@lunora/studio 1.0.0-alpha.9 → 1.0.0-alpha.90
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.
- package/LICENSE.md +6 -0
- package/dist/index.d.ts +822 -781
- package/dist/index.js +1 -41
- package/dist/mount.d.ts +10 -10
- package/dist/mount.js +1 -26
- package/dist/packem_chunks/AdvisorHealthPanel.js +1 -0
- package/dist/packem_chunks/ApiTab.js +1 -0
- package/dist/packem_chunks/AuditPanel.js +1 -0
- package/dist/packem_chunks/DeploymentHealthPanel.js +1 -0
- package/dist/packem_chunks/ExportImportPanel.js +3 -0
- package/dist/packem_chunks/FileBrowser.js +4 -0
- package/dist/packem_chunks/FunctionRunner.js +1 -0
- package/dist/packem_chunks/FunctionStatsPanel.js +1 -0
- package/dist/packem_chunks/HealthPanel.js +1 -0
- package/dist/packem_chunks/InsightsPanel.js +1 -0
- package/dist/packem_chunks/LogsPanel.js +1 -0
- package/dist/packem_chunks/MailPanel.js +2 -0
- package/dist/packem_chunks/MetricsPanel.js +1 -0
- package/dist/packem_chunks/NotificationsPanel.js +1 -0
- package/dist/packem_chunks/PitrPanel.js +1 -0
- package/dist/packem_chunks/SchemaViewer.js +1 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -0
- package/dist/packem_chunks/SettingsPanel.js +1 -0
- package/dist/packem_chunks/SqlEditorPanel.js +6 -0
- package/dist/packem_chunks/TableEditor.js +1 -0
- package/dist/packem_chunks/agents-panel.js +1 -0
- package/dist/packem_chunks/analytics-panel.js +1 -0
- package/dist/packem_chunks/auth-audit-panel.js +1 -0
- package/dist/packem_chunks/auth-config-panel.js +1 -0
- package/dist/packem_chunks/auth-sessions-panel.js +1 -0
- package/dist/packem_chunks/containers-panel.js +1 -0
- package/dist/packem_chunks/dashboards-panel.js +1 -0
- package/dist/packem_chunks/fanout-panel.js +1 -0
- package/dist/packem_chunks/flags-panel.js +1 -0
- package/dist/packem_chunks/issues-panel.js +1 -0
- package/dist/packem_chunks/kv-browser.js +1 -0
- package/dist/packem_chunks/log-drains-panel.js +4 -0
- package/dist/packem_chunks/migrations-route.js +1 -0
- package/dist/packem_chunks/organizations-panel.js +1 -0
- package/dist/packem_chunks/payments-panel.js +1 -0
- package/dist/packem_chunks/permissions-panel.js +1 -0
- package/dist/packem_chunks/queues-panel.js +1 -0
- package/dist/packem_chunks/rls-panel.js +1 -0
- package/dist/packem_chunks/schedule-panel.js +1 -0
- package/dist/packem_chunks/sparkline.js +1 -0
- package/dist/packem_chunks/storage-rules-panel.js +1 -0
- package/dist/packem_chunks/subscriptions-panel.js +1 -0
- package/dist/packem_chunks/sync-client-panel.js +1 -0
- package/dist/packem_chunks/traces-panel.js +1 -0
- package/dist/packem_chunks/users-panel.js +1 -0
- package/dist/packem_chunks/vector-browser.js +1 -0
- package/dist/packem_chunks/workflows-panel.js +1 -0
- package/dist/packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js +1 -0
- package/dist/packem_shared/ApiDocsPanel-DLMeLZ5-.js +2 -0
- package/dist/packem_shared/ApiReferencePanel-9q8BbJl-.js +1 -0
- package/dist/packem_shared/CommandPalette--SQwfTW1.js +1 -0
- package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +1 -0
- package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +1 -0
- package/dist/packem_shared/DataBrowser-CZZ_WkJ-.js +1 -0
- package/dist/packem_shared/DataFilters-B26ZeqBZ.js +1 -0
- package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-DpkjHfDg.js +1 -0
- package/dist/packem_shared/HomePanel-3baDsDBU.js +1 -0
- package/dist/packem_shared/MigrationsPanel-dygzHUvg.js +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-qOZcWXMs.js +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
- package/dist/packem_shared/ScheduledJobs-D8kBZWBu.js +1 -0
- package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
- package/dist/packem_shared/Studio-forQt-PC.js +1 -0
- package/dist/packem_shared/StudioApp-B1AWsBzi.js +1 -0
- package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
- package/dist/packem_shared/advisor-view-Pa8HLtBv.js +1 -0
- package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +1 -0
- package/dist/packem_shared/alert-CVcOFuDR.js +1 -0
- package/dist/packem_shared/app.d-DW7yZsfu.d.ts +252 -0
- package/dist/packem_shared/badge-BbuuAio7.js +1 -0
- package/dist/packem_shared/bar-chart-DraN_srt.js +9 -0
- package/dist/packem_shared/browser-storage-xjTyMKY0.js +1 -0
- package/dist/packem_shared/button-BkCrNcAs.js +1 -0
- package/dist/packem_shared/card-CIDGUN6K.js +1 -0
- package/dist/packem_shared/cf-links-Dmg86v1D.js +1 -0
- package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
- package/dist/packem_shared/data-grid-DcxyIXwG.js +1 -0
- package/dist/packem_shared/data-view-params-ClrV7XgF.js +1 -0
- package/dist/packem_shared/dropdown-menu-C3RQ_HlW.js +2 -0
- package/dist/packem_shared/empty-state-Cg7t_8qu.js +1 -0
- package/dist/packem_shared/error-alert-t6cpEi0z.js +1 -0
- package/dist/packem_shared/grid-features-jnrD0SpX.js +6 -0
- package/dist/packem_shared/home-panel-CeeqqV0z.js +3 -0
- package/dist/packem_shared/input-JHu63lTv.js +1 -0
- package/dist/packem_shared/internal-BSIsQVC6.js +2 -0
- package/dist/packem_shared/label-6uP1obNF.js +1 -0
- package/dist/packem_shared/live-status-CmuRLFKf.js +1 -0
- package/dist/packem_shared/log-fields-CoL3hsIQ.js +1 -0
- package/dist/packem_shared/modal-shell-CUwwWC2o.js +1 -0
- package/dist/packem_shared/operation-console-provider-BMJNtiyB.js +1 -0
- package/dist/packem_shared/recording-client-DRAZEmzE.js +1 -0
- package/dist/packem_shared/reference-view-DnYYWr7I.js +12 -0
- package/dist/packem_shared/result-chart-DzJOVsaw.js +1 -0
- package/dist/packem_shared/schema-diagram-cg-bz_VL.js +2 -0
- package/dist/packem_shared/scroll-area-DTEq6Jec.js +2 -0
- package/dist/packem_shared/select-Bul-DeII.js +2 -0
- package/dist/packem_shared/shard-history-DMEW5VBE.js +1 -0
- package/dist/packem_shared/skeleton-C1wQ9M5t.js +1 -0
- package/dist/packem_shared/sparkline-CgjeUU2I.js +1 -0
- package/dist/packem_shared/stat-card-fm_TF1mo.js +1 -0
- package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
- package/dist/packem_shared/studio-BtC7WPbz.js +2 -0
- package/dist/packem_shared/table-DdJBrClo.js +2 -0
- package/dist/packem_shared/table-list-sidebar-D9Bd4qgi.js +1 -0
- package/dist/packem_shared/textarea-Bu2-jKAs.js +1 -0
- package/dist/packem_shared/trace-handoff-Dw7mwjxu.js +1 -0
- package/dist/packem_shared/use-admin-query-QJ-ibl5u.js +1 -0
- package/dist/packem_shared/use-async-submit-q3ymBJkD.js +1 -0
- package/dist/packem_shared/use-auth-config-BObBpdsi.js +1 -0
- package/dist/packem_shared/use-shard-key-B2JtNa5m.js +1 -0
- package/dist/packem_shared/use-sql-assistant-C6dl2_Ty.js +1 -0
- package/dist/packem_shared/useDebounced-CU-uftxO.js +1 -0
- package/dist/packem_shared/utils-bhneXptQ.js +1 -0
- package/dist/packem_shared/virtual-rect-1o1veP7R.js +1 -0
- package/dist/standalone/chunk-24JLZ2Z5.js +1 -0
- package/dist/standalone/chunk-2OUPA2WJ.js +1 -0
- package/dist/standalone/chunk-2PJNAWB3.js +1 -0
- package/dist/standalone/chunk-2QSHLBCO.js +1 -0
- package/dist/standalone/chunk-3AV5CV6K.js +1 -0
- package/dist/standalone/chunk-3C3CG7ZK.js +1 -0
- package/dist/standalone/chunk-3CWGJYBB.js +1 -0
- package/dist/standalone/chunk-3XIESWL4.js +1 -0
- package/dist/standalone/chunk-4COKHD2C.js +1 -0
- package/dist/standalone/chunk-4LCY5XUR.js +1 -0
- package/dist/standalone/chunk-4UOFSGUS.js +1 -0
- package/dist/standalone/chunk-53KJRSHE.js +1 -0
- package/dist/standalone/chunk-54MMVNPT.js +1 -0
- package/dist/standalone/chunk-5Y3QLNWX.js +1 -0
- package/dist/standalone/chunk-5ZXDB6LB.js +13 -0
- package/dist/standalone/chunk-62EKHKTS.js +1 -0
- package/dist/standalone/chunk-67DKQC23.js +1 -0
- package/dist/standalone/chunk-6MKDYZ7A.js +1 -0
- package/dist/standalone/chunk-6ST5ECQA.js +1 -0
- package/dist/standalone/chunk-6VTLIGVX.js +1 -0
- package/dist/standalone/chunk-7H7LZRLP.js +1 -0
- package/dist/standalone/chunk-7QIFDWQV.js +1 -0
- package/dist/standalone/chunk-7T7UOTYK.js +1 -0
- package/dist/standalone/chunk-AQX2QFCN.js +1 -0
- package/dist/standalone/chunk-ARP36PTE.js +1 -0
- package/dist/standalone/chunk-AUQKJYHL.js +1 -0
- package/dist/standalone/chunk-AVAC26HJ.js +1 -0
- package/dist/standalone/chunk-AZAGCJVI.js +1 -0
- package/dist/standalone/chunk-BGBLQ563.js +1 -0
- package/dist/standalone/chunk-BL6NO3U3.js +1 -0
- package/dist/standalone/chunk-BRQMMGOS.js +1 -0
- package/dist/standalone/chunk-BUTBQGUU.js +1 -0
- package/dist/standalone/chunk-C3HXK3A5.js +3 -0
- package/dist/standalone/chunk-CFPZYHPY.js +2 -0
- package/dist/standalone/chunk-CT6ZDXLL.js +1 -0
- package/dist/standalone/chunk-CTNB2KIA.js +1 -0
- package/dist/standalone/chunk-D3HXVA33.js +1 -0
- package/dist/standalone/chunk-DG7YINFM.js +1 -0
- package/dist/standalone/chunk-DMCYISRF.js +1 -0
- package/dist/standalone/chunk-E7TB4USI.js +1 -0
- package/dist/standalone/chunk-EQZTSISX.js +1 -0
- package/dist/standalone/chunk-ESVP44Y3.js +1 -0
- package/dist/standalone/chunk-FURI47Z2.js +1 -0
- package/dist/standalone/chunk-FW75RYZU.js +1 -0
- package/dist/standalone/chunk-FXCBF4XT.js +1 -0
- package/dist/standalone/chunk-GKSRVABT.js +1 -0
- package/dist/standalone/chunk-GMR677FL.js +1 -0
- package/dist/standalone/chunk-GRL5MG3Z.js +1 -0
- package/dist/standalone/chunk-GSKOAKQ2.js +1 -0
- package/dist/standalone/chunk-HPFLBYRI.js +1 -0
- package/dist/standalone/chunk-I6A5C46N.js +1 -0
- package/dist/standalone/chunk-IAKPXGTQ.js +8 -0
- package/dist/standalone/chunk-IC4L6G56.js +1 -0
- package/dist/standalone/chunk-IC64YIX5.js +1 -0
- package/dist/standalone/chunk-ILNELDFC.js +1 -0
- package/dist/standalone/chunk-IVFHIQOT.js +1 -0
- package/dist/standalone/chunk-JFW3YNVQ.js +1 -0
- package/dist/standalone/chunk-JN2Y24PY.js +1 -0
- package/dist/standalone/chunk-KUVMORDQ.js +1 -0
- package/dist/standalone/chunk-LAHYLAT4.js +1 -0
- package/dist/standalone/chunk-LEDWUPXM.js +1 -0
- package/dist/standalone/chunk-LJIFMW67.js +1 -0
- package/dist/standalone/chunk-LJISXTZJ.js +1 -0
- package/dist/standalone/chunk-LQAKPCFX.js +1 -0
- package/dist/standalone/chunk-MHAXZQVO.js +1 -0
- package/dist/standalone/chunk-MIQTKZAR.js +1 -0
- package/dist/standalone/chunk-MV4A2PAK.js +1 -0
- package/dist/standalone/chunk-OG2AMGOC.js +1 -0
- package/dist/standalone/chunk-OG4N2XHD.js +19 -0
- package/dist/standalone/chunk-PB7FNRDB.js +1 -0
- package/dist/standalone/chunk-PGC523I2.js +1 -0
- package/dist/standalone/chunk-PM37X2V3.js +1 -0
- package/dist/standalone/chunk-QBWRC5YX.js +1 -0
- package/dist/standalone/chunk-QLQADHFE.js +1 -0
- package/dist/standalone/chunk-QP7IQOKF.js +1 -0
- package/dist/standalone/chunk-QV6KV4SD.js +1 -0
- package/dist/standalone/chunk-QWBRD6PX.js +1 -0
- package/dist/standalone/chunk-QWGT25SE.js +1 -0
- package/dist/standalone/chunk-QXXIJAD5.js +1 -0
- package/dist/standalone/chunk-QYIOW7CD.js +4 -0
- package/dist/standalone/chunk-S3DWUXGY.js +62 -0
- package/dist/standalone/chunk-S4ILMYP5.js +4 -0
- package/dist/standalone/chunk-SD4BERSA.js +1 -0
- package/dist/standalone/chunk-SF4MF2FT.js +1 -0
- package/dist/standalone/chunk-SFDOII3B.js +1 -0
- package/dist/standalone/chunk-SHMNA6UL.js +1 -0
- package/dist/standalone/chunk-SMIESS7P.js +1 -0
- package/dist/standalone/chunk-SP5SBO2W.js +3 -0
- package/dist/standalone/chunk-T6OAYQTX.js +1 -0
- package/dist/standalone/chunk-T6VMSOBB.js +1 -0
- package/dist/standalone/chunk-TBBJPPZ3.js +2 -0
- package/dist/standalone/chunk-THIXMMZD.js +1 -0
- package/dist/standalone/chunk-U6TNNM5U.js +1 -0
- package/dist/standalone/chunk-ULCZDGWQ.js +1 -0
- package/dist/standalone/chunk-UU2QJMGJ.js +1 -0
- package/dist/standalone/chunk-UZERI5YC.js +1 -0
- package/dist/standalone/chunk-V2U5CL3S.js +11 -0
- package/dist/standalone/chunk-V53KNYRN.js +1 -0
- package/dist/standalone/chunk-VDW32UET.js +1 -0
- package/dist/standalone/chunk-VFQDHG7I.js +4 -0
- package/dist/standalone/chunk-WB5IUUUU.js +1 -0
- package/dist/standalone/chunk-WLZ7YPBH.js +6 -0
- package/dist/standalone/chunk-X665E2HU.js +1 -0
- package/dist/standalone/chunk-XBDKZZ67.js +1 -0
- package/dist/standalone/chunk-XF2B7P5A.js +1 -0
- package/dist/standalone/chunk-XNGYYOLS.js +14 -0
- package/dist/standalone/chunk-XQCVZAGU.js +1 -0
- package/dist/standalone/chunk-XR7RBXKA.js +1 -0
- package/dist/standalone/chunk-XXQUMVWH.js +1 -0
- package/dist/standalone/chunk-XZSGE5ST.js +1 -0
- package/dist/standalone/chunk-Y7JXGNXD.js +1 -0
- package/dist/standalone/chunk-YOUKADZH.js +1 -0
- package/dist/standalone/chunk-YU5CI2FD.js +6 -0
- package/dist/standalone/chunk-Z7G74IH4.js +1 -0
- package/dist/standalone/chunk-ZJGP6EKR.js +1 -0
- package/dist/standalone/chunk-ZPLWCC4I.js +1 -0
- package/dist/standalone/studio.js +9 -356
- package/dist/styles.css +2 -2
- package/package.json +16 -14
- package/dist/packem_shared/ADMIN_FUNCTIONS-DjXgvJb6.js +0 -46
- package/dist/packem_shared/ApiDocsPanel-yVSGHK3H.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
- package/dist/packem_shared/ApiTab-rwttyQ1-.js +0 -251
- package/dist/packem_shared/AuditPanel-BqXZAsu_.js +0 -212
- package/dist/packem_shared/CommandPalette-BtgkBzZI.js +0 -373
- package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
- package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
- package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
- package/dist/packem_shared/DataBrowser-BtT2NYcR.js +0 -4542
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/ExportImportPanel-Dq6rj0tI.js +0 -193
- package/dist/packem_shared/FileBrowser-0pCpdKPE.js +0 -2932
- package/dist/packem_shared/FunctionRunner-7NH3KcTg.js +0 -343
- package/dist/packem_shared/FunctionStatsPanel-Cn_EBpDy.js +0 -432
- package/dist/packem_shared/GlobalDataBrowser-BTEmGrph.js +0 -318
- package/dist/packem_shared/HealthPanel-CQ4LzVET.js +0 -640
- package/dist/packem_shared/HomePanel-CP0lN1eF.js +0 -1273
- package/dist/packem_shared/InsightsPanel-B1BaHaPL.js +0 -431
- package/dist/packem_shared/LogsPanel-C3W0mabf.js +0 -839
- package/dist/packem_shared/MailPanel-DozizrvV.js +0 -447
- package/dist/packem_shared/MetricsPanel-CujtUfpl.js +0 -1625
- package/dist/packem_shared/MigrationsPanel-RX5qIFSr.js +0 -246
- package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
- package/dist/packem_shared/PitrPanel-LJGNP_IX.js +0 -252
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-CabfKbyM.js +0 -159
- package/dist/packem_shared/SchemaViewer-Bam6ylvw.js +0 -2512
- package/dist/packem_shared/SecurityAdvisorPanel-Bn2yq05G.js +0 -79
- package/dist/packem_shared/SettingsPanel-CBXQpYQA.js +0 -176
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/SqlEditorPanel-D5wMIxcg.js +0 -13
- package/dist/packem_shared/Studio-CccqZ-J1.js +0 -33
- package/dist/packem_shared/StudioApp-CQbULfaH.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/TableEditor-Df_5NPaF.js +0 -371
- package/dist/packem_shared/advisor-view-CGcfMiPq.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/app.d-Nbhpihxv.d.ts +0 -300
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-DURq3ElK.js +0 -175
- package/dist/packem_shared/cf-links-2cktDedA.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/data-grid-B5CaV3wS.js +0 -183
- package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
- package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
- package/dist/packem_shared/grid-features-CzUfqgsM.js +0 -840
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
- package/dist/packem_shared/reference-view-B4E49Lip.js +0 -2180
- package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
- package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
- package/dist/packem_shared/sql-editor-panel-Smfl_FDF.js +0 -2562
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-D93XGB-i.js +0 -10413
- package/dist/packem_shared/table-_RzNvy3R.js +0 -246
- package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +0 -832
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
- package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
- package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
- package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
- package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as me}from"./chunk-XF2B7P5A.js";import{R as ne}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as ee}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import"./chunk-XBDKZZ67.js";import{a as te,e as se}from"./chunk-UZERI5YC.js";import{d as Z,h as ie,m as de,o as ce}from"./chunk-OG4N2XHD.js";import{a as h,e as Y,f as ge,g as xe,h as ye}from"./chunk-3XIESWL4.js";var re=Y(xe(),1),K=Y(ge(),1);var s=Y(ye(),1);var be=h(e=>{let t=(0,re.c)(23),{destination:r}=e,f=Z(),g;t[0]!==r.snippet?(g=h(()=>{ce(r.snippet)},"g"),t[0]=r.snippet,t[1]=g):g=t[1];let m=g,a;t[2]!==r.title?(a=(0,s.jsx)("h4",{className:"text-sm font-semibold",children:r.title}),t[2]=r.title,t[3]=a):a=t[3];let o;t[4]!==r.description?(o=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:r.description}),t[4]=r.description,t[5]=o):o=t[5];let d;t[6]!==a||t[7]!==o?(d=(0,s.jsxs)("div",{children:[a,o]}),t[6]=a,t[7]=o,t[8]=d):d=t[8];let H=`drain-copy-${r.id}`,l;t[9]!==f?(l=f("Copy"),t[9]=f,t[10]=l):l=t[10];let n;t[11]!==m||t[12]!==H||t[13]!==l?(n=(0,s.jsx)(ee,{"data-testid":H,onClick:m,size:"sm",variant:"outline",children:l}),t[11]=m,t[12]=H,t[13]=l,t[14]=n):n=t[14];let i;t[15]!==d||t[16]!==n?(i=(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[d,n]}),t[15]=d,t[16]=n,t[17]=i):i=t[17];let c;t[18]!==r.snippet?(c=(0,s.jsx)("pre",{className:"mt-2 overflow-x-auto rounded bg-muted p-2 font-mono text-xs",children:r.snippet}),t[18]=r.snippet,t[19]=c):c=t[19];let x;return t[20]!==i||t[21]!==c?(x=(0,s.jsx)(te,{className:"py-0","data-testid":"drain-card",children:(0,s.jsxs)(se,{className:"p-3",children:[i,c]})}),t[20]=i,t[21]=c,t[22]=x):x=t[22],x},"he"),je=h(()=>{let e=(0,re.c)(88),t=Z(),r;e[0]!==t?(r=t("Stream every request log to R2, a SIEM, or a third-party log service."),e[0]=t,e[1]=r):r=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=["{",' "logpush": true',"}"],e[2]=f):f=e[2];let g=f.join(`
|
|
2
|
+
`),m;e[3]!==t?(m=t("Logpush"),e[3]=t,e[4]=m):m=e[4];let a;e[5]!==r||e[6]!==m?(a={description:r,id:"logpush",snippet:g,title:m},e[5]=r,e[6]=m,e[7]=a):a=e[7];let o;e[8]!==t?(o=t("Send logs programmatically to a Worker for custom capture and forwarding."),e[8]=t,e[9]=o):o=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=["{",' "tail_consumers": [{ "service": "my-log-forwarder" }]',"}"],e[10]=d):d=e[10];let H=d.join(`
|
|
3
|
+
`),l;e[11]!==t?(l=t("Tail Workers"),e[11]=t,e[12]=l):l=e[12];let n;e[13]!==o||e[14]!==l?(n={description:o,id:"tail-worker",snippet:H,title:l},e[13]=o,e[14]=l,e[15]=n):n=e[15];let i;e[16]!==t?(i=t("Retain and query recent request logs directly in Cloudflare's dashboard."),e[16]=t,e[17]=i):i=e[17];let c;e[18]===Symbol.for("react.memo_cache_sentinel")?(c=["{",' "observability": { "enabled": true }',"}"],e[18]=c):c=e[18];let x=c.join(`
|
|
4
|
+
`),y;e[19]!==t?(y=t("Workers Logs"),e[19]=t,e[20]=y):y=e[20];let b;e[21]!==i||e[22]!==y?(b={description:i,id:"workers-logs",snippet:x,title:y},e[21]=i,e[22]=y,e[23]=b):b=e[23];let J;e[24]!==b||e[25]!==a||e[26]!==n?(J=[a,n,b],e[24]=b,e[25]=a,e[26]=n,e[27]=J):J=e[27];let Q=J,[p,pe]=(0,K.useState)(""),[k,ae]=(0,K.useState)(!1),[u,$]=(0,K.useState)(null),A;if(e[28]!==t||e[29]!==p){let V=h(async()=>{let oe=p.trim();if(oe==="")return;let le="fetch"in globalThis?globalThis.fetch:void 0;if(le===void 0){$({kind:"error",message:t("fetch is unavailable in this environment.")});return}let fe={durationMs:12,function:"messages:list",outcome:"ok",shard:"root",source:"lunora",tablesRead:["messages"],tablesWritten:[],ts:new Date().toISOString(),type:"request"};ae(!0),$(null);let he=performance.now();try{let X=await le(oe,{body:JSON.stringify(fe),headers:{"Content-Type":"application/json"},method:"POST"});$({kind:"success",latencyMs:Math.round(performance.now()-he),status:X.status})}catch(X){$({kind:"error",message:ie(X)})}ae(!1)},"G");A=h(()=>{de(V())},"z"),e[28]=t,e[29]=p,e[30]=A}else A=e[30];let U=A,B;e[31]===Symbol.for("react.memo_cache_sentinel")?(B=h(V=>{pe(V.target.value)},"J"),e[31]=B):B=e[31];let ue=B,v;e[32]!==t?(v=t("Open in Cloudflare"),e[32]=t,e[33]=v):v=e[33];let w;e[34]!==v?(w=(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,s.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"drain-cf-link",href:me,rel:"noreferrer",target:"_blank",children:v})}),e[34]=v,e[35]=w):w=e[35];let N;e[36]!==t?(N=t("Lunora does not ship logs itself \u2014 forwarding is handled by Cloudflare. Configure a destination below, then test your collector."),e[36]=t,e[37]=N):N=e[37];let S;e[38]!==N?(S=(0,s.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"drain-readonly-note",children:N}),e[38]=N,e[39]=S):S=e[39];let _;e[40]!==t?(_=t("Cloudflare destinations"),e[40]=t,e[41]=_):_=e[41];let C;e[42]!==_?(C=(0,s.jsx)("h3",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:_}),e[42]=_,e[43]=C):C=e[43];let j;e[44]!==Q?(j=Q.map(ke),e[44]=Q,e[45]=j):j=e[45];let T;e[46]!==C||e[47]!==j?(T=(0,s.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"drain-destinations",children:[C,j]}),e[46]=C,e[47]=j,e[48]=T):T=e[48];let q;e[49]!==t?(q=t("Webhook test"),e[49]=t,e[50]=q):q=e[50];let L;e[51]!==q?(L=(0,s.jsx)("h3",{className:"mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:q}),e[51]=q,e[52]=L):L=e[52];let M;e[53]!==t?(M=t("POST a sample Lunora request-log envelope to your collector to confirm it is reachable."),e[53]=t,e[54]=M):M=e[54];let O;e[55]!==M?(O=(0,s.jsx)("p",{className:"mb-2 text-sm text-muted-foreground",children:M}),e[55]=M,e[56]=O):O=e[56];let W;e[57]!==t?(W=t("https://example.com/logs"),e[57]=t,e[58]=W):W=e[58];let D;e[59]!==W||e[60]!==p?(D=(0,s.jsx)(ne,{className:"min-w-[20rem] flex-1","data-testid":"drain-webhook-url",onChange:ue,placeholder:W,type:"url",value:p}),e[59]=W,e[60]=p,e[61]=D):D=e[61];let P;e[62]!==k||e[63]!==p?(P=k||p.trim()==="",e[62]=k,e[63]=p,e[64]=P):P=e[64];let R;e[65]!==k||e[66]!==t?(R=t(k?"Sending\u2026":"Send test event"),e[65]=k,e[66]=t,e[67]=R):R=e[67];let F;e[68]!==U||e[69]!==P||e[70]!==R?(F=(0,s.jsx)(ee,{"data-testid":"drain-webhook-test",disabled:P,onClick:U,children:R}),e[68]=U,e[69]=P,e[70]=R,e[71]=F):F=e[71];let I;e[72]!==D||e[73]!==F?(I=(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[D,F]}),e[72]=D,e[73]=F,e[74]=I):I=e[74];let z;e[75]!==u||e[76]!==t?(z=u!==null&&(0,s.jsx)("p",{className:u.kind==="success"?"mt-2 text-sm text-muted-foreground":"mt-2 text-sm text-destructive","data-testid":"drain-webhook-result",role:u.kind==="error"?"alert":void 0,children:u.kind==="success"?t("Delivered \u2014 status {status} in {latency}ms",{latency:u.latencyMs,status:u.status}):t("Failed: {message}",{message:u.message})}),e[75]=u,e[76]=t,e[77]=z):z=e[77];let E;e[78]!==L||e[79]!==O||e[80]!==I||e[81]!==z?(E=(0,s.jsx)(te,{className:"py-0",children:(0,s.jsx)(se,{className:"p-3",children:(0,s.jsxs)("section",{"data-testid":"drain-webhook",children:[L,O,I,z]})})}),e[78]=L,e[79]=O,e[80]=I,e[81]=z,e[82]=E):E=e[82];let G;return e[83]!==w||e[84]!==S||e[85]!==T||e[86]!==E?(G=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"log-drains",children:[w,S,T,E]}),e[83]=w,e[84]=S,e[85]=T,e[86]=E,e[87]=G):G=e[87],G},"_e");function ke(e){return(0,s.jsx)(be,{destination:e},e.id)}h(ke,"ge");export{je as LogDrainsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as y}from"./chunk-CFPZYHPY.js";import{a as C,c as M,e as P}from"./chunk-2OUPA2WJ.js";import{d as T}from"./chunk-6ST5ECQA.js";import{a as o,e as L,f as S,h as z}from"./chunk-3XIESWL4.js";var O=L(S(),1);var w=L(S(),1);var _=w.createContext({register:o(()=>{},"register"),unregister:o(()=>{},"unregister"),subscribeMapChange:o(()=>()=>{},"subscribeMapChange"),elementsRef:{current:[]},nextIndexRef:{current:0}});function F(){return w.useContext(_)}o(F,"useCompositeListContext");var W=(function(t){return t[t.None=0]="None",t[t.GuessFromOrder=1]="GuessFromOrder",t})({});function V(t={}){let{label:n,metadata:r,textRef:s,indexGuessBehavior:N,index:m}=t,{register:x,unregister:p,subscribeMapChange:f,elementsRef:d,labelsRef:h,nextIndexRef:c}=F(),g=O.useRef(-1),[a,i]=O.useState(m??(N===W.GuessFromOrder?()=>{if(g.current===-1){let e=c.current;c.current+=1,g.current=e}return g.current}:-1)),E=O.useRef(null),D=O.useCallback(e=>{if(E.current=e,a!==-1&&e!==null&&(d.current[a]=e,h)){let l=n!==void 0;h.current[a]=l?n:s?.current?.textContent??e.textContent}},[a,d,h,n,s]);return C(()=>{if(m!=null)return;let e=E.current;if(e)return x(e,r),()=>{p(e)}},[m,x,p,r]),C(()=>{if(m==null)return f(e=>{let l=E.current?e.get(E.current)?.index:null;l!=null&&i(l)})},[m,f,i]),{ref:D,index:a}}o(V,"useCompositeListItem");var b=L(S(),1);var v=L(z(),1);function Z(t){let{children:n,elementsRef:r,labelsRef:s,onMapChange:N}=t,m=M(N),x=b.useRef(0),p=T(U).current,f=T(k).current,[d,h]=b.useState(0),c=b.useRef(d),g=M((e,l)=>{f.set(e,l??null),c.current+=1,h(c.current)}),a=M(e=>{f.delete(e),c.current+=1,h(c.current)}),i=b.useMemo(()=>{let e=new Map;return Array.from(f.keys()).filter(u=>u.isConnected).sort(A).forEach((u,I)=>{let R=f.get(u)??{};e.set(u,{...R,index:I})}),e},[f,d]);C(()=>{if(typeof MutationObserver!="function"||i.size===0)return;let e=new MutationObserver(l=>{let u=new Set,I=o(R=>u.has(R)?u.delete(R):u.add(R),"updateDiff");l.forEach(R=>{R.removedNodes.forEach(I),R.addedNodes.forEach(I)}),u.size===0&&(c.current+=1,h(c.current))});return i.forEach((l,u)=>{u.parentElement&&e.observe(u.parentElement,{childList:!0})}),()=>{e.disconnect()}},[i]),C(()=>{c.current===d&&(r.current.length!==i.size&&(r.current.length=i.size),s&&s.current.length!==i.size&&(s.current.length=i.size),x.current=i.size),m(i)},[m,i,r,s,d]),C(()=>()=>{r.current=[]},[r]),C(()=>()=>{s&&(s.current=[])},[s]);let E=M(e=>(p.add(e),()=>{p.delete(e)}));C(()=>{p.forEach(e=>e(i))},[p,i]);let D=b.useMemo(()=>({register:g,unregister:a,subscribeMapChange:E,elementsRef:r,labelsRef:s,nextIndexRef:x}),[g,a,E,r,s,x]);return(0,v.jsx)(_.Provider,{value:D,children:n})}o(Z,"CompositeList");function k(){return new Map}o(k,"createMap");function U(){return new Set}o(U,"createListeners");function A(t,n){let r=t.compareDocumentPosition(n);return r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS?1:0}o(A,"sortByDocumentPosition");function re(t){let n=t.getBoundingClientRect(),r=P(t);if(y.env.jsdom)return n;let s=r.getComputedStyle(t,"::before"),N=r.getComputedStyle(t,"::after");if(!(s.content!=="none"||N.content!=="none"))return n;let x=parseFloat(s.width)||0,p=parseFloat(s.height)||0,f=parseFloat(N.width)||0,d=parseFloat(N.height)||0,h=Math.max(n.width,x,f),c=Math.max(n.height,p,d),g=h-n.width,a=c-n.height;return{left:n.left-g/2,right:n.right+g/2,top:n.top-a/2,bottom:n.bottom+a/2}}o(re,"getPseudoElementBounds");function ie(t){return t==null||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}o(ie,"isElementDisabled");export{W as a,V as b,Z as c,re as d,ie as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ke}from"./chunk-V53KNYRN.js";import{a as T}from"./chunk-5Y3QLNWX.js";import{a as Pe}from"./chunk-CTNB2KIA.js";import{a as be}from"./chunk-X665E2HU.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as M}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as F}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as j}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as ge}from"./chunk-LJIFMW67.js";import"./chunk-XXQUMVWH.js";import"./chunk-QWBRD6PX.js";import"./chunk-QLQADHFE.js";import{a as Z}from"./chunk-VDW32UET.js";import{c as ae}from"./chunk-SHMNA6UL.js";import{f as oe}from"./chunk-V2U5CL3S.js";import"./chunk-XBDKZZ67.js";import{a as de}from"./chunk-XQCVZAGU.js";import{a as Ne,b as ve,c as we,d as ce,e as le,f as re}from"./chunk-MIQTKZAR.js";import{a as se,b as pe,c as fe,d as ue,e as ne}from"./chunk-UZERI5YC.js";import{d as Y,f as he,g as xe,h as ye,m as te}from"./chunk-OG4N2XHD.js";import"./chunk-XNGYYOLS.js";import{a as d,e as ie,f as Ae,g as Ie,h as Fe}from"./chunk-3XIESWL4.js";var p=ie(Ae(),1);var me=ie(Ie(),1);var t=ie(Fe(),1);var Ce=["read","insert","update","delete"],Te=d((e,a)=>({delete:e("Delete"),insert:e("Insert"),read:e("Read"),update:e("Update")})[a],"$e"),Ee=d(e=>{let a=new Set;for(let i of e?.advisories??[])if(i.name==="rls_uncovered_table"){let{table:s}=i.metadata;typeof s=="string"&&s!==""&&a.add(s)}return a},"Ae"),ze=d((e,a,i)=>{let s=new Map,l=d(n=>{let o=s.get(n);if(o!==void 0)return o;let f={cells:{delete:{},insert:{},read:{},update:{}},maskedColumns:new Set,table:n,uncovered:i.has(n)};return s.set(n,f),f},"r");for(let n of e)l(n.table).cells[n.on]={procedure:n.procedure};for(let n of a)l(n.table).maskedColumns.add(n.column);for(let n of i)l(n);return[...s.values()].toSorted((n,o)=>n.table.localeCompare(o.table))},"Fe"),$e=d(e=>{let a=(0,me.c)(17),i;a[0]!==e?(i=e===void 0?{}:e,a[0]=e,a[1]=i):i=a[1];let{onProbe:s}=i,l=Y(),n,o;a[2]===Symbol.for("react.memo_cache_sentinel")?(n={},o={live:!0},a[2]=n,a[3]=o):(n=a[2],o=a[3]);let f=ae(Z.rlsPolicies,n,o),r;a[4]===Symbol.for("react.memo_cache_sentinel")?(r={},a[4]=r):r=a[4];let b=ae(Z.maskPolicies,r),h;a[5]===Symbol.for("react.memo_cache_sentinel")?(h={},a[5]=h):h=a[5];let g=ae(Z.getAdvisories,h),N;if(a[6]!==g.data||a[7]!==b.data||a[8]!==s||a[9]!==f||a[10]!==l){let v=null;f.data!==void 0&&(v=Array.isArray(f.data.policies)?f.data.policies:[]);let E=Array.isArray(b.data?.columns)?b.data.columns:[],R=g.data??null,{error:C,errorSource:w,liveError:S}=f,A=v===null?[]:ze(v,E,Ee(R)),k;a[12]!==S?(k=(0,t.jsx)("div",{className:"flex items-center justify-end",children:(0,t.jsx)(Pe,{message:S,prefix:"pm"})}),a[12]=S,a[13]=k):k=a[13];let x;a[14]!==C||a[15]!==w?(x=C!==null&&(0,t.jsx)(ge,{error:w,testId:"pm-error"}),a[14]=C,a[15]=w,a[16]=x):x=a[16],N=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-permissions-matrix",children:[k,x,v!==null&&A.length===0?(0,t.jsx)(de,{description:l("Add a `definePolicy` and wire it through `.use(rls(...))` to populate this matrix."),testId:"pm-empty",title:l("No policy")}):(0,t.jsxs)(Ne,{"data-testid":"pm-table",children:[(0,t.jsx)(ve,{children:(0,t.jsxs)(ce,{children:[(0,t.jsx)(le,{children:l("Table")}),Ce.map(c=>(0,t.jsx)(le,{children:Te(l,c)},c)),(0,t.jsx)(le,{children:l("Masked columns")})]})}),(0,t.jsx)(we,{children:A.map(c=>(0,t.jsxs)(ce,{"data-testid":`pm-row-${c.table}`,children:[(0,t.jsx)(re,{className:"font-mono text-xs",children:(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[c.table,c.uncovered&&(0,t.jsx)(j,{"data-testid":`pm-uncovered-${c.table}`,title:l("Uncovered \u2014 reachable without a policy"),variant:"destructive",children:l("Uncovered \u2014 reachable without a policy")})]})}),Ce.map(_=>{let y=c.cells[_];return(0,t.jsx)(re,{"data-testid":`pm-cell-${c.table}-${_}`,children:y.procedure===void 0?(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:l("No policy")}):(0,t.jsxs)("span",{className:"flex flex-col gap-1",children:[(0,t.jsx)(j,{variant:"secondary",children:l("Covered by {procedure}",{procedure:y.procedure})}),s!==void 0&&(0,t.jsx)(F,{className:"h-auto justify-start p-0 text-[11px]","data-testid":`pm-probe-${c.table}-${_}`,onClick:d(()=>{s(c.table,_,y.procedure??"")},"onClick"),size:"xs",type:"button",variant:"ghost",children:l("Probe this")})]})},_)}),(0,t.jsx)(re,{children:c.maskedColumns.size===0?(0,t.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"}):(0,t.jsx)("span",{className:"flex flex-wrap gap-1",children:[...c.maskedColumns].map(Le)})})]},c.table))})]})]}),a[6]=g.data,a[7]=b.data,a[8]=s,a[9]=f,a[10]=l,a[11]=N}else N=a[11];return N},"Ee");function Le(e){return(0,t.jsx)(j,{variant:"outline",children:e},e)}d(Le,"Te");var Oe=he(Z.runAs),Re=d(()=>{let e=oe();return async({args:a,functionPath:i,shardKey:s="",userId:l})=>{let n=Oe;try{return{kind:"allowed",value:await e.query(n,{args:a,functionPath:i,userId:l},xe(s))}}catch(o){return{kind:"denied",message:o instanceof Error?o.message:String(o)}}}},"Re"),je=d(e=>e===void 0?"undefined":JSON.stringify(e,null,2),"Me"),Me=d(({functions:e,prefill:a,runAsIdentity:i=!1}={})=>{let s=oe(),l=Y(),n=Re(),[o,f]=(0,p.useState)(null),[r,b]=(0,p.useState)(null),h=e??o??[],[g,N]=(0,p.useState)(""),[v,E]=(0,p.useState)("{}"),[R,C]=(0,p.useState)(""),[w,S]=(0,p.useState)(""),[A,k]=(0,p.useState)(!1),[x,c]=(0,p.useState)(null),[_,y]=(0,p.useState)(null),I=(0,p.useRef)(-1);(0,p.useEffect)(()=>{if(e!==void 0)return;let m=!1;return s.listFunctions().then(u=>(m||f(u),u)).catch(u=>{m||b(ye(u))}),()=>{m=!0}},[s,e]),(0,p.useEffect)(()=>{if(a===void 0||I.current===a.nonce)return;I.current=a.nonce;let m=a.functionPath;queueMicrotask(()=>{N(m),c(null)})},[a]);let P=g===""?h[0]?.path??"":g,z=d(async()=>{if(P==="")return;let m;try{m=v.trim()===""?{}:JSON.parse(v)}catch(u){y(l("Invalid JSON args: {message}",{message:u.message})),c(null);return}y(null),k(!0);try{let u=await n({args:m,functionPath:P,shardKey:R.trim(),userId:w.trim()});c(u)}finally{k(!1)}},"F"),$=d(()=>{te(z())},"E"),H=d(m=>{N(m.target.value)},"B"),L=d(m=>{E(m.target.value)},"T"),O=d(m=>{S(m.target.value)},"L");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-permissions-playground",children:[r!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pp-discover-error",role:"alert",children:r}),!i&&(0,t.jsx)(de,{description:l("Dev only: runs the selected function as this user over the admin gate so you can test auth and RLS."),testId:"pp-gate",title:l("Set `runAsIdentity` to forge an identity and probe access.")}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-md border border-border p-3",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(T,{htmlFor:"pp-function",children:l("Function")}),(0,t.jsx)("select",{"aria-label":l("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","data-testid":"pp-function",id:"pp-function",onChange:H,value:P,children:h.map(m=>(0,t.jsxs)("option",{value:m.path,children:[m.path," (",m.kind,")"]},m.path))})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(T,{htmlFor:"pp-args",children:l("Arguments")}),(0,t.jsx)(ke,{"aria-label":l("Arguments"),className:"font-mono text-xs","data-testid":"pp-args",id:"pp-args",onChange:L,value:v})]}),(0,t.jsx)(be,{onChange:C,testId:"pp-shard",value:R}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(T,{htmlFor:"pp-user",children:l("Run as (userId)")}),(0,t.jsx)(M,{"aria-label":l("Identity (userId) to run as"),className:"font-mono text-xs","data-testid":"pp-user",id:"pp-user",onChange:O,placeholder:l("Leave empty to run as admin"),value:w})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(F,{"data-testid":"pp-run",disabled:!i||A||P==="",onClick:$,type:"button",children:l(A?"Probing\u2026":"Run probe")}),w.trim()!==""&&(0,t.jsx)(j,{"data-testid":"pp-as-badge",variant:"secondary",children:l("as {userId}",{userId:w.trim()})})]})]}),_!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pp-args-error",role:"alert",children:_}),x!==null&&x.kind==="allowed"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"pp-outcome-allowed",children:[(0,t.jsx)(j,{variant:"secondary",children:l("Allowed")}),(0,t.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"pp-result",children:je(x.value)})]}),x!==null&&x.kind==="denied"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"pp-outcome-denied",children:[(0,t.jsx)(j,{variant:"destructive",children:l("Denied")}),(0,t.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"pp-denied",role:"alert",children:x.message})]})]})},"Oe"),qe="/__lunora/policy-scaffold",De={"already-wired":"That procedure already has an rls(...) policy wired in.","file-exists":"A policy file with that name already exists \u2014 pick another name or edit it by hand.","invalid-identifier":"Name, table, and policy-set must be plain identifiers (letters, digits, _ or $).","unknown-procedure":"No exported procedure was found at that file path.","unsupported-procedure-shape":"That procedure uses the bare query({\u2026}) form \u2014 convert it to the builder form (c.use(\u2026).query(\u2026)) before wiring RLS."},Je=d(async e=>{let a=await fetch(qe,{body:JSON.stringify(e),headers:{"Content-Type":"application/json"},method:"POST"}),i=await a.json();if(i.needsManualEdit===!0)return{kind:"needs-manual-edit",message:i.message??"This change must be made by hand."};if(a.ok)return{diagnostics:i.diagnostics??[],kind:"ok",label:i.fileName??i.exportName??""};let s=i.error;return{kind:"error",message:s===void 0?`policy scaffold failed (${String(a.status)})`:De[s]??s}},"qe"),Se={exportName:"",filePath:"",policyName:"",policies:"",tableName:""},Ke=d(()=>{let e=(0,me.c)(69),a=Y(),[i,s]=(0,p.useState)(null),[l,n]=(0,p.useState)(!1),[o,f]=(0,p.useState)(null),[r,b]=(0,p.useState)(Se),h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=d(ee=>{let G=ee.target.name,{value:V}=ee.target;b(_e=>({..._e,[G]:V}))},"u"),e[0]=h):h=e[0];let g=h,N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=d(()=>{s(null),b(Se)},"N"),e[1]=N):N=e[1];let v=N,E;e[2]===Symbol.for("react.memo_cache_sentinel")?(E=d(async ee=>{n(!0),f(null);try{let G=await Je(ee);f(G),G.kind==="ok"&&v()}catch(G){let V=G;f({kind:"error",message:V instanceof Error?V.message:String(V)})}n(!1)},"A"),e[2]=E):E=e[2];let R=E,C;e[3]!==r.policyName||e[4]!==r.tableName?(C=d(()=>{te(R({kind:"scaffoldPolicy",name:r.policyName.trim(),table:r.tableName.trim()}))},"S"),e[3]=r.policyName,e[4]=r.tableName,e[5]=C):C=e[5];let w=C,S;e[6]!==r.exportName||e[7]!==r.filePath||e[8]!==r.policies?(S=d(()=>{te(R({exportName:r.exportName.trim(),filePath:r.filePath.trim(),kind:"wireRls",policies:r.policies.trim()}))},"C"),e[6]=r.exportName,e[7]=r.filePath,e[8]=r.policies,e[9]=S):S=e[9];let A=S,k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=d(()=>{f(null),s("scaffold")},"k"),e[10]=k):k=e[10];let x=k,c;e[11]===Symbol.for("react.memo_cache_sentinel")?(c=d(()=>{f(null),s("wire")},"c"),e[11]=c):c=e[11];let _=c,y;e[12]!==a?(y=a("Scaffold access rules"),e[12]=a,e[13]=y):y=e[13];let I;e[14]!==y?(I=(0,t.jsx)(fe,{children:y}),e[14]=y,e[15]=I):I=e[15];let P;e[16]!==a?(P=a("Writes a new deny-by-default policy file under lunora/, or wires one into a procedure, then reruns codegen. Local dev only."),e[16]=a,e[17]=P):P=e[17];let z;e[18]!==P?(z=(0,t.jsx)(ue,{children:P}),e[18]=P,e[19]=z):z=e[19];let $;e[20]!==z||e[21]!==I?($=(0,t.jsxs)(pe,{children:[I,z]}),e[20]=z,e[21]=I,e[22]=$):$=e[22];let H=i==="scaffold"?"default":"outline",L;e[23]!==a?(L=a("New policy file"),e[23]=a,e[24]=L):L=e[24];let O;e[25]!==H||e[26]!==L?(O=(0,t.jsx)(F,{"data-testid":"policy-scaffolder-new",onClick:x,size:"xs",type:"button",variant:H,children:L}),e[25]=H,e[26]=L,e[27]=O):O=e[27];let m=i==="wire"?"default":"outline",u;e[28]!==a?(u=a("Wire into a procedure"),e[28]=a,e[29]=u):u=e[29];let q;e[30]!==m||e[31]!==u?(q=(0,t.jsx)(F,{"data-testid":"policy-scaffolder-wire",onClick:_,size:"xs",type:"button",variant:m,children:u}),e[30]=m,e[31]=u,e[32]=q):q=e[32];let D;e[33]!==O||e[34]!==q?(D=(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[O,q]}),e[33]=O,e[34]=q,e[35]=D):D=e[35];let J;e[36]!==l||e[37]!==r.policyName||e[38]!==r.tableName||e[39]!==i||e[40]!==w||e[41]!==a?(J=i==="scaffold"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"policy-scaffolder-new-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(T,{htmlFor:"policy-scaffolder-name",children:a("Policy name")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-name",id:"policy-scaffolder-name",name:"policyName",onChange:g,value:r.policyName})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(T,{htmlFor:"policy-scaffolder-table",children:a("Table name")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-table",id:"policy-scaffolder-table",name:"tableName",onChange:g,value:r.tableName})]}),(0,t.jsx)(F,{"data-testid":"policy-scaffolder-create",disabled:l||r.policyName.trim()===""||r.tableName.trim()==="",onClick:w,size:"xs",type:"button",children:a(l?"Creating\u2026":"Create policy file")}),(0,t.jsx)(F,{onClick:v,size:"xs",type:"button",variant:"ghost",children:a("Cancel")})]}),e[36]=l,e[37]=r.policyName,e[38]=r.tableName,e[39]=i,e[40]=w,e[41]=a,e[42]=J):J=e[42];let K;e[43]!==l||e[44]!==r.exportName||e[45]!==r.filePath||e[46]!==r.policies||e[47]!==i||e[48]!==A||e[49]!==a?(K=i==="wire"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"policy-scaffolder-wire-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(T,{htmlFor:"policy-scaffolder-file",children:a("Procedure file path")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-file",id:"policy-scaffolder-file",name:"filePath",onChange:g,value:r.filePath})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(T,{htmlFor:"policy-scaffolder-export",children:a("Exported procedure")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-export",id:"policy-scaffolder-export",name:"exportName",onChange:g,value:r.exportName})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(T,{htmlFor:"policy-scaffolder-policies",children:a("Policy set identifier")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-policies",id:"policy-scaffolder-policies",name:"policies",onChange:g,value:r.policies})]}),(0,t.jsx)(F,{"data-testid":"policy-scaffolder-apply",disabled:l||r.filePath.trim()===""||r.exportName.trim()===""||r.policies.trim()==="",onClick:A,size:"xs",type:"button",children:a(l?"Wiring\u2026":"Wire RLS")}),(0,t.jsx)(F,{onClick:v,size:"xs",type:"button",variant:"ghost",children:a("Cancel")})]}),e[43]=l,e[44]=r.exportName,e[45]=r.filePath,e[46]=r.policies,e[47]=i,e[48]=A,e[49]=a,e[50]=K):K=e[50];let U;e[51]!==o?(U=o?.kind==="error"&&(0,t.jsx)("p",{className:"mt-3 text-sm text-destructive","data-testid":"policy-scaffolder-error",role:"alert",children:o.message}),e[51]=o,e[52]=U):U=e[52];let W;e[53]!==o?.kind||e[54]!==a?(W=o?.kind==="needs-manual-edit"&&(0,t.jsx)("p",{className:"mt-3 text-sm text-amber-600 dark:text-amber-500","data-testid":"policy-scaffolder-manual",role:"alert",children:a("This change must be made by hand \u2014 the scaffolder only adds new, deny-by-default rules.")}),e[53]=o?.kind,e[54]=a,e[55]=W):W=e[55];let B;e[56]!==o||e[57]!==a?(B=o?.kind==="ok"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-1","data-testid":"policy-scaffolder-ok",children:[(0,t.jsx)("p",{className:"text-sm text-emerald-600 dark:text-emerald-500",children:a("Scaffolded {label} and reran codegen. Fill in the `when` predicates before relying on it.",{label:o.label})}),o.diagnostics.length>0&&(0,t.jsx)("ul",{className:"flex flex-col gap-0.5","data-testid":"policy-scaffolder-diagnostics",children:o.diagnostics.map(Ue)})]}),e[56]=o,e[57]=a,e[58]=B):B=e[58];let Q;e[59]!==D||e[60]!==J||e[61]!==K||e[62]!==U||e[63]!==W||e[64]!==B?(Q=(0,t.jsxs)(ne,{children:[D,J,K,U,W,B]}),e[59]=D,e[60]=J,e[61]=K,e[62]=U,e[63]=W,e[64]=B,e[65]=Q):Q=e[65];let X;return e[66]!==$||e[67]!==Q?(X=(0,t.jsxs)(se,{"data-testid":"policy-scaffolder",size:"sm",children:[$,Q]}),e[66]=$,e[67]=Q,e[68]=X):X=e[68],X},"Je");function Ue(e){return(0,t.jsx)("li",{className:"font-mono text-[11px] text-destructive",children:e},e)}d(Ue,"De");var st=d(({functions:e,runAsIdentity:a=!1,schemaEditable:i=!1}={})=>{let s=Y(),[l,n]=(0,p.useState)(void 0),o=d((f,r,b)=>{b!==""&&n(h=>({functionPath:b,nonce:(h?.nonce??0)+1}))},"o");return(0,t.jsxs)("div",{className:"flex flex-col gap-8","data-testid":"lunora-permissions",children:[(0,t.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Permissions")})}),(0,t.jsx)($e,{onProbe:o})]}),(0,t.jsx)("section",{className:"flex flex-col gap-3",children:(0,t.jsxs)(se,{className:"gap-0 py-0",children:[(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Probe")})}),(0,t.jsxs)(ne,{className:"px-4 py-4",children:[(0,t.jsx)("p",{className:"mb-3 text-sm text-muted-foreground",children:s("Pick a function and an identity, then run it to see the access outcome.")}),(0,t.jsx)(Me,{functions:e,prefill:l,runAsIdentity:a})]})]})}),i&&(0,t.jsx)("section",{className:"flex flex-col gap-2",children:(0,t.jsx)(Ke,{})})]})},"nt");export{st as PermissionsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-3XIESWL4.js";var u={highErrorRate:.05,highWriteContention:.1,lowCacheHitRate:.5,minCacheSamples:10,minConflictCalls:5,minErrorCalls:5,slowFunctionMs:1e3},h={error:0,info:2,warning:1},g=o((e,a)=>{let s=[];if(e.maxDurationMs>=a.slowFunctionMs){let n=e.scannedTables??[];n.length>0?s.push({fn:e.path,kind:"missing-index",severity:"warning",tables:n.map(t=>t.table),value:e.maxDurationMs}):s.push({fn:e.path,kind:"slow-function",severity:"info",value:e.maxDurationMs})}e.calls>=a.minErrorCalls&&e.errors/e.calls>=a.highErrorRate&&s.push({fn:e.path,kind:"high-error-rate",message:e.lastErrorMessage??void 0,severity:"error",value:e.errors/e.calls});let r=e.conflicts??0;return r>0&&e.calls>=a.minConflictCalls&&r/e.calls>=a.highWriteContention&&s.push({fn:e.path,kind:"high-write-contention",severity:"warning",value:r/e.calls}),s},"u"),v=o((e,a,s=u)=>{let r=[];if(e?.cache){let{evictions:n,hits:t,misses:c}=e.cache,i=t+c;if(i>=s.minCacheSamples){let l=t/i;l<s.lowCacheHitRate&&r.push({kind:"low-cache-hit-rate",severity:"warning",value:l})}n>0&&n>t&&r.push({kind:"high-evictions",severity:"warning",value:n})}for(let n of a??[])r.push(...g(n,s));return r.toSorted((n,t)=>h[n.severity]-h[t.severity])},"g");export{v as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as D,c as g,d as P,f as k}from"./chunk-V2U5CL3S.js";import{f as v,g as S,h as T,m as q}from"./chunk-OG4N2XHD.js";import{a as i,e as A,f as $,g as M}from"./chunk-3XIESWL4.js";var I=A(M(),1);var f=A($(),1);var l=i(e=>typeof e=="string"?e===""?void 0:e:typeof e=="number"||typeof e=="boolean"?String(e):void 0,"u"),h=i(e=>e.filter(r=>r!==void 0).join(" "),"d"),Q={deleteRows:i(e=>h([l(e.table),Array.isArray(e.ids)?`${String(e.ids.length)} rows`:void 0]),"deleteRows"),facetColumn:i(e=>h([l(e.table),l(e.column)]),"facetColumn"),lintSql:i(()=>"sql","lintSql"),readTablePage:i(e=>h([l(e.table),Array.isArray(e.filters)&&e.filters.length>0?`${String(e.filters.length)} filters`:void 0,typeof e.search=="string"&&e.search!==""?"search":void 0,typeof e.limit=="number"?`limit ${String(e.limit)}`:void 0]),"readTablePage"),runMigration:i(e=>h([l(e.id),l(e.direction),e.dryRun===!0?"dry-run":void 0]),"runMigration"),runSql:i(e=>typeof e.sql=="string"?`${String(e.sql.length)} chars`:"","runSql"),schemaVersion:i(e=>typeof e.hash=="string"?e.hash.slice(0,8):"","schemaVersion"),writeRow:i(e=>h([l(e.table),"1 row"]),"writeRow")},E="__lunora_admin__:",C=i((e,r)=>{let s=e.startsWith(E)?e.slice(E.length):e,t=Q[s];if(t!==void 0)return t(r);let n=Object.keys(r);return n.length===0?"":n.join(", ")},"N"),L=i(e=>{if(Array.isArray(e))return e.length;if(!(typeof e!="object"||e===null)){for(let r of Object.values(e))if(Array.isArray(r))return r.length}},"K"),w=class{static{i(this,"L")}entries=[];listeners=new Set;nextSeq=1;getSnapshot=i(()=>this.entries,"getSnapshot");subscribe=i(r=>(this.listeners.add(r),()=>{this.listeners.delete(r)}),"subscribe");start(r,s,t){return this.append(r,s,t,"call","pending")}startSubscription(r,s,t){return this.append(r,s,t,"subscription","live")}recordPush(r){if(this.listeners.size===0){let s=this.entries.find(t=>t.seq===r);s!==void 0&&(s.pushes=(s.pushes??0)+1);return}this.patch(r,s=>({...s,pushes:(s.pushes??0)+1}))}failSubscription(r,s){this.patch(r,t=>({...t,error:s,status:"error"}))}endSubscription(r){this.patch(r,s=>s.status==="error"?s:{...s,durationMs:Date.now()-s.startedAt,status:"closed"})}lastErrorSeq(){return this.entries.findLast(r=>r.status==="error")?.seq}settle(r,s){this.patch(r,t=>({...t,durationMs:Date.now()-t.startedAt,...s.error===void 0?{resultCount:L(s.result),status:"ok"}:{error:s.error,status:"error"}}))}clear(){this.entries=[],this.emit()}append(r,s,t,n,a){let o=this.nextSeq;this.nextSeq+=1;let d={functionPath:r,kind:n,seq:o,shardKey:t,startedAt:Date.now(),status:a,summary:C(r,s),...n==="subscription"?{pushes:0}:{}},u=[...this.entries,d];return this.entries=u.length>300?u.slice(u.length-300):u,this.emit(),o}patch(r,s){let t=this.entries.findIndex(n=>n.seq===r);t!==-1&&(this.entries=this.entries.with(t,s(this.entries[t])),this.emit())}emit(){for(let r of this.listeners)r()}},p=new w,_=i((e,r,s)=>["lunora-admin",e,r,s.trim()],"q");function R(e,r,s={}){let{enabled:t=!0,keepPreviousData:n=!1,staleTime:a=0}=s,o=P({enabled:t,queryFn:r,placeholderData:n?D:void 0,queryKey:e,staleTime:a});return{data:o.data,error:o.error?T(o.error):o.error,errorSource:o.error??void 0,isLoading:o.isLoading,liveError:void 0,refetch:i(()=>{q(o.refetch())},"refetch")}}i(R,"M");function V(e,r,s={}){let t=k(),n=g(),{enabled:a=!0,keepPreviousData:o=!1,live:d=!1,shardKey:u="",staleTime:j}=s,m=_(e,r,u),x=R(m,()=>t.query(v(e),r,S(u)),{enabled:a,keepPreviousData:o,staleTime:j??(d?Number.POSITIVE_INFINITY:0)}),[N,y]=(0,f.useState)(void 0),O=JSON.stringify(m);return(0,f.useEffect)(()=>{if(!a||!d)return;y(void 0);let b=p.startSubscription(e,r,u),K=t.subscribe(v(e),r,c=>{p.recordPush(b),y(void 0),n.setQueryData(m,c)},{...S(u),onError:i(c=>{p.failSubscription(b,c.message),y(c.message)},"onError")});return()=>{p.endSubscription(b),K()}},[O,a,d]),{...x,liveError:a&&d?N:void 0}}i(V,"z");var U=i(()=>{let e=(0,I.c)(2),r=g(),s;return e[0]!==r?(s=i((t,n,a)=>{let o=n===void 0?["lunora-admin",t]:_(t,n,a??"");q(r.invalidateQueries({queryKey:o}))},"e"),e[0]=r,e[1]=s):s=e[1],s},"J");export{p as a,R as b,V as c,U as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as Rs}from"./chunk-T6VMSOBB.js";import{a as ys}from"./chunk-7QIFDWQV.js";import{a as i,e as k,f as W,h as ot}from"./chunk-3XIESWL4.js";var Go=k(W(),1),ue=Go.createContext(null);var Jo=k(W(),1);function D(t){return Jo.useContext(ue)}i(D,"useRouter");var ze=k(W(),1),Mt=ze.createContext(void 0),Yo=ze.createContext(void 0);function pt(t){return t[t.length-1]}i(pt,"last");function Ss(t){return typeof t=="function"}i(Ss,"isFunction");function Y(t,o){return Ss(t)?t(o):t}i(Y,"functionalUpdate");var er=Object.prototype.hasOwnProperty,Xo=Object.prototype.propertyIsEnumerable;function mt(t){for(let o in t)if(er.call(t,o))return!0;return!1}i(mt,"hasKeys");var Ps=i(()=>Object.create(null),"createNull"),gt=i((t,o)=>at(t,o,Ps),"nullReplaceEqualDeep");function at(t,o,e=()=>({}),s=0){if(!1)return o;if(t===o)return t;if(s>500)return o;let r=o,n=Ke(t)&&Ke(r);if(!n&&!(Yt(t)&&Yt(r)))return r;let a=n?t:Zo(t);if(!a)return r;let c=n?r:Zo(r);if(!c)return r;let u=a.length,d=c.length,f=n?new Array(d):e(),l=0;for(let p=0;p<d;p++){let h=n?p:c[p],m=t[h],y=r[h];if(m===y){f[h]=m,(n?p<u:er.call(t,h))&&l++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){f[h]=y;continue}let g=at(m,y,e,s+1);f[h]=g,g===m&&l++}return u===d&&l===u?t:f}i(at,"replaceEqualDeep");function Zo(t){let o=Object.getOwnPropertyNames(t);for(let r of o)if(!Xo.call(t,r))return!1;let e=Object.getOwnPropertySymbols(t);if(e.length===0)return o;let s=o;for(let r of e){if(!Xo.call(t,r))return!1;s.push(r)}return s}i(Zo,"getEnumerableOwnKeys");function Yt(t){if(!Qo(t))return!1;let o=t.constructor;if(typeof o>"u")return!0;let e=o.prototype;return!(!Qo(e)||!e.hasOwnProperty("isPrototypeOf"))}i(Yt,"isPlainObject");function Qo(t){return Object.prototype.toString.call(t)==="[object Object]"}i(Qo,"hasObjectPrototype");function Ke(t){return Array.isArray(t)&&t.length===Object.keys(t).length}i(Ke,"isPlainArray");function st(t,o,e){if(t===o)return!0;if(typeof t!=typeof o)return!1;if(Array.isArray(t)&&Array.isArray(o)){if(t.length!==o.length)return!1;for(let s=0,r=t.length;s<r;s++)if(!st(t[s],o[s],e))return!1;return!0}if(Yt(t)&&Yt(o)){let s=e?.ignoreUndefined??!0;if(e?.partial){for(let a in o)if((!s||o[a]!==void 0)&&!st(t[a],o[a],e))return!1;return!0}let r=0;if(!s)r=Object.keys(t).length;else for(let a in t)t[a]!==void 0&&r++;let n=0;for(let a in o)if((!s||o[a]!==void 0)&&(n++,n>r||!st(t[a],o[a],e)))return!1;return r===n}return!1}i(st,"deepEqual");function ct(t){let o,e,s=new Promise((r,n)=>{o=r,e=n});return s.status="pending",s.resolve=r=>{s.status="resolved",s.value=r,o(r),t?.(r)},s.reject=r=>{s.status="rejected",e(r)},s}i(ct,"createControlledPromise");function vt(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}i(vt,"isPromise");var xs=/[\x00-\x1f\x7f"<>`{}]/g;function ws(t){return t.replace(xs,o=>"%"+o.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}i(ws,"sanitizePathSegment");function tr(t){let o;try{o=decodeURI(t)}catch{o=t.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return ws(o)}i(tr,"decodeSegment");var qe=["http:","https:","mailto:","tel:"];function ut(t,o){if(!t)return!1;try{let e=new URL(t);return!o.has(e.protocol)}catch{return!1}}i(ut,"isDangerousProtocol");function At(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};let o=/%25|%5C/gi,e=0,s="",r;for(;(r=o.exec(t))!==null;)s+=tr(t.slice(e,r.index))+r[0],e=o.lastIndex;s=s+tr(e?t.slice(e):t);let n=!1;return s.startsWith("//")&&(n=!0,s="/"+s.replace(/^\/+/,"")),{path:s,handledProtocolRelativeURL:n}}i(At,"decodePath");function or(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}i(or,"encodePathLikeUrl");function rr(t,o){if(t===o)return!0;if(t.length!==o.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==o[e])return!1;return!0}i(rr,"arraysEqual");function $(){throw new Error("Invariant failed")}i($,"invariant");function yt(t){let o=new Map,e,s,r=i(n=>{n.next&&(n.prev?(n.prev.next=n.next,n.next.prev=n.prev,n.next=void 0,s&&(s.next=n,n.prev=s)):(n.next.prev=void 0,e=n.next,n.next=void 0,s&&(n.prev=s,s.next=n)),s=n)},"touch");return{get(n){let a=o.get(n);if(a)return r(a),a.value},set(n,a){if(o.size>=t&&e){let u=e;o.delete(u.key),u.next&&(e=u.next,u.next.prev=void 0),u===s&&(s=void 0)}let c=o.get(n);if(c)c.value=a,r(c);else{let u={key:n,value:a,prev:s};s&&(s.next=u),s=u,e||(e=u),o.set(n,u)}},clear(){o.clear(),e=void 0,s=void 0}}}i(yt,"createLRUCache");var St=4,nr=5;function _s(t){let o=t.indexOf("{");if(o===-1)return null;let e=t.indexOf("}",o);return e===-1||o+1>=t.length?null:[o,e]}i(_s,"getOpenAndCloseBraces");function Ye(t,o,e=new Uint16Array(6)){let s=t.indexOf("/",o),r=s===-1?t.length:s,n=t.substring(o,r);if(!n||!n.includes("$"))return e[0]=0,e[1]=o,e[2]=o,e[3]=r,e[4]=r,e[5]=r,e;if(n==="$"){let c=t.length;return e[0]=2,e[1]=o,e[2]=o,e[3]=c,e[4]=c,e[5]=c,e}if(n.charCodeAt(0)===36)return e[0]=1,e[1]=o,e[2]=o+1,e[3]=r,e[4]=r,e[5]=r,e;let a=_s(n);if(a){let[c,u]=a,d=n.charCodeAt(c+1);if(d===45){if(c+2<n.length&&n.charCodeAt(c+2)===36){let f=c+3,l=u;if(f<l)return e[0]=3,e[1]=o+c,e[2]=o+f,e[3]=o+l,e[4]=o+u+1,e[5]=r,e}}else if(d===36){let f=c+1,l=c+2;return l===u?(e[0]=2,e[1]=o+c,e[2]=o+f,e[3]=o+l,e[4]=o+u+1,e[5]=t.length,e):(e[0]=1,e[1]=o+c,e[2]=o+l,e[3]=o+u,e[4]=o+u+1,e[5]=r,e)}}return e[0]=0,e[1]=o,e[2]=o,e[3]=r,e[4]=r,e[5]=r,e}i(Ye,"parseSegment");function de(t,o,e,s,r,n,a){a?.(e);let c=s;{let u=e.fullPath??e.from,d=u.length,f=e.options?.caseSensitive??t,l=e.options?.params?.parse??e.options?.parseParams;for(;c<d;){let h=Ye(u,c,o),m,y=c,g=h[5];switch(c=g+1,n++,h[0]){case 0:{let v=u.substring(h[2],h[3]);if(f){let R=r.static?.get(v);if(R)m=R;else{r.static??=new Map;let S=It(e.fullPath??e.from);S.parent=r,S.depth=n,m=S,r.static.set(v,S)}}else{let R=v.toLowerCase(),S=r.staticInsensitive?.get(R);if(S)m=S;else{r.staticInsensitive??=new Map;let P=It(e.fullPath??e.from);P.parent=r,P.depth=n,m=P,r.staticInsensitive.set(R,P)}}break}case 1:{let v=u.substring(y,h[1]),R=u.substring(h[4],g),S=f&&!!(v||R),P=v?S?v:v.toLowerCase():void 0,_=R?S?R:R.toLowerCase():void 0,b=!l&&r.dynamic?.find(x=>!x.parse&&x.caseSensitive===S&&x.prefix===P&&x.suffix===_);if(b)m=b;else{let x=Je(1,e.fullPath??e.from,S,P,_);m=x,x.depth=n,x.parent=r,r.dynamic??=[],r.dynamic.push(x)}break}case 3:{let v=u.substring(y,h[1]),R=u.substring(h[4],g),S=f&&!!(v||R),P=v?S?v:v.toLowerCase():void 0,_=R?S?R:R.toLowerCase():void 0,b=!l&&r.optional?.find(x=>!x.parse&&x.caseSensitive===S&&x.prefix===P&&x.suffix===_);if(b)m=b;else{let x=Je(3,e.fullPath??e.from,S,P,_);m=x,x.parent=r,x.depth=n,r.optional??=[],r.optional.push(x)}break}case 2:{let v=u.substring(y,h[1]),R=u.substring(h[4],g),S=f&&!!(v||R),P=v?S?v:v.toLowerCase():void 0,_=R?S?R:R.toLowerCase():void 0,b=Je(2,e.fullPath??e.from,S,P,_);m=b,b.parent=r,b.depth=n,r.wildcard??=[],r.wildcard.push(b)}}r=m}if(l&&e.children&&!e.isRoot&&e.id&&e.id.charCodeAt(e.id.lastIndexOf("/")+1)===95){let h=It(e.fullPath??e.from);h.kind=nr,h.parent=r,n++,h.depth=n,r.pathless??=[],r.pathless.push(h),r=h}let p=(e.path||!e.children)&&!e.isRoot;if(p&&u.endsWith("/")){let h=It(e.fullPath??e.from);h.kind=St,h.parent=r,n++,h.depth=n,r.index=h,r=h}r.parse=l??null,r.priority=e.options?.params?.priority??0,p&&!r.route&&(r.route=e,r.fullPath=e.fullPath??e.from)}if(e.children)for(let u of e.children)de(t,o,u,c,r,n,a)}i(de,"parseSegments");function Ge(t,o){if(t.parse&&!o.parse)return-1;if(!t.parse&&o.parse)return 1;if(t.parse&&o.parse&&(t.priority||o.priority))return o.priority-t.priority;if(t.prefix&&o.prefix&&t.prefix!==o.prefix){if(t.prefix.startsWith(o.prefix))return-1;if(o.prefix.startsWith(t.prefix))return 1}if(t.suffix&&o.suffix&&t.suffix!==o.suffix){if(t.suffix.endsWith(o.suffix))return-1;if(o.suffix.endsWith(t.suffix))return 1}return t.prefix&&!o.prefix?-1:!t.prefix&&o.prefix?1:t.suffix&&!o.suffix?-1:!t.suffix&&o.suffix?1:t.caseSensitive&&!o.caseSensitive?-1:!t.caseSensitive&&o.caseSensitive?1:0}i(Ge,"sortDynamic");function Rt(t){if(t.pathless)for(let o of t.pathless)Rt(o);if(t.static)for(let o of t.static.values())Rt(o);if(t.staticInsensitive)for(let o of t.staticInsensitive.values())Rt(o);if(t.dynamic?.length){t.dynamic.sort(Ge);for(let o of t.dynamic)Rt(o)}if(t.optional?.length){t.optional.sort(Ge);for(let o of t.optional)Rt(o)}if(t.wildcard?.length){t.wildcard.sort(Ge);for(let o of t.wildcard)Rt(o)}}i(Rt,"sortTreeNodes");function It(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(It,"createStaticNode");function Je(t,o,e,s,r){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:o,parent:null,parse:null,priority:0,caseSensitive:e,prefix:s,suffix:r}}i(Je,"createDynamicNode");function ir(t,o){let e=It("/"),s=new Uint16Array(6);for(let r of t)de(!1,s,r,1,e,0);Rt(e),o.masksTree=e,o.flatCache=yt(1e3)}i(ir,"processRouteMasks");function ar(t,o){t||="/";let e=o.flatCache.get(t);if(e)return e;let s=Xe(t,o.masksTree);return o.flatCache.set(t,s),s}i(ar,"findFlatMatch");function cr(t,o,e,s,r){t||="/",s||="/";let n=o?`case\0${t}`:t,a=r.singleCache.get(n);return a||(a=It("/"),de(o,new Uint16Array(6),{from:t},1,a,0),r.singleCache.set(n,a)),Xe(s,a,e)}i(cr,"findSingleMatch");function ur(t,o,e=!1){let s=e?t:`nofuzz\0${t}`,r=o.matchCache.get(s);if(r!==void 0)return r;t||="/";let n;try{n=Xe(t,o.segmentTree,e)}catch(a){if(a instanceof URIError)n=null;else throw a}return n&&(n.branch=Ze(n.route)),o.matchCache.set(s,n),n}i(ur,"findRouteMatch");function Cs(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}i(Cs,"trimPathRight");function lr(t,o=!1,e){let s=It(t.fullPath),r=new Uint16Array(6),n={},a={},c=0;return de(o,r,t,1,s,0,u=>{if(e?.(u,c),u.id in n&&$(),n[u.id]=u,c!==0&&u.path){let d=Cs(u.fullPath);(!a[d]||u.fullPath.endsWith("/"))&&(a[d]=u)}c++}),Rt(s),{processedTree:{segmentTree:s,singleCache:yt(1e3),matchCache:yt(1e3),flatCache:null,masksTree:null},routesById:n,routesByPath:a}}i(lr,"processRouteTree");function Xe(t,o,e=!1){let s=t.split("/"),r=Ls(t,s,o,e);if(!r)return null;let[n]=fr(t,s,r);return{route:r.node.route,rawParams:n}}i(Xe,"findMatch");function fr(t,o,e){let s=bs(e.node),r=null,n=Object.create(null),a=e.extract?.part??0,c=e.extract?.node??0,u=e.extract?.path??0,d=e.extract?.segment??0;for(;c<s.length;a++,c++,u++,d++){let f=s[c];if(f.kind===St)break;if(f.kind===nr){d--,a--,u--;continue}let l=o[a],p=u;if(l&&(u+=l.length),f.kind===1){r??=e.node.fullPath.split("/");let h=r[d],m=f.prefix?.length??0;if(h.charCodeAt(m)===123){let y=f.suffix?.length??0,g=h.substring(m+2,h.length-y-1),v=l.substring(m,l.length-y);n[g]=decodeURIComponent(v)}else{let y=h.substring(1);n[y]=decodeURIComponent(l)}}else if(f.kind===3){if(e.skipped&1<<c){a--,u=p-1;continue}r??=e.node.fullPath.split("/");let h=r[d],m=f.prefix?.length??0,y=f.suffix?.length??0,g=h.substring(m+3,h.length-y-1),v=f.suffix||f.prefix?l.substring(m,l.length-y):l;v&&(n[g]=decodeURIComponent(v))}else if(f.kind===2){let h=f,m=t.substring(p+(h.prefix?.length??0),t.length-(h.suffix?.length??0)),y=decodeURIComponent(m);n["*"]=y,n._splat=y;break}}return e.rawParams&&Object.assign(n,e.rawParams),[n,{part:a,node:c,path:u,segment:d}]}i(fr,"extractParams");function Ze(t){let o=[t];for(;t.parentRoute;)t=t.parentRoute,o.push(t);return o.reverse(),o}i(Ze,"buildRouteBranch");function bs(t){let o=Array(t.depth+1);do o[t.depth]=t,t=t.parent;while(t);return o}i(bs,"buildBranch");function Ls(t,o,e,s){if(t==="/"&&e.index)return{node:e.index,skipped:0};let r=!pt(o),n=r&&t!=="/",a=o.length-(r?1:0),c=[{node:e,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],u=null,d=null;for(;c.length;){let f=c.pop(),{node:l,index:p,skipped:h,depth:m,statics:y,dynamics:g,optionals:v}=f,{extract:R,rawParams:S}=f;if(l.kind===2&&l.route&&!fe(d,f))continue;if(l.parse){if(!sr(t,o,f))continue;S=f.rawParams,R=f.extract}s&&l.route&&l.kind!==St&&fe(u,f)&&(u=f);let P=p===a;if(P&&(l.route&&(!n||l.kind===St||l.kind===2)&&fe(d,f)&&(d=f),!l.optional&&!l.wildcard&&!l.index&&!l.pathless))continue;let _=P?void 0:o[p],b;if(P&&l.index){let x={node:l.index,index:p,skipped:h,depth:m+1,statics:y,dynamics:g,optionals:v,extract:R,rawParams:S},w=!0;if(l.index.parse&&(sr(t,o,x)||(w=!1)),w){if(!g&&!v&&!h&&Ms(y,a))return x;fe(d,x)&&(d=x)}}if(l.wildcard)for(let x=l.wildcard.length-1;x>=0;x--){let w=l.wildcard[x],{prefix:C,suffix:M}=w;if(!(C&&(P||!(w.caseSensitive?_:b??=_.toLowerCase()).startsWith(C)))){if(M){if(P)continue;let L=o.slice(p).join("/").slice(-M.length);if((w.caseSensitive?L:L.toLowerCase())!==M)continue}c.push({node:w,index:a,skipped:h,depth:m+1,statics:y,dynamics:g,optionals:v,extract:R,rawParams:S})}}if(l.optional){let x=h|1<<m,w=m+1;for(let C=l.optional.length-1;C>=0;C--){let M=l.optional[C];c.push({node:M,index:p,skipped:x,depth:w,statics:y,dynamics:g,optionals:v,extract:R,rawParams:S})}if(!P)for(let C=l.optional.length-1;C>=0;C--){let M=l.optional[C],{prefix:L,suffix:I}=M;if(L||I){let rt=M.caseSensitive?_:b??=_.toLowerCase();if(L&&!rt.startsWith(L)||I&&!rt.endsWith(I))continue}c.push({node:M,index:p+1,skipped:h,depth:w,statics:y,dynamics:g,optionals:v+le(a,p),extract:R,rawParams:S})}}if(!P&&l.dynamic&&_)for(let x=l.dynamic.length-1;x>=0;x--){let w=l.dynamic[x],{prefix:C,suffix:M}=w;if(C||M){let L=w.caseSensitive?_:b??=_.toLowerCase();if(C&&!L.startsWith(C)||M&&!L.endsWith(M))continue}c.push({node:w,index:p+1,skipped:h,depth:m+1,statics:y,dynamics:g+le(a,p),optionals:v,extract:R,rawParams:S})}if(!P&&l.staticInsensitive){let x=l.staticInsensitive.get(b??=_.toLowerCase());x&&c.push({node:x,index:p+1,skipped:h,depth:m+1,statics:y+le(a,p),dynamics:g,optionals:v,extract:R,rawParams:S})}if(!P&&l.static){let x=l.static.get(_);x&&c.push({node:x,index:p+1,skipped:h,depth:m+1,statics:y+le(a,p),dynamics:g,optionals:v,extract:R,rawParams:S})}if(l.pathless){let x=m+1;for(let w=l.pathless.length-1;w>=0;w--){let C=l.pathless[w];c.push({node:C,index:p,skipped:h,depth:x,statics:y,dynamics:g,optionals:v,extract:R,rawParams:S})}}}if(d)return d;if(s&&u){let f=u.index;for(let p=0;p<u.index;p++)f+=o[p].length;let l=f===t.length?"/":t.slice(f);return u.rawParams??=Object.create(null),u.rawParams["**"]=decodeURIComponent(l),u}return null}i(Ls,"getNodeMatch");function le(t,o){return 2**(t-o-1)}i(le,"segmentScore");function Ms(t,o){return t===2**(o-1)-1}i(Ms,"isPerfectStaticMatch");function sr(t,o,e){let s,r;try{[s,r]=fr(t,o,e)}catch{return null}if(e.rawParams=s,e.extract=r,!e.node.parse)return!0;try{if(e.node.parse(s)===!1)return null}catch{}return!0}i(sr,"validateParseParams");function fe(t,o){return t?o.statics>t.statics||o.statics===t.statics&&(o.dynamics>t.dynamics||o.dynamics===t.dynamics&&(o.optionals>t.optionals||o.optionals===t.optionals&&((o.node.kind===St)>(t.node.kind===St)||o.node.kind===St==(t.node.kind===St)&&o.depth>t.depth))):!0}i(fe,"isFrameMoreSpecific");function Et(t){return Zt(t.filter(o=>o!==void 0).join("/"))}i(Et,"joinPaths");function Zt(t){return t.replace(/\/{2,}/g,"/")}i(Zt,"cleanPath");function he(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}i(he,"trimPathLeft");function Z(t){let o=t.length;return o>1&&t[o-1]==="/"?t.replace(/\/{1,}$/,""):t}i(Z,"trimPathRight");function Qt(t){return Z(he(t))}i(Qt,"trimPath");function Pt(t,o){return t?.endsWith("/")&&t!=="/"&&t!==`${o}/`?t.slice(0,-1):t}i(Pt,"removeTrailingSlash");function pe(t,o,e){return Pt(t,e)===Pt(o,e)}i(pe,"exactPathTest");function Qe({base:t,to:o,trailingSlash:e="never",cache:s}){let r=o.startsWith("/"),n=!r&&o===".",a;if(s){a=r?o:n?t:t+"\0"+o;let d=s.get(a);if(d)return d}let c;if(n)c=t.split("/");else if(r)c=o.split("/");else{for(c=t.split("/");c.length>1&&pt(c)==="";)c.pop();let d=o.split("/");for(let f=0,l=d.length;f<l;f++){let p=d[f];p===""?f?f===l-1&&c.push(p):c=[p]:p===".."?c.pop():p==="."||c.push(p)}}c.length>1&&(pt(c)===""?e==="never"&&c.pop():e==="always"&&c.push(""));let u=Zt(c.join("/"))||"/";return a&&s&&s.set(a,u),u}i(Qe,"resolvePath");function hr(t){let o=new Map(t.map(r=>[encodeURIComponent(r),r])),e=Array.from(o.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(e,"g");return r=>r.replace(s,n=>o.get(n)??n)}i(hr,"compileDecodeCharMap");function Xt(t,o,e){let s=o[t];return typeof s!="string"?s:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(s)?s:s.split("/").map(r=>dr(r,e)).join("/"):dr(s,e)}i(Xt,"encodeParam");function me({path:t,params:o,decoder:e,...s}){let r=!1,n=Object.create(null);if(!t||t==="/")return{interpolatedPath:"/",usedParams:n,isMissingParams:r};if(!t.includes("$"))return{interpolatedPath:t,usedParams:n,isMissingParams:r};if(!1){let f=t.length,l=0,p="";for(;l<f;){for(;l<f&&t.charCodeAt(l)===47;)l++;if(l>=f)break;let h=l,m=t.indexOf("/",l);m===-1&&(m=f),l=m;let y=t.substring(h,m);if(y)if(y.charCodeAt(0)===36)if(y.length===1){let g=o._splat;if(n._splat=g,n["*"]=g,!g){r=!0;continue}let v=Xt("_splat",o,e);p+="/"+v}else{let g=y.substring(1);!r&&!(g in o)&&(r=!0),n[g]=o[g];let v=Xt(g,o,e)??"undefined";p+="/"+v}else p+="/"+y}return t.endsWith("/")&&(p+="/"),{usedParams:n,interpolatedPath:p||"/",isMissingParams:r}}let a=t.length,c=0,u,d="";for(;c<a;){let f=c;u=Ye(t,f,u);let l=u[5];if(c=l+1,f===l)continue;let p=u[0];if(p===0){d+="/"+t.substring(f,l);continue}if(p===2){let h=o._splat;n._splat=h,n["*"]=h;let m=t.substring(f,u[1]),y=t.substring(u[4],l);if(!h){r=!0,(m||y)&&(d+="/"+m+y);continue}let g=Xt("_splat",o,e);d+="/"+m+g+y;continue}if(p===1){let h=t.substring(u[2],u[3]);!r&&!(h in o)&&(r=!0),n[h]=o[h];let m=t.substring(f,u[1]),y=t.substring(u[4],l),g=Xt(h,o,e)??"undefined";d+="/"+m+g+y;continue}if(p===3){let h=t.substring(u[2],u[3]),m=o[h];if(m==null)continue;n[h]=m;let y=t.substring(f,u[1]),g=t.substring(u[4],l),v=Xt(h,o,e)??"";d+="/"+y+v+g;continue}}return t.endsWith("/")&&(d+="/"),{usedParams:n,interpolatedPath:d||"/",isMissingParams:r}}i(me,"interpolatePath");function dr(t,o){let e=encodeURIComponent(t);return o?.(e)??e}i(dr,"encodePathParam");function A(t){return t?.isNotFound===!0}i(A,"isNotFound");function Is(){try{return sessionStorage}catch{return}}i(Is,"getSafeSessionStorage");var Es="tsr-scroll-restoration-v1_3",gr=Is();function ks(){try{return JSON.parse(gr?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}i(ks,"createScrollRestorationCache");function Ts(){try{gr?.setItem(Es,JSON.stringify(Bt))}catch{}}i(Ts,"persistScrollRestorationCache");var Bt=ks(),pr="data-scroll-restoration-id",Os=i(t=>t.state.__TSR_key||t.href,"defaultGetScrollRestorationKey");function Ns(t){let o=t.getAttribute(pr);if(o)return`[${pr}="${o}"]`;let e="",s=t,r;for(;r=s.parentNode;){let n=1,a=s;for(;a=a.previousElementSibling;)n++;let c=`${s.localName}:nth-child(${n})`;e=e?`${c} > ${e}`:c,s=r}return e}i(Ns,"getScrollRestorationSelector");var ge=!1,ve="window";function to(t){try{return typeof t=="function"?t():document.querySelector(t)}catch{}}i(to,"getElement");function mr(t){let o=new Set;for(let e of t){if(e===ve)continue;let s=to(e);s&&o.add(s)}return o}i(mr,"getScrollToTopElements");function vr(t,o){let e=o??t.options.scrollRestoration,s=t._scroll;if(e&&(s.restoring=!0),!1)return;let r=t.options.getScrollRestorationKey||Os,n=new Set,a=i(c=>{let u=Bt[c]||={};for(let d of n)d===document?u[ve]={scrollX,scrollY}:d.isConnected&&(u[Ns(d)]={scrollX:d.scrollLeft,scrollY:d.scrollTop})},"snapshotCurrentScrollTargets");e&&!s.restoration&&(s.restoration=!0,ge=!1,history.scrollRestoration="manual",document.addEventListener("scroll",c=>{ge||n.add(c.target)},!0),t.subscribe("onBeforeLoad",c=>{c.fromLocation&&a(r(c.fromLocation)),n.clear()}),addEventListener("pagehide",()=>{a(r(t.stores.resolvedLocation.get()??t.stores.location.get())),Ts()})),!s.reset&&(s.reset=!0,t.subscribe("onRendered",c=>{let u=t.options.scrollRestorationBehavior,d=t.options.scrollToTopSelectors,f=s.next,l=s.hash,p;if(n.clear(),s.next=!0,s.hash=!1,typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return;let h=r(c.toLocation),m=c.fromLocation&&r(c.fromLocation);if(s.restoring&&m&&m!==h){let y=Bt[m];if(y){let g=Bt[h];for(let v in y){if(v===ve){if(f)continue}else{let R=to(v);if(!R||f&&d&&(p??=mr(d),p.has(R)))continue}g||(g=Bt[h]={}),g[v]??=y[v]}}}ge=!0;try{let y=c.toLocation.hash,g=c.toLocation.state.__hashScrollIntoViewOptions??!0,v=!1;if(f){!y&&d&&(p??=mr(d));let R=y&&g&&l,S=s.restoring?Bt[h]:void 0;if(S)for(let P in S){let{scrollX:_,scrollY:b}=S[P];if(P===ve){if(R)continue;scrollTo({top:b,left:_,behavior:u}),v=!0}else{let x=to(P);x&&(x.scrollLeft=_,x.scrollTop=b,p?.delete(x))}}if(!y){let P={top:0,left:0,behavior:u};if(v||scrollTo(P),p)for(let _ of p)_.scrollTo(P)}}!v&&y&&g&&document.getElementById(y)?.scrollIntoView(g)}finally{ge=!1}}))}i(vr,"setupScrollRestoration");function yr(t,o=String){let e=new URLSearchParams;for(let s in t){let r=t[s];r!==void 0&&e.set(s,o(r))}return e.toString()}i(yr,"encode");function eo(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}i(eo,"toValue");function Rr(t){let o=new URLSearchParams(t),e=Object.create(null);for(let[s,r]of o.entries()){let n=e[s];n==null?e[s]=eo(r):Array.isArray(n)?n.push(eo(r)):e[s]=[n,eo(r)]}return e}i(Rr,"decode");var Sr=Ds(JSON.parse),Pr=Fs(JSON.stringify,JSON.parse);function Ds(t){return o=>{o[0]==="?"&&(o=o.substring(1));let e=Rr(o);for(let s in e){let r=e[s];if(typeof r=="string")try{e[s]=t(r)}catch{}}return e}}i(Ds,"parseSearchWith");function Fs(t,o){let e=typeof o=="function";function s(r){if(typeof r=="object"&&r!==null)try{return t(r)}catch{}else if(e&&typeof r=="string")try{return o(r),t(r)}catch{}return r}return i(s,"stringifyValue"),r=>{let n=yr(r,s);return n?`?${n}`:""}}i(Fs,"stringifySearchWith");var X="__root__";function $t(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}let o=new Headers(t.headers);t.href&&o.get("Location")===null&&o.set("Location",t.href);let e=new Response(null,{status:t.statusCode,headers:o});if(e.options=t,t.throw)throw e;return e}i($t,"redirect");function H(t){return t instanceof Response&&!!t.options}i(H,"isRedirect");function xr(t){return{input:i(({url:o})=>{for(let e of t)o=ye(e,o);return o},"input"),output:i(({url:o})=>{for(let e=t.length-1;e>=0;e--)o=oo(t[e],o);return o},"output")}}i(xr,"composeRewrites");function wr(t){let o=Qt(t.basepath),e=`/${o}`,s=t.caseSensitive?e:e.toLowerCase(),r=`${s}/`;return{input:i(({url:n})=>{let a=t.caseSensitive?n.pathname:n.pathname.toLowerCase();return a===s?n.pathname="/":a.startsWith(r)&&(n.pathname=n.pathname.slice(e.length)),n},"input"),output:i(({url:n})=>(n.pathname=Et(["/",o,n.pathname]),n),"output")}}i(wr,"rewriteBasepath");function ye(t,o){let e=t?.input?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}i(ye,"executeRewriteInput");function oo(t,o){let e=t?.output?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}i(oo,"executeRewriteOutput");function no(t){let o=t;return{get(){return o},set(e){o=Y(e,o)}}}i(no,"createNonReactiveMutableStore");function io(t){return{get(){return t()}}}i(io,"createNonReactiveReadonlyStore");function _r(t,o){let{createMutableStore:e,createReadonlyStore:s,batch:r,init:n}=o,a=new Map,c=new Map,u=new Map,d=e(t.status),f=e(t.loadedAt),l=e(t.isLoading),p=e(t.isTransitioning),h=e(t.location),m=e(t.resolvedLocation),y=e(t.statusCode),g=e(t.redirect),v=e([]),R=e([]),S=e([]),P=s(()=>ro(a,v.get())),_=s(()=>ro(c,R.get())),b=s(()=>ro(u,S.get())),x=s(()=>v.get()[0]),w=s(()=>v.get().some(tt=>a.get(tt)?.get().status==="pending")),C=s(()=>({locationHref:h.get().href,resolvedLocationHref:m.get()?.href,status:d.get()})),M=s(()=>({status:d.get(),loadedAt:f.get(),isLoading:l.get(),isTransitioning:p.get(),matches:P.get(),location:h.get(),resolvedLocation:m.get(),statusCode:y.get(),redirect:g.get()})),L=yt(64);function I(tt){let zt=L.get(tt);return zt||(zt=s(()=>{let Fo=v.get();for(let Ao of Fo){let ie=a.get(Ao);if(ie&&ie.routeId===tt)return ie.get()}}),L.set(tt,zt)),zt}i(I,"getRouteMatchStore");let rt={status:d,loadedAt:f,isLoading:l,isTransitioning:p,location:h,resolvedLocation:m,statusCode:y,redirect:g,matchesId:v,pendingIds:R,cachedIds:S,matches:P,pendingMatches:_,cachedMatches:b,firstId:x,hasPending:w,matchRouteDeps:C,matchStores:a,pendingMatchStores:c,cachedMatchStores:u,__store:M,getRouteMatchStore:I,setMatches:K,setPending:dt,setCached:ne};K(t.matches),n?.(rt);function K(tt){so(tt,a,v,e,r)}i(K,"setMatches");function dt(tt){so(tt,c,R,e,r)}i(dt,"setPending");function ne(tt){so(tt,u,S,e,r)}return i(ne,"setCached"),rt}i(_r,"createRouterStores");function ro(t,o){let e=[];for(let s of o){let r=t.get(s);r&&e.push(r.get())}return e}i(ro,"readPoolMatches");function so(t,o,e,s,r){let n=t.map(c=>c.id),a=new Set(n);r(()=>{for(let c of o.keys())a.has(c)||o.delete(c);for(let c of t){let u=o.get(c.id);if(!u){let d=s(c);d.routeId=c.routeId,o.set(c.id,d);continue}u.routeId=c.routeId,u.get()!==c&&u.set(c)}rr(e.get(),n)||e.set(n)})}i(so,"reconcileMatchPool");var ao=i(t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},"triggerOnReady"),As=i(t=>t.stores.matchesId.get().some(o=>t.stores.matchStores.get(o)?.get()._forcePending),"hasForcePendingActiveMatch"),Pe=i((t,o)=>!!(t.preload&&!t.router.stores.matchStores.has(o)),"resolvePreload"),kt=i((t,o,e=!0)=>{let s={...t.router.options.context??{}},r=e?o:o-1;for(let n=0;n<=r;n++){let a=t.matches[n];if(!a)continue;let c=t.router.getMatch(a.id);c&&Object.assign(s,c.__routeContext,c.__beforeLoadContext)}return s},"buildMatchContext"),Cr=i((t,o)=>{if(!t.matches.length)return;let e=o.routeId,s=t.matches.findIndex(a=>a.routeId===t.router.routeTree.id),r=s>=0?s:0,n=e?t.matches.findIndex(a=>a.routeId===e):t.firstBadMatchIndex??t.matches.length-1;n<0&&(n=r);for(let a=n;a>=0;a--){let c=t.matches[a];if(t.router.looseRoutesById[c.routeId].options.notFoundComponent)return a}return e?n:r},"getNotFoundBoundaryIndex"),xt=i((t,o,e)=>{if(!(!H(e)&&!A(e)))throw H(e)&&e.redirectHandled&&!e.options.reloadDocument||(o&&(o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.loaderPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,o._nonReactive.loaderPromise=void 0,o._nonReactive.error=e,t.updateMatch(o.id,s=>({...s,status:H(e)?"redirected":A(e)?"notFound":s.status==="pending"?"success":s.status,context:kt(t,o.index),isFetching:!1,error:e})),A(e)&&!e.routeId&&(e.routeId=o.routeId),o._nonReactive.loadPromise?.resolve()),H(e)&&(t.rendered=!0,e.options._fromLocation=t.location,e.redirectHandled=!0,e=t.router.resolveRedirect(e))),e},"handleRedirectAndNotFound"),Ir=i((t,o)=>{let e=t.router.getMatch(o);return!!(!e||!!1&&e._nonReactive.dehydrated||!1)},"shouldSkipLoader"),br=i((t,o,e)=>{let s=kt(t,e);t.updateMatch(o,r=>({...r,context:s}))},"syncMatchContext"),te=i((t,o,e)=>{let{id:s,routeId:r}=t.matches[o],n=t.router.looseRoutesById[r];if(e instanceof Promise)throw e;t.firstBadMatchIndex??=o,xt(t,t.router.getMatch(s),e);try{n.options.onError?.(e)}catch(a){e=a,xt(t,t.router.getMatch(s),e)}t.updateMatch(s,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:e,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!t.preload&&!H(e)&&!A(e)&&(t.serialError??=e)},"handleSerialError"),Bs=i((t,o,e,s)=>{let r=t.router.getMatch(o),n=t.matches[e-1]?.id,a=n?t.router.getMatch(n):void 0;if(t.router.isShell()){r.ssr=s.id===X;return}if(a?.ssr===!1){r.ssr=!1;return}let c=i(h=>h===!0&&a?.ssr==="data-only"?"data-only":h,"parentOverride"),u=t.router.options.defaultSsr??!0;if(s.options.ssr===void 0){r.ssr=c(u);return}if(typeof s.options.ssr!="function"){r.ssr=c(s.options.ssr);return}let{search:d,params:f}=r,l={search:Re(d,r.searchError),params:Re(f,r.paramsError),location:t.location,matches:t.matches.map(h=>({index:h.index,pathname:h.pathname,fullPath:h.fullPath,staticData:h.staticData,id:h.id,routeId:h.routeId,search:Re(h.search,h.searchError),params:Re(h.params,h.paramsError),ssr:h.ssr}))},p=s.options.ssr(l);if(vt(p))return p.then(h=>{r.ssr=c(h??u)});r.ssr=c(p??u)},"isBeforeLoadSsr"),Er=i((t,o,e,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;let r=e.options.pendingMs??t.router.options.defaultPendingMs;if(t.onReady&&!!1&&!Pe(t,o)&&(e.options.loader||e.options.beforeLoad||uo(e))&&typeof r=="number"&&r!==1/0&&(e.options.pendingComponent??t.router.options?.defaultPendingComponent)){let n=setTimeout(()=>{ao(t)},r);s._nonReactive.pendingTimeout=n}},"setupPendingTimeout"),$s=i((t,o,e)=>{let s=t.router.getMatch(o);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;Er(t,o,e,s);let r=i(()=>{let n=t.router.getMatch(o);n.preload&&(n.status==="redirected"||n.status==="notFound")&&xt(t,n,n.error)},"then");return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(r):r()},"preBeforeLoadSetup"),Us=i((t,o,e,s)=>{let r=t.router.getMatch(o),n=r._nonReactive.loadPromise;r._nonReactive.loadPromise=ct(()=>{n?.resolve(),n=void 0});let{paramsError:a,searchError:c}=r;a&&te(t,e,a),c&&te(t,e,c),Er(t,o,s,r);let u=new AbortController,d=!1,f=i(()=>{d||(d=!0,t.updateMatch(o,P=>({...P,isFetching:"beforeLoad",fetchCount:P.fetchCount+1,abortController:u})))},"pending"),l=i(()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,t.updateMatch(o,P=>({...P,isFetching:!1}))},"resolve");if(!s.options.beforeLoad){t.router.batch(()=>{f(),l()});return}r._nonReactive.beforeLoadPromise=ct();let p={...kt(t,e,!1),...r.__routeContext},{search:h,params:m,cause:y}=r,g=Pe(t,o),v={search:h,abortController:u,params:m,preload:g,context:p,location:t.location,navigate:i(P=>t.router.navigate({...P,_fromLocation:t.location}),"navigate"),buildLocation:t.router.buildLocation,cause:g?"preload":y,matches:t.matches,routeId:s.id,...t.router.options.additionalContext},R=i(P=>{if(P===void 0){t.router.batch(()=>{f(),l()});return}(H(P)||A(P))&&(f(),te(t,e,P)),t.router.batch(()=>{f(),t.updateMatch(o,_=>({..._,__beforeLoadContext:P})),l()})},"updateContext"),S;try{if(S=s.options.beforeLoad(v),vt(S))return f(),S.catch(P=>{te(t,e,P)}).then(R)}catch(P){f(),te(t,e,P)}R(S)},"executeBeforeLoad"),Hs=i((t,o)=>{let{id:e,routeId:s}=t.matches[o],r=t.router.looseRoutesById[s],n=i(()=>{if(!1){let u=Bs(t,e,o,r);if(vt(u))return u.then(c)}return c()},"serverSsr"),a=i(()=>Us(t,e,o,r),"execute"),c=i(()=>{if(Ir(t,e))return;let u=$s(t,e,r);return vt(u)?u.then(a):a()},"queueExecution");return n()},"handleBeforeLoad"),Vs=i((t,o,e)=>{let s=t.router.getMatch(o);if(!s||!e.options.head&&!e.options.scripts&&!e.options.headers)return;let r={ssr:t.router.options.ssr,matches:t.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([e.options.head?.(r),e.options.scripts?.(r),e.options.headers?.(r)]).then(([n,a,c])=>({meta:n?.meta,links:n?.links,headScripts:n?.scripts,headers:c,scripts:a,styles:n?.styles}))},"executeHead"),kr=i((t,o,e,s,r)=>{let n=o[s-1],{params:a,loaderDeps:c,abortController:u,cause:d}=t.router.getMatch(e),f=kt(t,s),l=Pe(t,e);return{params:a,deps:c,preload:!!l,parentMatchPromise:n,abortController:u,context:f,location:t.location,navigate:i(p=>t.router.navigate({...p,_fromLocation:t.location}),"navigate"),cause:l?"preload":d,route:r,...t.router.options.additionalContext}},"getLoaderContext"),Lr=i(async(t,o,e,s,r)=>{try{let n=t.router.getMatch(e);try{(!!1||n.ssr===!0)&&Ut(r);let a=r.options.loader,c=typeof a=="function"?a:a?.handler,u=c?.(kr(t,o,e,s,r)),d=!!c&&vt(u);if((d||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||n._nonReactive.minPendingPromise)&&t.updateMatch(e,l=>({...l,isFetching:"loader"})),c){let l=d?await u:u;xt(t,t.router.getMatch(e),l),l!==void 0&&t.updateMatch(e,p=>({...p,loaderData:l}))}r._lazyPromise&&await r._lazyPromise;let f=n._nonReactive.minPendingPromise;f&&await f,r._componentsPromise&&await r._componentsPromise,t.updateMatch(e,l=>({...l,error:void 0,context:kt(t,s),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let c=a;if(c?.name==="AbortError"){if(n.abortController.signal.aborted){n._nonReactive.loaderPromise?.resolve(),n._nonReactive.loaderPromise=void 0;return}t.updateMatch(e,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1,context:kt(t,s)}));return}let u=n._nonReactive.minPendingPromise;u&&await u,A(a)&&await r.options.notFoundComponent?.preload?.(),xt(t,t.router.getMatch(e),a);try{r.options.onError?.(a)}catch(d){c=d,xt(t,t.router.getMatch(e),d)}!H(c)&&!A(c)&&await Ut(r,["errorComponent"]),t.updateMatch(e,d=>({...d,error:c,context:kt(t,s),status:"error",isFetching:!1}))}}catch(n){let a=t.router.getMatch(e);a&&(a._nonReactive.loaderPromise=void 0),xt(t,a,n)}},"runLoader"),Ws=i(async(t,o,e)=>{async function s(h,m,y,g,v){let R=Date.now()-m.updatedAt,S=h?v.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:v.options.staleTime??t.router.options.defaultStaleTime??0,P=v.options.shouldReload,_=typeof P=="function"?P(kr(t,o,r,e,v)):P,{status:b,invalid:x}=g,w=R>=S&&(!!t.forceStaleReload||g.cause==="enter"||y!==void 0&&y!==g.id);a=b==="success"&&(x||(_??w)),h&&v.options.preload===!1||(a&&!t.sync&&f?(c=!0,(async()=>{try{await Lr(t,o,r,e,v);let C=t.router.getMatch(r);C._nonReactive.loaderPromise?.resolve(),C._nonReactive.loadPromise?.resolve(),C._nonReactive.loaderPromise=void 0,C._nonReactive.loadPromise=void 0}catch(C){H(C)&&await t.router.navigate(C.options)}})()):b!=="success"||a?await Lr(t,o,r,e,v):br(t,r,e))}i(s,"handleLoader");let{id:r,routeId:n}=t.matches[e],a=!1,c=!1,u=t.router.looseRoutesById[n],d=u.options.loader,f=((typeof d=="function"?void 0:d?.staleReloadMode)??t.router.options.defaultStaleReloadMode)!=="blocking";if(Ir(t,r)){if(!t.router.getMatch(r))return t.matches[e];if(br(t,r,e),!1)return t.router.getMatch(r)}else{let h=t.router.getMatch(r),m=t.router.stores.matchesId.get()[e],y=(m&&t.router.stores.matchStores.get(m)||null)?.routeId===n?m:t.router.stores.matches.get().find(v=>v.routeId===n)?.id,g=Pe(t,r);if(h._nonReactive.loaderPromise){if(h.status==="success"&&!t.sync&&!h.preload&&f)return h;await h._nonReactive.loaderPromise;let v=t.router.getMatch(r),R=v._nonReactive.error||v.error;R&&xt(t,v,R),v.status==="pending"&&await s(g,h,y,v,u)}else{let v=g&&!t.router.stores.matchStores.has(r),R=t.router.getMatch(r);R._nonReactive.loaderPromise=ct(),v!==R.preload&&t.updateMatch(r,S=>({...S,preload:v})),await s(g,h,y,R,u)}}let l=t.router.getMatch(r);c||(l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loadPromise?.resolve(),l._nonReactive.loadPromise=void 0),clearTimeout(l._nonReactive.pendingTimeout),l._nonReactive.pendingTimeout=void 0,c||(l._nonReactive.loaderPromise=void 0),l._nonReactive.dehydrated=void 0;let p=c?l.isFetching:!1;return p!==l.isFetching||l.invalid!==!1?(t.updateMatch(r,h=>({...h,isFetching:p,invalid:!1})),t.router.getMatch(r)):l},"loadRouteMatch");async function co(t){let o=t,e=[];!!1&&As(o.router)&&ao(o);let s;for(let p=0;p<o.matches.length;p++){try{let h=Hs(o,p);vt(h)&&await h}catch(h){if(H(h))throw h;if(A(h))s=h;else if(!o.preload)throw h;break}if(o.serialError||o.firstBadMatchIndex!=null)break}let r=o.firstBadMatchIndex??o.matches.length,n=s&&!o.preload?Cr(o,s):void 0,a=s&&o.preload?0:n!==void 0?Math.min(n+1,r):r,c,u;for(let p=0;p<a;p++)e.push(Ws(o,e,p));try{await Promise.all(e)}catch{let p=await Promise.allSettled(e);for(let h of p){if(h.status!=="rejected")continue;let m=h.reason;if(H(m))throw m;A(m)?c??=m:u??=m}if(u!==void 0)throw u}let d=c??(s&&!o.preload?s:void 0),f=o.firstBadMatchIndex!==void 0?o.firstBadMatchIndex:o.matches.length-1;if(!d&&s&&o.preload)return o.matches;if(d){let p=Cr(o,d);p===void 0&&$();let h=o.matches[p],m=o.router.looseRoutesById[h.routeId],y=o.router.options?.defaultNotFoundComponent;!m.options.notFoundComponent&&y&&(m.options.notFoundComponent=y),d.routeId=h.routeId;let g=h.routeId===o.router.routeTree.id;o.updateMatch(h.id,v=>({...v,...g?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:d},isFetching:!1})),f=p,await Ut(m,["notFoundComponent"])}else if(!o.preload){let p=o.matches[0];p.globalNotFound||o.router.getMatch(p.id)?.globalNotFound&&o.updateMatch(p.id,h=>({...h,globalNotFound:!1,error:void 0}))}if(o.serialError&&o.firstBadMatchIndex!==void 0){let p=o.router.looseRoutesById[o.matches[o.firstBadMatchIndex].routeId];await Ut(p,["errorComponent"])}for(let p=0;p<=f;p++){let{id:h,routeId:m}=o.matches[p],y=o.router.looseRoutesById[m];try{let g=Vs(o,h,y);if(g){let v=await g;o.updateMatch(h,R=>({...R,...v}))}}catch(g){console.error(`Error executing head for route ${m}:`,g)}}let l=ao(o);if(vt(l)&&await l,d)throw d;if(o.serialError&&!o.preload&&!o.onReady)throw o.serialError;return o.matches}i(co,"loadMatches");function Mr(t,o){let e=o.map(s=>t.options[s]?.preload?.()).filter(Boolean);if(e.length!==0)return Promise.all(e)}i(Mr,"preloadRouteComponents");function Ut(t,o=Se){!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(s=>{let{id:r,...n}=s.options;Object.assign(t.options,n),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0);let e=i(()=>t._componentsLoaded?void 0:o===Se?(()=>{if(t._componentsPromise===void 0){let s=Mr(t,Se);s?t._componentsPromise=s.then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0}):t._componentsLoaded=!0}return t._componentsPromise})():Mr(t,o),"runAfterLazy");return t._lazyPromise?t._lazyPromise.then(e):e()}i(Ut,"loadRouteChunk");function Re(t,o){return o?{status:"error",error:o}:{status:"success",value:t}}i(Re,"makeMaybe");function uo(t){for(let o of Se)if(t.options[o]?.preload)return!0;return!1}i(uo,"routeNeedsPreload");var Se=["component","errorComponent","pendingComponent","notFoundComponent"];var wt="__TSR_index",Tr="popstate",Or="beforeunload";function fo(t){let o=t.getLocation(),e=new Set,s=i(a=>{o=t.getLocation(),e.forEach(c=>c({location:o,action:a}))},"notify"),r=i(a=>{t.notifyOnIndexChange??!0?s(a):o=t.getLocation()},"handleIndexChange"),n=i(async({task:a,navigateOpts:c,...u})=>{if(c?.ignoreBlocker??!1){a();return}let d=t.getBlockers?.()??[],f=u.type==="PUSH"||u.type==="REPLACE";if(typeof document<"u"&&d.length&&f)for(let l of d){let p=Ht(u.path,u.state);if(await l.blockerFn({currentLocation:o,nextLocation:p,action:u.type})){t.onBlocked?.();return}}a()},"tryNavigation");return{get location(){return o},get length(){return t.getLength()},subscribers:e,subscribe:i(a=>(e.add(a),()=>{e.delete(a)}),"subscribe"),push:i((a,c,u)=>{let d=o.state[wt];c=lo(d+1,c),n({task:i(()=>{t.pushState(a,c),s({type:"PUSH"})},"task"),navigateOpts:u,type:"PUSH",path:a,state:c})},"push"),replace:i((a,c,u)=>{let d=o.state[wt];c=lo(d,c),n({task:i(()=>{t.replaceState(a,c),s({type:"REPLACE"})},"task"),navigateOpts:u,type:"REPLACE",path:a,state:c})},"replace"),go:i((a,c)=>{n({task:i(()=>{t.go(a),r({type:"GO",index:a})},"task"),navigateOpts:c,type:"GO"})},"go"),back:i(a=>{n({task:i(()=>{t.back(a?.ignoreBlocker??!1),r({type:"BACK"})},"task"),navigateOpts:a,type:"BACK"})},"back"),forward:i(a=>{n({task:i(()=>{t.forward(a?.ignoreBlocker??!1),r({type:"FORWARD"})},"task"),navigateOpts:a,type:"FORWARD"})},"forward"),canGoBack:i(()=>o.state[wt]!==0,"canGoBack"),createHref:i(a=>t.createHref(a),"createHref"),block:i(a=>{if(!t.setBlockers)return()=>{};let c=t.getBlockers?.()??[];return t.setBlockers([...c,a]),()=>{let u=t.getBlockers?.()??[];t.setBlockers?.(u.filter(d=>d!==a))}},"block"),flush:i(()=>t.flush?.(),"flush"),destroy:i(()=>t.destroy?.(),"destroy"),notify:s}}i(fo,"createHistory");function lo(t,o){o||(o={});let e=po();return{...o,key:e,__TSR_key:e,[wt]:t}}i(lo,"assignKeyAndIndex");function ho(t){let o=t?.window??(typeof document<"u"?window:void 0),e=o.history.pushState,s=o.history.replaceState,r=[],n=i(()=>r,"_getBlockers"),a=i(w=>r=w,"_setBlockers"),c=t?.createHref??(w=>w),u=t?.parseLocation??(()=>Ht(`${o.location.pathname}${o.location.search}${o.location.hash}`,o.history.state));if(!o.history.state?.__TSR_key&&!o.history.state?.key){let w=po();o.history.replaceState({[wt]:0,key:w,__TSR_key:w},"")}let d=u(),f,l=!1,p=!1,h=!1,m=!1,y=i(()=>d,"getLocation"),g,v,R=i(()=>{g&&(x._ignoreSubscribers=!0,(g.isPush?o.history.pushState:o.history.replaceState)(g.state,"",g.href),x._ignoreSubscribers=!1,g=void 0,v=void 0,f=void 0)},"flush"),S=i((w,C,M)=>{let L=c(C);v||(f=d),d=Ht(C,M),g={href:L,state:M,isPush:g?.isPush||w==="push"},v||(v=Promise.resolve().then(()=>R()))},"queueHistoryAction"),P=i(w=>{d=u(),x.notify({type:w})},"onPushPop"),_=i(async()=>{if(p){p=!1;return}let w=u(),C=w.state[wt]-d.state[wt],M=C===1,L=C===-1,I=!M&&!L||l;l=!1;let rt=I?"GO":L?"BACK":"FORWARD",K=I?{type:"GO",index:C}:{type:L?"BACK":"FORWARD"};if(h)h=!1;else{let dt=n();if(typeof document<"u"&&dt.length){for(let ne of dt)if(await ne.blockerFn({currentLocation:d,nextLocation:w,action:rt})){p=!0,o.history.go(1),x.notify(K);return}}}d=u(),x.notify(K)},"onPushPopEvent"),b=i(w=>{if(m){m=!1;return}let C=!1,M=n();if(typeof document<"u"&&M.length)for(let L of M){let I=L.enableBeforeUnload??!0;if(I===!0){C=!0;break}if(typeof I=="function"&&I()===!0){C=!0;break}}if(C)return w.preventDefault(),w.returnValue=""},"onBeforeUnload"),x=fo({getLocation:y,getLength:i(()=>o.history.length,"getLength"),pushState:i((w,C)=>S("push",w,C),"pushState"),replaceState:i((w,C)=>S("replace",w,C),"replaceState"),back:i(w=>(w&&(h=!0),m=!0,o.history.back()),"back"),forward:i(w=>{w&&(h=!0),m=!0,o.history.forward()},"forward"),go:i(w=>{l=!0,o.history.go(w)},"go"),createHref:i(w=>c(w),"createHref"),flush:R,destroy:i(()=>{o.history.pushState=e,o.history.replaceState=s,o.removeEventListener(Or,b,{capture:!0}),o.removeEventListener(Tr,_)},"destroy"),onBlocked:i(()=>{f&&d!==f&&(d=f)},"onBlocked"),getBlockers:n,setBlockers:a,notifyOnIndexChange:!1});return o.addEventListener(Or,b,{capture:!0}),o.addEventListener(Tr,_),o.history.pushState=function(...w){let C=e.apply(o.history,w);return x._ignoreSubscribers||P("PUSH"),C},o.history.replaceState=function(...w){let C=s.apply(o.history,w);return x._ignoreSubscribers||P("REPLACE"),C},x}i(ho,"createBrowserHistory");function js(t={initialEntries:["/"]}){let o=t.initialEntries,e=t.initialIndex?Math.min(Math.max(t.initialIndex,0),o.length-1):o.length-1,s=o.map((u,d)=>lo(d,void 0)),r=i(()=>Ht(o[e],s[e]),"getLocation"),n=[];return fo({getLocation:r,getLength:i(()=>o.length,"getLength"),pushState:i((u,d)=>{e<o.length-1&&(o.splice(e+1),s.splice(e+1)),s.push(d),o.push(u),e=Math.max(o.length-1,0)},"pushState"),replaceState:i((u,d)=>{s[e]=d,o[e]=u},"replaceState"),back:i(()=>{e=Math.max(e-1,0)},"back"),forward:i(()=>{e=Math.min(e+1,o.length-1)},"forward"),go:i(u=>{e=Math.min(Math.max(e+u,0),o.length-1)},"go"),createHref:i(u=>u,"createHref"),getBlockers:i(()=>n,"_getBlockers"),setBlockers:i(u=>n=u,"_setBlockers")})}i(js,"createMemoryHistory");function zs(t){let o=t.replace(/[\x00-\x1f\x7f]/g,"");return o.startsWith("//")&&(o="/"+o.replace(/^\/+/,"")),o}i(zs,"sanitizePath");function Ht(t,o){let e=zs(t),s=e.indexOf("#"),r=e.indexOf("?"),n=po();return{href:e,pathname:e.substring(0,s>0?r>0?Math.min(s,r):s:r>0?r:e.length),hash:s>-1?e.substring(s):"",search:r>-1?e.slice(r,s===-1?void 0:s):"",state:o||{[wt]:0,key:n,__TSR_key:n}}}i(Ht,"parseHref");function po(){return(Math.random()+1).toString(36).substring(7)}i(po,"createRandomKey");function ht(t,o){let e=o,s=t;return{fromLocation:e,toLocation:s,pathChanged:e?.pathname!==s.pathname,hrefChanged:e?.href!==s.href,hashChanged:e?.hash!==s.hash}}i(ht,"getLocationChangeInfo");var mo=class{static{i(this,"RouterCore")}constructor(t,o){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let s=this.options,r=this.basepath??s?.basepath??"/",n=this.basepath===void 0,a=s?.rewrite;if(this.options={...s,...e},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=hr(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=ho()),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 f;if(!1){let l=globalThis.__TSR_CACHE__;this.resolvePathCache=l.resolvePathCache,f=l.processRouteTreeResult}else this.resolvePathCache=yt(1e3),f=this.buildRouteTree(),!1;this.setRoutes(f)}if(!this.stores&&this.latestLocation){let f=this.getStoreConfig(this);this.batch=f.batch,this.stores=_r(Fr(this.latestLocation),f),vr(this)}let c=!1,u=this.options.basepath??"/",d=this.options.rewrite;if(n||r!==u||a!==d){this.basepath=u;let f=[],l=Qt(u);l&&l!=="/"&&f.push(wr({basepath:u})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:xr(f),this.history&&this.updateLatestLocation(),c=!0}c&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=lr(this.routeTree,this.options.caseSensitive,(s,r)=>{s.init({originalIndex:r})});return this.options.routeMasks&&ir(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,s)=>{let r={eventType:e,fn:s};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=e=>{this.subscribers.forEach(s=>{s.eventType===e.type&&s.fn(e)})},this.parseLocation=(e,s)=>{let r=i(({pathname:u,search:d,hash:f,href:l,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){let v=this.options.parseSearch(d),R=this.options.stringifySearch(v);return{href:u+R+f,publicHref:u+R+f,pathname:At(u).path,external:!1,searchStr:R,search:gt(s?.search,v),hash:At(f.slice(1)).path,state:at(s?.state,p)}}let h=new URL(l,this.origin),m=ye(this.rewrite,h),y=this.options.parseSearch(m.search),g=this.options.stringifySearch(y);return m.search=g,{href:m.href.replace(m.origin,""),publicHref:l,pathname:At(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:g,search:gt(s?.search,y),hash:At(m.hash.slice(1)).path,state:at(s?.state,p)}},"parse"),n=r(e),{__tempLocation:a,__tempKey:c}=n.state;if(a&&(!c||c===this.tempLocationKey)){let u=r(a);return u.state.key=n.state.key,u.state.__TSR_key=n.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:n}}return n},this.resolvePathWithBase=(e,s)=>Qe({base:e,to:s.includes("//")?Zt(s):s,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,s,r)=>typeof e=="string"?this.matchRoutesInternal({pathname:e,search:s},r):this.matchRoutesInternal(e,s),this.getMatchedRoutes=e=>Ar({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let s=this.getMatch(e);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let s=this.stores.matchStores.get(e)?.get();s&&(s.status==="pending"||s.isFetching==="loader")&&this.cancelMatch(e)})},this.buildLocation=e=>{let s=i((n={})=>{let a=n._fromLocation||this.pendingBuiltLocation||this.latestLocation,c=this.matchRoutesLightweight(a);n.from;let u=n.unsafeRelative==="path"?a.pathname:n.from??c.fullPath,d=n.to?`${n.to}`:void 0,f=c.search,l=Object.assign(Object.create(null),c.params),p=d?.charCodeAt(0)===47?"/":this.resolvePathWithBase(u,"."),h=d?this.resolvePathWithBase(p,d):p,m=n.params===!1||n.params===null?Object.create(null):(n.params??!0)===!0?l:Object.assign(l,Y(n.params,l)),y=this.routesByPath[Z(h)],g;if(y)g=this.getRouteBranch(y);else if(h.includes("$"))g=[];else{let L=this.getMatchedRoutes(h);g=L.matchedRoutes,this.options.notFoundRoute&&(!L.foundRoute||L.foundRoute.path!=="/"&&L.routeParams["**"])&&(g=[...g,this.options.notFoundRoute])}if(g.length&&mt(m))for(let L of g){let I=L.options.params?.stringify??L.options.stringifyParams;if(I)try{Object.assign(m,I(m))}catch{}}let v=e.leaveParams?h:At(me({path:h,params:m,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,R=f;if(e._includeValidateSearch&&this.options.search?.strict){let L={};g.forEach(I=>{if(I.options.validateSearch)try{Object.assign(L,xe(I.options.validateSearch,{...L,...R}))}catch{}}),R=L}R=Ks({search:R,dest:n,destRoutes:g,_includeValidateSearch:e._includeValidateSearch}),R=gt(f,R);let S=this.options.stringifySearch(R),P=n.hash===!0?a.hash:n.hash?Y(n.hash,a.hash):void 0,_=P?`#${P}`:"",b=n.state===!0?a.state:n.state?Y(n.state,a.state):{};b=at(a.state,b);let x=`${v}${S}${_}`,w,C,M=!1;if(this.rewrite){let L=new URL(x,this.origin),I=oo(this.rewrite,L);w=L.href.replace(L.origin,""),I.origin!==this.origin?(C=I.href,M=!0):C=I.pathname+I.search+I.hash}else w=or(x),C=w;return{publicHref:C,href:w,pathname:v,search:R,searchStr:S,state:b,hash:P??"",external:M,unmaskOnReload:n.unmaskOnReload}},"build"),r=i((n={},a)=>{let c=s(n),u=a?s(a):void 0;if(!u){let d=Object.create(null);if(this.options.routeMasks){let f=ar(c.pathname,this.processedTree);if(f){Object.assign(d,f.rawParams);let{from:l,params:p,...h}=f.route,m=p===!1||p===null?Object.create(null):(p??!0)===!0?d:Object.assign(d,Y(p,d));a={from:e.from,...h,params:m},u=s(a)}}}return u&&(c.maskedLocation=u),c},"buildWithMatches");return e.mask?r(e,{from:e.from,...e.mask}):r(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:s,...r})=>{let n,a=i(()=>{let d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(l=>{r.state[l]=this.latestLocation.state[l]});let f=st(r.state,this.latestLocation.state);return d.forEach(l=>{delete r.state[l]}),f},"isSameState"),c=Z(this.latestLocation.href)===Z(r.href),u=this.commitLocationPromise;if(this.commitLocationPromise=ct(()=>{u?.resolve(),u=void 0}),c&&a())this.load();else{let{maskedLocation:d,hashScrollIntoView:f,...l}=r;d&&(l={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...l,search:l.searchStr,state:{...l.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(l.unmaskOnReload??this.options.unmaskOnReload??!1)&&(l.state.__tempKey=this.tempLocationKey)),l.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,n=r.replace?"REPLACE":"PUSH",this.history[n==="REPLACE"?"replace":"push"](l.publicHref,l.state,{ignoreBlocker:s})}return this._scroll.next=r.resetScroll??!0,this.history.subscribers.size||this.load(n?{action:{type:n}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:s,hashScrollIntoView:r,viewTransition:n,ignoreBlocker:a,href:c,...u}={})=>{if(c){let l=this.history.location.state.__TSR_index,p=Ht(c,{__TSR_index:e?l:l+1}),h=new URL(p.pathname,this.origin);u.to=ye(this.rewrite,h).pathname,u.search=this.options.parseSearch(p.search),u.hash=p.hash.slice(1)}let d=this.buildLocation({...u,_includeValidateSearch:!0});this.pendingBuiltLocation=d;let f=this.commitLocation({...d,viewTransition:n,replace:e,resetScroll:s,hashScrollIntoView:r,ignoreBlocker:a});return queueMicrotask(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:e,reloadDocument:s,href:r,publicHref:n,...a})=>{let c=!1;if(r)try{new URL(`${r}`),c=!0}catch{}if(c&&!s&&(s=!0),s){if(e!==void 0||!r){let d=this.buildLocation({to:e,...a});r=r??d.publicHref,n=n??d.publicHref}let u=!c&&n?n:r;if(ut(u,this.protocolAllowlist))return;if(!a.ignoreBlocker){let d=this.history.getBlockers?.()??[];for(let f of d)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(u):window.location.href=u;return}return this.buildAndCommitLocation({...a,href:r,to:e,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),!1){let r=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==r.publicHref){let n=this.getParsedLocationHref(r);throw r.external?$t({href:n}):$t({href:n,_builtLocation:r})}}let e=this.matchRoutes(this.latestLocation),s=this.stores.cachedMatches.get().filter(r=>!e.some(n=>n.id===r.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(s)})},this.load=async e=>{let s=e?.action?.type,r,n,a,c=this.stores.resolvedLocation.get()??this.stores.location.get();for(a=new Promise(d=>{this.startTransition(async()=>{try{this.beforeLoad(),s&&(this._scroll.hash=s==="PUSH"||s==="REPLACE");let f=this.latestLocation,l=ht(f,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...l}),this.emit({type:"onBeforeLoad",...l}),await co({router:this,sync:e?.sync,forceStaleReload:c.href===f.href,matches:this.stores.pendingMatches.get(),location:f,updateMatch:this.updateMatch,onReady:i(async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=null,h=null,m=null,y=null;this.batch(()=>{let g=this.stores.pendingMatches.get(),v=g.length,R=this.stores.matches.get();p=v?R.filter(_=>!this.stores.pendingMatchStores.has(_.id)):null;let S=new Set;for(let _ of this.stores.pendingMatchStores.values())_.routeId&&S.add(_.routeId);let P=new Set;for(let _ of this.stores.matchStores.values())_.routeId&&P.add(_.routeId);h=v?R.filter(_=>!S.has(_.routeId)):null,m=v?g.filter(_=>!P.has(_.routeId)):null,y=v?g.filter(_=>P.has(_.routeId)):R,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),v&&(this.stores.setMatches(g),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...p.filter(_=>_.status!=="error"&&_.status!=="notFound"&&_.status!=="redirected")]),this.clearExpiredCache())});for(let[g,v]of[[h,"onLeave"],[m,"onEnter"],[y,"onStay"]])if(g)for(let R of g)this.looseRoutesById[R.routeId].options[v]?.(R)})})},"onReady")})}catch(f){H(f)?(r=f,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):A(f)&&(n=f);let l=r?r.status:n?404:this.stores.matches.get().some(p=>p.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(l),this.stores.redirect.set(r)})}this.latestLoadPromise===a&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),d()})}),this.latestLoadPromise=a,await a;this.latestLoadPromise&&a!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.stores.matches.get().some(d=>d.status==="error")&&(u=500),u!==void 0&&this.stores.statusCode.set(u)},this.startViewTransition=e=>{let s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof s=="object"&&this.isViewTransitionTypesSupported){let n=this.latestLocation,a=this.stores.resolvedLocation.get(),c=typeof s.types=="function"?s.types(ht(n,a)):s.types;if(c===!1){e();return}r={update:e,types:c}}else r=e;document.startViewTransition(r)}else e()},this.updateMatch=(e,s)=>{this.startTransition(()=>{let r=this.stores.pendingMatchStores.get(e);if(r){r.set(s);return}let n=this.stores.matchStores.get(e);if(n){n.set(s);return}let a=this.stores.cachedMatchStores.get(e);if(a){let c=s(a.get());c.status==="redirected"?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(u=>u.filter(d=>d!==e)):a.set(c)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let s=i(r=>e?.filter?.(r)??!0?{...r,invalid:!0,...e?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r,"invalidate");return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(s)),this.stores.setCached(this.stores.cachedMatches.get().map(s)),this.stores.setPending(this.stores.pendingMatches.get().map(s))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||"/",this.resolveRedirect=e=>{let s=e.headers.get("Location");if(!e.options.href||e.options._builtLocation){let r=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(r);e.options.href=n,e.headers.set("Location",n)}else if(s)try{let r=new URL(s);if(this.origin&&r.origin===this.origin){let n=r.pathname+r.search+r.hash;e.options.href=n,e.headers.set("Location",n)}}catch{}if(e.options.href&&!e.options._builtLocation&&ut(e.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return e.headers.get("Location")||e.headers.set("Location",e.options.href),e},this.clearCache=e=>{let s=e?.filter;s!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(r=>!s(r))):this.stores.setCached([])},this.clearExpiredCache=()=>{let e=Date.now(),s=i(r=>{let n=this.looseRoutesById[r.routeId];if(!n.options.loader)return!0;let a=(r.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:e-r.updatedAt>=a},"filter");this.clearCache({filter:s})},this.loadRouteChunk=Ut,this.preloadRoute=async e=>{let s=e._builtLocation??this.buildLocation(e),r=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:e}),n=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),a=new Set([...n,...this.stores.cachedIds.get()]),c=r.filter(u=>!a.has(u.id));if(c.length){let u=this.stores.cachedMatches.get();this.stores.setCached([...u,...c])}try{return r=await co({router:this,matches:r,location:s,preload:!0,updateMatch:i((u,d)=>{n.has(u)?r=r.map(f=>f.id===u?d(f):f):this.updateMatch(u,d)},"updateMatch")}),r}catch(u){if(H(u))return u.options.reloadDocument?void 0:await this.preloadRoute({...u.options,_fromLocation:s});A(u)||console.error(u);return}},this.matchRoute=(e,s)=>{let r={...e,to:e.to?this.resolvePathWithBase(e.from||"",e.to):void 0,params:e.params||{},leaveParams:!0},n=this.buildLocation(r);if(s?.pending&&this.stores.status.get()!=="pending")return!1;let a=(s?.pending===void 0?!this.stores.isLoading.get():s.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),c=cr(n.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,a.pathname,this.processedTree);return!c||e.params&&!st(c.rawParams,e.params,{partial:!0})?!1:s?.includeSearch??!0?st(a.search,n.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status==="notFound"||e.globalNotFound),this.getStoreConfig=o,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Pr,parseSearch:t.parseSearch??Sr,protocolAllowlist:t.protocolAllowlist??qe}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:t,routesByPath:o,processedTree:e}){this.routesById=t,this.routesByPath=o,this.processedTree=e;let s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}getRouteBranch(t){let o=this.routeBranchCache.get(t);return o||(o=Ze(t),this.routeBranchCache.set(t,o)),o}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,o){let e=this.getMatchedRoutes(t.pathname),{foundRoute:s,routeParams:r}=e,{matchedRoutes:n}=e,a=!1;(s?s.path!=="/"&&r["**"]:Z(t.pathname))&&(this.options.notFoundRoute?n=[...n,this.options.notFoundRoute]:a=!0);let c=a?Gs(this.options.notFoundMode,n):void 0,u=new Array(n.length),d=new Map;for(let f of this.stores.matchStores.values())f.routeId&&d.set(f.routeId,f.get());for(let f=0;f<n.length;f++){let l=n[f],p=u[f-1],h,m,y;{let I=p?.search??t.search,rt=p?._strictSearch??void 0;try{let K=xe(l.options.validateSearch,{...I})??void 0;h={...I,...K},m={...rt,...K},y=void 0}catch(K){let dt=K;if(K instanceof ee||(dt=new ee(K.message,{cause:K})),o?.throwOnError)throw dt;h=I,m={},y=dt}}let g=l.options.loaderDeps?.({search:h})??"",v=g?JSON.stringify(g):"",{interpolatedPath:R,usedParams:S}=me({path:l.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),P=l.id+R+v,_=this.getMatch(P),b=d.get(l.id),x=_?._strictParams??S,w;if(!_)try{Nr(l,x)}catch(I){if(A(I)||H(I)?w=I:w=new Dr(I.message,{cause:I}),o?.throwOnError)throw w}Object.assign(r,x);let C=b?"stay":"enter",M;if(_)M={..._,cause:C,params:b?.params??r,_strictParams:x,search:b?gt(b.search,h):gt(_.search,h),_strictSearch:m};else{let I=l.options.loader||l.options.beforeLoad||l.lazyFn||uo(l)?"pending":"success";M={id:P,ssr:l.options.ssr,index:f,routeId:l.id,params:b?.params??r,_strictParams:x,pathname:R,updatedAt:Date.now(),search:b?gt(b.search,h):h,_strictSearch:m,searchError:void 0,status:I,isFetching:!1,error:void 0,paramsError:w,__routeContext:void 0,_nonReactive:{loadPromise:ct()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:b?at(b.loaderDeps,g):g,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:l.options.staticData||{},fullPath:l.fullPath}}o?.preload||(M.globalNotFound=c===l.id),M.searchError=y;let L=this.getParentContext(p);M.context={...L,...M.__routeContext,...M.__beforeLoadContext},u[f]=M}for(let f=0;f<u.length;f++){let l=u[f],p=this.looseRoutesById[l.routeId],h=this.getMatch(l.id),m=d.get(l.routeId);if(l.params=m?gt(m.params,r):r,!h){let y=u[f-1],g=this.getParentContext(y);if(p.options.context){let v={deps:l.loaderDeps,params:l.params,context:g??{},location:t,navigate:i(R=>this.navigate({...R,_fromLocation:t}),"navigate"),buildLocation:this.buildLocation,cause:l.cause,abortController:l.abortController,preload:!!l.preload,matches:u,routeId:p.id};l.__routeContext=p.options.context(v)??void 0}l.context={...g,...l.__routeContext,...l.__beforeLoadContext}}}return u}matchRoutesLightweight(t){let o=pt(this.stores.matchesId.get()),e=this.lightweightCache.get(t);if(e&&e[0]===o)return e[1];let{matchedRoutes:s,routeParams:r}=this.getMatchedRoutes(t.pathname),n=pt(s),a={...t.search};for(let l of s)try{Object.assign(a,xe(l.options.validateSearch,a))}catch{}let c=o&&this.stores.matchStores.get(o)?.get(),u=c&&c.routeId===n.id&&c.pathname===t.pathname,d;if(u)d=c.params;else{let l=Object.assign(Object.create(null),r);for(let p of s)try{Nr(p,l)}catch{}d=l}let f={matchedRoutes:s,fullPath:n.fullPath,search:a,params:d};return this.lightweightCache.set(t,[o,f]),f}},ee=class extends Error{static{i(this,"SearchParamError")}},Dr=class extends Error{static{i(this,"PathParamError")}};function Fr(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],statusCode:200}}i(Fr,"getInitialRouterState");function xe(t,o){if(t==null)return{};if("~standard"in t){let e=t["~standard"].validate(o);if(e instanceof Promise)throw new ee("Async validation not supported");if(e.issues)throw new ee(JSON.stringify(e.issues,void 0,2),{cause:e});return e.value}return"parse"in t?t.parse(o):typeof t=="function"?t(o):{}}i(xe,"validateSearch");function Ar({pathname:t,routesById:o,processedTree:e}){let s=Object.create(null),r=Z(t),n,a=ur(r,e,!0);return a&&(n=a.route,Object.assign(s,a.rawParams)),{matchedRoutes:a?.branch||[o.__root__],routeParams:s,foundRoute:n}}i(Ar,"getMatchedRoutes");function Ks({search:t,dest:o,destRoutes:e,_includeValidateSearch:s}){return qs(e)(t,o,s??!1)}i(Ks,"applySearchMiddleware");function qs(t){let o,e,s=[];for(let n of t){let a=n.options;if("search"in a)a.search?.middlewares&&s.push(...a.search.middlewares);else if(a.preSearchFilters||a.postSearchFilters){let u=i(({search:d,next:f})=>{let l=f(a.preSearchFilters?a.preSearchFilters.reduce((p,h)=>h(p),d):d);return a.postSearchFilters?a.postSearchFilters.reduce((p,h)=>h(p),l):l},"legacyMiddleware");s.push(u)}let c=a.validateSearch;if(c){let u=i(({search:d,next:f,meta:l})=>{let p=f(d);if(e)try{let h=xe(c,p);if(l&&h)for(let m in h)m in p||(l.defaulted||=new Map).set(m,h[m]);return{...p,...h}}catch{}return p},"validate");s.push(u)}}let r=i((n,a,c)=>{if(n>=s.length){if(!o.search)return{};if(o.search===!0)return a;let d=Y(o.search,a);return c&&(c.explicit=d),d}let u=i((d,f)=>{if(f){let l=c||{};return{search:r(n+1,d,l),meta:l}}return r(n+1,d,c)},"next");return s[n]({search:a,next:u,meta:c})},"applyNext");return i(function(a,c,u){return o=c,e=u,r(0,a)},"middleware")}i(qs,"buildMiddlewareChain");function Gs(t,o){if(t!=="root")for(let e=o.length-1;e>=0;e--){let s=o[e];if(s.children)return s.id}return X}i(Gs,"findGlobalNotFoundRouteId");function Nr(t,o){let e=t.options.params?.parse??t.options.parseParams;if(e){let s=e(o);if(s===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(o,s)}}i(Nr,"extractStrictParams");var go="Error preloading route! \u261D\uFE0F";var we=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=o=>{this.originalIndex=o.originalIndex;let e=this.options,s=!e?.path&&!e?.id;this.parentRoute=this.options.getParentRoute?.(),s?this._path=X:this.parentRoute||$();let r=s?X:e?.path;r&&r!=="/"&&(r=he(r));let n=e?.id||r,a=s?X:Et([this.parentRoute.id==="__root__"?"":this.parentRoute.id,n]);r==="__root__"&&(r="/"),a!=="__root__"&&(a=Et(["/",a]));let c=a==="__root__"?"/":Et([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=c,this._to=Z(c)},this.addChildren=o=>this._addFileChildren(o),this._addFileChildren=o=>(Array.isArray(o)&&(this.children=o),typeof o=="object"&&o!==null&&(this.children=Object.values(o)),this),this._addFileTypes=()=>this,this.updateLoader=o=>(Object.assign(this.options,o),this),this.update=o=>(Object.assign(this.options,o),this),this.lazy=o=>(this.lazyFn=o,this),this.redirect=o=>$t({from:this.fullPath,...o}),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 vo=class extends we{static{i(this,"BaseRootRoute")}constructor(t){super(t)}};var Me=k(W(),1);var F=(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))(F||{});function Br({update:t,notify:o,unwatched:e}){return{link:s,unlink:r,propagate:n,checkDirty:a,shallowPropagate:c};function s(d,f,l){let p=f.depsTail;if(p!==void 0&&p.dep===d)return;let h=p!==void 0?p.nextDep:f.deps;if(h!==void 0&&h.dep===d){h.version=l,f.depsTail=h;return}let m=d.subsTail;if(m!==void 0&&m.version===l&&m.sub===f)return;let y=f.depsTail=d.subsTail={version:l,dep:d,sub:f,prevDep:p,nextDep:h,prevSub:m,nextSub:void 0};h!==void 0&&(h.prevDep=y),p!==void 0?p.nextDep=y:f.deps=y,m!==void 0?m.nextSub=y:d.subs=y}function r(d,f=d.sub){let l=d.dep,p=d.prevDep,h=d.nextDep,m=d.nextSub,y=d.prevSub;return h!==void 0?h.prevDep=p:f.depsTail=p,p!==void 0?p.nextDep=h:f.deps=h,m!==void 0?m.prevSub=y:l.subsTail=y,y!==void 0?y.nextSub=m:(l.subs=m)===void 0&&e(l),h}function n(d){let f=d.nextSub,l;t:do{let p=d.sub,h=p.flags;if(h&60?h&12?h&4?!(h&48)&&u(d,p)?(p.flags=h|40,h&=1):h=0:p.flags=h&-9|32:h=0:p.flags=h|32,h&2&&o(p),h&1){let m=p.subs;if(m!==void 0){let y=(d=m).nextSub;y!==void 0&&(l={value:f,prev:l},f=y);continue}}if((d=f)!==void 0){f=d.nextSub;continue}for(;l!==void 0;)if(d=l.value,l=l.prev,d!==void 0){f=d.nextSub;continue t}break}while(!0)}function a(d,f){let l,p=0,h=!1;t:do{let m=d.dep,y=m.flags;if(f.flags&16)h=!0;else if((y&17)===17){if(t(m)){let g=m.subs;g.nextSub!==void 0&&c(g),h=!0}}else if((y&33)===33){(d.nextSub!==void 0||d.prevSub!==void 0)&&(l={value:d,prev:l}),d=m.deps,f=m,++p;continue}if(!h){let g=d.nextDep;if(g!==void 0){d=g;continue}}for(;p--;){let g=f.subs,v=g.nextSub!==void 0;if(v?(d=l.value,l=l.prev):d=g,h){if(t(f)){v&&c(g),f=d.sub;continue}h=!1}else f.flags&=-33;f=d.sub;let R=d.nextDep;if(R!==void 0){d=R;continue t}}return h}while(!0)}function c(d){do{let f=d.sub,l=f.flags;(l&48)===32&&(f.flags=l|16,(l&6)===2&&o(f))}while((d=d.nextSub)!==void 0)}function u(d,f){let l=f.depsTail;for(;l!==void 0;){if(l===d)return!0;l=l.prevDep}return!1}}i(Br,"createReactiveSystem");function Hr(t,o,e){let s=typeof t=="object",r=s?t:void 0;return{next:(s?t.next:t)?.bind(r),error:(s?t.error:o)?.bind(r),complete:(s?t.complete:e)?.bind(r)}}i(Hr,"toObserver");var yo=[],Ce=0,{link:$r,unlink:Xs,propagate:Zs,checkDirty:Vr,shallowPropagate:Ur}=Br({update(t){return t._update()},notify(t){yo[Ro++]=t,t.flags&=~F.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=F.Mutable|F.Dirty,be(t))}}),_e=0,Ro=0,lt,So=0;function oe(t){try{++So,t()}finally{--So||Po()}}i(oe,"batch");function be(t){let o=t.depsTail,e=o!==void 0?o.nextDep:t.deps;for(;e!==void 0;)e=Xs(e,t)}i(be,"purgeDeps");function Po(){if(!(So>0)){for(;_e<Ro;){let t=yo[_e];yo[_e++]=void 0,t.notify()}_e=0,Ro=0}}i(Po,"flush");function Le(t,o){let e=typeof t=="function",s=t,r={_snapshot:e?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:e?F.None:F.Mutable,get(){return lt!==void 0&&$r(r,lt,Ce),r._snapshot},subscribe(n){let a=Hr(n),c={current:!1},u=Qs(()=>{r.get(),c.current?a.next?.(r._snapshot):c.current=!0});return{unsubscribe:i(()=>{u.stop()},"unsubscribe")}},_update(n){let a=lt,c=o?.compare??Object.is;if(e)lt=r,++Ce,r.depsTail=void 0;else if(n===void 0)return!1;e&&(r.flags=F.Mutable|F.RecursedCheck);try{let u=r._snapshot,d=typeof n=="function"?n(u):n===void 0&&e?s(u):n;return u===void 0||!c(u,d)?(r._snapshot=d,!0):!1}finally{lt=a,e&&(r.flags&=~F.RecursedCheck),be(r)}}};return e?(r.flags=F.Mutable|F.Dirty,r.get=function(){let n=r.flags;if(n&F.Dirty||n&F.Pending&&Vr(r.deps,r)){if(r._update()){let a=r.subs;a!==void 0&&Ur(a)}}else n&F.Pending&&(r.flags=n&~F.Pending);return lt!==void 0&&$r(r,lt,Ce),r._snapshot}):r.set=function(n){if(r._update(n)){let a=r.subs;a!==void 0&&(Zs(a),Ur(a),Po())}},r}i(Le,"createAtom");function Qs(t){let o=i(()=>{let s=lt;lt=e,++Ce,e.depsTail=void 0,e.flags=F.Watching|F.RecursedCheck;try{return t()}finally{lt=s,e.flags&=~F.RecursedCheck,be(e)}},"run"),e={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:F.Watching|F.RecursedCheck,notify(){let s=this.flags;s&F.Dirty||s&F.Pending&&Vr(this.deps,this)?o():this.flags=F.Watching},stop(){this.flags=F.None,this.depsTail=void 0,be(this)}};return o(),e}i(Qs,"effect");var xo=k(W(),1),Wr=k(Rs(),1);function tn(t,o){return t===o}i(tn,"defaultCompare");function B(t,o,e=tn){let s=(0,xo.useCallback)(a=>{if(!t)return()=>{};let{unsubscribe:c}=t.subscribe(a);return c},[t]),r=(0,xo.useCallback)(()=>t?.get(),[t]);return(0,Wr.useSyncExternalStoreWithSelector)(s,r,r,o,e)}i(B,"useStore");var wo={get(){},subscribe(){return{unsubscribe(){}}}};function _o(t,o){let e=Me.useRef();return s=>{let r=t?.select?t.select(s):s;return t?.structuralSharing??o.options.defaultStructuralSharing?e.current=at(e.current,r):r}}i(_o,"useStructuralSharing");function Q(t){let o=D(),e=Me.useContext(t.from?Yo:Mt),s=t.from?o.stores.getRouteMatchStore(t.from):o.stores.matchStores.get(e);if(!1){let a=s?.get();if(!a){(t.shouldThrow??!0)&&$();return}return t.select?t.select(a):a}let r=_o(t,o),n=B(s??wo,a=>a?r(a):wo);if(n!==wo)return n;(t.shouldThrow??!0)&&$()}i(Q,"useMatch");function Ie(t){return Q({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:i(o=>t.select?t.select(o.search):o.search,"select")})}i(Ie,"useSearch");var nt=k(W(),1);var Tt=typeof window<"u"?nt.useLayoutEffect:nt.useEffect;function Ee(t){let o=nt.useRef({value:t,prev:null}),e=o.current.value;return t!==e&&(o.current={value:t,prev:e}),o.current.prev}i(Ee,"usePrevious");function jr(t,o,e={},s={}){nt.useEffect(()=>{if(!t.current||s.disabled||typeof IntersectionObserver!="function")return;let r=new IntersectionObserver(([n])=>{o(n)},e);return r.observe(t.current),()=>{r.disconnect()}},[o,e,s.disabled,t])}i(jr,"useIntersectionObserver");function zr(t){let o=nt.useRef(null);return nt.useImperativeHandle(t,()=>o.current,[]),o}i(zr,"useForwardedRef");var Co=k(W(),1);function ke(t){let o=D();return Co.useCallback(e=>o.navigate({...e,from:e.from??t?.from}),[t?.from,o])}i(ke,"useNavigate");var Vt=k(W(),1),it=k(ot(),1);function Ot(t){let o=t.errorComponent??Nt;return(0,it.jsx)(en,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:i(({error:e,reset:s})=>e?Vt.createElement(o,{error:e,reset:s}):t.children,"children")})}i(Ot,"CatchBoundary");var en=class extends Vt.Component{static{i(this,"CatchBoundaryImpl")}constructor(...t){super(...t),this.state={error:null}}static getDerivedStateFromProps(t,o){let e=t.getResetKey();return o.error&&o.resetKey!==e?{resetKey:e,error:null}:{resetKey:e}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidCatch(t,o){this.props.onCatch&&this.props.onCatch(t,o)}render(){return this.props.children({error:this.state.error,reset:i(()=>{this.reset()},"reset")})}};function Nt({error:t}){let[o,e]=Vt.useState(!1);return(0,it.jsxs)("div",{style:{padding:".5rem",maxWidth:"100%"},children:[(0,it.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[(0,it.jsx)("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),(0,it.jsx)("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:i(()=>e(s=>!s),"onClick"),children:o?"Hide Error":"Show Error"})]}),(0,it.jsx)("div",{style:{height:".25rem"}}),o?(0,it.jsx)("div",{children:(0,it.jsx)("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?(0,it.jsx)("code",{children:t.message}):null})}):null]})}i(Nt,"ErrorComponent");var Te=k(W(),1),bo=k(ot(),1);function Kr({children:t,fallback:o=null}){return Lo()?(0,bo.jsx)(Te.default.Fragment,{children:t}):(0,bo.jsx)(Te.default.Fragment,{children:o})}i(Kr,"ClientOnly");function Lo(){return Te.default.useSyncExternalStore(on,()=>!0,()=>!1)}i(Lo,"useHydrated");function on(){return()=>{}}i(on,"subscribe");function Mo(t){return Q({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:i(o=>t.select?t.select(o.loaderData):o.loaderData,"select")})}i(Mo,"useLoaderData");function Io(t){let{select:o,...e}=t;return Q({...e,select:i(s=>o?o(s.loaderDeps):s.loaderDeps,"select")})}i(Io,"useLoaderDeps");function Eo(t){return Q({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:i(o=>{let e=t.strict===!1?o.params:o._strictParams;return t.select?t.select(e):e},"select")})}i(Eo,"useParams");function ko(t){return Q({...t,select:i(o=>t.select?t.select(o.context):o.context,"select")})}i(ko,"useRouteContext");var U=k(W(),1),rn=k(ot(),1);var Zr=k(ys(),1);function sn(t,o){let e=D(),s=zr(o),r=!1,{activeProps:n,inactiveProps:a,activeOptions:c,to:u,preload:d,preloadDelay:f,preloadIntentProximity:l,hashScrollIntoView:p,replace:h,startTransition:m,resetScroll:y,viewTransition:g,children:v,target:R,disabled:S,style:P,className:_,onClick:b,onBlur:x,onFocus:w,onMouseEnter:C,onMouseLeave:M,onTouchStart:L,ignoreBlocker:I,params:rt,search:K,hash:dt,state:ne,mask:tt,reloadDocument:zt,unsafeRelative:Fo,from:Ao,_fromLocation:ie,...Dt}=t;if(r){let O=Xr(u);if(typeof u=="string"&&!O&&u.indexOf(":")>-1)try{return new URL(u),ut(u,e.protocolAllowlist)?{...Dt,ref:s,href:void 0,...v&&{children:v},...R&&{target:R},...S&&{disabled:S},...P&&{style:P},..._&&{className:_}}:{...Dt,ref:s,href:u,...v&&{children:v},...R&&{target:R},...S&&{disabled:S},...P&&{style:P},..._&&{className:_}}}catch{}let T=e.buildLocation({...t,from:t.from}),et=Yr(T.maskedLocation?T.maskedLocation.publicHref:T.publicHref,T.maskedLocation?T.maskedLocation.external:T.external,e.history,S),Jt=(()=>{if(et?.external)return ut(et.href,e.protocolAllowlist)?void 0:et.href;if(!O&&typeof u=="string"&&u.indexOf(":")>-1)try{return new URL(u),ut(u,e.protocolAllowlist)?void 0:u}catch{}})(),Ve=(()=>{if(Jt)return!1;let V=e.stores.location.get(),G=c?.exact??!1;if(G){if(!pe(V.pathname,T.pathname,e.basepath))return!1}else{let j=Pt(V.pathname,e.basepath),J=Pt(T.pathname,e.basepath);if(!(j.startsWith(J)&&(j.length===J.length||j[J.length]==="/")))return!1}if((c?.includeSearch??!0)&&V.search!==T.search){let j=!V.search||typeof V.search=="object"&&!mt(V.search),J=!T.search||typeof T.search=="object"&&!mt(T.search);if(!(j&&J)&&!st(V.search,T.search,{partial:!G,ignoreUndefined:!c?.explicitUndefined}))return!1}return!c?.includeHash})();if(Jt)return{...Dt,ref:s,href:Jt,...v&&{children:v},...R&&{target:R},...S&&{disabled:S},...P&&{style:P},..._&&{className:_}};let We=Ve?Y(n,{})??qr:Wt,je=Ve?Wt:Y(a,{})??Wt,Ko=(()=>{let V=P,G=We.style,j=je.style;if(!(!V&&!G&&!j))return V&&!G&&!j?V:!V&&G&&!j?G:!V&&!G&&j?j:{...V,...G,...j}})(),qo=(()=>{let V=_,G=We.className,j=je.className;if(!V&&!G&&!j)return"";let J="";return V&&(J=V),G&&(J=J?`${J} ${G}`:G),j&&(J=J?`${J} ${j}`:j),J})();return{...Dt,...We,...je,href:et?.href,ref:s,disabled:!!S,target:R,...Ko&&{style:Ko},...qo&&{className:qo},...S&&Gr,...Ve&&Jr}}let $e=Lo(),Kt=U.useMemo(()=>t,[e,t.from,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),bt=B(e.stores.location,O=>O,(O,T)=>O.href===T.href),q=U.useMemo(()=>{let O={_fromLocation:bt,...Kt};return e.buildLocation(O)},[e,bt,Kt]),Bo=q.maskedLocation?q.maskedLocation.publicHref:q.publicHref,$o=q.maskedLocation?q.maskedLocation.external:q.external,qt=U.useMemo(()=>Yr(Bo,$o,e.history,S),[S,$o,Bo,e.history]),Gt=U.useMemo(()=>{if(qt?.external)return ut(qt.href,e.protocolAllowlist)?void 0:qt.href;if(!Xr(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),ut(u,e.protocolAllowlist)?void 0:u}catch{}},[u,qt,e.protocolAllowlist]),Ue=U.useMemo(()=>{if(Gt)return!1;if(c?.exact){if(!pe(bt.pathname,q.pathname,e.basepath))return!1}else{let O=Pt(bt.pathname,e.basepath),T=Pt(q.pathname,e.basepath);if(!(O.startsWith(T)&&(O.length===T.length||O[T.length]==="/")))return!1}return(c?.includeSearch??!0)&&!st(bt.search,q.search,{partial:!c?.exact,ignoreUndefined:!c?.explicitUndefined})?!1:c?.includeHash?$e&&bt.hash===q.hash:!0},[c?.exact,c?.explicitUndefined,c?.includeHash,c?.includeSearch,bt,Gt,$e,q.hash,q.pathname,q.search,e.basepath]),ae=Ue?Y(n,{})??qr:Wt,ce=Ue?Wt:Y(a,{})??Wt,Uo=[_,ae.className,ce.className].filter(Boolean).join(" "),Ho=(P||ae.style||ce.style)&&{...P,...ae.style,...ce.style},[ms,Vo]=U.useState(!1),Wo=U.useRef(!1),Ft=t.reloadDocument||Gt?!1:d??e.options.defaultPreload,He=f??e.options.defaultPreloadDelay??0,Lt=U.useCallback(()=>{e.preloadRoute({...Kt,_builtLocation:q}).catch(O=>{console.warn(O),console.warn(go)})},[e,Kt,q]);jr(s,U.useCallback(O=>{O?.isIntersecting&&Lt()},[Lt]),an,{disabled:!!S||Ft!=="viewport"}),U.useEffect(()=>{Wo.current||!S&&Ft==="render"&&(Lt(),Wo.current=!0)},[S,Lt,Ft]);let gs=i(O=>{let T=O.currentTarget.getAttribute("target"),et=R!==void 0?R:T;if(!S&&!cn(O)&&!O.defaultPrevented&&(!et||et==="_self")&&O.button===0){O.preventDefault(),(0,Zr.flushSync)(()=>{Vo(!0)});let Jt=e.subscribe("onResolved",()=>{Jt(),Vo(!1)});e.navigate({...Kt,replace:h,resetScroll:y,hashScrollIntoView:p,startTransition:m,viewTransition:g,ignoreBlocker:I})}},"handleClick");if(Gt)return{...Dt,ref:s,href:Gt,...v&&{children:v},...R&&{target:R},...S&&{disabled:S},...P&&{style:P},..._&&{className:_},...b&&{onClick:b},...x&&{onBlur:x},...w&&{onFocus:w},...C&&{onMouseEnter:C},...M&&{onMouseLeave:M},...L&&{onTouchStart:L}};let jo=i(O=>{if(S||Ft!=="intent")return;if(!He){Lt();return}let T=O.currentTarget;if(re.has(T))return;let et=setTimeout(()=>{re.delete(T),Lt()},He);re.set(T,et)},"enqueueIntentPreload"),vs=i(O=>{S||Ft!=="intent"||Lt()},"handleTouchStart"),zo=i(O=>{if(S||!Ft||!He)return;let T=O.currentTarget,et=re.get(T);et&&(clearTimeout(et),re.delete(T))},"handleLeave");return{...Dt,...ae,...ce,href:qt?.href,ref:s,onClick:jt([b,gs]),onBlur:jt([x,zo]),onFocus:jt([w,jo]),onMouseEnter:jt([C,jo]),onMouseLeave:jt([M,zo]),onTouchStart:jt([L,vs]),disabled:!!S,target:R,...Ho&&{style:Ho},...Uo&&{className:Uo},...S&&Gr,...Ue&&Jr,...$e&&ms&&nn}}i(sn,"useLinkProps");var Wt={},qr={className:"active"},Gr={role:"link","aria-disabled":!0},Jr={"data-status":"active","aria-current":"page"},nn={"data-transitioning":"transitioning"},re=new WeakMap,an={rootMargin:"100px"},jt=i(t=>o=>{for(let e of t)if(e){if(o.defaultPrevented)return;e(o)}},"composeHandlers");function Yr(t,o,e,s){if(!s)return o?{href:t,external:!0}:{href:e.createHref(t)||"/",external:!1}}i(Yr,"getHrefOption");function Xr(t){if(typeof t!="string")return!1;let o=t.charCodeAt(0);return o===47?t.charCodeAt(1)!==47:o===46}i(Xr,"isSafeInternal");var To=U.forwardRef((t,o)=>{let{_asChild:e,...s}=t,{type:r,...n}=sn(s,o),a=typeof s.children=="function"?s.children({isActive:n["data-status"]==="active"}):s.children;if(!e){let{disabled:c,...u}=n;return U.createElement("a",u,a)}return U.createElement(e,n,a)});function cn(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}i(cn,"isCtrlEvent");var Oo=k(W(),1),No=k(ot(),1);var Qr=class extends we{static{i(this,"Route")}constructor(t){super(t),this.useMatch=o=>Q({select:o?.select,from:this.id,structuralSharing:o?.structuralSharing}),this.useRouteContext=o=>ko({...o,from:this.id}),this.useSearch=o=>Ie({select:o?.select,structuralSharing:o?.structuralSharing,from:this.id}),this.useParams=o=>Eo({select:o?.select,structuralSharing:o?.structuralSharing,from:this.id}),this.useLoaderDeps=o=>Io({...o,from:this.id}),this.useLoaderData=o=>Mo({...o,from:this.id}),this.useNavigate=()=>ke({from:this.fullPath}),this.Link=Oo.default.forwardRef((o,e)=>(0,No.jsx)(To,{ref:e,from:this.fullPath,...o}))}};function un(t){return new Qr(t)}i(un,"createRoute");var ts=class extends vo{static{i(this,"RootRoute")}constructor(t){super(t),this.useMatch=o=>Q({select:o?.select,from:this.id,structuralSharing:o?.structuralSharing}),this.useRouteContext=o=>ko({...o,from:this.id}),this.useSearch=o=>Ie({select:o?.select,structuralSharing:o?.structuralSharing,from:this.id}),this.useParams=o=>Eo({select:o?.select,structuralSharing:o?.structuralSharing,from:this.id}),this.useLoaderDeps=o=>Io({...o,from:this.id}),this.useLoaderData=o=>Mo({...o,from:this.id}),this.useNavigate=()=>ke({from:this.fullPath}),this.Link=Oo.default.forwardRef((o,e)=>(0,No.jsx)(To,{ref:e,from:this.fullPath,...o}))}};function ln(t){return new ts(t)}i(ln,"createRootRoute");var Rc=k(W(),1),Oe=k(ot(),1);function es(t){let o=D();if(!1){let s=`not-found-${o.stores.location.get().pathname}-${o.stores.status.get()}`;return(0,Oe.jsx)(Ot,{getResetKey:i(()=>s,"getResetKey"),onCatch:i((r,n)=>{if(A(r))t.onCatch?.(r,n);else throw r},"onCatch"),errorComponent:i(({error:r})=>{if(A(r))return t.fallback?.(r);throw r},"errorComponent"),children:t.children})}let e=`not-found-${B(o.stores.location,s=>s.pathname)}-${B(o.stores.status,s=>s)}`;return(0,Oe.jsx)(Ot,{getResetKey:i(()=>e,"getResetKey"),onCatch:i((s,r)=>{if(A(s))t.onCatch?.(s,r);else throw s},"onCatch"),errorComponent:i(({error:s})=>{if(A(s))return t.fallback?.(s);throw s},"errorComponent"),children:t.children})}i(es,"CatchNotFound");function os(){return(0,Oe.jsx)("p",{children:"Not Found"})}i(os,"DefaultGlobalNotFound");var rs=k(ot(),1);function ss({children:t}){let o=D();return null}i(ss,"ScriptOnce");var bc=k(W(),1),Ne=k(ot(),1);function _t(t){return(0,Ne.jsx)(Ne.Fragment,{children:t.children})}i(_t,"SafeFragment");var Ec=k(W(),1),De=k(ot(),1);function Fe(t,o,e){return o.options.notFoundComponent?(0,De.jsx)(o.options.notFoundComponent,{...e}):t.options.defaultNotFoundComponent?(0,De.jsx)(t.options.defaultNotFoundComponent,{...e}):(0,De.jsx)(os,{})}i(Fe,"renderRouteNotFound");var is=k(ot(),1);function ns(t){return null}i(ns,"getScrollRestorationScriptForRouter");function as(){let t=ns(D());return t?(0,is.jsx)(ss,{children:t}):null}i(as,"ScrollRestoration");var z=k(W(),1),N=k(ot(),1);var fn=i((t,o)=>t.routeId===o.routeId&&t._displayPending===o._displayPending,"matchViewFieldsEqual"),dn=i((t,o)=>t[0]===o[0]&&t[1]===o[1],"outletMatchSelectionEqual"),Ae=z.memo(i(function({matchId:o}){let e=D();if(!1){let a=e.stores.matchStores.get(o)?.get();a||$();let c=a.routeId,u=e.routesById[c].parentRoute?.id;return(0,N.jsx)(cs,{router:e,matchId:o,resetKey:e.stores.loadedAt.get(),matchState:{routeId:c,ssr:a.ssr,_displayPending:a._displayPending,parentRouteId:u}})}let s=e.stores.matchStores.get(o);s||$();let r=B(e.stores.loadedAt,a=>a),n=B(s,a=>a,fn);return(0,N.jsx)(cs,{router:e,matchId:o,resetKey:r,matchState:z.useMemo(()=>{let a=n.routeId,c=e.routesById[a].parentRoute?.id;return{routeId:a,ssr:n.ssr,_displayPending:n._displayPending,parentRouteId:c}},[n._displayPending,n.routeId,n.ssr,e.routesById])})},"MatchImpl"));function cs({router:t,matchId:o,resetKey:e,matchState:s}){let r=t.routesById[s.routeId],n=r.options.pendingComponent??t.options.defaultPendingComponent,a=n?(0,N.jsx)(n,{}):null,c=r.options.errorComponent??t.options.defaultErrorComponent,u=r.options.onCatch??t.options.defaultOnCatch,d=r.isRoot?r.options.notFoundComponent??t.options.notFoundRoute?.options.component:r.options.notFoundComponent,f=s.ssr===!1||s.ssr==="data-only",l=(!r.isRoot||r.options.wrapInSuspense||f)&&(r.options.wrapInSuspense??n??(r.options.errorComponent?.preload||f))?z.Suspense:_t,p=c?Ot:_t,h=d?es:_t;return(0,N.jsxs)(r.isRoot?r.options.shellComponent??_t:_t,{children:[(0,N.jsx)(Mt.Provider,{value:o,children:(0,N.jsx)(l,{fallback:a,children:(0,N.jsx)(p,{getResetKey:i(()=>e,"getResetKey"),errorComponent:c||Nt,onCatch:i((m,y)=>{if(A(m))throw m.routeId??=s.routeId,m;u?.(m,y)},"onCatch"),children:(0,N.jsx)(h,{fallback:i(m=>{if(m.routeId??=s.routeId,!d||m.routeId&&m.routeId!==s.routeId||!m.routeId&&!r.isRoot)throw m;return z.createElement(d,m)},"fallback"),children:f||s._displayPending?(0,N.jsx)(Kr,{fallback:a,children:(0,N.jsx)(us,{matchId:o})}):(0,N.jsx)(us,{matchId:o})})})})}),s.parentRouteId===X?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(hn,{}),t.options.scrollRestoration&&!1?(0,N.jsx)(as,{}):null]}):null]})}i(cs,"MatchView");function hn(){let t=D();if(!1)return null;let o=z.useRef();return Tt(()=>{let e=t.stores.resolvedLocation.get(),s=o.current;e&&(!s||s.href!==e.href)&&t.emit({type:"onRendered",...ht(t.stores.location.get(),s??e)}),o.current=e},[B(t.stores.resolvedLocation,e=>e?.state.__TSR_key),t]),null}i(hn,"OnRendered");var us=z.memo(i(function({matchId:o}){let e=D(),s=i((f,l)=>e.getMatch(f.id)?._nonReactive[l]??f._nonReactive[l],"getMatchPromise");if(!1){let f=e.stores.matchStores.get(o)?.get();f||$();let l=f.routeId,p=e.routesById[l],h=(e.routesById[l].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:l,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch}),m=h?JSON.stringify(h):void 0,y=p.options.component??e.options.defaultComponent,g=y?(0,N.jsx)(y,{},m):(0,N.jsx)(Do,{});if(f._displayPending)throw s(f,"displayPendingPromise");if(f._forcePending)throw s(f,"minPendingPromise");if(f.status==="pending")throw s(f,"loadPromise");if(f.status==="notFound")return A(f.error)||$(),Fe(e,p,f.error);if(f.status==="redirected")throw H(f.error)||$(),s(f,"loadPromise");return f.status==="error"?(0,N.jsx)((p.options.errorComponent??e.options.defaultErrorComponent)||Nt,{error:f.error,reset:void 0,info:{componentStack:""}}):g}let r=e.stores.matchStores.get(o);r||$();let n=B(r,f=>f),a=n.routeId,c=e.routesById[a],u=z.useMemo(()=>{let f=(e.routesById[a].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:a,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return f?JSON.stringify(f):void 0},[a,n.loaderDeps,n._strictParams,n._strictSearch,e.options.defaultRemountDeps,e.routesById]),d=z.useMemo(()=>{let f=c.options.component??e.options.defaultComponent;return f?(0,N.jsx)(f,{},u):(0,N.jsx)(Do,{})},[u,c.options.component,e.options.defaultComponent]);if(n._displayPending)throw s(n,"displayPendingPromise");if(n._forcePending)throw s(n,"minPendingPromise");if(n.status==="pending"){let f=c.options.pendingMinMs??e.options.defaultPendingMinMs;if(f){let l=e.getMatch(n.id);if(l&&!l._nonReactive.minPendingPromise&&!!1){let p=ct();l._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),l._nonReactive.minPendingPromise=void 0},f)}}throw s(n,"loadPromise")}if(n.status==="notFound")return A(n.error)||$(),Fe(e,c,n.error);if(n.status==="redirected")throw H(n.error)||$(),s(n,"loadPromise");if(n.status==="error"){if(!1)return(0,N.jsx)((c.options.errorComponent??e.options.defaultErrorComponent)||Nt,{error:n.error,reset:void 0,info:{componentStack:""}});throw n.error}return d},"MatchInnerImpl")),Do=z.memo(i(function(){let o=D(),e=z.useContext(Mt),s,r=!1,n;if(!1){let d=o.stores.matches.get(),f=e?d.findIndex(p=>p.id===e):-1,l=f>=0?d[f]:void 0;s=l?.routeId,r=l?.globalNotFound??!1,n=f>=0?d[f+1]?.id:void 0}else{let d=e?o.stores.matchStores.get(e):void 0;[s,r]=B(d,f=>[f?.routeId,f?.globalNotFound??!1],dn),n=B(o.stores.matchesId,f=>f[f.findIndex(l=>l===e)+1])}let a=s?o.routesById[s]:void 0,c=o.options.defaultPendingComponent?(0,N.jsx)(o.options.defaultPendingComponent,{}):null;if(r)return a||$(),Fe(o,a,void 0);if(!n)return null;let u=(0,N.jsx)(Ae,{matchId:n});return s===X?(0,N.jsx)(z.Suspense,{fallback:c,children:u}):u},"OutletImpl"));var Ct=k(W(),1);function ls(){let t=D(),o=Ct.useRef({router:t,mounted:!1}),[e,s]=Ct.useState(!1),r=B(t.stores.isLoading,l=>l),n=B(t.stores.hasPending,l=>l),a=Ee(r),c=r||e||n,u=Ee(c),d=r||n,f=Ee(d);return t.startTransition=l=>{s(!0),Ct.startTransition(()=>{l(),s(!1)})},Ct.useEffect(()=>{let l=t.history.subscribe(t.load),p=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Z(t.latestLocation.publicHref)!==Z(p.publicHref)&&t.commitLocation({...p,replace:!0}),()=>{l()}},[t,t.history]),Tt(()=>{if(typeof window<"u"&&t.ssr||o.current.router===t&&o.current.mounted)return;o.current={router:t,mounted:!0},i(async()=>{try{await t.load()}catch(p){console.error(p)}},"tryLoad")()},[t]),Tt(()=>{a&&!r&&t.emit({type:"onLoad",...ht(t.stores.location.get(),t.stores.resolvedLocation.get())})},[a,t,r]),Tt(()=>{f&&!d&&t.emit({type:"onBeforeRouteMount",...ht(t.stores.location.get(),t.stores.resolvedLocation.get())})},[d,f,t]),Tt(()=>{if(u&&!c){let l=ht(t.stores.location.get(),t.stores.resolvedLocation.get());t.emit({type:"onResolved",...l}),oe(()=>{t.stores.status.set("idle"),t.stores.resolvedLocation.set(t.stores.location.get())})}},[c,u,t]),null}i(ls,"Transitioner");var Be=k(W(),1),ft=k(ot(),1);function fs(){let t=D(),o=t.routesById[X].options.pendingComponent??t.options.defaultPendingComponent,e=o?(0,ft.jsx)(o,{}):null,s=(0,ft.jsxs)(typeof document<"u"&&t.ssr?_t:Be.Suspense,{fallback:e,children:[!!1&&(0,ft.jsx)(ls,{}),(0,ft.jsx)(pn,{})]});return t.options.InnerWrap?(0,ft.jsx)(t.options.InnerWrap,{children:s}):s}i(fs,"Matches");function pn(){let t=D(),o=!1,e=o?t.stores.firstId.get():B(t.stores.firstId,n=>n),s=o?t.stores.loadedAt.get():B(t.stores.loadedAt,n=>n),r=e?(0,ft.jsx)(Ae,{matchId:e}):null;return(0,ft.jsx)(Mt.Provider,{value:e,children:t.options.disableGlobalCatchBoundary?r:(0,ft.jsx)(Ot,{getResetKey:i(()=>s,"getResetKey"),errorComponent:Nt,onCatch:void 0,children:r})})}i(pn,"MatchesInner");var ds=i(t=>({createMutableStore:Le,createReadonlyStore:Le,batch:oe}),"getStoreFactory");var mn=i(t=>new hs(t),"createRouter"),hs=class extends mo{static{i(this,"Router")}constructor(t){super(t,ds)}};var Lu=k(W(),1),se=k(ot(),1);function ps({router:t,children:o,...e}){mt(e)&&t.update({...t.options,...e,context:{...t.options.context,...e.context}});let s=(0,se.jsx)(ue.Provider,{value:t,children:o});return t.options.Wrap?(0,se.jsx)(t.options.Wrap,{children:s}):s}i(ps,"RouterContextProvider");function gn({router:t,...o}){return(0,se.jsx)(ps,{router:t,...o,children:(0,se.jsx)(fs,{})})}i(gn,"RouterProvider");function vn(t){let o=D({warn:t?.router===void 0}),e=t?.router||o;if(!1){let s=e.stores.__store.get();return t?.select?t.select(s):s}return B(e.stores.__store,_o(t,e))}i(vn,"useRouterState");export{ho as a,js as b,D as c,Ie as d,ke as e,un as f,ln as g,Do as h,mn as i,gn as j,vn as k};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as nt}from"./chunk-SFDOII3B.js";import{e as Ee}from"./chunk-SMIESS7P.js";import{c as Ue}from"./chunk-FXCBF4XT.js";import{b as Fe}from"./chunk-THIXMMZD.js";import{a as D}from"./chunk-VDW32UET.js";import{c as ke}from"./chunk-SHMNA6UL.js";import{f as We}from"./chunk-V2U5CL3S.js";import{a as Ye}from"./chunk-XQCVZAGU.js";import{a as T,e as He}from"./chunk-UZERI5YC.js";import{d as $,f as Qe,g as Xe,m as Se,n as et,o as tt,p as at}from"./chunk-OG4N2XHD.js";import{a as m,e as Ve,f as ct,g as dt,h as mt,j as Be}from"./chunk-3XIESWL4.js";var S=Ve(dt(),1);var L=Ve(ct(),1);var n=Ve(mt(),1);var ut=Qe(D.studioFeatures),it={analytics:!0,auth:!0,containers:!0,flags:!0,kv:!0,mail:!0,notifications:!0,payments:!0,queues:!0,scheduler:!0,storage:!0,vectors:!0,workflows:!0},pt=m(t=>{if(t===null||typeof t!="object")return it;let e=t,s=m(a=>typeof e[a]=="boolean"?e[a]:!0,"a");return{analytics:s("analytics"),auth:s("auth"),containers:s("containers"),flags:s("flags"),kv:s("kv"),mail:s("mail"),notifications:s("notifications"),payments:s("payments"),queues:s("queues"),scheduler:s("scheduler"),storage:s("storage"),vectors:s("vectors"),workflows:s("workflows")}},"ut"),ft=m(()=>{let t=(0,S.c)(3),e=We(),[s,a]=(0,L.useState)(it),r,l;return t[0]!==e?(r=m(()=>{Se((async()=>{try{a(pt(await e.query(ut,{},Xe(""))))}catch{}})())},"s"),l=[e],t[0]=e,t[1]=r,t[2]=l):(r=t[1],l=t[2]),(0,L.useEffect)(r,l),s},"pt"),ht=m(()=>{let t=(0,S.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),t[0]=e):e=t[0],e},"ft"),gt=m(t=>{let e=(0,S.c)(24),{group:s}=t,a=$(),r=Ee(),l;e[0]!==s.tab||e[1]!==r?(l=m(()=>{Se(r({to:`/${s.tab}`}))},"o"),e[0]=s.tab,e[1]=r,e[2]=l):l=e[2];let o=l,i=s.bindings.length,c;e[3]!==s.label?(c=(0,n.jsx)("span",{className:"text-sm font-medium text-foreground",children:s.label}),e[3]=s.label,e[4]=c):c=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=(0,n.jsx)(ht,{}),e[5]=p):p=e[5];let d;e[6]!==c?(d=(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[c,p]}),e[6]=c,e[7]=d):d=e[7];let f;e[8]!==i||e[9]!==a?(f=i===1?a("1 binding"):a("{count} bindings",{count:i}),e[8]=i,e[9]=a,e[10]=f):f=e[10];let u;e[11]!==f?(u=(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:f}),e[11]=f,e[12]=u):u=e[12];let h;e[13]!==i||e[14]!==s.bindings?(h=i>0&&(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:s.bindings.map(yt)}),e[13]=i,e[14]=s.bindings,e[15]=h):h=e[15];let g;e[16]!==d||e[17]!==u||e[18]!==h?(g=(0,n.jsxs)(He,{className:"flex flex-col gap-2 py-4",children:[d,u,h]}),e[16]=d,e[17]=u,e[18]=h,e[19]=g):g=e[19];let x;return e[20]!==s.testId||e[21]!==o||e[22]!==g?(x=(0,n.jsx)(T,{className:"cursor-pointer gap-0 py-0 transition-colors hover:bg-muted/40","data-testid":s.testId,onClick:o,children:g}),e[20]=s.testId,e[21]=o,e[22]=g,e[23]=x):x=e[23],x},"ht"),st=["kv","files","vectors"],xt=m((t,e)=>[...t.filter(s=>s.tab!==e.tab),e].toSorted((s,a)=>st.indexOf(s.tab)-st.indexOf(a.tab)),"gt"),bt=m(()=>{let t=(0,S.c)(19),e=We(),s=ft(),a=$(),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=[],t[0]=r):r=t[0];let[l,o]=(0,L.useState)(r),i,c;if(t[1]!==e||t[2]!==s.kv||t[3]!==s.storage||t[4]!==s.vectors||t[5]!==a?(i=m(()=>{let g={cancelled:!1},x=[{enabled:s.kv,label:a("KV Namespaces"),load:m(async()=>(await e.listKvNamespaces()).map(vt),"load"),tab:"kv",testId:"home-binding-kv"},{enabled:s.storage,label:a("R2 Buckets"),load:m(()=>e.listStorageBuckets(),"load"),tab:"files",testId:"home-binding-r2"},{enabled:s.vectors,label:a("Vectorize Indexes"),load:m(async()=>(await e.listVectorIndexes()).map(Nt),"load"),tab:"vectors",testId:"home-binding-vectors"}];for(let b of x)b.enabled&&Se((async()=>{try{let y=await b.load();if(!g.cancelled){let k={bindings:y,label:b.label,tab:b.tab,testId:b.testId};o(A=>xt(A,k))}}catch{}})());return()=>{g.cancelled=!0}},"i"),c=[e,s.kv,s.storage,s.vectors,a],t[1]=e,t[2]=s.kv,t[3]=s.storage,t[4]=s.vectors,t[5]=a,t[6]=i,t[7]=c):(i=t[6],c=t[7]),(0,L.useEffect)(i,c),l.length===0)return null;let p;t[8]!==a?(p=a("Bindings"),t[8]=a,t[9]=p):p=t[9];let d;t[10]!==p?(d=(0,n.jsx)("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:p}),t[10]=p,t[11]=d):d=t[11];let f;t[12]!==l?(f=l.map(_t),t[12]=l,t[13]=f):f=t[13];let u;t[14]!==f?(u=(0,n.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:f}),t[14]=f,t[15]=u):u=t[15];let h;return t[16]!==d||t[17]!==u?(h=(0,n.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"home-bindings",children:[d,u]}),t[16]=d,t[17]=u,t[18]=h):h=t[18],h},"xt");function yt(t){return(0,n.jsx)(Fe,{variant:"secondary",children:t},t)}m(yt,"bt");function vt(t){return t.binding}m(vt,"yt");function Nt(t){return t.name}m(Nt,"vt");function _t(t){return(0,n.jsx)(gt,{group:t},t.tab)}m(_t,"Nt");var St=[{name:"lunora_list_functions",summary:"list every query, mutation, and action with its path"},{name:"lunora_list_tables",summary:"list the schema's tables"},{name:"lunora_get_function_schema",summary:"read a function's argument JSON Schema before calling it"},{name:"lunora_run_query",summary:"run a read-only query"},{name:"lunora_run_mutation",summary:"run a mutation \u2014 writes; only when LUNORA_MCP_ALLOW_WRITES is set"},{name:"lunora_run_action",summary:"run an action \u2014 writes/effects; only when LUNORA_MCP_ALLOW_WRITES is set"}],kt=m(t=>JSON.stringify({mcpServers:{lunora:{args:["-y","@lunora/mcp"],command:"npx",env:{LUNORA_ADMIN_TOKEN:"<your-admin-token>",LUNORA_URL:t}}}},null,2),"St"),wt=m(t=>{let e=St.map(s=>`- ${s.name} \u2014 ${s.summary}`).join(`
|
|
2
|
+
`);return[`You have a Lunora MCP server connected to the deployment at ${t}.`,"It exposes this backend's functions and schema so you can inspect and operate it:",e,"",`Start by calling lunora_list_functions and lunora_list_tables to learn what exists, then lunora_get_function_schema before any run call. The full HTTP API is also documented at ${t}/_lunora/admin/openapi (that endpoint needs the same admin token the MCP server is configured with).`].join(`
|
|
3
|
+
`)},"kt"),Mt=1500,It=m(()=>{let t=(0,S.c)(35),e=$(),s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=et(),t[0]=s):s=t[0];let a=s,[r,l]=(0,L.useState)(null),o,i;t[1]!==r?(o=m(()=>{if(r===null)return;let C=globalThis.setTimeout(()=>{l(null)},Mt);return()=>{globalThis.clearTimeout(C)}},"l"),i=[r],t[1]=r,t[2]=o,t[3]=i):(o=t[2],i=t[3]),(0,L.useEffect)(o,i);let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=m((C,j)=>{tt(j)&&l(C)},"c"),t[4]=c):c=t[4];let p=c,d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=m(()=>{p("config",kt(a))},"d"),t[5]=d):d=t[5];let f=d,u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=m(()=>{p("prompt",wt(a))},"m"),t[6]=u):u=t[6];let h=u,g;t[7]!==e?(g=e("Connect an AI agent"),t[7]=e,t[8]=g):g=t[8];let x;t[9]!==g?(x=(0,n.jsx)("span",{className:"text-sm font-medium text-foreground",children:g}),t[9]=g,t[10]=x):x=t[10];let b;t[11]!==e?(b=e("Drive this deployment from an AI agent over the Model Context Protocol \u2014 it can list functions and tables, read schemas, and run read-only queries. Writes stay off unless you opt in."),t[11]=e,t[12]=b):b=t[12];let y;t[13]!==b?(y=(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:b}),t[13]=b,t[14]=y):y=t[14];let k;t[15]!==x||t[16]!==y?(k=(0,n.jsxs)("div",{className:"flex flex-col gap-1.5 p-4",children:[x,y]}),t[15]=x,t[16]=y,t[17]=k):k=t[17];let A;t[18]===Symbol.for("react.memo_cache_sentinel")?(A=(0,n.jsx)("code",{className:"font-mono text-xs text-muted-foreground","data-testid":"home-connect-agent-command",children:"npx -y @lunora/mcp"}),t[18]=A):A=t[18];let w;t[19]!==r||t[20]!==e?(w=e(r==="config"?"Copied":"Copy MCP config"),t[19]=r,t[20]=e,t[21]=w):w=t[21];let v;t[22]!==w?(v=(0,n.jsx)(Ue,{"data-testid":"home-connect-agent-copy-config",onClick:f,size:"xs",variant:"outline",children:w}),t[22]=w,t[23]=v):v=t[23];let M;t[24]!==r||t[25]!==e?(M=e(r==="prompt"?"Copied":"Copy agent prompt"),t[24]=r,t[25]=e,t[26]=M):M=t[26];let I;t[27]!==M?(I=(0,n.jsx)(Ue,{"data-testid":"home-connect-agent-copy-prompt",onClick:h,size:"xs",variant:"outline",children:M}),t[27]=M,t[28]=I):I=t[28];let N;t[29]!==v||t[30]!==I?(N=(0,n.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border bg-muted/50 px-4 py-3",children:[A,(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[v,I]})]}),t[29]=v,t[30]=I,t[31]=N):N=t[31];let _;return t[32]!==k||t[33]!==N?(_=(0,n.jsxs)(T,{className:"gap-0 py-0","data-testid":"home-connect-agent",children:[k,N]}),t[32]=k,t[33]=N,t[34]=_):_=t[34],_},"$t"),Lt=(0,L.lazy)(()=>import("./chunk-MV4A2PAK.js").then(t=>({default:t.Sparkline}))),Ze=m(t=>{if(t<1e3)return`${String(Math.round(t))}ms`;let e=t>=1e4?0:1;return`${(t/1e3).toFixed(e)}s`},"Be"),At=m((t,e)=>{let s=Math.max(0,Math.round((e-t)/1e3));if(s<60)return`${String(s)}s ago`;let a=Math.round(s/60);if(a<60)return`${String(a)}m ago`;let r=Math.round(a/60);return r<24?`${String(r)}h ago`:`${String(Math.round(r/24))}d ago`},"Mt"),rt=m((t,e)=>{if(t===void 0||t.length===0)return[];let s=new Map;for(let a of t)s.set(a.bucketMs,(s.get(a.bucketMs)??0)+a[e]);return[...s.entries()].toSorted(([a],[r])=>a-r).map(([,a])=>a)},"He"),lt=m((t,e=!0)=>{if(t.length<4)return null;let s=Math.floor(t.length/2),a=t.slice(0,s).reduce((o,i)=>o+i,0),r=t.slice(s).reduce((o,i)=>o+i,0);if(a===0)return null;let l=(r-a)/a*100;return{positive:e?l>=0:l<=0,text:`${l>=0?"+":""}${l.toFixed(1)}%`}},"Je"),qe=m(t=>{let e=(0,S.c)(24),{delta:s,footer:a,label:r,trend:l,unit:o,value:i}=t,c=$(),p;e[0]!==r?(p=(0,n.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r}),e[0]=r,e[1]=p):p=e[1];let d;e[2]!==i?(d=(0,n.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:i}),e[2]=i,e[3]=d):d=e[3];let f;e[4]!==o?(f=o!==void 0&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:o}),e[4]=o,e[5]=f):f=e[5];let u;e[6]!==d||e[7]!==f?(u=(0,n.jsxs)("span",{className:"flex items-baseline gap-1.5",children:[d,f]}),e[6]=d,e[7]=f,e[8]=u):u=e[8];let h;e[9]!==l?(h=l!==void 0&&(0,n.jsx)(L.Suspense,{fallback:(0,n.jsx)("div",{"aria-hidden":"true",className:"h-8 w-28"}),children:(0,n.jsx)(Lt,{data:l})}),e[9]=l,e[10]=h):h=e[10];let g;e[11]!==u||e[12]!==h?(g=(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[u,h]}),e[11]=u,e[12]=h,e[13]=g):g=e[13];let x;e[14]!==p||e[15]!==g?(x=(0,n.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[p,g]}),e[14]=p,e[15]=g,e[16]=x):x=e[16];let b;e[17]!==s||e[18]!==a||e[19]!==c?(b=s==null?a!=null&&(0,n.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:a}):(0,n.jsxs)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px]",children:[(0,n.jsx)("span",{className:Be("font-semibold",s.positive?"text-success":"text-destructive"),children:s.text})," ",(0,n.jsx)("span",{className:"text-muted-foreground",children:c("vs. prev.")})]}),e[17]=s,e[18]=a,e[19]=c,e[20]=b):b=e[20];let y;return e[21]!==x||e[22]!==b?(y=(0,n.jsxs)(T,{className:"justify-between gap-0 py-0",children:[x,b]}),e[21]=x,e[22]=b,e[23]=y):y=e[23],y},"Oe"),Ct=m(()=>{let t=(0,S.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"m9 6 6 6-6 6"})}),t[0]=e):e=t[0],e},"At"),Je=m(t=>{let e=(0,S.c)(7),{command:s,label:a}=t,r;e[0]!==a?(r=(0,n.jsx)("div",{className:"p-4",children:(0,n.jsx)("span",{className:"text-sm font-medium text-foreground",children:a})}),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==s?(l=(0,n.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5",children:(0,n.jsx)("code",{className:"font-mono text-xs text-muted-foreground",children:s})}),e[2]=s,e[3]=l):l=e[3];let o;return e[4]!==r||e[5]!==l?(o=(0,n.jsxs)(T,{className:"justify-between gap-0 py-0",children:[r,l]}),e[4]=r,e[5]=l,e[6]=o):o=e[6],o},"De"),ot=m(t=>{let e=(0,S.c)(18),{count:s,onView:a,testId:r,title:l}=t,o=$(),i;e[0]!==l?(i=(0,n.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l}),e[0]=l,e[1]=i):i=e[1];let c;e[2]!==s||e[3]!==o?(c=s===null?(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:o("No data yet")}):(0,n.jsx)(Fe,{variant:s>0?"destructive":"success",children:s>0?s:o("All clear")}),e[2]=s,e[3]=o,e[4]=c):c=e[4];let p;e[5]!==i||e[6]!==c?(p=(0,n.jsxs)("div",{className:"flex items-start justify-between gap-2 p-4",children:[i,c]}),e[5]=i,e[6]=c,e[7]=p):p=e[7];let d;e[8]!==o?(d=o("View"),e[8]=o,e[9]=d):d=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsx)(Ct,{}),e[10]=f):f=e[10];let u;e[11]!==a||e[12]!==d?(u=(0,n.jsxs)("button",{className:"flex items-center gap-1 border-t border-border bg-muted/50 px-4 py-2.5 text-[12px] font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:bg-muted",onClick:a,type:"button",children:[d,f]}),e[11]=a,e[12]=d,e[13]=u):u=e[13];let h;return e[14]!==p||e[15]!==u||e[16]!==r?(h=(0,n.jsxs)(T,{className:"justify-between gap-0 py-0","data-testid":r,children:[p,u]}),e[14]=p,e[15]=u,e[16]=r,e[17]=h):h=e[17],h},"Ge"),$t=m(t=>{let e=(0,S.c)(7),{functions:s}=t,a=$(),r;if(e[0]!==s||e[1]!==a){let l=[...s].toSorted(qt).slice(0,5),o;e[3]!==a?(o=a("Top functions"),e[3]=a,e[4]=o):o=e[4];let i;e[5]!==o?(i=(0,n.jsx)("div",{className:"border-b border-border px-4 py-3",children:(0,n.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:o})}),e[5]=o,e[6]=i):i=e[6],r=(0,n.jsxs)(T,{className:"gap-0 py-0","data-testid":"home-top-functions",children:[i,l.length===0?(0,n.jsx)("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:a("No functions called yet.")}):(0,n.jsxs)("div",{className:"divide-y divide-border",children:[(0,n.jsxs)("div",{className:"grid grid-cols-[1fr_auto_auto_auto] gap-4 px-4 py-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:[(0,n.jsx)("span",{children:a("Function")}),(0,n.jsx)("span",{className:"text-end",children:a("Calls")}),(0,n.jsx)("span",{className:"w-12 text-end",children:a("Avg")}),(0,n.jsx)("span",{className:"w-8 text-end",children:a("Err")})]}),l.map(Rt)]})]}),e[0]=s,e[1]=a,e[2]=r}else r=e[2];return r},"Ct"),jt=m(t=>{let e=(0,S.c)(26),{subs:s}=t,a=$(),r;e[0]!==a?(r=a("Live connections"),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==r?(l=(0,n.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r}),e[2]=r,e[3]=l):l=e[3];let o=s?.totalConnections??0,i;e[4]!==o?(i=o.toLocaleString(),e[4]=o,e[5]=i):i=e[5];let c;e[6]!==i?(c=(0,n.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:i}),e[6]=i,e[7]=c):c=e[7];let p;e[8]!==a?(p=a("sockets"),e[8]=a,e[9]=p):p=e[9];let d;e[10]!==p?(d=(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:p}),e[10]=p,e[11]=d):d=e[11];let f;e[12]!==c||e[13]!==d?(f=(0,n.jsxs)("span",{className:"flex items-baseline gap-1.5",children:[c,d]}),e[12]=c,e[13]=d,e[14]=f):f=e[14];let u=s?.totalSubscriptions??0,h;e[15]!==u?(h=u.toLocaleString(),e[15]=u,e[16]=h):h=e[16];let g;e[17]!==a?(g=a("active subscriptions"),e[17]=a,e[18]=g):g=e[18];let x;e[19]!==h||e[20]!==g?(x=(0,n.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[h," ",g]}),e[19]=h,e[20]=g,e[21]=x):x=e[21];let b;return e[22]!==x||e[23]!==l||e[24]!==f?(b=(0,n.jsx)(T,{"data-testid":"home-live-connections",children:(0,n.jsxs)(He,{className:"flex flex-col gap-2.5 py-4",children:[l,f,x]})}),e[22]=x,e[23]=l,e[24]=f,e[25]=b):b=e[25],b},"It"),Tt=m(t=>{let e=(0,S.c)(7),{entries:s}=t,a=$(),r;if(e[0]!==s||e[1]!==a){let l=Date.now(),o;e[3]!==a?(o=a("Recent activity"),e[3]=a,e[4]=o):o=e[4];let i;e[5]!==o?(i=(0,n.jsx)("div",{className:"border-b border-border px-4 py-3",children:(0,n.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:o})}),e[5]=o,e[6]=i):i=e[6],r=(0,n.jsxs)(T,{className:"gap-0 py-0","data-testid":"home-recent-activity",children:[i,s.length===0?(0,n.jsx)("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:a("No recent activity.")}):(0,n.jsx)("ul",{className:"divide-y divide-border",children:s.slice(0,5).map(c=>(0,n.jsxs)("li",{className:"flex items-center justify-between gap-3 px-4 py-2 text-[13px]",children:[(0,n.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"size-1.5 shrink-0 rounded-full bg-muted-foreground/40"}),(0,n.jsxs)("span",{className:"truncate text-foreground",children:[c.op,c.table!==void 0&&(0,n.jsxs)("span",{className:"text-muted-foreground",children:[" \xB7 ",c.table,c.id===void 0?"":`#${c.id}`]})]})]}),(0,n.jsx)("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:At(c.ts,l)})]},c.seq))})]}),e[0]=s,e[1]=a,e[2]=r}else r=e[2];return r},"jt"),Ot=m(t=>{let e=t.reduce((s,a)=>s+a.calls,0);return e===0?null:t.reduce((s,a)=>s+a.totalDurationMs,0)/e},"Tt"),Gt=m(t=>{let e=(0,S.c)(151),{initialShardKey:s}=t,a=$(),r=Ee(),l=s??"",o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={},e[0]=o):o=e[0];let i;e[1]!==l?(i={shardKey:l},e[1]=l,e[2]=i):i=e[2];let c=ke(D.getMetrics,o,i),p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={},e[3]=p):p=e[3];let d;e[4]!==l?(d={shardKey:l},e[4]=l,e[5]=d):d=e[5];let f=ke(D.getFunctionStats,p,d),u,h;e[6]===Symbol.for("react.memo_cache_sentinel")?(u={},h={shardKey:""},e[6]=u,e[7]=h):(u=e[6],h=e[7]);let g=ke(D.getSecurityAudit,u,h),x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x={},e[8]=x):x=e[8];let b;e[9]!==l?(b={shardKey:l},e[9]=l,e[10]=b):b=e[10];let y=ke(D.listSubscriptions,x,b),k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k={},e[11]=k):k=e[11];let A;e[12]!==l?(A={shardKey:l},e[12]=l,e[13]=A):A=e[13];let w=ke(D.getAuditLog,k,A),v=c.data??null,M,I,N,_,C,j,P,O,q,V,W,E,R,K,B,F,U,H;if(e[14]!==w.data||e[15]!==g.data||e[16]!==v||e[17]!==c.data||e[18]!==r||e[19]!==f.data||e[20]!==y.data||e[21]!==a){_=Array.isArray(f.data?.functions)?f.data.functions:[],P=y.data??null;let Le;e[40]!==w.data?(Le=Array.isArray(w.data?.entries)?w.data.entries:[],e[40]=w.data,e[41]=Le):Le=e[41],I=Le,C=c.data===void 0||f.data===void 0?null:nt(v,_).length,j=Array.isArray(g.data?.findings)?g.data.findings.length:null;let Ae;e[42]!==r?(Ae=m(()=>{Se(r({to:"/security"}))},"Me"),e[42]=r,e[43]=Ae):Ae=e[43],H=Ae;let Ce;e[44]!==r?(Ce=m(()=>{Se(r({to:"/insights"}))},"Ae"),e[44]=r,e[45]=Ce):Ce=e[45],U=Ce;let $e=rt(v?.history,"calls"),je=rt(v?.history,"errors"),Ge=Ot(_),Te=Math.max(0,..._.map(Kt)),z=v?.cache,Oe;e[46]!==z?(Oe=z!=null&&z.hits+z.misses>0?Math.round(z.hits/(z.hits+z.misses)*100):null,e[46]=z,e[47]=Oe):Oe=e[47],N=Oe,B="flex flex-col gap-6",F="lunora-home",W="grid gap-3 sm:grid-cols-2 xl:grid-cols-4",E="home-health";let Ke=lt($e),ye;e[48]!==a?(ye=a("Requests"),e[48]=a,e[49]=ye):ye=e[49];let ze=v?.requests??0,ve;e[50]!==ze?(ve=ze.toLocaleString(),e[50]=ze,e[51]=ve):ve=e[51],e[52]!==$e||e[53]!==Ke||e[54]!==ye||e[55]!==ve?(R=(0,n.jsx)(qe,{delta:Ke,label:ye,trend:$e,value:ve}),e[52]=$e,e[53]=Ke,e[54]=ye,e[55]=ve,e[56]=R):R=e[56];let De=lt(je,!1),Ne;e[57]!==a?(Ne=a("Errors"),e[57]=a,e[58]=Ne):Ne=e[58];let Pe=v?.errors??0,_e;e[59]!==Pe?(_e=Pe.toLocaleString(),e[59]=Pe,e[60]=_e):_e=e[60],e[61]!==je||e[62]!==De||e[63]!==Ne||e[64]!==_e?(K=(0,n.jsx)(qe,{delta:De,label:Ne,trend:je,value:_e}),e[61]=je,e[62]=De,e[63]=Ne,e[64]=_e,e[65]=K):K=e[65],M=qe,e[66]!==Te||e[67]!==a?(O=Te>0?`${a("max")} ${Ze(Te)}`:void 0,e[66]=Te,e[67]=a,e[68]=O):O=e[68],e[69]!==a?(q=a("Avg latency"),e[69]=a,e[70]=q):q=e[70],V=Ge===null?"\u2014":Ze(Ge),e[14]=w.data,e[15]=g.data,e[16]=v,e[17]=c.data,e[18]=r,e[19]=f.data,e[20]=y.data,e[21]=a,e[22]=M,e[23]=I,e[24]=N,e[25]=_,e[26]=C,e[27]=j,e[28]=P,e[29]=O,e[30]=q,e[31]=V,e[32]=W,e[33]=E,e[34]=R,e[35]=K,e[36]=B,e[37]=F,e[38]=U,e[39]=H}else M=e[22],I=e[23],N=e[24],_=e[25],C=e[26],j=e[27],P=e[28],O=e[29],q=e[30],V=e[31],W=e[32],E=e[33],R=e[34],K=e[35],B=e[36],F=e[37],U=e[38],H=e[39];let J;e[71]!==M||e[72]!==O||e[73]!==q||e[74]!==V?(J=(0,n.jsx)(M,{footer:O,label:q,value:V}),e[71]=M,e[72]=O,e[73]=q,e[74]=V,e[75]=J):J=e[75];let Z;e[76]!==N||e[77]!==a?(Z=N===null?void 0:`${String(N)}% ${a("cache hit")}`,e[76]=N,e[77]=a,e[78]=Z):Z=e[78];let G;e[79]!==a?(G=a("Database size"),e[79]=a,e[80]=G):G=e[80];let Re=v?.databaseSize??null,Y;e[81]!==Re?(Y=at(Re),e[81]=Re,e[82]=Y):Y=e[82];let Q;e[83]!==Z||e[84]!==G||e[85]!==Y?(Q=(0,n.jsx)(qe,{footer:Z,label:G,value:Y}),e[83]=Z,e[84]=G,e[85]=Y,e[86]=Q):Q=e[86];let X;e[87]!==W||e[88]!==E||e[89]!==R||e[90]!==K||e[91]!==J||e[92]!==Q?(X=(0,n.jsxs)("div",{className:W,"data-testid":E,children:[R,K,J,Q]}),e[87]=W,e[88]=E,e[89]=R,e[90]=K,e[91]=J,e[92]=Q,e[93]=X):X=e[93];let we;e[94]===Symbol.for("react.memo_cache_sentinel")?(we=(0,n.jsx)(bt,{}),e[94]=we):we=e[94];let ee;e[95]!==_?(ee=(0,n.jsx)("div",{className:"lg:col-span-2",children:(0,n.jsx)($t,{functions:_})}),e[95]=_,e[96]=ee):ee=e[96];let te;e[97]!==P?(te=(0,n.jsx)(jt,{subs:P}),e[97]=P,e[98]=te):te=e[98];let ae;e[99]!==I?(ae=(0,n.jsx)(Tt,{entries:I}),e[99]=I,e[100]=ae):ae=e[100];let ne;e[101]!==te||e[102]!==ae?(ne=(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[te,ae]}),e[101]=te,e[102]=ae,e[103]=ne):ne=e[103];let se;e[104]!==ee||e[105]!==ne?(se=(0,n.jsxs)("div",{className:"grid gap-3 lg:grid-cols-3",children:[ee,ne]}),e[104]=ee,e[105]=ne,e[106]=se):se=e[106];let re;e[107]!==a?(re=a("Advisors"),e[107]=a,e[108]=re):re=e[108];let le;e[109]!==re?(le=(0,n.jsx)("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:re}),e[109]=re,e[110]=le):le=e[110];let oe;e[111]!==C||e[112]!==j||e[113]!==a||e[114]!==U||e[115]!==H?(oe=j===0&&C===0?(0,n.jsx)(Ye,{description:a("No security or performance issues detected."),icon:(0,n.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{d:"M12 3 4 6v5c0 5 3.4 8.5 8 10 4.6-1.5 8-5 8-10V6l-8-3Z"}),(0,n.jsx)("path",{d:"m9 12 2 2 4-4"})]}),testId:"home-advisors-clear",title:a("No issues found")}):(0,n.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,n.jsx)(ot,{count:j,onView:H,testId:"home-security",title:a("Security findings")}),(0,n.jsx)(ot,{count:C,onView:U,testId:"home-performance",title:a("Performance issues")})]}),e[111]=C,e[112]=j,e[113]=a,e[114]=U,e[115]=H,e[116]=oe):oe=e[116];let ie;e[117]!==le||e[118]!==oe?(ie=(0,n.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"home-advisors",children:[le,oe]}),e[117]=le,e[118]=oe,e[119]=ie):ie=e[119];let ce;e[120]!==a?(ce=a("Get connected"),e[120]=a,e[121]=ce):ce=e[121];let de;e[122]!==ce?(de=(0,n.jsx)("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:ce}),e[122]=ce,e[123]=de):de=e[123];let me;e[124]!==a?(me=a("Client SDK"),e[124]=a,e[125]=me):me=e[125];let ue;e[126]!==me?(ue=(0,n.jsx)(Je,{command:"npm i @lunora/client",label:me}),e[126]=me,e[127]=ue):ue=e[127];let pe;e[128]!==a?(pe=a("React"),e[128]=a,e[129]=pe):pe=e[129];let fe;e[130]!==pe?(fe=(0,n.jsx)(Je,{command:"npm i @lunora/react",label:pe}),e[130]=pe,e[131]=fe):fe=e[131];let he;e[132]!==a?(he=a("CLI"),e[132]=a,e[133]=he):he=e[133];let ge;e[134]!==he?(ge=(0,n.jsx)(Je,{command:"lunora dev",label:he}),e[134]=he,e[135]=ge):ge=e[135];let xe;e[136]!==ue||e[137]!==fe||e[138]!==ge?(xe=(0,n.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[ue,fe,ge]}),e[136]=ue,e[137]=fe,e[138]=ge,e[139]=xe):xe=e[139];let Me;e[140]===Symbol.for("react.memo_cache_sentinel")?(Me=(0,n.jsx)(It,{}),e[140]=Me):Me=e[140];let be;e[141]!==de||e[142]!==xe?(be=(0,n.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"home-get-connected",children:[de,xe,Me]}),e[141]=de,e[142]=xe,e[143]=be):be=e[143];let Ie;return e[144]!==B||e[145]!==F||e[146]!==X||e[147]!==se||e[148]!==ie||e[149]!==be?(Ie=(0,n.jsxs)("div",{className:B,"data-testid":F,children:[X,we,se,ie,be]}),e[144]=B,e[145]=F,e[146]=X,e[147]=se,e[148]=ie,e[149]=be,e[150]=Ie):Ie=e[150],Ie},"Zt");function qt(t,e){return e.calls-t.calls}m(qt,"Ot");function Rt(t){return(0,n.jsxs)("div",{className:"grid grid-cols-[1fr_auto_auto_auto] items-center gap-4 px-4 py-2 text-[13px]",children:[(0,n.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:t.path}),(0,n.jsx)("span",{className:"text-end tabular-nums",children:t.calls.toLocaleString()}),(0,n.jsx)("span",{className:"w-12 text-end tabular-nums text-muted-foreground",children:Ze(t.calls>0?t.totalDurationMs/t.calls:0)}),(0,n.jsx)("span",{className:Be("w-8 text-end tabular-nums",t.errors>0?"text-destructive":"text-muted-foreground"),children:t.errors})]},t.path)}m(Rt,"Rt");function Kt(t){return t.maxDurationMs}m(Kt,"qt");export{ft as a,Gt as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ge,b as fe,c as xe,d as Ne,e as we}from"./chunk-UU2QJMGJ.js";import"./chunk-2PJNAWB3.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import{a as ce}from"./chunk-V53KNYRN.js";import{a as ue}from"./chunk-JN2Y24PY.js";import{a as q}from"./chunk-5Y3QLNWX.js";import{g as me,h as ve,i as pe,j as ye}from"./chunk-PB7FNRDB.js";import"./chunk-SP5SBO2W.js";import"./chunk-3C3CG7ZK.js";import"./chunk-I6A5C46N.js";import"./chunk-2QSHLBCO.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import"./chunk-HPFLBYRI.js";import"./chunk-ILNELDFC.js";import"./chunk-SFDOII3B.js";import"./chunk-SMIESS7P.js";import{R as ae}from"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{c as $}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as he}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import"./chunk-QLQADHFE.js";import"./chunk-VDW32UET.js";import"./chunk-SHMNA6UL.js";import{f as G}from"./chunk-V2U5CL3S.js";import"./chunk-XBDKZZ67.js";import{a as ke}from"./chunk-XQCVZAGU.js";import{a as se,b as ie,c as oe,d as Q,e as X,f as Y}from"./chunk-MIQTKZAR.js";import{a as re,e as ne}from"./chunk-UZERI5YC.js";import{d as R,h as Z,m as A,o as de,p as be}from"./chunk-OG4N2XHD.js";import"./chunk-XNGYYOLS.js";import{a as i,e as le,f as Oe,g as _e,h as De}from"./chunk-3XIESWL4.js";var B=le(Oe(),1);var ee=le(_e(),1);var a=le(De(),1);var Je=i(r=>{let e=r.trim();if(e==="")return;let d=Number(e);return Number.isFinite(d)&&d>0?Math.floor(d):void 0},"_e"),Le=i(r=>r===void 0?"\u2014":new Date(r*1e3).toISOString(),"Je"),Pe=i(r=>new TextEncoder().encode(r).length,"De"),Ee=i(r=>{if(r.trim()!=="")try{return JSON.stringify(JSON.parse(r),void 0,2)}catch{return}},"ge"),Fe=i(r=>{if(r.trim()==="")return!0;try{return JSON.parse(r),!0}catch{return!1}},"xe"),Ke=[{key:"seconds",seconds:1},{key:"minutes",seconds:60},{key:"hours",seconds:3600},{key:"days",seconds:86400}],Ce=i((r,e)=>{let d=r.trim();if(d==="")return"";let u=Number(d),s=Ke.find(v=>v.key===e)?.seconds??1;return Number.isFinite(u)&&u>0?String(Math.round(u*s)):d},"ue"),Ve=i(r=>{let e=r.trim();if(e==="")return!0;let d=Number(e);return Number.isInteger(d)&&d>=60},"Ce"),Te=i((r,e,d,u)=>{let s=Je(r.ttl);return{expiration:s===void 0?u:void 0,expirationTtl:s,key:e,metadata:r.metadata.trim()===""?void 0:JSON.parse(r.metadata),namespace:d,value:r.value}},"we"),Me=i(r=>{let e=(0,ee.c)(60),{helper:d,id:u,invalid:s,onChange:v,testId:o}=r,t=R(),[l,p]=(0,B.useState)(""),[c,x]=(0,B.useState)("seconds"),g;e[0]!==v||e[1]!==c?(g=i(f=>{p(f.target.value),v(Ce(f.target.value,c))},"b"),e[0]=v,e[1]=c,e[2]=g):g=e[2];let O=g,V;e[3]!==l||e[4]!==v?(V=i(f=>{f!==null&&(x(f),v(Ce(l,f)))},"E"),e[3]=l,e[4]=v,e[5]=V):V=e[5];let _=V,y;e[6]!==t?(y=t("days"),e[6]=t,e[7]=y):y=e[7];let m;e[8]!==t?(m=t("hours"),e[8]=t,e[9]=m):m=e[9];let h;e[10]!==t?(h=t("minutes"),e[10]=t,e[11]=h):h=e[11];let N;e[12]!==t?(N=t("seconds"),e[12]=t,e[13]=N):N=e[13];let w;e[14]!==y||e[15]!==m||e[16]!==h||e[17]!==N?(w={days:y,hours:m,minutes:h,seconds:N},e[14]=y,e[15]=m,e[16]=h,e[17]=N,e[18]=w):w=e[18];let C=w,b;e[19]!==t?(b=t("Expires after"),e[19]=t,e[20]=b):b=e[20];let S;e[21]!==u||e[22]!==b?(S=(0,a.jsx)(q,{className:"text-xs",htmlFor:u,children:b}),e[21]=u,e[22]=b,e[23]=S):S=e[23];let K;e[24]!==t?(K=t("No expiration"),e[24]=t,e[25]=K):K=e[25];let J;e[26]!==l||e[27]!==u||e[28]!==s||e[29]!==O||e[30]!==K||e[31]!==o?(J=(0,a.jsx)(ae,{"aria-invalid":s,className:"flex-1","data-testid":o,id:u,inputMode:"numeric",onChange:O,placeholder:K,value:l}),e[26]=l,e[27]=u,e[28]=s,e[29]=O,e[30]=K,e[31]=o,e[32]=J):J=e[32];let T;e[33]!==t?(T=t("TTL unit"),e[33]=t,e[34]=T):T=e[34];let P=`${o}-unit`,L;e[35]===Symbol.for("react.memo_cache_sentinel")?(L=(0,a.jsx)(fe,{}),e[35]=L):L=e[35];let M;e[36]!==T||e[37]!==P?(M=(0,a.jsx)(xe,{"aria-label":T,className:"w-[7.5rem]","data-testid":P,children:L}),e[36]=T,e[37]=P,e[38]=M):M=e[38];let n;e[39]!==C?(n=Ke.map(f=>(0,a.jsx)(we,{value:f.key,children:C[f.key]},f.key)),e[39]=C,e[40]=n):n=e[40];let k;e[41]!==n?(k=(0,a.jsx)(Ne,{children:n}),e[41]=n,e[42]=k):k=e[42];let E;e[43]!==_||e[44]!==M||e[45]!==k||e[46]!==c?(E=(0,a.jsxs)(ge,{onValueChange:_,value:c,children:[M,k]}),e[43]=_,e[44]=M,e[45]=k,e[46]=c,e[47]=E):E=e[47];let I;e[48]!==J||e[49]!==E?(I=(0,a.jsxs)("div",{className:"flex gap-2",children:[J,E]}),e[48]=J,e[49]=E,e[50]=I):I=e[50];let F;e[51]!==d||e[52]!==s||e[53]!==t||e[54]!==o?(F=s?(0,a.jsx)("p",{className:"text-xs text-destructive","data-testid":`${o}-invalid`,children:t("TTL must be at least 60 seconds.")}):d!==void 0&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:d}),e[51]=d,e[52]=s,e[53]=t,e[54]=o,e[55]=F):F=e[55];let D;return e[56]!==I||e[57]!==F||e[58]!==S?(D=(0,a.jsxs)("div",{className:"mb-3 grid gap-1",children:[S,I,F]}),e[56]=I,e[57]=F,e[58]=S,e[59]=D):D=e[59],D},"$e"),Ie=i(r=>{let e=(0,ee.c)(36),{id:d,invalidTestId:u,onChange:s,testId:v,valid:o,value:t}=r,l=R(),p;e[0]!==t?(p=Ee(t),e[0]=t,e[1]=p):p=e[1];let c=p,x;e[2]!==l?(x=l("Metadata (JSON)"),e[2]=l,e[3]=x):x=e[3];let g;e[4]!==d||e[5]!==x?(g=(0,a.jsx)(q,{className:"text-xs",htmlFor:d,children:x}),e[4]=d,e[5]=x,e[6]=g):g=e[6];let O=`${v}-format`,V=c===void 0,_;e[7]!==c||e[8]!==s?(_=i(()=>{c!==void 0&&s(c)},"O"),e[7]=c,e[8]=s,e[9]=_):_=e[9];let y;e[10]!==l?(y=l("Format JSON"),e[10]=l,e[11]=y):y=e[11];let m;e[12]!==O||e[13]!==V||e[14]!==_||e[15]!==y?(m=(0,a.jsx)($,{"data-testid":O,disabled:V,onClick:_,size:"sm",variant:"outline",children:y}),e[12]=O,e[13]=V,e[14]=_,e[15]=y,e[16]=m):m=e[16];let h;e[17]!==g||e[18]!==m?(h=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[g,m]}),e[17]=g,e[18]=m,e[19]=h):h=e[19];let N=!o,w;e[20]!==s?(w=i(K=>{s(K.target.value)},"N"),e[20]=s,e[21]=w):w=e[21];let C;e[22]!==d||e[23]!==N||e[24]!==w||e[25]!==v||e[26]!==t?(C=(0,a.jsx)(ce,{"aria-invalid":N,className:"min-h-[4rem] font-mono text-xs","data-testid":v,id:d,onChange:w,value:t}),e[22]=d,e[23]=N,e[24]=w,e[25]=v,e[26]=t,e[27]=C):C=e[27];let b;e[28]!==u||e[29]!==l||e[30]!==o?(b=!o&&(0,a.jsx)("p",{className:"text-xs text-destructive","data-testid":u,children:l("Metadata must be valid JSON.")}),e[28]=u,e[29]=l,e[30]=o,e[31]=b):b=e[31];let S;return e[32]!==C||e[33]!==b||e[34]!==h?(S=(0,a.jsxs)("div",{className:"mb-3 grid gap-1",children:[h,C,b]}),e[32]=C,e[33]=b,e[34]=h,e[35]=S):S=e[35],S},"Se"),Be={busy:!1,error:null,metadata:"",name:"",ttl:"",value:""},$e=i((r,e)=>{switch(e.type){case"setField":return{...r,[e.field]:e.value};case"submitFailed":return{...r,busy:!1,error:e.error};case"submitStart":return{...r,busy:!0,error:null};default:return r}},"Be"),je=i(r=>{let e=(0,ee.c)(73),{namespace:d,onCancel:u,onCreated:s}=r,v=G(),o=R(),[t,l]=(0,B.useReducer)($e,Be),p;e[0]!==t.metadata?(p=Fe(t.metadata),e[0]=t.metadata,e[1]=p):p=e[1];let c=p,x;e[2]!==t.ttl?(x=Ve(t.ttl),e[2]=t.ttl,e[3]=x):x=e[3];let g=x,O;e[4]!==c||e[5]!==t.busy||e[6]!==t.name||e[7]!==g?(O=t.name.trim()!==""&&c&&g&&!t.busy,e[4]=c,e[5]=t.busy,e[6]=t.name,e[7]=g,e[8]=O):O=e[8];let V=O,_;e[9]!==V||e[10]!==v||e[11]!==d||e[12]!==s||e[13]!==t.metadata||e[14]!==t.name||e[15]!==t.ttl||e[16]!==t.value?(_=i(()=>{V&&(l({type:"submitStart"}),A((async()=>{try{await v.putKvValue(Te({metadata:t.metadata,ttl:t.ttl,value:t.value},t.name,d)),s()}catch(z){l({error:Z(z),type:"submitFailed"})}})()))},"O"),e[9]=V,e[10]=v,e[11]=d,e[12]=s,e[13]=t.metadata,e[14]=t.name,e[15]=t.ttl,e[16]=t.value,e[17]=_):_=e[17];let y=_,m;e[18]!==o?(m=o("Key name"),e[18]=o,e[19]=m):m=e[19];let h;e[20]!==m?(h=(0,a.jsx)(q,{className:"text-xs",htmlFor:"kv-create-name",children:m}),e[20]=m,e[21]=h):h=e[21];let N;e[22]===Symbol.for("react.memo_cache_sentinel")?(N=i(z=>{l({field:"name",type:"setField",value:z.target.value})},"x"),e[22]=N):N=e[22];let w;e[23]!==o?(w=o("Key name"),e[23]=o,e[24]=w):w=e[24];let C;e[25]!==t.name||e[26]!==w?(C=(0,a.jsx)(ae,{autoFocus:!0,"data-testid":"kv-create-name",id:"kv-create-name",onChange:N,placeholder:w,value:t.name}),e[25]=t.name,e[26]=w,e[27]=C):C=e[27];let b;e[28]!==h||e[29]!==C?(b=(0,a.jsxs)("div",{className:"grid gap-1",children:[h,C]}),e[28]=h,e[29]=C,e[30]=b):b=e[30];let S;e[31]!==o?(S=o("Value"),e[31]=o,e[32]=S):S=e[32];let K;e[33]!==S?(K=(0,a.jsx)(q,{className:"text-xs",htmlFor:"kv-create-value",children:S}),e[33]=S,e[34]=K):K=e[34];let J;e[35]===Symbol.for("react.memo_cache_sentinel")?(J=i(z=>{l({field:"value",type:"setField",value:z.target.value})},"J"),e[35]=J):J=e[35];let T;e[36]!==t.value?(T=(0,a.jsx)(ce,{className:"min-h-[6rem] font-mono text-xs","data-testid":"kv-create-value",id:"kv-create-value",onChange:J,value:t.value}),e[36]=t.value,e[37]=T):T=e[37];let P;e[38]!==K||e[39]!==T?(P=(0,a.jsxs)("div",{className:"grid gap-1",children:[K,T]}),e[38]=K,e[39]=T,e[40]=P):P=e[40];let L=!g,M;e[41]===Symbol.for("react.memo_cache_sentinel")?(M=i(z=>{l({field:"ttl",type:"setField",value:z})},"M"),e[41]=M):M=e[41];let n;e[42]!==L?(n=(0,a.jsx)(Me,{id:"kv-create-ttl",invalid:L,onChange:M,testId:"kv-create-ttl"}),e[42]=L,e[43]=n):n=e[43];let k;e[44]===Symbol.for("react.memo_cache_sentinel")?(k=i(z=>{l({field:"metadata",type:"setField",value:z})},"h"),e[44]=k):k=e[44];let E;e[45]!==c||e[46]!==t.metadata?(E=(0,a.jsx)(Ie,{id:"kv-create-metadata",invalidTestId:"kv-create-metadata-invalid",onChange:k,testId:"kv-create-metadata",valid:c,value:t.metadata}),e[45]=c,e[46]=t.metadata,e[47]=E):E=e[47];let I=!V,F;e[48]!==t.busy||e[49]!==o?(F=t.busy?o("Creating\u2026"):o("Create key"),e[48]=t.busy,e[49]=o,e[50]=F):F=e[50];let D;e[51]!==y||e[52]!==I||e[53]!==F?(D=(0,a.jsx)($,{"data-testid":"kv-create-submit",disabled:I,onClick:y,children:F}),e[51]=y,e[52]=I,e[53]=F,e[54]=D):D=e[54];let f=t.busy,j;e[55]!==o?(j=o("Cancel"),e[55]=o,e[56]=j):j=e[56];let H;e[57]!==u||e[58]!==t.busy||e[59]!==j?(H=(0,a.jsx)($,{"data-testid":"kv-create-cancel",disabled:f,onClick:u,variant:"outline",children:j}),e[57]=u,e[58]=t.busy,e[59]=j,e[60]=H):H=e[60];let U;e[61]!==D||e[62]!==H?(U=(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[D,H]}),e[61]=D,e[62]=H,e[63]=U):U=e[63];let W;e[64]!==t.error?(W=t.error!==null&&(0,a.jsx)("p",{className:"text-sm text-destructive","data-testid":"kv-create-error",role:"alert",children:t.error}),e[64]=t.error,e[65]=W):W=e[65];let te;return e[66]!==b||e[67]!==P||e[68]!==n||e[69]!==E||e[70]!==U||e[71]!==W?(te=(0,a.jsxs)("div",{className:"grid gap-3 px-4 pb-4","data-testid":"kv-create-form",children:[b,P,n,E,U,W]}),e[66]=b,e[67]=P,e[68]=n,e[69]=E,e[70]=U,e[71]=W,e[72]=te):te=e[72],te},"Pe"),ze={busy:"",editedMetadata:"",editedTtl:"",editedValue:"",loadError:null,loading:!0,value:null,writeError:null},Ae=i((r,e)=>{switch(e.type){case"deleteStart":return{...r,busy:"deleting",writeError:null};case"editMetadata":return{...r,editedMetadata:e.value};case"editTtl":return{...r,editedTtl:e.value};case"editValue":return{...r,editedValue:e.value};case"loaded":return{...r,editedMetadata:e.metadata===null||e.metadata===void 0?"":JSON.stringify(e.metadata,null,2),editedValue:e.value??"",loading:!1,value:e.value};case"loadFailed":return{...r,loadError:e.error,loading:!1};case"saveOk":return{...r,busy:"",value:r.editedValue};case"saveStart":return{...r,busy:"saving",writeError:null};case"writeFailed":return{...r,busy:"",writeError:e.error};default:return r}},"Ae"),He=i(r=>{let e=(0,ee.c)(67),{expiration:d,keyName:u,namespace:s,onDeleted:v}=r,o=G(),t=R(),[l,p]=(0,B.useReducer)(Ae,ze),c,x;e[0]!==o||e[1]!==u||e[2]!==s?(c=i(()=>{let f={cancelled:!1};return A((async()=>{try{let j=await o.getKvValue({key:u,namespace:s});f.cancelled||p({metadata:j.metadata,type:"loaded",value:j.value})}catch(j){let H=j;f.cancelled||p({error:Z(H),type:"loadFailed"})}})()),()=>{f.cancelled=!0}},"o"),x=[o,s,u],e[0]=o,e[1]=u,e[2]=s,e[3]=c,e[4]=x):(c=e[3],x=e[4]),(0,B.useEffect)(c,x);let g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=i(f=>{p({type:"editValue",value:f.target.value})},"b"),e[5]=g):g=e[5];let O=g,V;e[6]===Symbol.for("react.memo_cache_sentinel")?(V=i(f=>{p({type:"editMetadata",value:f})},"E"),e[6]=V):V=e[6];let _=V,y;e[7]!==l.editedValue?(y=Ee(l.editedValue),e[7]=l.editedValue,e[8]=y):y=e[8];let m=y,h;e[9]!==l.editedMetadata?(h=Fe(l.editedMetadata),e[9]=l.editedMetadata,e[10]=h):h=e[10];let N=h,w;e[11]!==l.editedTtl?(w=Ve(l.editedTtl),e[11]=l.editedTtl,e[12]=w):w=e[12];let C=w,b;e[13]!==m?(b=i(()=>{m!==void 0&&p({type:"editValue",value:m})},"k"),e[13]=m,e[14]=b):b=e[14];let S=b,K;e[15]!==o||e[16]!==d||e[17]!==u||e[18]!==N||e[19]!==s||e[20]!==l.editedMetadata||e[21]!==l.editedTtl||e[22]!==l.editedValue||e[23]!==t?(K=i(()=>{if(!N){p({error:t("Metadata must be valid JSON."),type:"writeFailed"});return}p({type:"saveStart"}),A((async()=>{try{await o.putKvValue(Te({metadata:l.editedMetadata,ttl:l.editedTtl,value:l.editedValue},u,s,d)),p({type:"saveOk"})}catch(f){p({error:Z(f),type:"writeFailed"})}})())},"K"),e[15]=o,e[16]=d,e[17]=u,e[18]=N,e[19]=s,e[20]=l.editedMetadata,e[21]=l.editedTtl,e[22]=l.editedValue,e[23]=t,e[24]=K):K=e[24];let J=K,T;e[25]!==o||e[26]!==u||e[27]!==s||e[28]!==v?(T=i(()=>{p({type:"deleteStart"}),A((async()=>{try{await o.deleteKvKey({key:u,namespace:s}),v(u)}catch(f){p({error:Z(f),type:"writeFailed"})}})())},"V"),e[25]=o,e[26]=u,e[27]=s,e[28]=v,e[29]=T):T=e[29];let P=T,L;e[30]!==u?(L=i(()=>{de(u)},"D"),e[30]=u,e[31]=L):L=e[31];let M;e[32]!==t?(M=t("Copy key"),e[32]=t,e[33]=M):M=e[33];let n;e[34]!==L||e[35]!==M?(n=(0,a.jsx)("div",{className:"mb-2 flex justify-end",children:(0,a.jsx)($,{"data-testid":"kv-copy-key-btn",onClick:L,size:"sm",variant:"outline",children:M})}),e[34]=L,e[35]=M,e[36]=n):n=e[36];let k;e[37]!==l.loadError?(k=l.loadError!==null&&(0,a.jsx)("p",{className:"mb-2 text-sm text-destructive","data-testid":"kv-value-error",role:"alert",children:l.loadError}),e[37]=l.loadError,e[38]=k):k=e[38];let E;e[39]!==l.loading||e[40]!==t?(E=l.loading&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"kv-value-loading",children:t("Loading\u2026")}),e[39]=l.loading,e[40]=t,e[41]=E):E=e[41];let I;e[42]!==m||e[43]!==N||e[44]!==P||e[45]!==S||e[46]!==J||e[47]!==l.busy||e[48]!==l.editedMetadata||e[49]!==l.editedValue||e[50]!==l.loading||e[51]!==l.value||e[52]!==l.writeError||e[53]!==t||e[54]!==C?(I=!l.loading&&l.value!==null&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"mb-1 flex flex-wrap items-center gap-2",children:[(0,a.jsx)(q,{className:"text-xs",htmlFor:"kv-value-editor",children:t("Value")}),m!==void 0&&(0,a.jsx)(he,{variant:"secondary",children:t("JSON")}),(0,a.jsx)("span",{className:"ml-auto text-xs tabular-nums text-muted-foreground","data-testid":"kv-value-size",children:be(Pe(l.editedValue))})]}),(0,a.jsx)("textarea",{"aria-label":t("KV value"),className:"mb-2 min-h-[8rem] w-full rounded border border-border bg-muted/30 p-2 font-mono text-xs","data-testid":"kv-value-editor",id:"kv-value-editor",onChange:O,value:l.editedValue}),(0,a.jsxs)("div",{className:"mb-3 flex flex-wrap gap-2",children:[(0,a.jsx)($,{"data-testid":"kv-format-btn",disabled:m===void 0,onClick:S,size:"sm",variant:"outline",children:t("Format JSON")}),(0,a.jsx)($,{"data-testid":"kv-copy-value-btn",onClick:i(()=>{de(l.editedValue)},"onClick"),size:"sm",variant:"outline",children:t("Copy value")})]}),(0,a.jsx)(Me,{helper:t("Leave blank to keep the current expiration."),id:"kv-ttl-input",invalid:!C,onChange:i(f=>{p({type:"editTtl",value:f})},"onChange"),testId:"kv-ttl-input"}),(0,a.jsx)(Ie,{id:"kv-metadata-editor",invalidTestId:"kv-metadata-invalid",onChange:_,testId:"kv-metadata-editor",valid:N,value:l.editedMetadata}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)($,{"data-testid":"kv-save-btn",disabled:l.busy!==""||!N||!C,onClick:J,children:l.busy==="saving"?t("Saving\u2026"):t("Save")}),(0,a.jsx)($,{"data-testid":"kv-delete-btn",disabled:l.busy!=="",onClick:P,variant:"destructive",children:l.busy==="deleting"?t("Deleting\u2026"):t("Delete")})]}),l.writeError!==null&&(0,a.jsx)("p",{className:"mt-2 text-sm text-destructive","data-testid":"kv-save-error",role:"alert",children:l.writeError})]}),e[42]=m,e[43]=N,e[44]=P,e[45]=S,e[46]=J,e[47]=l.busy,e[48]=l.editedMetadata,e[49]=l.editedValue,e[50]=l.loading,e[51]=l.value,e[52]=l.writeError,e[53]=t,e[54]=C,e[55]=I):I=e[55];let F;e[56]!==l.loadError||e[57]!==l.loading||e[58]!==l.value||e[59]!==t?(F=!l.loading&&l.value===null&&l.loadError===null&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"kv-absent",children:t("Key is absent or has no value.")}),e[56]=l.loadError,e[57]=l.loading,e[58]=l.value,e[59]=t,e[60]=F):F=e[60];let D;return e[61]!==n||e[62]!==k||e[63]!==E||e[64]!==I||e[65]!==F?(D=(0,a.jsxs)("div",{className:"px-4 pb-4","data-testid":"kv-value-section",children:[n,k,E,I,F]}),e[61]=n,e[62]=k,e[63]=E,e[64]=I,e[65]=F,e[66]=D):D=e[66],D},"ze"),Se=100,Ze={appliedPrefix:"",bulk:[],bulkBusy:!1,bulkError:null,cursor:null,keys:null,listComplete:!1,loadError:null,loading:!1,prefixInput:"",reloadNonce:0,selectedKey:null},Re=i((r,e)=>{switch(e.type){case"appendPage":return{...r,cursor:e.cursor,keys:[...r.keys??[],...e.keys],listComplete:e.listComplete,loading:!1};case"applyFilter":return{...r,appliedPrefix:r.prefixInput,bulk:[],bulkError:null,cursor:null,keys:null,listComplete:!1,selectedKey:null};case"bulkDeleted":{let d=new Set(e.deleted);return{...r,bulk:r.bulk.filter(u=>!d.has(u)),bulkBusy:!1,bulkError:e.error,keys:r.keys===null?null:r.keys.filter(u=>!d.has(u.name)),selectedKey:r.selectedKey!==null&&d.has(r.selectedKey)?null:r.selectedKey}}case"bulkDeleteStart":return{...r,bulkBusy:!0,bulkError:null};case"firstPage":return{...r,cursor:e.cursor,keys:e.keys,listComplete:e.listComplete,loading:!1};case"keyDeleted":return{...r,bulk:r.bulk.filter(d=>d!==e.name),keys:r.keys===null?null:r.keys.filter(d=>d.name!==e.name),selectedKey:null};case"loadFailed":return{...r,loadError:e.error,loading:!1};case"loadStart":return{...r,loadError:null,loading:!0};case"prefixInput":return{...r,prefixInput:e.value};case"reload":return{...r,bulk:[],bulkError:null,reloadNonce:r.reloadNonce+1,selectedKey:null};case"selectKey":return{...r,selectedKey:e.name};case"toggleAllBulk":return{...r,bulk:e.names};case"toggleBulk":return{...r,bulk:r.bulk.includes(e.name)?r.bulk.filter(d=>d!==e.name):[...r.bulk,e.name]};default:return r}},"Re"),Ue=i(({namespace:r})=>{let e=G(),d=R(),[u,s]=(0,B.useReducer)(Re,Ze),{appliedPrefix:v,bulk:o,bulkBusy:t,bulkError:l,cursor:p,keys:c,listComplete:x,loadError:g,loading:O,prefixInput:V,reloadNonce:_,selectedKey:y}=u,[m,h]=(0,B.useState)(!1);(0,B.useEffect)(()=>{let n={cancelled:!1};return A((async()=>{s({type:"loadStart"});try{let k=await e.listKvKeys({limit:Se,namespace:r,prefix:v===""?void 0:v});n.cancelled||s({cursor:k.cursor??null,keys:k.keys,listComplete:k.listComplete,type:"firstPage"})}catch(k){n.cancelled||s({error:Z(k),type:"loadFailed"})}})()),()=>{n.cancelled=!0}},[e,r,v,_]);let N=i(n=>{s({type:"prefixInput",value:n.target.value})},"x"),w=i(()=>{s({type:"applyFilter"})},"N"),C=i(n=>{s({name:n.currentTarget.dataset.key??null,type:"selectKey"})},"C"),b=i(()=>{p!==null&&(s({type:"loadStart"}),A((async()=>{try{let n=await e.listKvKeys({cursor:p,limit:Se,namespace:r,prefix:v===""?void 0:v});s({cursor:n.cursor??null,keys:n.keys,listComplete:n.listComplete,type:"appendPage"})}catch(n){s({error:Z(n),type:"loadFailed"})}})()))},"k"),S=i(n=>{s({name:n,type:"keyDeleted"})},"w"),K=i(n=>{s({name:n,type:"toggleBulk"})},"K"),J=i(n=>{s({names:n&&c!==null?c.map(k=>k.name):[],type:"toggleAllBulk"})},"J"),T=i(()=>{if(o.length===0)return;let n=[...o];s({type:"bulkDeleteStart"}),A((async()=>{let k=await Promise.allSettled(n.map(F=>e.deleteKvKey({key:F,namespace:r}))),E=n.filter((F,D)=>k[D]?.status==="fulfilled"),I=n.length-E.length;s({deleted:E,error:I>0?d("Failed to delete {count} keys.",{count:I}):null,type:"bulkDeleted"})})())},"V"),P=i(()=>{h(!1),s({type:"reload"})},"L"),L=c!==null&&c.length>0&&o.length===c.length,M=new Set(o);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"border border-border bg-card p-3","data-testid":"kv-keys-section",children:[(0,a.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[(0,a.jsx)(ae,{"aria-label":d("Filter keys by prefix"),className:"min-w-[16rem] flex-1","data-testid":"kv-prefix-input",onChange:N,placeholder:d("Filter by prefix\u2026"),value:V}),(0,a.jsx)($,{"data-testid":"kv-filter-btn",disabled:O,onClick:w,children:d("Filter")}),(0,a.jsx)($,{"data-testid":"kv-new-key-btn",onClick:i(()=>{h(n=>!n)},"onClick"),variant:"outline",children:d("New key")}),o.length>0&&(0,a.jsx)($,{"data-testid":"kv-bulk-delete-btn",disabled:t,onClick:T,variant:"destructive",children:t?d("Deleting\u2026"):d("Delete {count}",{count:o.length})})]}),l!==null&&(0,a.jsx)("p",{className:"mb-2 text-sm text-destructive","data-testid":"kv-bulk-error",role:"alert",children:l}),g!==null&&(0,a.jsx)("p",{className:"text-sm text-destructive","data-testid":"kv-keys-error",role:"alert",children:g}),c!==null&&c.length===0&&!O&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"kv-no-keys",children:d("No keys.")}),c!==null&&c.length>0&&(0,a.jsx)(re,{className:"overflow-hidden py-0",children:(0,a.jsx)(ne,{className:"px-0",children:(0,a.jsxs)(se,{"data-testid":"kv-key-table",children:[(0,a.jsx)(ie,{children:(0,a.jsxs)(Q,{children:[(0,a.jsx)(X,{className:"w-10",children:(0,a.jsx)(ue,{"aria-label":d("Select all"),checked:L,"data-testid":"kv-select-all",onCheckedChange:J})}),(0,a.jsx)(X,{children:d("Key")}),(0,a.jsx)(X,{children:d("Expiration")})]})}),(0,a.jsx)(oe,{children:c.map(n=>(0,a.jsxs)(Q,{className:n.name===y?"border-l-2 border-l-royal-amethyst bg-muted/50":"cursor-pointer","data-key":n.name,"data-testid":`kv-key-row-${n.name}`,onClick:C,children:[(0,a.jsx)(Y,{onClick:i(k=>{k.stopPropagation()},"onClick"),children:(0,a.jsx)(ue,{"aria-label":d("Select {name}",{name:n.name}),checked:M.has(n.name),"data-testid":`kv-select-${n.name}`,onCheckedChange:i(()=>{K(n.name)},"onCheckedChange")})}),(0,a.jsx)(Y,{className:"font-mono text-xs",children:n.name}),(0,a.jsx)(Y,{className:"tabular-nums text-xs",children:Le(n.expiration)})]},n.name))})]})})}),!x&&p!==null&&(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)($,{"data-testid":"kv-load-more",disabled:O,onClick:b,variant:"outline",children:d(O?"Loading\u2026":"Load more")})})]}),(0,a.jsx)(me,{onOpenChange:i(n=>{n||h(!1)},"onOpenChange"),open:m,children:(0,a.jsxs)(ve,{className:"w-full gap-0 overflow-y-auto sm:max-w-md","data-testid":"kv-create-sheet",side:"right",children:[(0,a.jsx)(pe,{children:(0,a.jsx)(ye,{children:d("New key")})}),(0,a.jsx)(je,{namespace:r,onCancel:i(()=>{h(!1)},"onCancel"),onCreated:P})]})}),(0,a.jsx)(me,{onOpenChange:i(n=>{n||s({name:null,type:"selectKey"})},"onOpenChange"),open:y!==null,children:(0,a.jsxs)(ve,{className:"w-full gap-0 overflow-y-auto sm:max-w-md","data-testid":"kv-editor-sheet",side:"right",children:[(0,a.jsx)(pe,{children:(0,a.jsx)(ye,{className:"truncate font-mono text-xs",children:y})}),y!==null&&(0,a.jsx)(He,{expiration:c?.find(n=>n.name===y)?.expiration,keyName:y,namespace:r,onDeleted:S},`${r}:${y}`)]})})]})},"Ue"),it=i(({loadNamespaces:r}={})=>{let e=G(),d=R(),[u,s]=(0,B.useState)(null),[v,o]=(0,B.useState)(null),[t,l]=(0,B.useState)(null);(0,B.useEffect)(()=>{let c={cancelled:!1};return A((async()=>{try{let x=await(r??(()=>e.listKvNamespaces()))();c.cancelled||(s(x),o(null),l(g=>g??x[0]?.binding??null))}catch(x){c.cancelled||(s(null),o(Z(x)))}})()),()=>{c.cancelled=!0}},[e,r]);let p=i(c=>{l(c.currentTarget.dataset.ns??null)},"v");return(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-kv-browser",children:[v!==null&&(0,a.jsx)("p",{className:"text-sm text-destructive","data-testid":"kv-ns-error",role:"alert",children:v}),u!==null&&u.length===0&&(0,a.jsx)(ke,{description:d("Add a kv_namespaces binding to wrangler.jsonc \u2014 it appears here automatically, no wiring needed."),icon:(0,a.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"})}),testId:"kv-empty",title:d("No KV namespaces.")}),u!==null&&u.length>0&&(0,a.jsx)(re,{className:"overflow-hidden py-0",children:(0,a.jsx)(ne,{className:"px-0",children:(0,a.jsxs)(se,{"data-testid":"kv-namespace-table",children:[(0,a.jsx)(ie,{children:(0,a.jsx)(Q,{children:(0,a.jsx)(X,{children:d("Namespace")})})}),(0,a.jsx)(oe,{children:u.map(c=>(0,a.jsx)(Q,{className:c.binding===t?"border-l-2 border-l-royal-amethyst bg-muted/50":"cursor-pointer","data-ns":c.binding,"data-testid":`kv-ns-row-${c.binding}`,onClick:p,children:(0,a.jsx)(Y,{className:"font-mono text-xs",children:c.binding})},c.binding))})]})})}),t!==null&&(0,a.jsx)(Ue,{namespace:t},t)]})},"ct");export{it as KvBrowser};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s,c as m,f as V}from"./chunk-3XIESWL4.js";var h=m(w=>{"use strict";var a=V();function z(e,u){return e===u&&(e!==0||1/e===1/u)||e!==e&&u!==u}s(z,"is");var I=typeof Object.is=="function"?Object.is:z,M=a.useState,_=a.useEffect,g=a.useLayoutEffect,G=a.useDebugValue;function L(e,u){var t=u(),i=M({inst:{value:t,getSnapshot:u}}),r=i[0].inst,n=i[1];return g(function(){r.value=t,r.getSnapshot=u,y(r)&&n({inst:r})},[e,t,u]),_(function(){return y(r)&&n({inst:r}),e(function(){y(r)&&n({inst:r})})},[e]),G(t),t}s(L,"useSyncExternalStore$2");function y(e){var u=e.getSnapshot;e=e.value;try{var t=u();return!I(e,t)}catch{return!0}}s(y,"checkIfSnapshotChanged");function $(e,u){return u()}s($,"useSyncExternalStore$1");var k=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?$:L;w.useSyncExternalStore=a.useSyncExternalStore!==void 0?a.useSyncExternalStore:k});var O=m((T,D)=>{"use strict";D.exports=h()});var N=m(R=>{"use strict";var E=V(),C=O();function U(e,u){return e===u&&(e!==0||1/e===1/u)||e!==e&&u!==u}s(U,"is");var W=typeof Object.is=="function"?Object.is:U,A=C.useSyncExternalStore,B=E.useRef,F=E.useEffect,H=E.useMemo,J=E.useDebugValue;R.useSyncExternalStoreWithSelector=function(e,u,t,i,r){var n=B(null);if(n.current===null){var c={hasValue:!1,value:null};n.current=c}else c=n.current;n=H(function(){function j(o){if(!S){if(S=!0,v=o,o=i(o),r!==void 0&&c.hasValue){var f=c.value;if(r(f,o))return d=f}return d=o}if(f=d,W(v,o))return f;var p=i(o);return r!==void 0&&r(f,p)?(v=o,f):(v=o,d=p)}s(j,"memoizedSelector");var S=!1,v,d,b=t===void 0?null:t;return[function(){return j(u())},b===null?void 0:function(){return j(b())}]},[u,t,i,r]);var l=A(e,n[0],n[1]);return F(function(){c.hasValue=!0,c.value=l},[l]),J(l),l}});var K=m((Z,q)=>{"use strict";q.exports=N()});export{O as a,K as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as fe}from"./chunk-LEDWUPXM.js";import"./chunk-2PJNAWB3.js";import{a as ie}from"./chunk-IC4L6G56.js";import{a as pe}from"./chunk-54MMVNPT.js";import"./chunk-BGBLQ563.js";import{R as de}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as x}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as ne}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as he}from"./chunk-LJIFMW67.js";import"./chunk-XXQUMVWH.js";import"./chunk-QWBRD6PX.js";import"./chunk-QLQADHFE.js";import{a as I}from"./chunk-VDW32UET.js";import{c as ue}from"./chunk-SHMNA6UL.js";import{f as le}from"./chunk-V2U5CL3S.js";import"./chunk-XBDKZZ67.js";import{a as ce}from"./chunk-XQCVZAGU.js";import{d as oe,f as Z,g as ee,h as te,m as ae,o as me,q as re}from"./chunk-OG4N2XHD.js";import"./chunk-XNGYYOLS.js";import{a as i,e as Y,f as ge,g as ve,h as Ne,j as se}from"./chunk-3XIESWL4.js";var t=Y(Ne(),1);var xe=Y(ve(),1);var N=Y(ge(),1);function ye({className:a,orientation:e="horizontal",...s}){return(0,t.jsx)(ie,{"data-slot":"separator",orientation:e,className:se("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",a),...s})}i(ye,"xe");var we=/https?:\/\/[^\s"'<>)]+/i,be=i(a=>a===void 0?void 0:we.exec(a)?.[0],"ae"),y=i(a=>a===void 0?"":Array.isArray(a)?a.join(", "):a,"N"),Ce=i(a=>{if(a!==void 0)return be(a.html)??be(a.text)},"Ne"),ke=i((a,e)=>{let s=e.trim().toLowerCase();return s===""?a:a.filter(o=>`${o.subject} ${y(o.to)} ${y(o.cc)}`.toLowerCase().includes(s))},"ye"),Se=i((a,e)=>{if(a.length!==0)return a.find(s=>s.id===e)??a[0]},"we"),Te=Z(I.clearCapturedMail),Le=Z(I.sendTestMail),je=i(a=>{let e=(0,xe.c)(38),{limit:s}=a,o=le(),p;e[0]!==s?(p={limit:s},e[0]=s,e[1]=p):p=e[1];let{data:P,error:w,errorSource:C,isLoading:g,refetch:n}=ue(I.getCapturedMail,p),[k,f]=(0,N.useState)(null),[D,S]=(0,N.useState)(null),[v,l]=(0,N.useState)("html"),[c,W]=(0,N.useState)(""),b=P?.entries??[],r=w??k,u=w===null?k:C,T;e[2]!==o||e[3]!==n?(T=i(async()=>{f(null);try{await o.query(Te,{},ee("")),S(null),n()}catch(m){f(te(m))}},"S"),e[2]=o,e[3]=n,e[4]=T):T=e[4];let B=T,L;e[5]!==o||e[6]!==n?(L=i(async()=>{f(null);try{await o.query(Le,{},ee("")),n()}catch(m){f(te(m))}},"$"),e[5]=o,e[6]=n,e[7]=L):L=e[7];let R=L,j;e[8]!==n?(j=i(()=>{n()},"T"),e[8]=n,e[9]=j):j=e[9],pe(j,!0);let M;e[10]!==B?(M=i(()=>{ae(B())},"L"),e[10]=B,e[11]=M):M=e[11];let U=M,_;e[12]!==R?(_=i(()=>{ae(R())},"j"),e[12]=R,e[13]=_):_=e[13];let G=_,$;e[14]===Symbol.for("react.memo_cache_sentinel")?($=i(m=>{W(m.currentTarget.value)},"M"),e[14]=$):$=e[14];let J=$,z;e[15]===Symbol.for("react.memo_cache_sentinel")?(z=i(m=>{let{id:h}=m.currentTarget.dataset;h!==void 0&&S(h)},"_"),e[15]=z):z=e[15];let K=z,A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=i(m=>{let h=m.currentTarget.dataset.tab;(h==="headers"||h==="html"||h==="text")&&l(h)},"z"),e[16]=A):A=e[16];let Q=A,F=ke(b,c),O=Se(F,D),d=Ce(O),q;e[17]!==d?(q=i(()=>{d!==void 0&&me(d)},"O"),e[17]=d,e[18]=q):q=e[18];let V=q,E;e[19]!==d?(E=i(()=>{d!==void 0&&"window"in globalThis&&globalThis.window.open(d,"_blank","noopener")},"E"),e[19]=d,e[20]=E):E=e[20];let X=E,H;return e[21]!==b||e[22]!==r||e[23]!==u||e[24]!==c||e[25]!==g||e[26]!==d||e[27]!==U||e[28]!==V||e[29]!==J||e[30]!==X||e[31]!==K||e[32]!==Q||e[33]!==G||e[34]!==O||e[35]!==v||e[36]!==F?(H={entries:b,error:r,errorSource:u,filter:c,isLoading:g,link:d,onClear:U,onCopyLink:V,onFilterChange:J,onOpenLink:X,onSelectMessage:K,onSelectTab:Q,onSendTest:G,selected:O,tab:v,visible:F},e[21]=b,e[22]=r,e[23]=u,e[24]=c,e[25]=g,e[26]=d,e[27]=U,e[28]=V,e[29]=J,e[30]=X,e[31]=K,e[32]=Q,e[33]=G,e[34]=O,e[35]=v,e[36]=F,e[37]=H):H=e[37],H},"Se"),Me=`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:">`,_e=i(a=>`${Me}${a}`,"Te"),Je=i(({limit:a=100})=>{let e=oe(),{entries:s,error:o,errorSource:p,filter:P,isLoading:w,link:C,onClear:g,onCopyLink:n,onFilterChange:k,onOpenLink:f,onSelectMessage:D,onSelectTab:S,onSendTest:v,selected:l,tab:c,visible:W}=je({limit:a}),b=i(r=>e(r==="html"?"HTML":r==="text"?"Plain text":"Headers"),"b");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mail-panel",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(x,{"data-testid":"mail-send-test",onClick:v,size:"sm",type:"button",variant:"outline",children:e("Send test")}),(0,t.jsx)(x,{"data-testid":"mail-clear",disabled:s.length===0,onClick:g,size:"sm",type:"button",variant:"outline",children:e("Clear inbox")}),s.length>0&&(0,t.jsx)(ne,{className:"ml-auto","data-testid":"mail-count",variant:"secondary",children:e("{count} messages",{count:s.length})})]}),o!==null&&(0,t.jsx)(he,{error:p,testId:"mail-error"}),o===null&&!w&&s.length===0&&(0,t.jsx)(ce,{description:e("Email your app sends in dev is captured here \u2014 nothing is delivered."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{d:"M4 5h16v14H4z"}),(0,t.jsx)("path",{d:"m4 6 8 6 8-6"})]}),testId:"mail-empty",title:e("No captured email.")}),s.length>0&&(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-[minmax(0,22rem)_1fr]","data-testid":"mail-reader",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(de,{"aria-label":e("Search messages"),"data-testid":"mail-search",onChange:k,placeholder:e("Filter messages"),type:"search",value:P}),(0,t.jsx)(fe,{className:"max-h-[32rem] rounded-xl border border-border bg-card shadow-xs","data-testid":"mail-list",children:(0,t.jsx)("ul",{className:"divide-y",children:W.map(r=>{let u=r.id===l?.id;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{className:`flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left text-sm hover:bg-muted/60 ${u?"bg-muted":""}`,"data-active":u,"data-id":r.id,"data-testid":"mail-list-item",onClick:D,type:"button",children:[(0,t.jsx)("span",{className:"w-full truncate font-medium",children:r.subject||e("(no subject)")}),(0,t.jsx)("span",{className:"w-full truncate text-xs text-muted-foreground",children:y(r.to)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:re(r.capturedAt,"\u2014")})]})},r.id)})})})]}),l!==void 0&&(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-card p-4 shadow-xs","data-testid":"mail-detail",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h2",{className:"truncate text-base font-semibold","data-testid":"mail-subject",children:l.subject||e("(no subject)")}),(0,t.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs text-muted-foreground",children:[(0,t.jsx)("dt",{children:e("From")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:l.from??"\u2014"}),(0,t.jsx)("dt",{children:e("To")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:y(l.to)}),l.cc!==void 0&&l.cc.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("dt",{children:e("Cc")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:y(l.cc)})]}),(0,t.jsx)("dt",{children:e("Sent")}),(0,t.jsx)("dd",{className:"tabular-nums",children:re(l.capturedAt,"\u2014")})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"mail-actions",children:[(0,t.jsx)(x,{"data-testid":"mail-copy-link",disabled:C===void 0,onClick:n,size:"sm",type:"button",variant:"outline",children:e("Copy link")}),(0,t.jsx)(x,{"data-testid":"mail-open-link",disabled:C===void 0,onClick:f,size:"sm",type:"button",variant:"outline",children:e("Open in new tab")})]}),(0,t.jsx)(ye,{}),(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"mail-tabs",role:"tablist",children:["html","text","headers"].map(r=>(0,t.jsx)(x,{"aria-selected":c===r,"data-tab":r,"data-testid":`mail-tab-${r}`,onClick:S,role:"tab",size:"sm",type:"button",variant:c===r?"secondary":"ghost",children:b(r)},r))}),(0,t.jsxs)("div",{className:"min-h-[12rem]",children:[c==="html"&&(l.html===void 0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No HTML body.")}):(0,t.jsx)("iframe",{className:"h-[24rem] w-full rounded-md border bg-white","data-testid":"mail-preview-html",sandbox:"",srcDoc:_e(l.html),title:e("Email preview")})),c==="text"&&(l.text===void 0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No text body.")}):(0,t.jsx)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-text",children:l.text})),c==="headers"&&(l.headers===void 0||Object.keys(l.headers).length===0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No headers.")}):(0,t.jsx)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-headers",children:Object.entries(l.headers).map(([r,u])=>`${r}: ${u}`).join(`
|
|
2
|
+
`)}))]})]})]})]})},"We");export{Je as MailPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i,j as a}from"./chunk-6ST5ECQA.js";import{a as o}from"./chunk-XBDKZZ67.js";import{a as r,j as n}from"./chunk-3XIESWL4.js";function s(e){return a(e.defaultTagName??"div",e,e)}r(s,"useRender");var g=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-none border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive font-mono text-[11px] tracking-wide uppercase focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline",success:"bg-success/10 text-success font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-success/15 dark:bg-success/15",warning:"bg-warning/10 text-warning font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-warning/15 dark:bg-warning/15",info:"bg-info/10 text-info font-mono text-[11px] tracking-wide uppercase [a]:hover:bg-info/15 dark:bg-info/15"}},defaultVariants:{variant:"default"}});function x({className:e,variant:t="default",render:d,...u}){return s({defaultTagName:"span",props:i({className:n(g({variant:t}),e)},u),render:d,state:{slot:"badge",variant:t}})}r(x,"f");export{s as a,x as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as u,m as f}from"./chunk-OG4N2XHD.js";import{a as s,e as l,f as h,g as S}from"./chunk-3XIESWL4.js";var i=l(S(),1),c=l(h(),1);var g=s(()=>{let t=(0,i.c)(4),[a,n]=(0,c.useState)(!1),[e,m]=(0,c.useState)(null),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s(p=>{f((async()=>{n(!0),m(null);try{await p()}catch(b){m(u(b))}n(!1)})())},"e"),t[0]=r):r=t[0];let y=r,o;return t[1]!==a||t[2]!==e?(o={busy:a,error:e,run:y},t[1]=a,t[2]=e,t[3]=o):o=t[3],o},"g");export{g as a};
|