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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (334) hide show
  1. package/LICENSE.md +6 -0
  2. package/README.md +1 -1
  3. package/__assets__/package-og.svg +1 -1
  4. package/dist/index.d.mts +1566 -0
  5. package/dist/index.d.ts +967 -803
  6. package/dist/index.mjs +1 -0
  7. package/dist/mount.d.mts +22 -0
  8. package/dist/mount.d.ts +11 -10
  9. package/dist/mount.mjs +1 -0
  10. package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -0
  11. package/dist/packem_chunks/ApiTab.mjs +1 -0
  12. package/dist/packem_chunks/AuditPanel.mjs +1 -0
  13. package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -0
  14. package/dist/packem_chunks/ExportImportPanel.mjs +3 -0
  15. package/dist/packem_chunks/FileBrowser.mjs +4 -0
  16. package/dist/packem_chunks/FunctionRunner.mjs +1 -0
  17. package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -0
  18. package/dist/packem_chunks/HealthPanel.mjs +1 -0
  19. package/dist/packem_chunks/InsightsPanel.mjs +1 -0
  20. package/dist/packem_chunks/LogsPanel.mjs +1 -0
  21. package/dist/packem_chunks/MailPanel.mjs +2 -0
  22. package/dist/packem_chunks/MetricsPanel.mjs +1 -0
  23. package/dist/packem_chunks/NotificationsPanel.mjs +1 -0
  24. package/dist/packem_chunks/PitrPanel.mjs +1 -0
  25. package/dist/packem_chunks/SchemaViewer.mjs +1 -0
  26. package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -0
  27. package/dist/packem_chunks/SettingsPanel.mjs +1 -0
  28. package/dist/packem_chunks/SqlEditorPanel.mjs +8 -0
  29. package/dist/packem_chunks/TableEditor.mjs +1 -0
  30. package/dist/packem_chunks/agents-panel.mjs +1 -0
  31. package/dist/packem_chunks/analytics-panel.mjs +1 -0
  32. package/dist/packem_chunks/auth-audit-panel.mjs +1 -0
  33. package/dist/packem_chunks/auth-config-panel.mjs +1 -0
  34. package/dist/packem_chunks/auth-sessions-panel.mjs +1 -0
  35. package/dist/packem_chunks/containers-panel.mjs +1 -0
  36. package/dist/packem_chunks/dashboards-panel.mjs +1 -0
  37. package/dist/packem_chunks/evals-panel.mjs +1 -0
  38. package/dist/packem_chunks/fanout-panel.mjs +1 -0
  39. package/dist/packem_chunks/flags-panel.mjs +1 -0
  40. package/dist/packem_chunks/issues-panel.mjs +1 -0
  41. package/dist/packem_chunks/kv-browser.mjs +1 -0
  42. package/dist/packem_chunks/log-drains-panel.mjs +4 -0
  43. package/dist/packem_chunks/migrations-route.mjs +1 -0
  44. package/dist/packem_chunks/organizations-panel.mjs +1 -0
  45. package/dist/packem_chunks/payments-panel.mjs +1 -0
  46. package/dist/packem_chunks/permissions-panel.mjs +1 -0
  47. package/dist/packem_chunks/queues-panel.mjs +1 -0
  48. package/dist/packem_chunks/reactors-panel.mjs +1 -0
  49. package/dist/packem_chunks/rls-panel.mjs +1 -0
  50. package/dist/packem_chunks/schedule-panel.mjs +1 -0
  51. package/dist/packem_chunks/sparkline.mjs +1 -0
  52. package/dist/packem_chunks/storage-rules-panel.mjs +1 -0
  53. package/dist/packem_chunks/subscriptions-panel.mjs +1 -0
  54. package/dist/packem_chunks/sync-client-panel.mjs +1 -0
  55. package/dist/packem_chunks/traces-panel.mjs +1 -0
  56. package/dist/packem_chunks/users-panel.mjs +1 -0
  57. package/dist/packem_chunks/vector-browser.mjs +1 -0
  58. package/dist/packem_chunks/workflows-panel.mjs +1 -0
  59. package/dist/packem_shared/ADMIN_FUNCTIONS-B8yyk5BX.mjs +1 -0
  60. package/dist/packem_shared/ApiDocsPanel-BImfQhyJ.mjs +2 -0
  61. package/dist/packem_shared/ApiReferencePanel-CigvHhCa.mjs +1 -0
  62. package/dist/packem_shared/CommandPalette-CSdz9zax.mjs +1 -0
  63. package/dist/packem_shared/ConfirmButton-DU4p72Er.mjs +1 -0
  64. package/dist/packem_shared/ConnectionBadge-B8Hj5DaE.mjs +1 -0
  65. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.mjs +1 -0
  66. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
  67. package/dist/packem_shared/DEFAULT_LOCALE-A1Yg5ORA.mjs +1 -0
  68. package/dist/packem_shared/DataBrowser-DLRa1EYq.mjs +4 -0
  69. package/dist/packem_shared/DataFilters-Cocu-WWE.mjs +1 -0
  70. package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
  71. package/dist/packem_shared/GlobalDataBrowser-BTbqR6Wc.mjs +1 -0
  72. package/dist/packem_shared/HomePanel-_BwLI4TQ.mjs +1 -0
  73. package/dist/packem_shared/MigrationsPanel-BPWzFdxC.mjs +1 -0
  74. package/dist/packem_shared/OpenRpcReferencePanel-C6CM791D.mjs +1 -0
  75. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
  76. package/dist/packem_shared/ScheduledJobs-B4DPADwk.mjs +1 -0
  77. package/dist/packem_shared/ShardInput-C6mjgAh4.mjs +1 -0
  78. package/dist/packem_shared/Studio-CcWQdYrV.mjs +1 -0
  79. package/dist/packem_shared/StudioApp-fYFz6zZQ.mjs +1 -0
  80. package/dist/packem_shared/StudioI18nProvider-fVsCSs5L.mjs +1 -0
  81. package/dist/packem_shared/advisor-view-CPgOok_h.mjs +1 -0
  82. package/dist/packem_shared/aggregateMetrics-CY05xrYU.mjs +1 -0
  83. package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
  84. package/dist/packem_shared/app.d-BbmO2HA2.d.mts +301 -0
  85. package/dist/packem_shared/app.d-BbmO2HA2.d.ts +301 -0
  86. package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
  87. package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
  88. package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
  89. package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
  90. package/dist/packem_shared/card--2hKx4L2.mjs +1 -0
  91. package/dist/packem_shared/cf-links-CBJ5SywP.mjs +1 -0
  92. package/dist/packem_shared/checkbox-CnS9cyCz.mjs +1 -0
  93. package/dist/packem_shared/control-button-BOZ5K-FC.mjs +1 -0
  94. package/dist/packem_shared/data-grid-DTBAKZlm.mjs +1 -0
  95. package/dist/packem_shared/data-view-params-qoSTqjAj.mjs +1 -0
  96. package/dist/packem_shared/dropdown-menu-jLZenfWH.mjs +2 -0
  97. package/dist/packem_shared/empty-state-D7jEML_T.mjs +1 -0
  98. package/dist/packem_shared/error-alert-tf5zvSLV.mjs +1 -0
  99. package/dist/packem_shared/grid-features-Dm80ngyR.mjs +6 -0
  100. package/dist/packem_shared/home-panel-DCUKd8Uk.mjs +3 -0
  101. package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
  102. package/dist/packem_shared/internal-B6haJbiP.mjs +2 -0
  103. package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
  104. package/dist/packem_shared/live-status-BuJdUZFU.mjs +1 -0
  105. package/dist/packem_shared/log-fields-SBxKyBug.mjs +1 -0
  106. package/dist/packem_shared/log-line-BoObzuue.mjs +1 -0
  107. package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
  108. package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
  109. package/dist/packem_shared/recording-client-BXUIyBL4.mjs +1 -0
  110. package/dist/packem_shared/reference-view-DiikOols.mjs +13 -0
  111. package/dist/packem_shared/schema-diagram-CDj_69jF.mjs +2 -0
  112. package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
  113. package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
  114. package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
  115. package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
  116. package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
  117. package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
  118. package/dist/packem_shared/sql-result-table-C5y0jwaK.mjs +1 -0
  119. package/dist/packem_shared/stat-card-D0Fe04cX.mjs +1 -0
  120. package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
  121. package/dist/packem_shared/studio-OqNyRY1N.mjs +2 -0
  122. package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
  123. package/dist/packem_shared/table-list-sidebar-DHG1UJC4.mjs +1 -0
  124. package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
  125. package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
  126. package/dist/packem_shared/use-admin-query-BKXiqLci.mjs +1 -0
  127. package/dist/packem_shared/use-async-submit-BTr3w2-K.mjs +1 -0
  128. package/dist/packem_shared/use-auth-config-CuM3eJZz.mjs +1 -0
  129. package/dist/packem_shared/use-open-trace-BCW0c9qq.mjs +1 -0
  130. package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
  131. package/dist/packem_shared/use-sql-assistant-BhIMDQHV.mjs +1 -0
  132. package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
  133. package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
  134. package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
  135. package/dist/packem_shared/wire-codec-Bk4XZGE4.mjs +1 -0
  136. package/dist/standalone/chunk-225VJ77I.js +1 -0
  137. package/dist/standalone/chunk-23C2QL7Z.js +8 -0
  138. package/dist/standalone/chunk-2DX5MROH.js +1 -0
  139. package/dist/standalone/chunk-2HFEYNGZ.js +1 -0
  140. package/dist/standalone/chunk-2URQKGWU.js +1 -0
  141. package/dist/standalone/chunk-35DM4JJG.js +1 -0
  142. package/dist/standalone/chunk-3CCIROFZ.js +1 -0
  143. package/dist/standalone/chunk-3FBLWUXD.js +1 -0
  144. package/dist/standalone/chunk-3NWLVUAS.js +1 -0
  145. package/dist/standalone/chunk-3Q2P62UR.js +1 -0
  146. package/dist/standalone/chunk-4ATHFUMH.js +1 -0
  147. package/dist/standalone/chunk-4C3MG76K.js +1 -0
  148. package/dist/standalone/chunk-4G53FSGN.js +1 -0
  149. package/dist/standalone/chunk-4GTO7FL5.js +1 -0
  150. package/dist/standalone/chunk-4JJEP7LF.js +1 -0
  151. package/dist/standalone/chunk-4JLGLPWV.js +1 -0
  152. package/dist/standalone/chunk-4KXVY5LG.js +1 -0
  153. package/dist/standalone/chunk-4L4WTGN5.js +1 -0
  154. package/dist/standalone/chunk-4ZEL6BYL.js +1 -0
  155. package/dist/standalone/chunk-54BDTYMC.js +1 -0
  156. package/dist/standalone/chunk-54S5V7YR.js +3 -0
  157. package/dist/standalone/chunk-55754F6H.js +1 -0
  158. package/dist/standalone/chunk-5JDWLCSH.js +1 -0
  159. package/dist/standalone/chunk-5R7DNF7C.js +4 -0
  160. package/dist/standalone/chunk-5WJXVZMZ.js +1 -0
  161. package/dist/standalone/chunk-5YNR3G3E.js +1 -0
  162. package/dist/standalone/chunk-5ZMBICI6.js +1 -0
  163. package/dist/standalone/chunk-66UGPQVC.js +1 -0
  164. package/dist/standalone/chunk-6D6Z2KXU.js +1 -0
  165. package/dist/standalone/chunk-6P3POBSU.js +1 -0
  166. package/dist/standalone/chunk-74LPCD76.js +1 -0
  167. package/dist/standalone/chunk-7NRK3UZ3.js +1 -0
  168. package/dist/standalone/chunk-A3JCPBOZ.js +1 -0
  169. package/dist/standalone/chunk-AAVLPU5Q.js +1 -0
  170. package/dist/standalone/chunk-AWHXPIXU.js +1 -0
  171. package/dist/standalone/chunk-BDO4YYBB.js +6 -0
  172. package/dist/standalone/chunk-BOTGXX4H.js +1 -0
  173. package/dist/standalone/chunk-C6T7K5XP.js +1 -0
  174. package/dist/standalone/chunk-CAHVOTZA.js +1 -0
  175. package/dist/standalone/chunk-CMA4PTV7.js +1 -0
  176. package/dist/standalone/chunk-COXVHN6E.js +1 -0
  177. package/dist/standalone/chunk-CSUROWL2.js +1 -0
  178. package/dist/standalone/chunk-CSZUHTON.js +1 -0
  179. package/dist/standalone/chunk-DNNWYXLD.js +1 -0
  180. package/dist/standalone/chunk-DTVF7X3F.js +1 -0
  181. package/dist/standalone/chunk-DX6FAHR2.js +1 -0
  182. package/dist/standalone/chunk-E7TOMONS.js +4 -0
  183. package/dist/standalone/chunk-EA2JKR5D.js +1 -0
  184. package/dist/standalone/chunk-EHADDOX7.js +1 -0
  185. package/dist/standalone/chunk-EVTM6Q43.js +1 -0
  186. package/dist/standalone/chunk-F7UC63UN.js +1 -0
  187. package/dist/standalone/chunk-FEWMAPNI.js +1 -0
  188. package/dist/standalone/chunk-FKVZRPV5.js +1 -0
  189. package/dist/standalone/chunk-FODLDLE2.js +19 -0
  190. package/dist/standalone/chunk-FPG5ZRPW.js +1 -0
  191. package/dist/standalone/chunk-FSRSK4LY.js +1 -0
  192. package/dist/standalone/chunk-FTOTZ5ZX.js +1 -0
  193. package/dist/standalone/chunk-G4PC65C6.js +1 -0
  194. package/dist/standalone/chunk-GGPSI4ZR.js +1 -0
  195. package/dist/standalone/chunk-GK2VTVJQ.js +1 -0
  196. package/dist/standalone/chunk-GMS77BZD.js +1 -0
  197. package/dist/standalone/chunk-GWFZ7WCP.js +1 -0
  198. package/dist/standalone/chunk-GZ3EDDP7.js +1 -0
  199. package/dist/standalone/chunk-HEAQVSNS.js +1 -0
  200. package/dist/standalone/chunk-HOIVU2H7.js +1 -0
  201. package/dist/standalone/chunk-HXXKZOZO.js +1 -0
  202. package/dist/standalone/chunk-IHMGCHAA.js +1 -0
  203. package/dist/standalone/chunk-IMOHEGMV.js +1 -0
  204. package/dist/standalone/chunk-IS6LVJ6L.js +1 -0
  205. package/dist/standalone/chunk-IWOLH2P2.js +1 -0
  206. package/dist/standalone/chunk-JBLAVREZ.js +1 -0
  207. package/dist/standalone/chunk-JWO4CGLV.js +5 -0
  208. package/dist/standalone/chunk-K7AJEMKE.js +1 -0
  209. package/dist/standalone/chunk-LBMSRD6N.js +1 -0
  210. package/dist/standalone/chunk-LG52A5TG.js +1 -0
  211. package/dist/standalone/chunk-LIEKK2VL.js +11 -0
  212. package/dist/standalone/chunk-LWT6QDJ3.js +1 -0
  213. package/dist/standalone/chunk-LYDV7Y4R.js +8 -0
  214. package/dist/standalone/chunk-MCTFHKVC.js +1 -0
  215. package/dist/standalone/chunk-MKL7VDTL.js +15 -0
  216. package/dist/standalone/chunk-MU3P2FI7.js +1 -0
  217. package/dist/standalone/chunk-MXLAOCAN.js +1 -0
  218. package/dist/standalone/chunk-OGUKYRFM.js +1 -0
  219. package/dist/standalone/chunk-OKG3HWSJ.js +1 -0
  220. package/dist/standalone/chunk-OMNXRJSM.js +1 -0
  221. package/dist/standalone/chunk-OZ5VOVBO.js +2 -0
  222. package/dist/standalone/chunk-P5RUFDVX.js +59 -0
  223. package/dist/standalone/chunk-PD6WIDY6.js +1 -0
  224. package/dist/standalone/chunk-PLHA3OWK.js +3 -0
  225. package/dist/standalone/chunk-Q4CAKBWN.js +1 -0
  226. package/dist/standalone/chunk-QBV3C2HK.js +1 -0
  227. package/dist/standalone/chunk-QKEJLVC5.js +1 -0
  228. package/dist/standalone/chunk-QUNKRCBP.js +1 -0
  229. package/dist/standalone/chunk-RDA5NLFX.js +1 -0
  230. package/dist/standalone/chunk-RFNGDE33.js +1 -0
  231. package/dist/standalone/chunk-RLLKECZT.js +1 -0
  232. package/dist/standalone/chunk-RPQL45FL.js +1 -0
  233. package/dist/standalone/chunk-S3CRZLGS.js +1 -0
  234. package/dist/standalone/chunk-SU5NQREA.js +1 -0
  235. package/dist/standalone/chunk-SUDJTC4S.js +1 -0
  236. package/dist/standalone/chunk-SV5XEZUN.js +1 -0
  237. package/dist/standalone/chunk-TIUMFAN2.js +1 -0
  238. package/dist/standalone/chunk-UCG3QPFD.js +1 -0
  239. package/dist/standalone/chunk-ULIQFBZU.js +1 -0
  240. package/dist/standalone/chunk-USCV7TYG.js +1 -0
  241. package/dist/standalone/chunk-UYEZR3BI.js +1 -0
  242. package/dist/standalone/chunk-V32I7IJL.js +3 -0
  243. package/dist/standalone/chunk-V3CZW3JB.js +1 -0
  244. package/dist/standalone/chunk-V3VJAA4D.js +1 -0
  245. package/dist/standalone/chunk-VMVIL7J7.js +1 -0
  246. package/dist/standalone/chunk-VOZRZLXT.js +1 -0
  247. package/dist/standalone/chunk-W3SCOCGB.js +1 -0
  248. package/dist/standalone/chunk-WBNKZBWC.js +1 -0
  249. package/dist/standalone/chunk-WUWBZPUK.js +1 -0
  250. package/dist/standalone/chunk-X7GEIRBP.js +1 -0
  251. package/dist/standalone/chunk-XT5WRPP2.js +1 -0
  252. package/dist/standalone/chunk-XZMOZFE6.js +1 -0
  253. package/dist/standalone/chunk-Y6CXU7T4.js +1 -0
  254. package/dist/standalone/chunk-YHLDMYGP.js +14 -0
  255. package/dist/standalone/chunk-YKXDMIHQ.js +1 -0
  256. package/dist/standalone/chunk-YOB2X3FZ.js +1 -0
  257. package/dist/standalone/chunk-YPRQLCKF.js +1 -0
  258. package/dist/standalone/chunk-YVVP4DRM.js +1 -0
  259. package/dist/standalone/chunk-ZOBUTUUF.js +1 -0
  260. package/dist/standalone/studio.js +9 -356
  261. package/dist/styles.css +2 -2
  262. package/package.json +24 -20
  263. package/dist/index.js +0 -41
  264. package/dist/mount.js +0 -26
  265. package/dist/packem_shared/ADMIN_FUNCTION_PREFIX-DmBqMZ-z.js +0 -45
  266. package/dist/packem_shared/ApiDocsPanel-DpRjJhG5.js +0 -842
  267. package/dist/packem_shared/ApiReferencePanel-DMIUp-kK.js +0 -229
  268. package/dist/packem_shared/ApiTab-DURGU15e.js +0 -251
  269. package/dist/packem_shared/AuditPanel-BC59Nhst.js +0 -212
  270. package/dist/packem_shared/CommandPalette-Dx_CoB9i.js +0 -373
  271. package/dist/packem_shared/ConfirmButton-WQVUoGFb.js +0 -59
  272. package/dist/packem_shared/ConnectionBadge-Bxagrip8.js +0 -111
  273. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
  274. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
  275. package/dist/packem_shared/DataBrowser-Coz6jJE6.js +0 -4542
  276. package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
  277. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
  278. package/dist/packem_shared/ExportImportPanel-WO34fJxy.js +0 -193
  279. package/dist/packem_shared/FileBrowser-Zcr-Qgxo.js +0 -2932
  280. package/dist/packem_shared/FunctionRunner-j0Rd5m9t.js +0 -343
  281. package/dist/packem_shared/FunctionStatsPanel-DboBl-XL.js +0 -432
  282. package/dist/packem_shared/GlobalDataBrowser-9MhPEfgN.js +0 -318
  283. package/dist/packem_shared/HealthPanel-DOIgbUtx.js +0 -640
  284. package/dist/packem_shared/HomePanel-bdOCNA-p.js +0 -1273
  285. package/dist/packem_shared/InsightsPanel-DaZPnSgt.js +0 -423
  286. package/dist/packem_shared/LogsPanel-CWdqAGpQ.js +0 -839
  287. package/dist/packem_shared/MailPanel-D_EGtDnS.js +0 -447
  288. package/dist/packem_shared/MetricsPanel-E4Gv6wTO.js +0 -1625
  289. package/dist/packem_shared/MigrationsPanel-DQdPY9io.js +0 -246
  290. package/dist/packem_shared/OpenRpcReferencePanel-j2p3HB0s.js +0 -191
  291. package/dist/packem_shared/PitrPanel-BbBkQR6t.js +0 -252
  292. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  293. package/dist/packem_shared/ScheduledJobs-Ok1CYYwI.js +0 -159
  294. package/dist/packem_shared/SchemaViewer-D8XGnp-X.js +0 -2512
  295. package/dist/packem_shared/SecurityAdvisorPanel-Cdm2IxLW.js +0 -79
  296. package/dist/packem_shared/SettingsPanel-D3WF2mBU.js +0 -176
  297. package/dist/packem_shared/ShardInput-DNCsT1KW.js +0 -107
  298. package/dist/packem_shared/SqlEditorPanel-BuQ7f2Hs.js +0 -13
  299. package/dist/packem_shared/Studio-D36od9Oz.js +0 -33
  300. package/dist/packem_shared/StudioApp-dvywkJ8I.js +0 -383
  301. package/dist/packem_shared/StudioI18nProvider-Dcajsznk.js +0 -48
  302. package/dist/packem_shared/TableEditor-DIVDk3vT.js +0 -371
  303. package/dist/packem_shared/advisor-view-DBlzJi6C.js +0 -159
  304. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  305. package/dist/packem_shared/app.d-CCmwDEVs.d.ts +0 -300
  306. package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
  307. package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
  308. package/dist/packem_shared/button-BhsN2uZH.js +0 -49
  309. package/dist/packem_shared/card-DURq3ElK.js +0 -175
  310. package/dist/packem_shared/cf-links-BZfRdxSE.js +0 -8
  311. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  312. package/dist/packem_shared/createStudioI18n-CgvlmDkN.js +0 -27
  313. package/dist/packem_shared/data-grid-CCh2Couo.js +0 -183
  314. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  315. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  316. package/dist/packem_shared/grid-features-DTjG6Sex.js +0 -840
  317. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  318. package/dist/packem_shared/internal-BBZYexre.js +0 -68
  319. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  320. package/dist/packem_shared/live-status-bPff1O7Y.js +0 -44
  321. package/dist/packem_shared/reference-view-BCKIoai7.js +0 -2180
  322. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  323. package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
  324. package/dist/packem_shared/sql-editor-panel-CW2y2x9h.js +0 -2562
  325. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  326. package/dist/packem_shared/studio-BDVd7rIV.js +0 -10303
  327. package/dist/packem_shared/table-_RzNvy3R.js +0 -246
  328. package/dist/packem_shared/table-list-sidebar-aZHLq70w.js +0 -832
  329. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  330. package/dist/packem_shared/use-live-admin-D1h1Fzsd.js +0 -73
  331. package/dist/packem_shared/use-live-shard-seed-B74RYcOy.js +0 -76
  332. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  333. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  334. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
