@lunora/studio 1.0.0-alpha.361 → 1.0.0-alpha.363
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/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +1 -1
- package/dist/mount.mjs +1 -1
- package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -1
- package/dist/packem_chunks/ApiTab.mjs +1 -1
- package/dist/packem_chunks/AuditPanel.mjs +1 -1
- package/dist/packem_chunks/ExportImportPanel.mjs +1 -1
- package/dist/packem_chunks/FileBrowser.mjs +1 -1
- package/dist/packem_chunks/FunctionRunner.mjs +1 -1
- package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -1
- package/dist/packem_chunks/HealthPanel.mjs +1 -1
- package/dist/packem_chunks/InsightsPanel.mjs +1 -1
- package/dist/packem_chunks/LogsPanel.mjs +1 -1
- package/dist/packem_chunks/MailPanel.mjs +1 -1
- package/dist/packem_chunks/MetricsPanel.mjs +1 -1
- package/dist/packem_chunks/NotificationsPanel.mjs +1 -1
- package/dist/packem_chunks/PitrPanel.mjs +1 -1
- package/dist/packem_chunks/SchemaViewer.mjs +1 -1
- package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -1
- package/dist/packem_chunks/SettingsPanel.mjs +1 -1
- package/dist/packem_chunks/SqlEditorPanel.mjs +24 -9
- package/dist/packem_chunks/TableEditor.mjs +1 -1
- package/dist/packem_chunks/agents-panel.mjs +1 -1
- package/dist/packem_chunks/ai-knowledge.mjs +1 -0
- package/dist/packem_chunks/ai-usage-panel.mjs +1 -1
- package/dist/packem_chunks/assistant-panel.mjs +3 -0
- package/dist/packem_chunks/auth-audit-panel.mjs +1 -1
- package/dist/packem_chunks/containers-panel.mjs +1 -1
- package/dist/packem_chunks/dashboards-panel.mjs +1 -1
- package/dist/packem_chunks/evals-panel.mjs +1 -1
- package/dist/packem_chunks/fanout-panel.mjs +1 -1
- package/dist/packem_chunks/flags-panel.mjs +1 -1
- package/dist/packem_chunks/issues-panel.mjs +1 -1
- package/dist/packem_chunks/kv-browser.mjs +1 -1
- package/dist/packem_chunks/log-drains-panel.mjs +1 -1
- package/dist/packem_chunks/migrations-route.mjs +1 -1
- package/dist/packem_chunks/payments-panel.mjs +1 -1
- package/dist/packem_chunks/permissions-panel.mjs +1 -1
- package/dist/packem_chunks/privacy-requests-panel.mjs +1 -1
- package/dist/packem_chunks/queues-panel.mjs +1 -1
- package/dist/packem_chunks/reactors-panel.mjs +1 -1
- package/dist/packem_chunks/rls-panel.mjs +1 -1
- package/dist/packem_chunks/schedule-panel.mjs +1 -1
- package/dist/packem_chunks/storage-rules-panel.mjs +1 -1
- package/dist/packem_chunks/subscriptions-panel.mjs +1 -1
- package/dist/packem_chunks/traces-panel.mjs +1 -1
- package/dist/packem_chunks/workflows-panel.mjs +1 -1
- package/dist/packem_shared/ADMIN_FUNCTIONS-DUXsXId1.mjs +1 -0
- package/dist/packem_shared/{ApiDocsPanel-DD2Uns6b.mjs → ApiDocsPanel-B9S9l1Ce.mjs} +1 -1
- package/dist/packem_shared/{DataBrowser-CVRWnNWu.mjs → DataBrowser-Dm-jhIUP.mjs} +2 -2
- package/dist/packem_shared/{GlobalDataBrowser-DC47T6Zl.mjs → GlobalDataBrowser-C1Y8GUhe.mjs} +1 -1
- package/dist/packem_shared/{HomePanel-D12HxHQo.mjs → HomePanel-B5ytwPIo.mjs} +1 -1
- package/dist/packem_shared/{MigrationsPanel-DMkxSXNl.mjs → MigrationsPanel-CwLikxDT.mjs} +1 -1
- package/dist/packem_shared/Studio-B89ZNMOD.mjs +1 -0
- package/dist/packem_shared/{StudioApp-isdWpF9P.mjs → StudioApp-C9l1a3A8.mjs} +1 -1
- package/dist/packem_shared/advisor-view-CzieqKMe.mjs +5 -0
- package/dist/packem_shared/assistant-provider-Bp72uWsq.mjs +1 -0
- package/dist/packem_shared/assistant-reason-D6EwMCxT.mjs +1 -0
- package/dist/packem_shared/{cf-links-CBJ5SywP.mjs → cf-links-C4DVTr8A.mjs} +1 -1
- package/dist/packem_shared/error-alert-DKXm5h19.mjs +6 -0
- package/dist/packem_shared/{home-panel-CDVTuTF8.mjs → home-panel-5fGktYeD.mjs} +1 -1
- package/dist/packem_shared/recording-client-z4CBi0y8.mjs +1 -0
- package/dist/packem_shared/studio-gZfpz1wC.mjs +2 -0
- package/dist/packem_shared/{table-list-sidebar-CNadcIgG.mjs → table-list-sidebar-kpHaDWjy.mjs} +1 -1
- package/dist/packem_shared/use-assistant-rpc-GCUK2zPa.mjs +1 -0
- package/dist/standalone/chunk-2DT3QG6Q.js +1 -0
- package/dist/standalone/chunk-2EB7FN5S.js +1 -0
- package/dist/standalone/chunk-2H6VLY2M.js +1 -0
- package/dist/standalone/chunk-2NGKUO32.js +1 -0
- package/dist/standalone/chunk-2SNHKJXK.js +1 -0
- package/dist/standalone/chunk-2W4UO5BC.js +1 -0
- package/dist/standalone/chunk-32V7XGNC.js +1 -0
- package/dist/standalone/{chunk-SLIDAWNX.js → chunk-3D67ZJRW.js} +1 -1
- package/dist/standalone/chunk-3X3NXJBR.js +1 -0
- package/dist/standalone/chunk-4EPW63HS.js +1 -0
- package/dist/standalone/chunk-4L55URI5.js +2 -0
- package/dist/standalone/chunk-4N76XUNG.js +1 -0
- package/dist/standalone/{chunk-WS36BO4R.js → chunk-4NKJV7YX.js} +1 -1
- package/dist/standalone/chunk-4PI2OSSP.js +1 -0
- package/dist/standalone/chunk-53XKGQEE.js +1 -0
- package/dist/standalone/chunk-5GYHGDIF.js +8 -0
- package/dist/standalone/chunk-5PEAXTYQ.js +1 -0
- package/dist/standalone/chunk-5QUTVSHM.js +1 -0
- package/dist/standalone/{chunk-BYOGQ2IV.js → chunk-5RX5CQSU.js} +2 -2
- package/dist/standalone/{chunk-O2NMPIV2.js → chunk-5WNGRT7N.js} +1 -1
- package/dist/standalone/chunk-5Z2U4KBN.js +1 -0
- package/dist/standalone/chunk-66BMMNUR.js +1 -0
- package/dist/standalone/chunk-6FPV3EK2.js +1 -0
- package/dist/standalone/chunk-6G3E4PJ2.js +1 -0
- package/dist/standalone/chunk-75TRPM7O.js +1 -0
- package/dist/standalone/chunk-7MLX5CGD.js +1 -0
- package/dist/standalone/chunk-7QEZ2SFW.js +1 -0
- package/dist/standalone/chunk-7TQ7BZ67.js +1 -0
- package/dist/standalone/chunk-A2Q3TGIQ.js +1 -0
- package/dist/standalone/chunk-AD5J2ANS.js +1 -0
- package/dist/standalone/chunk-ALR4VAUE.js +1 -0
- package/dist/standalone/chunk-AXE2SDRU.js +1 -0
- package/dist/standalone/chunk-AZIKM5BA.js +1 -0
- package/dist/standalone/chunk-BAEIW3YS.js +1 -0
- package/dist/standalone/chunk-BBDTJG2K.js +1 -0
- package/dist/standalone/chunk-BCUOQNI2.js +1 -0
- package/dist/standalone/chunk-BG2CJOVS.js +1 -0
- package/dist/standalone/chunk-BI6MZHZJ.js +1 -0
- package/dist/standalone/chunk-BKI3JMXQ.js +1 -0
- package/dist/standalone/chunk-CKEQX655.js +1 -0
- package/dist/standalone/{chunk-DX55P3KZ.js → chunk-CL3JOU6F.js} +1 -1
- package/dist/standalone/chunk-CP7QNLR4.js +1 -0
- package/dist/standalone/chunk-CVSIFPI5.js +1 -0
- package/dist/standalone/chunk-D57B4MFK.js +1 -0
- package/dist/standalone/chunk-D65UVZIA.js +1 -0
- package/dist/standalone/{chunk-DBVJ5VLI.js → chunk-DA2CAFXI.js} +1 -1
- package/dist/standalone/chunk-DB6QX4X6.js +1 -0
- package/dist/standalone/chunk-DZFXH55R.js +1 -0
- package/dist/standalone/chunk-ELSQ4FVH.js +1 -0
- package/dist/standalone/chunk-EPWCW2DF.js +1 -0
- package/dist/standalone/chunk-FHLODLBC.js +1 -0
- package/dist/standalone/chunk-FJLRSFTE.js +1 -0
- package/dist/standalone/{chunk-3FS22LNI.js → chunk-FVCBNFQW.js} +3 -3
- package/dist/standalone/{chunk-VEWQWS3J.js → chunk-FWM5Z6CH.js} +1 -1
- package/dist/standalone/chunk-GJXCPZDN.js +1 -0
- package/dist/standalone/chunk-GNI37YCV.js +33 -0
- package/dist/standalone/chunk-GVQPNM3T.js +3 -0
- package/dist/standalone/chunk-GWNGVKLG.js +1 -0
- package/dist/standalone/chunk-GXTSE66Z.js +1 -0
- package/dist/standalone/chunk-H3EIPYRZ.js +1 -0
- package/dist/standalone/chunk-H5TMLWIS.js +1 -0
- package/dist/standalone/{chunk-XIRKBJPD.js → chunk-HBG6SSE2.js} +5 -5
- package/dist/standalone/chunk-HC2B7SXW.js +1 -0
- package/dist/standalone/chunk-HCOF7HOM.js +1 -0
- package/dist/standalone/chunk-HGCOTYPV.js +1 -0
- package/dist/standalone/chunk-HLHMHCXS.js +1 -0
- package/dist/standalone/chunk-HSF2DCJ2.js +30 -0
- package/dist/standalone/chunk-HZDLUAWS.js +1 -0
- package/dist/standalone/{chunk-3PAYDWHN.js → chunk-I3SSF2T6.js} +2 -2
- package/dist/standalone/chunk-I5QX75DE.js +1 -0
- package/dist/standalone/chunk-ICHZ2IBL.js +1 -0
- package/dist/standalone/{chunk-7ZIYHKLX.js → chunk-IG5VD7R7.js} +3 -3
- package/dist/standalone/{chunk-SU5DTRGK.js → chunk-IHGRWY3Y.js} +1 -1
- package/dist/standalone/chunk-J45HAKBU.js +1 -0
- package/dist/standalone/chunk-J4PQAVOF.js +1 -0
- package/dist/standalone/chunk-JD6PRRFO.js +1 -0
- package/dist/standalone/chunk-JOPNP4EO.js +1 -0
- package/dist/standalone/chunk-JVP3TR3A.js +1 -0
- package/dist/standalone/chunk-KGLIQIZU.js +1 -0
- package/dist/standalone/{chunk-ONWGX5Y4.js → chunk-KH6OXCG3.js} +1 -1
- package/dist/standalone/chunk-KKMQUBYH.js +1 -0
- package/dist/standalone/chunk-L2FYX4FN.js +1 -0
- package/dist/standalone/chunk-LDHJRHPZ.js +1 -0
- package/dist/standalone/chunk-LSEUUZN4.js +1 -0
- package/dist/standalone/chunk-MNYDT3RH.js +1 -0
- package/dist/standalone/chunk-MT4ICMXJ.js +1 -0
- package/dist/standalone/chunk-MXJTD2OX.js +1 -0
- package/dist/standalone/chunk-NGZNXNRD.js +1 -0
- package/dist/standalone/chunk-O3AZ7JKE.js +1 -0
- package/dist/standalone/chunk-OK2QU2EV.js +1 -0
- package/dist/standalone/{chunk-IH2CJZF2.js → chunk-ONTGYVAN.js} +1 -1
- package/dist/standalone/chunk-OWRKSQPE.js +1 -0
- package/dist/standalone/chunk-OZAOWE7T.js +1 -0
- package/dist/standalone/chunk-P5EVJEGC.js +1 -0
- package/dist/standalone/chunk-PDBW6GTJ.js +1 -0
- package/dist/standalone/chunk-PJUVJTDR.js +1 -0
- package/dist/standalone/chunk-Q3IA6HPX.js +1 -0
- package/dist/standalone/chunk-QAOZXPLU.js +1 -0
- package/dist/standalone/chunk-QKUVJIRX.js +1 -0
- package/dist/standalone/chunk-QNM2J7MG.js +1 -0
- package/dist/standalone/chunk-QRA7AKYO.js +1 -0
- package/dist/standalone/chunk-RBIVXSXT.js +1 -0
- package/dist/standalone/chunk-RCXNYW7P.js +1 -0
- package/dist/standalone/{chunk-TDVDZ7XQ.js → chunk-RIAOZECW.js} +1 -1
- package/dist/standalone/{chunk-LUHXNZI4.js → chunk-RTS5G3ET.js} +1 -1
- package/dist/standalone/chunk-S36FVTKK.js +1 -0
- package/dist/standalone/chunk-SDDEOSQB.js +1 -0
- package/dist/standalone/chunk-SHHGIT7M.js +7 -0
- package/dist/standalone/chunk-SR6CPTRT.js +1 -0
- package/dist/standalone/chunk-SVQWZPO4.js +1 -0
- package/dist/standalone/chunk-T3ZCW3RG.js +1 -0
- package/dist/standalone/chunk-TEMI7MVE.js +1 -0
- package/dist/standalone/chunk-TKBTZX4K.js +1 -0
- package/dist/standalone/chunk-TW4O2BA5.js +159 -0
- package/dist/standalone/chunk-U5MPNEM2.js +1 -0
- package/dist/standalone/chunk-UD5REVU2.js +1 -0
- package/dist/standalone/chunk-ULQNADMJ.js +1 -0
- package/dist/standalone/chunk-UPPNZ6MI.js +1 -0
- package/dist/standalone/{chunk-PQH2LSJX.js → chunk-UQA2AJGI.js} +1 -1
- package/dist/standalone/chunk-UTQLJKHH.js +1 -0
- package/dist/standalone/chunk-UVG3ZISC.js +1 -0
- package/dist/standalone/chunk-UXBNXITB.js +1 -0
- package/dist/standalone/chunk-UZ2ZXB74.js +1 -0
- package/dist/standalone/chunk-V3BE427M.js +1 -0
- package/dist/standalone/chunk-VQDTA4P6.js +1 -0
- package/dist/standalone/chunk-W4LJQYCI.js +1 -0
- package/dist/standalone/chunk-WLHQ4FKC.js +1 -0
- package/dist/standalone/chunk-XPFVUAPX.js +1 -0
- package/dist/standalone/{chunk-SYGCASPT.js → chunk-Y2YLTUMD.js} +1 -1
- package/dist/standalone/chunk-Y3IGTWUE.js +1 -0
- package/dist/standalone/chunk-Y64STA6O.js +1 -0
- package/dist/standalone/chunk-YEVTA35E.js +1 -0
- package/dist/standalone/chunk-YEXTJUKQ.js +6 -0
- package/dist/standalone/chunk-YFTPHGS2.js +1 -0
- package/dist/standalone/{chunk-R36QXQZX.js → chunk-YORPLSI5.js} +1 -1
- package/dist/standalone/chunk-Z64BZNPS.js +1 -0
- package/dist/standalone/chunk-Z6VILGGP.js +5 -0
- package/dist/standalone/chunk-ZBOB33BA.js +1 -0
- package/dist/standalone/{chunk-5R2YO7HF.js → chunk-ZOKSVUID.js} +4 -4
- package/dist/standalone/{chunk-H7HZ42JY.js → chunk-ZPQBVYNN.js} +1 -1
- package/dist/standalone/chunk-ZSWW2UGP.js +1 -0
- package/dist/standalone/studio.js +2 -2
- package/dist/styles.css +1 -1
- package/package.json +7 -6
- package/dist/packem_shared/ADMIN_FUNCTIONS-4aGsMs95.mjs +0 -1
- package/dist/packem_shared/Studio-MA8kKZLu.mjs +0 -1
- package/dist/packem_shared/advisor-view-tBumWci_.mjs +0 -1
- package/dist/packem_shared/error-alert-C0R39DO1.mjs +0 -1
- package/dist/packem_shared/recording-client-DAipTA_n.mjs +0 -1
- package/dist/packem_shared/studio-UhUrPz5J.mjs +0 -2
- package/dist/packem_shared/use-sql-assistant-rZPs3LC3.mjs +0 -1
- package/dist/standalone/chunk-2AH4ABE5.js +0 -1
- package/dist/standalone/chunk-2G57ENH5.js +0 -1
- package/dist/standalone/chunk-3GXPALXG.js +0 -1
- package/dist/standalone/chunk-3GYLOE4V.js +0 -1
- package/dist/standalone/chunk-473JK2PQ.js +0 -1
- package/dist/standalone/chunk-4C4THJUD.js +0 -1
- package/dist/standalone/chunk-4DAKKAK7.js +0 -1
- package/dist/standalone/chunk-4M57OYFX.js +0 -1
- package/dist/standalone/chunk-4SQBAPY6.js +0 -1
- package/dist/standalone/chunk-5DNGK3NT.js +0 -1
- package/dist/standalone/chunk-5GIQ6C5N.js +0 -1
- package/dist/standalone/chunk-5WJG7FMH.js +0 -1
- package/dist/standalone/chunk-63KDHS3H.js +0 -1
- package/dist/standalone/chunk-6B6ARRMI.js +0 -1
- package/dist/standalone/chunk-6LMO2D54.js +0 -1
- package/dist/standalone/chunk-6M7FLLMT.js +0 -1
- package/dist/standalone/chunk-6QEXGYWH.js +0 -1
- package/dist/standalone/chunk-6UTZXEW3.js +0 -1
- package/dist/standalone/chunk-6VAY6L4J.js +0 -1
- package/dist/standalone/chunk-7PADVGQX.js +0 -1
- package/dist/standalone/chunk-7RGYCU6F.js +0 -1
- package/dist/standalone/chunk-7UM5ROG6.js +0 -1
- package/dist/standalone/chunk-A566HCBX.js +0 -1
- package/dist/standalone/chunk-A5JISKHE.js +0 -1
- package/dist/standalone/chunk-ADNRFCMZ.js +0 -1
- package/dist/standalone/chunk-AP4PC2M4.js +0 -1
- package/dist/standalone/chunk-BFE2DRP6.js +0 -33
- package/dist/standalone/chunk-BPEB4KFE.js +0 -1
- package/dist/standalone/chunk-BVX45MU5.js +0 -7
- package/dist/standalone/chunk-C6GN7ZXJ.js +0 -1
- package/dist/standalone/chunk-CL2VZNDI.js +0 -1
- package/dist/standalone/chunk-CNA3TVUK.js +0 -1
- package/dist/standalone/chunk-CZ6HBDIL.js +0 -1
- package/dist/standalone/chunk-D6S7MXW4.js +0 -1
- package/dist/standalone/chunk-E26OT26O.js +0 -1
- package/dist/standalone/chunk-FCAXVYAX.js +0 -1
- package/dist/standalone/chunk-FXPAJDES.js +0 -1
- package/dist/standalone/chunk-HHRYM6UW.js +0 -1
- package/dist/standalone/chunk-HPRF5LMA.js +0 -1
- package/dist/standalone/chunk-IB22LETR.js +0 -1
- package/dist/standalone/chunk-IBJVVHV5.js +0 -1
- package/dist/standalone/chunk-IENQRRQT.js +0 -1
- package/dist/standalone/chunk-IQ4TTHQT.js +0 -1
- package/dist/standalone/chunk-ITH5LRWM.js +0 -1
- package/dist/standalone/chunk-J6VFG6M5.js +0 -1
- package/dist/standalone/chunk-JSDKOE4U.js +0 -1
- package/dist/standalone/chunk-JTGGWF7R.js +0 -1
- package/dist/standalone/chunk-JZD7ZN3F.js +0 -1
- package/dist/standalone/chunk-K3CWB3AM.js +0 -1
- package/dist/standalone/chunk-KNFB3FGW.js +0 -1
- package/dist/standalone/chunk-KNXWDE4N.js +0 -1
- package/dist/standalone/chunk-KRPXOSBL.js +0 -1
- package/dist/standalone/chunk-KRY7BYHT.js +0 -1
- package/dist/standalone/chunk-KYAG2YMF.js +0 -1
- package/dist/standalone/chunk-KZCEJFZF.js +0 -1
- package/dist/standalone/chunk-KZILJQX3.js +0 -8
- package/dist/standalone/chunk-LEYUH5TS.js +0 -1
- package/dist/standalone/chunk-LFM672WN.js +0 -1
- package/dist/standalone/chunk-LIGOLZND.js +0 -1
- package/dist/standalone/chunk-LPU6YTSU.js +0 -1
- package/dist/standalone/chunk-MWJC3S62.js +0 -1
- package/dist/standalone/chunk-NP2AQOLE.js +0 -1
- package/dist/standalone/chunk-NVKLYDOH.js +0 -1
- package/dist/standalone/chunk-O2X2XYCM.js +0 -1
- package/dist/standalone/chunk-O3MDWYXF.js +0 -1
- package/dist/standalone/chunk-ONG4JEZD.js +0 -1
- package/dist/standalone/chunk-OS26JXYA.js +0 -1
- package/dist/standalone/chunk-OXFKZ4BM.js +0 -1
- package/dist/standalone/chunk-PGTEGUAB.js +0 -1
- package/dist/standalone/chunk-PTBUWRBY.js +0 -1
- package/dist/standalone/chunk-Q6HA3L2H.js +0 -1
- package/dist/standalone/chunk-QGV5ARD2.js +0 -1
- package/dist/standalone/chunk-QWRK4ESB.js +0 -1
- package/dist/standalone/chunk-RL2ITK2N.js +0 -1
- package/dist/standalone/chunk-RTJO3AR4.js +0 -1
- package/dist/standalone/chunk-SFY646MC.js +0 -1
- package/dist/standalone/chunk-T5UMHPAB.js +0 -1
- package/dist/standalone/chunk-T6HV2FQP.js +0 -2
- package/dist/standalone/chunk-T7ZKNNGX.js +0 -1
- package/dist/standalone/chunk-TCYPNSTV.js +0 -1
- package/dist/standalone/chunk-TQM6XHBA.js +0 -1
- package/dist/standalone/chunk-TRMWBRRU.js +0 -1
- package/dist/standalone/chunk-TW7KJSMR.js +0 -15
- package/dist/standalone/chunk-TYD3V4NB.js +0 -1
- package/dist/standalone/chunk-TZKLK52W.js +0 -1
- package/dist/standalone/chunk-U4RXQSQ7.js +0 -1
- package/dist/standalone/chunk-UNZ2UBVL.js +0 -1
- package/dist/standalone/chunk-VJRNOSRY.js +0 -1
- package/dist/standalone/chunk-W2BCSK5S.js +0 -1
- package/dist/standalone/chunk-W7MRISE3.js +0 -1
- package/dist/standalone/chunk-WM72PRE3.js +0 -1
- package/dist/standalone/chunk-X4WHMCOZ.js +0 -1
- package/dist/standalone/chunk-X74GEPSG.js +0 -1
- package/dist/standalone/chunk-XKPD4SFN.js +0 -1
- package/dist/standalone/chunk-XMSNLMWU.js +0 -1
- package/dist/standalone/chunk-XOPFDWXX.js +0 -1
- package/dist/standalone/chunk-XQLOVFPP.js +0 -1
- package/dist/standalone/chunk-XSHYZPGF.js +0 -1
- package/dist/standalone/chunk-XST3UEHU.js +0 -1
- package/dist/standalone/chunk-XYR5NST4.js +0 -1
- package/dist/standalone/chunk-Y74LIFSL.js +0 -1
- package/dist/standalone/chunk-YHTHRYP5.js +0 -1
- package/dist/standalone/chunk-YMEKCV27.js +0 -1
- package/dist/standalone/chunk-Z5EV64KS.js +0 -1
- package/dist/standalone/chunk-ZBON5T5A.js +0 -1
- package/dist/standalone/chunk-ZGSL4DPP.js +0 -1
- package/dist/standalone/chunk-ZOQTXWPK.js +0 -1
- package/dist/standalone/chunk-ZTOREMGH.js +0 -1
- package/dist/standalone/chunk-ZZ5GICTF.js +0 -1
- /package/dist/standalone/{chunk-UYEZR3BI.js → chunk-P6VNMPWR.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as T}from"./chunk-W7MRISE3.js";import{a as S,c as w,e as _}from"./chunk-ZBON5T5A.js";import{d as W}from"./chunk-4C4THJUD.js";import{a as s,d as N,e as F,g as X}from"./chunk-OXFKZ4BM.js";var L=N(F(),1);var D=N(F(),1);var A=D.createContext({register:s(()=>{},"register"),unregister:s(()=>{},"unregister"),subscribeMapChange:s(()=>()=>{},"subscribeMapChange"),nextIndexRef:{current:0}});function j(){return D.useContext(A)}s(j,"useCompositeListContext");function ne(n={}){let{guess:t,label:e,metadata:i,textRef:u,index:r}=n,{register:a,unregister:f,subscribeMapChange:m,nextIndexRef:C}=j(),l=L.useRef(-1),[b,g]=L.useState(r==null&&t?()=>{if(l.current===-1){let p=C.current;C.current+=1,l.current=p}return l.current}:-1),M=r??b,E=L.useRef(null),y=L.useCallback(p=>{let v=E.current;v&&f(v),E.current=p,p&&a(p,{metadata:i??null,index:r??null,label:e,textRef:u})},[r,a,f,i,e,u]);return S(()=>{if(r==null)return m(p=>{let v=E.current?p.get(E.current)?.index:null;v!=null&&g(v)})},[r,m]),{ref:y,index:M}}s(ne,"useCompositeListItem");var R=N(F(),1);var k=N(X(),1);function ae(n){let{children:t,elementsRef:e,labelsRef:i,onMapChange:u}=n,r=w(u),[,a]=R.useState(!1),f=W(G).current,m=W(z).current,C=R.useRef(0),l=R.useRef(!0),b=R.useRef(null),g=R.useRef(null),M=w(()=>{l.current||(l.current=!0,a(o=>!o))}),E=w((o,h)=>{m.set(o,h),M()}),y=w(o=>{m.delete(o),M()}),p=w(o=>{let h=new Map;return e.current.length=0,i&&(i.current.length=0),o.forEach(c=>{h.set(c.element,{...c.registration.metadata??{},index:c.index}),e.current[c.index]=c.element,i&&(i.current[c.index]=c.registration.label!==void 0?c.registration.label:c.registration.textRef?.current?.textContent??c.element.textContent)}),C.current=e.current.length,h});function v(o){if(g.current?.disconnect(),g.current=null,typeof MutationObserver!="function"||o.length<2)return;let h=new MutationObserver(d=>{if(!K(d))return;let I=null;for(let x of o)if(x.isConnected){if(I&&H(I,x)>0){h.disconnect(),M();return}I=x}});g.current=h;let c=new Set;for(let d=1;d<o.length;d+=1){let I=J(o[d-1],o[d]);I&&c.add(I)}c.forEach(d=>h.observe(d,{childList:!0}))}s(v,"observe");let U=w(()=>{let[o,h]=q(m),c=p(o),d=b.current,I=!d||d.length!==o.length||o.some((x,V)=>{let O=d[V];return x.index!==O.index||x.element!==O.element||x.registration.index!==O.registration.index||x.registration.metadata!==O.registration.metadata});v(h),b.current=o,l.current=!1,I&&(f.forEach(x=>x(c)),r(c))});S(()=>(!l.current&&b.current&&p(b.current),()=>{e.current=[],i&&(i.current=[])}),[e,i,p]),S(()=>{l.current&&U()}),S(()=>()=>{g.current?.disconnect(),l.current=!0},[]);let B=w(o=>(f.add(o),()=>{f.delete(o)})),Y=R.useMemo(()=>({register:E,unregister:y,subscribeMapChange:B,nextIndexRef:C}),[E,y,B,C]);return(0,k.jsx)(A.Provider,{value:Y,children:t})}s(ae,"CompositeList");function z(){return new Map}s(z,"createMap");function G(){return new Set}s(G,"createListeners");function q(n){let t=new Set,e=[],i=[];n.forEach((r,a)=>{if(!a.isConnected)return;let f=r.index,m={index:f??-1,element:a,registration:r};f===null?i.push(m):f>=0&&(t.add(f),e.push(m))});let u=0;return i.sort((r,a)=>H(r.element,a.element)),i.forEach(r=>{for(;t.has(u);)u+=1;r.index=u,e.push(r),u+=1}),t.size>0&&e.sort((r,a)=>r.index-a.index),[e,i.map(r=>r.element)]}s(q,"getCompositeListSnapshot");function J(n,t){let e=n.parentElement;for(;e&&!e.contains(t);)e=e.parentElement;return e}s(J,"getCommonAncestor");function K(n){for(let t of n)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}s(K,"hasMovedNode");function H(n,t){return n.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}s(H,"sortByDocumentPosition");var P=5;function pe(n,t){let e=Q(t);return n.clientX>=e.left-P&&n.clientX<=e.right+P&&n.clientY>=e.top-P&&n.clientY<=e.bottom+P}s(pe,"isMouseWithinBounds");function Q(n){let t=n.getBoundingClientRect(),e=_(n);if(T.env.jsdom)return t;let i=e.getComputedStyle(n,"::before"),u=e.getComputedStyle(n,"::after");if(!(i.content!=="none"||u.content!=="none"))return t;let a=parseFloat(i.width)||0,f=parseFloat(i.height)||0,m=parseFloat(u.width)||0,C=parseFloat(u.height)||0,l=Math.max(t.width,a,m),b=Math.max(t.height,f,C),g=l-t.width,M=b-t.height;return{left:t.left-g/2,right:t.right+g/2,top:t.top-M/2,bottom:t.bottom+M/2}}s(Q,"getPseudoElementBounds");function ge(n){return n==null||n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true"}s(ge,"isElementDisabled");export{ne as a,ae as b,pe as c,ge as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as C}from"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as v}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{a as j}from"./chunk-CZ6HBDIL.js";import"./chunk-T5UMHPAB.js";import"./chunk-NVKLYDOH.js";import"./chunk-E26OT26O.js";import{a as g}from"./chunk-6UTZXEW3.js";import{c as h}from"./chunk-4DAKKAK7.js";import"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as $}from"./chunk-XMSNLMWU.js";import{a as I,b as _,c as q,d as p,e as o,f as i}from"./chunk-HHRYM6UW.js";import{a as S,e as K}from"./chunk-JSDKOE4U.js";import{C as F,l as T}from"./chunk-BFE2DRP6.js";import{a as d,d as k,e as ne,f as oe,g as ie}from"./chunk-OXFKZ4BM.js";var Q=k(oe(),1),G=k(ne(),1);var e=k(ie(),1);var H="agent_threads",de="agent_messages",L="agent_run_queue",J=100,N=250,le={},ce={filters:[],limit:J,offset:0,orderBy:{column:"updatedAt",direction:"desc"},skipCount:!0,table:H},c=d((s,t)=>{let a=s[t];return typeof a=="string"?a:void 0},"c"),B=d((s,t)=>{let a=s[t];return typeof a=="number"?a:void 0},"E"),O=d(s=>{let{usage:t}=s;if(t===null||typeof t!="object")return;let{totalTokens:a}=t;return typeof a=="number"?a:void 0},"H"),me=d(s=>{let{toolCalls:t}=s;return Array.isArray(t)?t.map(a=>a!==null&&typeof a=="object"?a.name:void 0).filter(a=>typeof a=="string"):[]},"de"),ue=d(s=>{switch(s){case"awaiting_input":return"warning";case"cancelled":return"warning";case"error":return"destructive";case"running":return"info";default:return"outline"}},"le"),he=d(s=>{switch(s){case"approved":return"success";case"rejected":return"destructive";default:return"warning"}},"ie"),ge=d(s=>{let t=(0,Q.c)(3),{fetched:a}=s,m=T(),l;return t[0]!==a||t[1]!==m?(l=a<=N?null:(0,e.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"agents-messages-truncated",children:m("Showing the latest {count} messages; older ones are not shown.",{count:N})}),t[0]=a,t[1]=m,t[2]=l):l=t[2],l},"ce"),Te=d(({initialShardKey:s=""})=>{let t=T(),[a,m]=(0,G.useState)(void 0),{data:l}=h(g.listTables,le,{live:!0,shardKey:s}),V=l!==void 0,f=Array.isArray(l)&&l.some(r=>r.name===H),W=Array.isArray(l)&&l.some(r=>r.name===L),{data:E,error:X,errorSource:Y,liveError:Z}=h(g.readTablePage,ce,{enabled:f,live:!0,shardKey:s}),ee={filters:[{column:"threadKey",operator:"eq",value:a??""}],limit:N+1,offset:0,orderBy:{column:"seq",direction:"desc"},skipCount:!0,table:de},{data:P}=h(g.readTablePage,{limit:J,offset:0,orderBy:{column:"position",direction:"asc"},skipCount:!0,table:L},{enabled:W,live:!0,shardKey:s}),{data:U,error:te,errorSource:ae}=h(g.readTablePage,ee,{enabled:f&&a!==void 0,live:!0,shardKey:s}),b=Array.isArray(E?.rows)?E.rows:[],re=Array.isArray(P?.rows)?P.rows:[],z=d(r=>re.filter(n=>c(n,"threadKey")===r).length,"C"),M=Array.isArray(U?.rows)?U.rows:[],R=M.slice(0,N).toReversed(),D=b.find(r=>c(r,"key")===a),x;return V&&!f?x=(0,e.jsx)($,{description:t("No @lunora/agent tables found in this deployment. Add lunora/agents.ts with defineAgent(...) and merge the agent schema extension to run durable AI agents."),testId:"agents-unconfigured",title:t("No agents configured")}):f&&b.length===0?x=(0,e.jsx)($,{description:t("No agent has run yet. Start a run with ctx.agents.<name>.run(...) and its thread appears here."),testId:"agents-empty",title:t("No agent threads yet")}):x=(0,e.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,e.jsx)(S,{className:"overflow-hidden py-0",children:(0,e.jsx)(K,{className:"px-0",children:(0,e.jsxs)(I,{"data-testid":"agents-threads-table",children:[(0,e.jsx)(_,{children:(0,e.jsxs)(p,{children:[(0,e.jsx)(o,{children:t("Agent")}),(0,e.jsx)(o,{children:t("Key")}),(0,e.jsx)(o,{children:t("Status")}),(0,e.jsx)(o,{children:t("Queued")}),(0,e.jsx)(o,{children:t("Messages")}),(0,e.jsx)(o,{children:t("Tokens")}),(0,e.jsx)(o,{children:t("Updated")}),(0,e.jsx)(o,{"aria-label":t("Actions")})]})}),(0,e.jsx)(q,{children:b.map(r=>{let n=c(r,"key")??"",u=c(r,"status"),y=O(r);return(0,e.jsxs)(p,{"data-active":n===a?"":void 0,"data-testid":`agents-thread-${n}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs",children:c(r,"agent")??"\u2014"}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:n}),(0,e.jsx)(i,{children:(0,e.jsx)(v,{"data-testid":`agents-thread-status-${n}`,variant:ue(u),children:u??"\u2014"})}),(0,e.jsx)(i,{className:"tabular-nums",children:z(n)===0?(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}):(0,e.jsx)(v,{"data-testid":`agents-thread-queued-${n}`,variant:"warning",children:z(n)})}),(0,e.jsx)(i,{className:"tabular-nums",children:B(r,"messageCount")??"\u2014"}),(0,e.jsx)(i,{className:"tabular-nums text-muted-foreground",children:y??"\u2014"}),(0,e.jsx)(i,{className:"text-muted-foreground tabular-nums",children:F(B(r,"updatedAt"),"\u2014")}),(0,e.jsx)(i,{className:"text-right",children:(0,e.jsx)(C,{"data-testid":`agents-thread-open-${n}`,onClick:d(()=>{m(n)},"onClick"),size:"sm",type:"button",variant:"outline",children:t("Timeline")})})]},n)})})]})})}),te!==null&&(0,e.jsx)(j,{error:ae,testId:"agents-messages-error"}),a!==void 0&&(0,e.jsx)(S,{className:"overflow-hidden py-0","data-testid":"agents-thread-detail",children:(0,e.jsxs)(K,{className:"flex flex-col gap-3 px-4 py-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("span",{className:"font-mono text-xs",children:[t("Timeline")," \xB7 ",a,D!==void 0&&(0,e.jsxs)("span",{className:"text-muted-foreground",children:[" \xB7 ",t("Usage"),": ",O(D)??0," ",t("Tokens")]})]}),(0,e.jsx)(C,{"data-testid":"agents-thread-detail-close",onClick:d(()=>{m(void 0)},"onClick"),size:"xs",type:"button",variant:"ghost",children:t("Close")})]}),(0,e.jsx)(ge,{fetched:M.length}),R.length===0?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:t("This thread has no messages yet.")}):(0,e.jsxs)(I,{"data-testid":"agents-messages-table",children:[(0,e.jsx)(_,{children:(0,e.jsxs)(p,{children:[(0,e.jsx)(o,{children:t("Role")}),(0,e.jsx)(o,{children:t("Content")}),(0,e.jsx)(o,{children:t("Tool")}),(0,e.jsx)(o,{children:t("Approval")})]})}),(0,e.jsx)(q,{children:R.map((r,n)=>{let u=c(r,"role")??"\u2014",y=me(r),se=c(r,"toolName"),w=c(r,"status"),A=B(r,"seq")??n;return(0,e.jsxs)(p,{"data-testid":`agents-message-${String(A)}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs align-top text-muted-foreground",children:u}),(0,e.jsx)(i,{className:"max-w-md font-mono text-xs whitespace-pre-wrap break-words",children:c(r,"content")??"\u2014"}),(0,e.jsx)(i,{className:"font-mono text-xs align-top text-muted-foreground",children:se??(y.length>0?y.join(", "):"\u2014")}),(0,e.jsx)(i,{className:"align-top",children:w===void 0?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"}):(0,e.jsx)(v,{"data-testid":`agents-message-approval-${String(A)}`,variant:he(w),children:w})})]},c(r,"messageKey")??`${u}:${String(A)}`)})})]})]})})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-agents-panel",children:[X!==null&&(0,e.jsx)(j,{error:Y,testId:"agents-error"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t("Agents run as durable workflows. Each run persists a thread of assistant and tool messages; select a thread to inspect its timeline, tool calls, approvals, and token usage.")}),Z!==void 0&&(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-500","data-testid":"agents-live-error",role:"alert",children:t("Live updates unavailable; showing the last evaluation.")}),x]})},"Ee");export{Te as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as c}from"./chunk-IH2CJZF2.js";import{i as e}from"./chunk-LUHXNZI4.js";import{y as m}from"./chunk-BFE2DRP6.js";import{a as s,d as p,f as n}from"./chunk-OXFKZ4BM.js";var f=p(n(),1);var h=s(r=>{let t=(0,f.c)(3),a=e(),o;return t[0]!==a||t[1]!==r?(o=s(i=>{c({shardKey:r,traceId:i}),m(a({to:"/traces"}))},"e"),t[0]=a,t[1]=r,t[2]=o):o=t[2],o},"u");export{h as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as Be,b as Ue,c as We,d as De,e as we}from"./chunk-TCYPNSTV.js";import"./chunk-A566HCBX.js";import"./chunk-LIGOLZND.js";import{a as je}from"./chunk-Q6HA3L2H.js";import{a as qe}from"./chunk-KYAG2YMF.js";import"./chunk-KRPXOSBL.js";import"./chunk-W2BCSK5S.js";import"./chunk-NGVP66OH.js";import"./chunk-XYR5NST4.js";import{a as ze}from"./chunk-5DNGK3NT.js";import{a as _e}from"./chunk-XST3UEHU.js";import"./chunk-SLIDAWNX.js";import"./chunk-6M7FLLMT.js";import"./chunk-ZTOREMGH.js";import{i as ke}from"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as ie}from"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as me}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import"./chunk-E26OT26O.js";import{a as U}from"./chunk-6UTZXEW3.js";import{c as Ee}from"./chunk-4DAKKAK7.js";import{m as be}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as Ae}from"./chunk-XMSNLMWU.js";import{a as Le,b as Re,c as Ve,d as pe,e as B,f as L}from"./chunk-HHRYM6UW.js";import{a as Me,e as Ce}from"./chunk-JSDKOE4U.js";import{C as Te,e as Se,f as $e,l as ue,n as re,o as Ne,p as Ke,y as le}from"./chunk-BFE2DRP6.js";import{a as d,d as ye,e as Oe,f as Ge,g as He}from"./chunk-OXFKZ4BM.js";var ge=ye(Ge(),1);var ne=ye(Oe(),1);var t=ye(He(),1);var Ie="none",Je=["all","open","resolved","ignored"],Pe=["critical","high","medium","low"],Qe=re(U.resolveIssue),Xe=re(U.ignoreIssue),Fe=re(U.assignIssue),Ye=re(U.setIssueSeverity),Ze=re(U.explainIssue),es=d(n=>Array.isArray(n?.issues)?n.issues:[],"Xe"),ss=d(n=>n==="resolved"?"success":n==="ignored"?"secondary":"warning","Je"),ts=d(n=>n==="critical"?"destructive":n==="high"?"warning":n==="medium"?"info":"secondary","Ze"),as=d(n=>{let e=(0,ge.c)(44),{expanded:u,issue:s,shardKey:$}=n,i=be(),l=ue(),[a,o]=(0,ne.useState)(void 0),{busy:_,error:A,run:R}=je(),K;e[0]!==i||e[1]!==s||e[2]!==R||e[3]!==$?(K=d(()=>{o(void 0),R(async()=>{let g={culprit:s.culprit,sampleMessage:s.sampleMessage,title:s.title},S=await i.query(Ze,g,Ne($));o(S)})},"C"),e[0]=i,e[1]=s,e[2]=R,e[3]=$,e[4]=K):K=e[4];let z=K;if(!u)return null;let k;if(e[5]!==s.sampleMessage){let g=$e(s.sampleMessage);k=g===void 0?void 0:Se(g.body),e[5]=s.sampleMessage,e[6]=k}else k=e[6];let T=k,E=`issues-detail-${s.hash}`,h;e[7]!==s.sampleMessage?(h=(0,t.jsx)("p",{className:"whitespace-pre-wrap font-mono text-xs text-muted-foreground",children:s.sampleMessage}),e[7]=s.sampleMessage,e[8]=h):h=e[8];let x;e[9]!==l?(x=l("Suggested fix"),e[9]=l,e[10]=x):x=e[10];let M;e[11]!==x?(M=(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:x}),e[11]=x,e[12]=M):M=e[12];let v;e[13]!==T||e[14]!==s.hash||e[15]!==l?(v=T===void 0?(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground","data-testid":`issues-hint-empty-${s.hash}`,children:l("No known fix for this error yet.")}):(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm","data-testid":`issues-hint-${s.hash}`,children:T}),e[13]=T,e[14]=s.hash,e[15]=l,e[16]=v):v=e[16];let y;e[17]!==M||e[18]!==v?(y=(0,t.jsxs)("div",{children:[M,v]}),e[17]=M,e[18]=v,e[19]=y):y=e[19];let b=`issues-explain-${s.hash}`,w;e[20]!==_||e[21]!==l?(w=l(_?"Explaining\u2026":"Explain in plain language"),e[20]=_,e[21]=l,e[22]=w):w=e[22];let m;e[23]!==_||e[24]!==z||e[25]!==w||e[26]!==b?(m=(0,t.jsx)("div",{children:(0,t.jsx)(ie,{"data-testid":b,disabled:_,onClick:z,size:"sm",type:"button",variant:"outline",children:w})}),e[23]=_,e[24]=z,e[25]=w,e[26]=b,e[27]=m):m=e[27];let f;e[28]!==A||e[29]!==s.hash?(f=A!==null&&(0,t.jsx)("p",{className:"text-xs text-destructive","data-testid":`issues-explain-error-${s.hash}`,role:"alert",children:A}),e[28]=A,e[29]=s.hash,e[30]=f):f=e[30];let p;e[31]!==a||e[32]!==s.hash||e[33]!==l?(p=a!==void 0&&(a.degraded?(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":`issues-degraded-${s.hash}`,children:a.reason==="no-ai-binding"?l("No AI binding is configured. Wire an AI binding to enable plain-language explanations \u2014 the suggested fix above is always available."):l("The AI model could not explain this error right now. The suggested fix above still applies.")}):(0,t.jsxs)("div",{"data-testid":`issues-explanation-${s.hash}`,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:l("AI explanation")}),(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm",children:a.explanation}),a.groundedId===void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground","data-testid":`issues-ungrounded-${s.hash}`,children:l("No catalog fix matched this error, so this explanation is the model's own reading of the message. Verify before acting on it.")}),(0,t.jsx)("p",{className:"mt-1 text-[0.7rem] text-muted-foreground",children:l("Generated by {model}",{model:a.model})})]})),e[31]=a,e[32]=s.hash,e[33]=l,e[34]=p):p=e[34];let c;e[35]!==m||e[36]!==f||e[37]!==p||e[38]!==h||e[39]!==y?(c=(0,t.jsx)(L,{className:"bg-muted/30",colSpan:7,children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 py-1",children:[h,y,m,f,p]})}),e[35]=m,e[36]=f,e[37]=p,e[38]=h,e[39]=y,e[40]=c):c=e[40];let I;return e[41]!==c||e[42]!==E?(I=(0,t.jsx)(pe,{"data-testid":E,children:c}),e[41]=c,e[42]=E,e[43]=I):I=e[43],I},"et"),is=d(n=>{let e=(0,ge.c)(119),{busy:u,issue:s,rowError:$,runTriage:i,shardKey:l}=n,a=ue(),[o,_]=(0,ne.useState)(!1),A;e[0]===Symbol.for("react.memo_cache_sentinel")?(A=d(()=>{_(rs)},"A"),e[0]=A):A=e[0];let R=A,K;e[1]!==s.hash||e[2]!==i?(K=d(ae=>{let ce=ae===null||ae===Ie?null:ae;le(i(s.hash,Ye,{severity:ce}))},"C"),e[1]=s.hash,e[2]=i,e[3]=K):K=e[3];let z=K,k;e[4]!==s.hash||e[5]!==i?(k=d(ae=>{if(ae.key!=="Enter")return;let ce=ae.currentTarget.value.trim();le(i(s.hash,Fe,{assignee:ce===""?null:ce}))},"T"),e[4]=s.hash,e[5]=i,e[6]=k):k=e[6];let T=k,E=`issues-row-${s.hash}`,h;e[7]!==a?(h=a("Toggle issue details"),e[7]=a,e[8]=h):h=e[8];let x=`issues-toggle-${s.hash}`,M=`mt-1 size-3 shrink-0 text-muted-foreground transition-transform ${o?"rotate-90":""}`,v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(0,t.jsx)("path",{d:"m9 6 6 6-6 6"}),e[9]=v):v=e[9];let y;e[10]!==M?(y=(0,t.jsx)("svg",{"aria-hidden":"true",className:M,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:v}),e[10]=M,e[11]=y):y=e[11];let b;e[12]!==s.title?(b=(0,t.jsx)("span",{className:"block truncate font-medium",title:s.title,children:s.title}),e[12]=s.title,e[13]=b):b=e[13];let w;e[14]!==s.culprit?(w=(0,t.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",title:s.culprit,children:s.culprit}),e[14]=s.culprit,e[15]=w):w=e[15];let m;e[16]!==b||e[17]!==w?(m=(0,t.jsxs)("span",{className:"min-w-0",children:[b,w]}),e[16]=b,e[17]=w,e[18]=m):m=e[18];let f;e[19]!==o||e[20]!==m||e[21]!==h||e[22]!==x||e[23]!==y?(f=(0,t.jsxs)("button",{"aria-expanded":o,"aria-label":h,className:"flex w-full items-start gap-2 text-left","data-testid":x,onClick:R,type:"button",children:[y,m]}),e[19]=o,e[20]=m,e[21]=h,e[22]=x,e[23]=y,e[24]=f):f=e[24];let p;e[25]!==s.hash||e[26]!==$?(p=$!==void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-destructive","data-testid":`issues-action-error-${s.hash}`,role:"alert",children:$}),e[25]=s.hash,e[26]=$,e[27]=p):p=e[27];let c;e[28]!==f||e[29]!==p?(c=(0,t.jsxs)(L,{className:"max-w-80",children:[f,p]}),e[28]=f,e[29]=p,e[30]=c):c=e[30];let I=`issues-status-${s.hash}`,g;e[31]!==s.status?(g=ss(s.status),e[31]=s.status,e[32]=g):g=e[32];let S;e[33]!==s.status||e[34]!==I||e[35]!==g?(S=(0,t.jsx)(L,{children:(0,t.jsx)(me,{"data-testid":I,variant:g,children:s.status})}),e[33]=s.status,e[34]=I,e[35]=g,e[36]=S):S=e[36];let V=s.severity??Ie,r;e[37]!==a?(r=a("Set severity"),e[37]=a,e[38]=r):r=e[38];let oe=`issues-severity-${s.hash}`,j;e[39]!==a?(j=a("\u2014"),e[39]=a,e[40]=j):j=e[40];let N;e[41]!==s.severity||e[42]!==a?(N=s.severity===void 0?(0,t.jsx)("span",{className:"text-muted-foreground",children:a("\u2014")}):(0,t.jsx)(me,{variant:ts(s.severity),children:s.severity}),e[41]=s.severity,e[42]=a,e[43]=N):N=e[43];let C;e[44]!==j||e[45]!==N?(C=(0,t.jsx)(Ue,{placeholder:j,children:N}),e[44]=j,e[45]=N,e[46]=C):C=e[46];let q;e[47]!==r||e[48]!==oe||e[49]!==C?(q=(0,t.jsx)(We,{"aria-label":r,className:"h-7 w-[110px]","data-testid":oe,children:C}),e[47]=r,e[48]=oe,e[49]=C,e[50]=q):q=e[50];let de;e[51]===Symbol.for("react.memo_cache_sentinel")?(de=Pe.map(ls),e[51]=de):de=e[51];let W;e[52]!==a?(W=a("Clear"),e[52]=a,e[53]=W):W=e[53];let D;e[54]!==W?(D=(0,t.jsxs)(De,{children:[de,(0,t.jsx)(we,{value:Ie,children:W})]}),e[54]=W,e[55]=D):D=e[55];let F;e[56]!==u||e[57]!==z||e[58]!==V||e[59]!==q||e[60]!==D?(F=(0,t.jsx)(L,{children:(0,t.jsxs)(Be,{disabled:u,onValueChange:z,value:V,children:[q,D]})}),e[56]=u,e[57]=z,e[58]=V,e[59]=q,e[60]=D,e[61]=F):F=e[61];let O;e[62]!==a?(O=a("Assignee"),e[62]=a,e[63]=O):O=e[63];let fe=`issues-assignee-${s.hash}`,xe=s.assignee??"",ve=s.assignee??"",G;e[64]!==a?(G=a("Unassigned"),e[64]=a,e[65]=G):G=e[65];let H;e[66]!==u||e[67]!==T||e[68]!==O||e[69]!==fe||e[70]!==xe||e[71]!==ve||e[72]!==G?(H=(0,t.jsx)(L,{children:(0,t.jsx)(ke,{"aria-label":O,className:"h-7 w-32","data-testid":fe,defaultValue:xe,disabled:u,onKeyDown:T,placeholder:G},ve)}),e[66]=u,e[67]=T,e[68]=O,e[69]=fe,e[70]=xe,e[71]=ve,e[72]=G,e[73]=H):H=e[73];let J;e[74]!==s.count?(J=(0,t.jsx)(L,{className:"text-right",children:(0,t.jsx)(me,{variant:"secondary",children:s.count})}),e[74]=s.count,e[75]=J):J=e[75];let P;e[76]!==s.lastSeen?(P=Te(s.lastSeen),e[76]=s.lastSeen,e[77]=P):P=e[77];let Q;e[78]!==P?(Q=(0,t.jsx)(L,{className:"text-xs tabular-nums text-muted-foreground",children:P}),e[78]=P,e[79]=Q):Q=e[79];let X;e[80]!==u||e[81]!==s.hash||e[82]!==s.status||e[83]!==i||e[84]!==a?(X=s.status!=="resolved"&&(0,t.jsx)(ie,{"data-testid":`issues-resolve-${s.hash}`,disabled:u,onClick:d(()=>{le(i(s.hash,Qe,{}))},"onClick"),size:"xs",variant:"outline",children:a("Resolve")}),e[80]=u,e[81]=s.hash,e[82]=s.status,e[83]=i,e[84]=a,e[85]=X):X=e[85];let Y;e[86]!==u||e[87]!==s.hash||e[88]!==s.status||e[89]!==i||e[90]!==a?(Y=s.status!=="ignored"&&(0,t.jsx)(ie,{"data-testid":`issues-ignore-${s.hash}`,disabled:u,onClick:d(()=>{le(i(s.hash,Xe,{}))},"onClick"),size:"xs",variant:"ghost",children:a("Ignore")}),e[86]=u,e[87]=s.hash,e[88]=s.status,e[89]=i,e[90]=a,e[91]=Y):Y=e[91];let Z;e[92]!==u||e[93]!==s.assignee||e[94]!==s.hash||e[95]!==s.status||e[96]!==i||e[97]!==a?(Z=s.status!=="open"&&(0,t.jsx)(ie,{"data-testid":`issues-reopen-${s.hash}`,disabled:u,onClick:d(()=>{le(i(s.hash,Fe,{assignee:s.assignee??null}))},"onClick"),size:"xs",variant:"ghost",children:a("Reopen")}),e[92]=u,e[93]=s.assignee,e[94]=s.hash,e[95]=s.status,e[96]=i,e[97]=a,e[98]=Z):Z=e[98];let ee;e[99]!==X||e[100]!==Y||e[101]!==Z?(ee=(0,t.jsx)(L,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:[X,Y,Z]})}),e[99]=X,e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let se;e[103]!==c||e[104]!==S||e[105]!==F||e[106]!==H||e[107]!==J||e[108]!==Q||e[109]!==E||e[110]!==ee?(se=(0,t.jsxs)(pe,{"data-testid":E,children:[c,S,F,H,J,Q,ee]}),e[103]=c,e[104]=S,e[105]=F,e[106]=H,e[107]=J,e[108]=Q,e[109]=E,e[110]=ee,e[111]=se):se=e[111];let te;e[112]!==o||e[113]!==s||e[114]!==l?(te=(0,t.jsx)(as,{expanded:o,issue:s,shardKey:l},s.sampleMessage),e[112]=o,e[113]=s,e[114]=l,e[115]=te):te=e[115];let he;return e[116]!==se||e[117]!==te?(he=(0,t.jsxs)(t.Fragment,{children:[se,te]}),e[116]=se,e[117]=te,e[118]=he):he=e[118],he},"tt"),ks=d(n=>{let e=(0,ge.c)(38),{initialShardKey:u}=n,s=ue(),$=be(),{queryShardKey:i,setShardKey:l,shardKey:a}=ze(u),[o,_]=(0,ne.useState)("all"),[A,R]=(0,ne.useState)(ns),[K,z]=(0,ne.useState)(os),k;e[0]!==o?(k=o==="all"?{}:{status:o},e[0]=o,e[1]=k):k=e[1];let T;e[2]!==i?(T={live:!0,shardKey:i},e[2]=i,e[3]=T):T=e[3];let{data:E,error:h,liveError:x}=Ee(U.getIssues,k,T),M=E!==void 0,v;if(e[4]!==K||e[5]!==A||e[6]!==$||e[7]!==E||e[8]!==h||e[9]!==x||e[10]!==M||e[11]!==i||e[12]!==l||e[13]!==a||e[14]!==o||e[15]!==s){let y=es(E),b;e[17]!==$||e[18]!==i?(b=d(async(r,oe,j)=>{z(N=>{if(!N.has(r))return N;let C=new Map(N);return C.delete(r),C}),R(N=>new Set(N).add(r));try{await $.query(oe,{...j,hash:r},Ne(i))}catch(N){let C=Ke(N);z(q=>new Map(q).set(r,C))}R(N=>{let C=new Set(N);return C.delete(r),C})},"v"),e[17]=$,e[18]=i,e[19]=b):b=e[19];let w=b,m;e[20]!==s?(m=d(r=>s(r==="all"?"All":r==="open"?"Open":r==="resolved"?"Resolved":"Ignored"),"u"),e[20]=s,e[21]=m):m=e[21];let f=m,p;e[22]!==h?(p=h!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"issues-error",role:"alert",children:h}),e[22]=h,e[23]=p):p=e[23];let c;e[24]!==l||e[25]!==a?(c=(0,t.jsx)(_e,{onChange:l,testId:"issues-shard-input",value:a}),e[24]=l,e[25]=a,e[26]=c):c=e[26];let I;e[27]!==x?(I=(0,t.jsx)(qe,{message:x,prefix:"issues"}),e[27]=x,e[28]=I):I=e[28];let g;e[29]!==o||e[30]!==f?(g=Je.map(r=>(0,t.jsx)(ie,{"data-active":o===r?"":void 0,"data-testid":`issues-filter-${r}`,onClick:d(()=>{_(r)},"onClick"),size:"xs",variant:o===r?"default":"outline",children:f(r)},r)),e[29]=o,e[30]=f,e[31]=g):g=e[31];let S;e[32]!==g?(S=(0,t.jsx)("div",{className:"ms-auto flex items-center gap-1","data-testid":"issues-status-filter",role:"group",children:g}),e[32]=g,e[33]=S):S=e[33];let V;e[34]!==S||e[35]!==c||e[36]!==I?(V=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,I,S]}),e[34]=S,e[35]=c,e[36]=I,e[37]=V):V=e[37],v=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-issues-panel",children:[p,V,M&&y.length===0?(0,t.jsx)(Ae,{description:s("No grouped errors yet. When a function throws or a container crashes, matching errors fold into a single issue here."),testId:"issues-empty",title:s("No issues")}):(0,t.jsx)(Me,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ce,{className:"px-0",children:(0,t.jsxs)(Le,{"data-testid":"issues-table",children:[(0,t.jsx)(Re,{children:(0,t.jsxs)(pe,{children:[(0,t.jsx)(B,{children:s("Issue")}),(0,t.jsx)(B,{children:s("Status")}),(0,t.jsx)(B,{children:s("Severity")}),(0,t.jsx)(B,{children:s("Assignee")}),(0,t.jsx)(B,{className:"text-right",children:s("Events")}),(0,t.jsx)(B,{children:s("Last seen")}),(0,t.jsx)(B,{className:"text-right",children:s("Actions")})]})}),(0,t.jsx)(Ve,{children:y.map(r=>(0,t.jsx)(is,{busy:A.has(r.hash),issue:r,rowError:K.get(r.hash),runTriage:w,shardKey:i},r.hash))})]})})})]}),e[4]=K,e[5]=A,e[6]=$,e[7]=E,e[8]=h,e[9]=x,e[10]=M,e[11]=i,e[12]=l,e[13]=a,e[14]=o,e[15]=s,e[16]=v}else v=e[16];return v},"Tt");function rs(n){return!n}d(rs,"st");function ls(n){return(0,t.jsx)(we,{value:n,children:n},n)}d(ls,"at");function ns(){return new Set}d(ns,"it");function os(){return new Map}d(os,"lt");export{ks as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as s}from"./chunk-4DAKKAK7.js";import{a as n}from"./chunk-OXFKZ4BM.js";var b="__lunora_admin__:",g=new Set(["action","mutation","query"]),c=Symbol("lunora.operationSeq"),_=n(t=>{if(typeof t!="object"||t===null)return;let e=t[c];return typeof e=="number"?e:void 0},"g"),d=n((t,e)=>{if(!(typeof t!="object"||t===null||!Object.isExtensible(t)))try{Object.defineProperty(t,c,{configurable:!0,enumerable:!1,value:e,writable:!0})}catch{}},"h"),m=n(t=>{if(typeof t!="object"||t===null)return;let e=t.__lunoraRef;return typeof e=="string"&&e.startsWith(b)?e:void 0},"p"),h=n(t=>{if(typeof t!="object"||t===null)return"";let{shardKey:e}=t;return typeof e=="string"?e:""},"O"),w=n(t=>new Proxy(t,{get(e,u,y){let i=Reflect.get(e,u,y);if(typeof i!="function"||typeof u!="string"||!g.has(u))return typeof i=="function"?i.bind(e):i;let f=i;return async(...o)=>{let l=m(o[0]);if(l===void 0)return f.apply(e,o);let p=typeof o[1]=="object"&&o[1]!==null?o[1]:{},a=s.start(l,p,h(o[2]));try{let r=await f.apply(e,o);return s.settle(a,{result:r}),r}catch(r){throw s.settle(a,{error:r instanceof Error?r.message:String(r)}),d(r,a),r}}}}),"E");export{_ as a,w as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as L,d as W,e as $,f as q,h as D,i as F,j as H,k as A,l as S,m as I,n as J,o as M,p as P}from"./chunk-O2NMPIV2.js";import{b as O}from"./chunk-JZD7ZN3F.js";import{a as X,b as z,c as B,d as K,e as E,f as G}from"./chunk-HHRYM6UW.js";import{l as C,x as j}from"./chunk-BFE2DRP6.js";import{a as f,d as T,f as U,g as V}from"./chunk-OXFKZ4BM.js";var N=T(U(),1);var t=T(V(),1);var _=50,R={value:{colors:{dark:["var(--chart-1)"],light:["var(--chart-1)"]},label:"value"}},Q=f(r=>{let a=r.columns.find(e=>r.rows.length>0&&r.rows.every(n=>typeof n[e]=="number"))??null;return{label:r.columns.find(e=>e!==a)??null,value:a}},"D"),Y=f(r=>{let a=(0,N.c)(3),{data:e,kind:n}=r,l;return a[0]!==e||a[1]!==n?(l=(0,t.jsx)(H,{className:"h-full w-full",config:R,children:n==="area"?(0,t.jsxs)(F,{data:e,children:[(0,t.jsx)(L,{vertical:!1}),(0,t.jsx)(q,{axisLine:!1,dataKey:"label",tickLine:!1}),(0,t.jsx)(S,{content:(0,t.jsx)(A,{})}),(0,t.jsx)($,{dataKey:"value",fill:"var(--color-value-0)",fillOpacity:.2,stroke:"var(--color-value-0)",type:"monotone"})]}):(0,t.jsxs)(D,{data:e,children:[(0,t.jsx)(L,{vertical:!1}),(0,t.jsx)(q,{axisLine:!1,dataKey:"label",tickLine:!1}),(0,t.jsx)(S,{content:(0,t.jsx)(A,{})}),(0,t.jsx)(W,{dataKey:"value",dot:!1,stroke:"var(--color-value-0)",strokeWidth:2,type:"monotone"})]})}),a[0]=e,a[1]=n,a[2]=l):l=a[2],l},"J"),na=f(r=>{let a=(0,N.c)(21),{axes:e,kind:n,result:l}=r,u=C(),o;a[0]!==l?(o=Q(l),a[0]=l,a[1]=o):o=a[1];let d=o,m;a[2]!==l.columns?(m=new Set(l.columns),a[2]=l.columns,a[3]=m):m=a[3];let s=m,c=e!==void 0&&s.has(e.x)?e.x:d.label,p;a[4]!==e?.y||a[5]!==s?(p=e?.y.find(i=>s.has(i)),a[4]=e?.y,a[5]=s,a[6]=p):p=a[6];let x=p,y=x??d.value,b;a[7]!==c||a[8]!==l.rows||a[9]!==y?(b=y===null?[]:l.rows.slice(0,_).map((i,w)=>({label:c===null?`#${(w+1).toString()}`:j(i[c]),value:Number(i[y])||0})),a[7]=c,a[8]=l.rows,a[9]=y,a[10]=b):b=a[10];let k=b;if(y===null){let i;a[11]!==u?(i=u("No numeric column to chart."),a[11]=u,a[12]=i):i=a[12];let w;return a[13]!==i?(w=(0,t.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-chart-empty",children:i}),a[13]=i,a[14]=w):w=a[14],w}let h=n??(e!==void 0&&x!==void 0?e.kind:"bar"),v;a[15]!==k||a[16]!==h?(v=h==="bar"?(0,t.jsxs)(I,{className:"h-full w-full",config:R,data:k,children:[(0,t.jsx)(M,{dataKey:"label"}),(0,t.jsx)(J,{dataKey:"value"}),(0,t.jsx)(P,{})]}):(0,t.jsx)(Y,{data:k,kind:h}),a[15]=k,a[16]=h,a[17]=v):v=a[17];let g;return a[18]!==h||a[19]!==v?(g=(0,t.jsx)("div",{className:"h-80 w-full p-3","data-chart-kind":h,"data-testid":"sql-chart",children:v}),a[18]=h,a[19]=v,a[20]=g):g=a[20],g},"oe"),oa=f(r=>{let a=(0,N.c)(19),{result:e}=r,n=C();if(e.columns.length===0){let s;a[0]!==e.rowCount||a[1]!==n?(s=n("{count} rows",{count:e.rowCount}),a[0]=e.rowCount,a[1]=n,a[2]=s):s=a[2];let c;return a[3]!==s?(c=(0,t.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:s}),a[3]=s,a[4]=c):c=a[4],c}let l;a[5]!==e.columns?(l=e.columns.map(Z),a[5]=e.columns,a[6]=l):l=a[6];let u;a[7]!==l?(u=(0,t.jsx)(z,{className:"sticky top-0 z-10 bg-muted",children:(0,t.jsx)(K,{children:l})}),a[7]=l,a[8]=u):u=a[8];let o;if(a[9]!==e.columns||a[10]!==e.rows){let s;a[12]!==e.columns?(s=f((c,p)=>(0,t.jsx)(K,{"data-testid":"sql-row",children:e.columns.map(x=>(0,t.jsx)(G,{className:"max-w-md truncate font-mono text-xs",children:(0,t.jsx)(O,{value:c[x]})},x))},p),"s"),a[12]=e.columns,a[13]=s):s=a[13],o=e.rows.map(s),a[9]=e.columns,a[10]=e.rows,a[11]=o}else o=a[11];let d;a[14]!==o?(d=(0,t.jsx)(B,{children:o}),a[14]=o,a[15]=d):d=a[15];let m;return a[16]!==u||a[17]!==d?(m=(0,t.jsxs)(X,{"data-testid":"sql-rows",children:[u,d]}),a[16]=u,a[17]=d,a[18]=m):m=a[18],m},"ne");function Z(r){return(0,t.jsx)(E,{children:r},r)}f(Z,"P");export{na as a,oa as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as q}from"./chunk-XSHYZPGF.js";import"./chunk-O2NMPIV2.js";import{a as k}from"./chunk-MWJC3S62.js";import"./chunk-IH2CJZF2.js";import"./chunk-SYGCASPT.js";import"./chunk-ZGSL4DPP.js";import{a as A}from"./chunk-5DNGK3NT.js";import{a as $}from"./chunk-XST3UEHU.js";import"./chunk-SLIDAWNX.js";import"./chunk-6M7FLLMT.js";import"./chunk-LUHXNZI4.js";import"./chunk-ZTOREMGH.js";import"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import"./chunk-ZBON5T5A.js";import{b as K}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{a as F}from"./chunk-CZ6HBDIL.js";import"./chunk-T5UMHPAB.js";import"./chunk-NVKLYDOH.js";import"./chunk-E26OT26O.js";import{a as T}from"./chunk-6UTZXEW3.js";import{c as S}from"./chunk-4DAKKAK7.js";import"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as O}from"./chunk-XMSNLMWU.js";import{a as j,e as w}from"./chunk-JSDKOE4U.js";import{C as E,l as I}from"./chunk-BFE2DRP6.js";import{a as p,d as C,f as D,g as H}from"./chunk-OXFKZ4BM.js";var M=C(D(),1);var m=C(H(),1);var L=p(s=>s.length===0?void 0:{max:Math.max(...s),mean:s.reduce((e,t)=>e+t,0)/s.length,min:Math.min(...s)},"F"),B=/^gen_ai\.evaluation\.(.+)\.score$/u,P=p(s=>{let e=[];for(let t of s)for(let n of t.spans)for(let[a,l]of Object.entries(n.attributes??{})){let o=B.exec(a);if(!o||typeof l!="number")continue;let i=o[1],c=n.attributes?.[`gen_ai.evaluation.${i}.label`];e.push({...typeof c=="string"?{label:c}:{},name:i,score:l,spanName:n.name,startTs:t.startTs+n.offsetMs,traceId:t.traceId})}return e.toSorted((t,n)=>n.startTs-t.startTs)},"q"),Q=p(s=>{let e=[];for(let t of s?.series??[]){let n=B.exec(t.name);n&&e.push({name:n[1],points:t.points})}return e},"D"),R=p((s,e)=>{let t=new Set([...s.map(a=>a.name),...e.map(a=>a.name)]),n=[];for(let a of t){let l=s.filter(r=>r.name===a),o=e.find(r=>r.name===a)?.points??[],i=o.at(-1)?.last??l[0]?.score,c=o.length>0?{max:Math.max(...o.map(r=>r.max)),mean:o.reduce((r,d)=>r+d.sum,0)/o.reduce((r,d)=>r+d.count,0),min:Math.min(...o.map(r=>r.min))}:L(l.map(r=>r.score));n.push({...i===void 0?{}:{latest:i},...c,name:a,points:o,runs:l})}return n.toSorted((a,l)=>a.name.localeCompare(l.name))},"H"),U=p(s=>Array.isArray(s?.traces)?s.traces:[],"L"),N=p(s=>s===void 0?"\u2014":s.toFixed(2),"y"),z=p(s=>{let e=(0,M.c)(34),{card:t,onOpenTrace:n}=s,a=I(),l;e[0]!==t.name?(l=(0,m.jsx)("h3",{className:"font-mono text-sm font-semibold text-foreground","data-testid":"ev-name",children:t.name}),e[0]=t.name,e[1]=l):l=e[1];let o;e[2]!==t.latest?(o=N(t.latest),e[2]=t.latest,e[3]=o):o=e[3];let i;e[4]!==o?(i=(0,m.jsx)("span",{className:"font-mono text-lg text-foreground","data-testid":"ev-latest",children:o}),e[4]=o,e[5]=i):i=e[5];let c;e[6]!==l||e[7]!==i?(c=(0,m.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[l,i]}),e[6]=l,e[7]=i,e[8]=c):c=e[8];let r;e[9]!==t.max||e[10]!==t.mean||e[11]!==t.min||e[12]!==a?(r=a("min {min} \xB7 mean {mean} \xB7 max {max}",{max:N(t.max),mean:N(t.mean),min:N(t.min)}),e[9]=t.max,e[10]=t.mean,e[11]=t.min,e[12]=a,e[13]=r):r=e[13];let d;e[14]!==r?(d=(0,m.jsx)("p",{className:"font-mono text-xs text-muted-foreground","data-testid":"ev-summary",children:r}),e[14]=r,e[15]=d):d=e[15];let u;e[16]!==t.name||e[17]!==t.points||e[18]!==a?(u=t.points.length>1?(0,m.jsx)(q,{ariaLabel:a("Score trend for {name}",{name:t.name}),className:"h-10 w-full",series:t.points.map(G),testId:"ev-trend"}):(0,m.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"ev-no-trend",children:a("No durable history yet \u2014 pass ctx.metrics to recordEvaluation to chart a trend.")}),e[16]=t.name,e[17]=t.points,e[18]=a,e[19]=u):u=e[19];let h;if(e[20]!==t.runs||e[21]!==n||e[22]!==a){let v;e[24]!==n||e[25]!==a?(v=p(f=>(0,m.jsxs)("div",{className:"flex items-center justify-between gap-2 font-mono text-xs","data-testid":"ev-run",children:[(0,m.jsxs)("span",{className:"truncate text-muted-foreground",children:[E(f.startTs)," \xB7 ",f.spanName]}),(0,m.jsxs)("span",{className:"flex items-center gap-2",children:[f.label===void 0?null:(0,m.jsx)(K,{variant:"outline",children:f.label}),(0,m.jsx)("span",{className:"text-foreground",children:N(f.score)}),n===void 0?null:(0,m.jsx)("button",{className:"text-muted-foreground underline-offset-2 hover:underline",onClick:p(()=>{n(f.traceId)},"onClick"),title:a("Open the trace {trace}",{trace:f.traceId}),type:"button",children:f.traceId.slice(0,8)})]})]},`${f.traceId}:${f.spanName}`),"x"),e[24]=n,e[25]=a,e[26]=v):v=e[26],h=t.runs.slice(0,5).map(v),e[20]=t.runs,e[21]=n,e[22]=a,e[23]=h}else h=e[23];let x;e[27]!==h?(x=(0,m.jsx)("div",{className:"flex flex-col gap-1",children:h}),e[27]=h,e[28]=x):x=e[28];let g;return e[29]!==c||e[30]!==d||e[31]!==u||e[32]!==x?(g=(0,m.jsx)(j,{"data-testid":"ev-card",children:(0,m.jsxs)(w,{className:"flex flex-col gap-3 p-4",children:[c,d,u,x]})}),e[29]=c,e[30]=d,e[31]=u,e[32]=x,e[33]=g):g=e[33],g},"P"),oe=p(s=>{let e=(0,M.c)(19),{initialShardKey:t}=s,n=I(),{queryShardKey:a,setShardKey:l,shardKey:o}=A(t),i=k(a),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];let r;e[1]!==a?(r={live:!0,shardKey:a},e[1]=a,e[2]=r):r=e[2];let{data:d,error:u}=S(T.getTraces,c,r),h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h={},e[3]=h):h=e[3];let x;e[4]!==a?(x={live:!0,shardKey:a},e[4]=a,e[5]=x):x=e[5];let{data:g}=S(T.getMetricHistory,h,x),v;if(e[6]!==d||e[7]!==u||e[8]!==g||e[9]!==i||e[10]!==l||e[11]!==o||e[12]!==n){let f=R(P(U(d)),Q(g)),y;e[14]!==l||e[15]!==o?(y=(0,m.jsx)($,{onChange:l,testId:"ev-shard-input",value:o}),e[14]=l,e[15]=o,e[16]=y):y=e[16];let b;e[17]!==u?(b=u===null?null:(0,m.jsx)(F,{error:u,testId:"ev-error"}),e[17]=u,e[18]=b):b=e[18],v=(0,m.jsxs)("section",{className:"flex flex-col gap-4","data-testid":"ev-panel",children:[y,b,f.length===0?(0,m.jsx)(O,{description:n("Call recordEvaluation from a graded run and its score shows up here."),testId:"ev-empty",title:n("No evals recorded")}):(0,m.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:f.map(_=>(0,m.jsx)(z,{card:_,onOpenTrace:i},_.name))})]}),e[6]=d,e[7]=u,e[8]=g,e[9]=i,e[10]=l,e[11]=o,e[12]=n,e[13]=v}else v=e[13];return v},"re");function G(s){return s.last}p(G,"Q");export{oe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as ne}from"./chunk-CNA3TVUK.js";import{a as A}from"./chunk-KZCEJFZF.js";import{a as re}from"./chunk-FXPAJDES.js";import{a as te}from"./chunk-XST3UEHU.js";import{b as ee}from"./chunk-SLIDAWNX.js";import"./chunk-6M7FLLMT.js";import{i as q}from"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as w}from"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as O}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{a as Q}from"./chunk-6UTZXEW3.js";import{c as I,d as P,m as Y}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{C as X,l as U,m as W,n as G,p as j,v as V,y as H}from"./chunk-BFE2DRP6.js";import{a as o,d as M,e as he,g as ge}from"./chunk-OXFKZ4BM.js";var c=M(he(),1);var n=M(ge(),1);var be=o(t=>t.kind==="id"?t.table===void 0?"id":`id<${t.table}>`:t.kind==="array"?t.element===void 0?"array":`${t.element}[]`:t.kind,"me"),xe=o(t=>t===void 0||t.length===0?"()":`(${t.map(e=>`${e.name}${e.optional?"?":""}: ${be(e)}`).join(", ")})`,"ge"),ye=o(t=>{switch(t){case"array":return[];case"bigint":return I(0n);case"boolean":return!1;case"bytes":return I(new ArrayBuffer(0));case"number":return 0;case"object":case"record":return{};default:return""}},"be"),ve=o(t=>{let e={};for(let r of t??[])r.optional||(e[r.name]=ye(r.kind));return JSON.stringify(e,void 0,2)},"xe"),Ne=G(Q.runAs),h="\xABsensitive\xBB",we=o(t=>(t??[]).filter(e=>e.sensitive===!0).map(e=>e.name),"ve"),Ae=o((t,e)=>{if(e.length===0)return t;try{let r=JSON.parse(t);if(typeof r!="object"||r===null||Array.isArray(r))return"";let l={...r};for(let i of e)Object.hasOwn(l,i)&&(l[i]=h);return JSON.stringify(l,null,2)}catch{return""}},"Ne"),Se=4,ke=o(t=>{let e=t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);try{return new TextDecoder("utf-8",{fatal:!0}).decode(e)}catch{return}},"Ae"),$e=o(t=>Array.isArray(t)?[]:Object.keys(t).filter(e=>e.length>0),"we"),Ie=o(t=>{let e=[],r=new Set,l=[t];for(;l.length>0;){let i=l.pop();if(typeof i=="string")i.length>0&&e.push(i);else if(typeof i=="number"||typeof i=="bigint")e.push(String(i));else if(i instanceof ArrayBuffer||ArrayBuffer.isView(i)){let u=ke(i);u!==void 0&&u.length>0&&e.push(u)}else typeof i=="object"&&i!==null&&!r.has(i)&&(r.add(i),e.push(...$e(i)),l.push(...Object.values(i)))}return e},"ke"),Oe=o((t,e)=>{let r=[],l=new Set,i=[[t,e]];for(;i.length>0;){let[u,s]=i.pop()??[void 0,void 0];typeof s=="boolean"?r.push({key:u,text:s?"true":"false"}):typeof s=="object"&&s!==null&&!l.has(s)&&(l.add(s),Array.isArray(s)?i.push(...s.map(p=>[void 0,p])):i.push(...Object.entries(s)))}return r},"Re"),ae=o(t=>t.replaceAll(/[$()*+.?[\\\]^{|}]/gu,String.raw`\$&`),"P"),je=o((t,e)=>e.length>=Se?t.replaceAll(e,h):t.replaceAll(new RegExp(`(?<![A-Za-z0-9])${ae(e)}(?![A-Za-z0-9])`,"gu"),h),"Oe"),Re=o((t,e)=>{let r=t.replaceAll(`"${e.text}"`,h);if(e.key===void 0)return r;let l=ae(e.key);return r.replaceAll(new RegExp(`(?<![A-Za-z0-9_])${l}=${e.text}(?![A-Za-z0-9_])`,"gu"),`${e.key}=${h}`).replaceAll(new RegExp(String.raw`"${l}":\s*${e.text}(?![A-Za-z0-9_])`,"gu"),`"${e.key}":${h}`)},"Ie"),Ce=o((t,e,r)=>{if(r.length===0||typeof e!="object"||e===null)return t;let l=r.flatMap(s=>Oe(s,e[s])),i=r.flatMap(s=>Ie(e[s])).flatMap(s=>{let p=JSON.stringify(s).slice(1,-1);return p===s?[s]:[s,p]}).toSorted((s,p)=>p.length-s.length),u=t;for(let s of l)u=Re(u,s);for(let s of i)u=je(u,s);return u},"$e"),Te=10,Fe=o(t=>t===void 0?"undefined":JSON.stringify(t,V,2),"Ce"),ze=o((t,e)=>[{argsText:Ae(e.argsText,e.sensitive),at:Date.now(),id:(t[0]?.id??0)+1,kind:e.selected.kind,path:e.selected.path,redacted:e.sensitive.length>0,shardKey:e.shardKey,status:e.runStatus},...t].slice(0,Te),"Ee"),Ge=o(({functions:t,runAsIdentity:e=!1}={})=>{let r=U(),l=Y(),[i,u]=(0,c.useState)(null),[s,p]=(0,c.useState)(null),S=t??i??[],[R,C]=(0,c.useState)(""),[y,k]=(0,c.useState)("{}"),[g,T]=(0,c.useState)(""),[b,se]=(0,c.useState)(""),[$,x]=(0,c.useState)("idle"),[ie,v]=(0,c.useState)(void 0),[F,N]=(0,c.useState)(null),[z,oe]=(0,c.useState)([]);(0,c.useEffect)(()=>{if(t!==void 0)return;let a=!1;return l.listFunctions().then(f=>(a||u(f),f)).catch(f=>{a||p(j(f))}),()=>{a=!0}},[l,t]);let B=R===""?S[0]?.path??"":R,d=S.find(a=>a.path===B),le=o(async()=>{if(!d)return;let a;try{a=y.trim()===""?{}:P(JSON.parse(y))}catch(m){x("error"),v(void 0),N(r("Invalid JSON args: {message}",{message:m.message}));return}let f={__lunoraRef:d.path},E=g.trim()===""?{}:{shardKey:g.trim()},K=e?b.trim():"",Z=we(d.args),D=o(m=>{oe(me=>ze(me,{argsText:y,runStatus:m,selected:d,sensitive:Z,shardKey:g}))},"M");x("running"),N(null);try{let m=K===""?await W(l,d.kind,f,a,E):await l.query(Ne,{args:a,functionPath:d.path,userId:K},E);ee(g),v(m),x("success"),D("success")}catch(m){v(void 0),N(Ce(j(m),a,Z)),x("error"),D("error")}},"H"),de=o(a=>{if(C(a.path),T(a.shardKey),a.redacted){v(void 0),N(r("Re-enter the sensitive values before running this again.")),x("error");return}k(a.argsText)},"G"),ue=o(a=>{C(a.target.value)},"W"),ce=o(a=>{k(a.target.value)},"X"),fe=o(a=>{se(a.target.value)},"Y"),J=o(()=>{H(le())},"j"),L=e?b.trim():"",_=$==="running"||d===void 0,pe=o(()=>{k(ve(d?.args))},"_");return(0,n.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-runner",children:[s!==null&&(0,n.jsx)("p",{className:"text-sm text-destructive","data-testid":"function-discover-error",role:"alert",children:s}),(0,n.jsxs)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsx)(A,{htmlFor:"function-select",children:r("Function")}),(0,n.jsx)("select",{"aria-label":r("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"function-select",id:"function-select",onChange:ue,value:B,children:S.map(a=>(0,n.jsxs)("option",{value:a.path,children:[a.path," (",a.kind,")"]},a.path))}),d!==void 0&&(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,n.jsx)("span",{className:"mr-1.5 font-medium",children:r("Signature")}),(0,n.jsx)("code",{className:"font-mono","data-testid":"function-signature",children:xe(d.args)})]})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)(A,{htmlFor:"args-input",children:r("Arguments")}),(0,n.jsx)(w,{"data-testid":"prefill-button",disabled:d===void 0,onClick:pe,size:"xs",type:"button",variant:"ghost",children:r("Prefill")})]}),(0,n.jsx)(ne,{"aria-label":r("Arguments"),className:"font-mono text-xs","data-testid":"args-input",id:"args-input",onChange:ce,value:y})]}),(0,n.jsx)(te,{onChange:T,testId:"shard-input",value:g}),e&&(0,n.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"run-as-field",children:[(0,n.jsx)(A,{htmlFor:"run-as-input",children:r("Run as identity (userId)")}),(0,n.jsx)(q,{"aria-label":r("Run as identity (userId)"),className:"font-mono text-xs","data-testid":"run-as-input",id:"run-as-input",onChange:fe,placeholder:r("Leave empty to run as admin"),value:b}),(0,n.jsx)("p",{className:"text-[11px] text-muted-foreground",children:r("Dev only: runs the function as this user so you can test auth and RLS. Forged over the admin gate.")})]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[L!==""&&d!==void 0&&d.kind!=="query"?(0,n.jsx)(re,{confirmLabel:r("This will execute `{functionPath}` as user `{userId}`.",{functionPath:d.path,userId:L}),disabled:_,onConfirm:J,testId:"run-button",children:r("Run")}):(0,n.jsx)(w,{"data-testid":"run-button",disabled:_,onClick:J,type:"button",children:r("Run")}),d!==void 0&&(0,n.jsx)(O,{variant:"outline",children:d.kind}),e&&b.trim()!==""&&(0,n.jsx)(O,{"data-testid":"run-as-badge",variant:"secondary",children:r("as {userId}",{userId:b.trim()})})]})]}),$==="error"&&F!==null&&(0,n.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"error",role:"alert",children:F}),$==="success"&&(0,n.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"result",children:Fe(ie)}),z.length>0&&(0,n.jsx)("ul",{className:"flex flex-col overflow-hidden rounded-xl border border-border","data-testid":"fn-history",children:z.map((a,f)=>(0,n.jsxs)("li",{className:"flex flex-wrap items-center gap-2 border-b border-border px-3 py-2 text-sm last:border-b-0","data-testid":"fn-history-row",children:[(0,n.jsx)("span",{className:a.status==="success"?"text-success":"text-destructive","data-testid":`fn-history-status-${f.toString()}`,children:a.status==="success"?"\u2713":"\u2717"})," ",(0,n.jsxs)("span",{className:"font-mono text-xs",children:[a.path," (",a.kind,")"]})," ",(0,n.jsx)("time",{className:"text-xs text-muted-foreground",children:X(a.at)})," ",(0,n.jsx)(w,{className:"ml-auto","data-testid":`fn-history-load-${f.toString()}`,onClick:o(()=>{de(a)},"onClick"),size:"xs",type:"button",variant:"ghost",children:r("Load")})]},a.id))})]})},"Ge");export{Ge as FunctionRunner};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as pe,d as ne,e as kt,f as me}from"./chunk-A566HCBX.js";import{a as de,b as Ut}from"./chunk-W2BCSK5S.js";import{D as gt,b as ie,c as fe,e as Lt,f as ue}from"./chunk-W7MRISE3.js";import{a as ht,c as lt}from"./chunk-ZBON5T5A.js";import{c as At,j as X}from"./chunk-4C4THJUD.js";import{h as oe}from"./chunk-BFE2DRP6.js";import{a as o,c as Ge,d as O,e as Q,f as Ke,g as _t}from"./chunk-OXFKZ4BM.js";var je=O(Ke(),1);var at={};Ge(at,{Content:()=>Le,Corner:()=>Fe,Root:()=>ye,Scrollbar:()=>_e,Thumb:()=>ke,Viewport:()=>We});var s=O(Q(),1);var $t=O(Q(),1);var le=$t.createContext(void 0);function j(){let e=$t.useContext(le);if(e===void 0)throw new Error(At(53));return e}o(j,"useScrollAreaRootContext");function I(e,t,l){if(!e)return 0;let v=getComputedStyle(e),g=`${t}${l==="x"?"Inline":"Block"}`,p=parseFloat(v[`${g}Start`]);return l==="x"&&t==="margin"?p*2:p+parseFloat(v[`${g}End`])}o(I,"getOffset");var he="data-has-overflow-x",Se="data-has-overflow-y",xe="data-overflow-x-start",be="data-overflow-x-end",Re="data-overflow-y-start",we="data-overflow-y-end";var Et=o(e=>t=>t?{[e]:""}:null,"attr"),st={hasOverflowX:Et(he),hasOverflowY:Et(Se),overflowXStart:Et(xe),overflowXEnd:Et(be),overflowYStart:Et(Re),overflowYEnd:Et(we),cornerHidden:o(()=>null,"cornerHidden")};var Ft="--scroll-area-corner-height",jt="--scroll-area-corner-width";var Ae="data-orientation";var Ee=O(_t(),1);var Je={x:0,y:0},ge={width:0,height:0},Qe={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},tr={x:!0,y:!0,corner:!0},ye=s.forwardRef(o(function(t,l){let{render:v,className:g,overflowEdgeThreshold:p,style:x,...c}=t,{xStart:m,xEnd:b,yStart:E,yEnd:P}=er(p),_=ie(),y=gt(),T=gt(),{nonce:L,disableStyleElements:U}=me(),[it,k]=s.useState(!1),[B,tt]=s.useState(!1),[et,rt]=s.useState(!1),[ft,M]=s.useState(!1),[xt,d]=s.useState(!1),[$,G]=s.useState(ge),[bt,ut]=s.useState(ge),[R,ot]=s.useState(Qe),[H,h]=s.useState(tr),K=s.useRef(null),n=s.useRef(null),a=s.useRef(null),f=s.useRef(null),u=s.useRef(null),S=s.useRef(null),F=s.useRef(null),A=s.useRef(null),C=s.useRef(0),N=s.useRef(0),Z=s.useRef(0),dt=s.useRef(0),D=s.useRef("vertical"),Y=s.useRef(Je),W=s.useRef(null);function z(r){let i=r?rt:tt,w=r?y:T;i(!0),w.start(500,()=>{i(!1)})}o(z,"startScrolling");let q=lt(r=>{let i=r.x-Y.current.x,w=r.y-Y.current.y;Y.current=r,w!==0&&z(!0),i!==0&&z(!1)}),J=lt(()=>{let r=n.current;r&&W.current===null&&(W.current=r.style.scrollSnapType,r.style.scrollSnapType="none")}),Mt=lt(r=>{if(r.button!==0||A.current!==null&&(D.current==="vertical"?u.current:S.current)?.hasPointerCapture(A.current))return;A.current=r.pointerId,C.current=r.clientY,N.current=r.clientX,D.current=r.currentTarget.getAttribute(Ae);let i=n.current;i&&(Z.current=i.scrollTop,dt.current=i.scrollLeft,J()),(D.current==="vertical"?u.current:S.current)?.setPointerCapture(r.pointerId)}),yt=lt(r=>{if(r.pointerId!==A.current)return;A.current=null,(D.current==="vertical"?rt:tt)(!1),W.current!==null&&(n.current&&(n.current.style.scrollSnapType=W.current),W.current=null);let i=D.current==="vertical"?u.current:S.current;i?.hasPointerCapture(r.pointerId)&&i.releasePointerCapture(r.pointerId)}),Rt=lt(r=>{if(r.pointerId!==A.current)return;if(r.buttons%2===0){yt(r);return}let i=n.current;if(!i)return;let w=D.current==="vertical",nt=w?u.current:S.current,vt=w?a.current:f.current;if(!nt||!vt)return;let Dt=w?"y":"x",Yt=I(vt,"padding",Dt),Xt=I(nt,"margin",Dt),Pt=w?nt.offsetHeight:nt.offsetWidth,Ot=(w?vt.offsetHeight:vt.offsetWidth)-Pt-Yt-Xt,Wt=w?r.clientY-C.current:r.clientX-N.current,ee=Ot<=0?0:Wt/Ot,re=w?i.scrollHeight:i.scrollWidth,Tt=w?i.clientHeight:i.clientWidth,It=(w?Z.current:dt.current)+ee*(re-Tt);w?i.scrollTop=It:i.scrollLeft=It,r.preventDefault(),z(w)});function wt(r){M(r.pointerType==="touch")}o(wt,"handleTouchModalityChange");function pt(r){if(wt(r),r.pointerType!=="touch"){let i=Lt(K.current,r.target);k(i)}}o(pt,"handlePointerEnterOrMove");let mt=s.useMemo(()=>({scrolling:B||et,hasOverflowX:!H.x,hasOverflowY:!H.y,overflowXStart:R.xStart,overflowXEnd:R.xEnd,overflowYStart:R.yStart,overflowYEnd:R.yEnd,cornerHidden:H.corner}),[B,et,H.x,H.y,H.corner,R]),Ct={role:"presentation",onPointerEnter:pt,onPointerMove:pt,onPointerDown:wt,onPointerLeave(){k(!1)},style:{position:"relative",[Ft]:`${$.height}px`,[jt]:`${$.width}px`}},Ht=X("div",t,{state:mt,ref:[l,K],props:[Ct,c],stateAttributesMapping:st}),Qt=s.useMemo(()=>({handlePointerDown:Mt,handlePointerMove:Rt,handlePointerUp:yt,handleScroll:q,disableViewportSnap:J,cornerSize:$,setCornerSize:G,thumbSize:bt,setThumbSize:ut,hasMeasuredScrollbar:xt,setHasMeasuredScrollbar:d,touchModality:ft,cornerRef:F,scrollingX:B,scrollingY:et,hovering:it,setHovering:k,viewportRef:n,scrollbarYRef:a,scrollbarXRef:f,thumbYRef:u,thumbXRef:S,rootId:_,hiddenState:H,setHiddenState:h,overflowEdges:R,setOverflowEdges:ot,viewportState:mt,overflowEdgeThreshold:{xStart:m,xEnd:b,yStart:E,yEnd:P}}),[Mt,Rt,yt,q,J,$,bt,xt,ft,B,et,it,_,H,R,mt,m,b,E,P]);return(0,Ee.jsxs)(le.Provider,{value:Qt,children:[!U&&kt.getElement(L),Ht]})},"ScrollAreaRoot"));function er(e){let t=typeof e=="number"?{xStart:e,xEnd:e,yStart:e,yEnd:e}:e;return{xStart:Math.max(0,t?.xStart||0),xEnd:Math.max(0,t?.xEnd||0),yStart:Math.max(0,t?.yStart||0),yEnd:Math.max(0,t?.yEnd||0)}}o(er,"normalizeOverflowEdgeThreshold");var St=O(Q(),1);var Bt=O(Q(),1);var se=Bt.createContext(void 0);function Ce(){let e=Bt.useContext(se);if(e===void 0)throw new Error(At(55));return e}o(Ce,"useScrollAreaViewportContext");var Oe="--scroll-area-overflow-x-start",Te="--scroll-area-overflow-x-end",Ne="--scroll-area-overflow-y-start",Ve="--scroll-area-overflow-y-end";var Gt="--scroll-area-thumb-height",Kt="--scroll-area-thumb-width";var Xe=O(_t(),1);var Pe=[Oe,Te,Ne,Ve],De=!1;function or(){De||fe.engine.webkit||(typeof CSS<"u"&&"registerProperty"in CSS&&Pe.forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),De=!0)}o(or,"removeCSSVariableInheritance");var We=St.forwardRef(o(function(t,l){let{render:v,className:g,style:p,...x}=t,{viewportRef:c,scrollbarYRef:m,scrollbarXRef:b,thumbYRef:E,thumbXRef:P,cornerRef:_,cornerSize:y,setCornerSize:T,setThumbSize:L,rootId:U,setHiddenState:it,hiddenState:k,setHasMeasuredScrollbar:B,handleScroll:tt,touchModality:et,setHovering:rt,setOverflowEdges:ft,overflowEdgeThreshold:M,viewportState:xt}=j(),d=Ut(),$=St.useRef(!0),G=St.useRef([NaN,NaN,NaN,NaN]),bt=gt(),ut=gt(),R=lt(()=>{let n=c.current,a=m.current,f=b.current,u=E.current,S=P.current,F=_.current;if(!n)return;let A=n.scrollHeight,C=n.scrollWidth,N=n.clientHeight,Z=n.clientWidth,dt=n.scrollTop,D=n.scrollLeft,Y=G.current,W=Number.isNaN(Y[0]);if(Y[0]=N,Y[1]=A,Y[2]=Z,Y[3]=C,W&&B(!0),A===0||C===0)return;let z=nr(n),q=z.y,J=z.x,Mt=Z/C,yt=N/A,Rt=Math.max(0,C-Z),wt=Math.max(0,A-N),pt=0,mt=0;J||(pt=ne(d==="rtl"?-D:D,Rt),mt=Rt-pt);let Ct=q?0:ne(dt,wt),Ht=q?0:wt-Ct,Qt=J?0:Z,r=q?0:N,i=0,w=0;!J&&!q&&(i=a?.offsetWidth||0,w=f?.offsetHeight||0);let nt=y.width===0&&y.height===0,vt=nt?i:0,Dt=nt?w:0,Yt=I(f,"padding","x"),Xt=I(a,"padding","y"),Pt=I(S,"margin","x"),te=I(u,"margin","y"),Ot=Qt-Yt-Pt,Wt=r-Xt-te,ee=f?Math.min(f.offsetWidth-vt,Ot):Ot,re=a?Math.min(a.offsetHeight-Dt,Wt):Wt,Tt=Math.max(16,ee*Mt),zt=Math.max(16,re*yt);if(L(V=>Zt(V,{width:Tt,height:zt})),a&&u){let V=a.offsetHeight-zt-Xt-te,Nt=Ye(u,Gt,dt,wt,A,zt,V);u.style.transform=`translate3d(0,${Nt}px,0)`}if(f&&S){let V=f.offsetWidth-Tt-Yt-Pt,Nt=d==="rtl"?-D:D,ce=Ye(S,Kt,Nt,Rt,C,Tt,V);S.style.transform=`translate3d(${d==="rtl"?-ce:ce}px,0,0)`}let It=[pt,mt,Ct,Ht];Pe.forEach((V,Nt)=>{n.style.setProperty(V,`${It[Nt]}px`)}),F&&T(V=>Zt(V,{width:i,height:w})),it(V=>Zt(V,z));let Be={xStart:!J&&pt>M.xStart,xEnd:!J&&mt>M.xEnd,yStart:!q&&Ct>M.yStart,yEnd:!q&&Ht>M.yEnd};ft(V=>Zt(V,Be))});ht(()=>{or()},[]),ht(()=>{queueMicrotask(R)},[R,k,d,M.xStart,M.xEnd,M.yStart,M.yEnd]),ht(()=>{c.current?.matches(":hover")&&rt(!0)},[c,rt]),ht(()=>{let n=c.current;if(typeof ResizeObserver>"u"||!n)return;let a=!1,f=new ResizeObserver(()=>{if(!a){a=!0;let u=G.current;if(u[0]===n.clientHeight&&u[1]===n.scrollHeight&&u[2]===n.clientWidth&&u[3]===n.scrollWidth)return}R()});return f.observe(n),ut.start(0,()=>{let u=n.getAnimations({subtree:!0});u.length!==0&&Promise.allSettled(u.map(S=>S.finished)).then(R).catch(()=>{})}),()=>{f.disconnect(),ut.clear()}},[R,c,ut]);function ot(){$.current=!1}o(ot,"handleUserInteraction");let H={role:"presentation",...U&&{"data-id":`${U}-viewport`},tabIndex:k.x&&k.y?-1:0,className:kt.className,style:{overflow:"scroll"},onScroll(){c.current&&(R(),(et||!$.current)&&tt({x:c.current.scrollLeft,y:c.current.scrollTop}),bt.start(100,()=>{$.current=!0}))},onWheel:ot,onPointerMove:ot,onPointerEnter:ot,onKeyDown:ot},h=X("div",t,{ref:[l,c],state:xt,props:[H,x],stateAttributesMapping:st}),K=St.useMemo(()=>({computeThumbPosition:R}),[R]);return(0,Xe.jsx)(se.Provider,{value:K,children:h})},"ScrollAreaViewport"));function nr(e){let t=e.clientHeight>=e.scrollHeight,l=e.clientWidth>=e.scrollWidth;return{y:t,x:l,corner:t||l}}o(nr,"getHiddenState");function Zt(e,t){for(let l in t)if(e[l]!==t[l])return t;return e}o(Zt,"pickState");function Ye(e,t,l,v,g,p,x){let c=pe(l,0,v),m=l-c,b=Math.max(16,p*g/(g+Math.abs(m)));return e.style.setProperty(t,m?`${b}px`:""),(v?c/v*x:0)+(m>0?p-b:0)}o(Ye,"applyOverscrollThumb");var Jt=O(Q(),1);var qt=O(Q(),1);var ae=qt.createContext(void 0);function ze(){let e=qt.useContext(ae);if(e===void 0)throw new Error(At(54));return e}o(ze,"useScrollAreaScrollbarContext");var Ie=O(_t(),1);var _e=Jt.forwardRef(o(function(t,l){let{render:v,className:g,orientation:p="vertical",keepMounted:x=!1,style:c,...m}=t,{hovering:b,scrollingX:E,scrollingY:P,hiddenState:_,scrollbarYRef:y,scrollbarXRef:T,viewportRef:L,thumbYRef:U,thumbXRef:it,handlePointerDown:k,handlePointerUp:B,handleScroll:tt,disableViewportSnap:et,rootId:rt,thumbSize:ft,hasMeasuredScrollbar:M,viewportState:xt}=j(),d=p==="vertical",$={...xt,hovering:b,scrolling:d?P:E,orientation:p},G=Ut(),bt=!M&&!x,ut=d?_.y:_.x,R=x||!ut;Jt.useEffect(()=>{if(!R)return;let h=L.current,K=d?y.current:T.current;if(!K)return;function n(a){if(!h||a.ctrlKey)return;let f=!d,u=f?"scrollLeft":"scrollTop",S=f?a.deltaX:a.deltaY;if(S===0)return;let F=f?h.scrollWidth-h.clientWidth:h.scrollHeight-h.clientHeight,A=f&&G==="rtl"?-F:0,C=f&&G==="rtl"?0:F,N=h[u];N<=A&&S<0||N>=C&&S>0||(a.preventDefault(),h[u]=Math.min(C,Math.max(A,N+S)),tt({x:h.scrollLeft,y:h.scrollTop}))}return o(n,"handleWheel"),de(K,"wheel",n,{passive:!1})},[G,tt,d,T,y,R,L]);let ot={...rt&&{"data-id":`${rt}-scrollbar`},"aria-hidden":!0,onPointerDown(h){if(h.button!==0)return;let K=ue(h.nativeEvent),n=d?U.current:it.current;if(n&&Lt(n,K))return;let a=L.current;if(!a)return;let f=d?y.current:T.current;if(!n||!f)return;let u=d?"y":"x",S=I(n,"margin",u),F=I(f,"padding",u),A=d?n.offsetHeight:n.offsetWidth,C=f.getBoundingClientRect(),N=d?h.clientY-C.top-A/2-F+S/2:h.clientX-C.left-A/2-F+S/2,Z=d?a.scrollHeight:a.scrollWidth,dt=d?a.clientHeight:a.clientWidth,Y=(d?f.offsetHeight:f.offsetWidth)-A-F-S;if(Y<=0)return;let W=N/Y,z=Z-dt;et(),d?a.scrollTop=W*z:G==="rtl"?a.scrollLeft=-(1-W)*z:a.scrollLeft=W*z,tt({x:a.scrollLeft,y:a.scrollTop}),k(h)},onMouseDown(h){h.preventDefault()},onPointerUp:B,onPointerCancel:B,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",visibility:bt?"hidden":void 0,...d?{top:0,bottom:`var(${Ft})`,insetInlineEnd:0,[Gt]:`${ft.height}px`}:{insetInlineStart:0,insetInlineEnd:`var(${jt})`,bottom:0,[Kt]:`${ft.width}px`}}},H=X("div",t,{ref:[l,d?y:T],state:$,props:[ot,m],stateAttributesMapping:st});return R?(0,Ie.jsx)(ae.Provider,{value:p,children:H}):null},"ScrollAreaScrollbar"));var Vt=O(Q(),1);var Le=Vt.forwardRef(o(function(t,l){let{render:v,className:g,style:p,...x}=t,{computeThumbPosition:c}=Ce(),{hasMeasuredScrollbar:m,viewportState:b}=j(),E=Vt.useRef(null),P=Vt.useRef(m);return ht(()=>{if(typeof ResizeObserver>"u")return;let y=!1,T=new ResizeObserver(()=>{!y&&(y=!0,!P.current)||c()});return E.current&&T.observe(E.current),()=>{T.disconnect()}},[c]),X("div",t,{ref:[l,E],state:b,stateAttributesMapping:st,props:[{role:"presentation",style:{minWidth:"fit-content"}},x]})},"ScrollAreaContent"));var Ue=O(Q(),1);var ke=Ue.forwardRef(o(function(t,l){let{render:v,className:g,style:p,...x}=t,{thumbYRef:c,thumbXRef:m,handlePointerDown:b,handlePointerMove:E,handlePointerUp:P,scrollingX:_,scrollingY:y,hasMeasuredScrollbar:T}=j(),L=ze(),U=L==="vertical";return X("div",t,{ref:[l,U?c:m],state:{scrolling:U?y:_,orientation:L},props:[{onPointerDown:b,onPointerMove:E,onPointerUp:P,onPointerCancel:P,style:{visibility:T?void 0:"hidden",...U?{height:"var(--scroll-area-thumb-height)"}:{width:"var(--scroll-area-thumb-width)"}}},x]})},"ScrollAreaThumb"));var $e=O(Q(),1);var Fe=$e.forwardRef(o(function(t,l){let{render:v,className:g,style:p,...x}=t,{cornerRef:c,cornerSize:m,hiddenState:b}=j(),E=X("div",t,{ref:[l,c],props:[{"aria-hidden":!0,style:{position:"absolute",bottom:0,insetInlineEnd:0,width:m.width,height:m.height}},x]});return b.corner?null:E},"ScrollAreaCorner"));var ct=O(_t(),1);function No(e){let t=(0,je.c)(14),l,v,g;t[0]!==e?({className:v,children:l,...g}=e,t[0]=e,t[1]=l,t[2]=v,t[3]=g):(l=t[1],v=t[2],g=t[3]);let p;t[4]!==v?(p=oe("relative",v),t[4]=v,t[5]=p):p=t[5];let x;t[6]!==l?(x=(0,ct.jsx)(at.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:l}),t[6]=l,t[7]=x):x=t[7];let c,m;t[8]===Symbol.for("react.memo_cache_sentinel")?(c=(0,ct.jsx)(lr,{}),m=(0,ct.jsx)(at.Corner,{}),t[8]=c,t[9]=m):(c=t[8],m=t[9]);let b;return t[10]!==g||t[11]!==p||t[12]!==x?(b=(0,ct.jsxs)(at.Root,{"data-slot":"scroll-area",className:p,...g,children:[x,c,m]}),t[10]=g,t[11]=p,t[12]=x,t[13]=b):b=t[13],b}o(No,"z");function lr({className:e,orientation:t="vertical",...l}){return(0,ct.jsx)(at.Scrollbar,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:oe("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-s data-vertical:border-s-transparent",e),...l,children:(0,ct.jsx)(at.Thumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-md bg-border"})})}o(lr,"h");export{No as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var Q=Object.create;var v=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var J=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var i=(t,e)=>v(t,"name",{value:e,configurable:!0});var _=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ct=(t,e)=>{for(var r in e)v(t,r,{get:e[r],enumerable:!0})},K=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Z(e))!b.call(t,o)&&o!==r&&v(t,o,{get:()=>e[o],enumerable:!(n=X(e,o))||n.enumerable});return t};var At=(t,e,r)=>(r=t!=null?Q(J(t)):{},K(e||!t||!t.__esModule?v(r,"default",{value:t,enumerable:!0}):r,t));var k=_(u=>{"use strict";var d=Symbol.for("react.transitional.element"),F=Symbol.for("react.portal"),tt=Symbol.for("react.fragment"),et=Symbol.for("react.strict_mode"),rt=Symbol.for("react.profiler"),nt=Symbol.for("react.consumer"),ut=Symbol.for("react.context"),ot=Symbol.for("react.forward_ref"),st=Symbol.for("react.suspense"),it=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),ft=Symbol.for("react.activity"),ct=Symbol.for("react.view_transition"),N=Symbol.iterator;function pt(t){return t===null||typeof t!="object"?null:(t=N&&t[N]||t["@@iterator"],typeof t=="function"?t:null)}i(pt,"getIteratorFn");var h={isMounted:i(function(){return!1},"isMounted"),enqueueForceUpdate:i(function(){},"enqueueForceUpdate"),enqueueReplaceState:i(function(){},"enqueueReplaceState"),enqueueSetState:i(function(){},"enqueueSetState")},g=Object.assign,I={};function a(t,e,r){this.props=t,this.context=e,this.refs=I,this.updater=r||h}i(a,"Component");a.prototype.isReactComponent={};a.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};a.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Y(){}i(Y,"ComponentDummy");Y.prototype=a.prototype;function C(t,e,r){this.props=t,this.context=e,this.refs=I,this.updater=r||h}i(C,"PureComponent");var A=C.prototype=new Y;A.constructor=C;g(A,a.prototype);A.isPureReactComponent=!0;var O=Array.isArray;function m(){}i(m,"noop");var f={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function S(t,e,r){var n=r.ref;return{$$typeof:d,type:t,key:e,ref:n!==void 0?n:null,props:r}}i(S,"ReactElement");function lt(t,e){return S(t.type,e,t.props)}i(lt,"cloneAndReplaceKey");function j(t){return typeof t=="object"&&t!==null&&t.$$typeof===d}i(j,"isValidElement");function _t(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}i(_t,"escape");var w=/\/+/g;function R(t,e){return typeof t=="object"&&t!==null&&t.key!=null?_t(""+t.key):e.toString(36)}i(R,"getElementKey");function Et(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(m,m):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}i(Et,"resolveThenable");function E(t,e,r,n,o){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var c=!1;if(t===null)c=!0;else switch(s){case"bigint":case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case d:case F:c=!0;break;case H:return c=t._init,E(c(t._payload),e,r,n,o)}}if(c)return o=o(t),c=n===""?"."+R(t,0):n,O(o)?(r="",c!=null&&(r=c.replace(w,"$&/")+"/"),E(o,e,r,"",function(V){return V})):o!=null&&(j(o)&&(o=lt(o,r+(o.key==null||t&&t.key===o.key?"":(""+o.key).replace(w,"$&/")+"/")+c)),e.push(o)),1;c=0;var l=n===""?".":n+":";if(O(t))for(var p=0;p<t.length;p++)n=t[p],s=l+R(n,p),c+=E(n,e,r,s,o);else if(p=pt(t),typeof p=="function")for(t=p.call(t),p=0;!(n=t.next()).done;)n=n.value,s=l+R(n,p++),c+=E(n,e,r,s,o);else if(s==="object"){if(typeof t.then=="function")return E(Et(t),e,r,n,o);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return c}i(E,"mapIntoArray");function y(t,e,r){if(t==null)return t;var n=[],o=0;return E(t,n,"","",function(s){return e.call(r,s,o++)}),n}i(y,"mapChildren");function at(t){if(t._status===-1){var e=t._result,r=e();r.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n,r.status===void 0&&(r.status="fulfilled",r.value=n))},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n,r.status===void 0&&(r.status="rejected",r.reason=n))}),t._status===-1&&(t._status=0,t._result=r)}if(t._status===1)return t._result.default;throw t._result}i(at,"lazyInitializer");var P=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function x(t){var e=f.T,r={};r.types=e!==null?e.types:null,f.T=r;try{var n=t(),o=f.S;o!==null&&o(r,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(m,P)}catch(s){P(s)}finally{e!==null&&r.types!==null&&(e.types=r.types),f.T=e}}i(x,"startTransition");function M(t){var e=f.T;if(e!==null){var r=e.types;r===null?e.types=[t]:r.indexOf(t)===-1&&r.push(t)}else x(M.bind(null,t))}i(M,"addTransitionType");var vt={map:y,forEach:i(function(t,e,r){y(t,function(){e.apply(this,arguments)},r)},"forEach"),count:i(function(t){var e=0;return y(t,function(){e++}),e},"count"),toArray:i(function(t){return y(t,function(e){return e})||[]},"toArray"),only:i(function(t){if(!j(t))throw Error("React.Children.only expected to receive a single React element child.");return t},"only")};u.Activity=ft;u.Children=vt;u.Component=a;u.Fragment=tt;u.Profiler=rt;u.PureComponent=C;u.StrictMode=et;u.Suspense=st;u.ViewTransition=ct;u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=f;u.__COMPILER_RUNTIME={__proto__:null,c:i(function(t){return f.H.useMemoCache(t)},"c")};u.addTransitionType=M;u.cache=function(t){return function(){return t.apply(null,arguments)}};u.cacheSignal=function(){return null};u.cloneElement=function(t,e,r){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var n=g({},t.props),o=t.key;if(e!=null)for(s in e.key!==void 0&&(o=""+e.key),e)!$.call(e,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&e.ref===void 0||(n[s]=e[s]);var s=arguments.length-2;if(s===1)n.children=r;else if(1<s){for(var c=Array(s),l=0;l<s;l++)c[l]=arguments[l+2];n.children=c}return S(t.type,o,n)};u.createContext=function(t){return t={$$typeof:ut,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:nt,_context:t},t};u.createElement=function(t,e,r){var n,o={},s=null;if(e!=null)for(n in e.key!==void 0&&(s=""+e.key),e)$.call(e,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(o[n]=e[n]);var c=arguments.length-2;if(c===1)o.children=r;else if(1<c){for(var l=Array(c),p=0;p<c;p++)l[p]=arguments[p+2];o.children=l}if(t&&t.defaultProps)for(n in c=t.defaultProps,c)o[n]===void 0&&(o[n]=c[n]);return S(t,s,o)};u.createRef=function(){return{current:null}};u.forwardRef=function(t){return{$$typeof:ot,render:t}};u.isValidElement=j;u.lazy=function(t){return{$$typeof:H,_payload:{_status:-1,_result:t},_init:at}};u.memo=function(t,e){return{$$typeof:it,type:t,compare:e===void 0?null:e}};u.startTransition=x;u.unstable_useCacheRefresh=function(){return f.H.useCacheRefresh()};u.use=function(t){return f.H.use(t)};u.useActionState=function(t,e,r){return f.H.useActionState(t,e,r)};u.useCallback=function(t,e){return f.H.useCallback(t,e)};u.useContext=function(t){return f.H.useContext(t)};u.useDebugValue=function(){};u.useDeferredValue=function(t,e){return f.H.useDeferredValue(t,e)};u.useEffect=function(t,e){return f.H.useEffect(t,e)};u.useEffectEvent=function(t){return f.H.useEffectEvent(t)};u.useId=function(){return f.H.useId()};u.useImperativeHandle=function(t,e,r){return f.H.useImperativeHandle(t,e,r)};u.useInsertionEffect=function(t,e){return f.H.useInsertionEffect(t,e)};u.useLayoutEffect=function(t,e){return f.H.useLayoutEffect(t,e)};u.useMemo=function(t,e){return f.H.useMemo(t,e)};u.useOptimistic=function(t,e){return f.H.useOptimistic(t,e)};u.useReducer=function(t,e,r){return f.H.useReducer(t,e,r)};u.useRef=function(t){return f.H.useRef(t)};u.useState=function(t){return f.H.useState(t)};u.useSyncExternalStore=function(t,e,r){return f.H.useSyncExternalStore(t,e,r)};u.useTransition=function(){return f.H.useTransition()};u.version="19.3.0"});var U=_((Ot,L)=>{"use strict";L.exports=k()});var q=_(D=>{"use strict";var yt=U().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;D.c=function(t){return yt.H.useMemoCache(t)}});var Tt=_((Pt,G)=>{"use strict";G.exports=q()});var W=_(T=>{"use strict";var Rt=Symbol.for("react.transitional.element"),mt=Symbol.for("react.fragment");function z(t,e,r){var n=null;if(r!==void 0&&(n=""+r),e.key!==void 0&&(n=""+e.key),"key"in e){r={};for(var o in e)o!=="key"&&(r[o]=e[o])}else r=e;return e=r.ref,{$$typeof:Rt,type:t,key:n,ref:e!==void 0?e:null,props:r}}i(z,"jsxProd");T.Fragment=mt;T.jsx=z;T.jsxs=z});var dt=_((gt,B)=>{"use strict";B.exports=W()});export{i as a,_ as b,Ct as c,At as d,U as e,Tt as f,dt as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as He}from"./chunk-Z5EV64KS.js";import{a as Se}from"./chunk-KZCEJFZF.js";import{a as Ge}from"./chunk-473JK2PQ.js";import{a as qe}from"./chunk-FXPAJDES.js";import{i as Ue}from"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as Ze}from"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as Ke}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{a as je}from"./chunk-6UTZXEW3.js";import{m as $e}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{l as Pe,n as Fe,o as me,p as Ce,q as Oe,y as Re}from"./chunk-BFE2DRP6.js";import{a as s,d as Me,e as ot,f as at,g as lt}from"./chunk-OXFKZ4BM.js";var De=Me(at(),1),m=Me(ot(),1);var r=Me(lt(),1);var ze=Fe(je.getPitrBookmark),st=Fe(je.pitrRestore),nt=/^\d+$/u,Je=s(ie=>{let e=ie.trim(),h=nt.test(e)?Number(e):Date.parse(e),l=new Date(h);return Number.isNaN(l.getTime())?void 0:{epochMs:h,iso:l.toISOString()}},"De"),it=s(ie=>{let e=(0,De.c)(9),{text:h}=ie,l=Pe();if(h.trim()==="")return null;let t,o,p;if(e[0]!==l||e[1]!==h){let y=Je(h);t="font-mono text-xs text-muted-foreground",o="pitr-time-resolved",p=y===void 0?l("Not a time \u2014 use epoch-ms or ISO 8601."):l("Resolves to {instant} (a date-time without an offset is read in this browser's time zone; a bare date is UTC)",{instant:y.iso}),e[0]=l,e[1]=h,e[2]=t,e[3]=o,e[4]=p}else t=e[2],o=e[3],p=e[4];let N;return e[5]!==t||e[6]!==o||e[7]!==p?(N=(0,r.jsx)("p",{className:t,"data-testid":o,children:p}),e[5]=t,e[6]=o,e[7]=p,e[8]=N):N=e[8],N},"lt"),vt=s(ie=>{let e=(0,De.c)(140),{initialShardKey:h}=ie,l=$e(),t=Pe(),o=h??"",p=He(o),[N,y]=(0,m.useState)(null),[f,Qe]=(0,m.useState)(""),[ce,Ee]=(0,m.useState)(null),[c,We]=(0,m.useState)(""),[b,Xe]=(0,m.useState)(!1),[i,Ye]=(0,m.useState)(null),[ue,w]=(0,m.useState)(null),[de,I]=(0,m.useState)(!1),[C,Ve]=(0,m.useState)(!1),pe;e[0]!==l||e[1]!==o?(pe=s(async a=>{I(!0),w(null);let d;try{d={current:(await l.query(ze,{},me(o))).current,error:null,unavailable:!1}}catch(n){let g=n;d={current:null,error:Ce(g),unavailable:Oe(g)==="PITR_UNAVAILABLE"}}a?.aborted!==!0&&(d.error===null?y(d.current):w(d.error),Ve(d.unavailable),I(!1))},"fe"),e[0]=l,e[1]=o,e[2]=pe):pe=e[2];let x=pe,he,fe;e[3]!==x?(he=s(()=>{let a=new AbortController;return Re(x(a.signal)),()=>{a.abort()}},"ue"),fe=[x],e[3]=x,e[4]=he,e[5]=fe):(he=e[4],fe=e[5]),(0,m.useEffect)(he,fe);let be;e[6]!==l||e[7]!==o?(be=s(async()=>{let a=await l.query(ze,{},me(o));y(a.current)},"he"),e[6]=l,e[7]=o,e[8]=be):be=e[8],Ge(be,!C);let xe;e[9]===Symbol.for("react.memo_cache_sentinel")?(xe=s(a=>{Qe(a.target.value)},"be"),e[9]=xe):xe=e[9];let et=xe,ke;e[10]===Symbol.for("react.memo_cache_sentinel")?(ke=s(a=>{We(a.target.value)},"xe"),e[10]=ke):ke=e[10];let tt=ke,Ne;e[11]===Symbol.for("react.memo_cache_sentinel")?(Ne=s(a=>{Xe(a.target.checked)},"ke"),e[11]=Ne):Ne=e[11];let rt=Ne,ve,R,u,k,v,ge;if(e[12]!==c||e[13]!==l||e[14]!==ce||e[15]!==x||e[16]!==o||e[17]!==p||e[18]!==t||e[19]!==f){u=Je(f),R=s(()=>{if(u===void 0)return;let d=o;Re((async()=>{I(!0),w(null);let n;try{n={result:await l.query(ze,{time:u.epochMs},me(d))}}catch(g){n={error:Ce(g)}}p.current===d&&("result"in n?(Ee(n.result.forTime===void 0?null:{bookmark:n.result.forTime,shard:d}),y(n.result.current)):(Ee(null),w(n.error)),I(!1))})())},"C"),v=ce?.shard===o?ce.bookmark:null;let a;e[26]!==l||e[27]!==x||e[28]!==o?(a=s(d=>{Re((async()=>{I(!0),w(null);try{let n=await l.mutation(st,d,me(o));Ye(n),await x()}catch(n){let g=n;w(Ce(g)),Oe(g)==="PITR_UNAVAILABLE"&&Ve(!0)}I(!1)})())},"o"),e[26]=l,e[27]=x,e[28]=o,e[29]=a):a=e[29],k=a,ve=c.trim()!==""||u!==void 0,ge=t("Restore {shard} to {target}?",{shard:o===""?t("root"):o,target:c.trim()===""?u?.iso??"":t("the given bookmark")}),e[12]=c,e[13]=l,e[14]=ce,e[15]=x,e[16]=o,e[17]=p,e[18]=t,e[19]=f,e[20]=ve,e[21]=R,e[22]=u,e[23]=k,e[24]=v,e[25]=ge}else ve=e[20],R=e[21],u=e[22],k=e[23],v=e[24],ge=e[25];let Te=ge,ye;e[30]!==c||e[31]!==u?.epochMs||e[32]!==b||e[33]!==k?(ye=s(()=>{let a=b?{restart:!0}:{};c.trim()===""?a.time=u?.epochMs:a.bookmark=c.trim(),k(a)},"Ne"),e[30]=c,e[31]=u?.epochMs,e[32]=b,e[33]=k,e[34]=ye):ye=e[34];let Be=ye,we;e[35]!==b||e[36]!==i||e[37]!==k?(we=s(()=>{i!==null&&k(b?{bookmark:i.undoBookmark,restart:!0}:{bookmark:i.undoBookmark})},"ye"),e[35]=b,e[36]=i,e[37]=k,e[38]=we):we=e[38];let Ae=we,S;e[39]!==t?(S=t("Shard"),e[39]=t,e[40]=S):S=e[40];let T;e[41]!==o||e[42]!==t?(T=o===""?t("root"):o,e[41]=o,e[42]=t,e[43]=T):T=e[43];let B;e[44]!==T?(B=(0,r.jsx)("span",{className:"font-mono",children:T}),e[44]=T,e[45]=B):B=e[45];let A;e[46]!==S||e[47]!==B?(A=(0,r.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:[S,": ",B]})}),e[46]=S,e[47]=B,e[48]=A):A=e[48];let _;e[49]!==t?(_=t("In-place recovery to any moment in the last 30 days. For older or portable recovery, use the snapshot backup tier."),e[49]=t,e[50]=_):_=e[50];let L;e[51]!==_?(L=(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"pitr-note",children:_}),e[51]=_,e[52]=L):L=e[52];let M;e[53]!==ue?(M=ue!==null&&(0,r.jsx)("p",{className:"text-sm text-destructive","data-testid":"pitr-error",role:"alert",children:ue}),e[53]=ue,e[54]=M):M=e[54];let P;e[55]!==t?(P=t("Current bookmark"),e[55]=t,e[56]=P):P=e[56];let U;e[57]!==P?(U=(0,r.jsx)("h3",{className:"mb-2 text-sm font-semibold",children:P}),e[57]=P,e[58]=U):U=e[58];let F;e[59]!==N?(F=N??(0,r.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[59]=N,e[60]=F):F=e[60];let O;e[61]!==F?(O=(0,r.jsx)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-current",children:F}),e[61]=F,e[62]=O):O=e[62];let j;e[63]!==U||e[64]!==O?(j=(0,r.jsxs)("section",{className:"rounded-xl border border-border bg-card p-3 shadow-xs",children:[U,O]}),e[63]=U,e[64]=O,e[65]=j):j=e[65];let q;e[66]!==t?(q=t("Restore"),e[66]=t,e[67]=q):q=e[67];let z;e[68]!==q?(z=(0,r.jsx)("h3",{className:"text-sm font-semibold",children:q}),e[68]=q,e[69]=z):z=e[69];let D;e[70]!==t?(D=t("Time (ISO or epoch-ms, last 30 days)"),e[70]=t,e[71]=D):D=e[71];let E;e[72]!==D?(E=(0,r.jsx)(Se,{htmlFor:"pitr-time",children:D}),e[72]=D,e[73]=E):E=e[73];let V;e[74]!==f?(V=(0,r.jsx)(Ue,{"data-testid":"pitr-time",id:"pitr-time",onChange:et,placeholder:"2026-06-01T00:00:00.000Z",value:f}),e[74]=f,e[75]=V):V=e[75];let _e=de||C||u===void 0,K;e[76]!==t?(K=t("Preview"),e[76]=t,e[77]=K):K=e[77];let Z;e[78]!==R||e[79]!==_e||e[80]!==K?(Z=(0,r.jsx)(Ze,{"data-testid":"pitr-preview",disabled:_e,onClick:R,size:"sm",type:"button",variant:"outline",children:K}),e[78]=R,e[79]=_e,e[80]=K,e[81]=Z):Z=e[81];let $;e[82]!==V||e[83]!==Z?($=(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[V,Z]}),e[82]=V,e[83]=Z,e[84]=$):$=e[84];let G;e[85]!==f?(G=(0,r.jsx)(it,{text:f}),e[85]=f,e[86]=G):G=e[86];let H;e[87]!==v||e[88]!==t?(H=v!==null&&(0,r.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-preview-bookmark",children:[t("Bookmark for that time"),": ",v]}),e[87]=v,e[88]=t,e[89]=H):H=e[89];let J;e[90]!==E||e[91]!==$||e[92]!==G||e[93]!==H?(J=(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[E,$,G,H]}),e[90]=E,e[91]=$,e[92]=G,e[93]=H,e[94]=J):J=e[94];let Q;e[95]!==t?(Q=t("Or an explicit bookmark (wins over time)"),e[95]=t,e[96]=Q):Q=e[96];let W;e[97]!==Q?(W=(0,r.jsx)(Se,{htmlFor:"pitr-bookmark",children:Q}),e[97]=Q,e[98]=W):W=e[98];let X;e[99]!==t?(X=t("bookmark string"),e[99]=t,e[100]=X):X=e[100];let Y;e[101]!==c||e[102]!==X?(Y=(0,r.jsx)(Ue,{"data-testid":"pitr-bookmark",id:"pitr-bookmark",onChange:tt,placeholder:X,value:c}),e[101]=c,e[102]=X,e[103]=Y):Y=e[103];let ee;e[104]!==W||e[105]!==Y?(ee=(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[W,Y]}),e[104]=W,e[105]=Y,e[106]=ee):ee=e[106];let te;e[107]!==b?(te=(0,r.jsx)("input",{checked:b,className:"size-4 accent-primary","data-testid":"pitr-restart",id:"pitr-restart",onChange:rt,type:"checkbox"}),e[107]=b,e[108]=te):te=e[108];let re;e[109]!==t?(re=t("Restart the shard now so recovery applies immediately"),e[109]=t,e[110]=re):re=e[110];let oe;e[111]!==te||e[112]!==re?(oe=(0,r.jsxs)(Se,{className:"flex items-center gap-2 text-xs font-normal text-muted-foreground",htmlFor:"pitr-restart",children:[te,re]}),e[111]=te,e[112]=re,e[113]=oe):oe=e[113];let Le=de||C||!ve,ae;e[114]!==t?(ae=t("Restore"),e[114]=t,e[115]=ae):ae=e[115];let le;e[116]!==Te||e[117]!==Be||e[118]!==Le||e[119]!==ae?(le=(0,r.jsx)("div",{children:(0,r.jsx)(qe,{confirmLabel:Te,disabled:Le,onConfirm:Be,testId:"pitr-restore",children:ae})}),e[116]=Te,e[117]=Be,e[118]=Le,e[119]=ae,e[120]=le):le=e[120];let se;e[121]!==z||e[122]!==J||e[123]!==ee||e[124]!==oe||e[125]!==le?(se=(0,r.jsxs)("section",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-3 shadow-xs",children:[z,J,ee,oe,le]}),e[121]=z,e[122]=J,e[123]=ee,e[124]=oe,e[125]=le,e[126]=se):se=e[126];let ne;e[127]!==de||e[128]!==Ae||e[129]!==i||e[130]!==t||e[131]!==C?(ne=i!==null&&(0,r.jsxs)("section",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs","data-testid":"pitr-result",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold",children:t("Restore armed")}),(0,r.jsx)(Ke,{variant:i.restarted?"destructive":"secondary",children:i.restarted?t("restarted now"):t("on next restart")})]}),(0,r.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground",children:[t("Restored to"),": ",i.restoredTo]}),(0,r.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-undo-bookmark",children:[t("Undo bookmark"),": ",i.undoBookmark]}),(0,r.jsx)("div",{children:(0,r.jsx)(qe,{confirmLabel:t("Confirm undo"),disabled:de||C,onConfirm:Ae,testId:"pitr-undo",children:t("Undo restore")})})]}),e[127]=de,e[128]=Ae,e[129]=i,e[130]=t,e[131]=C,e[132]=ne):ne=e[132];let Ie;return e[133]!==A||e[134]!==L||e[135]!==M||e[136]!==j||e[137]!==se||e[138]!==ne?(Ie=(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-pitr",children:[A,L,M,j,se,ne]}),e[133]=A,e[134]=L,e[135]=M,e[136]=j,e[137]=se,e[138]=ne,e[139]=Ie):Ie=e[139],Ie},"Nt");export{vt as PitrPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as A}from"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as D}from"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import"./chunk-4C4THJUD.js";import{m as J}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as G}from"./chunk-XMSNLMWU.js";import{a as Q,b as W,c as Z,d as V,e as C,f as S}from"./chunk-HHRYM6UW.js";import{a as $,e as z}from"./chunk-JSDKOE4U.js";import{l as B,p as F,x as H,y as K}from"./chunk-BFE2DRP6.js";import{a as I,d as M,e as U,f as X,g as Y}from"./chunk-OXFKZ4BM.js";var L=M(X(),1),g=M(U(),1);var t=M(Y(),1);var _=10,E=I(h=>{let e=(0,L.c)(7),{label:i,value:l}=h,r;e[0]!==i?(r=(0,t.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:i}),e[0]=i,e[1]=r):r=e[1];let a=l??"\u2014",n;e[2]!==a?(n=(0,t.jsx)("span",{className:"font-mono text-sm",children:a}),e[2]=a,e[3]=n):n=e[3];let s;return e[4]!==r||e[5]!==n?(s=(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[r,n]}),e[4]=r,e[5]=n,e[6]=s):s=e[6],s},"_"),ee=I(h=>{let e=(0,L.c)(38),{indexes:i,onSelect:l,selected:r}=h,a=B(),n;e[0]!==a?(n=a("name"),e[0]=a,e[1]=n):n=e[1];let s;e[2]!==n?(s=(0,t.jsx)(C,{children:n}),e[2]=n,e[3]=s):s=e[3];let c;e[4]!==a?(c=a("table"),e[4]=a,e[5]=c):c=e[5];let o;e[6]!==c?(o=(0,t.jsx)(C,{children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==a?(d=a("dimensions"),e[8]=a,e[9]=d):d=e[9];let x;e[10]!==d?(x=(0,t.jsx)(C,{children:d}),e[10]=d,e[11]=x):x=e[11];let m;e[12]!==a?(m=a("metric"),e[12]=a,e[13]=m):m=e[13];let p;e[14]!==m?(p=(0,t.jsx)(C,{children:m}),e[14]=m,e[15]=p):p=e[15];let u;e[16]!==a?(u=a("vectors"),e[16]=a,e[17]=u):u=e[17];let v;e[18]!==u?(v=(0,t.jsx)(C,{children:u}),e[18]=u,e[19]=v):v=e[19];let y;e[20]!==v||e[21]!==s||e[22]!==o||e[23]!==x||e[24]!==p?(y=(0,t.jsx)(W,{children:(0,t.jsxs)(V,{children:[s,o,x,p,v]})}),e[20]=v,e[21]=s,e[22]=o,e[23]=x,e[24]=p,e[25]=y):y=e[25];let k;if(e[26]!==i||e[27]!==l||e[28]!==r){let q;e[30]!==l||e[31]!==r?(q=I(w=>(0,t.jsxs)(V,{className:w.name===r?"border-l-2 border-l-royal-amethyst bg-muted/50":"cursor-pointer","data-index":w.name,"data-testid":`vector-row-${w.name}`,onClick:l,children:[(0,t.jsx)(S,{className:"font-mono text-xs",children:w.name}),(0,t.jsx)(S,{className:"font-mono text-xs",children:w.table}),(0,t.jsx)(S,{className:"tabular-nums",children:w.dimensions??"\u2014"}),(0,t.jsx)(S,{children:w.metric??"\u2014"}),(0,t.jsx)(S,{className:"tabular-nums",children:w.vectorsCount??"\u2014"})]},w.name),"q"),e[30]=l,e[31]=r,e[32]=q):q=e[32],k=i.map(q),e[26]=i,e[27]=l,e[28]=r,e[29]=k}else k=e[29];let N;e[33]!==k?(N=(0,t.jsx)(Z,{children:k}),e[33]=k,e[34]=N):N=e[34];let f;return e[35]!==y||e[36]!==N?(f=(0,t.jsx)($,{className:"overflow-hidden py-0",children:(0,t.jsx)(z,{className:"px-0",children:(0,t.jsxs)(Q,{"data-testid":"vector-table",children:[y,N]})})}),e[35]=y,e[36]=N,e[37]=f):f=e[37],f},"X"),te=I(h=>{let e=(0,L.c)(27),{matches:i}=h,l=B();if(i.length===0){let u;e[0]!==l?(u=l("No matches."),e[0]=l,e[1]=u):u=e[1];let v;return e[2]!==u?(v=(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground","data-testid":"vector-no-matches",children:u}),e[2]=u,e[3]=v):v=e[3],v}let r;e[4]!==l?(r=l("id"),e[4]=l,e[5]=r):r=e[5];let a;e[6]!==r?(a=(0,t.jsx)(C,{children:r}),e[6]=r,e[7]=a):a=e[7];let n;e[8]!==l?(n=l("score"),e[8]=l,e[9]=n):n=e[9];let s;e[10]!==n?(s=(0,t.jsx)(C,{children:n}),e[10]=n,e[11]=s):s=e[11];let c;e[12]!==l?(c=l("metadata"),e[12]=l,e[13]=c):c=e[13];let o;e[14]!==c?(o=(0,t.jsx)(C,{children:c}),e[14]=c,e[15]=o):o=e[15];let d;e[16]!==a||e[17]!==s||e[18]!==o?(d=(0,t.jsx)(W,{children:(0,t.jsxs)(V,{children:[a,s,o]})}),e[16]=a,e[17]=s,e[18]=o,e[19]=d):d=e[19];let x;e[20]!==i?(x=i.map(le),e[20]=i,e[21]=x):x=e[21];let m;e[22]!==x?(m=(0,t.jsx)(Z,{children:x}),e[22]=x,e[23]=m):m=e[23];let p;return e[24]!==d||e[25]!==m?(p=(0,t.jsx)($,{className:"mt-3 overflow-hidden py-0",children:(0,t.jsx)(z,{className:"px-0",children:(0,t.jsxs)(Q,{"data-testid":"vector-matches",children:[d,m]})})}),e[24]=d,e[25]=m,e[26]=p):p=e[26],p},"Y"),me=I(({loadIndexes:h,runQuery:e}={})=>{let i=J(),l=B(),[r,a]=(0,g.useState)(null),[n,s]=(0,g.useState)(null),[c,o]=(0,g.useState)(null),[d,x]=(0,g.useState)(""),[m,p]=(0,g.useState)(null),[u,v]=(0,g.useState)(null),[y,k]=(0,g.useState)(!1),N=(0,g.useRef)(0);(0,g.useEffect)(()=>{let b={cancelled:!1};return K((async()=>{try{let j=await(h??(()=>i.listVectorIndexes()))();b.cancelled||(a(j),s(null),o(T=>T??j[0]?.name??null))}catch(j){b.cancelled||(a(null),s(F(j)))}})()),()=>{b.cancelled=!0}},[i,h]);let f=r?.find(b=>b.name===c)??null,q=I(b=>{N.current+=1,o(b.currentTarget.dataset.index??null),p(null),v(null),k(!1)},"q"),w=I(b=>{x(b.target.value)},"y"),O=I(async()=>{let b=d.trim();if(c===null||b==="")return;N.current+=1;let j=N.current;k(!0),v(null);try{let T=await(e??(R=>i.queryVectorIndex(R)))({name:c,text:b,topK:_});if(j!==N.current)return;p(T)}catch(T){if(j!==N.current)return;p(null),v(F(T))}k(!1)},"H"),P=I(()=>{K(O())},"K");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-vector-browser",children:[n!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"vector-error",role:"alert",children:n}),r!==null&&r.length===0&&(0,t.jsx)(G,{description:l("Indexes declared with .vectorize() or defineVectorIndex() appear here."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"})}),testId:"vector-empty",title:l("No vector indexes.")}),r!==null&&r.length>0&&(0,t.jsx)(ee,{indexes:r,onSelect:q,selected:c}),f!==null&&(0,t.jsxs)("section",{className:"border border-border bg-card p-3","data-testid":"vector-detail",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,t.jsx)(E,{label:l("field"),value:f.field}),(0,t.jsx)(E,{label:l("dimensions"),value:f.dimensions}),(0,t.jsx)(E,{label:l("metric"),value:f.metric}),(0,t.jsx)(E,{label:l("vectors"),value:f.vectorsCount})]}),f.metadata!==void 0&&f.metadata.length>0&&(0,t.jsxs)("p",{className:"mt-3 text-xs text-muted-foreground","data-testid":"vector-metadata",children:[l("metadata"),": ",(0,t.jsx)("span",{className:"font-mono",children:f.metadata.join(", ")})]}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,t.jsx)(A,{className:"min-w-[18rem] flex-1","data-testid":"vector-query-input",onChange:w,placeholder:l("Search by similarity\u2026"),value:d}),(0,t.jsx)(D,{"data-testid":"vector-search",disabled:y||d.trim()==="",onClick:P,children:l(y?"Searching\u2026":"Search")})]}),u!==null&&(0,t.jsx)("p",{className:"mt-2 text-sm text-destructive","data-testid":"vector-query-error",role:"alert",children:u}),m!==null&&(0,t.jsx)(te,{matches:m})]})]})},"ue");function le(h){return(0,t.jsxs)(V,{"data-testid":`vector-match-${h.id}`,children:[(0,t.jsx)(S,{className:"font-mono text-xs",children:h.id}),(0,t.jsx)(S,{className:"tabular-nums",children:h.score.toFixed(4)}),(0,t.jsx)(S,{className:"max-w-md truncate font-mono text-xs",children:h.metadata===void 0?"\u2014":H(h.metadata)})]},h.id)}I(le,"ee");export{me as VectorBrowser};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as u,y as f}from"./chunk-BFE2DRP6.js";import{a as s,d as l,e as h,f as S}from"./chunk-OXFKZ4BM.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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as Z}from"./chunk-7PADVGQX.js";import{b as Y}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{i as se,m as ee}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as re}from"./chunk-XMSNLMWU.js";import{a as O}from"./chunk-JSDKOE4U.js";import{C as ne,h as X,l as le}from"./chunk-BFE2DRP6.js";import{a as k,d as ae,f as ce,g as me}from"./chunk-OXFKZ4BM.js";var te=ae(ce(),1);var a=ae(me(),1);var pe="/_lunora/health",he="/_lunora/health/ready",ue=k((r,e)=>(r.endsWith("/")?r.slice(0,-1):r)+e,"me"),fe=k(()=>{let r=ee();return async e=>{let w=e==="ready"?he:pe,t=r.getAuthToken(),y=ue(r.url,w);try{let i=await fetch(y,{headers:t===null?{}:{authorization:`Bearer ${t}`}}),p=null;try{p=await i.json()}catch{p=null}return{body:p,ok:i.ok,status:i.status}}catch(i){return{body:null,error:i instanceof Error?i.message:String(i),ok:!1,status:0}}}},"pe"),ge={crit:"bg-destructive",ok:"bg-success",warn:"bg-warning"},ye=k(r=>r==="unhealthy"?"crit":r==="degraded"?"warn":"ok","fe"),ie=k(r=>{let e=(0,te.c)(13),{label:w,level:t,testId:y,value:i}=r,p=ge[t],d;e[0]!==p?(d=X("size-1.5 shrink-0 rounded-full",p),e[0]=p,e[1]=d):d=e[1];let o;e[2]!==d?(o=(0,a.jsx)("span",{"aria-hidden":"true",className:d}),e[2]=d,e[3]=o):o=e[3];let c;e[4]!==w||e[5]!==o?(c=(0,a.jsxs)("span",{className:"flex items-center gap-1.5 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:[o,w]}),e[4]=w,e[5]=o,e[6]=c):c=e[6];let h;e[7]!==y||e[8]!==i?(h=(0,a.jsx)("span",{className:"text-lg font-semibold text-foreground","data-testid":y,children:i}),e[7]=y,e[8]=i,e[9]=h):h=e[9];let C;return e[10]!==c||e[11]!==h?(C=(0,a.jsx)(O,{className:"gap-0 py-0",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[c,h]})}),e[10]=c,e[11]=h,e[12]=C):C=e[12],C},"Z"),Ie=k(r=>{let e=(0,te.c)(107),{probe:w}=r,t=le(),y=ee(),i=fe(),p=w??i,d;e[0]!==p?(d=k(async()=>{let[s,n]=await Promise.all([p("live"),p("ready")]);return{live:s,ready:n}},"o"),e[0]=p,e[1]=d):d=e[1];let o;e[2]!==y?(o=y.clientIdentifier(),e[2]=y,e[3]=o):o=e[3];let c;e[4]!==o?(c=["deployment-health",o],e[4]=o,e[5]=c):c=e[5];let h;e[6]!==d||e[7]!==c?(h={queryFn:d,queryKey:c},e[6]=d,e[7]=c,e[8]=h):h=e[8];let{data:C,isPending:de}=se(h),Q=C?.live??null,oe=C?.ready??null;if(de){let s;return e[9]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"deployment-health-loading",children:[(0,a.jsx)(Z,{className:"h-16 w-full"}),(0,a.jsx)(Z,{className:"h-40 w-full"})]}),e[9]=s):s=e[9],s}let l=Q?.body??null;if(l===null){let s=Q?.status===403,n;e[10]!==s||e[11]!==Q?.error||e[12]!==t?(n=s?t("The health endpoint is in the admin posture. Paste a valid admin token in the connect popover, or set its auth to public."):t("Couldn't reach the health endpoint: {message}",{message:Q?.error??t("no response")}),e[10]=s,e[11]=Q?.error,e[12]=t,e[13]=n):n=e[13];let m;e[14]!==t?(m=t("Health endpoint unavailable"),e[14]=t,e[15]=m):m=e[15];let f;return e[16]!==n||e[17]!==m?(f=(0,a.jsx)(re,{description:n,testId:"deployment-health-error",title:m}),e[16]=n,e[17]=m,e[18]=f):f=e[18],f}let J;e[19]!==l.status?(J=ye(l.status),e[19]=l.status,e[20]=J):J=e[20];let W=J,u;if(l.status==="unhealthy"){let s;e[21]!==t?(s=t("Unhealthy"),e[21]=t,e[22]=s):s=e[22],u=s}else if(l.status==="degraded"){let s;e[23]!==t?(s=t("Degraded"),e[23]=t,e[24]=s):s=e[24],u=s}else{let s;e[25]!==t?(s=t("Healthy"),e[25]=t,e[26]=s):s=e[26],u=s}let _=oe?.ok??!1,G=_?"ok":"crit",j,H,I,x,N,v,S,V,b,P;if(e[27]!==l.appName||e[28]!==l.appVersion||e[29]!==l.checks||e[30]!==l.timestamp||e[31]!==W||e[32]!==G||e[33]!==_||e[34]!==u||e[35]!==t){let s=[...l.checks].toSorted(xe);H="flex flex-col gap-6",I="deployment-health";let n;e[46]!==t?(n=t("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint \u2014 wire an uptime monitor or a Cloudflare Health Check at it."),e[46]=t,e[47]=n):n=e[47],e[48]!==n?(x=(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:n}),e[48]=n,e[49]=x):x=e[49];let m;e[50]!==u?(m=(0,a.jsx)("span",{className:"text-sm font-semibold text-foreground","data-testid":"dh-status",children:u}),e[50]=u,e[51]=m):m=e[51];let f;e[52]!==l.appName||e[53]!==l.appVersion?(f=(0,a.jsxs)("span",{className:"font-mono text-[13px] text-muted-foreground","data-testid":"dh-app",children:[l.appName," \xB7 ",l.appVersion]}),e[52]=l.appName,e[53]=l.appVersion,e[54]=f):f=e[54];let D;e[55]!==m||e[56]!==f?(D=(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsxs)("div",{className:"grid leading-tight",children:[m,f]})}),e[55]=m,e[56]=f,e[57]=D):D=e[57];let T;e[58]!==t?(T=t("Checked"),e[58]=t,e[59]=T):T=e[59];let $;e[60]!==T?($=(0,a.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:T}),e[60]=T,e[61]=$):$=e[61];let q;e[62]!==l.timestamp?(q=ne(l.timestamp),e[62]=l.timestamp,e[63]=q):q=e[63];let B;e[64]!==q?(B=(0,a.jsx)("time",{className:"text-[13px] text-muted-foreground","data-testid":"dh-timestamp",children:q}),e[64]=q,e[65]=B):B=e[65];let E;e[66]!==$||e[67]!==B?(E=(0,a.jsxs)("div",{className:"text-end",children:[$,B]}),e[66]=$,e[67]=B,e[68]=E):E=e[68],e[69]!==D||e[70]!==E?(N=(0,a.jsx)(O,{className:"gap-0 py-0",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 p-4",children:[D,E]})}),e[69]=D,e[70]=E,e[71]=N):N=e[71];let L;e[72]!==t?(L=t("Liveness"),e[72]=t,e[73]=L):L=e[73];let R;e[74]!==W||e[75]!==u||e[76]!==L?(R=(0,a.jsx)(ie,{label:L,level:W,testId:"dh-liveness",value:u}),e[74]=W,e[75]=u,e[76]=L,e[77]=R):R=e[77];let U;e[78]!==t?(U=t("Readiness"),e[78]=t,e[79]=U):U=e[79];let A;e[80]!==_||e[81]!==t?(A=t(_?"Ready":"Not ready"),e[80]=_,e[81]=t,e[82]=A):A=e[82];let F;e[83]!==G||e[84]!==U||e[85]!==A?(F=(0,a.jsx)(ie,{label:U,level:G,testId:"dh-readiness",value:A}),e[83]=G,e[84]=U,e[85]=A,e[86]=F):F=e[86],e[87]!==R||e[88]!==F?(v=(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2","data-testid":"dh-probes",children:[R,F]}),e[87]=R,e[88]=F,e[89]=v):v=e[89],j=O,S="gap-0 py-0",V="dh-checks";let K;e[90]!==t?(K=t("Subsystem checks"),e[90]=t,e[91]=K):K=e[91],e[92]!==K?(b=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:K})}),e[92]=K,e[93]=b):b=e[93],P=s.length===0?(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"dh-checks-empty",children:t("No checks reported.")}):(0,a.jsx)("ul",{className:"divide-y divide-border",children:s.map(g=>(0,a.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2.5 text-xs","data-testid":`dh-check-${g.name}`,children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:X("size-1.5 shrink-0 rounded-full",g.status==="up"?"bg-success":"bg-destructive")}),(0,a.jsx)("span",{className:"font-mono text-foreground",children:g.name}),g.critical&&(0,a.jsx)(Y,{variant:"outline",children:t("Critical")})]}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[g.message!==void 0&&(0,a.jsx)("span",{className:"text-muted-foreground",children:g.message}),(0,a.jsx)(Y,{"data-testid":`dh-check-status-${g.name}`,variant:g.status==="up"?"secondary":"destructive",children:g.status==="up"?t("Up"):t("Down")})]})]},g.name))}),e[27]=l.appName,e[28]=l.appVersion,e[29]=l.checks,e[30]=l.timestamp,e[31]=W,e[32]=G,e[33]=_,e[34]=u,e[35]=t,e[36]=j,e[37]=H,e[38]=I,e[39]=x,e[40]=N,e[41]=v,e[42]=S,e[43]=V,e[44]=b,e[45]=P}else j=e[36],H=e[37],I=e[38],x=e[39],N=e[40],v=e[41],S=e[42],V=e[43],b=e[44],P=e[45];let z;e[94]!==j||e[95]!==S||e[96]!==V||e[97]!==b||e[98]!==P?(z=(0,a.jsxs)(j,{className:S,"data-testid":V,children:[b,P]}),e[94]=j,e[95]=S,e[96]=V,e[97]=b,e[98]=P,e[99]=z):z=e[99];let M;return e[100]!==H||e[101]!==I||e[102]!==x||e[103]!==N||e[104]!==v||e[105]!==z?(M=(0,a.jsxs)("div",{className:H,"data-testid":I,children:[x,N,v,z]}),e[100]=H,e[101]=I,e[102]=x,e[103]=N,e[104]=v,e[105]=z,e[106]=M):M=e[106],M},"_e");function xe(r,e){return r.name.localeCompare(e.name)}k(xe,"he");export{Ie as DeploymentHealthPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as Oe,b as _e}from"./chunk-NGVP66OH.js";import{i as je,k as He}from"./chunk-XYR5NST4.js";import{a as Re,b as ye,c as Ie,d as Ee,e as Pe,g as Be,h as Ve}from"./chunk-SU5DTRGK.js";import{I as Ae,J as Me,K as Se,L as Le,M as Fe,N as Te,b as U,l as De}from"./chunk-W7MRISE3.js";import{b as we,c as Ge}from"./chunk-JTGGWF7R.js";import{a as M,e as Ne}from"./chunk-ZBON5T5A.js";import{a as Ce,c as ke,e as ge,i as ve,j as H}from"./chunk-4C4THJUD.js";import{h as he}from"./chunk-BFE2DRP6.js";import{a as i,c as It,d as C,e as A,f as Et,g as xe}from"./chunk-OXFKZ4BM.js";var Qe=C(Et(),1);var V={};It(V,{Indicator:()=>$e,Root:()=>Ye});var l=C(A(),1);function Ue(o){if(!o)return null;for(let e of o.elements){let r=e.tagName;if(r==="BUTTON"||r==="INPUT"){let a=e;if(a.type==="submit")return a}}return null}i(Ue,"getDefaultFormSubmitter");var qe="data-checked",We="data-unchecked";function q(o){return{checked(e){return o.indeterminate?{}:e?{[qe]:""}:{[We]:""}},...Re}}i(q,"getCheckboxStateAttributesMapping");var ze=C(A(),1);function Ke(o,e,r,a=!0,s){let[f,p]=ze.useState(),P=U(s?`${s}-label`:void 0),b=o??e??f;return M(()=>{let x=o||e||!a?void 0:Nt(r.current,P);f!==x&&p(x)}),b}i(Ke,"useAriaLabelledBy");function Nt(o,e){let r=Dt(o);if(r)return!r.id&&e&&(r.id=e),r.id||void 0}i(Nt,"getAriaLabelledBy");function Dt(o){if(!o)return;let e=o.parentElement;if(e&&e.tagName==="LABEL")return e;let r=o.id;if(r){let s=o.nextElementSibling;if(s&&s.htmlFor===r)return s}let a=o.labels;return a&&a[0]}i(Dt,"findAssociatedLabel");var W=C(A(),1);var Bt=W.createContext(void 0);function Je(){return W.useContext(Bt)}i(Je,"useCheckboxGroupContext");var z=C(A(),1);var ie=z.createContext(void 0);function Xe(){let o=z.useContext(ie);if(o===void 0)throw new Error(ke(14));return o}i(Xe,"useCheckboxRootContext");var S=C(xe(),1);var At="data-parent",Ye=l.forwardRef(i(function(e,r){let{checked:a,className:s,defaultChecked:f=!1,"aria-labelledby":p,disabled:P=!1,form:b,id:x,indeterminate:N=!1,inputRef:X,name:L,onCheckedChange:F,parent:u=!1,readOnly:y=!1,render:ae,required:I=!1,uncheckedValue:T,value:O,nativeButton:_=!1,style:Mt,...Ze}=e,{clearErrors:et}=Ie(),{disabled:tt,name:ot,setDirty:rt,setFilled:se,setFocused:de,setTouched:nt,state:ce,validationMode:it,validityData:at,validation:st}=ye(),dt=Be(),{labelId:ct,registerControlId:ut,getDescriptionProps:ue}=Ee(),n=Je(),k=n?.allValues===void 0?void 0:n.parent,w=k!==void 0,c=tt||dt.disabled||n?.disabled||P,E=ot??L,d=O??E,le=U(),lt=n?.registerControlId!==ut,Y=Pe({id:x||void 0,enabled:lt}),ft=_?Y:le,$={};w&&(u?$=k.getParentProps():d!==void 0&&($=k.getChildProps(d)));let{checked:fe=a,indeterminate:pt=N,onCheckedChange:mt,...bt}=$,Q=n?.value,G=l.useRef(null),{getButtonProps:xt,buttonRef:ht}=Ge({disabled:c,native:_}),D=n?.validation??st,[m,Ct]=Se({controlled:d!==void 0&&Q!==void 0&&!u?Q.includes(d):fe,default:f,name:"Checkbox",state:"checked"}),Z=w?!!fe:m,B=w&&pt||N;Ve(G,le,m,void 0,!n&&!c,L);let ee=k?.registerChildId,g=l.useRef(null),pe=D.registerInput,me=n?d:void 0,kt=l.useCallback(t=>pe(t,{controlRef:G,value:me}),[pe,me]),gt=ge(X,g,u?void 0:kt),vt=Ke(p,ct,g,!_,Y);M(()=>{g.current&&(g.current.indeterminate=B),n||se(m)},[m,B,n,se]),Le(m,()=>{n||(et(E),rt(m!==at.initialValue),D.change(m))});let Rt=Ce({checked:m,disabled:c,form:b,name:u?void 0:E,id:_?void 0:Y,required:I,ref:gt,style:E?_e:Oe,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(t){if(t.nativeEvent.defaultPrevented)return;if(y){t.preventDefault();return}let h=t.currentTarget.checked,v=Te(Fe.none,t.nativeEvent);if(F?.(h,v),!v.isCanceled&&(mt?.(h,v),!v.isCanceled&&(Ct(h),d!==void 0&&n!==void 0&&!u&&!w))){let R=h?[...n.value,d]:n.value.filter(j=>j!==d);n.setValue(R,v)}},onClick(t){t.stopPropagation()},onFocus(){G.current?.focus()}},O!==void 0?{value:(n?m&&O:O)||""}:ve,ue,t=>D.getValidationProps(c,t));l.useEffect(()=>{if(!k||d===void 0)return;let t=k.disabledStatesRef.current;return t.set(d,c),()=>{t.delete(d)}},[k,c,d]);let te=l.useMemo(()=>({...ce,checked:Z,disabled:c,readOnly:y,required:I,indeterminate:B}),[ce,Z,c,y,I,B]),yt=q(te),be=H("span",e,{state:te,ref:[ht,G,r],props:[{id:ft,role:"checkbox","aria-checked":B?"mixed":Z,"aria-readonly":y||void 0,"aria-required":I||void 0,"aria-labelledby":vt,[At]:u?"":void 0,onFocus(){c||de(!0)},onBlur(){let t=g.current;t&&(nt(!0),de(!1),it==="onBlur"&&D.commit(n?Q:t.checked))},onKeyDown(t){if(t.key!=="Enter"||(t.preventBaseUIHandler(),t.defaultPrevented))return;let h=g.current?.form??null,v=t.currentTarget,R=t.nativeEvent,j=t.preventDefault,re=R.preventDefault,ne=!1;t.preventDefault=()=>{ne=!0,j.call(t)},R.preventDefault=()=>{ne=!0,re.call(R)},re.call(R),Ne(v).queueMicrotask(()=>{t.preventDefault=j,R.preventDefault=re,ne||Ue(h)?.click()})},onClick(t){if(y||c)return;t.preventDefault();let h=g.current;h&&we(h,t)}},Ze,bt,xt,ue,t=>D.getValidationProps(c,t)],stateAttributesMapping:yt}),oe=be.props.id;return M(()=>{if(!(!ee||u||d===void 0||oe===void 0))return ee(d,oe)},[ee,u,d,oe]),(0,S.jsxs)(ie.Provider,{value:te,children:[be,!m&&!n&&E&&!u&&T!==void 0&&(0,S.jsx)("input",{type:"hidden",form:b,name:E,value:T,disabled:c}),(0,S.jsx)("input",{...Rt,suppressHydrationWarning:!0})]})},"CheckboxRoot"));var K=C(A(),1);var $e=K.forwardRef(i(function(e,r){let{render:a,className:s,style:f,keepMounted:p=!1,...P}=e,b=Xe(),x=b.checked||b.indeterminate,{mounted:N,transitionStatus:X,setMounted:L}=Me(x),F=K.useRef(null),u={...b,transitionStatus:X};Ae({batch:!0,enabled:!x,open:x,ref:F,onComplete(){x||L(!1)}});let ae={...q(b),...De},I=p||N,T=H("span",e,{ref:[r,F],state:u,stateAttributesMapping:ae,props:P});return I?T:null},"CheckboxIndicator"));var J=C(xe(),1);function Fo(o){let e=(0,Qe.c)(9),r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let s;e[3]!==r?(s=he("peer relative flex size-4 shrink-0 items-center justify-center rounded-md border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",r),e[3]=r,e[4]=s):s=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=(0,J.jsx)(V.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:(0,J.jsx)(He,{icon:je,strokeWidth:2})}),e[5]=f):f=e[5];let p;return e[6]!==a||e[7]!==s?(p=(0,J.jsx)(V.Root,{"data-slot":"checkbox",className:s,...a,children:f}),e[6]=a,e[7]=s,e[8]=p):p=e[8],p}i(Fo,"v");export{Fo as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as Pt,b as jt,c as ot}from"./chunk-VEWQWS3J.js";import{a as de}from"./chunk-Y74LIFSL.js";import{a as Et,b as Ot,c as Dt,d as Ft}from"./chunk-TDVDZ7XQ.js";import{a as it}from"./chunk-XSHYZPGF.js";import{a as rt,b as at,c as st,d as At,e as zt,f as lt,g as nt,h as Kt,i as Lt}from"./chunk-O2NMPIV2.js";import{a as Rt}from"./chunk-R36QXQZX.js";import{a as $t}from"./chunk-MWJC3S62.js";import"./chunk-IH2CJZF2.js";import{e as _t}from"./chunk-UYEZR3BI.js";import{a as kt,b as Ct,c as Mt,d as It,e as je}from"./chunk-TCYPNSTV.js";import"./chunk-A566HCBX.js";import"./chunk-SYGCASPT.js";import"./chunk-LIGOLZND.js";import{a as qt}from"./chunk-KYAG2YMF.js";import"./chunk-KRPXOSBL.js";import"./chunk-W2BCSK5S.js";import"./chunk-NGVP66OH.js";import"./chunk-XYR5NST4.js";import"./chunk-ZGSL4DPP.js";import{a as wt}from"./chunk-5DNGK3NT.js";import{a as St}from"./chunk-XST3UEHU.js";import{a as yt,b as Nt}from"./chunk-SLIDAWNX.js";import"./chunk-6M7FLLMT.js";import"./chunk-LUHXNZI4.js";import"./chunk-ZTOREMGH.js";import"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as Ye}from"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as Ge}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import"./chunk-E26OT26O.js";import{a as Ee}from"./chunk-6UTZXEW3.js";import{c as Fe}from"./chunk-4DAKKAK7.js";import{a as ct,m as vt}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as ht}from"./chunk-XMSNLMWU.js";import{a as Ze,b as et,c as tt,d as Pe,e as oe,f as B}from"./chunk-HHRYM6UW.js";import{a as fe,b as Oe,c as De,d as ut,e as xe}from"./chunk-JSDKOE4U.js";import{h as mt,l as he,n as gt,o as pt,p as ft,q as xt,u as Je,y as bt}from"./chunk-BFE2DRP6.js";import{a as b,d as Xe,e as Ut,f as Ht,g as Gt}from"./chunk-OXFKZ4BM.js";var me=Xe(Ht(),1),j=Xe(Ut(),1);var t=Xe(Gt(),1);var Bt=b((l,e,s)=>`${l}:${e}:${ct(s??{})}`,"ut"),Tt=b((l,e)=>l==="gauge"?e.last:l==="histogram"?e.sum/Math.max(1,e.count):e.sum,"ht"),Jt=b((l,e)=>Tt(l,e),"Vt"),Vt=b(l=>Tt(l.kind,l),"Gt"),dt=b(l=>Number.isInteger(l)?l.toLocaleString():l.toLocaleString(void 0,{maximumFractionDigits:2}),"Ye"),Wt=b(l=>Array.isArray(l?.series)?l.series:[],"Yt"),Xt="FUNCTION_NOT_FOUND",Yt=b(l=>{let e=new Map;if(!Array.isArray(l?.series))return e;for(let s of l.series)e.set(Bt(s.kind,s.name,s.attributes),s.points);return e},"Wt"),Zt={counter:"secondary",gauge:"default",histogram:"outline"},er=b(l=>{let e=(0,me.c)(18),{name:s,onOpenTrace:a,traceId:r}=l,o=he();if(r===void 0){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[0]=c):c=e[0],c}let i;e[1]!==r?(i=r.slice(0,8),e[1]=r,e[2]=i):i=e[2];let n=i;if(a===void 0){let c=`mt-instrument-trace-${s}`,d;return e[3]!==n||e[4]!==c||e[5]!==r?(d=(0,t.jsx)("span",{className:"text-muted-foreground","data-testid":c,title:r,children:n}),e[3]=n,e[4]=c,e[5]=r,e[6]=d):d=e[6],d}let m=`mt-instrument-trace-${s}`,p;e[7]!==a||e[8]!==r?(p=b(()=>{a(r)},"p"),e[7]=a,e[8]=r,e[9]=p):p=e[9];let h;e[10]!==o||e[11]!==r?(h=o("Open the exemplar trace {trace}",{trace:r}),e[10]=o,e[11]=r,e[12]=h):h=e[12];let u;return e[13]!==n||e[14]!==m||e[15]!==p||e[16]!==h?(u=(0,t.jsx)("button",{className:"text-primary underline-offset-4 hover:underline","data-testid":m,onClick:p,title:h,type:"button",children:n}),e[13]=n,e[14]=m,e[15]=p,e[16]=h,e[17]=u):u=e[17],u},"Zt"),tr=b(l=>{let e=(0,me.c)(105),{onOpenTrace:s,shardKey:a}=l,r=he(),o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={},e[0]=o):o=e[0];let i;e[1]!==a?(i={live:!0,shardKey:a},e[1]=a,e[2]=i):i=e[2];let{data:n,error:m,errorSource:p}=Fe(Ee.getMetricSeries,o,i),h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h={},e[3]=h):h=e[3];let u;e[4]!==a?(u={live:!0,shardKey:a},e[4]=a,e[5]=u):u=e[5];let{data:c}=Fe(Ee.getMetricHistory,h,u),d,f,g,v,x,S,y,w,I,k,N,z,_;if(e[6]!==n||e[7]!==m||e[8]!==p||e[9]!==c||e[10]!==s||e[11]!==r){w=Symbol.for("react.early_return_sentinel");e:{let L=Wt(n),E=xt(p)===Xt;if(m!==null&&!E){let q;e[25]!==r?(q=r("Instruments"),e[25]=r,e[26]=q):q=e[26];let D;e[27]!==q?(D=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:q}),e[27]=q,e[28]=D):D=e[28];let F;e[29]!==m||e[30]!==r?(F=r("Instruments unavailable: {error}",{error:m}),e[29]=m,e[30]=r,e[31]=F):F=e[31];let P;e[32]!==F?(P=(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"mt-instruments-error",role:"status",children:F}),e[32]=F,e[33]=P):P=e[33];let ie;e[34]!==D||e[35]!==P?(ie=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"mt-instruments",children:[D,P]}),e[34]=D,e[35]=P,e[36]=ie):ie=e[36],w=ie;break e}if(L.length===0){w=null;break e}let O=Yt(c),ue;e[37]!==r?(ue=b(q=>r(q==="counter"?"Counter":q==="gauge"?"Gauge":"Histogram"),"de"),e[37]=r,e[38]=ue):ue=e[38];let ge=ue;x="flex flex-col gap-2",S="mt-instruments";let T;e[39]!==r?(T=r("Instruments"),e[39]=r,e[40]=T):T=e[40],e[41]!==T?(y=(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:T}),e[41]=T,e[42]=y):y=e[42],v=fe,_="overflow-hidden py-0",g=xe,z="px-0",f=Ze,k="mt-instruments-table";let U;e[43]!==r?(U=r("name"),e[43]=r,e[44]=U):U=e[44];let H;e[45]!==U?(H=(0,t.jsx)(oe,{children:U}),e[45]=U,e[46]=H):H=e[46];let G;e[47]!==r?(G=r("kind"),e[47]=r,e[48]=G):G=e[48];let J;e[49]!==G?(J=(0,t.jsx)(oe,{children:G}),e[49]=G,e[50]=J):J=e[50];let V;e[51]!==r?(V=r("value"),e[51]=r,e[52]=V):V=e[52];let W;e[53]!==V?(W=(0,t.jsx)(oe,{className:"text-right",children:V}),e[53]=V,e[54]=W):W=e[54];let X;e[55]!==r?(X=r("count"),e[55]=r,e[56]=X):X=e[56];let Y;e[57]!==X?(Y=(0,t.jsx)(oe,{className:"text-right",children:X}),e[57]=X,e[58]=Y):Y=e[58];let Z;e[59]!==r?(Z=r("range"),e[59]=r,e[60]=Z):Z=e[60];let ee;e[61]!==Z?(ee=(0,t.jsx)(oe,{className:"text-right",children:Z}),e[61]=Z,e[62]=ee):ee=e[62];let te;e[63]!==r?(te=r("trend"),e[63]=r,e[64]=te):te=e[64];let re;e[65]!==te?(re=(0,t.jsx)(oe,{children:te}),e[65]=te,e[66]=re):re=e[66];let ae;e[67]!==r?(ae=r("trace"),e[67]=r,e[68]=ae):ae=e[68];let se;e[69]!==ae?(se=(0,t.jsx)(oe,{children:ae}),e[69]=ae,e[70]=se):se=e[70];let le;e[71]!==r?(le=r("dimensions"),e[71]=r,e[72]=le):le=e[72];let ne;e[73]!==le?(ne=(0,t.jsx)(oe,{children:le}),e[73]=le,e[74]=ne):ne=e[74],e[75]!==H||e[76]!==J||e[77]!==W||e[78]!==Y||e[79]!==ee||e[80]!==re||e[81]!==se||e[82]!==ne?(N=(0,t.jsx)(et,{children:(0,t.jsxs)(Pe,{children:[H,J,W,Y,ee,re,se,ne]})}),e[75]=H,e[76]=J,e[77]=W,e[78]=Y,e[79]=ee,e[80]=re,e[81]=se,e[82]=ne,e[83]=N):N=e[83],d=tt,I=L.map(q=>{let D=Rt(q.attributes),F=Bt(q.kind,q.name,q.attributes),P=(O.get(F)??[]).map(ie=>Jt(q.kind,ie));return(0,t.jsxs)(Pe,{"data-testid":`mt-instrument-${q.name}`,children:[(0,t.jsx)(B,{className:"font-mono text-xs",title:q.functionPath,children:q.name}),(0,t.jsx)(B,{children:(0,t.jsx)(Ge,{variant:Zt[q.kind],children:ge(q.kind)})}),(0,t.jsx)(B,{className:"text-right font-mono tabular-nums","data-testid":`mt-instrument-value-${q.name}`,children:dt(Vt(q))}),(0,t.jsx)(B,{className:"text-right tabular-nums text-muted-foreground",children:q.count.toLocaleString()}),(0,t.jsx)(B,{className:"text-right font-mono text-xs tabular-nums text-muted-foreground",children:q.min===q.max?"\u2014":`${dt(q.min)}\u2013${dt(q.max)}`}),(0,t.jsx)(B,{children:P.length>=2?(0,t.jsx)(it,{ariaLabel:r("{name} trend",{name:q.name}),className:"h-6 w-24 text-foreground",series:P,testId:`mt-instrument-trend-${q.name}`}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(B,{className:"font-mono text-xs",children:(0,t.jsx)(er,{name:q.name,onOpenTrace:s,traceId:q.exemplarTraceId})}),(0,t.jsx)(B,{className:"max-w-64 truncate font-mono text-xs text-muted-foreground",title:D,children:D===""?"\u2014":D})]},F)})}e[6]=n,e[7]=m,e[8]=p,e[9]=c,e[10]=s,e[11]=r,e[12]=d,e[13]=f,e[14]=g,e[15]=v,e[16]=x,e[17]=S,e[18]=y,e[19]=w,e[20]=I,e[21]=k,e[22]=N,e[23]=z,e[24]=_}else d=e[12],f=e[13],g=e[14],v=e[15],x=e[16],S=e[17],y=e[18],w=e[19],I=e[20],k=e[21],N=e[22],z=e[23],_=e[24];if(w!==Symbol.for("react.early_return_sentinel"))return w;let C;e[84]!==d||e[85]!==I?(C=(0,t.jsx)(d,{children:I}),e[84]=d,e[85]=I,e[86]=C):C=e[86];let R;e[87]!==f||e[88]!==C||e[89]!==k||e[90]!==N?(R=(0,t.jsxs)(f,{"data-testid":k,children:[N,C]}),e[87]=f,e[88]=C,e[89]=k,e[90]=N,e[91]=R):R=e[91];let M;e[92]!==g||e[93]!==R||e[94]!==z?(M=(0,t.jsx)(g,{className:z,children:R}),e[92]=g,e[93]=R,e[94]=z,e[95]=M):M=e[95];let $;e[96]!==v||e[97]!==M||e[98]!==_?($=(0,t.jsx)(v,{className:_,children:M}),e[96]=v,e[97]=M,e[98]=_,e[99]=$):$=e[99];let A;return e[100]!==x||e[101]!==S||e[102]!==y||e[103]!==$?(A=(0,t.jsxs)("section",{className:x,"data-testid":S,children:[y,$]}),e[100]=x,e[101]=S,e[102]=y,e[103]=$,e[104]=A):A=e[104],A},"es"),rr=b(l=>{let e=(0,me.c)(74),{aggregate:s,shardResults:a}=l,r=he(),o;e[0]!==r?(o=r("Shards"),e[0]=r,e[1]=o):o=e[1];let i;e[2]!==s.failed||e[3]!==s.reachable||e[4]!==r?(i=s.failed>0?r("{reachable} reachable, {failed} unreachable",{failed:s.failed,reachable:s.reachable}):r("{reachable} reachable",{reachable:s.reachable}),e[2]=s.failed,e[3]=s.reachable,e[4]=r,e[5]=i):i=e[5];let n;e[6]!==o||e[7]!==i?(n=(0,t.jsx)(de,{label:o,testId:"mt-agg-shards",value:i}),e[6]=o,e[7]=i,e[8]=n):n=e[8];let m;e[9]!==r?(m=r("Total requests"),e[9]=r,e[10]=m):m=e[10];let p;e[11]!==s.totalRequests||e[12]!==m?(p=(0,t.jsx)(de,{label:m,testId:"mt-agg-requests",value:s.totalRequests}),e[11]=s.totalRequests,e[12]=m,e[13]=p):p=e[13];let h;e[14]!==r?(h=r("Total errors"),e[14]=r,e[15]=h):h=e[15];let u;e[16]!==s.totalErrors||e[17]!==h?(u=(0,t.jsx)(de,{label:h,testId:"mt-agg-errors",value:s.totalErrors}),e[16]=s.totalErrors,e[17]=h,e[18]=u):u=e[18];let c;e[19]!==r?(c=r("Total database size"),e[19]=r,e[20]=c):c=e[20];let d;e[21]!==s.totalDatabaseSize?(d=Je(s.totalDatabaseSize),e[21]=s.totalDatabaseSize,e[22]=d):d=e[22];let f;e[23]!==c||e[24]!==d?(f=(0,t.jsx)(de,{label:c,testId:"mt-agg-db-size",value:d}),e[23]=c,e[24]=d,e[25]=f):f=e[25];let g;e[26]!==r?(g=r("Combined cache hit rate"),e[26]=r,e[27]=g):g=e[27];let v;e[28]!==s.hitRate||e[29]!==r?(v=s.hitRate===null?r("no cache configured"):`${(s.hitRate*100).toFixed(1)}%`,e[28]=s.hitRate,e[29]=r,e[30]=v):v=e[30];let x;e[31]!==g||e[32]!==v?(x=(0,t.jsx)(de,{label:g,testId:"mt-agg-cache",value:v}),e[31]=g,e[32]=v,e[33]=x):x=e[33];let S;e[34]!==f||e[35]!==x||e[36]!==n||e[37]!==p||e[38]!==u?(S=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"mt-aggregate-stats",children:[n,p,u,f,x]}),e[34]=f,e[35]=x,e[36]=n,e[37]=p,e[38]=u,e[39]=S):S=e[39];let y;e[40]!==r?(y=r("shard"),e[40]=r,e[41]=y):y=e[41];let w;e[42]!==y?(w=(0,t.jsx)(oe,{children:y}),e[42]=y,e[43]=w):w=e[43];let I;e[44]!==r?(I=r("requests"),e[44]=r,e[45]=I):I=e[45];let k;e[46]!==I?(k=(0,t.jsx)(oe,{children:I}),e[46]=I,e[47]=k):k=e[47];let N;e[48]!==r?(N=r("errors"),e[48]=r,e[49]=N):N=e[49];let z;e[50]!==N?(z=(0,t.jsx)(oe,{children:N}),e[50]=N,e[51]=z):z=e[51];let _;e[52]!==r?(_=r("db size"),e[52]=r,e[53]=_):_=e[53];let C;e[54]!==_?(C=(0,t.jsx)(oe,{children:_}),e[54]=_,e[55]=C):C=e[55];let R;e[56]!==w||e[57]!==k||e[58]!==z||e[59]!==C?(R=(0,t.jsx)(et,{children:(0,t.jsxs)(Pe,{children:[w,k,z,C]})}),e[56]=w,e[57]=k,e[58]=z,e[59]=C,e[60]=R):R=e[60];let M;if(e[61]!==a||e[62]!==r){let E;e[64]!==r?(E=b(O=>(0,t.jsxs)(Pe,{"data-testid":`mt-agg-row-${O.shard}`,children:[(0,t.jsx)(B,{children:O.shard}),O.metrics===null?(0,t.jsx)(B,{className:"text-destructive",colSpan:3,children:O.error??r("unreachable")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B,{className:"tabular-nums",children:O.metrics.requests}),(0,t.jsx)(B,{className:"tabular-nums",children:O.metrics.errors}),(0,t.jsx)(B,{className:"tabular-nums",children:Je(O.metrics.databaseSize)})]})]},O.shard),"L"),e[64]=r,e[65]=E):E=e[65],M=a.map(E),e[61]=a,e[62]=r,e[63]=M}else M=e[63];let $;e[66]!==M?($=(0,t.jsx)(tt,{children:M}),e[66]=M,e[67]=$):$=e[67];let A;e[68]!==R||e[69]!==$?(A=(0,t.jsx)(fe,{className:"overflow-hidden py-0",children:(0,t.jsx)(xe,{className:"px-0",children:(0,t.jsxs)(Ze,{"data-testid":"mt-agg-table",children:[R,$]})})}),e[68]=R,e[69]=$,e[70]=A):A=e[70];let L;return e[71]!==S||e[72]!==A?(L=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mt-aggregate-view",children:[S,A]}),e[71]=S,e[72]=A,e[73]=L):L=e[73],L},"ts"),ar=b(l=>{let e=(0,me.c)(75),{currentDelta:s,errorRate:a,history:r,latencyPercentiles:o,metrics:i}=l,n=he(),{cache:m}=i,p;e[0]!==r||e[1]!==n?(p=r.length>=2?(0,t.jsx)(it,{ariaLabel:n("Requests per interval over time"),className:"h-7 w-24 text-foreground",series:r,testId:"mt-sparkline"}):void 0,e[0]=r,e[1]=n,e[2]=p):p=e[2];let h;e[3]!==s||e[4]!==r.length||e[5]!==n?(h=r.length>=2?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:`+${s.toLocaleString()}`})," ",n("last interval")]}):(0,t.jsx)("span",{"data-testid":"mt-sparkline-empty",children:n("collecting samples\u2026")}),e[3]=s,e[4]=r.length,e[5]=n,e[6]=h):h=e[6];let u;e[7]!==n?(u=n("Requests"),e[7]=n,e[8]=u):u=e[8];let c;e[9]!==i.requests||e[10]!==p||e[11]!==h||e[12]!==u?(c=(0,t.jsx)(de,{chart:p,footer:h,label:u,testId:"mt-requests",value:i.requests}),e[9]=i.requests,e[10]=p,e[11]=h,e[12]=u,e[13]=c):c=e[13];let d;e[14]!==a||e[15]!==n?(d=n("{rate} error rate",{rate:a}),e[14]=a,e[15]=n,e[16]=d):d=e[16];let f;e[17]!==n?(f=n("Errors"),e[17]=n,e[18]=f):f=e[18];let g;e[19]!==a||e[20]!==i.errors?(g=(0,t.jsxs)(t.Fragment,{children:[i.errors," (",a,")"]}),e[19]=a,e[20]=i.errors,e[21]=g):g=e[21];let v;e[22]!==d||e[23]!==f||e[24]!==g?(v=(0,t.jsx)(de,{footer:d,label:f,testId:"mt-errors",value:g}),e[22]=d,e[23]=f,e[24]=g,e[25]=v):v=e[25];let x;e[26]!==o.p90?(x=o.p90>0?`P90 ${ot(o.p90)}`:void 0,e[26]=o.p90,e[27]=x):x=e[27];let S;e[28]!==n?(S=n("P95 latency"),e[28]=n,e[29]=S):S=e[29];let y;e[30]!==o.p95?(y=o.p95>0?ot(o.p95):"\u2014",e[30]=o.p95,e[31]=y):y=e[31];let w;e[32]!==S||e[33]!==y||e[34]!==x?(w=(0,t.jsx)(de,{footer:x,label:S,testId:"mt-p95",value:y}),e[32]=S,e[33]=y,e[34]=x,e[35]=w):w=e[35];let I;e[36]!==m||e[37]!==n?(I=m?`${m.entries.toLocaleString()} ${n("cache entries")}`:void 0,e[36]=m,e[37]=n,e[38]=I):I=e[38];let k;e[39]!==n?(k=n("Database size"),e[39]=n,e[40]=k):k=e[40];let N;e[41]!==i.databaseSize?(N=Je(i.databaseSize),e[41]=i.databaseSize,e[42]=N):N=e[42];let z;e[43]!==I||e[44]!==k||e[45]!==N?(z=(0,t.jsx)(de,{footer:I,label:k,testId:"mt-db-size",value:N}),e[43]=I,e[44]=k,e[45]=N,e[46]=z):z=e[46];let _;e[47]!==n?(_=n("Shard"),e[47]=n,e[48]=_):_=e[48];let C;e[49]!==i.shard||e[50]!==_?(C=(0,t.jsx)(de,{label:_,testId:"mt-shard",value:i.shard}),e[49]=i.shard,e[50]=_,e[51]=C):C=e[51];let R;e[52]!==n?(R=n("Uptime"),e[52]=n,e[53]=R):R=e[53];let M;e[54]!==i.uptimeMs?(M=Pt(i.uptimeMs),e[54]=i.uptimeMs,e[55]=M):M=e[55];let $;e[56]!==R||e[57]!==M?($=(0,t.jsx)(de,{label:R,testId:"mt-uptime",value:M}),e[56]=R,e[57]=M,e[58]=$):$=e[58];let A;e[59]!==n?(A=n("Cache hit rate"),e[59]=n,e[60]=A):A=e[60];let L;e[61]!==m||e[62]!==n?(L=m?n("{rate} ({count} entries)",{count:m.entries,rate:jt(m.hits,m.misses)}):n("no cache configured"),e[61]=m,e[62]=n,e[63]=L):L=e[63];let E;e[64]!==A||e[65]!==L?(E=(0,t.jsx)(de,{label:A,testId:"mt-cache",value:L}),e[64]=A,e[65]=L,e[66]=E):E=e[66];let O;return e[67]!==w||e[68]!==z||e[69]!==C||e[70]!==$||e[71]!==E||e[72]!==c||e[73]!==v?(O=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4","data-testid":"mt-stats",children:[c,v,w,z,C,$,E]}),e[67]=w,e[68]=z,e[69]=C,e[70]=$,e[71]=E,e[72]=c,e[73]=v,e[74]=O):O=e[74],O},"ss"),We=b(l=>l>=100?"critical":l>=50?"warning":"good","Ge"),Qe=b(l=>l<1?`${(l*1e3).toFixed(0)}\u03BCs`:l<1e3?`${l.toFixed(1)}ms`:`${(l/1e3).toFixed(2)}s`,"Le"),Ve=b(l=>l>=1e9?`${(l/1e9).toFixed(1)}B`:l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:l.toLocaleString(),"Ue"),sr=b(l=>{let e=(0,me.c)(3),{level:s}=l;if(s==="critical"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(Ge,{variant:"destructive",children:"Slow"}),e[0]=r):r=e[0],r}if(s==="warning"){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",children:"Moderate"}),e[1]=r):r=e[1],r}let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",children:"Fast"}),e[2]=a):a=e[2],a},"rs"),lr=b((l,e)=>{let s=[...l];return s.sort((a,r)=>{switch(e){case"avgTime":return r.avgDurationMs-a.avgDurationMs;case"execCount":return r.execCount-a.execCount;case"rowsRead":return r.rowsRead-a.rowsRead;default:return r.totalDurationMs-a.totalDurationMs}}),s},"ls"),nr=b(l=>{let e=(0,me.c)(161),{queryStats:s}=l,a=he(),[r,o]=(0,j.useState)("totalTime"),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=new Set,e[0]=i):i=e[0];let[n,m]=(0,j.useState)(i),p;e[1]===Symbol.for("react.memo_cache_sentinel")?(p=b(_=>{_!==null&&o(_)},"p"),e[1]=p):p=e[1];let h=p,u,c,d,f,g,v,x,S,y,w;if(e[2]!==n||e[3]!==s||e[4]!==r||e[5]!==a){d=Symbol.for("react.early_return_sentinel");e:{let _=lr(s,r),C;e[16]!==s?(C=s.filter(ir),e[16]=s,e[17]=C):C=e[17];let R=C.length,M;e[18]!==s?(M=s.filter(or),e[18]=s,e[19]=M):M=e[19];let $=M.length,A;e[20]!==s?(A=s.filter(dr),e[20]=s,e[21]=A):A=e[21];let L=A.length,E;e[22]===Symbol.for("react.memo_cache_sentinel")?(E=b(K=>{m(ce=>{let Q=new Set(ce);return Q.has(K)?Q.delete(K):Q.add(K),Q})},"L"),e[22]=E):E=e[22];let O=E;if(s.length===0){let K;e[23]!==a?(K=a("No query insights yet"),e[23]=a,e[24]=K):K=e[24];let ce;e[25]!==K?(ce=(0,t.jsx)("p",{className:"text-lg font-medium","data-testid":"qi-empty",children:K}),e[25]=K,e[26]=ce):ce=e[26];let Q;e[27]!==a?(Q=a("Query insights appear once statements are executed against this shard."),e[27]=a,e[28]=Q):Q=e[28];let pe;e[29]!==Q?(pe=(0,t.jsx)("p",{className:"mt-1 text-sm",children:Q}),e[29]=Q,e[30]=pe):pe=e[30];let He;e[31]!==ce||e[32]!==pe?(He=(0,t.jsx)(fe,{children:(0,t.jsx)(xe,{className:"py-12",children:(0,t.jsxs)("div",{className:"text-center text-muted-foreground",children:[ce,pe]})})}),e[31]=ce,e[32]=pe,e[33]=He):He=e[33],d=He;break e}x="space-y-4",S="qi-root";let ue;e[34]!==a?(ue=a("Critical queries"),e[34]=a,e[35]=ue):ue=e[35];let ge;e[36]!==ue?(ge=(0,t.jsx)(Oe,{className:"pb-2",children:(0,t.jsx)(De,{className:"text-sm font-medium",children:ue})}),e[36]=ue,e[37]=ge):ge=e[37];let T;e[38]!==R?(T=(0,t.jsx)("div",{className:"text-2xl font-bold text-destructive","data-testid":"qi-critical",children:R}),e[38]=R,e[39]=T):T=e[39];let U;e[40]!==a?(U=a(">100ms avg execution"),e[40]=a,e[41]=U):U=e[41];let H;e[42]!==U?(H=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:U}),e[42]=U,e[43]=H):H=e[43];let G;e[44]!==T||e[45]!==H?(G=(0,t.jsxs)(xe,{children:[T,H]}),e[44]=T,e[45]=H,e[46]=G):G=e[46];let J;e[47]!==ge||e[48]!==G?(J=(0,t.jsxs)(fe,{children:[ge,G]}),e[47]=ge,e[48]=G,e[49]=J):J=e[49];let V;e[50]!==a?(V=a("Moderate queries"),e[50]=a,e[51]=V):V=e[51];let W;e[52]!==V?(W=(0,t.jsx)(Oe,{className:"pb-2",children:(0,t.jsx)(De,{className:"text-sm font-medium",children:V})}),e[52]=V,e[53]=W):W=e[53];let X;e[54]!==$?(X=(0,t.jsx)("div",{className:"text-2xl font-bold text-warning","data-testid":"qi-moderate",children:$}),e[54]=$,e[55]=X):X=e[55];let Y;e[56]!==a?(Y=a("50\u2013100ms avg execution"),e[56]=a,e[57]=Y):Y=e[57];let Z;e[58]!==Y?(Z=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:Y}),e[58]=Y,e[59]=Z):Z=e[59];let ee;e[60]!==X||e[61]!==Z?(ee=(0,t.jsxs)(xe,{children:[X,Z]}),e[60]=X,e[61]=Z,e[62]=ee):ee=e[62];let te;e[63]!==W||e[64]!==ee?(te=(0,t.jsxs)(fe,{children:[W,ee]}),e[63]=W,e[64]=ee,e[65]=te):te=e[65];let re;e[66]!==a?(re=a("Fast queries"),e[66]=a,e[67]=re):re=e[67];let ae;e[68]!==re?(ae=(0,t.jsx)(Oe,{className:"pb-2",children:(0,t.jsx)(De,{className:"text-sm font-medium",children:re})}),e[68]=re,e[69]=ae):ae=e[69];let se;e[70]!==L?(se=(0,t.jsx)("div",{className:"text-2xl font-bold text-success","data-testid":"qi-fast",children:L}),e[70]=L,e[71]=se):se=e[71];let le;e[72]!==a?(le=a("<50ms avg execution"),e[72]=a,e[73]=le):le=e[73];let ne;e[74]!==le?(ne=(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:le}),e[74]=le,e[75]=ne):ne=e[75];let q;e[76]!==se||e[77]!==ne?(q=(0,t.jsxs)(xe,{children:[se,ne]}),e[76]=se,e[77]=ne,e[78]=q):q=e[78];let D;e[79]!==ae||e[80]!==q?(D=(0,t.jsxs)(fe,{children:[ae,q]}),e[79]=ae,e[80]=q,e[81]=D):D=e[81],e[82]!==J||e[83]!==te||e[84]!==D?(y=(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-3",children:[J,te,D]}),e[82]=J,e[83]=te,e[84]=D,e[85]=y):y=e[85];let F;e[86]!==a?(F=a("Query leaderboard"),e[86]=a,e[87]=F):F=e[87];let P;e[88]!==F?(P=(0,t.jsx)("h3",{className:"text-lg font-semibold",children:F}),e[88]=F,e[89]=P):P=e[89];let ie;e[90]!==r||e[91]!==a?(ie=a("Slow queries sorted by {sortField}",{sortField:a(r)}),e[90]=r,e[91]=a,e[92]=ie):ie=e[92];let be;e[93]!==ie?(be=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:ie}),e[93]=ie,e[94]=be):be=e[94];let ve;e[95]!==P||e[96]!==be?(ve=(0,t.jsxs)("div",{children:[P,be]}),e[95]=P,e[96]=be,e[97]=ve):ve=e[97];let ye;e[98]!==a?(ye=a("Sort by"),e[98]=a,e[99]=ye):ye=e[99];let Ne;e[100]!==ye?(Ne=(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:ye}),e[100]=ye,e[101]=Ne):Ne=e[101];let Se;e[102]!==a?(Se=a("Sort queries by"),e[102]=a,e[103]=Se):Se=e[103];let Be;e[104]===Symbol.for("react.memo_cache_sentinel")?(Be=(0,t.jsx)(Ct,{}),e[104]=Be):Be=e[104];let we;e[105]!==Se?(we=(0,t.jsx)(Mt,{"aria-label":Se,className:"w-[140px]","data-testid":"qi-sort",children:Be}),e[105]=Se,e[106]=we):we=e[106];let qe;e[107]!==a?(qe=a("Total time"),e[107]=a,e[108]=qe):qe=e[108];let _e;e[109]!==qe?(_e=(0,t.jsx)(je,{value:"totalTime",children:qe}),e[109]=qe,e[110]=_e):_e=e[110];let ke;e[111]!==a?(ke=a("Avg time"),e[111]=a,e[112]=ke):ke=e[112];let Ce;e[113]!==ke?(Ce=(0,t.jsx)(je,{value:"avgTime",children:ke}),e[113]=ke,e[114]=Ce):Ce=e[114];let Me;e[115]!==a?(Me=a("Execution count"),e[115]=a,e[116]=Me):Me=e[116];let Ie;e[117]!==Me?(Ie=(0,t.jsx)(je,{value:"execCount",children:Me}),e[117]=Me,e[118]=Ie):Ie=e[118];let Re;e[119]!==a?(Re=a("Rows read"),e[119]=a,e[120]=Re):Re=e[120];let $e;e[121]!==Re?($e=(0,t.jsx)(je,{value:"rowsRead",children:Re}),e[121]=Re,e[122]=$e):$e=e[122];let Ae;e[123]!==_e||e[124]!==Ce||e[125]!==Ie||e[126]!==$e?(Ae=(0,t.jsxs)(It,{children:[_e,Ce,Ie,$e]}),e[123]=_e,e[124]=Ce,e[125]=Ie,e[126]=$e,e[127]=Ae):Ae=e[127];let ze;e[128]!==r||e[129]!==we||e[130]!==Ae?(ze=(0,t.jsxs)(kt,{onValueChange:h,value:r,children:[we,Ae]}),e[128]=r,e[129]=we,e[130]=Ae,e[131]=ze):ze=e[131];let Ke;e[132]!==Ne||e[133]!==ze?(Ke=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[Ne,ze]}),e[132]=Ne,e[133]=ze,e[134]=Ke):Ke=e[134],e[135]!==ve||e[136]!==Ke?(w=(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[ve,Ke]}),e[135]=ve,e[136]=Ke,e[137]=w):w=e[137],c=fe;let Le;e[138]!==a?(Le=a("Statements"),e[138]=a,e[139]=Le):Le=e[139];let Te;e[140]!==Le?(Te=(0,t.jsx)(De,{children:Le}),e[140]=Le,e[141]=Te):Te=e[141],v=(0,t.jsxs)(Oe,{children:[Te,(0,t.jsx)(ut,{children:a("{count} tracked statements",{count:_.length})})]}),u=xe,f="space-y-2";let Ue;e[142]!==n||e[143]!==a?(Ue=b(K=>{let ce=K.normalizedSql,Q=n.has(ce),pe=We(K.avgDurationMs);return(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border","data-testid":"qi-row",children:[(0,t.jsxs)("button",{"aria-expanded":Q,className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",onClick:b(()=>{O(ce)},"onClick"),type:"button",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsx)(sr,{level:pe}),(0,t.jsx)("span",{className:"max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",children:K.normalizedSql})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-4",children:[(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(K.totalDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("total")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(K.avgDurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("avg")})]}),K.p95DurationMs!==void 0&&(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Qe(K.p95DurationMs)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("p95")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:Ve(K.execCount)}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:a("calls")})]})]})]}),Q&&(0,t.jsxs)("div",{className:"space-y-3 border-t bg-muted/30 p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-sm font-medium",children:a("Full statement")}),(0,t.jsx)("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",children:K.normalizedSql})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm md:grid-cols-4",children:[K.p50DurationMs!==void 0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("p50")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(K.p50DurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Exec count")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(K.execCount)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Total time")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Qe(K.totalDurationMs)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows read")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(K.rowsRead)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:a("Rows written")}),(0,t.jsx)("span",{className:"block font-medium tabular-nums",children:Ve(K.rowsWritten)})]})]})]})]},ce)},"Ke"),e[142]=n,e[143]=a,e[144]=Ue):Ue=e[144],g=_.map(Ue)}e[2]=n,e[3]=s,e[4]=r,e[5]=a,e[6]=u,e[7]=c,e[8]=d,e[9]=f,e[10]=g,e[11]=v,e[12]=x,e[13]=S,e[14]=y,e[15]=w}else u=e[6],c=e[7],d=e[8],f=e[9],g=e[10],v=e[11],x=e[12],S=e[13],y=e[14],w=e[15];if(d!==Symbol.for("react.early_return_sentinel"))return d;let I;e[145]!==f||e[146]!==g?(I=(0,t.jsx)("div",{className:f,children:g}),e[145]=f,e[146]=g,e[147]=I):I=e[147];let k;e[148]!==u||e[149]!==I?(k=(0,t.jsx)(u,{children:I}),e[148]=u,e[149]=I,e[150]=k):k=e[150];let N;e[151]!==c||e[152]!==k||e[153]!==v?(N=(0,t.jsxs)(c,{children:[v,k]}),e[151]=c,e[152]=k,e[153]=v,e[154]=N):N=e[154];let z;return e[155]!==N||e[156]!==x||e[157]!==S||e[158]!==y||e[159]!==w?(z=(0,t.jsxs)("div",{className:x,"data-testid":S,children:[y,w,N]}),e[155]=N,e[156]=x,e[157]=S,e[158]=y,e[159]=w,e[160]=z):z=e[160],z},"as");function ir(l){return We(l.avgDurationMs)==="critical"}b(ir,"is");function or(l){return We(l.avgDurationMs)==="warning"}b(or,"ns");function dr(l){return We(l.avgDurationMs)==="good"}b(dr,"os");var cr=["1m","5m","15m","1h"],mr=b(l=>new Date(l).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}),"ds"),ur=b(l=>l.map(e=>({avg:Math.round(e.avgDurationMs*100)/100,execs:e.execCount,label:mr(e.bucketMs)})),"ms"),hr=b(({shardKey:l=""})=>{let e=he(),[s,a]=(0,j.useState)("15m"),r=Fe(Ee.getQueryInsights,{range:s},{live:!0,shardKey:l}).data,o=ur(r?.buckets??[]);return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"qi-range",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-lg border border-border p-0.5","data-testid":"qi-ranges",role:"group",children:cr.map(i=>(0,t.jsx)("button",{"aria-pressed":i===s,className:mt("rounded px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",i===s&&"bg-accent font-medium text-foreground"),"data-testid":`qi-range-${i}`,onClick:b(()=>{a(i)},"onClick"),type:"button",children:i},i))}),r?.capped===!0&&(0,t.jsx)(Ge,{"data-testid":"qi-capped",variant:"secondary",children:e("showing a capped set")})]}),o.length===0?(0,t.jsx)(ht,{description:e("Statements executed in the selected window appear here, with throughput and latency over time."),testId:"qi-empty",title:e("No queries in this window.")}):(0,t.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-throughput",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Throughput")}),(0,t.jsx)(rt,{height:140,width:"100%",children:(0,t.jsxs)(Lt,{data:o,children:[(0,t.jsx)(st,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(lt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(nt,{allowDecimals:!1,fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(at,{}),(0,t.jsx)(zt,{dataKey:"execs",fill:"var(--color-primary)",fillOpacity:.15,stroke:"var(--color-primary)",type:"monotone"})]})})]}),(0,t.jsxs)("figure",{className:"rounded-xl border border-border p-3","data-testid":"qi-latency",children:[(0,t.jsx)("figcaption",{className:"mb-2 text-xs font-medium text-muted-foreground",children:e("Mean latency (ms)")}),(0,t.jsx)(rt,{height:140,width:"100%",children:(0,t.jsxs)(Kt,{data:o,children:[(0,t.jsx)(st,{strokeDasharray:"3 3",vertical:!1}),(0,t.jsx)(lt,{dataKey:"label",fontSize:10,tickLine:!1}),(0,t.jsx)(nt,{fontSize:10,tickLine:!1,width:32}),(0,t.jsx)(at,{}),(0,t.jsx)(At,{dataKey:"avg",dot:!1,stroke:"var(--color-destructive)",type:"monotone"})]})})]})]}),(0,t.jsx)(nr,{queryStats:r?.entries??[]})]})},"fs"),gr=gt(Ee.getMetrics),pr=[],fr=b((l,e)=>l?e:"overview","gs"),xr=b(l=>{let e=(0,me.c)(14),s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={},e[0]=s):s=e[0];let a;e[1]!==l?(a={live:!0,shardKey:l},e[1]=l,e[2]=a):a=e[2];let r=Fe(Ee.getMetrics,s,a),{data:o}=r,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i={points:[],shard:null},e[3]=i):i=e[3];let[n,m]=(0,j.useState)(i),p=(0,j.useRef)(null),h=(0,j.useRef)(null),u,c;e[4]!==o||e[5]!==l?(u=b(()=>{o!==void 0&&Nt(l)},"u"),c=[o,l],e[4]=o,e[5]=l,e[6]=u,e[7]=c):(u=e[6],c=e[7]),(0,j.useEffect)(u,c);let d,f;e[8]!==o?(d=b(()=>{if(o===void 0)return;let x=o,S=h.current!==null&&h.current!==x.shard,y=h.current===x.shard?p.current:null;if(h.current=x.shard,p.current=x.requests,S){m({points:[],shard:x.shard});return}y!==null&&x.requests>=y&&m(w=>({points:[...w.shard===x.shard?w.points:[],x.requests-y].slice(-30),shard:x.shard}))},"c"),f=[o],e[8]=o,e[9]=d,e[10]=f):(d=e[9],f=e[10]),(0,j.useEffect)(d,f);let g=n.shard!==null&&n.shard===o?.shard?n.points:pr,v;return e[11]!==r||e[12]!==g?(v={...r,history:g},e[11]=r,e[12]=g,e[13]=v):v=e[13],v},"ps"),br=b(l=>{let e=vt(),s=(0,j.useRef)(!0);(0,j.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]);let[a,r]=(0,j.useState)(null),[o,i]=(0,j.useState)(!1),n=b(async()=>{i(!0);let p=l,h=Ot(p,yt());try{let u=await Promise.all(h.map(async c=>{try{let d=await e.query(gr,{},pt(c));return{error:null,metrics:d,shard:c===""?d.shard:c}}catch(d){return{error:ft(d),metrics:null,shard:c===""?"__root__":c}}}));s.current&&r({results:u,shard:p})}finally{s.current&&i(!1)}},"a"),m=a?.shard===l?a.results:null;return{aggregate:m===null?null:Et(m),aggregating:o,clearAggregate:b(()=>{r(null)},"clearAggregate"),runAggregate:b(()=>{bt(n())},"runAggregate"),shardResults:m}},"xs"),vr=b(l=>{if(!l||!("queryStats"in l))return;let e=l.queryStats;if(!(!e||!Array.isArray(e)))return Ft(e)},"bs"),Qt=b(l=>`pb-2 text-sm font-medium transition-colors ${l?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"ot"),yr=b(l=>{let e=(0,me.c)(26),{activeTab:s,onSelect:a,queryCount:r}=l,o=he(),i;e[0]!==a?(i=b(()=>{a("overview")},"n"),e[0]=a,e[1]=i):i=e[1];let n=i,m;e[2]!==a?(m=b(()=>{a("query-insights")},"m"),e[2]=a,e[3]=m):m=e[3];let p=m,h=s==="overview",u;e[4]!==h?(u=Qt(h),e[4]=h,e[5]=u):u=e[5];let c;e[6]!==o?(c=o("Overview"),e[6]=o,e[7]=c):c=e[7];let d;e[8]!==n||e[9]!==u||e[10]!==c?(d=(0,t.jsx)("button",{className:u,"data-testid":"mt-tab-overview",onClick:n,type:"button",children:c}),e[8]=n,e[9]=u,e[10]=c,e[11]=d):d=e[11];let f=s==="query-insights",g;e[12]!==f?(g=Qt(f),e[12]=f,e[13]=g):g=e[13];let v;e[14]!==o?(v=o("Query insights"),e[14]=o,e[15]=v):v=e[15];let x;e[16]!==r?(x=r>0&&(0,t.jsx)("span",{className:"ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:r}),e[16]=r,e[17]=x):x=e[17];let S;e[18]!==p||e[19]!==x||e[20]!==g||e[21]!==v?(S=(0,t.jsxs)("button",{className:g,"data-testid":"mt-tab-query-insights",onClick:p,type:"button",children:[v,x]}),e[18]=p,e[19]=x,e[20]=g,e[21]=v,e[22]=S):S=e[22];let y;return e[23]!==S||e[24]!==d?(y=(0,t.jsxs)("div",{className:"flex gap-2 border-b","data-testid":"mt-tabs",children:[d,S]}),e[23]=S,e[24]=d,e[25]=y):y=e[25],y},"vs"),Nr=b(l=>{let e=(0,me.c)(13),{history:s,metrics:a}=l,r;e[0]!==s?(r=s.at(-1)??0,e[0]=s,e[1]=r):r=e[1];let o;e[2]!==a.errors||e[3]!==a.requests?(o=a.requests===0?"\u2014":`${(a.errors/a.requests*100).toFixed(1)}%`,e[2]=a.errors,e[3]=a.requests,e[4]=o):o=e[4];let i;e[5]!==a?(i=Dt(a),e[5]=a,e[6]=i):i=e[6];let n;return e[7]!==s||e[8]!==a||e[9]!==r||e[10]!==o||e[11]!==i?(n=(0,t.jsx)(ar,{currentDelta:r,errorRate:o,history:s,latencyPercentiles:i,metrics:a}),e[7]=s,e[8]=a,e[9]=r,e[10]=o,e[11]=i,e[12]=n):n=e[12],n},"ys"),Sr=b(l=>{let e=(0,me.c)(25),{aggregating:s,liveError:a,onAggregate:r,onClearAggregate:o,onShardKeyChange:i,shardKey:n}=l,m=he(),p;e[0]!==i||e[1]!==n?(p=(0,t.jsx)(St,{onChange:i,testId:"mt-shard-input",value:n}),e[0]=i,e[1]=n,e[2]=p):p=e[2];let h;e[3]!==a?(h=(0,t.jsx)(qt,{message:a,prefix:"mt"}),e[3]=a,e[4]=h):h=e[4];let u;e[5]!==s||e[6]!==m?(u=m(s?"Aggregating\u2026":"All shards"),e[5]=s,e[6]=m,e[7]=u):u=e[7];let c;e[8]!==s||e[9]!==r||e[10]!==u?(c=(0,t.jsx)(Ye,{"data-testid":"mt-aggregate",disabled:s,onClick:r,size:"sm",type:"button",variant:"secondary",children:u}),e[8]=s,e[9]=r,e[10]=u,e[11]=c):c=e[11];let d;e[12]!==o||e[13]!==m?(d=o!==void 0&&(0,t.jsx)(Ye,{"data-testid":"mt-aggregate-clear",onClick:o,size:"sm",type:"button",variant:"ghost",children:m("Hide")}),e[12]=o,e[13]=m,e[14]=d):d=e[14];let f;e[15]!==m?(f=m("Open in Cloudflare"),e[15]=m,e[16]=f):f=e[16];let g;e[17]!==f?(g=(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"mt-cf-link",href:_t,rel:"noreferrer",target:"_blank",children:f}),e[17]=f,e[18]=g):g=e[18];let v;return e[19]!==p||e[20]!==h||e[21]!==c||e[22]!==d||e[23]!==g?(v=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[p,h,c,d,g]}),e[19]=p,e[20]=h,e[21]=c,e[22]=d,e[23]=g,e[24]=v):v=e[24],v},"Ns"),Jr=b(l=>{let e=(0,me.c)(41),{initialShardKey:s}=l,{queryShardKey:a,setShardKey:r,shardKey:o}=wt(s),[i,n]=(0,j.useState)("overview"),m=$t(a),{data:p,error:h,history:u,liveError:c}=xr(a),d=p??null,{aggregate:f,aggregating:g,clearAggregate:v,runAggregate:x,shardResults:S}=br(o),y;e[0]!==d?(y=vr(d),e[0]=d,e[1]=y):y=e[1];let w=y,I=w!==void 0,k;e[2]!==i||e[3]!==I?(k=fr(I,i),e[2]=i,e[3]=I,e[4]=k):k=e[4];let N=k,z=S===null?void 0:v,_;e[5]!==g||e[6]!==c||e[7]!==x||e[8]!==r||e[9]!==o||e[10]!==z?(_=(0,t.jsx)(Sr,{aggregating:g,liveError:c,onAggregate:x,onClearAggregate:z,onShardKeyChange:r,shardKey:o}),e[5]=g,e[6]=c,e[7]=x,e[8]=r,e[9]=o,e[10]=z,e[11]=_):_=e[11];let C;e[12]!==h?(C=h!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"mt-error",role:"alert",children:h}),e[12]=h,e[13]=C):C=e[13];let R;e[14]!==N||e[15]!==w?(R=w!==void 0&&(0,t.jsx)(yr,{activeTab:N,onSelect:n,queryCount:w.length}),e[14]=N,e[15]=w,e[16]=R):R=e[16];let M;e[17]!==N||e[18]!==a||e[19]!==w?(M=N==="query-insights"&&w!==void 0&&(0,t.jsx)(hr,{shardKey:a}),e[17]=N,e[18]=a,e[19]=w,e[20]=M):M=e[20];let $;e[21]!==N||e[22]!==u||e[23]!==d?($=N==="overview"&&d!==null&&(0,t.jsx)(Nr,{history:u,metrics:d}),e[21]=N,e[22]=u,e[23]=d,e[24]=$):$=e[24];let A;e[25]!==N||e[26]!==m||e[27]!==a?(A=N==="overview"&&(0,t.jsx)(tr,{onOpenTrace:m,shardKey:a}),e[25]=N,e[26]=m,e[27]=a,e[28]=A):A=e[28];let L;e[29]!==f||e[30]!==N||e[31]!==S?(L=N==="overview"&&f!==null&&S!==null&&(0,t.jsx)(rr,{aggregate:f,shardResults:S}),e[29]=f,e[30]=N,e[31]=S,e[32]=L):L=e[32];let E;return e[33]!==A||e[34]!==L||e[35]!==_||e[36]!==C||e[37]!==R||e[38]!==M||e[39]!==$?(E=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-metrics",children:[_,C,R,M,$,A,L]}),e[33]=A,e[34]=L,e[35]=_,e[36]=C,e[37]=R,e[38]=M,e[39]=$,e[40]=E):E=e[40],E},"Js");export{Jr as MetricsPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as Ze}from"./chunk-QWRK4ESB.js";import{a as qe}from"./chunk-ITH5LRWM.js";import{a as Ke}from"./chunk-Q6HA3L2H.js";import{a as He}from"./chunk-TYD3V4NB.js";import{a as L}from"./chunk-KZCEJFZF.js";import{a as Je}from"./chunk-FCAXVYAX.js";import"./chunk-WM72PRE3.js";import{a as We}from"./chunk-473JK2PQ.js";import{a as Xe}from"./chunk-6QEXGYWH.js";import"./chunk-NGVP66OH.js";import"./chunk-XYR5NST4.js";import{i as T}from"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as _}from"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as D}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{b as De}from"./chunk-4DAKKAK7.js";import{m as Z}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as Ve}from"./chunk-XMSNLMWU.js";import{a as ze,b as _e,c as Pe,d as q,e as U,f as z}from"./chunk-HHRYM6UW.js";import{a as J,e as K}from"./chunk-JSDKOE4U.js";import{A as Qe,C as te,l as Q,p as Ee,x as Ue,y as X}from"./chunk-BFE2DRP6.js";import{a as s,d as Me,e as at,f as lt,g as nt}from"./chunk-OXFKZ4BM.js";var C=Me(at(),1);var W=Me(lt(),1);var t=Me(nt(),1);var it=s(()=>{let h=(0,W.c)(3),{config:e,ready:n}=qe(),l;return h[0]!==e.capabilities||h[1]!==n?(l={capabilities:e.capabilities,ready:n},h[0]=e.capabilities,h[1]=n,h[2]=l):l=h[2],l},"nt"),st=s((h,e)=>typeof h.acceptedAt=="number"?"spent":typeof h.expiresAt=="number"&&h.expiresAt<=e?"expired":"pending","lt"),et=500,rt=s((h,e)=>{if(!URL.canParse(h.trim()))return null;let n=new URL(h.trim());return n.searchParams.set("email",e.email),n.searchParams.set("invite",e.token),n.toString()},"at"),dt=s(h=>{let e=(0,W.c)(34),{issued:n,onSignUpPageChange:l,signUpPage:o}=h,a=Q(),[p,i]=(0,C.useState)(null),u;e[0]!==n||e[1]!==o?(u=rt(o,n),e[0]=n,e[1]=o,e[2]=u):u=e[2];let c=u,y;e[3]!==c?(y=s(()=>{let $="navigator"in globalThis?globalThis.navigator.clipboard:void 0;c===null||$===void 0||X($.writeText(c).then(()=>(i(c),!0)))},"y"),e[3]=c,e[4]=y):y=e[4];let w=y,g;e[5]!==a?(g=a("Send this link to the invitee. It is shown once and cannot be recovered."),e[5]=a,e[6]=g):g=e[6];let I;e[7]!==g?(I=(0,t.jsx)("p",{className:"text-sm",children:g}),e[7]=g,e[8]=I):I=e[8];let k=c===null,v;e[9]!==a?(v=a("Your app's sign-up page"),e[9]=a,e[10]=v):v=e[10];let d;e[11]!==l?(d=s($=>{l($.target.value)},"r"),e[11]=l,e[12]=d):d=e[12];let m;e[13]!==o||e[14]!==k||e[15]!==v||e[16]!==d?(m=(0,t.jsx)(T,{"aria-invalid":k,"aria-label":v,"data-testid":"sign-up-invitation-page",onChange:d,value:o}),e[13]=o,e[14]=k,e[15]=v,e[16]=d,e[17]=m):m=e[17];let b=c??"",x;e[18]!==b?(x=(0,t.jsx)(T,{"data-testid":"sign-up-invitation-link",readOnly:!0,value:b}),e[18]=b,e[19]=x):x=e[19];let N;e[20]!==p||e[21]!==c||e[22]!==a?(N=a(p!==null&&p===c?"Copied":"Copy"),e[20]=p,e[21]=c,e[22]=a,e[23]=N):N=e[23];let f;e[24]!==w||e[25]!==N?(f=(0,t.jsx)(_,{"data-testid":"sign-up-invitation-copy",onClick:w,type:"button",children:N}),e[24]=w,e[25]=N,e[26]=f):f=e[26];let r;e[27]!==x||e[28]!==f?(r=(0,t.jsxs)("div",{className:"flex gap-2",children:[x,f]}),e[27]=x,e[28]=f,e[29]=r):r=e[29];let A;return e[30]!==r||e[31]!==I||e[32]!==m?(A=(0,t.jsx)(J,{children:(0,t.jsxs)(K,{className:"flex flex-col gap-2 p-4",children:[I,m,r]})}),e[30]=r,e[31]=I,e[32]=m,e[33]=A):A=e[33],A},"it"),ot=s(()=>{let h=Z(),e=Q(),[n,l]=(0,C.useState)(""),[o,a]=(0,C.useState)(null),[p,i]=(0,C.useState)(null),[u,c]=(0,C.useState)(()=>`${Qe(h.url)}/sign-up`),y=De(["lunora-auth-sign-up-invitations",et],()=>h.listAuthSignUpInvitations({limit:et})),w=y.data?.rows??null,g=y.data?.total??0,I=s(()=>{let v=n.trim();v!==""&&(a(null),X((async()=>{try{let d=await h.createAuthSignUpInvitation({email:v}),m=typeof d.token=="string"?d.token:void 0;i(m===void 0?null:{email:v,token:m}),l(""),y.refetch()}catch(d){a(d instanceof Error?d.message:String(d))}})()))},"w"),k=s(v=>{a(null),X((async()=>{try{await h.revokeAuthSignUpInvitation({email:v}),y.refetch()}catch(d){a(d instanceof Error?d.message:String(d))}})())},"k");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"sign-up-invitations",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-base font-medium",children:e("Sign-up invitations")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("Only invited addresses can create an account. Nothing is emailed \u2014 send the invitee the one-time link yourself.")})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(T,{"aria-label":e("Email address to invite"),"data-testid":"sign-up-invitation-email",onChange:s(v=>{l(v.target.value)},"onChange"),placeholder:e("ada@example.com"),type:"email",value:n}),(0,t.jsx)(_,{"data-testid":"sign-up-invitation-submit",onClick:I,type:"button",children:e("Invite")})]}),p!==null&&(0,t.jsx)(dt,{issued:p,onSignUpPageChange:c,signUpPage:u},p.token),(o??y.error)!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sign-up-invitations-error",role:"alert",children:o??y.error}),w!==null&&w.length===0&&(0,t.jsx)(Ve,{testId:"sign-up-invitations-empty",title:e("Nobody has been invited yet.")}),w!==null&&g>w.length&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sign-up-invitations-truncated",children:e("Showing the most recent invitations. Query the signUpInvitation table directly to see the rest.")}),w!==null&&w.length>0&&(0,t.jsx)(J,{children:(0,t.jsx)(K,{className:"p-0",children:(0,t.jsxs)(ze,{children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(q,{children:[(0,t.jsx)(U,{children:e("Email")}),(0,t.jsx)(U,{children:e("Status")}),(0,t.jsx)(U,{children:e("Expires")}),(0,t.jsx)(U,{children:e("Invited by")}),(0,t.jsx)(U,{})]})}),(0,t.jsx)(Pe,{children:w.map(v=>{let d=st(v,Date.now()),m=v.email??"";return(0,t.jsxs)(q,{"data-testid":`sign-up-invitation-${m}`,children:[(0,t.jsx)(z,{children:m}),(0,t.jsxs)(z,{"data-testid":`sign-up-invitation-status-${m}`,children:[d==="spent"&&e("Accepted"),d==="expired"&&e("Expired"),d==="pending"&&e("Pending")]}),(0,t.jsx)(z,{children:typeof v.expiresAt=="number"?te(v.expiresAt):"\u2014"}),(0,t.jsx)(z,{children:v.invitedBy??"\u2014"}),(0,t.jsx)(z,{className:"text-right",children:(0,t.jsx)(_,{onClick:s(()=>{k(m)},"onClick"),type:"button",variant:"ghost",children:e("Revoke")})})]},v.id)})})]})})})]})},"rt"),ct={boolean:"checkbox",date:"datetime-local",number:"number",string:"text"},ut=s((h,e)=>h.type==="boolean"?!0:typeof e!="string"||e.trim()===""?!1:h.type!=="number"||!Number.isNaN(Number(e.trim())),"dt"),mt=s((h,e)=>{if(h.type==="boolean")return e===!0?{value:!0}:h.required?{value:!1}:void 0;let n=typeof e=="string"?e.trim():"";if(n!==""){if(h.type==="number"){let l=Number(n);return Number.isNaN(l)?void 0:{value:l}}return{value:n}}},"ct"),ht=s(h=>{let e=(0,W.c)(105),{onClose:n,onCreated:l}=h,o=Z(),a=Q(),{config:p}=qe(),{busy:i,error:u,run:c}=Ke(),[y,w]=(0,C.useState)(""),[g,I]=(0,C.useState)(""),[k,v]=(0,C.useState)(""),[d,m]=(0,C.useState)(""),b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={},e[0]=b):b=e[0];let[x,N]=(0,C.useState)(b),f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=s(S=>{w(S.target.value)},"p"),e[1]=f):f=e[1];let r=f,A;e[2]===Symbol.for("react.memo_cache_sentinel")?(A=s(S=>{I(S.target.value)},"S"),e[2]=A):A=e[2];let $=A,j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=s(S=>{v(S.target.value)},"z"),e[3]=j):j=e[3];let H=j,M;e[4]===Symbol.for("react.memo_cache_sentinel")?(M=s(S=>{m(S.target.value)},"M"),e[4]=M):M=e[4];let Y=M,B;e[5]===Symbol.for("react.memo_cache_sentinel")?(B=s((S,R)=>{N(ee=>({...ee,[S]:R}))},"L"),e[5]=B):B=e[5];let V=B,G;e[6]!==x?(G=s(S=>x[S.name]??(S.type==="boolean"?!1:""),"Y"),e[6]=x,e[7]=G):G=e[7];let P=G,O;if(e[8]!==p.userFields||e[9]!==P){let S;e[11]!==P?(S=s(R=>!R.required||ut(R,P(R)),"A"),e[11]=P,e[12]=S):S=e[12],O=p.userFields.every(S),e[8]=p.userFields,e[9]=P,e[10]=O}else O=e[10];let F=O,E;e[13]!==i||e[14]!==y||e[15]!==g||e[16]!==F?(E=!i&&y.trim()!==""&&g.trim()!==""&&F,e[13]=i,e[14]=y,e[15]=g,e[16]=F,e[17]=E):E=e[17];let $e=E,ae;e[18]!==p.userFields||e[19]!==P?(ae=s(()=>{let S={};for(let R of p.userFields){let ee=mt(R,P(R));ee!==void 0&&(S[R.name]=ee.value)}return Object.keys(S).length===0?void 0:S},"te"),e[18]=p.userFields,e[19]=P,e[20]=ae):ae=e[20];let je=ae,Re;e[21]!==je||e[22]!==o||e[23]!==y||e[24]!==g||e[25]!==n||e[26]!==l||e[27]!==k||e[28]!==d||e[29]!==c?(Re=s(()=>{c(async()=>{await o.createAuthUser({data:je(),email:y.trim(),name:g.trim(),password:k===""?void 0:k,role:d.trim()===""?void 0:d.trim()}),l(),n()})},"De"),e[21]=je,e[22]=o,e[23]=y,e[24]=g,e[25]=n,e[26]=l,e[27]=k,e[28]=d,e[29]=c,e[30]=Re):Re=e[30];let Be=Re,le;e[31]!==a?(le=a("Create user"),e[31]=a,e[32]=le):le=e[32];let ne;e[33]!==a?(ne=a("Create user"),e[33]=a,e[34]=ne):ne=e[34];let ie;e[35]!==ne?(ie=(0,t.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:ne}),e[35]=ne,e[36]=ie):ie=e[36];let se;e[37]!==a?(se=a("email"),e[37]=a,e[38]=se):se=e[38];let re;e[39]!==se?(re=(0,t.jsx)(L,{htmlFor:"uc-email",children:se}),e[39]=se,e[40]=re):re=e[40];let de;e[41]!==y?(de=(0,t.jsx)(T,{"data-testid":"uc-email",id:"uc-email",onChange:r,type:"email",value:y}),e[41]=y,e[42]=de):de=e[42];let oe;e[43]!==re||e[44]!==de?(oe=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[re,de]}),e[43]=re,e[44]=de,e[45]=oe):oe=e[45];let ce;e[46]!==a?(ce=a("name"),e[46]=a,e[47]=ce):ce=e[47];let ue;e[48]!==ce?(ue=(0,t.jsx)(L,{htmlFor:"uc-name",children:ce}),e[48]=ce,e[49]=ue):ue=e[49];let me;e[50]!==g?(me=(0,t.jsx)(T,{"data-testid":"uc-name",id:"uc-name",onChange:$,value:g}),e[50]=g,e[51]=me):me=e[51];let he;e[52]!==ue||e[53]!==me?(he=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[ue,me]}),e[52]=ue,e[53]=me,e[54]=he):he=e[54];let pe;e[55]!==a?(pe=a("Password (optional)"),e[55]=a,e[56]=pe):pe=e[56];let fe;e[57]!==pe?(fe=(0,t.jsx)(L,{htmlFor:"uc-password",children:pe}),e[57]=pe,e[58]=fe):fe=e[58];let ve;e[59]!==k?(ve=(0,t.jsx)(T,{"data-testid":"uc-password",id:"uc-password",onChange:H,type:"password",value:k}),e[59]=k,e[60]=ve):ve=e[60];let ge;e[61]!==fe||e[62]!==ve?(ge=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[fe,ve]}),e[61]=fe,e[62]=ve,e[63]=ge):ge=e[63];let be;e[64]!==a?(be=a("Role (optional)"),e[64]=a,e[65]=be):be=e[65];let xe;e[66]!==be?(xe=(0,t.jsx)(L,{htmlFor:"uc-role",children:be}),e[66]=be,e[67]=xe):xe=e[67];let ye;e[68]!==d?(ye=(0,t.jsx)(T,{"data-testid":"uc-role",id:"uc-role",onChange:Y,value:d}),e[68]=d,e[69]=ye):ye=e[69];let Ne;e[70]!==xe||e[71]!==ye?(Ne=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[xe,ye]}),e[70]=xe,e[71]=ye,e[72]=Ne):Ne=e[72];let ke;e[73]!==p.userFields||e[74]!==P||e[75]!==a?(ke=p.userFields.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border pt-3","data-testid":"uc-plugin-fields",children:[(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Plugin fields")}),p.userFields.map(S=>{let R=`uc-field-${S.name}`,ee=S.required?"":` (${a("optional")})`;if(S.type==="boolean"){let Le=P(S)===!0;return(0,t.jsxs)("label",{className:"flex items-center gap-2",htmlFor:R,children:[(0,t.jsx)(Ze,{checked:Le,"data-testid":R,id:R,onCheckedChange:s(tt=>{V(S.name,tt)},"onCheckedChange")}),(0,t.jsxs)("span",{className:"text-sm",children:[S.name,ee]})]},S.name)}let Ge=P(S);return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)(L,{htmlFor:R,children:[S.name,ee]}),(0,t.jsx)(T,{"data-testid":R,id:R,onChange:s(Le=>{V(S.name,Le.target.value)},"onChange"),type:ct[S.type],value:typeof Ge=="string"?Ge:""})]},S.name)})]}),e[73]=p.userFields,e[74]=P,e[75]=a,e[76]=ke):ke=e[76];let we;e[77]!==u?(we=u!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"uc-error",role:"alert",children:u}),e[77]=u,e[78]=we):we=e[78];let Ce;e[79]!==a?(Ce=a("Cancel"),e[79]=a,e[80]=Ce):Ce=e[80];let Ie;e[81]!==n||e[82]!==Ce?(Ie=(0,t.jsx)(_,{"data-testid":"uc-cancel",onClick:n,size:"sm",type:"button",variant:"outline",children:Ce}),e[81]=n,e[82]=Ce,e[83]=Ie):Ie=e[83];let Oe=!$e,Se;e[84]!==i||e[85]!==a?(Se=a(i?"Creating\u2026":"Create"),e[84]=i,e[85]=a,e[86]=Se):Se=e[86];let Ae;e[87]!==Be||e[88]!==Oe||e[89]!==Se?(Ae=(0,t.jsx)(_,{"data-testid":"uc-submit",disabled:Oe,onClick:Be,size:"sm",type:"button",children:Se}),e[87]=Be,e[88]=Oe,e[89]=Se,e[90]=Ae):Ae=e[90];let Fe;e[91]!==Ie||e[92]!==Ae?(Fe=(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[Ie,Ae]}),e[91]=Ie,e[92]=Ae,e[93]=Fe):Fe=e[93];let Te;return e[94]!==n||e[95]!==le||e[96]!==ie||e[97]!==oe||e[98]!==he||e[99]!==ge||e[100]!==Ne||e[101]!==ke||e[102]!==we||e[103]!==Fe?(Te=(0,t.jsxs)(He,{label:le,onClose:n,panelTestId:"uc-dialog",testId:"uc-overlay",variant:"dialog",children:[ie,oe,he,ge,Ne,ke,we,Fe]}),e[94]=n,e[95]=le,e[96]=ie,e[97]=oe,e[98]=he,e[99]=ge,e[100]=Ne,e[101]=ke,e[102]=we,e[103]=Fe,e[104]=Te):Te=e[104],Te},"ut"),Ye=s(h=>{let e=(0,W.c)(2),{children:n}=h,l;return e[0]!==n?(l=(0,t.jsx)("h3",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:n}),e[0]=n,e[1]=l):l=e[1],l},"_e"),pt=s(h=>{let e=(0,W.c)(29),{busy:n,runAction:l,userId:o,version:a}=h,p=Z(),i=Q(),[u,c]=(0,C.useState)(null),[y,w]=(0,C.useState)(null),g;e[0]!==p||e[1]!==o?(g=s(()=>{X((async()=>{w(null);try{let r=await p.listAuthSessions({limit:50,userId:o});c(r.rows)}catch(r){let A=r;c(null),w(Ee(A))}})())},"g"),e[0]=p,e[1]=o,e[2]=g):g=e[2];let I;e[3]!==p||e[4]!==o||e[5]!==a?(I=[p,o,a],e[3]=p,e[4]=o,e[5]=a,e[6]=I):I=e[6],(0,C.useEffect)(g,I);let k;e[7]!==p||e[8]!==l?(k=s(r=>{l(()=>p.revokeAuthSession({sessionId:r}))},"k"),e[7]=p,e[8]=l,e[9]=k):k=e[9];let v=k,d;e[10]!==i?(d=i("Sessions"),e[10]=i,e[11]=d):d=e[11];let m;e[12]!==d?(m=(0,t.jsx)(Ye,{children:d}),e[12]=d,e[13]=m):m=e[13];let b;e[14]!==y?(b=y!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"ud-sessions-error",role:"alert",children:y}),e[14]=y,e[15]=b):b=e[15];let x;e[16]!==u||e[17]!==i?(x=u!==null&&u.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"ud-sessions-empty",children:i("No active sessions.")}),e[16]=u,e[17]=i,e[18]=x):x=e[18];let N;e[19]!==n||e[20]!==v||e[21]!==u||e[22]!==i?(N=u!==null&&u.length>0&&(0,t.jsx)(J,{className:"overflow-hidden py-0",children:(0,t.jsx)(K,{className:"px-0",children:(0,t.jsxs)(ze,{"data-testid":"ud-sessions-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(q,{children:[(0,t.jsx)(U,{children:i("expires")}),(0,t.jsx)(U,{children:i("ip")}),(0,t.jsx)(U,{children:i("user agent")}),(0,t.jsx)(U,{"aria-label":i("Actions")})]})}),(0,t.jsx)(Pe,{children:u.map(r=>(0,t.jsxs)(q,{"data-testid":`ud-session-${r.id}`,children:[(0,t.jsx)(z,{className:"text-muted-foreground tabular-nums",children:te(r.expiresAt)}),(0,t.jsx)(z,{children:r.ipAddress??""}),(0,t.jsx)(z,{className:"max-w-40 truncate",children:r.userAgent??""}),(0,t.jsx)(z,{children:(0,t.jsx)(_,{"data-testid":`ud-revoke-${r.id}`,disabled:n,onClick:s(()=>{v(r.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Revoke")})})]},r.id))})]})})}),e[19]=n,e[20]=v,e[21]=u,e[22]=i,e[23]=N):N=e[23];let f;return e[24]!==m||e[25]!==b||e[26]!==x||e[27]!==N?(f=(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ud-sessions",children:[m,b,x,N]}),e[24]=m,e[25]=b,e[26]=x,e[27]=N,e[28]=f):f=e[28],f},"mt"),ft=s(h=>{let e=(0,W.c)(30),{busy:n,runAction:l,userId:o,version:a}=h,p=Z(),i=Q(),[u,c]=(0,C.useState)(null),[y,w]=(0,C.useState)(null),g;e[0]!==p||e[1]!==o?(g=s(()=>{X((async()=>{w(null);try{c(await p.listAuthAccounts({userId:o}))}catch(r){let A=r;c(null),w(Ee(A))}})())},"g"),e[0]=p,e[1]=o,e[2]=g):g=e[2];let I;e[3]!==p||e[4]!==o||e[5]!==a?(I=[p,o,a],e[3]=p,e[4]=o,e[5]=a,e[6]=I):I=e[6],(0,C.useEffect)(g,I);let k;e[7]!==p||e[8]!==l||e[9]!==o?(k=s(r=>{l(()=>p.unlinkAuthAccount({accountId:r,userId:o}))},"k"),e[7]=p,e[8]=l,e[9]=o,e[10]=k):k=e[10];let v=k,d;e[11]!==i?(d=i("Linked accounts"),e[11]=i,e[12]=d):d=e[12];let m;e[13]!==d?(m=(0,t.jsx)(Ye,{children:d}),e[13]=d,e[14]=m):m=e[14];let b;e[15]!==y?(b=y!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:y}),e[15]=y,e[16]=b):b=e[16];let x;e[17]!==u||e[18]!==i?(x=u!==null&&u.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i("No linked accounts.")}),e[17]=u,e[18]=i,e[19]=x):x=e[19];let N;e[20]!==u||e[21]!==n||e[22]!==v||e[23]!==i?(N=u!==null&&u.length>0&&(0,t.jsx)(J,{className:"overflow-hidden py-0",children:(0,t.jsx)(K,{className:"px-0",children:(0,t.jsxs)(ze,{"data-testid":"ud-accounts-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(q,{children:[(0,t.jsx)(U,{children:i("provider")}),(0,t.jsx)(U,{children:i("created")}),(0,t.jsx)(U,{"aria-label":i("Actions")})]})}),(0,t.jsx)(Pe,{children:u.map(r=>{let A=Ue(r.id);return(0,t.jsxs)(q,{"data-testid":`ud-account-${A}`,children:[(0,t.jsx)(z,{children:Ue(r.providerId)}),(0,t.jsx)(z,{className:"text-muted-foreground tabular-nums",children:te(r.createdAt)}),(0,t.jsx)(z,{children:(0,t.jsx)(_,{"data-testid":`ud-unlink-${A}`,disabled:n,onClick:s(()=>{v(A)},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Unlink")})})]},A)})})]})})}),e[20]=u,e[21]=n,e[22]=v,e[23]=i,e[24]=N):N=e[24];let f;return e[25]!==m||e[26]!==b||e[27]!==x||e[28]!==N?(f=(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ud-accounts",children:[m,b,x,N]}),e[25]=m,e[26]=b,e[27]=x,e[28]=N,e[29]=f):f=e[29],f},"ht"),vt=s(h=>{let e=(0,W.c)(40),{busy:n,capabilities:l,runAction:o,userId:a,version:p}=h,i=Z(),u=Q(),[c,y]=(0,C.useState)(null),w;e[0]!==l.passkey||e[1]!==i||e[2]!==a?(w=s(()=>{l.passkey&&X((async()=>{try{y(await i.listAuthPasskeys({userId:a}))}catch{y(null)}})())},"C"),e[0]=l.passkey,e[1]=i,e[2]=a,e[3]=w):w=e[3];let g;e[4]!==l.passkey||e[5]!==i||e[6]!==a||e[7]!==p?(g=[l.passkey,i,a,p],e[4]=l.passkey,e[5]=i,e[6]=a,e[7]=p,e[8]=g):g=e[8],(0,C.useEffect)(w,g);let I;e[9]!==i||e[10]!==o||e[11]!==a?(I=s(()=>{o(()=>i.disableAuthTwoFactor({userId:a}))},"w"),e[9]=i,e[10]=o,e[11]=a,e[12]=I):I=e[12];let k=I,v;e[13]!==i||e[14]!==o?(v=s(A=>{o(()=>i.deleteAuthPasskey({passkeyId:A}))},"v"),e[13]=i,e[14]=o,e[15]=v):v=e[15];let d=v,m;e[16]!==u?(m=u("Security"),e[16]=u,e[17]=m):m=e[17];let b;e[18]!==m?(b=(0,t.jsx)(Ye,{children:m}),e[18]=m,e[19]=b):b=e[19];let x;e[20]!==n||e[21]!==l.twoFactor||e[22]!==k||e[23]!==u?(x=l.twoFactor&&(0,t.jsx)(_,{"data-testid":"ud-disable-2fa",disabled:n,onClick:k,size:"sm",type:"button",variant:"outline",children:u("Disable two-factor")}),e[20]=n,e[21]=l.twoFactor,e[22]=k,e[23]=u,e[24]=x):x=e[24];let N;e[25]!==l.passkey||e[26]!==c||e[27]!==u?(N=l.passkey&&c!==null&&c.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:u("No passkeys.")}),e[25]=l.passkey,e[26]=c,e[27]=u,e[28]=N):N=e[28];let f;e[29]!==n||e[30]!==l.passkey||e[31]!==d||e[32]!==c||e[33]!==u?(f=l.passkey&&c!==null&&c.length>0&&(0,t.jsx)(J,{className:"overflow-hidden py-0",children:(0,t.jsx)(K,{className:"px-0",children:(0,t.jsxs)(ze,{"data-testid":"ud-passkeys-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(q,{children:[(0,t.jsx)(U,{children:u("name")}),(0,t.jsx)(U,{children:u("created")}),(0,t.jsx)(U,{"aria-label":u("Actions")})]})}),(0,t.jsx)(Pe,{children:c.map(A=>{let $=Ue(A.id);return(0,t.jsxs)(q,{"data-testid":`ud-passkey-${$}`,children:[(0,t.jsx)(z,{children:Ue(A.name)||$}),(0,t.jsx)(z,{className:"text-muted-foreground tabular-nums",children:te(A.createdAt)}),(0,t.jsx)(z,{children:(0,t.jsx)(_,{"data-testid":`ud-delete-passkey-${$}`,disabled:n,onClick:s(()=>{d($)},"onClick"),size:"xs",type:"button",variant:"ghost",children:u("Delete")})})]},$)})})]})})}),e[29]=n,e[30]=l.passkey,e[31]=d,e[32]=c,e[33]=u,e[34]=f):f=e[34];let r;return e[35]!==b||e[36]!==x||e[37]!==N||e[38]!==f?(r=(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ud-security",children:[b,x,N,f]}),e[35]=b,e[36]=x,e[37]=N,e[38]=f,e[39]=r):r=e[39],r},"ft"),gt=/(?:at|expires)$/iu,bt=/^[1-9]\d*$/u,xt=new Set(["banExpires","banned","banReason","email","emailVerified","id","name","role"]),yt=s(h=>{let e=(0,W.c)(51),{busy:n,onBan:l}=h,o=Q(),[a,p]=(0,C.useState)(""),[i,u]=(0,C.useState)(""),[c,y]=(0,C.useState)(!1),w;e[0]!==i?(w=bt.test(i.trim())&&Number.isSafeInteger(Number(i.trim())*86400)?Number(i.trim()):void 0,e[0]=i,e[1]=w):w=e[1];let g=w,I=c||g!==void 0,k;e[2]!==l||e[3]!==c||e[4]!==a||e[5]!==g?(k=s(()=>{l({expiresInSeconds:c||g===void 0?void 0:g*86400,reason:a.trim()===""?void 0:a.trim()})},"k"),e[2]=l,e[3]=c,e[4]=a,e[5]=g,e[6]=k):k=e[6];let v=k,d;e[7]!==o?(d=o("Ban reason (optional)"),e[7]=o,e[8]=d):d=e[8];let m;e[9]!==d?(m=(0,t.jsx)(L,{htmlFor:"ud-ban-reason",children:d}),e[9]=d,e[10]=m):m=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=s(E=>{p(E.target.value)},"b"),e[11]=b):b=e[11];let x;e[12]!==a?(x=(0,t.jsx)(T,{"data-testid":"ud-ban-reason",id:"ud-ban-reason",onChange:b,value:a}),e[12]=a,e[13]=x):x=e[13];let N;e[14]!==m||e[15]!==x?(N=(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[m,x]}),e[14]=m,e[15]=x,e[16]=N):N=e[16];let f;e[17]!==o?(f=o("Days"),e[17]=o,e[18]=f):f=e[18];let r;e[19]!==f?(r=(0,t.jsx)(L,{htmlFor:"ud-ban-days",children:f}),e[19]=f,e[20]=r):r=e[20];let A;e[21]!==i||e[22]!==g?(A=i.trim()!==""&&g===void 0,e[21]=i,e[22]=g,e[23]=A):A=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=s(E=>{u(E.target.value)},"T"),e[24]=$):$=e[24];let j;e[25]!==i||e[26]!==c||e[27]!==A?(j=(0,t.jsx)(T,{"aria-invalid":A,"data-testid":"ud-ban-days",disabled:c,id:"ud-ban-days",min:1,onChange:$,step:1,type:"number",value:i}),e[25]=i,e[26]=c,e[27]=A,e[28]=j):j=e[28];let H;e[29]!==j||e[30]!==r?(H=(0,t.jsxs)("div",{className:"flex w-24 flex-col gap-1",children:[r,j]}),e[29]=j,e[30]=r,e[31]=H):H=e[31];let M;e[32]===Symbol.for("react.memo_cache_sentinel")?(M=s(E=>{y(E.target.checked)},"M"),e[32]=M):M=e[32];let Y;e[33]!==c?(Y=(0,t.jsx)("input",{checked:c,className:"size-4 accent-destructive","data-testid":"ud-ban-permanent",id:"ud-ban-permanent",onChange:M,type:"checkbox"}),e[33]=c,e[34]=Y):Y=e[34];let B;e[35]!==o?(B=o("Permanent"),e[35]=o,e[36]=B):B=e[36];let V;e[37]!==Y||e[38]!==B?(V=(0,t.jsxs)(L,{className:"flex items-center gap-1.5 pb-2 text-xs font-normal",htmlFor:"ud-ban-permanent",children:[Y,B]}),e[37]=Y,e[38]=B,e[39]=V):V=e[39];let G=n||!I,P;e[40]!==o?(P=o("Ban user"),e[40]=o,e[41]=P):P=e[41];let O;e[42]!==v||e[43]!==G||e[44]!==P?(O=(0,t.jsx)(_,{"data-testid":"ud-ban",disabled:G,onClick:v,size:"sm",type:"button",variant:"destructive",children:P}),e[42]=v,e[43]=G,e[44]=P,e[45]=O):O=e[45];let F;return e[46]!==H||e[47]!==V||e[48]!==O||e[49]!==N?(F=(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[N,H,V,O]}),e[46]=H,e[47]=V,e[48]=O,e[49]=N,e[50]=F):F=e[50],F},"bt"),Nt=s((h,e)=>typeof e=="number"&>.test(h)?te(e):Ue(e),"xt"),kt=s(({capabilities:h,onChanged:e,onClose:n,user:l})=>{let o=Z(),a=Q(),p=l.banned===!0,[i,u]=(0,C.useState)(null),[c,y]=(0,C.useState)(!1),[w,g]=(0,C.useState)(0),[I,k]=(0,C.useState)(typeof l.role=="string"?l.role:""),[v,d]=(0,C.useState)(""),[m,b]=(0,C.useState)(null),[x,N]=(0,C.useState)(!1),f=s((F,E)=>{X((async()=>{y(!0),u(null);try{let $e=await F();E?.refresh!==!1&&(g(ae=>ae+1),e()),E?.onResult?.($e)}catch($e){u(Ee($e))}y(!1)})())},"p"),r=s(F=>{k(F.target.value)},"i"),A=s(F=>{d(F.target.value)},"S"),$=s(()=>{let F=I.trim();F!==""&&f(async()=>{await o.setAuthUserRole({role:F,userId:l.id})})},"T"),j=s(F=>{f(async()=>{await o.banAuthUser({...F,userId:l.id})})},"z"),H=s(()=>{f(async()=>{await o.unbanAuthUser({userId:l.id})})},"j"),M=s(()=>{f(async()=>{await o.setAuthUserPassword({newPassword:v,userId:l.id}),d("")})},"M"),Y=s(()=>{f(()=>o.impersonateAuthUser({userId:l.id}),{onResult:s(F=>{b(F.token)},"onResult"),refresh:!1})},"H"),B=s(()=>{f(async()=>{await o.revokeAuthUserSessions({userId:l.id})})},"L"),V=s(()=>{f(async()=>{await o.removeAuthUser({userId:l.id}),n()})},"V"),G=s(()=>{N(!0)},"Y"),P=s(()=>{N(!1)},"E"),O=Object.entries(l).filter(([F])=>!xt.has(F));return(0,t.jsxs)(He,{label:a("User details"),onClose:n,panelTestId:"ud-panel",testId:"ud-overlay",variant:"drawer",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:l.name??l.email??l.id}),(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:l.id}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 pt-1",children:[typeof l.role=="string"&&l.role!==""&&(0,t.jsx)(D,{variant:"secondary",children:l.role}),p?(0,t.jsx)(D,{variant:"destructive",children:a("Banned")}):(0,t.jsx)(D,{variant:"outline",children:a("Active")}),l.emailVerified===!0?(0,t.jsx)(D,{variant:"secondary",children:a("verified")}):(0,t.jsx)(D,{variant:"outline",children:a("unverified")})]})]}),(0,t.jsx)(_,{"data-testid":"ud-close",onClick:n,size:"sm",type:"button",variant:"ghost",children:a("Close")})]}),i!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"ud-action-error",role:"alert",children:i}),h.admin&&(0,t.jsxs)(J,{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:a("Actions")})}),(0,t.jsxs)(K,{className:"flex flex-col gap-3 p-3",children:[(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[(0,t.jsx)(L,{htmlFor:"ud-role",children:a("Role")}),(0,t.jsx)(T,{"data-testid":"ud-role-input",id:"ud-role",onChange:r,value:I})]}),(0,t.jsx)(_,{"data-testid":"ud-set-role",disabled:c||I.trim()==="",onClick:$,size:"sm",type:"button",variant:"outline",children:a("Set role")})]}),p?(0,t.jsx)(_,{"data-testid":"ud-unban",disabled:c,onClick:H,size:"sm",type:"button",variant:"outline",children:a("Unban")}):(0,t.jsx)(yt,{busy:c,onBan:j}),(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[(0,t.jsx)(L,{htmlFor:"ud-password",children:a("New password")}),(0,t.jsx)(T,{"data-testid":"ud-password",id:"ud-password",onChange:A,type:"password",value:v})]}),(0,t.jsx)(_,{"data-testid":"ud-set-password",disabled:c||v==="",onClick:M,size:"sm",type:"button",variant:"outline",children:a("Set password")})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(_,{"data-testid":"ud-impersonate",disabled:c,onClick:Y,size:"sm",type:"button",variant:"outline",children:a("Impersonate")}),(0,t.jsx)(_,{"data-testid":"ud-revoke-all",disabled:c,onClick:B,size:"sm",type:"button",variant:"outline",children:a("Revoke all sessions")}),x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_,{"data-testid":"ud-delete-confirm",disabled:c,onClick:V,size:"sm",type:"button",variant:"destructive",children:a("Confirm delete")}),(0,t.jsx)(_,{"data-testid":"ud-delete-cancel",onClick:P,size:"sm",type:"button",variant:"ghost",children:a("Cancel")})]}):(0,t.jsx)(_,{"data-testid":"ud-delete",disabled:c,onClick:G,size:"sm",type:"button",variant:"destructive",children:a("Delete user")})]}),m!==null&&(0,t.jsxs)("div",{className:"flex flex-col gap-1","data-testid":"ud-impersonation",children:[(0,t.jsx)(L,{htmlFor:"ud-token",children:a("Impersonation token")}),(0,t.jsx)(T,{"data-testid":"ud-token",id:"ud-token",readOnly:!0,value:m})]})]})]}),(0,t.jsx)(pt,{busy:c,runAction:f,userId:l.id,version:w}),h.accounts&&(0,t.jsx)(ft,{busy:c,runAction:f,userId:l.id,version:w}),(h.twoFactor||h.passkey)&&(0,t.jsx)(vt,{busy:c,capabilities:h,runAction:f,userId:l.id,version:w}),(0,t.jsxs)("div",{className:"flex flex-col gap-1","data-testid":"ud-fields",children:[(0,t.jsx)("h3",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Fields")}),(0,t.jsx)("dl",{className:"flex flex-col",children:O.map(([F,E])=>(0,t.jsxs)("div",{className:"flex flex-col border-t border-border py-1.5",children:[(0,t.jsx)("dt",{className:"text-xs font-semibold text-muted-foreground",children:F}),(0,t.jsx)("dd",{className:"m-0 font-mono text-xs break-words",children:Nt(F,E)})]},F))})]})]})},"yt"),wt=50,Vt=s(({pageSize:h=wt}={})=>{let e=Z(),n=Q(),[l,o]=(0,C.useState)(""),[a,p]=(0,C.useState)(""),[i,u]=(0,C.useState)(0),c=Xe(l),[y,w]=(0,C.useState)(null),[g,I]=(0,C.useState)(!1),{capabilities:k}=it(),v=c.trim(),d=a.trim(),m=De(["lunora-auth-users",v,d,h,i],()=>e.listAuthUsers({filterField:d===""?void 0:"role",filterValue:d===""?void 0:d,limit:h,offset:i,search:v===""?void 0:v}).then(r=>({...r,offset:i})),{keepPreviousData:!0}),b=m.data?.rows??null,x=m.error,N=s(()=>{m.refetch()},"N");We(()=>m.poll(),!0);let f=y===null?null:b?.find(r=>r.id===y)??null;return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-users",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(T,{"aria-label":n("Search users"),className:"w-56","data-testid":"us-search",onChange:s(r=>{o(r.target.value),u(0)},"onChange"),placeholder:n("Search by email or name\u2026"),value:l}),(0,t.jsx)(T,{"aria-label":n("Filter by role"),className:"w-40","data-testid":"us-role-filter",onChange:s(r=>{p(r.target.value),u(0)},"onChange"),placeholder:n("Filter by role"),value:a}),(0,t.jsx)(_,{"data-testid":"us-new",onClick:s(()=>{I(!0)},"onClick"),size:"sm",type:"button",children:n("New user")})]}),x!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"us-users-error",role:"alert",children:x}),b!==null&&b.length===0&&(0,t.jsx)(Ve,{description:n("Users who sign up to your app will appear here."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M16 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M9.5 10a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm11.5 10v-2a4 4 0 0 0-3-3.85"})}),testId:"us-empty",title:n("No users.")}),b!==null&&b.length>0&&(0,t.jsx)(J,{className:"overflow-hidden py-0",children:(0,t.jsx)(K,{className:"px-0",children:(0,t.jsxs)(ze,{"data-testid":"us-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(q,{children:[(0,t.jsx)(U,{children:n("id")}),(0,t.jsx)(U,{children:n("email")}),(0,t.jsx)(U,{children:n("name")}),(0,t.jsx)(U,{children:n("role")}),(0,t.jsx)(U,{children:n("status")}),(0,t.jsx)(U,{children:n("verified")}),(0,t.jsx)(U,{children:n("created")}),(0,t.jsx)(U,{"aria-label":n("Actions")})]})}),(0,t.jsx)(Pe,{children:b.map(r=>(0,t.jsxs)(q,{"data-testid":`us-row-${r.id}`,children:[(0,t.jsx)(z,{className:"font-mono text-xs",children:r.id}),(0,t.jsx)(z,{children:r.email??""}),(0,t.jsx)(z,{children:r.name??""}),(0,t.jsx)(z,{children:typeof r.role=="string"&&r.role!==""?(0,t.jsx)(D,{variant:"secondary",children:r.role}):""}),(0,t.jsx)(z,{children:r.banned===!0?(0,t.jsx)(D,{variant:"destructive",children:n("Banned")}):(0,t.jsx)(D,{variant:"success",children:n("Active")})}),(0,t.jsx)(z,{children:r.emailVerified===!0?(0,t.jsx)(D,{variant:"success",children:n("yes")}):(0,t.jsx)(D,{variant:"outline",children:n("no")})}),(0,t.jsx)(z,{className:"text-muted-foreground tabular-nums",children:te(r.createdAt)}),(0,t.jsx)(z,{children:(0,t.jsx)(_,{"data-testid":`us-manage-${r.id}`,onClick:s(()=>{w(r.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:n("Manage")})})]},r.id))})]})})}),b!==null&&(0,t.jsx)(Je,{count:b.length,offset:m.data?.offset??0,onOffsetChange:u,pageSize:h,prefix:"us",total:m.data?.total}),f!==null&&(0,t.jsx)(kt,{capabilities:k,onChanged:N,onClose:s(()=>{w(null)},"onClose"),user:f}),g&&(0,t.jsx)(ht,{onClose:s(()=>{I(!1)},"onClose"),onCreated:N}),k.inviteOnly&&(0,t.jsx)(ot,{})]})},"jt");export{Vt as UsersPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e}from"./chunk-ZGSL4DPP.js";import{a,d as r,f as c,g as p}from"./chunk-OXFKZ4BM.js";var i=r(c(),1);var m=r(p(),1);var u={bounce:.1,duration:.45,type:"spring"},d=a(n=>{let t=(0,i.c)(2),{className:s}=n,o;return t[0]!==s?(o=(0,m.jsx)(e.span,{className:s,layoutId:"studio-theme-active",transition:u}),t[0]=s,t[1]=o):o=t[1],o},"u");export{d as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-H7HZ42JY.js";import{h as v}from"./chunk-BFE2DRP6.js";import{a as c,d as l,f as x,g}from"./chunk-OXFKZ4BM.js";var u=l(x(),1);var s=l(g(),1);var p=b("flex items-start gap-2 rounded-md border px-3 py-2 text-sm [&>svg]:mt-0.5 [&>svg]:size-4 [&>svg]:shrink-0",{defaultVariants:{variant:"default"},variants:{variant:{default:"border-border bg-muted/40 text-foreground",destructive:"border-destructive/40 bg-destructive/5 text-destructive",warning:"border-amber-500/40 bg-amber-500/5 text-amber-700 dark:text-amber-400"}}}),j=c(f=>{let t=(0,u.c)(10),{children:d,className:i,icon:m,testId:o,variant:n}=f,e;t[0]!==i||t[1]!==n?(e=v(p({variant:n}),i),t[0]=i,t[1]=n,t[2]=e):e=t[2];let r;t[3]!==d?(r=(0,s.jsx)("div",{className:"min-w-0 flex-1",children:d}),t[3]=d,t[4]=r):r=t[4];let a;return t[5]!==m||t[6]!==e||t[7]!==r||t[8]!==o?(a=(0,s.jsxs)("div",{className:e,"data-testid":o,role:"alert",children:[m,r]}),t[5]=m,t[6]=e,t[7]=r,t[8]=o,t[9]=a):a=t[9],a},"N");export{j as a};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as fe}from"./chunk-OS26JXYA.js";import"./chunk-A566HCBX.js";import{a as ie}from"./chunk-3GXPALXG.js";import{a as pe}from"./chunk-473JK2PQ.js";import"./chunk-W2BCSK5S.js";import{i as ne}from"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as b}from"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as oe}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{a as ue}from"./chunk-CZ6HBDIL.js";import"./chunk-T5UMHPAB.js";import"./chunk-NVKLYDOH.js";import"./chunk-E26OT26O.js";import{a as H}from"./chunk-6UTZXEW3.js";import{c as he}from"./chunk-4DAKKAK7.js";import{m as me}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as de}from"./chunk-XMSNLMWU.js";import{B as ce,C as re,h as le,l as se,n as Z,o as ee,p as te,y as ae}from"./chunk-BFE2DRP6.js";import{a as l,d as Y,e as ge,f as ve,g as Ne}from"./chunk-OXFKZ4BM.js";var t=Y(Ne(),1);var be=Y(ve(),1),v=Y(ge(),1);function ye({className:a,orientation:e="horizontal",...s}){return(0,t.jsx)(ie,{"data-slot":"separator",orientation:e,className:le("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",a),...s})}l(ye,"ge");var we=/https?:\/\/[^\s"'<>)]+/i,xe=l(a=>a===void 0?void 0:we.exec(a)?.[0],"re"),N=l(a=>a===void 0?"":Array.isArray(a)?a.join(", "):a,"v"),Ce=/<a\s(?:[^>]*?\s)?href\s*=\s*["'](https?:\/\/[^"'\s]+)["']/iu,ke=/&(?:amp|#0*38|#x0*26);/giu,Se=l(a=>a===void 0?void 0:((a.html===void 0?void 0:Ce.exec(a.html)?.[1])??xe(a.text)??xe(a.html))?.replaceAll(ke,"&"),"ye"),Te=l((a,e)=>{let s=e.trim().toLowerCase();return s===""?a:a.filter(o=>`${o.subject} ${N(o.to)} ${N(o.cc)}`.toLowerCase().includes(s))},"Ce"),je=l((a,e)=>{if(a.length!==0)return a.find(s=>s.id===e)??a[0]},"Se"),Le=Z(H.clearCapturedMail),_e=Z(H.sendTestMail),Me=l(a=>{let e=(0,be.c)(36),{limit:s}=a,o=me(),p;e[0]!==s?(p={limit:s},e[0]=s,e[1]=p):p=e[1];let{data:I,error:y,errorSource:w,isLoading:g,poll:P,refetch:c}=he(H.getCapturedMail,p),[C,f]=(0,v.useState)(null),[q,k]=(0,v.useState)(null),[i,h]=(0,v.useState)("html"),[x,B]=(0,v.useState)(""),r=I?.entries??[],m=y??C,D=y===null?C:w,S;e[2]!==o||e[3]!==c?(S=l(async()=>{f(null);try{await o.query(Le,{},ee("")),k(null),c()}catch(d){f(te(d))}},"S"),e[2]=o,e[3]=c,e[4]=S):S=e[4];let R=S,T;e[5]!==o||e[6]!==c?(T=l(async()=>{f(null);try{await o.query(_e,{},ee("")),c()}catch(d){f(te(d))}},"T"),e[5]=o,e[6]=c,e[7]=T):T=e[7];let Q=T;pe(P,!0);let j;e[8]!==R?(j=l(()=>{ae(R())},"k"),e[8]=R,e[9]=j):j=e[9];let U=j,L;e[10]!==Q?(L=l(()=>{ae(Q())},"A"),e[10]=Q,e[11]=L):L=e[11];let W=L,_;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=l(d=>{B(d.currentTarget.value)},"E"),e[12]=_):_=e[12];let G=_,M;e[13]===Symbol.for("react.memo_cache_sentinel")?(M=l(d=>{let{id:u}=d.currentTarget.dataset;u!==void 0&&k(u)},"_"),e[13]=M):M=e[13];let J=M,z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=l(d=>{let u=d.currentTarget.dataset.tab;(u==="headers"||u==="html"||u==="text")&&h(u)},"L"),e[14]=z):z=e[14];let K=z,$=Te(r,x),A=je($,q),n=Se(A),O;e[15]!==n?(O=l(()=>{n!==void 0&&ce(n)},"j"),e[15]=n,e[16]=O):O=e[16];let V=O,F;e[17]!==n?(F=l(()=>{n!==void 0&&"window"in globalThis&&globalThis.window.open(n,"_blank","noopener")},"$"),e[17]=n,e[18]=F):F=e[18];let X=F,E;return e[19]!==r||e[20]!==m||e[21]!==D||e[22]!==x||e[23]!==g||e[24]!==n||e[25]!==U||e[26]!==V||e[27]!==G||e[28]!==X||e[29]!==J||e[30]!==K||e[31]!==W||e[32]!==A||e[33]!==i||e[34]!==$?(E={entries:r,error:m,errorSource:D,filter:x,isLoading:g,link:n,onClear:U,onCopyLink:V,onFilterChange:G,onOpenLink:X,onSelectMessage:J,onSelectTab:K,onSendTest:W,selected:A,tab:i,visible:$},e[19]=r,e[20]=m,e[21]=D,e[22]=x,e[23]=g,e[24]=n,e[25]=U,e[26]=V,e[27]=G,e[28]=X,e[29]=J,e[30]=K,e[31]=W,e[32]=A,e[33]=i,e[34]=$,e[35]=E):E=e[35],E},"Ae"),ze=`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:">`,$e=l(a=>`${ze}${a}`,"_e"),Ke=l(({limit:a=100})=>{let e=se(),{entries:s,error:o,errorSource:p,filter:I,isLoading:y,link:w,onClear:g,onCopyLink:P,onFilterChange:c,onOpenLink:C,onSelectMessage:f,onSelectTab:q,onSendTest:k,selected:i,tab:h,visible:x}=Me({limit:a}),B=l(r=>e(r==="html"?"HTML":r==="text"?"Plain text":"Headers"),"H");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)(b,{"data-testid":"mail-send-test",onClick:k,size:"sm",type:"button",variant:"outline",children:e("Send test")}),(0,t.jsx)(b,{"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)(oe,{className:"ml-auto","data-testid":"mail-count",variant:"secondary",children:e("{count} messages",{count:s.length})})]}),o!==null&&(0,t.jsx)(ue,{error:p,testId:"mail-error"}),o===null&&!y&&s.length===0&&(0,t.jsx)(de,{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)(ne,{"aria-label":e("Search messages"),"data-testid":"mail-search",onChange:c,placeholder:e("Filter messages"),type:"search",value:I}),(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:x.map(r=>{let m=r.id===i?.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 ${m?"bg-muted":""}`,"data-active":m,"data-id":r.id,"data-testid":"mail-list-item",onClick:f,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:N(r.to)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:re(r.capturedAt,"\u2014")})]})},r.id)})})})]}),i!==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:i.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:i.from??"\u2014"}),(0,t.jsx)("dt",{children:e("To")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:N(i.to)}),i.cc!==void 0&&i.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:N(i.cc)})]}),(0,t.jsx)("dt",{children:e("Sent")}),(0,t.jsx)("dd",{className:"tabular-nums",children:re(i.capturedAt,"\u2014")})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"mail-actions",children:[(0,t.jsx)(b,{"data-testid":"mail-copy-link",disabled:w===void 0,onClick:P,size:"sm",type:"button",variant:"outline",children:e("Copy link")}),(0,t.jsx)(b,{"data-testid":"mail-open-link",disabled:w===void 0,onClick:C,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)(b,{"aria-selected":h===r,"data-tab":r,"data-testid":`mail-tab-${r}`,onClick:q,role:"tab",size:"sm",type:"button",variant:h===r?"secondary":"ghost",children:B(r)},r))}),(0,t.jsxs)("div",{className:"min-h-[12rem]",children:[h==="html"&&(i.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(i.html),title:e("Email preview")})),h==="text"&&(i.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:i.text})),h==="headers"&&(i.headers===void 0||Object.keys(i.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(i.headers).map(([r,m])=>`${r}: ${m}`).join(`
|
|
2
|
-
`)}))]})]})]})]})},"Qe");export{Ke as MailPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as h}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{b as A}from"./chunk-4DAKKAK7.js";import{m as S}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as y,e as I}from"./chunk-JSDKOE4U.js";import{l as k}from"./chunk-BFE2DRP6.js";import{a as u,d as w,f as z,g as P}from"./chunk-OXFKZ4BM.js";var N=w(z(),1);var a=w(P(),1);var j=[{key:"accounts",label:"Accounts"},{key:"admin",label:"Admin"},{key:"organization",label:"Organizations"},{key:"passkey",label:"Passkeys"},{key:"twoFactor",label:"Two-factor"}],v=u(e=>{if(e===void 0)return"\u2014";let i=[[86400,"d"],[3600,"h"],[60,"m"]];for(let[t,d]of i)if(e>=t&&e%t===0)return`${String(e/t)}${d}`;return`${String(e)}s`},"v"),p=u(e=>{let i=(0,N.c)(8),{children:t,heading:d,testId:n}=e,l;i[0]!==d?(l=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:d})}),i[0]=d,i[1]=l):l=i[1];let s;i[2]!==t?(s=(0,a.jsx)(I,{className:"p-3",children:t}),i[2]=t,i[3]=s):s=i[3];let c;return i[4]!==l||i[5]!==s||i[6]!==n?(c=(0,a.jsxs)(y,{className:"gap-0 py-0","data-testid":n,children:[l,s]}),i[4]=l,i[5]=s,i[6]=n,i[7]=c):c=i[7],c},"h"),o=u(e=>{let i=(0,N.c)(7),{label:t,value:d}=e,n;i[0]!==t?(n=(0,a.jsx)("span",{className:"text-sm",children:t}),i[0]=t,i[1]=n):n=i[1];let l;i[2]!==d?(l=(0,a.jsx)("span",{className:"text-sm text-muted-foreground tabular-nums",children:d}),i[2]=d,i[3]=l):l=i[3];let s;return i[4]!==n||i[5]!==l?(s=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs",children:[n,l]}),i[4]=n,i[5]=l,i[6]=s):s=i[6],s},"c"),M=u(()=>{let e=(0,N.c)(20),i=S(),t=k(),d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=["lunora-auth-config"],e[0]=d):d=e[0];let n;e[1]!==i?(n=u(()=>i.getAuthConfig(),"r"),e[1]=i,e[2]=n):n=e[2];let{data:l,error:s}=A(d,n),c;e[3]!==t?(c=u(r=>(0,a.jsx)(h,{variant:r?"success":"outline",children:t(r?"Enabled":"Disabled")}),"u"),e[3]=t,e[4]=c):c=e[4];let m=c,g;e[5]!==s?(g=s!==null&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"auth-config-error",role:"alert",children:s}),e[5]=s,e[6]=g):g=e[6];let f;e[7]!==l||e[8]!==s||e[9]!==t?(f=s===null&&l===void 0&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"auth-config-loading",children:t("Loading auth configuration\u2026")}),e[7]=l,e[8]=s,e[9]=t,e[10]=f):f=e[10];let x;e[11]!==l||e[12]!==s||e[13]!==m||e[14]!==t?(x=s===null&&l!==void 0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p,{heading:t("Enabled capabilities"),testId:"auth-config-capabilities",children:(0,a.jsx)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:j.map(r=>{let $=l.capabilities[r.key];return(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-cap-${r.key}`,children:[(0,a.jsx)("span",{className:"text-sm",children:t(r.label)}),m($)]},r.key)})})}),(0,a.jsx)(p,{heading:t("Plugins"),testId:"auth-config-plugins",children:l.plugins.length===0?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t("No plugins enabled.")}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:l.plugins.map(C)})}),(0,a.jsx)(p,{heading:t("Sign-in methods"),testId:"auth-config-signin",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Email & password"),value:m(l.emailAndPassword)}),(0,a.jsx)(o,{label:t("Social providers"),value:l.socialProviders.length===0?t("None"):(0,a.jsx)("span",{className:"flex flex-wrap justify-end gap-1",children:l.socialProviders.map(q)})})]})}),l.organization.enabled&&(0,a.jsx)(p,{heading:t("Organizations"),testId:"auth-config-org",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Teams"),value:m(l.organization.teams)}),(0,a.jsx)(o,{label:t("Custom roles"),value:m(l.organization.roles)})]})}),(0,a.jsx)(p,{heading:t("Session policy"),testId:"auth-config-session",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Expires in"),value:v(l.session.expiresIn)}),(0,a.jsx)(o,{label:t("Refresh after"),value:v(l.session.updateAge)}),(0,a.jsx)(o,{label:t("Fresh window"),value:v(l.session.freshAge)}),(0,a.jsx)(o,{label:t("Cookie cache"),value:m(l.session.cookieCache===!0)})]})}),(0,a.jsx)(p,{heading:t("Rate limit"),testId:"auth-config-ratelimit",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Status"),value:m(l.rateLimit.enabled)}),l.rateLimit.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{label:t("Max requests"),value:l.rateLimit.max??"\u2014"}),(0,a.jsx)(o,{label:t("Window"),value:v(l.rateLimit.window)})]})]})}),l.userFields.length>0&&(0,a.jsx)(p,{heading:t("Plugin user fields"),testId:"auth-config-user-fields",children:(0,a.jsx)("ul",{className:"flex flex-col gap-2",children:l.userFields.map(r=>(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-user-field-${r.name}`,children:[(0,a.jsxs)("span",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-mono text-xs",children:r.name}),r.plugin!==void 0&&(0,a.jsx)("span",{className:"text-[11px] text-muted-foreground",children:r.plugin})]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(h,{variant:"outline",children:r.type}),r.required&&(0,a.jsx)(h,{variant:"secondary",children:t("required")}),r.unique&&(0,a.jsx)(h,{variant:"secondary",children:t("unique")})]})]},r.name))})}),(0,a.jsx)(y,{className:"gap-0 py-0",children:(0,a.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground","data-testid":"auth-config-note",children:t("OAuth providers, email templates, and rate limits are configured at deploy time in the better-auth setup and aren't editable here. See the Mail tab for email output.")})})]}),e[11]=l,e[12]=s,e[13]=m,e[14]=t,e[15]=x):x=e[15];let b;return e[16]!==g||e[17]!==f||e[18]!==x?(b=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"auth-config",children:[g,f,x]}),e[16]=g,e[17]=f,e[18]=x,e[19]=b):b=e[19],b},"O");function C(e){return(0,a.jsx)(h,{"data-testid":`auth-config-plugin-${e}`,variant:"outline",children:e},e)}u(C,"P");function q(e){return(0,a.jsx)(h,{"data-testid":`auth-config-provider-${e}`,variant:"outline",children:e},e)}u(q,"z");export{M as default};
|