@@ -0,0 +1 @@
1
+ import{a as f}from"./chunk-YKXDMIHQ.js";function S(e,r,t){e.prototype=r.prototype=t,t.constructor=e}f(S,"default");function W(e,r){var t=Object.create(e.prototype);for(var n in r)t[n]=r[n];return t}f(W,"extend");function B(){}f(B,"Color");var C=.7,Y=1/C,R="\\s*([+-]?\\d+)\\s*",E="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",y="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xe=/^#([0-9a-f]{3,8})$/,Se=new RegExp(`^rgb\\(${R},${R},${R}\\)$`),Ce=new RegExp(`^rgb\\(${y},${y},${y}\\)$`),Ee=new RegExp(`^rgba\\(${R},${R},${R},${E}\\)$`),Be=new RegExp(`^rgba\\(${y},${y},${y},${E}\\)$`),Ie=new RegExp(`^hsl\\(${E},${y},${y}\\)$`),_e=new RegExp(`^hsla\\(${E},${y},${y},${E}\\)$`),se={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};S(B,v,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:le,formatHex:le,formatHex8:je,formatHsl:Ye,formatRgb:ue,toString:ue});function le(){return this.rgb().formatHex()}f(le,"color_formatHex");function je(){return this.rgb().formatHex8()}f(je,"color_formatHex8");function Ye(){return ge(this).formatHsl()}f(Ye,"color_formatHsl");function ue(){return this.rgb().formatRgb()}f(ue,"color_formatRgb");function v(e){var r,t;return e=(e+"").trim().toLowerCase(),(r=Xe.exec(e))?(t=r[1].length,r=parseInt(r[1],16),t===6?xe(r):t===3?new d(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):t===8?_(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):t===4?_(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=Se.exec(e))?new d(r[1],r[2],r[3],1):(r=Ce.exec(e))?new d(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Ee.exec(e))?_(r[1],r[2],r[3],r[4]):(r=Be.exec(e))?_(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Ie.exec(e))?he(r[1],r[2]/100,r[3]/100,1):(r=_e.exec(e))?he(r[1],r[2]/100,r[3]/100,r[4]):se.hasOwnProperty(e)?xe(se[e]):e==="transparent"?new d(NaN,NaN,NaN,0):null}f(v,"color");function xe(e){return new d(e>>16&255,e>>8&255,e&255,1)}f(xe,"rgbn");function _(e,r,t,n){return n<=0&&(e=r=t=NaN),new d(e,r,t,n)}f(_,"rgba");function Le(e){return e instanceof B||(e=v(e)),e?(e=e.rgb(),new d(e.r,e.g,e.b,e.opacity)):new d}f(Le,"rgbConvert");function H(e,r,t,n){return arguments.length===1?Le(e):new d(e,r,t,n??1)}f(H,"rgb");function d(e,r,t,n){this.r=+e,this.g=+r,this.b=+t,this.opacity=+n}f(d,"Rgb");S(d,H,W(B,{brighter(e){return e=e==null?Y:Math.pow(Y,e),new d(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?C:Math.pow(C,e),new d(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new d(k(this.r),k(this.g),k(this.b),L(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ce,formatHex:ce,formatHex8:Te,formatRgb:pe,toString:pe}));function ce(){return`#${N(this.r)}${N(this.g)}${N(this.b)}`}f(ce,"rgb_formatHex");function Te(){return`#${N(this.r)}${N(this.g)}${N(this.b)}${N((isNaN(this.opacity)?1:this.opacity)*255)}`}f(Te,"rgb_formatHex8");function pe(){let e=L(this.opacity);return`${e===1?"rgb(":"rgba("}${k(this.r)}, ${k(this.g)}, ${k(this.b)}${e===1?")":`, ${e})`}`}f(pe,"rgb_formatRgb");function L(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}f(L,"clampa");function k(e){return Math.max(0,Math.min(255,Math.round(e)||0))}f(k,"clampi");function N(e){return e=k(e),(e<16?"0":"")+e.toString(16)}f(N,"hex");function he(e,r,t,n){return n<=0?e=r=t=NaN:t<=0||t>=1?e=r=NaN:r<=0&&(e=NaN),new w(e,r,t,n)}f(he,"hsla");function ge(e){if(e instanceof w)return new w(e.h,e.s,e.l,e.opacity);if(e instanceof B||(e=v(e)),!e)return new w;if(e instanceof w)return e;e=e.rgb();var r=e.r/255,t=e.g/255,n=e.b/255,i=Math.min(r,t,n),o=Math.max(r,t,n),a=NaN,s=o-i,x=(o+i)/2;return s?(r===o?a=(t-n)/s+(t<n)*6:t===o?a=(n-r)/s+2:a=(r-t)/s+4,s/=x<.5?o+i:2-o-i,a*=60):s=x>0&&x<1?0:a,new w(a,s,x,e.opacity)}f(ge,"hslConvert");function me(e,r,t,n){return arguments.length===1?ge(e):new w(e,r,t,n??1)}f(me,"hsl");function w(e,r,t,n){this.h=+e,this.s=+r,this.l=+t,this.opacity=+n}f(w,"Hsl");S(w,me,W(B,{brighter(e){return e=e==null?Y:Math.pow(Y,e),new w(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?C:Math.pow(C,e),new w(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*r,i=2*t-n;return new d(Z(e>=240?e-240:e+120,i,n),Z(e,i,n),Z(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new w(de(this.h),j(this.s),j(this.l),L(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=L(this.opacity);return`${e===1?"hsl(":"hsla("}${de(this.h)}, ${j(this.s)*100}%, ${j(this.l)*100}%${e===1?")":`, ${e})`}`}}));function de(e){return e=(e||0)%360,e<0?e+360:e}f(de,"clamph");function j(e){return Math.max(0,Math.min(1,e||0))}f(j,"clampt");function Z(e,r,t){return(e<60?r+(t-r)*e/60:e<180?t:e<240?r+(t-r)*(240-e)/60:r)*255}f(Z,"hsl2rgb");function F(e,r,t,n,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*r+(4-6*o+3*a)*t+(1+3*e+3*o-3*a)*n+a*i)/6}f(F,"basis");function J(e){var r=e.length-1;return function(t){var n=t<=0?t=0:t>=1?(t=1,r-1):Math.floor(t*r),i=e[n],o=e[n+1],a=n>0?e[n-1]:2*i-o,s=n<r-1?e[n+2]:2*o-i;return F((t-n/r)*r,a,i,o,s)}}f(J,"default");function U(e){var r=e.length;return function(t){var n=Math.floor(((t%=1)<0?++t:t)*r),i=e[(n+r-1)%r],o=e[n%r],a=e[(n+1)%r],s=e[(n+2)%r];return F((t-n/r)*r,i,o,a,s)}}f(U,"default");var I=f(e=>()=>e,"default");function De(e,r){return function(t){return e+t*r}}f(De,"linear");function Oe(e,r,t){return e=Math.pow(e,t),r=Math.pow(r,t)-e,t=1/t,function(n){return Math.pow(e+n*r,t)}}f(Oe,"exponential");function be(e){return(e=+e)==1?T:function(r,t){return t-r?Oe(r,t,e):I(isNaN(r)?t:r)}}f(be,"gamma");function T(e,r){var t=r-e;return t?De(e,t):I(isNaN(e)?r:e)}f(T,"nogamma");var D=f((function e(r){var t=be(r);function n(i,o){var a=t((i=H(i)).r,(o=H(o)).r),s=t(i.g,o.g),x=t(i.b,o.b),l=T(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=x(u),i.opacity=l(u),i+""}}return f(n,"rgb"),n.gamma=e,n}),"rgbGamma")(1);function we(e){return function(r){var t=r.length,n=new Array(t),i=new Array(t),o=new Array(t),a,s;for(a=0;a<t;++a)s=H(r[a]),n[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return n=e(n),i=e(i),o=e(o),s.opacity=1,function(x){return s.r=n(x),s.g=i(x),s.b=o(x),s+""}}}f(we,"rgbSpline");var ze=we(J),Pe=we(U);function ee(e,r){r||(r=[]);var t=e?Math.min(r.length,e.length):0,n=r.slice(),i;return function(o){for(i=0;i<t;++i)n[i]=e[i]*(1-o)+r[i]*o;return n}}f(ee,"default");function ye(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}f(ye,"isNumberArray");function ve(e,r){var t=r?r.length:0,n=e?Math.min(t,e.length):0,i=new Array(n),o=new Array(t),a;for(a=0;a<n;++a)i[a]=M(e[a],r[a]);for(;a<t;++a)o[a]=r[a];return function(s){for(a=0;a<n;++a)o[a]=i[a](s);return o}}f(ve,"genericArray");function re(e,r){var t=new Date;return e=+e,r=+r,function(n){return t.setTime(e*(1-n)+r*n),t}}f(re,"default");function g(e,r){return e=+e,r=+r,function(t){return e*(1-t)+r*t}}f(g,"default");function te(e,r){var t={},n={},i;(e===null||typeof e!="object")&&(e={}),(r===null||typeof r!="object")&&(r={});for(i in r)i in e?t[i]=M(e[i],r[i]):n[i]=r[i];return function(o){for(i in t)n[i]=t[i](o);return n}}f(te,"default");var fe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ne=new RegExp(fe.source,"g");function Ve(e){return function(){return e}}f(Ve,"zero");function Qe(e){return function(r){return e(r)+""}}f(Qe,"one");function O(e,r){var t=fe.lastIndex=ne.lastIndex=0,n,i,o,a=-1,s=[],x=[];for(e=e+"",r=r+"";(n=fe.exec(e))&&(i=ne.exec(r));)(o=i.index)>t&&(o=r.slice(t,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,x.push({i:a,x:g(n,i)})),t=ne.lastIndex;return t<r.length&&(o=r.slice(t),s[a]?s[a]+=o:s[++a]=o),s.length<2?x[0]?Qe(x[0].x):Ve(r):(r=x.length,function(l){for(var u=0,c;u<r;++u)s[(c=x[u]).i]=c.x(l);return s.join("")})}f(O,"default");function M(e,r){var t=typeof r,n;return r==null||t==="boolean"?I(r):(t==="number"?g:t==="string"?(n=v(r))?(r=n,D):O:r instanceof v?D:r instanceof Date?re:ye(r)?ee:Array.isArray(r)?ve:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?te:g)(e,r)}f(M,"default");var Ge=1e-12;function Me(e){return((e=Math.exp(e))+1/e)/2}f(Me,"cosh");function Ke(e){return((e=Math.exp(e))-1/e)/2}f(Ke,"sinh");function We(e){return((e=Math.exp(2*e))-1)/(e+1)}f(We,"tanh");var Ze=f((function e(r,t,n){function i(o,a){var s=o[0],x=o[1],l=o[2],u=a[0],c=a[1],p=a[2],h=u-s,b=c-x,m=h*h+b*b,$,A;if(m<Ge)A=Math.log(p/l)/r,$=f(function(X){return[s+X*h,x+X*b,l*Math.exp(r*X*A)]},"i");else{var Q=Math.sqrt(m),G=(p*p-l*l+n*m)/(2*l*t*Q),K=(p*p-l*l-n*m)/(2*p*t*Q),q=Math.log(Math.sqrt(G*G+1)-G),qe=Math.log(Math.sqrt(K*K+1)-K);A=(qe-q)/r,$=f(function(X){var ie=X*A,ae=Me(q),oe=l/(t*Q)*(ae*We(r*ie+q)-Ke(q));return[s+oe*h,x+oe*b,l*ae/Me(r*ie+q)]},"i")}return $.duration=A*1e3*r/Math.SQRT2,$}return f(i,"zoom"),i.rho=function(o){var a=Math.max(.001,+o),s=a*a,x=s*s;return e(a,s,x)},i}),"zoomRho")(Math.SQRT2,2,4);function $e(e,r){return e=+e,r=+r,function(t){return Math.round(e*(1-t)+r*t)}}f($e,"default");var Ne=180/Math.PI,z={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function P(e,r,t,n,i,o){var a,s,x;return(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a),(x=e*t+r*n)&&(t-=e*x,n-=r*x),(s=Math.sqrt(t*t+n*n))&&(t/=s,n/=s,x/=s),e*n<r*t&&(e=-e,r=-r,x=-x,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(r,e)*Ne,skewX:Math.atan(x)*Ne,scaleX:a,scaleY:s}}f(P,"default");var V;function ke(e){let r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return r.isIdentity?z:P(r.a,r.b,r.c,r.d,r.e,r.f)}f(ke,"parseCss");function Re(e){return e==null?z:(V||(V=document.createElementNS("http://www.w3.org/2000/svg","g")),V.setAttribute("transform",e),(e=V.transform.baseVal.consolidate())?(e=e.matrix,P(e.a,e.b,e.c,e.d,e.e,e.f)):z)}f(Re,"parseSvg");function He(e,r,t,n){function i(l){return l.length?l.pop()+" ":""}f(i,"pop");function o(l,u,c,p,h,b){if(l!==c||u!==p){var m=h.push("translate(",null,r,null,t);b.push({i:m-4,x:g(l,c)},{i:m-2,x:g(u,p)})}else(c||p)&&h.push("translate("+c+r+p+t)}f(o,"translate");function a(l,u,c,p){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),p.push({i:c.push(i(c)+"rotate(",null,n)-2,x:g(l,u)})):u&&c.push(i(c)+"rotate("+u+n)}f(a,"rotate");function s(l,u,c,p){l!==u?p.push({i:c.push(i(c)+"skewX(",null,n)-2,x:g(l,u)}):u&&c.push(i(c)+"skewX("+u+n)}f(s,"skewX");function x(l,u,c,p,h,b){if(l!==c||u!==p){var m=h.push(i(h)+"scale(",null,",",null,")");b.push({i:m-4,x:g(l,c)},{i:m-2,x:g(u,p)})}else(c!==1||p!==1)&&h.push(i(h)+"scale("+c+","+p+")")}return f(x,"scale"),function(l,u){var c=[],p=[];return l=e(l),u=e(u),o(l.translateX,l.translateY,u.translateX,u.translateY,c,p),a(l.rotate,u.rotate,c,p),s(l.skewX,u.skewX,c,p),x(l.scaleX,l.scaleY,u.scaleX,u.scaleY,c,p),l=u=null,function(h){for(var b=-1,m=p.length,$;++b<m;)c[($=p[b]).i]=$.x(h);return c.join("")}}}f(He,"interpolateTransform");var Fe=He(ke,"px, ","px)","deg)"),Je=He(Re,", ",")",")");function Ae(e,r){r===void 0&&(r=e,e=M);for(var t=0,n=r.length-1,i=r[0],o=new Array(n<0?0:n);t<n;)o[t]=e(i,i=r[++t]);return function(a){var s=Math.max(0,Math.min(n-1,Math.floor(a*=n)));return o[s](a-s)}}f(Ae,"piecewise");export{v as a,D as b,g as c,O as d,M as e,$e as f,Fe as g,Je as h,Ze as i,Ae as j};
@@ -0,0 +1,4 @@
1
+ import{d as Le}from"./chunk-BDO4YYBB.js";import{c as _e}from"./chunk-UYEZR3BI.js";import"./chunk-RFNGDE33.js";import"./chunk-V3CZW3JB.js";import"./chunk-MU3P2FI7.js";import{a as ye}from"./chunk-3FBLWUXD.js";import"./chunk-XZMOZFE6.js";import{a as Ee}from"./chunk-66UGPQVC.js";import"./chunk-YPRQLCKF.js";import"./chunk-GMS77BZD.js";import"./chunk-3Q2P62UR.js";import"./chunk-AWHXPIXU.js";import"./chunk-V3VJAA4D.js";import{a as Oe}from"./chunk-PD6WIDY6.js";import{a as Te}from"./chunk-2DX5MROH.js";import"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import{W as Ce}from"./chunk-PLHA3OWK.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import{a as te}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as ae}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as be}from"./chunk-4ZEL6BYL.js";import{f as Se}from"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as he}from"./chunk-FKVZRPV5.js";import{a as $e,b as Ke,c as Fe,d as ie,e as re,f as ee}from"./chunk-HEAQVSNS.js";import{a as je,e as ze}from"./chunk-WUWBZPUK.js";import{d as Ne,f as me,g as pe,h as Q,l as ge,o as W,q as De}from"./chunk-FODLDLE2.js";import{a as m,d as fe,e as mt,f as pt,g as gt}from"./chunk-YKXDMIHQ.js";var M=fe(pt(),1),z=fe(mt(),1);var o=fe(gt(),1);var Ue=m((d,e,t)=>{let{onCopy:r,onDelete:l,onDownload:n,onToggleSelect:c}=t,i=m(()=>{r(d.key)},"c"),s=m(()=>{n(d.key)},"o"),u=m(()=>{l(d.key)},"f"),h=m(()=>{c(d.key)},"h");return{copy:i,download:s,name:d.key.slice(e.length),remove:u,toggle:h}},"Ee"),Me=m(d=>{let e=(0,M.c)(31),{busy:t,buttonClassName:r,copied:l,objectKey:n,onCopy:c,onDelete:i,onDownload:s,t:u}=d,h=`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 p;e[3]!==t||e[4]!==r||e[5]!==c||e[6]!==h||e[7]!==f?(p=(0,o.jsx)(te,{className:r,"data-testid":h,disabled:t,onClick:c,size:"sm",type:"button",variant:"ghost",children:f}),e[3]=t,e[4]=r,e[5]=c,e[6]=h,e[7]=f,e[8]=p):p=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)(te,{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 N;e[17]!==u?(N=u("Delete object?"),e[17]=u,e[18]=N):N=e[18];let v=`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]!==N||e[24]!==v||e[25]!==b?(y=(0,o.jsx)(Oe,{confirmLabel:N,disabled:t,onConfirm:i,testId:v,children:b}),e[21]=t,e[22]=i,e[23]=N,e[24]=v,e[25]=b,e[26]=y):y=e[26];let x;return e[27]!==y||e[28]!==p||e[29]!==k?(x=(0,o.jsxs)(o.Fragment,{children:[p,k,y]}),e[27]=y,e[28]=p,e[29]=k,e[30]=x):x=e[30],x},"$e"),Ae=m(d=>{let e=(0,M.c)(14),{objectKey:t,references:r,t:l}=d;if(r===void 0)return null;if(r.length===0){let h=`storage-orphan-${t}`,f;e[0]!==l?(f=l("Orphan"),e[0]=l,e[1]=f):f=e[1];let p;return e[2]!==h||e[3]!==f?(p=(0,o.jsx)(ae,{"data-testid":h,variant:"warning",children:f}),e[2]=h,e[3]=f,e[4]=p):p=e[4],p}let n;e[5]!==r?(n=r.map(bt).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},"Fe"),Pe=m(d=>{let e=(0,M.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)(ye,{"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},"Re");function bt(d){return`${d.table}\xB7${d.id}`}m(bt,"yt");var yt=m(d=>{let e=(0,M.c)(10),{colSpan:t,name:r,onEnter:l}=d,n;e[0]!==r||e[1]!==l?(n=m(()=>{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)(ie,{children:(0,o.jsx)(ee,{colSpan:t,children:s})}),e[7]=t,e[8]=s,e[9]=u):u=e[9],u},"xt"),xt=m(d=>{let e=(0,M.c)(37),{busy:t,copiedKey:r,handlers:l,object:n,prefix:c,references:i,selected:s,showReferences:u,t:h}=d,f;e[0]!==l||e[1]!==n||e[2]!==c?(f=Ue(n,c,l),e[0]=l,e[1]=n,e[2]=c,e[3]=f):f=e[3];let{copy:p,download:w,name:a,remove:k,toggle:N}=f,v;e[4]!==n.key||e[5]!==s||e[6]!==h||e[7]!==N?(v=(0,o.jsx)(ee,{className:"w-8",children:(0,o.jsx)(Pe,{objectKey:n.key,onToggle:N,selected:s,t:h})}),e[4]=n.key,e[5]=s,e[6]=h,e[7]=N,e[8]=v):v=e[8];let b;e[9]!==a?(b=(0,o.jsx)(ee,{className:"font-mono text-xs",children:a}),e[9]=a,e[10]=b):b=e[10];let y;e[11]!==n.size?(y=ge(n.size),e[11]=n.size,e[12]=y):y=e[12];let x;e[13]!==y?(x=(0,o.jsx)(ee,{className:"tabular-nums text-muted-foreground",children:y}),e[13]=y,e[14]=x):x=e[14];let j=n.httpMetadata?.contentType??"",S;e[15]!==j?(S=(0,o.jsx)(ee,{children:j}),e[15]=j,e[16]=S):S=e[16];let C;e[17]!==n.key||e[18]!==i||e[19]!==u||e[20]!==h?(C=u&&(0,o.jsx)(ee,{children:(0,o.jsx)(Ae,{objectKey:n.key,references:i,t:h})}),e[17]=n.key,e[18]=i,e[19]=u,e[20]=h,e[21]=C):C=e[21];let T=r===n.key,D;e[22]!==t||e[23]!==p||e[24]!==w||e[25]!==n.key||e[26]!==k||e[27]!==h||e[28]!==T?(D=(0,o.jsx)(ee,{className:"text-right",children:(0,o.jsx)("span",{className:"inline-flex items-center gap-1",children:(0,o.jsx)(Me,{busy:t,copied:T,objectKey:n.key,onCopy:p,onDelete:k,onDownload:w,t:h})})}),e[22]=t,e[23]=p,e[24]=w,e[25]=n.key,e[26]=k,e[27]=h,e[28]=T,e[29]=D):D=e[29];let F;return e[30]!==D||e[31]!==v||e[32]!==b||e[33]!==x||e[34]!==S||e[35]!==C?(F=(0,o.jsxs)(ie,{"data-testid":"fb-row",children:[v,b,x,S,C,D]}),e[30]=D,e[31]=v,e[32]=b,e[33]=x,e[34]=S,e[35]=C,e[36]=F):F=e[36],F},"vt"),vt=m(d=>{let e=(0,M.c)(65),{allSelected:t,busy:r,copiedKey:l,files:n,folders:c,handlers:i,onEnterFolder:s,prefix:u,references:h,selected:f,showReferences:p,someSelected:w,t:a,toggleSelectAll:k}=d,N;e[0]!==a?(N=a("Select all rows"),e[0]=a,e[1]=N):N=e[1];let v;e[2]!==t||e[3]!==w||e[4]!==N||e[5]!==k?(v=(0,o.jsx)(re,{className:"w-8",children:(0,o.jsx)(ye,{"aria-label":N,checked:t,"data-testid":"storage-select-all",indeterminate:w,onCheckedChange:k})}),e[2]=t,e[3]=w,e[4]=N,e[5]=k,e[6]=v):v=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)(re,{children:b}),e[9]=b,e[10]=y):y=e[10];let x;e[11]!==a?(x=a("size"),e[11]=a,e[12]=x):x=e[12];let j;e[13]!==x?(j=(0,o.jsx)(re,{children:x}),e[13]=x,e[14]=j):j=e[14];let S;e[15]!==a?(S=a("content-type"),e[15]=a,e[16]=S):S=e[16];let C;e[17]!==S?(C=(0,o.jsx)(re,{children:S}),e[17]=S,e[18]=C):C=e[18];let T;e[19]!==p||e[20]!==a?(T=p&&(0,o.jsx)(re,{children:a("used by")}),e[19]=p,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)(re,{"aria-label":D}),e[24]=D,e[25]=F):F=e[25];let $;e[26]!==F||e[27]!==v||e[28]!==y||e[29]!==j||e[30]!==C||e[31]!==T?($=(0,o.jsx)(Ke,{children:(0,o.jsxs)(ie,{children:[v,y,j,C,T,F]})}),e[26]=F,e[27]=v,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]!==p){let E;e[37]!==s||e[38]!==p?(E=m(_=>(0,o.jsx)(yt,{colSpan:p?6:5,name:_,onEnter:s},_),"D"),e[37]=s,e[38]=p,e[39]=E):E=e[39],O=c.map(E),e[33]=c,e[34]=s,e[35]=p,e[36]=O}else O=e[36];let B;if(e[40]!==r||e[41]!==l||e[42]!==n||e[43]!==i||e[44]!==u||e[45]!==h||e[46]!==f||e[47]!==p||e[48]!==a){let E;e[50]!==r||e[51]!==l||e[52]!==i||e[53]!==u||e[54]!==h||e[55]!==f||e[56]!==p||e[57]!==a?(E=m(_=>(0,o.jsx)(xt,{busy:r,copiedKey:l,handlers:i,object:_,prefix:u,references:h[_.key],selected:f.has(_.key),showReferences:p,t:a},_.key),"D"),e[50]=r,e[51]=l,e[52]=i,e[53]=u,e[54]=h,e[55]=f,e[56]=p,e[57]=a,e[58]=E):E=e[58],B=n.map(E),e[40]=r,e[41]=l,e[42]=n,e[43]=i,e[44]=u,e[45]=h,e[46]=f,e[47]=p,e[48]=a,e[49]=B}else B=e[49];let L;e[59]!==O||e[60]!==B?(L=(0,o.jsxs)(Fe,{children:[O,B]}),e[59]=O,e[60]=B,e[61]=L):L=e[61];let I;return e[62]!==$||e[63]!==L?(I=(0,o.jsx)(je,{className:"overflow-hidden py-0",children:(0,o.jsx)(ze,{className:"px-0",children:(0,o.jsxs)($e,{"data-testid":"fb-table",children:[$,L]})})}),e[62]=$,e[63]=L,e[64]=I):I=e[64],I},"kt"),kt=[{label:"15m",seconds:900},{label:"1h",seconds:3600},{label:"24h",seconds:86400},{label:"7d",seconds:604800}],wt=3600,Be=m((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},"ve"),St=m((d,e,t)=>{let r=t==="desc"?-1:1;return d.toSorted((l,n)=>{let c=Be(l,e),i=Be(n,e);return(typeof c=="number"&&typeof i=="number"?c-i:String(c).localeCompare(String(i)))*r})},"Ct"),Nt=m((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))}},"Nt"),Ct=m(d=>{let e=(0,M.c)(59),{bucket:t,buckets:r,busy:l,draftPrefix:n,expiry:c,fileInputRef:i,onBucketChange:s,onExpiryChange:u,onFileChange:h,onList:f,onPrefixChange:p,onUploadClick:w,t:a}=d,k;e[0]!==p?(k=m(P=>{p(P.target.value)},"v"),e[0]=p,e[1]=k):k=e[1];let N=k,v;e[2]!==s?(v=m(P=>{s(P.target.value)},"x"),e[2]=s,e[3]=v):v=e[3];let b=v,y;e[4]!==u?(y=m(P=>{u(Number.parseInt(P.target.value,10))},"b"),e[4]=u,e[5]=y):y=e[5];let x=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(zt)}),e[6]=t,e[7]=r,e[8]=b,e[9]=a,e[10]=j):j=e[10];let S;e[11]!==a?(S=a("Key prefix"),e[11]=a,e[12]=S):S=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]!==N||e[17]!==S||e[18]!==C?(T=(0,o.jsx)(Ce,{"aria-label":S,className:"h-8 w-64 max-w-full","data-testid":"fb-prefix-input",onChange:N,placeholder:C,value:n}),e[15]=n,e[16]=N,e[17]=S,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)(te,{"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)(te,{"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 B;e[33]!==i||e[34]!==h?(B=(0,o.jsx)("input",{className:"hidden","data-testid":"storage-file-input",onChange:h,ref:i,type:"file"}),e[33]=i,e[34]=h,e[35]=B):B=e[35];let L;e[36]!==a?(L=a("Link expiry"),e[36]=a,e[37]=L):L=e[37];let I;e[38]!==a?(I=kt.map(P=>(0,o.jsx)("option",{value:P.seconds,children:a(P.label)},P.seconds)),e[38]=a,e[39]=I):I=e[39];let E;e[40]!==c||e[41]!==x||e[42]!==I?(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:x,value:c,children:I}),e[40]=c,e[41]=x,e[42]=I,e[43]=E):E=e[43];let _;e[44]!==L||e[45]!==E?(_=(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]=_):_=e[46];let U;e[47]!==a?(U=a("Open in Cloudflare"),e[47]=a,e[48]=U):U=e[48];let A;e[49]!==U?(A=(0,o.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"fb-cf-link",href:_e,rel:"noreferrer",target:"_blank",children:U}),e[49]=U,e[50]=A):A=e[50];let H;return e[51]!==O||e[52]!==B||e[53]!==_||e[54]!==A||e[55]!==j||e[56]!==T||e[57]!==F?(H=(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[j,T,F,O,B,_,A]}),e[51]=O,e[52]=B,e[53]=_,e[54]=A,e[55]=j,e[56]=T,e[57]=F,e[58]=H):H=e[58],H},"Tt"),jt=m(d=>{let e=(0,M.c)(66),{onSortKeyChange:t,onThumbSizeChange:r,showGrid:l,showList:n,sortDirection:c,sortKey:i,t:s,tagKeys:u,thumbSize:h,toggleSortDirection:f,view:p}=d,w;e[0]!==t?(w=m(G=>{t(G.target.value)},"k"),e[0]=t,e[1]=w):w=e[1];let a=w,k;e[2]!==r?(k=m(G=>{r(Number.parseInt(G.target.value,10))},"v"),e[2]=r,e[3]=k):k=e[3];let N=k,v=p==="list",b;e[4]!==s?(b=s("List"),e[4]=s,e[5]=b):b=e[5];let y;e[6]!==n||e[7]!==v||e[8]!==b?(y=(0,o.jsx)("button",{"aria-pressed":v,className:"px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-list",onClick:n,type:"button",children:b}),e[6]=n,e[7]=v,e[8]=b,e[9]=y):y=e[9];let x=p==="grid",j;e[10]!==s?(j=s("Grid"),e[10]=s,e[11]=j):j=e[11];let S;e[12]!==l||e[13]!==x||e[14]!==j?(S=(0,o.jsx)("button",{"aria-pressed":x,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]=x,e[14]=j,e[15]=S):S=e[15];let C;e[16]!==y||e[17]!==S?(C=(0,o.jsxs)("div",{className:"inline-flex overflow-hidden rounded-md border border-border",children:[y,S]}),e[16]=y,e[17]=S,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 B;e[29]!==s?(B=s("Type"),e[29]=s,e[30]=B):B=e[30];let L;e[31]!==B?(L=(0,o.jsx)("option",{value:"type",children:B}),e[31]=B,e[32]=L):L=e[32];let I;e[33]!==s?(I=s("Modified"),e[33]=s,e[34]=I):I=e[34];let E;e[35]!==I?(E=(0,o.jsx)("option",{value:"date",children:I}),e[35]=I,e[36]=E):E=e[36];let _;e[37]!==u?(_=u.map(Dt),e[37]=u,e[38]=_):_=e[38];let U;e[39]!==a||e[40]!==i||e[41]!==F||e[42]!==O||e[43]!==L||e[44]!==E||e[45]!==_?(U=(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,_]}),e[39]=a,e[40]=i,e[41]=F,e[42]=O,e[43]=L,e[44]=E,e[45]=_,e[46]=U):U=e[46];let A;e[47]!==T||e[48]!==U?(A=(0,o.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-sort",children:[T,U]}),e[47]=T,e[48]=U,e[49]=A):A=e[49];let H;e[50]!==s?(H=s("Toggle sort direction"),e[50]=s,e[51]=H):H=e[51];let P=c==="asc"?"\u2191":"\u2193",q;e[52]!==H||e[53]!==P||e[54]!==f?(q=(0,o.jsx)("button",{"aria-label":H,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:P}),e[52]=H,e[53]=P,e[54]=f,e[55]=q):q=e[55];let Y;e[56]!==N||e[57]!==s||e[58]!==h||e[59]!==p?(Y=p==="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:N,step:8,type:"range",value:h})]}),e[56]=N,e[57]=s,e[58]=h,e[59]=p,e[60]=Y):Y=e[60];let ne;return e[61]!==A||e[62]!==q||e[63]!==Y||e[64]!==C?(ne=(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs","data-testid":"fb-controls",children:[C,A,q,Y]}),e[61]=A,e[62]=q,e[63]=Y,e[64]=C,e[65]=ne):ne=e[65],ne},"_t");function zt(d){return(0,o.jsx)("option",{value:d,children:d},d)}m(zt,"Et");function Dt(d){return(0,o.jsx)("option",{value:`tag:${d}`,children:d},d)}m(Dt,"$t");var Tt=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,$t=m(d=>(d.httpMetadata?.contentType??"").startsWith("image/")||Tt.test(d.key),"Rt"),Kt=m(()=>{let d=(0,M.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},"zt"),Ft=m(d=>{let e=(0,M.c)(13),{object:t,resolveUrl:r}=d,[l,n]=(0,z.useState)(null),[c,i]=(0,z.useState)(!1),s;e[0]!==t?(s=$t(t),e[0]=t,e[1]=s):s=e[1];let u=s,h,f;e[2]!==u||e[3]!==t.key||e[4]!==r?(h=m(()=>{if(!u)return;let k={cancelled:!1};return W((async()=>{try{let N=await r(t.key);k.cancelled||n(N)}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]=h,e[6]=f):(h=e[5],f=e[6]),(0,z.useEffect)(h,f);let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=m(()=>{i(!0)},"m"),e[7]=p):p=e[7];let w=p,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)(Kt,{})}),e[8]=c,e[9]=u,e[10]=t.key,e[11]=l,e[12]=a):a=e[12],a},"Dt"),Ot=m(d=>{let e=(0,M.c)(42),{busy:t,copiedKey:r,handlers:l,object:n,prefix:c,references:i,resolveUrl:s,selected:u,showReferences:h,t:f}=d,p;e[0]!==l||e[1]!==n||e[2]!==c?(p=Ue(n,c,l),e[0]=l,e[1]=n,e[2]=c,e[3]=p):p=e[3];let{copy:w,download:a,name:k,remove:N,toggle:v}=p,b;e[4]!==n||e[5]!==s?(b=(0,o.jsx)(Ft,{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]!==v?(y=(0,o.jsx)("span",{className:"absolute left-1.5 top-1.5 rounded bg-background/80 p-0.5",children:(0,o.jsx)(Pe,{objectKey:n.key,onToggle:v,selected:u,t:f})}),e[7]=n.key,e[8]=u,e[9]=f,e[10]=v,e[11]=y):y=e[11];let x;e[12]!==b||e[13]!==y?(x=(0,o.jsxs)("div",{className:"relative",children:[b,y]}),e[12]=b,e[13]=y,e[14]=x):x=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 S;e[17]!==n.size?(S=ge(n.size),e[17]=n.size,e[18]=S):S=e[18];let C;e[19]!==S?(C=(0,o.jsx)("p",{className:"text-[11px] tabular-nums text-muted-foreground",children:S}),e[19]=S,e[20]=C):C=e[20];let T;e[21]!==n.key||e[22]!==i||e[23]!==h||e[24]!==f?(T=h&&(0,o.jsx)("div",{className:"mt-1",children:(0,o.jsx)(Ae,{objectKey:n.key,references:i,t:f})}),e[21]=n.key,e[22]=i,e[23]=h,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]!==N||e[35]!==f||e[36]!==F?($=(0,o.jsx)("div",{className:"flex items-center gap-1",children:(0,o.jsx)(Me,{busy:t,buttonClassName:"h-7 px-2 text-xs",copied:F,objectKey:n.key,onCopy:w,onDelete:N,onDownload:a,t:f})}),e[30]=t,e[31]=w,e[32]=a,e[33]=n.key,e[34]=N,e[35]=f,e[36]=F,e[37]=$):$=e[37];let O;return e[38]!==$||e[39]!==x||e[40]!==D?(O=(0,o.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"fb-tile",children:[x,D,$]}),e[38]=$,e[39]=x,e[40]=D,e[41]=O):O=e[41],O},"jt"),Et=m(d=>{let e=(0,M.c)(9),{name:t,onEnter:r}=d,l;e[0]!==t||e[1]!==r?(l=m(()=>{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},"Kt"),Lt=m(d=>{let e=(0,M.c)(34),{busy:t,copiedKey:r,files:l,folders:n,handlers:c,onEnterFolder:i,prefix:s,references:u,resolveUrl:h,selected:f,showReferences:p,size:w,t:a}=d,k;e[0]!==w?(k=w.toString(),e[0]=w,e[1]=k):k=e[1];let N=`repeat(auto-fill, minmax(${k}px, 1fr))`,v;e[2]!==N?(v={gridTemplateColumns:N},e[2]=N,e[3]=v):v=e[3];let b=v,y;if(e[4]!==n||e[5]!==i){let S;e[7]!==i?(S=m(C=>(0,o.jsx)(Et,{name:C,onEnter:i},C),"S"),e[7]=i,e[8]=S):S=e[8],y=n.map(S),e[4]=n,e[5]=i,e[6]=y}else y=e[6];let x;if(e[9]!==t||e[10]!==r||e[11]!==l||e[12]!==c||e[13]!==s||e[14]!==u||e[15]!==h||e[16]!==f||e[17]!==p||e[18]!==a){let S;e[20]!==t||e[21]!==r||e[22]!==c||e[23]!==s||e[24]!==u||e[25]!==h||e[26]!==f||e[27]!==p||e[28]!==a?(S=m(C=>(0,o.jsx)(Ot,{busy:t,copiedKey:r,handlers:c,object:C,prefix:s,references:u[C.key],resolveUrl:h,selected:f.has(C.key),showReferences:p,t:a},C.key),"S"),e[20]=t,e[21]=r,e[22]=c,e[23]=s,e[24]=u,e[25]=h,e[26]=f,e[27]=p,e[28]=a,e[29]=S):S=e[29],x=l.map(S),e[9]=t,e[10]=r,e[11]=l,e[12]=c,e[13]=s,e[14]=u,e[15]=h,e[16]=f,e[17]=p,e[18]=a,e[19]=x}else x=e[19];let j;return e[30]!==b||e[31]!==y||e[32]!==x?(j=(0,o.jsxs)("div",{className:"grid gap-4","data-testid":"fb-gallery",style:b,children:[y,x]}),e[30]=b,e[31]=y,e[32]=x,e[33]=j):j=e[33],j},"Lt"),_t=m(d=>{let e=(0,M.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 h;e[8]!==t.key?(h=(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]=h):h=e[9];let f;e[10]!==c||e[11]!==i||e[12]!==u||e[13]!==h?(f=(0,o.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5",children:[c,i,u,h]}),e[10]=c,e[11]=i,e[12]=u,e[13]=h,e[14]=f):f=e[14];let p;e[15]!==r?(p=r("Missing object"),e[15]=r,e[16]=p):p=e[16];let w;e[17]!==p?(w=(0,o.jsx)(ae,{className:"border-destructive/40 text-destructive",variant:"outline",children:p}),e[17]=p,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},"Bt"),Bt=m(d=>{let e=(0,M.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 h;e[6]!==u?(h=(0,o.jsx)("span",{className:"text-sm font-medium text-foreground",children:u}),e[6]=u,e[7]=h):h=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 p;e[10]!==f?(p=(0,o.jsx)("span",{className:"text-xs text-muted-foreground",children:f}),e[10]=f,e[11]=p):p=e[11];let w;e[12]!==s||e[13]!==h||e[14]!==p?(w=(0,o.jsxs)("div",{className:"flex flex-col gap-1",children:[s,h,p]}),e[12]=s,e[13]=h,e[14]=p,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)(te,{"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 N;e[23]!==w||e[24]!==k?(N=(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]=N):N=e[25];let v;e[26]!==l||e[27]!==n||e[28]!==c?(v=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]=v):v=e[29];let b;e[30]!==l?.length||e[31]!==n||e[32]!==c?(b=l?.length===0&&!c&&(0,o.jsx)(he,{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)(_t,{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 x;return e[37]!==N||e[38]!==v||e[39]!==b||e[40]!==y?(x=(0,o.jsxs)("section",{className:"flex flex-col gap-2 rounded-lg border border-border/60 p-3","data-testid":"fb-orphans",children:[N,v,b,y]}),e[37]=N,e[38]=v,e[39]=b,e[40]=y,e[41]=x):x=e[41],x},"It"),It=m(function(d,e){let t=(0,M.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=m(v=>{n(b=>{let y=new Set(b);return y.has(v)?y.delete(v):y.add(v),y})},"a"),t[1]=c):c=t[1];let i=c,s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=m(()=>{n(new Set)},"o"),t[2]=s):s=t[2];let u=s,h,f,p;if(t[3]!==d||t[4]!==e||t[5]!==l){let v;t[9]!==e?(v=m(b=>e(b),"x"),t[9]=e,t[10]=v):v=t[10],f=d.map(v),h=f.length>0&&f.every(b=>l.has(b)),p=!h&&f.some(b=>l.has(b)),t[3]=d,t[4]=e,t[5]=l,t[6]=h,t[7]=f,t[8]=p}else h=t[6],f=t[7],p=t[8];let w=p,a;t[11]!==f?(a=m(()=>{n(v=>f.every(b=>v.has(b))?new Set:new Set(f))},"i"),t[11]=f,t[12]=a):a=t[12];let k=a,N;return t[13]!==h||t[14]!==l||t[15]!==w||t[16]!==k?(N={allSelected:h,clear:u,selected:l,someSelected:w,toggle:i,toggleAll:k},t[13]=h,t[14]=l,t[15]=w,t[16]=k,t[17]=N):N=t[17],N},"Ot"),Rt=me(be.storageReferences),Ut=me(be.storageOrphans),Ie=1e4,Mt=1e3,At=m(async d=>{let e=[],t,r=!0,l=!1;for(;r&&e.length<Ie;){let n=await d.list({cursor:t,limit:Mt}),c=Ie-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}},"Gt"),Pt=3600,Wt=m((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()},"Pt"),Ht=m(d=>d.key,"qt"),qt=m(({initialPrefix:d,pageSize:e})=>{let t=Se(),[r,l]=(0,z.useState)(d??""),[n,c]=(0,z.useState)(d??""),[i,s]=(0,z.useState)(wt),[u,h]=(0,z.useState)("list"),[f,p]=(0,z.useState)(128),[w,a]=(0,z.useState)("name"),[k,N]=(0,z.useState)("asc"),[v,b]=(0,z.useState)(void 0),[y,x]=(0,z.useState)(void 0),[j,S]=(0,z.useState)(!1),[C,T]=(0,z.useState)(void 0),[D,F]=(0,z.useState)(void 0),[$,O]=(0,z.useState)(""),[B,L]=(0,z.useState)({}),[I,E]=(0,z.useState)(!1),[_,U]=(0,z.useState)(void 0),[A,H]=(0,z.useState)(!1),[P,q]=(0,z.useState)(!1),[Y,ne]=(0,z.useState)([]),[G,xe]=(0,z.useState)(""),oe=(0,z.useRef)(0),J=(0,z.useRef)(0);(0,z.useEffect)(()=>{let g={cancelled:!1};return W((async()=>{try{let K=await t.listStorageBuckets();if(!g.cancelled){ne(K);let[R]=K;R!==void 0&&xe(X=>X===""?R:X)}}catch{}})()),()=>{g.cancelled=!0}},[t]);let V=(0,z.useMemo)(()=>({list:m(g=>t.listStorageObjects({...g,bucket:G}),"list"),remove:m(g=>t.deleteStorageObject(g,{bucket:G}),"remove"),signedUrl:m((g,K)=>t.signedStorageUrl(g,{...K,bucket:G}),"signedUrl"),upload:m(g=>t.uploadStorageObject({...g,bucket:G}),"upload")}),[G,t]),Z=(0,z.useCallback)(async(g,K,R)=>{oe.current+=1;let X=oe.current;x(void 0),S(!0);try{let se=await V.list({cursor:K,limit:e,prefix:g});if(X!==oe.current)return;b(we=>R&&we!==void 0?[...we,...se.objects]:se.objects),F(se.cursor)}catch(se){if(X!==oe.current)return;R||b(void 0),x(Q(se))}finally{X===oe.current&&S(!1)}},[e,V]);(0,z.useEffect)(()=>{W(Z(d??"",void 0,!1))},[Z,d]);let We=(v?.length??0)<=e;Ee(()=>{W(Z(r,void 0,!1))},We);let{files:de,folders:He}=Nt(v??[],r),qe=(0,z.useMemo)(()=>{let g=new Set;for(let K of de)for(let R of Object.keys(K.customMetadata??{}))g.add(R);return[...g].toSorted((K,R)=>K.localeCompare(R))},[de]),ce=St(de,w,k),ue=(0,z.useMemo)(()=>[...new Set(ce.map(g=>g.key))].toSorted((g,K)=>g.localeCompare(K)).join(`
3
+ `),[ce]);(0,z.useEffect)(()=>{let g=ue===""?[]:ue.split(`
4
+ `);if(g.length===0){L({});return}let K={current:!0};return W((async()=>{try{let R=await t.query(Rt,{keys:g},pe($));K.current&&(L(R.references??{}),E(Object.keys(R.storageColumns??{}).length>0))}catch{K.current&&(L({}),E(!1))}})()),()=>{K.current=!1}},[t,ue,$]);let{allSelected:Ge,clear:le,selected:ve,someSelected:Ve,toggle:Ze,toggleAll:Xe}=It(ce,Ht),Ye=m(()=>{l(n),le(),W(Z(n,void 0,!1))},"Oe"),Je=m(()=>{W(Z(r,D,!0))},"Ae"),ke=m(g=>{l(g),c(g),le(),W(Z(g,void 0,!1))},"be"),Qe=m(g=>{ke(`${r}${g}`)},"Ue"),et=m(g=>V.signedUrl(g,{expiresInSeconds:Pt}),"Me"),tt=m(()=>{h("list")},"Ge"),rt=m(()=>{h("grid")},"He"),nt=m(g=>{a(g)},"Pe"),ot=m(()=>{N(g=>g==="asc"?"desc":"asc")},"qe"),lt=m(g=>{p(g)},"Ve"),st=m(g=>{s(g)},"We"),at=m(()=>{x(void 0),S(!0),W((async()=>{try{for(let g of ve)await V.remove(g);await Z(r,void 0,!1),le()}catch(g){x(Q(g))}S(!1)})())},"Ze"),ct=m(g=>{x(void 0),W((async()=>{try{let K=await V.signedUrl(g,{expiresInSeconds:i});De(K)&&T(g)}catch(K){x(Q(K))}})())},"Xe"),it=m(g=>{x(void 0),W((async()=>{try{let K=await V.signedUrl(g,{expiresInSeconds:i}),R=g.slice(g.lastIndexOf("/")+1)||g;Wt(K,R)}catch(K){x(Q(K))}})())},"Ye");(0,z.useEffect)(()=>{if(C===void 0)return;let g=globalThis.setTimeout(()=>{T(void 0)},2e3);return()=>{globalThis.clearTimeout(g)}},[C]);let dt=m(g=>{x(void 0),S(!0),W((async()=>{try{await V.remove(g),await Z(r,void 0,!1)}catch(K){x(Q(K))}S(!1)})())},"Je"),ut=m(g=>{let K=`${r}${g.name}`;x(void 0),S(!0),W((async()=>{try{let R=await g.arrayBuffer();await V.upload({body:R,contentType:g.type===""?void 0:g.type,key:K}),await Z(r,void 0,!1)}catch(R){x(Q(R))}S(!1)})())},"Qe");(0,z.useEffect)(()=>{J.current+=1,U(void 0),q(!1)},[$]);let ft=m(()=>{J.current+=1;let g=J.current;x(void 0),H(!0),W((async()=>{try{let{liveKeys:K,truncated:R}=await At(V);if(R)g===J.current&&(U(void 0),q(!0));else{let X=await t.query(Ut,{liveKeys:K},pe($));g===J.current&&(U(X.references??[]),q(X.truncated===!0))}}catch(K){g===J.current&&(U(void 0),q(!1),x(Q(K)))}g===J.current&&H(!1)})())},"et"),ht=m(g=>{oe.current+=1,J.current+=1,xe(g),l(d??""),c(d??""),b(void 0),U(void 0),q(!1),le()},"tt");return{allSelected:Ge,bucket:G,buckets:Y,bulkDelete:at,busy:j,checkOrphans:ft,clearSelection:le,copiedKey:C,danglingBusy:A,danglingReferences:_,danglingTruncated:P,draftPrefix:n,enterFolder:Qe,error:y,expiry:i,files:ce,folders:He,hasObjects:v!==void 0&&v.length>0,hasStorageColumns:I,listFirst:Ye,loaded:v!==void 0,loadMore:Je,navigate:ke,nextCursor:D,onCopy:ct,onDelete:dt,onDownload:it,onExpiryChange:st,onFile:ut,onSortKeyChange:nt,onThumbSizeChange:lt,prefix:r,referenceShard:$,references:B,resolveUrl:et,selectBucket:ht,selected:ve,setDraftPrefix:c,setReferenceShard:O,showGrid:rt,showList:tt,someSelected:Ve,sortDirection:k,sortKey:w,tagKeys:qe,thumbSize:f,toggleSelect:Ze,toggleSelectAll:Xe,toggleSortDirection:ot,view:u}},"Vt"),Gt=100,Re=m(d=>{let e=(0,M.c)(6),{label:t,onNavigate:r,target:l}=d,n;e[0]!==r||e[1]!==l?(n=m(()=>{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},"Se"),Vt=m(d=>{let e=(0,M.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(Zt),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)(Re,{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((h,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)(Re,{label:h,onNavigate:t,target:`${c.slice(0,f+1).join("/")}/`})]},`${h}-${f.toString()}`))]}),e[0]=t,e[1]=r,e[2]=l,e[3]=n}else n=e[3];return n},"Zt"),fr=m(({initialPrefix:d,pageSize:e=Gt})=>{let t=Ne(),r=qt({initialPrefix:d,pageSize:e}),l=(0,z.useRef)(null),{onCopy:n,onDelete:c,onDownload:i,onFile:s,toggleSelect:u}=r,h={onCopy:n,onDelete:c,onDownload:i,onToggleSelect:u},f=m(()=>{l.current?.click()},"u"),p=m(a=>{let k=a.target,N=k.files?.[0];k.value="",N&&s(N)},"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)(Ct,{bucket:r.bucket,buckets:r.buckets,busy:r.busy,draftPrefix:r.draftPrefix,expiry:r.expiry,fileInputRef:l,onBucketChange:r.selectBucket,onExpiryChange:r.onExpiryChange,onFileChange:p,onList:r.listFirst,onPrefixChange:r.setDraftPrefix,onUploadClick:f,t}),r.loaded&&(0,o.jsx)(Vt,{onNavigate:r.navigate,prefix:r.prefix,t}),r.hasObjects&&(0,o.jsx)(jt,{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)(Te,{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)(Bt,{busy:r.danglingBusy,onCheck:r.checkOrphans,references:r.danglingReferences,t,truncated:r.danglingTruncated}),r.selected.size>0&&(0,o.jsx)(Le,{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)(he,{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)(vt,{allSelected:r.allSelected,busy:r.busy,copiedKey:r.copiedKey,files:r.files,folders:r.folders,handlers:h,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)(Lt,{busy:r.busy,copiedKey:r.copiedKey,files:r.files,folders:r.folders,handlers:h,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)(te,{"data-testid":"fb-next",disabled:r.busy,onClick:r.loadMore,size:"sm",type:"button",variant:"outline",children:t("Load more")})})]})},"ps");function Zt(d){return d!==""}m(Zt,"Xt");export{fr as FileBrowser};
@@ -0,0 +1 @@
1
+ import{a as l,d as m,f as d,g as p,i}from"./chunk-YKXDMIHQ.js";var n=m(d(),1);var c=m(p(),1);function f(r){let t=(0,n.c)(8),e,s;t[0]!==r?({className:e,...s}=r,t[0]=r,t[1]=e,t[2]=s):(e=t[1],s=t[2]);let a;t[3]!==e?(a=i("animate-pulse rounded-md bg-muted",e),t[3]=e,t[4]=a):a=t[4];let o;return t[5]!==s||t[6]!==a?(o=(0,c.jsx)("div",{"data-slot":"skeleton",className:a,...s}),t[5]=s,t[6]=a,t[7]=o):o=t[7],o}l(f,"p");export{f as a};
@@ -0,0 +1 @@
1
+ import{a as Ce,b as Ne}from"./chunk-WBNKZBWC.js";import{a as ye}from"./chunk-2HFEYNGZ.js";import"./chunk-P5RUFDVX.js";import"./chunk-5JDWLCSH.js";import"./chunk-EVTM6Q43.js";import{e as ke,g as we}from"./chunk-OKG3HWSJ.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import{a as X}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import"./chunk-225VJ77I.js";import{a as le}from"./chunk-ULIQFBZU.js";import{a as pe}from"./chunk-4ZEL6BYL.js";import"./chunk-FPG5ZRPW.js";import{f as he}from"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as me}from"./chunk-FKVZRPV5.js";import"./chunk-HEAQVSNS.js";import{a as oe,b as ue,c as ge,e as ae}from"./chunk-WUWBZPUK.js";import{d as te,f as ve,g as be,h as fe,n as xe,o as ne}from"./chunk-FODLDLE2.js";import{a as g,d as ie,e as Se,f as Ke,g as Le}from"./chunk-YKXDMIHQ.js";var Y=ie(Ke(),1),G=ie(Se(),1);var a=ie(Le(),1);var Me=ve(pe.runSql),qe=g((f,e)=>{let t=(0,Y.c)(11),n=he(),[l,d]=(0,G.useState)(void 0),[s,i]=(0,G.useState)(void 0),[h,x]=(0,G.useState)(!0),m;t[0]!==n||t[1]!==e||t[2]!==f?(m=g(async u=>{x(!0);try{let C=await n.query(Me,{sql:f},be(e));u.cancelled||(d(C),i(void 0))}catch(C){let k=C;u.cancelled||(d(void 0),i(fe(k)))}u.cancelled||x(!1)},"h"),t[0]=n,t[1]=e,t[2]=f,t[3]=m):m=t[3];let r=m,o,v;t[4]!==r?(o=g(()=>{let u={cancelled:!1};return ne(r(u)),()=>{u.cancelled=!0}},"l"),v=[r],t[4]=r,t[5]=o,t[6]=v):(o=t[5],v=t[6]),(0,G.useEffect)(o,v);let S;return t[7]!==s||t[8]!==h||t[9]!==l?(S={error:s,loading:h,result:l},t[7]=s,t[8]=h,t[9]=l,t[10]=S):S=t[10],S},"Le"),Ee=g(f=>{f.preventDefault()},"Me"),ce=g(f=>f.kind??"chart","le"),Re=g(f=>{let e=(0,Y.c)(80),{actions:t,children:n,draggedRef:l,first:d,last:s,onEdit:i,onMove:h,onRemove:x,onReorder:m,widget:r}=f,o=te(),v;e[0]!==h||e[1]!==r.id?(v=g(()=>{h(r.id,-1)},"g"),e[0]=h,e[1]=r.id,e[2]=v):v=e[2];let S=v,u;e[3]!==h||e[4]!==r.id?(u=g(()=>{h(r.id,1)},"f"),e[3]=h,e[4]=r.id,e[5]=u):u=e[5];let C=u,k;e[6]!==i||e[7]!==r.id?(k=g(()=>{i(r.id)},"x"),e[6]=i,e[7]=r.id,e[8]=k):k=e[8];let E=k,O;e[9]!==x||e[10]!==r.id?(O=g(()=>{x(r.id)},"O"),e[9]=x,e[10]=r.id,e[11]=O):O=e[11];let j=O,T;e[12]!==l||e[13]!==r.id?(T=g(()=>{l.current=r.id},"z"),e[12]=l,e[13]=r.id,e[14]=T):T=e[14];let w=T,K;e[15]!==l||e[16]!==m||e[17]!==r.id?(K=g(()=>{let de=l.current;l.current=null,de!==null&&de!==r.id&&m(de,r.id)},"K"),e[15]=l,e[16]=m,e[17]=r.id,e[18]=K):K=e[18];let _=K,R=`dashboards-widget-${r.id}`,y;e[19]!==r.title?(y=(0,a.jsx)(ge,{className:"min-w-0 cursor-grab truncate",title:r.title,children:r.title}),e[19]=r.title,e[20]=y):y=e[20];let N;e[21]!==o?(N=o("Move widget up"),e[21]=o,e[22]=N):N=e[22];let F=`dashboards-move-up-${r.id}`,H;e[23]!==o?(H=o("Move widget up"),e[23]=o,e[24]=H):H=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=(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:"m6 15 6-6 6 6"})}),e[25]=D):D=e[25];let W;e[26]!==d||e[27]!==S||e[28]!==F||e[29]!==H||e[30]!==N?(W=(0,a.jsx)(X,{"aria-label":N,"data-testid":F,disabled:d,onClick:S,size:"icon-xs",title:H,type:"button",variant:"ghost",children:D}),e[26]=d,e[27]=S,e[28]=F,e[29]=H,e[30]=N,e[31]=W):W=e[31];let L;e[32]!==o?(L=o("Move widget down"),e[32]=o,e[33]=L):L=e[33];let $=`dashboards-move-down-${r.id}`,M;e[34]!==o?(M=o("Move widget down"),e[34]=o,e[35]=M):M=e[35];let z;e[36]===Symbol.for("react.memo_cache_sentinel")?(z=(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:"m6 9 6 6 6-6"})}),e[36]=z):z=e[36];let q;e[37]!==s||e[38]!==C||e[39]!==L||e[40]!==$||e[41]!==M?(q=(0,a.jsx)(X,{"aria-label":L,"data-testid":$,disabled:s,onClick:C,size:"icon-xs",title:M,type:"button",variant:"ghost",children:z}),e[37]=s,e[38]=C,e[39]=L,e[40]=$,e[41]=M,e[42]=q):q=e[42];let B;e[43]!==o?(B=o("Edit widget"),e[43]=o,e[44]=B):B=e[44];let I=`dashboards-widget-edit-${r.id}`,A;e[45]!==o?(A=o("Edit widget"),e[45]=o,e[46]=A):A=e[46];let p;e[47]===Symbol.for("react.memo_cache_sentinel")?(p=(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:"M4 20h4L18 10l-4-4L4 16v4ZM14 6l4 4"})}),e[47]=p):p=e[47];let b;e[48]!==E||e[49]!==B||e[50]!==I||e[51]!==A?(b=(0,a.jsx)(X,{"aria-label":B,"data-testid":I,onClick:E,size:"icon-xs",title:A,type:"button",variant:"ghost",children:p}),e[48]=E,e[49]=B,e[50]=I,e[51]=A,e[52]=b):b=e[52];let c;e[53]!==o?(c=o("Remove widget"),e[53]=o,e[54]=c):c=e[54];let J=`dashboards-widget-remove-${r.id}`,V;e[55]!==o?(V=o("Remove widget"),e[55]=o,e[56]=V):V=e[56];let U;e[57]===Symbol.for("react.memo_cache_sentinel")?(U=(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 7h14M9 7V5h6v2m-1 0v12H10V7M7 7v13h10V7"})}),e[57]=U):U=e[57];let Q;e[58]!==j||e[59]!==c||e[60]!==J||e[61]!==V?(Q=(0,a.jsx)(X,{"aria-label":c,"data-testid":J,onClick:j,size:"icon-xs",title:V,type:"button",variant:"ghost",children:U}),e[58]=j,e[59]=c,e[60]=J,e[61]=V,e[62]=Q):Q=e[62];let Z;e[63]!==t||e[64]!==W||e[65]!==q||e[66]!==b||e[67]!==Q?(Z=(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[t,W,q,b,Q]}),e[63]=t,e[64]=W,e[65]=q,e[66]=b,e[67]=Q,e[68]=Z):Z=e[68];let P;e[69]!==Z||e[70]!==y?(P=(0,a.jsxs)(ue,{className:"flex flex-row items-start justify-between gap-2 border-b pb-3",children:[y,Z]}),e[69]=Z,e[70]=y,e[71]=P):P=e[71];let ee;e[72]!==n?(ee=(0,a.jsx)(ae,{className:"min-h-32 py-2",children:n}),e[72]=n,e[73]=ee):ee=e[73];let re;return e[74]!==w||e[75]!==_||e[76]!==P||e[77]!==ee||e[78]!==R?(re=(0,a.jsxs)(oe,{"data-testid":R,draggable:!0,onDragOver:Ee,onDragStart:w,onDrop:_,children:[P,ee]}),e[74]=w,e[75]=_,e[76]=P,e[77]=ee,e[78]=R,e[79]=re):re=e[79],re},"ce"),je=g(f=>{let e=(0,Y.c)(10),{result:t}=f,n=te(),l=t.columns[0],d=l===void 0?void 0:t.rows[0]?.[l],s;e[0]!==d||e[1]!==n?(s=d===void 0?n("\u2014"):xe(d),e[0]=d,e[1]=n,e[2]=s):s=e[2];let i;e[3]!==s?(i=(0,a.jsx)("p",{className:"truncate font-mono text-3xl font-semibold text-foreground",children:s}),e[3]=s,e[4]=i):i=e[4];let h;e[5]!==l?(h=l!==void 0&&(0,a.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:l}),e[5]=l,e[6]=h):h=e[6];let x;return e[7]!==i||e[8]!==h?(x=(0,a.jsxs)("div",{className:"flex h-full flex-col justify-center gap-1 p-4","data-testid":"dashboards-kpi",children:[i,h]}),e[7]=i,e[8]=h,e[9]=x):x=e[9],x},"qe"),ze=g(f=>{let e=(0,Y.c)(12),{draggedRef:t,first:n,last:l,onEdit:d,onMove:s,onRemove:i,onReorder:h,widget:x}=f,m=x.text??"",r;e[0]!==m?(r=(0,a.jsx)("p",{className:"p-2 text-sm whitespace-pre-wrap text-muted-foreground","data-testid":"dashboards-text",children:m}),e[0]=m,e[1]=r):r=e[1];let o;return e[2]!==t||e[3]!==n||e[4]!==l||e[5]!==d||e[6]!==s||e[7]!==i||e[8]!==h||e[9]!==r||e[10]!==x?(o=(0,a.jsx)(Re,{draggedRef:t,first:n,last:l,onEdit:d,onMove:s,onRemove:i,onReorder:h,widget:x,children:r}),e[2]=t,e[3]=n,e[4]=l,e[5]=d,e[6]=s,e[7]=i,e[8]=h,e[9]=r,e[10]=x,e[11]=o):o=e[11],o},"Ee"),Ae=g(f=>{let e=(0,Y.c)(52),{draggedRef:t,first:n,inferring:l,last:d,onEdit:s,onMove:i,onRemove:h,onReorder:x,onSuggest:m,widget:r}=f,o=te(),{error:v,loading:S,result:u}=qe(r.sql,r.shardKey??""),C;e[0]!==r?(C=ce(r),e[0]=r,e[1]=C):C=e[1];let k=C,E;e[2]!==m||e[3]!==u||e[4]!==r.id?(E=g(()=>{u!==void 0&&m?.(r.id,u)},"q"),e[2]=m,e[3]=u,e[4]=r.id,e[5]=E):E=e[5];let O=E,j;e[6]!==l||e[7]!==k||e[8]!==m||e[9]!==O||e[10]!==u||e[11]!==o||e[12]!==r.id?(j=k==="chart"&&m!==void 0&&u!==void 0?(0,a.jsx)(X,{"aria-label":o("Suggest chart"),"data-testid":`dashboards-widget-suggest-${r.id}`,disabled:l,onClick:O,size:"icon-xs",title:o(l?"Suggesting\u2026":"Suggest chart"),type:"button",variant:"ghost",children:(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:"m12 3 1.9 4.6L18.5 9.5 13.9 11.4 12 16l-1.9-4.6L5.5 9.5l4.6-1.9L12 3ZM18 15l.9 2.1 2.1.9-2.1.9L18 21l-.9-2.1-2.1-.9 2.1-.9L18 15Z"})})}):void 0,e[6]=l,e[7]=k,e[8]=m,e[9]=O,e[10]=u,e[11]=o,e[12]=r.id,e[13]=j):j=e[13];let T=j,w;e[14]!==v||e[15]!==r.id?(w=v!==void 0&&(0,a.jsx)(le,{className:"font-mono text-xs",testId:`dashboards-widget-error-${r.id}`,variant:"destructive",children:v}),e[14]=v,e[15]=r.id,e[16]=w):w=e[16];let K;e[17]!==v||e[18]!==S||e[19]!==u||e[20]!==o||e[21]!==r.id?(K=v===void 0&&S&&u===void 0&&(0,a.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":`dashboards-widget-loading-${r.id}`,children:o("Running\u2026")}),e[17]=v,e[18]=S,e[19]=u,e[20]=o,e[21]=r.id,e[22]=K):K=e[22];let _;e[23]!==v||e[24]!==k||e[25]!==u||e[26]!==r.chartAxes||e[27]!==r.chartKind?(_=v===void 0&&u!==void 0&&k==="chart"&&(0,a.jsx)(Ce,{axes:r.chartAxes,kind:r.chartKind,result:u}),e[23]=v,e[24]=k,e[25]=u,e[26]=r.chartAxes,e[27]=r.chartKind,e[28]=_):_=e[28];let R;e[29]!==v||e[30]!==k||e[31]!==u?(R=v===void 0&&u!==void 0&&k==="kpi"&&(0,a.jsx)(je,{result:u}),e[29]=v,e[30]=k,e[31]=u,e[32]=R):R=e[32];let y;e[33]!==v||e[34]!==k||e[35]!==u?(y=v===void 0&&u!==void 0&&k==="table"&&(0,a.jsx)("div",{className:"max-h-72 overflow-auto",children:(0,a.jsx)(Ne,{result:u})}),e[33]=v,e[34]=k,e[35]=u,e[36]=y):y=e[36];let N;return e[37]!==t||e[38]!==n||e[39]!==d||e[40]!==s||e[41]!==i||e[42]!==h||e[43]!==x||e[44]!==T||e[45]!==w||e[46]!==K||e[47]!==_||e[48]!==R||e[49]!==y||e[50]!==r?(N=(0,a.jsxs)(Re,{actions:T,draggedRef:t,first:n,last:d,onEdit:s,onMove:i,onRemove:h,onReorder:x,widget:r,children:[w,K,_,R,y]}),e[37]=t,e[38]=n,e[39]=d,e[40]=s,e[41]=i,e[42]=h,e[43]=x,e[44]=T,e[45]=w,e[46]=K,e[47]=_,e[48]=R,e[49]=y,e[50]=r,e[51]=N):N=e[51],N},"Ae"),_e=g(f=>{let e=(0,Y.c)(11),{draggedRef:t,first:n,inferring:l,last:d,onEdit:s,onMove:i,onRemove:h,onReorder:x,onSuggest:m,widget:r}=f,o;return e[0]!==t||e[1]!==n||e[2]!==l||e[3]!==d||e[4]!==s||e[5]!==i||e[6]!==h||e[7]!==x||e[8]!==m||e[9]!==r?(o=ce(r)==="text"?(0,a.jsx)(ze,{draggedRef:t,first:n,last:d,onEdit:s,onMove:i,onRemove:h,onReorder:x,widget:r}):(0,a.jsx)(Ae,{draggedRef:t,first:n,inferring:l,last:d,onEdit:s,onMove:i,onRemove:h,onReorder:x,onSuggest:m,widget:r}),e[0]=t,e[1]=n,e[2]=l,e[3]=d,e[4]=s,e[5]=i,e[6]=h,e[7]=x,e[8]=m,e[9]=r,e[10]=o):o=e[10],o},"Te"),We=["bar","line","area"],$e=["chart","kpi","table","text"],Be="lunora-studio-dashboards",se={chartKind:"bar",kind:"chart",shardKey:"",sql:"",text:"",title:""},Ie=g((f,e)=>t=>t.map(n=>n.id===f?{...n,chartAxes:e,chartKind:e.kind}:n),"De"),Te=g((f,e)=>t=>{let n=t.find(s=>s.id===f),l=t.filter(s=>s.id!==f),d=l.findIndex(s=>s.id===e);return n===void 0||d===-1?t:[...l.slice(0,d),n,...l.slice(d)]},"je"),De=g((f,e)=>e(f==="line"?"Line":f==="area"?"Area":"Bar"),"ze"),Oe=g((f,e)=>e(f==="kpi"?"Single value":f==="table"?"Table":f==="text"?"Text":"Chart"),"Be"),Fe=g(f=>{let e=(0,Y.c)(82),{draft:t,editing:n,onCancel:l,onChange:d,onSubmit:s}=f,i=te(),h;e[0]!==t||e[1]!==d?(h=g(c=>{d({...t,title:c.target.value})},"c"),e[0]=t,e[1]=d,e[2]=h):h=e[2];let x=h,m;e[3]!==t||e[4]!==d?(m=g(c=>{d({...t,sql:c.target.value})},"h"),e[3]=t,e[4]=d,e[5]=m):m=e[5];let r=m,o;e[6]!==t||e[7]!==d?(o=g(c=>{d({...t,text:c.target.value})},"l"),e[6]=t,e[7]=d,e[8]=o):o=e[8];let v=o,S;e[9]!==t||e[10]!==d?(S=g(c=>{d({...t,shardKey:c.target.value})},"N"),e[9]=t,e[10]=d,e[11]=S):S=e[11];let u=S,C;e[12]!==t||e[13]!==d?(C=g(c=>{d({...t,chartKind:c.target.value})},"y"),e[12]=t,e[13]=d,e[14]=C):C=e[14];let k=C,E;e[15]!==t||e[16]!==d?(E=g(c=>{d({...t,kind:c.target.value})},"q"),e[15]=t,e[16]=d,e[17]=E):E=e[17];let O=E,j;e[18]!==s?(j=g(()=>{s()},"E"),e[18]=s,e[19]=j):j=e[19];let T=j,w=t.kind==="text",K;e[20]!==t.sql||e[21]!==t.text||e[22]!==t.title||e[23]!==w?(K=t.title.trim()!==""&&(w?t.text.trim()!=="":t.sql.trim()!==""),e[20]=t.sql,e[21]=t.text,e[22]=t.title,e[23]=w,e[24]=K):K=e[24];let _=K,R;e[25]!==i?(R=i("Widget title"),e[25]=i,e[26]=R):R=e[26];let y;e[27]!==i?(y=i("Widget title"),e[27]=i,e[28]=y):y=e[28];let N;e[29]!==t.title||e[30]!==x||e[31]!==y||e[32]!==R?(N=(0,a.jsx)("input",{"aria-label":R,className:"h-8 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"dashboards-form-title",onChange:x,placeholder:y,type:"text",value:t.title}),e[29]=t.title,e[30]=x,e[31]=y,e[32]=R,e[33]=N):N=e[33];let F;e[34]!==i?(F=i("Widget type"),e[34]=i,e[35]=F):F=e[35];let H=t.kind,D;e[36]!==i?(D=$e.map(c=>(0,a.jsx)("option",{value:c,children:Oe(c,i)},c)),e[36]=i,e[37]=D):D=e[37];let W;e[38]!==t.kind||e[39]!==O||e[40]!==F||e[41]!==D?(W=(0,a.jsx)("select",{"aria-label":F,className:"h-8 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"dashboards-form-widget-kind",onChange:O,value:H,children:D}),e[38]=t.kind,e[39]=O,e[40]=F,e[41]=D,e[42]=W):W=e[42];let L;e[43]!==t.sql||e[44]!==t.text||e[45]!==w||e[46]!==r||e[47]!==v||e[48]!==i?(L=w?(0,a.jsx)("textarea",{"aria-label":i("Text"),className:"min-h-24 resize-y rounded-md border border-border bg-background p-2 text-xs leading-5 outline-none focus-visible:border-ring","data-testid":"dashboards-form-text",onChange:v,placeholder:i("Notes for whoever reads this dashboard."),value:t.text}):(0,a.jsx)("textarea",{"aria-label":i("SQL query"),className:"min-h-24 resize-y rounded-md border border-border bg-background p-2 font-mono text-xs leading-5 outline-none focus-visible:border-ring","data-testid":"dashboards-form-sql",onChange:r,placeholder:"SELECT author, COUNT(*) AS messages FROM \u2026",spellCheck:!1,value:t.sql}),e[43]=t.sql,e[44]=t.text,e[45]=w,e[46]=r,e[47]=v,e[48]=i,e[49]=L):L=e[49];let $;e[50]!==t.chartKind||e[51]!==t.kind||e[52]!==k||e[53]!==i?($=t.kind==="chart"&&(0,a.jsx)("select",{"aria-label":i("Chart type"),className:"h-8 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"dashboards-form-kind",onChange:k,value:t.chartKind,children:We.map(c=>(0,a.jsx)("option",{value:c,children:De(c,i)},c))}),e[50]=t.chartKind,e[51]=t.kind,e[52]=k,e[53]=i,e[54]=$):$=e[54];let M;e[55]!==t.shardKey||e[56]!==w||e[57]!==u||e[58]!==i?(M=!w&&(0,a.jsx)("input",{"aria-label":i("Shard key (optional)"),className:"h-8 rounded-md border border-border bg-background px-2 font-mono text-xs outline-none focus-visible:border-ring","data-testid":"dashboards-form-shard",onChange:u,placeholder:i("Shard key (optional)"),type:"text",value:t.shardKey}),e[55]=t.shardKey,e[56]=w,e[57]=u,e[58]=i,e[59]=M):M=e[59];let z;e[60]!==i?(z=i("Cancel"),e[60]=i,e[61]=z):z=e[61];let q;e[62]!==l||e[63]!==z?(q=(0,a.jsx)(X,{"data-testid":"dashboards-form-cancel",onClick:l,size:"sm",type:"button",variant:"outline",children:z}),e[62]=l,e[63]=z,e[64]=q):q=e[64];let B=!_,I;e[65]!==n||e[66]!==i?(I=i(n?"Save widget":"Add widget"),e[65]=n,e[66]=i,e[67]=I):I=e[67];let A;e[68]!==T||e[69]!==B||e[70]!==I?(A=(0,a.jsx)(X,{"data-testid":"dashboards-form-save",disabled:B,onClick:T,size:"sm",type:"button",children:I}),e[68]=T,e[69]=B,e[70]=I,e[71]=A):A=e[71];let p;e[72]!==q||e[73]!==A?(p=(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[q,A]}),e[72]=q,e[73]=A,e[74]=p):p=e[74];let b;return e[75]!==N||e[76]!==W||e[77]!==L||e[78]!==$||e[79]!==M||e[80]!==p?(b=(0,a.jsx)(oe,{"data-testid":"dashboards-form",children:(0,a.jsxs)(ae,{className:"flex flex-col gap-3 py-4",children:[N,W,L,$,M,p]})}),e[75]=N,e[76]=W,e[77]=L,e[78]=$,e[79]=M,e[80]=p,e[81]=b):b=e[81],b},"Fe"),tt=g(f=>{let e=(0,Y.c)(53),{initialShardKey:t}=f,n=te(),[l,d]=ke(Be),[s,i]=(0,G.useState)(se),[h,x]=(0,G.useState)(null),[m,r]=(0,G.useState)(!1),o=ye(t??""),[v,S]=(0,G.useState)(null),u=(0,G.useRef)(null),C;e[0]!==t?(C=g(()=>{x(null),i({...se,shardKey:t??""}),r(!0)},"y"),e[0]=t,e[1]=C):C=e[1];let k=C,E;e[2]===Symbol.for("react.memo_cache_sentinel")?(E=g(()=>{r(!1),x(null),i(se)},"q"),e[2]=E):E=e[2];let O=E,j;e[3]!==l?(j=g(p=>{let b=l.find(c=>c.id===p);b!==void 0&&(x(p),i({chartKind:b.chartKind??"bar",kind:ce(b),shardKey:b.shardKey??"",sql:b.sql,text:b.text??"",title:b.title}),r(!0))},"E"),e[3]=l,e[4]=j):j=e[4];let T=j,w;e[5]!==o||e[6]!==d?(w=g((p,b)=>{S(p),ne((async()=>{let c=await o.inferChart({columns:b.columns,rowCount:b.rowCount});c!==void 0&&d(Ie(p,c))})().finally(()=>{S(c=>c===p?null:c)}))},"C"),e[5]=o,e[6]=d,e[7]=w):w=e[7];let K=w,_;e[8]!==d?(_=g(p=>{d(b=>b.filter(c=>c.id!==p))},"W"),e[8]=d,e[9]=_):_=e[9];let R=_,y;e[10]!==d?(y=g((p,b)=>{d(Te(p,b))},"k"),e[10]=d,e[11]=y):y=e[11];let N=y,F;e[12]!==d?(F=g((p,b)=>{d(c=>{let J=c.findIndex(P=>P.id===p),V=J+b;if(J===-1||V<0||V>=c.length)return c;let U=[...c],Q=U[J],Z=U[V];return Q===void 0||Z===void 0?c:(U[J]=Z,U[V]=Q,U)})},"_"),e[12]=d,e[13]=F):F=e[13];let H=F,D;e[14]!==s||e[15]!==h||e[16]!==d?(D=g(()=>{let p=s.title.trim(),b=s.sql.trim(),c=s.text.trim(),{chartKind:J,kind:V}=s;if(p===""||(V==="text"?c==="":b===""))return;let U={chartKind:J,kind:V,shardKey:s.shardKey.trim(),sql:b,text:c,title:p};d(h===null?Q=>[...Q,{...U,id:we("w")}]:Q=>Q.map(Z=>Z.id===h?{...Z,...U}:Z)),O()},"B"),e[14]=s,e[15]=h,e[16]=d,e[17]=D):D=e[17];let W=D,L;e[18]!==n?(L=n("Charts, values, tables, and notes. Drag a tile to reorder."),e[18]=n,e[19]=L):L=e[19];let $;e[20]!==L?($=(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:L}),e[20]=L,e[21]=$):$=e[21];let M;e[22]!==m||e[23]!==k||e[24]!==n?(M=!m&&(0,a.jsx)(X,{"data-testid":"dashboards-add",onClick:k,size:"sm",type:"button",children:n("Add widget")}),e[22]=m,e[23]=k,e[24]=n,e[25]=M):M=e[25];let z;e[26]!==$||e[27]!==M?(z=(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[$,M]}),e[26]=$,e[27]=M,e[28]=z):z=e[28];let q;e[29]!==o||e[30]!==n?(q=o.reason("chart")!==void 0&&(0,a.jsx)(le,{className:"text-xs",testId:"dashboards-suggest-error",variant:"destructive",children:n("Could not suggest a chart for that result.")}),e[29]=o,e[30]=n,e[31]=q):q=e[31];let B;e[32]!==s||e[33]!==h||e[34]!==m||e[35]!==W?(B=m&&(0,a.jsx)(Fe,{draft:s,editing:h!==null,onCancel:O,onChange:i,onSubmit:W}),e[32]=s,e[33]=h,e[34]=m,e[35]=W,e[36]=B):B=e[36];let I;e[37]!==o.unavailable||e[38]!==m||e[39]!==v||e[40]!==T||e[41]!==H||e[42]!==R||e[43]!==N||e[44]!==K||e[45]!==n||e[46]!==l?(I=l.length===0&&!m?(0,a.jsx)(me,{description:n("Add a chart, a single value, a table, or a note. Everything is saved on this browser."),testId:"dashboards-empty",title:n("No widgets yet")}):(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3","data-testid":"dashboards-grid",children:l.map((p,b)=>(0,a.jsx)(_e,{draggedRef:u,first:b===0,inferring:v===p.id,last:b===l.length-1,onEdit:T,onMove:H,onRemove:R,onReorder:N,onSuggest:o.unavailable?void 0:K,widget:p},p.id))}),e[37]=o.unavailable,e[38]=m,e[39]=v,e[40]=T,e[41]=H,e[42]=R,e[43]=N,e[44]=K,e[45]=n,e[46]=l,e[47]=I):I=e[47];let A;return e[48]!==z||e[49]!==q||e[50]!==B||e[51]!==I?(A=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-dashboards",children:[z,q,B,I]}),e[48]=z,e[49]=q,e[50]=B,e[51]=I,e[52]=A):A=e[52],A},"it");export{tt as default};
@@ -0,0 +1 @@
1
+ import{a as ee}from"./chunk-5WJXVZMZ.js";import{b as Z}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{d as se,f as X}from"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as re}from"./chunk-FKVZRPV5.js";import{a as O}from"./chunk-WUWBZPUK.js";import{d as le,r as ne}from"./chunk-FODLDLE2.js";import{a as k,d as ae,f as ce,g as me,i as Y}from"./chunk-YKXDMIHQ.js";var te=ae(ce(),1);var a=ae(me(),1);var pe="/_lunora/health",he="/_lunora/health/ready",ue=k((r,e)=>(r.endsWith("/")?r.slice(0,-1):r)+e,"me"),fe=k(()=>{let r=X();return async e=>{let w=e==="ready"?he:pe,t=r.getAuthToken(),y=ue(r.url,w);try{let i=await fetch(y,{headers:t===null?{}:{authorization:`Bearer ${t}`}}),p=null;try{p=await i.json()}catch{p=null}return{body:p,ok:i.ok,status:i.status}}catch(i){return{body:null,error:i instanceof Error?i.message:String(i),ok:!1,status:0}}}},"pe"),ge={crit:"bg-destructive",ok:"bg-success",warn:"bg-warning"},ye=k(r=>r==="unhealthy"?"crit":r==="degraded"?"warn":"ok","fe"),ie=k(r=>{let e=(0,te.c)(13),{label:w,level:t,testId:y,value:i}=r,p=ge[t],d;e[0]!==p?(d=Y("size-1.5 shrink-0 rounded-full",p),e[0]=p,e[1]=d):d=e[1];let o;e[2]!==d?(o=(0,a.jsx)("span",{"aria-hidden":"true",className:d}),e[2]=d,e[3]=o):o=e[3];let c;e[4]!==w||e[5]!==o?(c=(0,a.jsxs)("span",{className:"flex items-center gap-1.5 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:[o,w]}),e[4]=w,e[5]=o,e[6]=c):c=e[6];let h;e[7]!==y||e[8]!==i?(h=(0,a.jsx)("span",{className:"text-lg font-semibold text-foreground","data-testid":y,children:i}),e[7]=y,e[8]=i,e[9]=h):h=e[9];let C;return e[10]!==c||e[11]!==h?(C=(0,a.jsx)(O,{className:"gap-0 py-0",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[c,h]})}),e[10]=c,e[11]=h,e[12]=C):C=e[12],C},"Z"),Pe=k(r=>{let e=(0,te.c)(107),{probe:w}=r,t=le(),y=X(),i=fe(),p=w??i,d;e[0]!==p?(d=k(async()=>{let[s,n]=await Promise.all([p("live"),p("ready")]);return{live:s,ready:n}},"o"),e[0]=p,e[1]=d):d=e[1];let o;e[2]!==y?(o=y.clientIdentifier(),e[2]=y,e[3]=o):o=e[3];let c;e[4]!==o?(c=["deployment-health",o],e[4]=o,e[5]=c):c=e[5];let h;e[6]!==d||e[7]!==c?(h={queryFn:d,queryKey:c},e[6]=d,e[7]=c,e[8]=h):h=e[8];let{data:C,isPending:de}=se(h),Q=C?.live??null,oe=C?.ready??null;if(de){let s;return e[9]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"deployment-health-loading",children:[(0,a.jsx)(ee,{className:"h-16 w-full"}),(0,a.jsx)(ee,{className:"h-40 w-full"})]}),e[9]=s):s=e[9],s}let l=Q?.body??null;if(l===null){let s=Q?.status===403,n;e[10]!==s||e[11]!==Q?.error||e[12]!==t?(n=s?t("The health endpoint is in the admin posture. Paste a valid admin token in the connect popover, or set its auth to public."):t("Couldn't reach the health endpoint: {message}",{message:Q?.error??t("no response")}),e[10]=s,e[11]=Q?.error,e[12]=t,e[13]=n):n=e[13];let m;e[14]!==t?(m=t("Health endpoint unavailable"),e[14]=t,e[15]=m):m=e[15];let f;return e[16]!==n||e[17]!==m?(f=(0,a.jsx)(re,{description:n,testId:"deployment-health-error",title:m}),e[16]=n,e[17]=m,e[18]=f):f=e[18],f}let J;e[19]!==l.status?(J=ye(l.status),e[19]=l.status,e[20]=J):J=e[20];let W=J,u;if(l.status==="unhealthy"){let s;e[21]!==t?(s=t("Unhealthy"),e[21]=t,e[22]=s):s=e[22],u=s}else if(l.status==="degraded"){let s;e[23]!==t?(s=t("Degraded"),e[23]=t,e[24]=s):s=e[24],u=s}else{let s;e[25]!==t?(s=t("Healthy"),e[25]=t,e[26]=s):s=e[26],u=s}let j=oe?.ok??!1,G=j?"ok":"crit",H,I,P,x,N,v,S,V,b,_;if(e[27]!==l.appName||e[28]!==l.appVersion||e[29]!==l.checks||e[30]!==l.timestamp||e[31]!==W||e[32]!==G||e[33]!==j||e[34]!==u||e[35]!==t){let s=[...l.checks].toSorted(xe);I="flex flex-col gap-6",P="deployment-health";let n;e[46]!==t?(n=t("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint \u2014 wire an uptime monitor or a Cloudflare Health Check at it."),e[46]=t,e[47]=n):n=e[47],e[48]!==n?(x=(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:n}),e[48]=n,e[49]=x):x=e[49];let m;e[50]!==u?(m=(0,a.jsx)("span",{className:"text-sm font-semibold text-foreground","data-testid":"dh-status",children:u}),e[50]=u,e[51]=m):m=e[51];let f;e[52]!==l.appName||e[53]!==l.appVersion?(f=(0,a.jsxs)("span",{className:"font-mono text-[13px] text-muted-foreground","data-testid":"dh-app",children:[l.appName," \xB7 ",l.appVersion]}),e[52]=l.appName,e[53]=l.appVersion,e[54]=f):f=e[54];let D;e[55]!==m||e[56]!==f?(D=(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsxs)("div",{className:"grid leading-tight",children:[m,f]})}),e[55]=m,e[56]=f,e[57]=D):D=e[57];let L;e[58]!==t?(L=t("Checked"),e[58]=t,e[59]=L):L=e[59];let T;e[60]!==L?(T=(0,a.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:L}),e[60]=L,e[61]=T):T=e[61];let $;e[62]!==l.timestamp?($=ne(l.timestamp),e[62]=l.timestamp,e[63]=$):$=e[63];let q;e[64]!==$?(q=(0,a.jsx)("time",{className:"text-[13px] text-muted-foreground","data-testid":"dh-timestamp",children:$}),e[64]=$,e[65]=q):q=e[65];let B;e[66]!==T||e[67]!==q?(B=(0,a.jsxs)("div",{className:"text-end",children:[T,q]}),e[66]=T,e[67]=q,e[68]=B):B=e[68],e[69]!==D||e[70]!==B?(N=(0,a.jsx)(O,{className:"gap-0 py-0",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 p-4",children:[D,B]})}),e[69]=D,e[70]=B,e[71]=N):N=e[71];let E;e[72]!==t?(E=t("Liveness"),e[72]=t,e[73]=E):E=e[73];let R;e[74]!==W||e[75]!==u||e[76]!==E?(R=(0,a.jsx)(ie,{label:E,level:W,testId:"dh-liveness",value:u}),e[74]=W,e[75]=u,e[76]=E,e[77]=R):R=e[77];let U;e[78]!==t?(U=t("Readiness"),e[78]=t,e[79]=U):U=e[79];let A;e[80]!==j||e[81]!==t?(A=t(j?"Ready":"Not ready"),e[80]=j,e[81]=t,e[82]=A):A=e[82];let F;e[83]!==G||e[84]!==U||e[85]!==A?(F=(0,a.jsx)(ie,{label:U,level:G,testId:"dh-readiness",value:A}),e[83]=G,e[84]=U,e[85]=A,e[86]=F):F=e[86],e[87]!==R||e[88]!==F?(v=(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2","data-testid":"dh-probes",children:[R,F]}),e[87]=R,e[88]=F,e[89]=v):v=e[89],H=O,S="gap-0 py-0",V="dh-checks";let K;e[90]!==t?(K=t("Subsystem checks"),e[90]=t,e[91]=K):K=e[91],e[92]!==K?(b=(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:K})}),e[92]=K,e[93]=b):b=e[93],_=s.length===0?(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"dh-checks-empty",children:t("No checks reported.")}):(0,a.jsx)("ul",{className:"divide-y divide-border",children:s.map(g=>(0,a.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2.5 text-xs","data-testid":`dh-check-${g.name}`,children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:Y("size-1.5 shrink-0 rounded-full",g.status==="up"?"bg-success":"bg-destructive")}),(0,a.jsx)("span",{className:"font-mono text-foreground",children:g.name}),g.critical&&(0,a.jsx)(Z,{variant:"outline",children:t("Critical")})]}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[g.message!==void 0&&(0,a.jsx)("span",{className:"text-muted-foreground",children:g.message}),(0,a.jsx)(Z,{"data-testid":`dh-check-status-${g.name}`,variant:g.status==="up"?"secondary":"destructive",children:g.status==="up"?t("Up"):t("Down")})]})]},g.name))}),e[27]=l.appName,e[28]=l.appVersion,e[29]=l.checks,e[30]=l.timestamp,e[31]=W,e[32]=G,e[33]=j,e[34]=u,e[35]=t,e[36]=H,e[37]=I,e[38]=P,e[39]=x,e[40]=N,e[41]=v,e[42]=S,e[43]=V,e[44]=b,e[45]=_}else H=e[36],I=e[37],P=e[38],x=e[39],N=e[40],v=e[41],S=e[42],V=e[43],b=e[44],_=e[45];let z;e[94]!==H||e[95]!==S||e[96]!==V||e[97]!==b||e[98]!==_?(z=(0,a.jsxs)(H,{className:S,"data-testid":V,children:[b,_]}),e[94]=H,e[95]=S,e[96]=V,e[97]=b,e[98]=_,e[99]=z):z=e[99];let M;return e[100]!==I||e[101]!==P||e[102]!==x||e[103]!==N||e[104]!==v||e[105]!==z?(M=(0,a.jsxs)("div",{className:I,"data-testid":P,children:[x,N,v,z]}),e[100]=I,e[101]=P,e[102]=x,e[103]=N,e[104]=v,e[105]=z,e[106]=M):M=e[106],M},"Pe");function xe(r,e){return r.name.localeCompare(e.name)}k(xe,"he");export{Pe as DeploymentHealthPanel};
@@ -0,0 +1 @@
1
+ import{a as f,d as i,e as d,f as h}from"./chunk-YKXDMIHQ.js";var m=i(h(),1),e=i(d(),1);var E=5e3,p=f((s,r,l)=>{let t=(0,m.c)(6),o=l===void 0?E:l,u=(0,e.useRef)(s),n;t[0]!==s?(n=f(()=>{u.current=s},"s"),t[0]=s,t[1]=n):n=t[1],(0,e.useEffect)(n);let a,c;t[2]!==r||t[3]!==o?(a=f(()=>{if(!r)return;let R=setInterval(()=>{globalThis.document?.hidden!==!0&&u.current()},o);return()=>{clearInterval(R)}},"c"),c=[r,o],t[2]=r,t[3]=o,t[4]=a,t[5]=c):(a=t[4],c=t[5]),(0,e.useEffect)(a,c)},"h");export{p as a};
@@ -0,0 +1 @@
1
+ import{b as Nr}from"./chunk-Y6CXU7T4.js";import{a as i,d as k,e as B,g as Z}from"./chunk-YKXDMIHQ.js";var jn=k(B(),1),ie=jn.createContext(null);var Kn=k(B(),1);function D(t){return Kn.useContext(ie)}i(D,"useRouter");var Ue=k(B(),1),xt=Ue.createContext(void 0),qn=Ue.createContext(void 0);function dt(t){return t[t.length-1]}i(dt,"last");function q(t,e){return typeof t=="function"?t(e):t}i(q,"functionalUpdate");var Xn=Object.prototype.hasOwnProperty,Or=Object.prototype.propertyIsEnumerable;function ht(t){for(let e in t)if(Xn.call(t,e))return!0;return!1}i(ht,"hasKeys");var Tr=i(()=>Object.create(null),"createNull"),pt=i((t,e)=>rt(t,e,Tr),"nullReplaceEqualDeep");function rt(t,e,n=()=>({}),r=0){if(!1)return e;if(t===e)return t;if(r>500)return e;let o=e,s=Ve(t)&&Ve(o);if(!s&&!(Ht(t)&&Ht(o)))return o;let c=s?t:Gn(t);if(!c)return o;let a=s?o:Gn(o);if(!a)return o;let u=c.length,l=a.length,f=s?new Array(l):n(),d=0;for(let h=0;h<l;h++){let p=s?h:a[h],g=t[p],m=o[p];if(g===m){f[p]=g,(s?h<u:Xn.call(t,p))&&d++;continue}if(g===null||m===null||typeof g!="object"||typeof m!="object"){f[p]=m;continue}let y=rt(g,m,n,r+1);f[p]=y,y===g&&d++}return u===l&&d===u?t:f}i(rt,"replaceEqualDeep");function Gn(t){let e=Object.keys(t);if(e.length!==Object.getOwnPropertyNames(t).length)return!1;let n=Object.getOwnPropertySymbols(t);if(n.length===0)return e;for(let r of n){if(!Or.call(t,r))return!1;e.push(r)}return e}i(Gn,"getEnumerableOwnKeys");function Ht(t){if(!Jn(t))return!1;let e=t.constructor;if(typeof e>"u")return!0;let n=e.prototype;return!(!Jn(n)||!n.hasOwnProperty("isPrototypeOf"))}i(Ht,"isPlainObject");function Jn(t){return Object.prototype.toString.call(t)==="[object Object]"}i(Jn,"hasObjectPrototype");function Ve(t){return Array.isArray(t)&&t.length===Object.keys(t).length}i(Ve,"isPlainArray");function Q(t,e,n){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0,o=t.length;r<o;r++)if(!Q(t[r],e[r],n))return!1;return!0}if(Ht(t)&&Ht(e)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let c in e)if((!r||e[c]!==void 0)&&!Q(t[c],e[c],n))return!1;return!0}let o=0;if(!r)o=Object.keys(t).length;else for(let c in t)t[c]!==void 0&&o++;let s=0;for(let c in e)if((!r||e[c]!==void 0)&&(s++,s>o||!Q(t[c],e[c],n)))return!1;return o===s}return!1}i(Q,"deepEqual");var Dr=/[\x00-\x1f\x7f"<>`{}]/g;function Fr(t){return t.replace(Dr,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}i(Fr,"sanitizePathSegment");function Yn(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return Fr(e)}i(Yn,"decodeSegment");var We=["http:","https:","mailto:","tel:"];function st(t,e){if(!t)return!1;try{let n=new URL(t);return!e.has(n.protocol)}catch{return!1}}i(st,"isDangerousProtocol");function Dt(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};let e=/%25|%5C/gi,n=0,r="",o;for(;(o=e.exec(t))!==null;)r+=Yn(t.slice(n,o.index))+o[0],n=e.lastIndex;r=r+Yn(n?t.slice(n):t);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}i(Dt,"decodePath");function Zn(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}i(Zn,"encodePathLikeUrl");function Qn(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}i(Qn,"arraysEqual");function mt(){throw new Error("Invariant failed")}i(mt,"invariant");function Ft(t){let e=new Map,n,r,o=i(s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)},"touch");return{get(s){let c=e.get(s);if(c)return o(c),c.value},set(s,c){if(e.size>=t&&n){let u=n;e.delete(u.key),u.next&&(n=u.next,u.next.prev=void 0),u===r&&(r=void 0)}let a=e.get(s);if(a)a.value=c,o(a);else{let u={key:s,value:c,prev:r};r&&(r.next=u),r=u,n||(n=u),e.set(s,u)}},clear(){e.clear(),n=void 0,r=void 0}}}i(Ft,"createLRUCache");var gt=4,eo=5;function ze(t,e,n=new Uint16Array(6)){let r=t.indexOf("/",e),o=r===-1?t.length:r,s=t.substring(e,o);if(!s||!s.includes("$"))return n[0]=0,n[1]=e,n[2]=e,n[3]=o,n[4]=o,n[5]=o,n;if(s==="$"){let u=t.length;return n[0]=2,n[1]=e,n[2]=e,n[3]=u,n[4]=u,n[5]=u,n}if(s.charCodeAt(0)===36)return n[0]=1,n[1]=e,n[2]=e+1,n[3]=o,n[4]=o,n[5]=o,n;let c=s.indexOf("{"),a;if(c!==-1&&c+1<s.length&&(a=s.indexOf("}",c))!==-1){let u=s.charCodeAt(c+1);if(u===45){if(c+2<s.length&&s.charCodeAt(c+2)===36){let l=c+3,f=a;if(l<f)return n[0]=3,n[1]=e+c,n[2]=e+l,n[3]=e+f,n[4]=e+a+1,n[5]=o,n}}else if(u===36){let l=c+1,f=c+2;return f===a?(n[0]=2,n[1]=e+c,n[2]=e+l,n[3]=e+f,n[4]=e+a+1,n[5]=t.length,n):(n[0]=1,n[1]=e+c,n[2]=e+f,n[3]=e+a,n[4]=e+a+1,n[5]=o,n)}}return n[0]=0,n[1]=e,n[2]=e,n[3]=o,n[4]=o,n[5]=o,n}i(ze,"parseSegment");function le(t,e,n,r,o,s,c,a){a?.(n);let u=r;{let l=n.fullPath??n.from,f=n.options,d=l.length,h=f?.caseSensitive??t,p=f?.params?.parse??f?.parseParams;for(;u<d;){let m=ze(l,u,e),y,R=u,v=m[5];u=v+1,s++;let _=m[0];switch(_){case 0:{let x=l.substring(m[2],m[3]),L=x,b;h?b=o.static??=new Map:(L=x.toLowerCase(),b=o.staticInsensitive??=new Map);let S=b.get(L);if(S)y=S;else{let C=Mt(l);C.parent=o,C.depth=s,y=C,b.set(L,C)}break}case 1:case 3:case 2:{let x=l.substring(R,m[1]),L=l.substring(m[4],v),b=h&&!!(x||L);h||(x=x.toLowerCase(),L=L.toLowerCase());let S=_===1?o.dynamic:_===3?o.optional:o.wildcard,C=_!==2&&!p&&S?.find(w=>!w.parse&&w.caseSensitive===b&&w.prefix===x&&w.suffix===L);if(C)y=C;else{let w=Mr(_,l,b,x,L);y=w,w.parent=o,w.depth=s;let P;_===1?P=o.dynamic??=[]:_===3?P=o.optional??=[]:P=o.wildcard??=[],P.push(w),P.length===2&&c?.push(P)}break}}o=y}if(p&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){let m=Mt(l);m.kind=eo,m.parent=o,s++,m.depth=s,o.pathless??=[],o.pathless.push(m),o=m}let g=(n.path||!n.children)&&!n.isRoot;if(g&&l.endsWith("/")){let m=Mt(l);m.kind=gt,m.parent=o,s++,m.depth=s,o.index=m,o=m}o.parse=p??null,o.priority=f?.params?.priority??0,g&&!o.route&&(o.route=n,o.fullPath=l)}if(n.children)for(let l of n.children)le(t,e,l,u,o,s,c,a)}i(le,"parseSegments");function no(t,e){if(t.parse&&!e.parse)return-1;if(!t.parse&&e.parse)return 1;if(t.parse&&e.parse&&(t.priority||e.priority))return e.priority-t.priority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}i(no,"sortDynamic");function Mt(t){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0}}i(Mt,"createStaticNode");function Mr(t,e,n,r,o){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:o}}i(Mr,"createDynamicNode");function oo(t,e){let n=Mt("/"),r=new Uint16Array(6),o=[];for(let s of t)le(!1,r,s,1,n,0,o);for(let s of o)s.sort(no);e.masksTree=n,e.flatCache=Ft(1e3)}i(oo,"processRouteMasks");function ro(t,e){t||="/";let n=e.flatCache.get(t);if(n!==void 0)return n;let r=He(t,e.masksTree);return e.flatCache.set(t,r),r}i(ro,"findFlatMatch");function so(t,e,n,r,o){t||="/",r||="/";let s=e?`case\0${t}`:t,c=o.singleCache.get(s);return c||(c=Mt("/"),le(e,new Uint16Array(6),{from:t},1,c,0),o.singleCache.set(s,c)),He(r,c,n)}i(so,"findSingleMatch");function io(t,e,n=!1){let r=n?t:`nofuzz\0${t}`,o=e.matchCache.get(r);if(o!==void 0)return o;t||="/";let s;try{s=He(t,e.segmentTree,n)}catch(c){if(c instanceof URIError)s=null;else throw c}return s&&(s.branch=je(s.route)),e.matchCache.set(r,s),s}i(io,"findRouteMatch");function Ar(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}i(Ar,"trimPathRight");function ao(t,e=!1,n){let r=Mt(t.fullPath),o=new Uint16Array(6),s=[],c={},a={},u=0;le(e,o,t,1,r,0,s,l=>{if(n?.(l,u),l.id in c&&mt(),c[l.id]=l,u!==0&&l.path){let f=Ar(l.fullPath);(!a[f]||l.fullPath.endsWith("/"))&&(a[f]=l)}u++});for(let l of s)l.sort(no);return{processedTree:{segmentTree:r,singleCache:Ft(1e3),matchCache:Ft(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:a}}i(ao,"processRouteTree");function He(t,e,n=!1){let r=t.split("/"),o=Br(t,r,e,n);if(!o)return null;let[s]=co(t,r,o);return{route:o.node.route,rawParams:s}}i(He,"findMatch");function co(t,e,n){let r=$r(n.node),o=null,s=Object.create(null),c=n.extract?.part??0,a=n.extract?.node??0,u=n.extract?.path??0,l=n.extract?.segment??0;for(;a<r.length;c++,a++,u++,l++){let f=r[a];if(f.kind===gt)break;if(f.kind===eo){l--,c--,u--;continue}let d=e[c],h=u;if(d&&(u+=d.length),f.kind===1){o??=n.node.fullPath.split("/");let p=o[l],g=f.prefix.length;if(p.charCodeAt(g)===123){let m=f.suffix.length,y=p.substring(g+2,p.length-m-1),R=d.substring(g,d.length-m);s[y]=decodeURIComponent(R)}else{let m=p.substring(1);s[m]=decodeURIComponent(d)}}else if(f.kind===3){if(n.skipped&1<<a){c--,u=h-1;continue}o??=n.node.fullPath.split("/");let p=o[l],g=f.prefix.length,m=f.suffix.length,y=p.substring(g+3,p.length-m-1),R=f.suffix||f.prefix?d.substring(g,d.length-m):d;R&&(s[y]=decodeURIComponent(R))}else if(f.kind===2){let p=f,g=t.substring(h+p.prefix.length,t.length-p.suffix.length),m=decodeURIComponent(g);s["*"]=m,s._splat=m;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:c,node:a,path:u,segment:l}]}i(co,"extractParams");function je(t){let e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}i(je,"buildRouteBranch");function $r(t){let e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}i($r,"buildBranch");function Br(t,e,n,r){if(t==="/"&&n.index)return{node:n.index,skipped:0};let o=!dt(e),s=o&&t!=="/",c=e.length-(o?1:0),a=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],u=null,l=null;for(;a.length;){let f=a.pop(),{node:d,index:h,skipped:p,statics:g,dynamics:m,optionals:y}=f,{extract:R,rawParams:v}=f;if(d.kind===2&&d.route&&!ce(l,f))continue;if(d.parse){if(!to(t,e,f))continue;v=f.rawParams,R=f.extract}r&&d.route&&d.kind!==gt&&ce(u,f)&&(u=f);let _=h===c;if(_&&(d.route&&(!s||d.kind===gt||d.kind===2)&&ce(l,f)&&(l=f),!d.optional&&!d.wildcard&&!d.index&&!d.pathless))continue;let x=_?void 0:e[h],L;if(_&&d.index){let b={node:d.index,index:h,skipped:p,statics:g,dynamics:m,optionals:y,extract:R,rawParams:v},S=!0;if(d.index.parse&&(to(t,e,b)||(S=!1)),S){if(!m&&!y&&!p&&Ur(g,c))return b;ce(l,b)&&(l=b)}}if(d.wildcard)for(let b=d.wildcard.length-1;b>=0;b--){let S=d.wildcard[b],{prefix:C,suffix:w}=S;if(!(C&&(_||!(S.caseSensitive?x:L??=x.toLowerCase()).startsWith(C)))){if(w){if(_)continue;let P=e.slice(h).join("/"),E=P.slice(-w.length);if((S.caseSensitive?E:E.toLowerCase())!==w||P.length-w.length<C.length)continue}a.push({node:S,index:c,skipped:p,statics:g,dynamics:m,optionals:y,extract:R,rawParams:v})}}if(d.optional){let b=p|1<<d.depth+1;for(let S=d.optional.length-1;S>=0;S--){let C=d.optional[S];a.push({node:C,index:h,skipped:b,statics:g,dynamics:m,optionals:y,extract:R,rawParams:v})}if(!_)for(let S=d.optional.length-1;S>=0;S--){let C=d.optional[S],{prefix:w,suffix:P}=C;if(w||P){let E=C.caseSensitive?x:L??=x.toLowerCase();if(w&&!E.startsWith(w)||P&&E.indexOf(P,E.length-P.length)<w.length)continue}a.push({node:C,index:h+1,skipped:p,statics:g,dynamics:m,optionals:y+ae(c,h),extract:R,rawParams:v})}}if(!_&&d.dynamic&&x)for(let b=d.dynamic.length-1;b>=0;b--){let S=d.dynamic[b],{prefix:C,suffix:w}=S;if(C||w){let P=S.caseSensitive?x:L??=x.toLowerCase();if(C&&!P.startsWith(C)||w&&P.indexOf(w,P.length-w.length)<C.length)continue}a.push({node:S,index:h+1,skipped:p,statics:g,dynamics:m+ae(c,h),optionals:y,extract:R,rawParams:v})}if(!_&&d.staticInsensitive){let b=d.staticInsensitive.get(L??=x.toLowerCase());b&&a.push({node:b,index:h+1,skipped:p,statics:g+ae(c,h),dynamics:m,optionals:y,extract:R,rawParams:v})}if(!_&&d.static){let b=d.static.get(x);b&&a.push({node:b,index:h+1,skipped:p,statics:g+ae(c,h),dynamics:m,optionals:y,extract:R,rawParams:v})}if(d.pathless)for(let b=d.pathless.length-1;b>=0;b--){let S=d.pathless[b];a.push({node:S,index:h,skipped:p,statics:g,dynamics:m,optionals:y,extract:R,rawParams:v})}}if(l)return l;if(r&&u){let f=u.index;for(let h=0;h<u.index;h++)f+=e[h].length;let d=f===t.length?"/":t.slice(f);return u.rawParams??=Object.create(null),u.rawParams["**"]=decodeURIComponent(d),u}return null}i(Br,"getNodeMatch");function ae(t,e){return 2**(t-e-1)}i(ae,"segmentScore");function Ur(t,e){return t===2**(e-1)-1}i(Ur,"isPerfectStaticMatch");function to(t,e,n){let r,o;try{[r,o]=co(t,e,n)}catch{return null}if(n.rawParams=r,n.extract=o,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}i(to,"validateParseParams");function ce(t,e){return t?e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((e.node.kind===gt)>(t.node.kind===gt)||e.node.kind===gt==(t.node.kind===gt)&&e.node.depth>t.node.depth))):!0}i(ce,"isFrameMoreSpecific");function bt(t){return Kt(t.filter(e=>e!==void 0).join("/"))}i(bt,"joinPaths");function Kt(t){return t.replace(/\/{2,}/g,"/")}i(Kt,"cleanPath");function ue(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}i(ue,"trimPathLeft");function G(t){let e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/{1,}$/,""):t}i(G,"trimPathRight");function qt(t){return G(ue(t))}i(qt,"trimPath");function yt(t,e){return t?.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}i(yt,"removeTrailingSlash");function fe(t,e,n){return yt(t,n)===yt(e,n)}i(fe,"exactPathTest");function Ke({base:t,to:e,trailingSlash:n="never",cache:r}){if(e.includes("//")&&(e=Kt(e)),e.startsWith("/"))return e.length===1||n==="preserve"?e:n==="always"?e.endsWith("/")?e:`${e}/`:e.endsWith("/")?e.slice(0,-1):e;let o=e===".",s;if(r){s=o?t:t+"\0"+e;let l=r.get(s);if(l)return l}let c;if(o)c=t.split("/");else{for(t.includes("//")&&(t=Kt(t)),c=t.split("/");c.length>1&&dt(c)==="";)c.pop();let l=e.split("/");for(let f=0,d=l.length;f<d;f++){let h=l[f];h===""?f?f===d-1&&c.push(h):c=[h]:h===".."?c.length>1?c.pop():c=[""]:h==="."||c.push(h)}}c.length>1&&(dt(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));let a=c.join("/"),u=(o?Kt(a):a)||"/";return s&&r&&r.set(s,u),u}i(Ke,"resolvePath");function uo(t){let e=new Map(t.map(o=>[encodeURIComponent(o),o])),n=Array.from(e.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return o=>o.replace(r,s=>e.get(s)??s)}i(uo,"compileDecodeCharMap");function jt(t,e,n){let r=e[t];return typeof r!="string"?r:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(o=>lo(o,n)).join("/"):lo(r,n)}i(jt,"encodeParam");function de({path:t,params:e,decoder:n,...r}){let o=!1,s=Object.create(null);if(!t||t==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:o};if(!t.includes("$"))return{interpolatedPath:t,usedParams:s,isMissingParams:o};if(!1){let f=t.length,d=0,h="";for(;d<f;){for(;d<f&&t.charCodeAt(d)===47;)d++;if(d>=f)break;let p=d,g=t.indexOf("/",d);g===-1&&(g=f),d=g;let m=t.substring(p,g);if(m)if(m.charCodeAt(0)===36)if(m.length===1){let y=e._splat;if(s._splat=y,s["*"]=y,!y){o=!0;continue}let R=jt("_splat",e,n);h+="/"+R}else{let y=m.substring(1);!o&&!(y in e)&&(o=!0),s[y]=e[y];let R=jt(y,e,n)??"undefined";h+="/"+R}else h+="/"+m}return t.endsWith("/")&&(h+="/"),{usedParams:s,interpolatedPath:h||"/",isMissingParams:o}}let c=t.length,a=0,u,l="";for(;a<c;){let f=a;u=ze(t,f,u);let d=u[5];if(a=d+1,f===d)continue;let h=u[0];if(h===0){l+="/"+t.substring(f,d);continue}if(h===2){let p=e._splat;s._splat=p,s["*"]=p;let g=t.substring(f,u[1]),m=t.substring(u[4],d);if(!p){o=!0,(g||m)&&(l+="/"+g+m);continue}let y=jt("_splat",e,n);l+="/"+g+y+m;continue}if(h===1){let p=t.substring(u[2],u[3]);!o&&!(p in e)&&(o=!0),s[p]=e[p];let g=t.substring(f,u[1]),m=t.substring(u[4],d),y=jt(p,e,n)??"undefined";l+="/"+g+y+m;continue}if(h===3){let p=t.substring(u[2],u[3]),g=e[p];if(g==null)continue;s[p]=g;let m=t.substring(f,u[1]),y=t.substring(u[4],d),R=jt(p,e,n)??"";l+="/"+m+R+y;continue}}return t.endsWith("/")&&(l+="/"),{usedParams:s,interpolatedPath:l||"/",isMissingParams:o}}i(de,"interpolatePath");function lo(t,e){let n=encodeURIComponent(t);return e?.(n)??n}i(lo,"encodePathParam");function J(t){return t?.isNotFound===!0}i(J,"isNotFound");function Vr(){try{return sessionStorage}catch{return}}i(Vr,"getSafeSessionStorage");var Wr="tsr-scroll-restoration-v1_3",po=Vr();function zr(){try{return JSON.parse(po?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}i(zr,"createScrollRestorationCache");function Hr(){try{po?.setItem(Wr,JSON.stringify(At))}catch{}}i(Hr,"persistScrollRestorationCache");var At=zr(),fo="data-scroll-restoration-id",jr=i(t=>t.state.__TSR_key||t.href,"defaultGetScrollRestorationKey");function Kr(t){let e=t.getAttribute(fo);if(e)return`[${fo}="${e}"]`;let n="",r=t,o;for(;o=r.parentNode;){let s=1,c=r;for(;c=c.previousElementSibling;)s++;let a=`${r.localName}:nth-child(${s})`;n=n?`${a} > ${n}`:a,r=o}return n}i(Kr,"getScrollRestorationSelector");var he=!1,pe="window";function qe(t){try{return typeof t=="function"?t():document.querySelector(t)}catch{}}i(qe,"getElement");function ho(t){let e=new Set;for(let n of t){if(n===pe)continue;let r=qe(n);r&&e.add(r)}return e}i(ho,"getScrollToTopElements");function mo(t,e){let n=e??t.options.scrollRestoration,r=t._scroll;if(n&&(r.restoring=!0),!1)return;let o=t.options.getScrollRestorationKey||jr,s=new Set,c=i(a=>{let u=At[a]||={};for(let l of s)l===document?u[pe]={scrollX,scrollY}:l.isConnected&&(u[Kr(l)]={scrollX:l.scrollLeft,scrollY:l.scrollTop})},"snapshotCurrentScrollTargets");n&&!r.restoration&&(r.restoration=!0,he=!1,history.scrollRestoration="manual",document.addEventListener("scroll",a=>{he||s.add(a.target)},!0),t.subscribe("onBeforeLoad",a=>{a.fromLocation&&c(o(a.fromLocation)),s.clear()}),addEventListener("pagehide",()=>{c(o(t.stores.resolvedLocation.get()??t.stores.location.get())),Hr()})),!r.reset&&(r.reset=!0,t.subscribe("onRendered",a=>{let u=t.options.scrollRestorationBehavior,l=t.options.scrollToTopSelectors,f=r.next,d=r.hash,h;if(s.clear(),r.next=!0,r.hash=!1,typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return;let p=o(a.toLocation),g=a.fromLocation&&o(a.fromLocation);if(r.restoring&&g&&g!==p){let m=At[g];if(m){let y=At[p];for(let R in m){if(R===pe){if(f)continue}else{let v=qe(R);if(!v||f&&l&&(h??=ho(l),h.has(v)))continue}y||(y=At[p]={}),y[R]??=m[R]}}}he=!0;try{let m=a.toLocation.hash,y=a.toLocation.state.__hashScrollIntoViewOptions??!0,R=!1;if(f){!m&&l&&(h??=ho(l));let v=m&&y&&d,_=r.restoring?At[p]:void 0;if(_)for(let x in _){let{scrollX:L,scrollY:b}=_[x];if(x===pe){if(v)continue;scrollTo({top:b,left:L,behavior:u}),R=!0}else{let S=qe(x);S&&(S.scrollLeft=L,S.scrollTop=b,h?.delete(S))}}if(!m){let x={top:0,left:0,behavior:u};if(R||scrollTo(x),h)for(let L of h)L.scrollTo(x)}}!R&&m&&y&&document.getElementById(m)?.scrollIntoView(y)}finally{he=!1}}))}i(mo,"setupScrollRestoration");function go(t,e=String){let n=new URLSearchParams;for(let r in t){let o=t[r];o!==void 0&&n.set(r,e(o))}return n.toString()}i(go,"encode");function Ge(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}i(Ge,"toValue");function yo(t){let e=new URLSearchParams(t),n=Object.create(null);for(let[r,o]of e.entries()){let s=n[r];s==null?n[r]=Ge(o):Array.isArray(s)?s.push(Ge(o)):n[r]=[s,Ge(o)]}return n}i(yo,"decode");var qr=/^(?:\s|["[{\d-]|fa|nu|tr)/,vo=Gr(JSON.parse),Ro=Jr(JSON.stringify,JSON.parse);function Gr(t){return e=>{e[0]==="?"&&(e=e.substring(1));let n=yo(e);for(let r in n){let o=n[r];if(typeof o=="string")try{n[r]=t(o)}catch{}}return n}}i(Gr,"parseSearchWith");function Jr(t,e){let n=e===JSON.parse;function r(o){if(o&&typeof o=="object")try{return t(o)}catch{}else if(e&&typeof o=="string"){if(n&&!qr.test(o))return o;try{return e(o),t(o)}catch{}}return o}return i(r,"stringifyValue"),o=>{let s=go(o,r);return s?`?${s}`:""}}i(Jr,"stringifySearchWith");var tt="__root__";function So(t){if(t.statusCode=t.statusCode||t.code||307,!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}let e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);let n=new Response(null,{status:t.statusCode,headers:e});if(n.options=t,t.throw)throw n;return n}i(So,"redirect");function me(t){return t instanceof Response&&!!t.options}i(me,"isRedirect");function _o(t){return{input:i(({url:e})=>{for(let n of t)e=ge(n,e);return e},"input"),output:i(({url:e})=>{for(let n=t.length-1;n>=0;n--)e=Je(t[n],e);return e},"output")}}i(_o,"composeRewrites");function wo(t){let e=qt(t.basepath),n=`/${e}`,r=t.caseSensitive?n:n.toLowerCase(),o=`${r}/`;return{input:i(({url:s})=>{let c=t.caseSensitive?s.pathname:s.pathname.toLowerCase();return c===r?s.pathname="/":c.startsWith(o)&&(s.pathname=s.pathname.slice(n.length)),s},"input"),output:i(({url:s})=>(s.pathname=bt(["/",e,s.pathname]),s),"output")}}i(wo,"rewriteBasepath");function ge(t,e){let n=t?.input?.({url:e});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return e}i(ge,"executeRewriteInput");function Je(t,e){let n=t?.output?.({url:e});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return e}i(Je,"executeRewriteOutput");function Ye(t){let e=t;return{get(){return e},set(n){e=q(n,e)}}}i(Ye,"createNonReactiveMutableStore");function Xe(t){return{get(){return t()}}}i(Xe,"createNonReactiveReadonlyStore");function xo(t,e){let{createMutableStore:n,createReadonlyStore:r,batch:o}=e,s=new Map,c=n("idle"),a=n(t),u=n(void 0),l=n([]),f=r(()=>l.get().map(m=>s.get(m).get())),d=r(()=>({status:c.get(),isLoading:c.get()==="pending",matches:f.get(),location:a.get(),resolvedLocation:u.get()}));function h(m){let y=s.get(m);return y||(y=n(void 0),s.set(m,y)),y}i(h,"getMatchStore");let p={status:c,location:a,resolvedLocation:u,ids:l,matches:f,byRoute:s,__store:d,getMatchStore:h,setMatches:g};function g(m){let y=l.get(),R=m.map(v=>v.routeId);o(()=>{Qn(y,R)||l.set(R);for(let v of y)R.includes(v)||s.get(v).set(()=>{});for(let v of m){let _=h(v.routeId);_.get()!==v&&_.set(v)}})}return i(g,"setMatches"),p}i(xo,"createRouterStores");var vt="__TSR_index",bo="popstate",Co="beforeunload";function Qe(t){let e=t.getLocation(),n=new Set,r=i(c=>{e=t.getLocation(),n.forEach(a=>a({location:e,action:c}))},"notify"),o=i(c=>{t.notifyOnIndexChange??!0?r(c):e=t.getLocation()},"handleIndexChange"),s=i(async({task:c,navigateOpts:a,...u})=>{if(a?.ignoreBlocker??!1){c();return}let l=t.getBlockers?.()??[],f=u.type==="PUSH"||u.type==="REPLACE";if(typeof document<"u"&&l.length&&f)for(let d of l){let h=$t(u.path,u.state);if(await d.blockerFn({currentLocation:e,nextLocation:h,action:u.type})){t.onBlocked?.();return}}c()},"tryNavigation");return{get location(){return e},get length(){return t.getLength()},subscribers:n,subscribe:i(c=>(n.add(c),()=>{n.delete(c)}),"subscribe"),push:i((c,a,u)=>{let l=e.state[vt];a=Ze(l+1,a),s({task:i(()=>{t.pushState(c,a),r({type:"PUSH"})},"task"),navigateOpts:u,type:"PUSH",path:c,state:a})},"push"),replace:i((c,a,u)=>{let l=e.state[vt];a=Ze(l,a),s({task:i(()=>{t.replaceState(c,a),r({type:"REPLACE"})},"task"),navigateOpts:u,type:"REPLACE",path:c,state:a})},"replace"),go:i((c,a)=>{s({task:i(()=>{t.go(c),o({type:"GO",index:c})},"task"),navigateOpts:a,type:"GO"})},"go"),back:i(c=>{s({task:i(()=>{t.back(c?.ignoreBlocker??!1),o({type:"BACK"})},"task"),navigateOpts:c,type:"BACK"})},"back"),forward:i(c=>{s({task:i(()=>{t.forward(c?.ignoreBlocker??!1),o({type:"FORWARD"})},"task"),navigateOpts:c,type:"FORWARD"})},"forward"),canGoBack:i(()=>e.state[vt]!==0,"canGoBack"),createHref:i(c=>t.createHref(c),"createHref"),block:i(c=>{if(!t.setBlockers)return()=>{};let a=t.getBlockers?.()??[];return t.setBlockers([...a,c]),()=>{let u=t.getBlockers?.()??[];t.setBlockers?.(u.filter(l=>l!==c))}},"block"),flush:i(()=>t.flush?.(),"flush"),destroy:i(()=>t.destroy?.(),"destroy"),notify:r}}i(Qe,"createHistory");function Ze(t,e){e||(e={});let n=en();return{...e,key:n,__TSR_key:n,[vt]:t}}i(Ze,"assignKeyAndIndex");function tn(t){let e=t?.window??(typeof document<"u"?window:void 0),n=e.history.pushState,r=e.history.replaceState,o=[],s=i(()=>o,"_getBlockers"),c=i(S=>o=S,"_setBlockers"),a=t?.createHref??(S=>S),u=t?.parseLocation??(()=>$t(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){let S=en();e.history.replaceState({[vt]:0,key:S,__TSR_key:S},"")}let l=u(),f,d=!1,h=!1,p=!1,g=!1,m=i(()=>l,"getLocation"),y,R=i(()=>{y&&(b._ignoreSubscribers=!0,(y[2]?e.history.pushState:e.history.replaceState)(y[1],"",y[0]),b._ignoreSubscribers=!1,y=void 0,f=void 0)},"flush"),v=i((S,C,w)=>{let P=a(C),E=!!y;E||(f=l),l=$t(C,w),y=[P,w,y?.[2]||S],E||queueMicrotask(()=>R())},"queueHistoryAction"),_=i(S=>{l=u(),b.notify({type:S})},"onPushPop"),x=i(async()=>{if(h){h=!1;return}let S=u(),C=S.state[vt]-l.state[vt],w=C===1,P=C===-1,E=!w&&!P||d;d=!1;let I=E?"GO":P?"BACK":"FORWARD",N=E?{type:"GO",index:C}:{type:P?"BACK":"FORWARD"};if(p)p=!1;else{let _t=s();if(typeof document<"u"&&_t.length){for(let nt of _t)if(await nt.blockerFn({currentLocation:l,nextLocation:S,action:I})){h=!0,e.history.go(1),b.notify(N);return}}}l=u(),b.notify(N)},"onPushPopEvent"),L=i(S=>{if(g){g=!1;return}let C=!1,w=s();if(typeof document<"u"&&w.length)for(let P of w){let E=P.enableBeforeUnload??!0;if(E===!0){C=!0;break}if(typeof E=="function"&&E()===!0){C=!0;break}}if(C)return S.preventDefault(),S.returnValue=""},"onBeforeUnload"),b=Qe({getLocation:m,getLength:i(()=>e.history.length,"getLength"),pushState:i((S,C)=>v(!0,S,C),"pushState"),replaceState:i((S,C)=>v(!1,S,C),"replaceState"),back:i(S=>(S&&(p=!0),g=!0,e.history.back()),"back"),forward:i(S=>{S&&(p=!0),g=!0,e.history.forward()},"forward"),go:i(S=>{d=!0,e.history.go(S)},"go"),createHref:i(S=>a(S),"createHref"),flush:R,destroy:i(()=>{e.history.pushState=n,e.history.replaceState=r,e.removeEventListener(Co,L,{capture:!0}),e.removeEventListener(bo,x)},"destroy"),onBlocked:i(()=>{f&&l!==f&&(l=f)},"onBlocked"),getBlockers:s,setBlockers:c,notifyOnIndexChange:!1});return e.addEventListener(Co,L,{capture:!0}),e.addEventListener(bo,x),e.history.pushState=function(...S){let C=n.apply(e.history,S);return b._ignoreSubscribers||_("PUSH"),C},e.history.replaceState=function(...S){let C=r.apply(e.history,S);return b._ignoreSubscribers||_("REPLACE"),C},b}i(tn,"createBrowserHistory");function Yr(t={initialEntries:["/"]}){let e=t.initialEntries,n=t.initialIndex?Math.min(Math.max(t.initialIndex,0),e.length-1):e.length-1,r=e.map((u,l)=>Ze(l,void 0)),o=i(()=>$t(e[n],r[n]),"getLocation"),s=[];return Qe({getLocation:o,getLength:i(()=>e.length,"getLength"),pushState:i((u,l)=>{n<e.length-1&&(e.splice(n+1),r.splice(n+1)),r.push(l),e.push(u),n=Math.max(e.length-1,0)},"pushState"),replaceState:i((u,l)=>{r[n]=l,e[n]=u},"replaceState"),back:i(()=>{n=Math.max(n-1,0)},"back"),forward:i(()=>{n=Math.min(n+1,e.length-1)},"forward"),go:i(u=>{n=Math.min(Math.max(n+u,0),e.length-1)},"go"),createHref:i(u=>u,"createHref"),getBlockers:i(()=>s,"_getBlockers"),setBlockers:i(u=>s=u,"_setBlockers")})}i(Yr,"createMemoryHistory");function Xr(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}i(Xr,"sanitizePath");function $t(t,e){let n=Xr(t),r=n.indexOf("#"),o=n.indexOf("?"),s=en();return{href:n,pathname:n.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:n.length),hash:r>-1?n.substring(r):"",search:o>-1?n.slice(o,r===-1?void 0:r):"",state:e||{[vt]:0,key:s,__TSR_key:s}}}i($t,"parseHref");function en(){return(Math.random()+1).toString(36).substring(7)}i(en,"createRandomKey");function Po(t){return t.options.loader||t.options.beforeLoad||t.lazyFn||t.options.component?.preload||t.options.pendingComponent?.preload}i(Po,"routeNeedsLoad");function Ct(t,e){return{fromLocation:e,toLocation:t,pathChanged:e?.pathname!==t.pathname,hrefChanged:e?.href!==t.href,hashChanged:e?.hash!==t.hash}}i(Ct,"getLocationChangeInfo");function Lo({key:t,__TSR_key:e,__TSR_index:n,__hashScrollIntoViewOptions:r,...o}){return o}i(Lo,"_getUserHistoryState");function Io(t,e,n,r){for(let o of e){if(r&&t._tx!==r)return;n.some(s=>s.routeId===o.routeId)||t.routesById[o.routeId].options.onLeave?.(o)}for(let o of n){if(r&&t._tx!==r)return;t.routesById[o.routeId].options[e.some(s=>s.routeId===o.routeId)?"onStay":"onEnter"]?.(o)}}i(Io,"runRouteLifecycle");var nn=class{static{i(this,"RouterCore")}constructor(t,e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async n=>(n(),!1),this.update=n=>{let r=this.options,o=this.basepath??r?.basepath??"/",s=this.basepath===void 0,c=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??!1??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=uo(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=tn()),this.origin=this.options.origin,this.origin||(!!1&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let l;if(!1){let f=globalThis.__TSR_CACHE__;this.resolvePathCache=f.resolvePathCache,l=f.processRouteTreeResult}else this.resolvePathCache=Ft(1e3),l=this.buildRouteTree(),!1;this.setRoutes(l)}if(!this.stores&&this.latestLocation){let l=this.getStoreConfig(this);this.batch=l.batch,this.stores=xo(this.latestLocation,l),mo(this)}let a=this.options.basepath??"/",u=this.options.rewrite;if(s||o!==a||c!==u){this.basepath=a;let l=[],f=qt(a);f&&f!=="/"&&l.push(wo({basepath:a})),u&&l.push(u),this.rewrite=l.length===0?void 0:l.length===1?l[0]:_o(l),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let n=ao(this.routeTree,this.options.caseSensitive,(r,o)=>{r.init({originalIndex:o})});return this.options.routeMasks&&oo(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{let o={eventType:n,fn:r};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{for(let r of this.subscribers)if(r.eventType===n.type)try{r.fn(n)}catch(o){console.error(o)}},this.parseLocation=(n,r)=>{let o=i(({pathname:u,search:l,hash:f,href:d,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){let R=this.options.parseSearch(l),v=this.options.stringifySearch(R);return{href:u+v+f,publicHref:u+v+f,pathname:Dt(u).path,external:!1,searchStr:v,search:pt(r?.search,R),hash:Dt(f.slice(1)).path,state:rt(r?.state,h)}}let p=new URL(d,this.origin),g=ge(this.rewrite,p),m=this.options.parseSearch(g.search),y=this.options.stringifySearch(m);return g.search=y,{href:g.href.replace(g.origin,""),publicHref:d,pathname:Dt(g.pathname).path,external:!!this.rewrite&&g.origin!==this.origin,searchStr:y,search:pt(r?.search,m),hash:Dt(g.hash.slice(1)).path,state:rt(r?.state,h)}},"parse"),s=o(n),{__tempLocation:c,__tempKey:a}=s.state;if(c&&(!a||a===this.tempLocationKey)){let u=o(c);return u.state.key=s.state.key,u.state.__TSR_key=s.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:s}}return s},this.resolvePathWithBase=(n,r)=>Ke({base:n,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},o):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>{let r=Object.create(null),o=io(G(n),this.processedTree,!0);return o&&Object.assign(r,o.rawParams),[o?.branch||[this.routesById.__root__],r,o?.route]},this.buildLocation=n=>{let r=i((s={})=>{if(s.href){let w=$t(s.href,{});s={...s,to:ge(this.rewrite,new URL(w.pathname,this.origin)).pathname,search:this.options.parseSearch(w.search),hash:w.hash.slice(1)}}let c=s._fromLocation||this._pendingLocation||this.latestLocation,a=this.matchRoutesLightweight(c);s.from;let u=s.unsafeRelative==="path"?c.pathname:s.from??a[1],l=a[2],f=a[3],d=this.resolvePathWithBase(u,s.to?`${s.to}`:"."),h=Eo(s.params,f),p=this.routesByPath[G(d)],g;if(p)g=this.getRouteBranch(p);else if(d.includes("$"))g=[];else{let[w,P,E]=this.getMatchedRoutes(d);g=w,this.options.notFoundRoute&&(!E||E.path!=="/"&&P["**"])&&(g=[...g,this.options.notFoundRoute])}if(g.length&&ht(h))for(let w of g){let P=w.options.params?.stringify??w.options.stringifyParams;if(P){h===f&&(h=Object.assign(Object.create(null),h));try{Object.assign(h,P(h))}catch{}}}let m=n.leaveParams?d:Dt(de({path:d,params:h,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,y=l;if(n._includeValidateSearch&&this.options.search?.strict){let w={};g.forEach(P=>{if(P.options.validateSearch)try{Object.assign(w,ye(P.options.validateSearch,{...w,...y}))}catch{}}),y=w}y=Zr(y,s,g,n._includeValidateSearch),y=pt(l,y);let R=this.options.stringifySearch(y),v=s.hash===!0?c.hash:s.hash?q(s.hash,c.hash):void 0,_=v?`#${v}`:"",x=s.state===!0?c.state:s.state?q(s.state,c.state):{};s.state&&(x=rt(c.state,x));let L=`${m}${R}${_}`,b,S,C=!1;if(this.rewrite){let w=new URL(L,this.origin),P=Je(this.rewrite,w);b=w.href.replace(w.origin,""),P.origin!==this.origin?(S=P.href,C=!0):S=P.pathname+P.search+P.hash}else b=Zn(L),S=b;return{publicHref:S,href:b,pathname:m,search:y,searchStr:R,state:x,hash:v??"",external:C,unmaskOnReload:s.unmaskOnReload}},"build"),o=r(n);if(n.mask)o.maskedLocation=r({from:n.from,...n.mask});else if(this.options.routeMasks){let s=ro(o.pathname,this.processedTree);if(s){let c=Object.assign(Object.create(null),s.rawParams),{from:a,params:u,...l}=s.route,f=Eo(u,c);o.maskedLocation=r({from:n.from,...l,params:f})}}return o},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...o})=>{let s,c=G(this.latestLocation.href)===G(o.href)&&Q(Lo(o.state),Lo(this.latestLocation.state)),a=this._commitPromise,u,l=new Promise(f=>{u=f});if(l.resolve=()=>{u(),a?.resolve()},this._commitPromise=l,c)this.load();else{let{maskedLocation:f,hashScrollIntoView:d,...h}=o;f&&(h={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,s=o.replace?"REPLACE":"PUSH",this.history[s==="REPLACE"?"replace":"push"](h.publicHref,h.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:s}})}return this._scroll.next=o.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:o,viewTransition:s,ignoreBlocker:c,...a}={})=>{let u=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=u;let l=this.commitLocation({...u,viewTransition:s,replace:n,resetScroll:r,hashScrollIntoView:o,ignoreBlocker:c});return queueMicrotask(()=>{this._pendingLocation===u&&(this._pendingLocation=void 0)}),l},this.navigate=async({to:n,reloadDocument:r,href:o,publicHref:s,...c})=>{let a=!1;if(o)try{new URL(`${o}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!o){let l=this.buildLocation({to:n,...c});o=o??l.publicHref,s=s??l.publicHref}let u=!a&&s?s:o;if(st(u,this.protocolAllowlist))return;if(!c.ignoreBlocker){let l=this.history.getBlockers?.()??[];for(let f of l)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}c.replace?window.location.replace(u):window.location.href=u;return}return this.buildAndCommitLocation({...c,href:o,to:n,_isNavigate:!0})},this.load=async n=>{if(!1)return(void 0)(this,n);this.updateLatestLocation(),n?.action&&(this._scroll.hash=n.action.type==="PUSH"||n.action.type==="REPLACE"),await Oo(this,n)},this.startViewTransition=n=>{let r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&!!1&&typeof document.startViewTransition=="function"){let o;if(typeof r=="object"&&window.CSS?.supports?.("selector(:active-view-transition-type(a))")){let s=this.latestLocation,c=this.stores.resolvedLocation.get(),a=typeof r.types=="function"?r.types(Ct(s,c)):r.types;if(a===!1)return n();o={update:n,types:a}}else o=n;return document.startViewTransition(o).updateCallbackDone}return n()},this.invalidate=n=>{let r=this._committed,o=n?.filter,s=this._preloads,c=new Set([...r,...this._cache.values(),...[...s?.values()??[]].flat(),...this._tx?.[3]??[]].filter(l=>!o||o(l)).map(l=>l.id)),a=[];for(let[l,f]of s??[])f.some(d=>c.has(d.id))&&(s.delete(l),a.push(l));let u=i(l=>{if(c.has(l.id)){let f=this.routesById[l.routeId],d={...l,invalid:!0,...(n?.forcePending||l.status==="error"||l.status==="notFound")&&Po(f)?{status:"pending",error:void 0}:void 0};return l._flight=void 0,d}return l},"invalidate");this._committed=r.map(u);for(let[l,f]of this._cache)c.has(l)&&(f.invalid=!0,n?.forcePending&&(f.status="pending"));for(let l of c)this._flights?.delete(l);for(let l of a)l.abort();return this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.resolveRedirect=n=>{let r=n.headers.get("Location");if(n.options.href){if(r)try{let o=new URL(r);if(this.origin&&o.origin===this.origin){let s=o.pathname+o.search+o.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}}else{let o=this.buildLocation(n.options).publicHref||"/";n.options.href=o,n.headers.set("Location",o)}if(n.options.href&&st(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{let r=this._cache,o=this._preloads,s=n?.filter,c=[],a=[];for(let[l,f]of r)(!s||s(f))&&(a.push(l),c.push(f));let u=[];for(let[l,f]of o??[])(!s||f.some(s))&&(u.push(l),c.push(...f));for(let l of a)r.delete(l);for(let l of u)o.delete(l);for(let l of c){let f=l._flight;l._flight=void 0,f&&!--f[2]&&(this._flights?.get(l.id)===f&&this._flights.delete(l.id),u.push(f[1]))}for(let l of u)l.abort()},this.loadRouteChunk=Pt,this.preloadRoute=n=>To(this,n),this.matchRoute=(n,r)=>{let o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(o),c=this.stores.status.get()==="pending";if(r?.pending&&!c)return!1;let a=r?.pending??!c?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),u=so(s.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,a.pathname,this.processedTree);return!u||n.params&&!Q(u.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Q(a.search,s.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.getStoreConfig=e,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Ro,parseSearch:t.parseSearch??vo,protocolAllowlist:t.protocolAllowlist??We}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:t,routesByPath:e,processedTree:n}){this.routesById=t,this.routesByPath=e,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(t){let e=this.routeBranchCache.get(t);return e||(e=je(t),this.routeBranchCache.set(t,e)),e}matchRoutesInternal(t,e){let[n,r,o]=this.getMatchedRoutes(t.pathname),s=n,c=!1;(o?o.path!=="/"&&r["**"]:G(t.pathname))&&(this.options.notFoundRoute?s=[...s,this.options.notFoundRoute]:c=!0);let a=c?Qr(this.options.notFoundMode,s):void 0,u=new Array(s.length),l=this._committed,f=i((h,p)=>{let g=l[p];return g?.routeId===h.id?g:h===this.options.notFoundRoute?l.find(m=>m.routeId===h.id):void 0},"previousAt"),d;for(let h=0;h<s.length;h++){let p=s[h],g=u[h-1],m,y,R;{let N=g?.search??t.search,_t=g?._strictSearch??void 0;try{let nt=ye(p.options.validateSearch,{...N})??void 0;m={...N,...nt},y={..._t,...nt}}catch(nt){let oe=nt;if(nt instanceof Gt||(oe=new Gt(nt.message,{cause:nt})),e?.throwOnError)throw oe;m=N,y={},R=oe}}let v="",_="";try{v=p.options.loaderDeps?.({search:m})??"",_=v&&JSON.stringify(v)||""}catch(N){if(e?.throwOnError)throw N;R??=N}let{interpolatedPath:x,usedParams:L}=de({path:p.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),b=p.id+x+_,S=f(p,h),C=this._cache.get(b)??(S?.id===b?S:void 0);d=C?._strictParams??Object.assign(L,d);let w;if(!C)try{ko(p,d)}catch(N){if(J(N)||me(N)?w=N:w=new No(N.message,{cause:N}),e?.throwOnError)throw w}let P=S?"stay":"enter",E;if(C)E={...C,cause:P,search:S?pt(S.search,m):pt(C.search,m),_strictSearch:y,searchError:R};else{let N=Po(p)?"pending":"success";E={id:b,ssr:p.options.ssr,index:h,routeId:p.id,params:S?.params??d,_strictParams:d,pathname:x,updatedAt:Date.now(),search:S?pt(S.search,m):m,_strictSearch:y,searchError:R,status:N,isFetching:!1,error:void 0,paramsError:w,context:{},abortController:e?._controller??new AbortController,cause:P,loaderDeps:S?rt(S.loaderDeps,v):v,invalid:!1,preload:!1,staticData:p.options.staticData||{},fullPath:p.fullPath}}let I=a===p.id;E._notFound&&!I&&(E.error=void 0),E._notFound=I,u[h]=E}for(let h=0;h<u.length;h++){let p=u[h];p.params=p.cause==="stay"?pt(p.params,d):d,e?._controller&&(p.context={})}return u}matchRoutesLightweight(t){let e=dt(this.stores.ids.get()),n=e?this.stores.byRoute.get(e).get():void 0,r=n?.id,o=this.lightweightCache.get(t);if(o&&o[0]===r)return o[1];let[s,c]=this.getMatchedRoutes(t.pathname),a=dt(s),u={...t.search};for(let h of s)try{Object.assign(u,ye(h.options.validateSearch,u))}catch{}let l=n&&n.routeId===a.id&&n.pathname===t.pathname,f;if(l)f=n.params;else{let h=Object.assign(Object.create(null),c);for(let p of s)try{ko(p,h)}catch{}f=h}let d=[s,a.fullPath,u,f];return this.lightweightCache.set(t,[r,d]),d}},Gt=class extends Error{static{i(this,"SearchParamError")}},No=class extends Error{static{i(this,"PathParamError")}};function ye(t,e){if(t==null)return{};if("~standard"in t){let n=t["~standard"].validate(e);if(n instanceof Promise)throw new Gt("Async validation not supported");if(n.issues)throw new Gt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}i(ye,"validateSearch");function Zr(t,e,n,r){let o=[];for(let c of n){let a=c.options;if("search"in a)a.search?.middlewares&&o.push(...a.search.middlewares);else if(a.preSearchFilters||a.postSearchFilters){let l=i(({search:f,next:d})=>{let h=d(a.preSearchFilters?a.preSearchFilters.reduce((p,g)=>g(p),f):f);return a.postSearchFilters?a.postSearchFilters.reduce((p,g)=>g(p),h):h},"legacyMiddleware");o.push(l)}let u=a.validateSearch;if(r&&u){let l=i(({search:f,next:d,meta:h})=>{let p=d(f);try{let g=ye(u,p);if(h&&g)for(let m in g)m in p||(h.defaulted||=new Map).set(m,g[m]);return{...p,...g}}catch{}return p},"validate");o.push(l)}}let s=i((c,a,u)=>{if(c>=o.length){if(!e.search)return{};if(e.search===!0)return a;let f=q(e.search,a);return u&&(u.explicit=f),f}let l=i((f,d)=>{if(d){let h=u||{};return{search:s(c+1,f,h),meta:h}}return s(c+1,f,u)},"next");return o[c]({search:a,next:l,meta:u})},"applyNext");return s(0,t)}i(Zr,"applySearchMiddleware");function Qr(t,e){if(t!=="root"){let n;for(let r=e.length-1;r>=0;r--){let o=e[r];if(o.options.notFoundComponent)return o.id;n||=o.children&&o.id}if(n)return n}return tt}i(Qr,"findGlobalNotFoundRouteId");function Eo(t,e){if(t===!1||t===null)return Object.create(null);if((t??!0)===!0)return e;let n=Object.assign(Object.create(null),e);return Object.assign(n,q(t,n))}i(Eo,"resolveNextParams");function ko(t,e){let n=t.options.params?.parse??t.options.parseParams;n&&Object.assign(e,n(e))}i(ko,"extractStrictParams");function on(t,e){return t.options[e]?.preload?.()}i(on,"preloadComponent");function ts(t,e){let n=on(t,"component"),r=on(t,"pendingComponent");return e&&(r?r=r.then(e):e()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}i(ts,"loadComponents");function Pt(t,e,n){let r=i(()=>e===!1?void 0:e?on(t,e):ts(t,n),"afterLazy"),o=t._lazy;if(o)return o===!0?r():o.then(r);if(!t.lazyFn)return r();let s=t.lazyFn().then(c=>{{let{id:a,...u}=c.options;Object.assign(t.options,u),t._lazy=!0}},c=>{throw t._lazy=void 0,c});return t._lazy=s,s.then(r)}i(Pt,"loadRouteChunk");function an(t){let e=t.findIndex(n=>n.status!=="success"||n._notFound)+1;return e&&e<t.length?t.slice(0,e):t}i(an,"_getRenderedMatches");var it=0,ft=1,Re=2,Y=3,Rt=[4];function Xt(t){return typeof t[0]=="number"}i(Xt,"isControl");function Et(t,e){return e.aborted?Promise.race([Promise.reject(e),t]):new Promise((n,r)=>{let o=i(()=>r(e),"abort");e.addEventListener("abort",o,{once:!0}),Promise.resolve(t).then(n,r).finally(()=>e.removeEventListener("abort",o))})}i(Et,"waitFor");function kt(t,e){return t.routesById[e.routeId]}i(kt,"getRoute");function Zt(t,e,n){return me(t)?[Y,t]:J(t)?(t.routeId||=n,[Re,t]):e?(typeof t?.then=="function"&&(t=new Error("A Promise was thrown",{cause:t})),[ft,t]):[it,t]}i(Zt,"normalize");function cn(t,e){let n=Zt(e,!0,t.id);if(n[0]!==ft)return n;try{t.options.onError?.(n[1])}catch(r){n=Zt(r,!0,t.id)}return n}i(cn,"normalizeError");function Yt(t,e,n,r,o){return o[0].signal.aborted?Rt:fn(t,e,n,cn(n,r),o)}i(Yt,"normalizeLaneError");async function es(t,e,n,r,o,s){let[c,a]=e,u=n[0].signal,l=!!n[3];for(let f=n[6]??0;f<r;f++){let d=a[f],h=kt(t,d);d.abortController=n[0];let p=a[f-1]?.context??t.options.context??{},g={params:d.params,location:c,navigate:i(v=>t.navigate({...v,_fromLocation:c}),"navigate"),buildLocation:t.buildLocation,cause:l?"preload":d.cause,abortController:n[0],preload:l,matches:a,routeId:h.id};try{let v=d._ctx||=h.options.context?h.options.context({...g,deps:d.loaderDeps,context:p})||{}:void 0;d.context={...p,...v}}catch(v){return ut(t,d),[f,Yt(t,e,h,v,n)]}if(u.aborted)return[f,Rt];let m=d.paramsError??d.searchError;if(m!==void 0)return ut(t,d),[f,Yt(t,e,h,m,n)];let y=h.options.beforeLoad;if(!y)continue;let R=d.status;f>=s&&(d.status="pending",n[7]?.());try{Qt(t,d,"beforeLoad",n[0]);let v=await Et(y({...g,search:d.search,context:d.context,...t.options.additionalContext}),u);if(u.aborted)return[f,Rt];let _=fn(t,e,h,Zt(v,!1,h.id),n);if(_[0]!==it)return ut(t,d),[f,_];d.context={...d.context,...v}}catch(v){return ut(t,d),[f,Yt(t,e,h,v,n)]}finally{d.status=R,Qt(t,d,!1,n[0])}}o()}i(es,"contextualize");function ln(t,e,n){if(!(!n||--n[2])){if(t._flights?.get(e.id)===n){let r=t._tx;if(r&&!r[0].signal.aborted&&!r[3].includes(e)&&r[3].some(o=>o.id===e.id)&&r[3].some(o=>o.isFetching==="beforeLoad"))return;t._flights.delete(e.id)}return n[1]}}i(ln,"releaseOwnedFlight");function ut(t,e){let n=e._flight;e._flight=void 0,ln(t,e,n)?.abort()}i(ut,"releaseFlight");function j(t,e,n,r){let o=[];for(let s of e)if(!n?.includes(s)){let c=s._flight;if(s._flight=void 0,r&&c?.[2]===1&&t._flights?.get(s.id)===c&&n?.some(a=>a.id===s.id))c[2]=0;else{let a=ln(t,s,c);a&&o.push(a)}}for(let s of o)s.abort()}i(j,"transferMatchResources");function un(t){for(let e of t){let n=e._flight;n&&n[2]++}}i(un,"acquireMatchResources");function Qt(t,e,n,r){if(e.isFetching=n,r&&t._tx?.[0]!==r)return;let o=t.stores.byRoute.get(e.routeId),s=o?.get();s?.id===e.id&&o.set({...s,isFetching:n})}i(Qt,"setFetching");function Bo(t,e,n,r,o,s,c){let a=e[0];return{params:n.params,location:a,navigate:i(u=>t.navigate({...u,_fromLocation:a}),"navigate"),cause:c?"preload":n.cause,abortController:o,preload:c,deps:n.loaderDeps,parentMatchPromise:s,context:n.context,route:r,...t.options.additionalContext}}i(Bo,"getLoaderContext");async function Do(t,e,n,r,o,s,c){let a=c[0],u=a.signal;if(u.aborted)return Rt;if(!o)return[it,void 0];let l=n._flight;Qt(t,n,"loader",a);try{if(!l){let f=new AbortController;l=[Promise.resolve().then(()=>o(Bo(t,e,n,r,f,s,!!c[3]))).then(d=>Zt(d,!1,r.id),d=>Zt(d,!0,r.id)).then(d=>(d[0]!==it&&t._flights?.get(n.id)===l&&(t._flights.delete(n.id),l[2]||f.abort()),d[0]===ft&&l[2]?cn(r,d[1]):d)),f,1],(t._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],fn(t,e,r,await Et(l[0],u),c)}catch(f){if(f!==u||!u.aborted)throw f;return ut(t,n),Rt}finally{Qt(t,n,!1,a)}}i(Do,"loadResource");function Fo(t,e,n){e[0]!==Y&&(t.status="success",t.error=void 0,e[0]===it?(t.loaderData=e[1],t.invalid=!1,t.updatedAt=Date.now(),t.preload=n):t.invalid=!0)}i(Fo,"settleInto");function ns(t,e,n){let r=t._cache.get(e.id);if(r!==n||t._committed.some(s=>s.id===e.id&&s._flight===e._flight))return;let o={...e,_notFound:void 0,context:{}};o._flight&&o._flight[2]++,t._cache.set(e.id,o),r&&ut(t,r)}i(ns,"cacheLoaderMatch");function Mo(t,e){return e[0]===ft||e[0]===Re?{...t,status:e[0]===ft?"error":"notFound",error:e[1],_flight:void 0}:t}i(Mo,"getParentSnapshot");function os(t,e,n,r,o,s,c){let a=e[1][n],u=kt(t,a),l=!!s[3],f=t._cache.get(a.id),d,h=!1,p;try{if(a.status==="success"&&(d=u.options.shouldReload,typeof d=="function"&&(d=d(Bo(t,e,a,u,s[0],o,l))),s[0].signal.aborted&&(p=Rt)),!p)if(a.status!=="success")h=!0;else{let I=l||a.preload?u.options.preloadStaleTime??t.options.defaultPreloadStaleTime??3e4:u.options.staleTime??t.options.defaultStaleTime??0;h=!!(a.invalid||d||d===void 0&&Date.now()-a.updatedAt>=I&&(s[5]||a.cause==="enter"||s[2].some(N=>N.routeId===a.routeId&&N.id!==a.id)))}}catch(I){a.invalid=!0,ut(t,a),p=Yt(t,e,u,I,s)}let g=u.options.loader,m=typeof g=="function",y=m?g:g?.handler,R=!l||u.options.preload!==!1,v=R&&g?t._flights?.get(a.id):void 0;v===a._flight||p?v=void 0:v&&!h&&!l&&d===void 0?h=!0:h||(v=void 0);let _=!!(g&&h&&a.status==="success"&&!l&&!s[4]&&((m?void 0:g.staleReloadMode)??t.options.defaultStaleReloadMode)!=="blocking"),x=h&&R,L=x&&!_&&(a.status!=="success"||!!g),b=n>=c?s[7]:void 0,S=u.lazyFn&&u._lazy!==!0?b:void 0;if(x&&!g&&(a.invalid=!1,a.updatedAt=Date.now()),v&&v[2]++,L){let I=a._flight;a._flight=v,ln(t,a,I)?.abort(),n>=c&&(a.status="pending"),b?.()}x||(a.isFetching=!1);let C=(p?Promise.resolve(p):L?Do(t,e,a,u,y,o,s):Promise.resolve([it,a.loaderData])).then(I=>(L&&(Fo(a,I,l),I[0]===it&&(g&&!s[0].signal.aborted&&ns(t,a,f),n>=c&&(a.status="pending"))),I)),w=Et(Promise.resolve().then(()=>Pt(u,void 0,S)),s[0].signal).then(()=>{},I=>e[1].some((N,_t)=>_t<=n&&(N.status==="error"||N.status==="notFound"||N._notFound))?void 0:[n,Yt(t,e,u,I,s)]).then(I=>C.then(N=>(L&&!I&&N[0]===it&&a.status==="pending"&&!s[0].signal.aborted&&(a.status="success",b?.()),I)));if(r.push([n,C,w]),!_)return C.then(I=>Mo(a,I));let P={...a,status:"pending",preload:!1,_flight:v};a.invalid=!1,a.isFetching="loader";let E=Do(t,e,P,u,y,o,s).then(I=>(a.isFetching=!1,Fo(P,I,!1),I));return(e[2]??=[]).push([n,E,w,P]),E.then(I=>Mo(P,I))}i(os,"createLoaderTask");async function rn(t,e,n,r,o=0){let s=n?.[1][1],c=s?.routeId?e.findIndex(a=>a.routeId===s.routeId):n?.[0]??e.length-1;c<0&&(c=0);for(let a=c;a>=0;a--){let u=kt(t,e[a]);try{let l=Pt(u,!1);l&&await Et(l,r)}catch(l){if(l===r&&r.aborted)throw l}if(u.options.notFoundComponent)return a}return s?.routeId?c:o}i(rn,"getNotFoundBoundary");function Lt(t,e){e[2]&&(j(t,e[2].map(n=>n[3])),e[2]=void 0)}i(Lt,"discardBackground");async function Ao(t,e,n,r){let o;try{await Promise.all(t.map(s=>s[1].then(async c=>{let a=s[0];if(!(r&&a>=await r)){if(c[0]>=Y)throw[a,c];!o&&c[0]!==it&&(o=[a,c],await Promise.all((n??[]).map(u=>{if(!(u[0]<=a))return u[1].then(l=>{if(l[0]===Y)throw[u[0],l]})})))}})))}catch(s){return s}return e??o}i(Ao,"settleTasks");function fn(t,e,n,r,o,s){for(;r[0]===Y;){let c=r[1],a=c.options;if(a.reloadDocument?o[3]:o[1]>=20)return r;try{return a.href&&a.reloadDocument?(t.resolveRedirect(c),r):[Y,c,t.buildLocation({...a,_fromLocation:e[0],_includeValidateSearch:!0})]}catch(u){r=s?[ft,u]:cn(n,u),s=!0}}return r}i(fn,"materializeRedirect");async function Uo(t,e,n,r,o,s){let c=e[1],a=await o,u=!1,l=c.findIndex(p=>p._notFound),f=i(p=>p[1][0]===Re?rn(t,c,p,r.signal):p[0],"boundaryOf"),d=l<0?c.length:l;if((a?.[1][0]??0)>=Y)d=0;else if(a){d=a[2]??=await f(a);for(let p of n){if(p[0]>=d)break;let g=await p[1];if(g[0]!==it&&g[0]<Y&&!("loaderData"in c[p[0]])){a=[p[0],g],d=a[2]=await f(a);break}}}for(let p of n){if(p[0]>=d)break;let g=await p[2];if(g){a=g;break}}if((a?.[1][0]??0)>=Y){let p=a[1];if(p[0]!==Y||p[1].options.reloadDocument||p[2])return Lt(t,e),p;u=!0,a=[0,[ft,new Error("Too many redirects")]]}let h=a?a[2]??await f(a):l;if(h>=0){let p=a?.[1],g=p?.[0],m=c[h],y=p?.[1],R=i(()=>{p&&(m._notFound=void 0,g===ft?m.status="error":(y.routeId=m.routeId,m.routeId===t.routeTree.id?(m.status="success",m._notFound=!0):m.status="notFound"),m.error=y,m.isFetching=!1)},"install");R(),p||s?.();let v=kt(t,m);try{await Et(p?Promise.resolve().then(()=>Pt(v,g===ft?"errorComponent":"notFoundComponent")):Promise.all([Pt(v),Pt(v,"notFoundComponent")]),r.signal)}catch(_){if(_===r.signal&&r.signal.aborted)return Lt(t,e),Rt}p?u&&(r.abort(),await Promise.all([...n.map(_=>_[1]),...n.map(_=>_[2]),...(e[2]??[]).map(_=>_[1])]),Lt(t,e),j(t,c),R()):m.status="success"}return e}i(Uo,"reduceLane");async function Vo(t,e,n,r=0,o=e[1].length){let s=e[1];for(let c=r;c<o;c++){let a=s[c],u=kt(t,a).options;if(u.head||u.scripts)try{let l={ssr:t.options.ssr,matches:s,match:a,params:a.params,loaderData:a.loaderData},[f,d]=await Et(Promise.all([u.head?.(l),u.scripts?.(l)]),n);a.meta=f?.meta,a.links=f?.links,a.headScripts=f?.scripts,a.styles=f?.styles,a.scripts=d}catch(l){if(l===n&&n.aborted)break;console.error(l)}if(a.status!=="success"||a._notFound)break}return e}i(Vo,"projectLane");async function Wo(t,e,n,r){let o=[e,n],s=r[0].signal,c;try{let a=t.stores.matches.get(),u=n.findIndex(R=>R._notFound);if(t.options.notFoundMode!=="root"&&u>=0){let R=await rn(t,n,void 0,s,u);n[u]._notFound=void 0,n[R]._notFound=!0,u=R}let l=u<0?n.length:u+1,f=0;for(;f<l&&f!==u;){let R=n[f],v=r[2][f],_=a[f];if(v?.id!==R.id||v.status!=="success"||v._notFound||R.preload||_?.id!==R.id||_.status!=="success"||_._notFound)break;f++}let d=[],h=r[6]??0,p=h?Promise.resolve(n[h-1]):void 0,g=i(()=>{for(let R=h;R<l&&!s.aborted;R++)p=os(t,o,R,d,p,r,f)},"planSuccessfulLane"),m=await es(t,o,r,l,g,f);if(m){if(r[4]=!0,l=m[0],m[1][0]===Re){let R=await rn(t,n,m,s);m[2]=R,l=Math.min(l,R+1)}else m[1][0]>=Y&&(l=0);g()}if(!s.aborted&&!r[3]){let R=[];for(let[v,_]of t._flights??[])_[2]||(t._flights.delete(v),R.push(_[1]));for(let v of R)v.abort()}let y=Uo(t,o,d,r[0],Ao(d,m,o[2]),r[7]);o[2]?.length&&(o[3]=Ao(o[2],void 0,void 0,y.then(R=>Xt(R)?0:an(n).length,()=>0))),c=await y}catch(a){if(Lt(t,o),a===s&&s.aborted)return Rt;throw a}return Xt(c)?c:Vo(t,c,s,r[6]===n.length?r[6]:0)}i(Wo,"executeClientLane");function sn(t,e){if(t._tx!==e)return;let n=e[3],r=t.stores.matches.get(),o=t._pending;for(let s=0;s<n.length;s++){let c=n[s],a=c.status==="success"&&!c._notFound,u=r[s]?.id===c.id&&r[s]?.status==="pending";if(a&&!u)continue;let l=kt(t,c),f=a||c.invalid?0:l.options.pendingMs??t.options.defaultPendingMs,d=l.options.pendingComponent??t.options.defaultPendingComponent;if(!d||typeof f!="number"||f===1/0){o&&(o[0]=e,o[2]=0,o[4]=!0);return}let h=l.options.pendingMinMs??t.options.defaultPendingMinMs??0,p=!1;if(o?.[1]===c.id?(p=o[0]!==e,o[0]=e):(clearTimeout(o?.[3]),t._pending=o=void 0),o||(t._pending=o=[e,c.id,u?Date.now()+h:e[4]+f,void 0,u||void 0,d]),o[4]&&!p&&o[5]===d)return;if(o[5]=d,!o[4]){clearTimeout(o[3]);let y=o[2]-Date.now();if(y>0){o[3]=setTimeout(()=>sn(t,e),y);return}o[2]=0}let g=n.map(y=>({...y,_flight:void 0}));g[s].status="pending";let m=o[4]=t.startTransition(()=>t.stores.setMatches(g),g).then(y=>(y&&t._pending===o&&o[4]===m&&!o[2]&&(o[2]=Date.now()+h),y));return}}i(sn,"offerPending");function Jt(t,e){let n=t._pending;(t._tx===e||!t._tx?.[3].some(r=>r.id===n?.[1]))&&(clearTimeout(n?.[3]),t._pending=void 0)}i(Jt,"finishPending");async function $o(t,e){let n=t._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!an(e[3]).some(s=>s.id===n[1]))return;let o;try{await Et(new Promise(s=>{o=setTimeout(s,r)}),e[0].signal)}catch{}clearTimeout(o)}i($o,"awaitPendingMinimum");function zo(t,e){t._committed=e,t.stores.setMatches(e)}i(zo,"publishMatches");function rs(t,e,n,r){let o=t._committed,s=t._cache;for(let u of n)u.preload=!1,r&&(u._assetEnd=void 0);let c=an(n).length,a=new Map;{let u=Date.now();for(let l of[...o,...s.values()]){if(l.status!=="success"||n.some((d,h)=>d.id===l.id&&(h<c||d.status==="success")))continue;let f=kt(t,l);!f.options.loader||u-l.updatedAt>=(l.preload?f.options.preloadGcTime??t.options.defaultPreloadGcTime??3e5:f.options.gcTime??t.options.defaultGcTime??3e5)||a.set(l.id,s.get(l.id)===l?l:{...l,_flight:void 0,isFetching:!1,context:{}})}}e[3]=[],t._cache=a,zo(t,n),j(t,[...s.values(),...o],[...n,...a.values()]),Io(t,o,n,e)}i(rs,"commitMatches");async function ve(t,e){let n=t._tx;for(;n&&n!==e;){if(await n[5],t._tx===n)return;n=t._tx}}i(ve,"awaitCurrent");function Ho(t,e,n){let r=n[1].options,o=n[2];if(!o)return t.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return t.navigate({href:o.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});o._redirects=e[1]+1,t._pendingLocation=o;let s=t.commitLocation({...o,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{t._pendingLocation===o&&(t._pendingLocation=void 0)}),s}i(Ho,"followRedirect");async function ss(t,e,n,r,o){let s=n.map(u=>({...u}));un(s);for(let u of r)ut(t,s[u[0]]),s[u[0]]=u[3];let c=[e[2],s],a;try{a=await Uo(t,c,r,e[0],o)}catch(u){throw j(t,s),u}if(Xt(a)){j(t,s),a[0]===Y&&t._tx===e&&t._committed===n&&await Ho(t,e,a);return}if(await Vo(t,a,e[0].signal),t._tx!==e||t._committed!==n){j(t,s);return}for(let u of s){let l=t._cache.get(u.id);l?._flight&&l._flight===u._flight&&(t._cache.delete(u.id),ut(t,l))}zo(t,s),j(t,n,s)}i(ss,"runBackground");async function is(t,e,n,r,o,s){let c=await Wo(t,e[2],e[3],[e[0],e[1],t._committed,void 0,o,n,s,r]);if(Xt(c)){let d=c[0]===Y&&t._tx===e;if((!d||c[1].options.reloadDocument)&&Jt(t,e),j(t,e[3]),e[3]=[],!d)return;if(t._tx!==e){Jt(t,e);return}await Ho(t,e,c);return}let a=c[1];if(t._tx===e&&await $o(t,e),t._tx!==e){Jt(t,e),j(t,a),Lt(t,c);return}let u=e[2],l=Ct(u,t.stores.resolvedLocation.get()),f=c[2];await t.startViewTransition(async()=>{if(t._tx===e&&await $o(t,e),t._tx!==e){Jt(t,e),j(t,a),Lt(t,c);return}let d=i(()=>{Jt(t,e),rs(t,e,a,s),t._tx===e&&(t.emit({type:"onLoad",...l}),t._tx===e&&t.emit({type:"onBeforeRouteMount",...l}))},"commit"),h=await t.startTransition(d,a);if(t._tx!==e){Lt(t,c);return}f?.length&&ss(t,e,a,f,c[3]).catch(console.error),t.batch(()=>{t.stores.resolvedLocation.set(u),t.stores.status.set("idle"),t._tx===e&&t.emit({type:"onResolved",...l}),h&&t._tx===e&&t.emit({type:"onRendered",...l})}),t._tx===e&&(t._commitPromise?.resolve(),t._commitPromise=void 0)})}i(is,"runClientTransaction");async function Oo(t,e){let n=!1,r=t._tx,o=t.stores.resolvedLocation.get(),s=o??t.stores.location.get(),c=t.latestLocation,a=t._pendingLocation,u=a?.href===c.href?a._redirects??0:0,l=t._handoff,f=n?void 0:l?.[0](),d=new AbortController,h=t._preflight;if(t._preflight=d,!n&&!f&&l?.[1](),h?.abort(),!d.signal.aborted){let L=Ct(c,o);t.emit({type:"onBeforeNavigate",...L}),d.signal.aborted||t.emit({type:"onBeforeLoad",...L})}if(d.signal.aborted){await ve(t,r);return}let p=s.href===c.href,g=d,m=t.matchRoutes(c,{_controller:d});un(m);let y=f?l[1](m):void 0;if(y?g=f:f?.abort(),d.signal.aborted){j(t,m),await ve(t,r);return}t._preflight=void 0;let R,v=i(()=>is(t,x,p,()=>sn(t,x),e?.sync,y),"run"),_=e?.sync?new Promise(L=>R=L):Promise.resolve().then(v).then(),x=[g,u,c,m,Date.now(),_];if(t._tx=x,r){for(let L of t.stores.matches.get()){if(t._tx!==x)break;L.isFetching&&Qt(t,L,!1)}r[0].abort(),j(t,r[3],x[3],!0)}if(t._tx!==x){j(t,x[3]),x[3]=[],R?.(),await ve(t,x);return}t.batch(()=>{t.stores.status.set("pending"),t.stores.location.set(c)}),(y||!t._committed.length&&m[0]?.status!=="success"&&!m.some(L=>L._notFound))&&sn(t,x),R?.(v()),await _,await ve(t,x)}i(Oo,"loadClientRoute");async function To(t,e){let n=t.buildLocation(e);for(let r=0;;r++){let o=t._committed,s=new AbortController,c,a,u;try{try{c=t.matchRoutes(n,{_controller:s}),un(c),a=(t._preloads??=new Map).set(s,c),u=await Wo(t,n,c,[s,r,o,!0])}finally{a&&(a=a.delete(s),j(t,c)),s.abort()}if(!Xt(u))return u[1];if(!a||u.length<3)return;n=u[2]}catch(l){J(l)||console.error(l);return}}}i(To,"preloadClientRoute");var dn="Error preloading route! \u261D\uFE0F";var Se=class{static{i(this,"BaseRoute")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=e=>{this.originalIndex=e.originalIndex;let n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=tt:this.parentRoute||mt();let o=r?tt:n?.path;o&&o!=="/"&&(o=ue(o));let s=n?.id||o,c=r?tt:bt([this.parentRoute.id==="__root__"?"":this.parentRoute.id,s]);o==="__root__"&&(o="/"),c!=="__root__"&&(c=bt(["/",c]));let a=c==="__root__"?"/":bt([this.parentRoute.fullPath,o]);this._path=o,this._id=c,this._fullPath=a,this._to=G(a)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>So({from:this.fullPath,...e}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}};var hn=class extends Se{static{i(this,"BaseRootRoute")}constructor(t){super(t)}};var Ce=k(B(),1);var T=(t=>(t[t.None=0]="None",t[t.Mutable=1]="Mutable",t[t.Watching=2]="Watching",t[t.RecursedCheck=4]="RecursedCheck",t[t.Recursed=8]="Recursed",t[t.Dirty=16]="Dirty",t[t.Pending=32]="Pending",t))(T||{});function jo({update:t,notify:e,unwatched:n}){return{link:r,unlink:o,propagate:s,checkDirty:c,shallowPropagate:a};function r(l,f,d){let h=f.depsTail;if(h!==void 0&&h.dep===l)return;let p=h!==void 0?h.nextDep:f.deps;if(p!==void 0&&p.dep===l){p.version=d,f.depsTail=p;return}let g=l.subsTail;if(g!==void 0&&g.version===d&&g.sub===f)return;let m=f.depsTail=l.subsTail={version:d,dep:l,sub:f,prevDep:h,nextDep:p,prevSub:g,nextSub:void 0};p!==void 0&&(p.prevDep=m),h!==void 0?h.nextDep=m:f.deps=m,g!==void 0?g.nextSub=m:l.subs=m}function o(l,f=l.sub){let d=l.dep,h=l.prevDep,p=l.nextDep,g=l.nextSub,m=l.prevSub;return p!==void 0?p.prevDep=h:f.depsTail=h,h!==void 0?h.nextDep=p:f.deps=p,g!==void 0?g.prevSub=m:d.subsTail=m,m!==void 0?m.nextSub=g:(d.subs=g)===void 0&&n(d),p}function s(l){let f=l.nextSub,d;t:do{let h=l.sub,p=h.flags;if(p&60?p&12?p&4?!(p&48)&&u(l,h)?(h.flags=p|40,p&=1):p=0:h.flags=p&-9|32:p=0:h.flags=p|32,p&2&&e(h),p&1){let g=h.subs;if(g!==void 0){let m=(l=g).nextSub;m!==void 0&&(d={value:f,prev:d},f=m);continue}}if((l=f)!==void 0){f=l.nextSub;continue}for(;d!==void 0;)if(l=d.value,d=d.prev,l!==void 0){f=l.nextSub;continue t}break}while(!0)}function c(l,f){let d,h=0,p=!1;t:do{let g=l.dep,m=g.flags;if(f.flags&16)p=!0;else if((m&17)===17){if(t(g)){let y=g.subs;y.nextSub!==void 0&&a(y),p=!0}}else if((m&33)===33){(l.nextSub!==void 0||l.prevSub!==void 0)&&(d={value:l,prev:d}),l=g.deps,f=g,++h;continue}if(!p){let y=l.nextDep;if(y!==void 0){l=y;continue}}for(;h--;){let y=f.subs,R=y.nextSub!==void 0;if(R?(l=d.value,d=d.prev):l=y,p){if(t(f)){R&&a(y),f=l.sub;continue}p=!1}else f.flags&=-33;f=l.sub;let v=l.nextDep;if(v!==void 0){l=v;continue t}}return p}while(!0)}function a(l){do{let f=l.sub,d=f.flags;(d&48)===32&&(f.flags=d|16,(d&6)===2&&e(f))}while((l=l.nextSub)!==void 0)}function u(l,f){let d=f.depsTail;for(;d!==void 0;){if(d===l)return!0;d=d.prevDep}return!1}}i(jo,"createReactiveSystem");function Go(t,e,n){let r=typeof t=="object",o=r?t:void 0;return{next:(r?t.next:t)?.bind(o),error:(r?t.error:e)?.bind(o),complete:(r?t.complete:n)?.bind(o)}}i(Go,"toObserver");var pn=[],we=0,{link:Ko,unlink:ls,propagate:us,checkDirty:Jo,shallowPropagate:qo}=jo({update(t){return t._update()},notify(t){pn[mn++]=t,t.flags&=~T.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=T.Mutable|T.Dirty,xe(t))}}),_e=0,mn=0,at,gn=0;function yn(t){try{++gn,t()}finally{--gn||vn()}}i(yn,"batch");function xe(t){let e=t.depsTail,n=e!==void 0?e.nextDep:t.deps;for(;n!==void 0;)n=ls(n,t)}i(xe,"purgeDeps");function vn(){if(!(gn>0)){for(;_e<mn;){let t=pn[_e];pn[_e++]=void 0,t.notify()}_e=0,mn=0}}i(vn,"flush");function be(t,e){let n=typeof t=="function",r=t,o={_snapshot:n?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?T.None:T.Mutable,get(){return at!==void 0&&Ko(o,at,we),o._snapshot},subscribe(s){let c=Go(s),a={current:!1},u=fs(()=>{o.get(),a.current?c.next?.(o._snapshot):a.current=!0});return{unsubscribe:i(()=>{u.stop()},"unsubscribe")}},_update(s){let c=at,a=e?.compare??Object.is;if(n)at=o,++we,o.depsTail=void 0;else if(s===void 0)return!1;n&&(o.flags=T.Mutable|T.RecursedCheck);try{let u=o._snapshot,l=typeof s=="function"?s(u):s===void 0&&n?r(u):s;return u===void 0||!a(u,l)?(o._snapshot=l,!0):!1}finally{at=c,n&&(o.flags&=~T.RecursedCheck),xe(o)}}};return n?(o.flags=T.Mutable|T.Dirty,o.get=function(){let s=o.flags;if(s&T.Dirty||s&T.Pending&&Jo(o.deps,o)){if(o._update()){let c=o.subs;c!==void 0&&qo(c)}}else s&T.Pending&&(o.flags=s&~T.Pending);return at!==void 0&&Ko(o,at,we),o._snapshot}):o.set=function(s){if(o._update(s)){let c=o.subs;c!==void 0&&(us(c),qo(c),vn())}},o}i(be,"createAtom");function fs(t){let e=i(()=>{let r=at;at=n,++we,n.depsTail=void 0,n.flags=T.Watching|T.RecursedCheck;try{return t()}finally{at=r,n.flags&=~T.RecursedCheck,xe(n)}},"run"),n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:T.Watching|T.RecursedCheck,notify(){let r=this.flags;r&T.Dirty||r&T.Pending&&Jo(this.deps,this)?e():this.flags=T.Watching},stop(){this.flags=T.None,this.depsTail=void 0,xe(this)}};return e(),n}i(fs,"effect");var Rn=k(B(),1),Yo=k(Nr(),1);function ds(t,e){return t===e}i(ds,"defaultCompare");function V(t,e,n=ds){let r=(0,Rn.useCallback)(c=>{if(!t)return()=>{};let{unsubscribe:a}=t.subscribe(c);return a},[t]),o=(0,Rn.useCallback)(()=>t?.get(),[t]);return(0,Yo.useSyncExternalStoreWithSelector)(r,o,o,e,n)}i(V,"useStore");var Xo={};function Sn(t,e){let n=Ce.useRef();return r=>{let o=t?.select?t.select(r):r;return t?.structuralSharing??e.options.defaultStructuralSharing?n.current=rt(n.current,o):o}}i(Sn,"useStructuralSharing");function X(t){let e=D(),n=Ce.useContext(t.from?qn:xt),r=t.from??n,o=e.stores.getMatchStore(r);if(!1){let a=o.get();if(!a){(t.shouldThrow??!0)&&mt();return}return t.select?t.select(a):a}let s=Sn(t,e),c=V(o,a=>a?s(a):Xo);if(c!==Xo)return c;(t.shouldThrow??!0)&&mt()}i(X,"useMatch");function Pe(t){return X({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:i(e=>t.select?t.select(e.search):e.search,"select")})}i(Pe,"useSearch");var ct=k(B(),1);var Le=ct.useLayoutEffect;function Zo(t,e,n){ct.useEffect(()=>{if(!t.current||n||typeof IntersectionObserver!="function")return()=>e();let r=new IntersectionObserver(o=>{e(o.pop())},{rootMargin:"100px"});return r.observe(t.current),()=>{r.disconnect(),e()}},[e,n,t])}i(Zo,"useIntersectionObserver");function Qo(t){let e=ct.useRef(null);return ct.useImperativeHandle(t,()=>e.current,[]),e}i(Qo,"useForwardedRef");var _n=k(B(),1);function Ee(t){let e=D();return _n.useCallback(n=>e.navigate({...n,from:n.from??t?.from}),[t?.from,e])}i(Ee,"useNavigate");var Bt=k(B(),1),lt=k(Z(),1);var It=class extends Bt.Component{static{i(this,"CatchBoundary")}constructor(...t){super(...t),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(t,e){let n=t.getResetKey();return e.error&&e.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,e){this.props.onCatch?.(t,e)}render(){let t=this.state.error;return t?Bt.createElement(this.props.errorComponent??wn,{error:t,reset:this.reset}):this.props.children}};function wn({error:t}){let[e,n]=Bt.useState(!1);return(0,lt.jsxs)("div",{style:{padding:".5rem",maxWidth:"100%"},children:[(0,lt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[(0,lt.jsx)("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),(0,lt.jsx)("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:i(()=>n(r=>!r),"onClick"),children:e?"Hide Error":"Show Error"})]}),(0,lt.jsx)("div",{style:{height:".25rem"}}),e?(0,lt.jsx)("div",{children:(0,lt.jsx)("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?(0,lt.jsx)("code",{children:t.message}):null})}):null]})}i(wn,"ErrorComponent");var xn=k(B(),1),tr=k(Z(),1);function er({children:t,fallback:e=null}){return(0,tr.jsx)(xn.default.Fragment,{children:bn()?t:e})}i(er,"ClientOnly");function bn(){return xn.default.useSyncExternalStore(hs,()=>!0,()=>!1)}i(bn,"useHydrated");function hs(){return()=>{}}i(hs,"subscribe");function Cn(t){return X({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:i(e=>t.select?t.select(e.loaderData):e.loaderData,"select")})}i(Cn,"useLoaderData");function Pn(t){let{select:e,...n}=t;return X({...n,select:i(r=>e?e(r.loaderDeps):r.loaderDeps,"select")})}i(Pn,"useLoaderDeps");function Ln(t){return X({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:i(e=>{let n=t.strict===!1?e.params:e._strictParams;return t.select?t.select(n):n},"select")})}i(Ln,"useParams");function En(t){return X({...t,select:i(e=>t.select?t.select(e.context):e.context,"select")})}i(En,"useRouteContext");var W=k(B(),1);var ps=k(Z(),1);function kn(t){let e=W.useRef(t);return Q(e.current,t,{ignoreUndefined:!1})||(e.current=t),e.current}i(kn,"useValueStable");function ms(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}i(ms,"compareLinkState");function gs(t,e,n){if(t?.external)return st(t.href,n)?void 0:t.href;if(!ir(e)&&!(typeof e!="string"||e.indexOf(":")===-1))try{return new URL(e),st(e,n)?void 0:e}catch{}}i(gs,"resolveExternalLink");function ys(t,e,n,r,o,s){if(s)return!1;if(n?.exact){if(!fe(t.pathname,e.pathname,r))return!1}else{let c=yt(t.pathname,r),a=yt(e.pathname,r);if(!(c.startsWith(a)&&(c.length===a.length||c[a.length]==="/")))return!1}return(n?.includeSearch??!0)&&!Q(t.search,e.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:n?.includeHash?o&&t.hash===e.hash:!0}i(ys,"resolveIsActive");function vs(t,e){let n=D(),r=Qo(e),{activeProps:o,inactiveProps:s,activeOptions:c,to:a,preload:u,preloadDelay:l,preloadIntentProximity:f,hashScrollIntoView:d,replace:h,startTransition:p,resetScroll:g,viewTransition:m,children:y,target:R,disabled:v,style:_,className:x,onClick:L,onBlur:b,onFocus:S,onMouseEnter:C,onMouseLeave:w,onTouchStart:P,ignoreBlocker:E,params:I,search:N,hash:_t,state:nt,mask:oe,reloadDocument:Ps,unsafeRelative:Ls,from:Es,_fromLocation:ks,...Nt}=t;if(!1){let M=ir(a);if(typeof a=="string"&&!M&&a.indexOf(":")>-1)try{return new URL(a),st(a,n.protocolAllowlist)?{...Nt,ref:r,href:void 0,...y&&{children:y},...R&&{target:R},...v&&{disabled:v},..._&&{style:_},...x&&{className:x}}:{...Nt,ref:r,href:a,...y&&{children:y},...R&&{target:R},...v&&{disabled:v},..._&&{style:_},...x&&{className:x}}}catch{}let F=n.buildLocation({...t,from:t.from}),ot=sr(F.maskedLocation?F.maskedLocation.publicHref:F.publicHref,F.maskedLocation?F.maskedLocation.external:F.external,n.history,v),Tt=(()=>{if(ot?.external)return st(ot.href,n.protocolAllowlist)?void 0:ot.href;if(!M&&typeof a=="string"&&a.indexOf(":")>-1)try{return new URL(a),st(a,n.protocolAllowlist)?void 0:a}catch{}})(),Ae=(()=>{if(Tt)return!1;let $=n.stores.location.get(),z=c?.exact??!1;if(z){if(!fe($.pathname,F.pathname,n.basepath))return!1}else{let U=yt($.pathname,n.basepath),H=yt(F.pathname,n.basepath);if(!(U.startsWith(H)&&(U.length===H.length||U[H.length]==="/")))return!1}if((c?.includeSearch??!0)&&$.search!==F.search){let U=!$.search||typeof $.search=="object"&&!ht($.search),H=!F.search||typeof F.search=="object"&&!ht(F.search);if(!(U&&H)&&!Q($.search,F.search,{partial:!z,ignoreUndefined:!c?.explicitUndefined}))return!1}return!c?.includeHash})();if(Tt)return{...Nt,ref:r,href:Tt,...y&&{children:y},...R&&{target:R},...v&&{disabled:v},..._&&{style:_},...x&&{className:x}};let $e=Ae?q(o,{})??nr:Ut,Be=Ae?Ut:q(s,{})??Ut,zn=(()=>{let $=_,z=$e.style,U=Be.style;if(!(!$&&!z&&!U))return $&&!z&&!U?$:!$&&z&&!U?z:!$&&!z&&U?U:{...$,...z,...U}})(),Hn=(()=>{let $=x,z=$e.className,U=Be.className;if(!$&&!z&&!U)return"";let H="";return $&&(H=$),z&&(H=H?`${H} ${z}`:z),U&&(H=H?`${H} ${U}`:U),H})();return{...Nt,...$e,...Be,href:ot?.href,ref:r,disabled:!!v,target:R,...zn&&{style:zn},...Hn&&{className:Hn},...v&&or,...Ae&&rr}}let An=bn(),Cr=kn(t.search),Pr=kn(t.params),$n=kn(c),zt=W.useMemo(()=>t,[n,t.from,t._fromLocation,t.hash,t.to,Cr,Pr,t.state,t.mask,t.unsafeRelative]),Lr=W.useCallback(M=>{let F=n.buildLocation({_fromLocation:M,...zt}),ot=sr(F.maskedLocation?F.maskedLocation.publicHref:F.publicHref,F.maskedLocation?F.maskedLocation.external:F.external,n.history,v),Tt=gs(ot,a,n.protocolAllowlist);return[ot?.href,Tt,ys(M,F,$n,n.basepath,An,Tt!==void 0)]},[$n,v,An,zt,n,a]),[Er,Te,De]=V(n.stores.location,Lr,ms),re=De?q(o,{})??nr:Ut,se=De?Ut:q(s,{})??Ut,Bn=[x,re.className,se.className].filter(Boolean).join(" "),Un=(_||re.style||se.style)&&{..._,...re.style,...se.style},Vn=W.useRef(!1),wt=t.reloadDocument||Te||v?!1:u??n.options.defaultPreload,Fe=l??n.options.defaultPreloadDelay??0,Ot=W.useCallback(()=>{n.preloadRoute(zt).catch(M=>{console.warn(M),console.warn(dn)})},[n,zt]),Me=W.useCallback(M=>{if(!M){In(r);return}if(!(M.isIntersecting??wt==="intent")){M.isIntersecting===!1&&In(r);return}if(!Fe){Ot();return}te.has(r)||te.set(r,setTimeout(()=>{te.delete(r),Ot()},Fe))},[Ot,r,wt,Fe]);Zo(r,Me,wt!=="viewport"),W.useEffect(()=>{Vn.current||wt==="render"&&(Ot(),Vn.current=!0)},[Ot,wt]);let kr=i(M=>{let F=M.currentTarget.getAttribute("target"),ot=R!==void 0?R:F;!v&&!(M.metaKey||M.altKey||M.ctrlKey||M.shiftKey)&&!M.defaultPrevented&&(!ot||ot==="_self")&&M.button===0&&(M.preventDefault(),n.navigate({...zt,replace:h,resetScroll:g,hashScrollIntoView:d,startTransition:p,viewTransition:m,ignoreBlocker:E}))},"handleClick");if(Te)return{...Nt,ref:r,href:Te,...y&&{children:y},...R&&{target:R},...v&&{disabled:v},..._&&{style:_},...x&&{className:x},...L&&{onClick:L},...b&&{onBlur:b},...S&&{onFocus:S},...C&&{onMouseEnter:C},...w&&{onMouseLeave:w},...P&&{onTouchStart:P}};let Ir=i(()=>{wt==="intent"&&Ot()},"handleTouchStart"),Wn=i(()=>{wt==="intent"&&In(r)},"handleLeave");return{...Nt,...re,...se,href:Er,ref:r,onClick:Vt([L,kr]),onBlur:Vt([b,Wn]),onFocus:Vt([S,Me]),onMouseEnter:Vt([C,Me]),onMouseLeave:Vt([w,Wn]),onTouchStart:Vt([P,Ir]),disabled:!!v,target:R,...Un&&{style:Un},...Bn&&{className:Bn},...v&&or,...De&&rr}}i(vs,"useLinkProps");var Ut={},nr={className:"active"},or={role:"link","aria-disabled":!0},rr={"data-status":"active","aria-current":"page"},te=new WeakMap,In=i(t=>{clearTimeout(te.get(t)),te.delete(t)},"cancelPreload"),Vt=i(t=>e=>{for(let n of t)if(n){if(e.defaultPrevented)return;n(e)}},"composeHandlers");function sr(t,e,n,r){if(!r)return e?{href:t,external:!0}:{href:n.createHref(t)||"/",external:!1}}i(sr,"getHrefOption");function ir(t){if(typeof t!="string")return!1;let e=t.charCodeAt(0);return e===47?t.charCodeAt(1)!==47:e===46}i(ir,"isSafeInternal");var Nn=W.forwardRef((t,e)=>{let{_asChild:n,...r}=t,{type:o,...s}=vs(r,e),c=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){let{disabled:a,...u}=s;return W.createElement("a",u,c)}return W.createElement(n,s,c)});var On=k(B(),1),Tn=k(Z(),1);var ar=class extends Se{static{i(this,"Route")}constructor(t){super(t),this.useMatch=e=>X({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>En({...e,from:this.id}),this.useSearch=e=>Pe({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Ln({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Pn({...e,from:this.id}),this.useLoaderData=e=>Cn({...e,from:this.id}),this.useNavigate=()=>Ee({from:this.fullPath}),this.Link=On.default.forwardRef((e,n)=>(0,Tn.jsx)(Nn,{ref:n,from:this.fullPath,...e}))}};function Rs(t){return new ar(t)}i(Rs,"createRoute");var cr=class extends hn{static{i(this,"RootRoute")}constructor(t){super(t),this.useMatch=e=>X({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>En({...e,from:this.id}),this.useSearch=e=>Pe({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Ln({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Pn({...e,from:this.id}),this.useLoaderData=e=>Cn({...e,from:this.id}),this.useNavigate=()=>Ee({from:this.fullPath}),this.Link=On.default.forwardRef((e,n)=>(0,Tn.jsx)(Nn,{ref:n,from:this.fullPath,...e}))}};function Ss(t){return new cr(t)}i(Ss,"createRootRoute");var Ic=k(B(),1);var ke=k(Z(),1);function lr(t){let e=D();if(!1){let r=`not-found-${e.stores.location.get().pathname}-${e.stores.status.get()}`;return(0,ke.jsx)(It,{getResetKey:i(()=>r,"getResetKey"),onCatch:i((o,s)=>{if(J(o))t.onCatch?.(o,s);else throw o},"onCatch"),errorComponent:i(({error:o})=>{if(J(o))return t.fallback?.(o);throw o},"errorComponent"),children:t.children})}let n=`not-found-${V(e.stores.location,r=>r.pathname)}-${V(e.stores.status,r=>r)}`;return(0,ke.jsx)(It,{getResetKey:i(()=>n,"getResetKey"),onCatch:i((r,o)=>{if(J(r))t.onCatch?.(r,o);else throw r},"onCatch"),errorComponent:i(({error:r})=>{if(J(r))return t.fallback?.(r);throw r},"errorComponent"),children:t.children})}i(lr,"CatchNotFound");function ur(){return(0,ke.jsx)("p",{children:"Not Found"})}i(ur,"DefaultGlobalNotFound");var fr=k(Z(),1);function dr({children:t}){let e=D();return null}i(dr,"ScriptOnce");var Ac=k(B(),1),Ie=k(Z(),1);function St(t){return(0,Ie.jsx)(Ie.Fragment,{children:t.children})}i(St,"SafeFragment");var Vc=k(B(),1),Ne=k(Z(),1);function Dn(t,e,n){return e.options.notFoundComponent?(0,Ne.jsx)(e.options.notFoundComponent,{...n}):t.options.defaultNotFoundComponent?(0,Ne.jsx)(t.options.defaultNotFoundComponent,{...n}):(0,Ne.jsx)(ur,{})}i(Dn,"renderRouteNotFound");var pr=k(Z(),1);function hr(t){return null}i(hr,"getScrollRestorationScriptForRouter");function mr(){let t=hr(D());return t?(0,pr.jsx)(dr,{children:t}):null}i(mr,"ScrollRestoration");var K=k(B(),1);var A=k(Z(),1);function ee(t,e){let n=e?.options.pendingComponent??t.options.defaultPendingComponent;return n?(0,A.jsx)(n,{}):null}i(ee,"renderPending");var _s=i((t,e)=>t[0]===e[0]&&t[1]===e[1],"outletMatchSelectionEqual"),vr=i((t,e,n)=>!e.isRoot||e.options.shellComponent||e.options.wrapInSuspense||n===!1||n==="data-only"||!t.ssr,"canWrapInSuspense"),Oe=K.memo(i(function({routeId:e}){let n=D();return(0,A.jsx)(gr,{router:n,match:V(n.stores.getMatchStore(e),r=>r)})},"MatchImpl"));function gr({router:t,match:e}){let n=t.routesById[e.routeId],r=ee(t,n),o=n.options.errorComponent??t.options.defaultErrorComponent,s=n.options.onCatch??t.options.defaultOnCatch,c=n.isRoot?n.options.notFoundComponent??t.options.notFoundRoute?.options.component:n.options.notFoundComponent,a=e.ssr===!1||e.ssr==="data-only",u=vr(t,n,e.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||a))?K.Suspense:St,l=o?It:St,f=c?lr:St;return(0,A.jsxs)(n.isRoot?n.options.shellComponent??St:St,{children:[(0,A.jsx)(xt.Provider,{value:e.routeId,children:(0,A.jsx)(u,{fallback:r,children:(0,A.jsx)(l,{getResetKey:i(()=>e,"getResetKey"),errorComponent:o,onCatch:i((d,h)=>{if(J(d))throw d.routeId??=e.routeId,d;s?.(d,h)},"onCatch"),children:(0,A.jsx)(f,{fallback:i(d=>{if(d.routeId??=e.routeId,d.routeId!==e.routeId)throw d;return K.createElement(c,d)},"fallback"),children:a?(0,A.jsx)(er,{fallback:r,children:(0,A.jsx)(yr,{match:e})}):(0,A.jsx)(yr,{match:e})})})})}),null]})}i(gr,"MatchView");var yr=K.memo(i(function({match:e}){let n=D(),r=e.routeId,o=n.routesById[r],s=K.useMemo(()=>{let a=(o.options.remountDeps??n.options.defaultRemountDeps)?.({routeId:r,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return a?JSON.stringify(a):void 0},[r,e.loaderDeps,e._strictParams,e._strictSearch,o.options.remountDeps,n.options.defaultRemountDeps]),c=K.useMemo(()=>{let a=o.options.component??n.options.defaultComponent;return a?(0,A.jsx)(a,{},s):(0,A.jsx)(Rr,{})},[s,o.options.component,n.options.defaultComponent]);if(e.status==="pending"){if(n.ssr&&!vr(n,o,e.ssr))return c;if(n._tx)throw n._tx[5];return ee(n,o)}if(e.status==="notFound")return Dn(n,o,e.error);if(e.status==="error"){if(!1)return(0,A.jsx)((o.options.errorComponent??n.options.defaultErrorComponent)||wn,{error:e.error,reset:void 0,info:{componentStack:""}});throw e.error}return c},"MatchInnerImpl")),Rr=K.memo(i(function(){let e=D(),n=K.useContext(xt),r,o,s;if(!1){let a=e.stores.matches.get(),u=a.findIndex(f=>f.routeId===n),l=a[u];r=!!l._notFound,o=l.error,s=a[u+1]?.routeId}else{let a=e.stores.getMatchStore(n);[r,o]=V(a,u=>[!!u._notFound,u.error],_s),s=V(e.stores.ids,u=>u[u.indexOf(n)+1])}if(r)return Dn(e,e.routesById[n],o);if(!s)return null;let c=(0,A.jsx)(Oe,{routeId:s});return n===tt?(0,A.jsx)(K.Suspense,{fallback:ee(e),children:c}):c},"OutletImpl"));var Fn=k(B(),1);function Mn(t,e){let n=t[1];t.length=0,n?.(e)}i(Mn,"settleOwner");function Sr({t}){let e=D(),n=e._rendered??=[],r=void 0;return e.startTransition=(o,s)=>new Promise(c=>{Mn(n,!1),n.push(s,c),t(e),Fn.startTransition(o)}),Le(()=>{let o=e.history.subscribe(e.load);if(r?.current)return o;r&&(r.current=!0),e.updateLatestLocation();let s=e.latestLocation,c=e.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(G(s.publicHref)!==G(c.publicHref))return e.commitLocation({...c,replace:!0,ignoreBlocker:!0}),o;let a=e.stores.resolvedLocation.get();return a?.href===s.href&&a.state.__TSR_key===s.state.__TSR_key?n.push(e.stores.matches.get(),u=>{u&&e.emit({type:"onRendered",...Ct(a,a)})}):e._tx||e.load({sync:!0}).catch(console.error),o},[e,e.history]),null}i(Sr,"Transitioner");var Wt=k(B(),1);var et=k(Z(),1);function _r(){let t=D(),e=t.routesById[tt],n=ee(t,e),r=t.ssr?St:Wt.Suspense,o=(0,et.jsxs)(et.Fragment,{children:[!!1&&(0,et.jsx)(Sr,{t:Wt.useState()[1]}),(0,et.jsx)(r,{fallback:n,children:(0,et.jsx)(ws,{})})]});return t.options.InnerWrap?(0,et.jsx)(t.options.InnerWrap,{children:o}):o}i(_r,"Matches");function ws(){let t=D(),e=t._rendered,n=V(t.stores.matches,c=>e[0]??c),r=n[0],o=r?.routeId;Le(()=>{e[0]===n&&Mn(e,!0)},[e,n]);let s=o?(0,et.jsx)(Oe,{routeId:o}):null;return(0,et.jsx)(xt.Provider,{value:o,children:t.options.disableGlobalCatchBoundary?s:(0,et.jsx)(It,{getResetKey:i(()=>r,"getResetKey"),onCatch:void 0,children:s})})}i(ws,"MatchesInner");var wr=i(t=>({createMutableStore:be,createReadonlyStore:be,batch:yn}),"getStoreFactory");var xs=i(t=>new xr(t),"createRouter"),xr=class extends nn{static{i(this,"Router")}constructor(t){super(t,wr)}};var Al=k(B(),1),ne=k(Z(),1);function br({router:t,children:e,...n}){ht(n)&&t.update({...t.options,...n,context:{...t.options.context,...n.context}});let r=(0,ne.jsx)(ie.Provider,{value:t,children:e});return t.options.Wrap?(0,ne.jsx)(t.options.Wrap,{children:r}):r}i(br,"RouterContextProvider");function bs({router:t,...e}){return(0,ne.jsx)(br,{router:t,...e,children:(0,ne.jsx)(_r,{})})}i(bs,"RouterProvider");function Cs(t){let e=D({warn:t?.router===void 0}),n=t?.router||e;if(!1){let r=n.stores.__store.get();return t?.select?t.select(r):r}return V(n.stores.__store,Sn(t,n))}i(Cs,"useRouterState");export{tn as a,Yr as b,D as c,Pe as d,Ee as e,Rs as f,Ss as g,Rr as h,xs as i,bs as j,Cs as k};
@@ -0,0 +1 @@
1
+ import{a as G}from"./chunk-EA2JKR5D.js";import{a as x}from"./chunk-IMOHEGMV.js";import{a as U}from"./chunk-2DX5MROH.js";import{b as M}from"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import{W as O}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as p}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as w}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as E}from"./chunk-4ZEL6BYL.js";import{f as D}from"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{d as K,e as _,f as z,h as B,o as P,r as q}from"./chunk-FODLDLE2.js";import{a as s,d as J,e as ie,g as oe}from"./chunk-YKXDMIHQ.js";var i=J(ie(),1);var e=J(oe(),1);var de=s(r=>r.kind==="id"?r.table===void 0?"id":`id<${r.table}>`:r.kind==="array"?r.element===void 0?"array":`${r.element}[]`:r.kind,"oe"),le=s(r=>r===void 0||r.length===0?"()":`(${r.map(o=>`${o.name}${o.optional?"?":""}: ${de(o)}`).join(", ")})`,"ie"),ce=s(r=>{switch(r){case"array":return[];case"bigint":case"number":return 0;case"boolean":return!1;case"object":case"record":return{};default:return""}},"de"),ue=s(r=>{let o={};for(let a of r??[])a.optional||(o[a.name]=ce(a.kind));return JSON.stringify(o,void 0,2)},"le"),me=z(E.runAs),fe=10,he=s(r=>r===void 0?"undefined":JSON.stringify(r,null,2),"me"),Fe=s(({functions:r,runAsIdentity:o=!1}={})=>{let a=K(),u=D(),[H,Q]=(0,i.useState)(null),[k,V]=(0,i.useState)(null),g=r??H??[],[I,S]=(0,i.useState)(""),[m,b]=(0,i.useState)("{}"),[c,F]=(0,i.useState)(""),[f,W]=(0,i.useState)(""),[v,h]=(0,i.useState)("idle"),[X,y]=(0,i.useState)(void 0),[C,N]=(0,i.useState)(null),[$,Y]=(0,i.useState)([]);(0,i.useEffect)(()=>{if(r!==void 0)return;let t=!1;return u.listFunctions().then(d=>(t||Q(d),d)).catch(d=>{t||V(B(d))}),()=>{t=!0}},[u,r]);let A=I===""?g[0]?.path??"":I,n=g.find(t=>t.path===A),Z=s(async()=>{if(!n)return;let t;try{t=m.trim()===""?{}:JSON.parse(m)}catch(l){h("error"),y(void 0),N(a("Invalid JSON args: {message}",{message:l.message}));return}let d={__lunoraRef:n.path},R=c.trim()===""?{}:{shardKey:c.trim()},j=o?f.trim():"",L=s(l=>{Y(T=>[{argsText:m,at:Date.now(),id:(T[0]?.id??0)+1,kind:n.kind,path:n.path,shardKey:c,status:l},...T].slice(0,fe))},"$");h("running"),N(null);try{let l=j===""?await _(u,n.kind,d,t,R):await u.query(me,{args:t,functionPath:n.path,userId:j},R);M(c),y(l),h("success"),L("success")}catch(l){y(void 0),N(l.message),h("error"),L("error")}},"J"),ee=s(t=>{S(t.path),b(t.argsText),F(t.shardKey)},"M"),te=s(t=>{S(t.target.value)},"P"),re=s(t=>{b(t.target.value)},"z"),ae=s(t=>{W(t.target.value)},"q"),se=s(()=>{P(Z())},"H"),ne=s(()=>{b(ue(n?.args))},"V");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-runner",children:[k!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"function-discover-error",role:"alert",children:k}),(0,e.jsxs)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)(x,{htmlFor:"function-select",children:a("Function")}),(0,e.jsx)("select",{"aria-label":a("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"function-select",id:"function-select",onChange:te,value:A,children:g.map(t=>(0,e.jsxs)("option",{value:t.path,children:[t.path," (",t.kind,")"]},t.path))}),n!==void 0&&(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,e.jsx)("span",{className:"mr-1.5 font-medium",children:a("Signature")}),(0,e.jsx)("code",{className:"font-mono","data-testid":"function-signature",children:le(n.args)})]})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)(x,{htmlFor:"args-input",children:a("Arguments")}),(0,e.jsx)(p,{"data-testid":"prefill-button",disabled:n===void 0,onClick:ne,size:"xs",type:"button",variant:"ghost",children:a("Prefill")})]}),(0,e.jsx)(G,{"aria-label":a("Arguments"),className:"font-mono text-xs","data-testid":"args-input",id:"args-input",onChange:re,value:m})]}),(0,e.jsx)(U,{onChange:F,testId:"shard-input",value:c}),o&&(0,e.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"run-as-field",children:[(0,e.jsx)(x,{htmlFor:"run-as-input",children:a("Run as identity (userId)")}),(0,e.jsx)(O,{"aria-label":a("Run as identity (userId)"),className:"font-mono text-xs","data-testid":"run-as-input",id:"run-as-input",onChange:ae,placeholder:a("Leave empty to run as admin"),value:f}),(0,e.jsx)("p",{className:"text-[11px] text-muted-foreground",children:a("Dev only: runs the function as this user so you can test auth and RLS. Forged over the admin gate.")})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(p,{"data-testid":"run-button",disabled:v==="running"||n===void 0,onClick:se,type:"button",children:a("Run")}),n!==void 0&&(0,e.jsx)(w,{variant:"outline",children:n.kind}),o&&f.trim()!==""&&(0,e.jsx)(w,{"data-testid":"run-as-badge",variant:"secondary",children:a("as {userId}",{userId:f.trim()})})]})]}),v==="error"&&C!==null&&(0,e.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"error",role:"alert",children:C}),v==="success"&&(0,e.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"result",children:he(X)}),$.length>0&&(0,e.jsx)("ul",{className:"flex flex-col overflow-hidden rounded-xl border border-border","data-testid":"fn-history",children:$.map((t,d)=>(0,e.jsxs)("li",{className:"flex flex-wrap items-center gap-2 border-b border-border px-3 py-2 text-sm last:border-b-0","data-testid":"fn-history-row",children:[(0,e.jsx)("span",{className:t.status==="success"?"text-success":"text-destructive","data-testid":`fn-history-status-${d.toString()}`,children:t.status==="success"?"\u2713":"\u2717"})," ",(0,e.jsxs)("span",{className:"font-mono text-xs",children:[t.path," (",t.kind,")"]})," ",(0,e.jsx)("time",{className:"text-xs text-muted-foreground",children:q(t.at)})," ",(0,e.jsx)(p,{className:"ml-auto","data-testid":`fn-history-load-${d.toString()}`,onClick:s(()=>{ee(t)},"onClick"),size:"xs",type:"button",variant:"ghost",children:a("Load")})]},t.id))})]})},"Ae");export{Fe as FunctionRunner};
@@ -0,0 +1 @@
1
+ import{a as E}from"./chunk-66UGPQVC.js";import{a as w}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import"./chunk-225VJ77I.js";import{b as T}from"./chunk-FPG5ZRPW.js";import{f as A}from"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as j}from"./chunk-FKVZRPV5.js";import{a as _,b as $,c as C,d as g,e as o,f as l}from"./chunk-HEAQVSNS.js";import{a as I,e as S}from"./chunk-WUWBZPUK.js";import{d as k,o as B,r as R}from"./chunk-FODLDLE2.js";import{a as h,d as y,f as K,g as L}from"./chunk-YKXDMIHQ.js";var H=y(K(),1);var s=y(L(),1);var z=200,U=h(()=>{let e=(0,H.c)(21),n=A(),t=k(),u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=["lunora-auth-sessions",z],e[0]=u):u=e[0];let p;e[1]!==n?(p=h(()=>n.listAuthSessions({limit:z}),"u"),e[1]=n,e[2]=p):p=e[2];let a=T(u,p),{error:f}=a,i=a.data?.rows??null,x;e[3]!==a?(x=h(()=>{a.refetch()},"p"),e[3]=a,e[4]=x):x=e[4],E(x,!0);let N;e[5]!==n||e[6]!==a?(N=h(r=>{B((async()=>{await n.revokeAuthSession({sessionId:r}),a.refetch()})())},"x"),e[5]=n,e[6]=a,e[7]=N):N=e[7];let v=N,d;e[8]!==f?(d=f!==null&&(0,s.jsx)("p",{className:"text-sm text-destructive","data-testid":"auth-sessions-error",role:"alert",children:f}),e[8]=f,e[9]=d):d=e[9];let c;e[10]!==i||e[11]!==t?(c=i!==null&&i.length===0&&(0,s.jsx)(j,{testId:"auth-sessions-empty",title:t("No active sessions.")}),e[10]=i,e[11]=t,e[12]=c):c=e[12];let m;e[13]!==v||e[14]!==i||e[15]!==t?(m=i!==null&&i.length>0&&(0,s.jsx)(I,{className:"overflow-hidden py-0",children:(0,s.jsx)(S,{className:"px-0",children:(0,s.jsxs)(_,{"data-testid":"auth-sessions-table",children:[(0,s.jsx)($,{children:(0,s.jsxs)(g,{children:[(0,s.jsx)(o,{children:t("user")}),(0,s.jsx)(o,{children:t("expires")}),(0,s.jsx)(o,{children:t("ip")}),(0,s.jsx)(o,{children:t("user agent")}),(0,s.jsx)(o,{children:t("impersonated by")}),(0,s.jsx)(o,{"aria-label":t("Actions")})]})}),(0,s.jsx)(C,{children:i.map(r=>(0,s.jsxs)(g,{"data-testid":`auth-session-${r.id}`,children:[(0,s.jsx)(l,{className:"font-mono text-xs",children:r.userId}),(0,s.jsx)(l,{className:"text-muted-foreground tabular-nums",children:R(r.expiresAt)}),(0,s.jsx)(l,{children:r.ipAddress??""}),(0,s.jsx)(l,{className:"max-w-40 truncate",children:r.userAgent??""}),(0,s.jsx)(l,{className:"font-mono text-xs",children:r.impersonatedBy??""}),(0,s.jsx)(l,{children:(0,s.jsx)(w,{"data-testid":`auth-session-revoke-${r.id}`,onClick:h(()=>{v(r.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:t("Revoke")})})]},r.id))})]})})}),e[13]=v,e[14]=i,e[15]=t,e[16]=m):m=e[16];let b;return e[17]!==d||e[18]!==c||e[19]!==m?(b=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"auth-sessions",children:[d,c,m]}),e[17]=d,e[18]=c,e[19]=m,e[20]=b):b=e[20],b},"K");export{U as default};
@@ -0,0 +1 @@
1
+ import{a as te}from"./chunk-PD6WIDY6.js";import{a as Z}from"./chunk-S3CRZLGS.js";import{a as Y}from"./chunk-2DX5MROH.js";import{b as X}from"./chunk-OGUKYRFM.js";import{a as W}from"./chunk-K7AJEMKE.js";import{e as G}from"./chunk-6D6Z2KXU.js";import"./chunk-OKG3HWSJ.js";import"./chunk-PLHA3OWK.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import{b as ae,c as ne}from"./chunk-C6T7K5XP.js";import{a as q,b as ee}from"./chunk-JBLAVREZ.js";import{a as Q}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import"./chunk-225VJ77I.js";import"./chunk-GWFZ7WCP.js";import"./chunk-ULIQFBZU.js";import"./chunk-4JJEP7LF.js";import"./chunk-35DM4JJG.js";import{a as I}from"./chunk-4ZEL6BYL.js";import{c as _}from"./chunk-FPG5ZRPW.js";import{f as D}from"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import"./chunk-HEAQVSNS.js";import"./chunk-WUWBZPUK.js";import{d as M,f as C,g as A,l as V,o as N}from"./chunk-FODLDLE2.js";import{a as l,d as j,e as he,f as me,g as pe}from"./chunk-YKXDMIHQ.js";var E=j(me(),1);var c=j(he(),1);var S=j(pe(),1);var ge=l(t=>{let{suggestedIndex:e,table:i}=t;if(typeof i!="string"||i.length===0||typeof e!="object"||e===null)return!1;let{fields:a,name:n}=e;return!Array.isArray(a)||a.length===0||a.some(s=>typeof s!="string"||s.length===0)?!1:typeof n=="string"&&n.length>0},"ye"),be=l((t,e)=>`.index(${JSON.stringify(t)}, [${e.map(i=>JSON.stringify(i)).join(", ")}])`,"ge"),ye=l(t=>{let e=(0,E.c)(19),{fields:i,indexName:a,table:n,testId:s}=t,u=M(),[h,f]=(0,c.useState)(null),m;e[0]!==i||e[1]!==a?(m=l(()=>{let b=be(a,i),$="navigator"in globalThis?globalThis.navigator.clipboard:void 0;if($===void 0){f({copied:!1,declaration:b});return}N($.writeText(b).then(()=>(f({copied:!0,declaration:b}),!0)),()=>{f({copied:!1,declaration:b})})},"m"),e[0]=i,e[1]=a,e[2]=m):m=e[2];let x=m;if(h!==null){let b;return e[3]!==h.copied||e[4]!==h.declaration||e[5]!==u||e[6]!==n||e[7]!==s?(b=h.copied?(0,S.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":`${s}-applied`,children:u("Index declaration copied \u2014 add it to {table} in lunora/schema.ts.",{table:n})}):(0,S.jsxs)("span",{className:"flex flex-col gap-1 text-xs text-muted-foreground","data-testid":`${s}-manual`,children:[u("Could not reach the clipboard \u2014 add this to {table} in lunora/schema.ts:",{table:n}),(0,S.jsx)("code",{className:"font-mono break-all select-all",children:h.declaration})]}),e[3]=h.copied,e[4]=h.declaration,e[5]=u,e[6]=n,e[7]=s,e[8]=b):b=e[8],b}let T;e[9]!==u?(T=u("Copy?"),e[9]=u,e[10]=T):T=e[10];let p;e[11]!==u||e[12]!==n?(p=u("Copy index declaration for {table}",{table:n}),e[11]=u,e[12]=n,e[13]=p):p=e[13];let w;return e[14]!==x||e[15]!==T||e[16]!==p||e[17]!==s?(w=(0,S.jsx)(te,{confirmLabel:T,onConfirm:x,testId:s,children:p}),e[14]=x,e[15]=T,e[16]=p,e[17]=s,e[18]=w):w=e[18],w},"ve"),xe=l((t,e)=>{let i=new Map;for(let a of e){let n=`${a.table} ${a.index}`;i.set(n,(i.get(n)??0)+a.reads)}return t.map(a=>({index:a.index,reads:i.get(`${a.table} ${a.index}`)??0,table:a.table}))},"Se"),ve=l(t=>{let e=new Map;for(let i of t)for(let a of i.scannedTables??[])e.set(a.table,(e.get(a.table)??0)+a.scans);return[...e].map(([i,a])=>({scans:a,table:i}))},"Te"),ie=l((t,e)=>e.map(i=>({index:i.name,table:t})),"P"),we=l(t=>{let e=xe(t.declaredIndexes??[],t.indexHits??[]),i=ve(t.functions??[]),a=t.shardTraffic??[],n=t.analyticsMetrics,s=n&&n.indexHits.length>0?n.indexHits:e,u=n&&n.tableScans.length>0?n.tableScans:i,h=n&&n.shardTraffic.length>0?n.shardTraffic:a,f=ne({indexHits:s,schema:{tables:[]},shardTraffic:h,tableScans:u},{lints:ae,source:"runtime"}),m=t.suppressHotScanTables;return(m===void 0?f:f.filter(x=>!(x.metadata.kind==="hot_scan"&&typeof x.metadata.table=="string"&&m.has(x.metadata.table)))).map(x=>q(x))},"we"),Se=C(I.listTables),Te=C(I.listTableIndexes),Ie=C(I.listTablesIndexes),B=l(t=>`${(t*100).toFixed(1)}%`,"L"),re=l(t=>`${(t/1e3).toFixed(2)}s`,"V"),$e=l(t=>{if(t.length<=1)return t[0]??"";let e=t[t.length-1]??"";return`${t.slice(0,-1).join(", ")} and ${e}`},"Ne"),ke=l((t,e)=>({"high-error-rate":t("High error rate"),"high-evictions":t("High cache eviction rate"),"high-write-contention":t("High write contention"),"low-cache-hit-rate":t("Low cache hit rate"),"missing-index":t("Missing index"),"slow-function":t("Slow function"),"storage-headroom":t("Storage headroom")})[e.kind],"ke"),se=l((t,e)=>({"high-error-rate":t("{rate} of calls failed.",{rate:B(e.value)}),"high-evictions":t("{count} entries evicted recently.",{count:e.value}),"high-write-contention":t("{rate} of calls hit a write conflict \u2014 consider sharding to cut contention.",{rate:B(e.value)}),"low-cache-hit-rate":t("{rate} hit rate over recent traffic.",{rate:B(e.value)}),"missing-index":t("Slowest call took {duration} \u2014 it full-scanned {tables} with no index.",{duration:re(e.value),tables:$e(e.tables??[])}),"slow-function":t("Slowest call took {duration}.",{duration:re(e.value)}),"storage-headroom":t("{size} of the 10 GiB per-shard ceiling \u2014 plan a .shardBy() migration while it still has runway.",{size:V(e.value)})})[e.kind],"U"),Ne=l(t=>{let e=(0,E.c)(10),{onJump:i,table:a}=t,n=M(),s;e[0]!==i||e[1]!==a?(s=l(()=>{i(a)},"i"),e[0]=i,e[1]=a,e[2]=s):s=e[2];let u=s,h=`in-add-index-${a}`,f;e[3]!==n||e[4]!==a?(f=n("Add index on {table}",{table:a}),e[3]=n,e[4]=a,e[5]=f):f=e[5];let m;return e[6]!==u||e[7]!==h||e[8]!==f?(m=(0,S.jsx)(Q,{"data-testid":h,onClick:u,size:"sm",type:"button",variant:"outline",children:f}),e[6]=u,e[7]=h,e[8]=f,e[9]=m):m=e[9],m},"Be"),ze=l(({initialShardKey:t,loadShardTraffic:e})=>{let i=D(),a=G(),n=M(),{queryShardKey:s,setShardKey:u,shardKey:h}=Z(t),[f,m]=(0,c.useState)(null),[x,T]=(0,c.useState)(null),p=(0,c.useRef)(""),w=_(I.getMetrics,{},{live:!0,shardKey:s}),b=_(I.getFunctionStats,{},{live:!0,shardKey:s}),$=_(I.getAdvisories,{},{live:!0,shardKey:s}),L=w.data??null,H=b.data?.functions??null,F=$.data?.advisories??null,J=w.data?.indexHits??null,O=w.error!==null&&b.error!==null?w.error:null,oe=e??(r=>i.shardTraffic(r)),le=l(async(r,y)=>{let o=r[0];if(o===void 0||o===""){p.current===y&&T(null);return}try{let g=await oe(o);if(p.current!==y)return;let d=new Map;for(let v of g.shards)d.has(v.shardKey)||d.set(v.shardKey,{requests:v.requests,shardKey:v.shardKey});T([...d.values()])}catch{p.current===y&&T(null)}},"Y"),de=l(async(r,y)=>{let o=await Promise.allSettled(r.map(async d=>[d,await i.query(Te,{table:d},A(y))])),g=[];for(let d of o)if(d.status==="fulfilled"){let[v,k]=d.value;g.push(...ie(v,k.indexes))}return g},"Z"),z=(0,c.useEffectEvent)(async r=>{p.current=r;let y=[];try{let o=await i.query(Se,{},A(r));if(p.current!==r)return;X(r),y=o.map(d=>d.name);let g=[];if(y.length>0)try{let d=await i.query(Ie,{tables:y},A(r));if(p.current!==r)return;for(let[v,k]of Object.entries(d.indexesByTable))g.push(...ie(v,k))}catch{if(g=await de(y,r),p.current!==r)return}m(g)}catch{p.current===r&&m(null)}await le(y,r)});(0,c.useEffect)(()=>{N(z(s))},[s]);let ce=(0,c.useEffectEvent)(()=>{w.refetch(),b.refetch(),$.refetch(),N(z(s))});(0,c.useEffect)(()=>{let r=l(()=>{document.visibilityState==="visible"&&ce()},"r");return document.addEventListener("visibilitychange",r),()=>{document.removeEventListener("visibilitychange",r)}},[]);let U=(0,c.useCallback)(r=>{N(a({search:{table:r},to:"/schema"}))},[a]),K=(0,c.useMemo)(()=>W(L,H),[H,L]),P=(0,c.useMemo)(()=>new Set(K.filter(r=>r.kind==="missing-index").flatMap(r=>r.tables??[])),[K]),R=(0,c.useMemo)(()=>we({declaredIndexes:f??[],functions:H,indexHits:J,shardTraffic:x,suppressHotScanTables:P}),[f,H,J,P,x]),ue=(0,c.useMemo)(()=>{let r=K.map(o=>{let g=o.kind==="missing-index"?o.tables??[]:[];return{action:g.length>0?g.map(d=>(0,S.jsx)(Ne,{onJump:U,table:d},d)):void 0,description:o.message===void 0?se(n,o):`${se(n,o)} \u2014 ${o.message}`,entity:o.fn,issueType:ke(n,o),key:`${o.kind}:${o.fn??""}`,level:o.severity}}),y=new Set(["unindexed_foreign_key","unindexed_relation_target"]);return[...(F??[]).map(o=>{let g=q(o);if(y.has(o.name)&&ge(o.metadata)){let{table:d,suggestedIndex:v}=o.metadata,k=`in-apply-index-${d}-${v.name}`;return{...g,action:(0,S.jsx)(ye,{fields:v.fields,indexName:v.name,table:d,testId:k})}}return g}),...R,...r]},[F,K,U,R,n]),fe=(0,S.jsx)(Y,{onChange:u,testId:"in-shard-input",value:h});return(0,S.jsx)(ee,{error:O,errorSource:O===null?void 0:w.errorSource,rows:ue,testId:"lunora-insights",toolbar:fe})},"Ue");export{ze as InsightsPanel};
@@ -0,0 +1 @@
1
+ import{W as K}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as Q}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import"./chunk-225VJ77I.js";import{f as z}from"./chunk-LIEKK2VL.js";import"./chunk-FSRSK4LY.js";import"./chunk-MKL7VDTL.js";import{a as W}from"./chunk-FKVZRPV5.js";import{a as q,b as B,c as L,d as f,e as c,f as d}from"./chunk-HEAQVSNS.js";import{a as I,e as j}from"./chunk-WUWBZPUK.js";import{d as F,h as S,n as Z,o as V}from"./chunk-FODLDLE2.js";import{a as h,d as C,e as U,f as G,g as J}from"./chunk-YKXDMIHQ.js";var A=C(G(),1);var n=C(U(),1);var e=C(J(),1);var X=10,g=h(v=>{let l=(0,A.c)(7),{label:m,value:a}=v,r;l[0]!==m?(r=(0,e.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:m}),l[0]=m,l[1]=r):r=l[1];let p=a??"\u2014",s;l[2]!==p?(s=(0,e.jsx)("span",{className:"font-mono text-sm",children:p}),l[2]=p,l[3]=s):s=l[3];let u;return l[4]!==r||l[5]!==s?(u=(0,e.jsxs)("div",{className:"flex flex-col gap-0.5",children:[r,s]}),l[4]=r,l[5]=s,l[6]=u):u=l[6],u},"g"),se=h(({loadIndexes:v,runQuery:l}={})=>{let m=z(),a=F(),[r,p]=(0,n.useState)(null),[s,u]=(0,n.useState)(null),[N,E]=(0,n.useState)(null),[b,D]=(0,n.useState)(""),[x,y]=(0,n.useState)(null),[M,w]=(0,n.useState)(null),[T,$]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let t={cancelled:!1};return V((async()=>{try{let i=await(v??(()=>m.listVectorIndexes()))();t.cancelled||(p(i),u(null),E(k=>k??i[0]?.name??null))}catch(i){t.cancelled||(p(null),u(S(i)))}})()),()=>{t.cancelled=!0}},[m,v]);let o=r?.find(t=>t.name===N)??null,H=h(t=>{E(t.currentTarget.dataset.index??null),y(null),w(null)},"Q"),O=h(t=>{D(t.target.value)},"$"),P=h(async()=>{let t=b.trim();if(!(N===null||t==="")){$(!0),w(null);try{let i=await(l??(k=>m.queryVectorIndex(k)))({name:N,text:t,topK:X});y(i)}catch(i){y(null),w(S(i))}$(!1)}},"A"),R=h(()=>{V(P())},"D");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-vector-browser",children:[s!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"vector-error",role:"alert",children:s}),r!==null&&r.length===0&&(0,e.jsx)(W,{description:a("Indexes declared with .vectorize() or defineVectorIndex() appear here."),icon:(0,e.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"})}),testId:"vector-empty",title:a("No vector indexes.")}),r!==null&&r.length>0&&(0,e.jsx)(I,{className:"overflow-hidden py-0",children:(0,e.jsx)(j,{className:"px-0",children:(0,e.jsxs)(q,{"data-testid":"vector-table",children:[(0,e.jsx)(B,{children:(0,e.jsxs)(f,{children:[(0,e.jsx)(c,{children:a("name")}),(0,e.jsx)(c,{children:a("table")}),(0,e.jsx)(c,{children:a("dimensions")}),(0,e.jsx)(c,{children:a("metric")}),(0,e.jsx)(c,{children:a("vectors")})]})}),(0,e.jsx)(L,{children:r.map(t=>(0,e.jsxs)(f,{className:t.name===N?"border-l-2 border-l-royal-amethyst bg-muted/50":"cursor-pointer","data-index":t.name,"data-testid":`vector-row-${t.name}`,onClick:H,children:[(0,e.jsx)(d,{className:"font-mono text-xs",children:t.name}),(0,e.jsx)(d,{className:"font-mono text-xs",children:t.table}),(0,e.jsx)(d,{className:"tabular-nums",children:t.dimensions??"\u2014"}),(0,e.jsx)(d,{children:t.metric??"\u2014"}),(0,e.jsx)(d,{className:"tabular-nums",children:t.vectorsCount??"\u2014"})]},t.name))})]})})}),o!==null&&(0,e.jsxs)("section",{className:"border border-border bg-card p-3","data-testid":"vector-detail",children:[(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,e.jsx)(g,{label:a("field"),value:o.field}),(0,e.jsx)(g,{label:a("dimensions"),value:o.dimensions}),(0,e.jsx)(g,{label:a("metric"),value:o.metric}),(0,e.jsx)(g,{label:a("vectors"),value:o.vectorsCount})]}),o.metadata!==void 0&&o.metadata.length>0&&(0,e.jsxs)("p",{className:"mt-3 text-xs text-muted-foreground","data-testid":"vector-metadata",children:[a("metadata"),": ",(0,e.jsx)("span",{className:"font-mono",children:o.metadata.join(", ")})]}),(0,e.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,e.jsx)(K,{className:"min-w-[18rem] flex-1","data-testid":"vector-query-input",onChange:O,placeholder:a("Search by similarity\u2026"),value:b}),(0,e.jsx)(Q,{"data-testid":"vector-search",disabled:T||b.trim()==="",onClick:R,children:a(T?"Searching\u2026":"Search")})]}),M!==null&&(0,e.jsx)("p",{className:"mt-2 text-sm text-destructive","data-testid":"vector-query-error",role:"alert",children:M}),x!==null&&x.length===0&&(0,e.jsx)("p",{className:"mt-2 text-sm text-muted-foreground","data-testid":"vector-no-matches",children:a("No matches.")}),x!==null&&x.length>0&&(0,e.jsx)(I,{className:"mt-3 overflow-hidden py-0",children:(0,e.jsx)(j,{className:"px-0",children:(0,e.jsxs)(q,{"data-testid":"vector-matches",children:[(0,e.jsx)(B,{children:(0,e.jsxs)(f,{children:[(0,e.jsx)(c,{children:a("id")}),(0,e.jsx)(c,{children:a("score")}),(0,e.jsx)(c,{children:a("metadata")})]})}),(0,e.jsx)(L,{children:x.map(t=>(0,e.jsxs)(f,{"data-testid":`vector-match-${t.id}`,children:[(0,e.jsx)(d,{className:"font-mono text-xs",children:t.id}),(0,e.jsx)(d,{className:"tabular-nums",children:t.score.toFixed(4)}),(0,e.jsx)(d,{className:"max-w-md truncate font-mono text-xs",children:t.metadata===void 0?"\u2014":Z(t.metadata)})]},t.id))})]})})})]})]})},"se");export{se as VectorBrowser};
@@ -0,0 +1 @@
1
+ import{d as E}from"./chunk-225VJ77I.js";import{a as n,d as b,e as h}from"./chunk-YKXDMIHQ.js";var y=b(h(),1);var T=n(()=>{},"noop"),K=typeof document<"u"?y.useLayoutEffect:T;var W=b(h(),1),l={...W};var a=l.useInsertionEffect,_=a&&a!==l.useLayoutEffect?a:t=>t();function q(t){let e=E(B).current;return e.next=t,_(e.effect),e.trampoline}n(q,"useStableCallback");function B(){let t={next:void 0,callback:O,trampoline:n((...e)=>t.callback?.(...e),"trampoline"),effect:n(()=>{t.callback=t.next},"effect")};return t}n(B,"createStableCallback");function O(){}n(O,"assertNotCalled");function s(){return typeof window<"u"}n(s,"hasWindow");function m(t){return N(t)?(t.nodeName||"").toLowerCase():"#document"}n(m,"getNodeName");function c(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}n(c,"getWindow");function V(t){var e;return(e=(N(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}n(V,"getDocumentElement");function N(t){return s()?t instanceof Node||t instanceof c(t).Node:!1}n(N,"isNode");function C(t){return s()?t instanceof Element||t instanceof c(t).Element:!1}n(C,"isElement");function L(t){return s()?t instanceof HTMLElement||t instanceof c(t).HTMLElement:!1}n(L,"isHTMLElement");function g(t){return!s()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof c(t).ShadowRoot}n(g,"isShadowRoot");function R(t){let{overflow:e,overflowX:i,overflowY:u,display:o}=v(t);return/auto|scroll|overlay|hidden|clip/.test(e+u+i)&&o!=="inline"&&o!=="contents"}n(R,"isOverflowElement");function J(t){return/^(table|td|th)$/.test(m(t))}n(J,"isTableElement");function $(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}n($,"isTopLayer");var A=/transform|translate|scale|rotate|perspective|filter/,H=/paint|layout|strict|content/,r=n(t=>!!t&&t!=="none","isNotNone"),d;function I(t){let e=C(t)?v(t):t;return r(e.transform)||r(e.translate)||r(e.scale)||r(e.rotate)||r(e.perspective)||!M()&&(r(e.backdropFilter)||r(e.filter))||A.test(e.willChange||"")||H.test(e.contain||"")}n(I,"isContainingBlock");function Q(t){let e=p(t);for(;L(e)&&!k(e);){if(I(e))return e;if($(e))return null;e=p(e)}return null}n(Q,"getContainingBlock");function M(){return d==null&&(d=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),d}n(M,"isWebKit");function k(t){return/^(html|body|#document)$/.test(m(t))}n(k,"isLastTraversableNode");function v(t){return c(t).getComputedStyle(t)}n(v,"getComputedStyle");function Z(t){return C(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}n(Z,"getNodeScroll");function p(t){if(m(t)==="html")return t;let e=t.assignedSlot||t.parentNode||g(t)&&t.host||V(t);return g(e)?e.host:e}n(p,"getParentNode");function D(t){let e=p(t);return k(e)?(t.ownerDocument||t).body:L(e)&&R(e)?e:D(e)}n(D,"getNearestOverflowAncestor");function S(t,e,i){var u;e===void 0&&(e=[]),i===void 0&&(i=!0);let o=D(t),x=o===((u=t.ownerDocument)==null?void 0:u.body),f=c(o);if(x){let w=F(f);return e.concat(f,f.visualViewport||[],R(o)?o:[],w&&i?S(w):[])}else return e.concat(o,S(o,[],i))}n(S,"getOverflowAncestors");function F(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}n(F,"getFrameElement");function nt(t){return t?.ownerDocument||document}n(nt,"ownerDocument");export{K as a,l as b,q as c,m as d,c as e,V as f,N as g,C as h,L as i,g as j,R as k,J as l,$ as m,I as n,Q as o,M as p,k as q,v as r,Z as s,p as t,S as u,F as v,nt as w};
@@ -0,0 +1 @@
1
+ var i={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},e={...i,position:"fixed",top:0,left:0},t={...i,position:"absolute"};export{e as a,t as b};
@@ -0,0 +1,6 @@
1
+ import{a as V,b as J,c as K,d as M,e as B,f as A,g as I,h as F}from"./chunk-RFNGDE33.js";import{a as P}from"./chunk-XZMOZFE6.js";import{a as z}from"./chunk-PD6WIDY6.js";import{d as L,m as D,n as U,o as Q,q as W}from"./chunk-FODLDLE2.js";import{a as p,d as q,e as ee,f as te,g as le}from"./chunk-YKXDMIHQ.js";var R=q(te(),1),E=q(ee(),1);var $="inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",fe=`${$} aria-pressed:bg-accent aria-pressed:text-accent-foreground`;var r=q(le(),1);var X=p(l=>`"${l.replaceAll('"','""')}"`,"F"),ne=/["\n,]/u,oe=/^[=+\-@\t\r]/u,Y=p(l=>{if(l==null)return"";let e;return typeof l=="string"?e=oe.test(l)?` ${l}`:l:typeof l=="number"||typeof l=="boolean"||typeof l=="bigint"?e=String(l):e=U(l),ne.test(e)?`"${e.replaceAll('"','""')}"`:e},"J"),ae=p((l,e)=>{let n=l.map(t=>Y(t)).join(","),o=e.map(t=>l.map(i=>Y(t[i])).join(","));return[n,...o].join(`
2
+ `)},"ne"),se=p(l=>JSON.stringify(l,D,2),"oe"),Z=500,re=p(l=>l==null?"NULL":typeof l=="number"?Number.isFinite(l)?String(l):"NULL":typeof l=="bigint"?String(l):typeof l=="boolean"?l?"1":"0":`'${(typeof l=="string"?l:U(l)).replaceAll("'","''")}'`,"K"),G="__doc__",ie=p((l,e,n,o)=>{if(e.length===0||n.length===0)return"";let t=o?.includes(G)===!0&&!e.includes(G)?e.filter(c=>!o.includes(c)):void 0,i=t===void 0?e:o,s=p((c,g)=>re(t===void 0||g!==G?c[g]:JSON.stringify(Object.fromEntries(t.map(d=>[d,c[d]])),D)),"i"),a=i.map(c=>X(c)).join(", "),u=[];for(let c=0;c<n.length;c+=Z){let g=n.slice(c,c+Z).map(d=>` (${i.map(m=>s(d,m)).join(", ")})`).join(`,
3
+ `);u.push(`INSERT INTO ${X(l)} (${a}) VALUES
4
+ ${g};`)}return u.join(`
5
+
6
+ `)},"se"),H=p((l,e,n)=>{if(!("document"in globalThis))return;let o=globalThis.URL.createObjectURL(new globalThis.Blob([e],{type:n})),t=globalThis.document.createElement("a");t.href=o,t.download=l,globalThis.document.body.append(t),t.click(),t.remove(),globalThis.URL.revokeObjectURL(o)},"M"),ce=p(l=>{let e=(0,R.c)(37),{columns:n,name:o,rows:t,sqlColumns:i}=l,s=L(),a;e[0]!==n||e[1]!==o||e[2]!==t?(a=p(()=>{H(`${o}.csv`,ae(n,t),"text/csv;charset=utf-8")},"s"),e[0]=n,e[1]=o,e[2]=t,e[3]=a):a=e[3];let u=a,c;e[4]!==o||e[5]!==t?(c=p(()=>{H(`${o}.json`,se(t),"application/json")},"c"),e[4]=o,e[5]=t,e[6]=c):c=e[6];let g=c,d;e[7]!==n||e[8]!==o||e[9]!==t||e[10]!==i?(d=p(()=>{H(`${o}.sql`,ie(o,n,t,i),"application/sql;charset=utf-8")},"a"),e[7]=n,e[8]=o,e[9]=t,e[10]=i,e[11]=d):d=e[11];let m=d,j=t.length===0,b;e[12]!==j?(b=(0,r.jsx)(J,{className:$,"data-testid":"grid-export",disabled:j,title:"Exports only the rows loaded on the current page, not the whole table",children:"Export page"}),e[12]=j,e[13]=b):b=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=(0,r.jsx)(B,{children:"Export loaded rows"}),e[14]=k):k=e[14];let h;e[15]!==s?(h=s("CSV"),e[15]=s,e[16]=h):h=e[16];let x;e[17]!==u||e[18]!==h?(x=(0,r.jsx)(A,{"data-testid":"grid-export-csv",onClick:u,children:h}),e[17]=u,e[18]=h,e[19]=x):x=e[19];let w;e[20]!==s?(w=s("JSON"),e[20]=s,e[21]=w):w=e[21];let y;e[22]!==g||e[23]!==w?(y=(0,r.jsx)(A,{"data-testid":"grid-export-json",onClick:g,children:w}),e[22]=g,e[23]=w,e[24]=y):y=e[24];let N;e[25]!==s?(N=s("SQL"),e[25]=s,e[26]=N):N=e[26];let f;e[27]!==m||e[28]!==N?(f=(0,r.jsx)(A,{"data-testid":"grid-export-sql",onClick:m,children:N}),e[27]=m,e[28]=N,e[29]=f):f=e[29];let C;e[30]!==y||e[31]!==f||e[32]!==x?(C=(0,r.jsxs)(K,{align:"end",children:[k,x,y,f]}),e[30]=y,e[31]=f,e[32]=x,e[33]=C):C=e[33];let v;return e[34]!==C||e[35]!==b?(v=(0,r.jsxs)(V,{children:[b,C]}),e[34]=C,e[35]=b,e[36]=v):v=e[36],v},"ie"),de=p(l=>{let e=(0,R.c)(9),{column:n}=l,o;e[0]!==n?(o=p(()=>{n.toggleVisibility()},"o"),e[0]=n,e[1]=o):o=e[1];let t=o,i;e[2]!==n?(i=n.getIsVisible(),e[2]=n,e[3]=i):i=e[3];let s=`grid-column-${n.id}`,a;return e[4]!==n.id||e[5]!==t||e[6]!==i||e[7]!==s?(a=(0,r.jsx)(I,{checked:i,closeOnClick:!1,"data-testid":s,onCheckedChange:t,children:n.id}),e[4]=n.id,e[5]=t,e[6]=i,e[7]=s,e[8]=a):a=e[8],a},"re"),me=[],ue=p(({backRelations:l=me,enabledBackRelations:e,onToggleBackRelation:n,table:o})=>{let t=L(),i=o.getIsAllColumnsVisible(),s=p(()=>{o.toggleAllColumnsVisible(!i)},"i");return(0,r.jsxs)(V,{children:[(0,r.jsx)(J,{className:$,"data-testid":"grid-columns",children:t("Columns")}),(0,r.jsxs)(K,{align:"end",className:"max-h-80 overflow-y-auto",children:[(0,r.jsxs)(M,{children:[(0,r.jsx)(B,{children:t("Columns")}),(0,r.jsx)(I,{checked:i,closeOnClick:!1,"data-testid":"grid-columns-all",onCheckedChange:s,children:t(i?"Hide all":"Show all")}),(0,r.jsx)(F,{}),o.getAllLeafColumns().filter(a=>!a.id.startsWith("__back__:")).map(a=>(0,r.jsx)(de,{column:a},a.id))]}),l.length>0&&n!==void 0&&(0,r.jsxs)(M,{children:[(0,r.jsx)(F,{}),(0,r.jsx)(B,{children:t("Related")}),l.map(a=>{let u=`${a.table}.${a.column}`;return(0,r.jsx)(I,{checked:e?.has(u)===!0,closeOnClick:!1,"data-testid":`grid-back-relation-${u}`,onCheckedChange:p(()=>{n(u)},"onCheckedChange"),children:`\u2190 ${a.table}.${a.column}`},u)})]})]})]})},"ae"),ge=p(l=>{let e=(0,R.c)(19),{count:n,editable:o,onClear:t,onDelete:i}=l,s=L(),a;e[0]!==n||e[1]!==s?(a=s("{count} selected",{count:n}),e[0]=n,e[1]=s,e[2]=a):a=e[2];let u;e[3]!==a?(u=(0,r.jsx)("span",{className:"font-medium tabular-nums","data-testid":"grid-selection-count",children:a}),e[3]=a,e[4]=u):u=e[4];let c;e[5]!==s?(c=s("Clear"),e[5]=s,e[6]=c):c=e[6];let g;e[7]!==t||e[8]!==c?(g=(0,r.jsx)("button",{className:$,"data-testid":"grid-selection-clear",onClick:t,type:"button",children:c}),e[7]=t,e[8]=c,e[9]=g):g=e[9];let d;e[10]!==n||e[11]!==o||e[12]!==i||e[13]!==s?(d=o&&(0,r.jsx)(z,{confirmLabel:s("Delete {count} rows and everything that cascades?",{count:n}),onConfirm:i,testId:"grid-selection-delete",children:s("Delete {count}",{count:n})}),e[10]=n,e[11]=o,e[12]=i,e[13]=s,e[14]=d):d=e[14];let m;return e[15]!==u||e[16]!==g||e[17]!==d?(m=(0,r.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-accent/40 px-3 py-1.5 text-xs","data-testid":"grid-selection-bar",children:[u,g,d]}),e[15]=u,e[16]=g,e[17]=d,e[18]=m):m=e[18],m},"de"),pe=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,be=p(l=>{let e=(0,R.c)(9),{bucket:n,objectKey:o,resolveUrl:t}=l,[i,s]=(0,E.useState)(null),[a,u]=(0,E.useState)(!1),c,g;e[0]!==n||e[1]!==o||e[2]!==t?(c=p(()=>{let b={cancelled:!1};return Q((async()=>{try{let k=await t(o,n);b.cancelled||s(k)}catch{b.cancelled||u(!0)}})()),()=>{b.cancelled=!0}},"c"),g=[n,o,t],e[0]=n,e[1]=o,e[2]=t,e[3]=c,e[4]=g):(c=e[3],g=e[4]),(0,E.useEffect)(c,g);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=p(()=>{u(!0)},"a"),e[5]=d):d=e[5];let m=d;if(i===null||a)return null;let j;return e[6]!==o||e[7]!==i?(j=(0,r.jsx)("div",{className:"flex max-h-64 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted/30",children:(0,r.jsx)("img",{alt:o,className:"max-h-64 object-contain","data-testid":"grid-cell-image",onError:m,src:i})}),e[6]=o,e[7]=i,e[8]=j):j=e[8],j},"me"),je=p(l=>{let e=(0,R.c)(37),{bucket:n,column:o,onClose:t,resolveUrl:i,value:s}=l,a=L(),[u,c]=(0,E.useState)(!1),g;e[0]!==s?(g=U(s),e[0]=s,e[1]=g):g=e[1];let d=g,m;e[2]!==d?(m=p(()=>{W(d)&&c(!0)},"d"),e[2]=d,e[3]=m):m=e[3];let j=m,b;e[4]!==a?(b=a("Cell value"),e[4]=a,e[5]=b):b=e[5];let k;e[6]!==o?(k=(0,r.jsx)("h2",{className:"truncate font-mono text-sm font-semibold text-foreground",children:o}),e[6]=o,e[7]=k):k=e[7];let h;e[8]!==u||e[9]!==a?(h=a(u?"Copied":"Copy"),e[8]=u,e[9]=a,e[10]=h):h=e[10];let x;e[11]!==j||e[12]!==h?(x=(0,r.jsx)("button",{className:$,"data-testid":"grid-cell-copy",onClick:j,type:"button",children:h}),e[11]=j,e[12]=h,e[13]=x):x=e[13];let w;e[14]!==a?(w=a("Close"),e[14]=a,e[15]=w):w=e[15];let y;e[16]!==t||e[17]!==w?(y=(0,r.jsx)("button",{className:$,"data-testid":"grid-cell-close",onClick:t,type:"button",children:w}),e[16]=t,e[17]=w,e[18]=y):y=e[18];let N;e[19]!==x||e[20]!==y?(N=(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[x,y]}),e[19]=x,e[20]=y,e[21]=N):N=e[21];let f;e[22]!==k||e[23]!==N?(f=(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[k,N]}),e[22]=k,e[23]=N,e[24]=f):f=e[24];let C;e[25]!==n||e[26]!==i||e[27]!==s?(C=i!==void 0&&typeof s=="string"&&pe.test(s)&&(0,r.jsx)(be,{bucket:n,objectKey:s,resolveUrl:i}),e[25]=n,e[26]=i,e[27]=s,e[28]=C):C=e[28];let v;e[29]!==d?(v=(0,r.jsx)("pre",{className:"min-h-0 flex-1 overflow-auto rounded-md border border-border bg-muted/30 p-3 font-mono text-xs whitespace-pre-wrap","data-testid":"grid-cell-value",children:d}),e[29]=d,e[30]=v):v=e[30];let S;return e[31]!==t||e[32]!==f||e[33]!==C||e[34]!==v||e[35]!==b?(S=(0,r.jsxs)(P,{className:"max-h-[70vh] w-[min(40rem,90vw)]",label:b,onClose:t,panelTestId:"grid-cell-dialog",testId:"grid-cell-dialog-overlay",variant:"dialog",children:[f,C,v]}),e[31]=t,e[32]=f,e[33]=C,e[34]=v,e[35]=b,e[36]=S):S=e[36],S},"Se"),Se=p(l=>{let e=(0,R.c)(37),{backRelations:n,enabledBackRelations:o,onToggleBackRelation:t,columns:i,editable:s,name:a,onBulkDelete:u,onToggleTranspose:c,rows:g,sqlColumns:d,table:m,transposed:j}=l,b=L(),k;e[0]!==m?(k=m.getSelectedRowModel(),e[0]=m,e[1]=k):k=e[1];let h=k.rows,x;e[2]!==m?(x=p(()=>{m.resetRowSelection()},"y"),e[2]=m,e[3]=x):x=e[3];let w=x,y;e[4]!==u||e[5]!==h||e[6]!==m?(y=p(()=>{u(h.map(he)),m.resetRowSelection()},"x"),e[4]=u,e[5]=h,e[6]=m,e[7]=y):y=e[7];let N=y,f;e[8]!==i||e[9]!==a||e[10]!==g||e[11]!==d?(f=(0,r.jsx)(ce,{columns:i,name:a,rows:g,sqlColumns:d}),e[8]=i,e[9]=a,e[10]=g,e[11]=d,e[12]=f):f=e[12];let C;e[13]!==n||e[14]!==o||e[15]!==t||e[16]!==m?(C=(0,r.jsx)(ue,{backRelations:n,enabledBackRelations:o,onToggleBackRelation:t,table:m}),e[13]=n,e[14]=o,e[15]=t,e[16]=m,e[17]=C):C=e[17];let v;e[18]!==b?(v=b("Swap rows and columns"),e[18]=b,e[19]=v):v=e[19];let S;e[20]!==b?(S=b("Transpose"),e[20]=b,e[21]=S):S=e[21];let T;e[22]!==c||e[23]!==v||e[24]!==S||e[25]!==j?(T=(0,r.jsx)("button",{"aria-pressed":j,className:$,"data-testid":"grid-transpose",onClick:c,title:v,type:"button",children:S}),e[22]=c,e[23]=v,e[24]=S,e[25]=j,e[26]=T):T=e[26];let _;e[27]!==s||e[28]!==w||e[29]!==N||e[30]!==h.length?(_=h.length>0&&(0,r.jsx)(ge,{count:h.length,editable:s,onClear:w,onDelete:N}),e[27]=s,e[28]=w,e[29]=N,e[30]=h.length,e[31]=_):_=e[31];let O;return e[32]!==f||e[33]!==C||e[34]!==T||e[35]!==_?(O=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"grid-actions",children:[f,C,T,_]}),e[32]=f,e[33]=C,e[34]=T,e[35]=_,e[36]=O):O=e[36],O},"ke");function he(l){return l.id}p(he,"ue");export{$ as a,fe as b,ce as c,ge as d,je as e,Se as f};