@hot-updater/console 1.0.0-rc.4 → 1.0.0-rc.40
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/.output/nitro.json +1 -1
- package/.output/public/assets/ConsoleFeatureUnavailable-BH7LLqAg.js +1 -0
- package/.output/public/assets/EventDetails-3DgVjwDn.js +1 -0
- package/.output/public/assets/InsightsInfo-NUuLFYqg.js +1 -0
- package/.output/public/assets/InsightsPageHeader-DqCp0vf7.js +1 -0
- package/.output/public/assets/NotFoundPage-CkgdpWvl.js +1 -0
- package/.output/public/assets/alert-dialog-DXxrSU0G.js +1 -0
- package/.output/public/assets/api-BiZP_i-u.js +1 -0
- package/.output/public/assets/api-keys-DQDqmKtq.js +1 -0
- package/.output/public/assets/api-keys-DTQ1HrkR.js +1 -0
- package/.output/public/assets/arrow-left-BPK7iqvj.js +1 -0
- package/.output/public/assets/card-DKr2pZMA.js +1 -0
- package/.output/public/assets/console-features-api-BhUIxeL-.js +1 -0
- package/.output/public/assets/dialog-DxjO7ofz.js +1 -0
- package/.output/public/assets/dist-BzWwzt98.js +1 -0
- package/.output/public/assets/empty-DtangHOp.js +1 -0
- package/.output/public/assets/field-bPoDrs6K.js +1 -0
- package/.output/public/assets/index-B7BSdp0k.js +11 -0
- package/.output/public/assets/input-group-_PD0i7wZ.js +1 -0
- package/.output/public/assets/insights-BBya_x8N.js +1 -0
- package/.output/public/assets/insights-CevVB_8E.js +2 -0
- package/.output/public/assets/insights-DMH-zhbe.js +42 -0
- package/.output/public/assets/insights-usage-rpc-pz2XQBi3.js +1 -0
- package/.output/public/assets/insights_.distribution-B9MOEnzZ.js +2 -0
- package/.output/public/assets/insights_.distribution-O73SKvoa.js +1 -0
- package/.output/public/assets/insights_.distribution-WTcKITzb.js +1 -0
- package/.output/public/assets/installations-CstW4tEL.js +1 -0
- package/.output/public/assets/installations-DtZj5jk2.js +1 -0
- package/.output/public/assets/installations-LJBhFDEM.js +2 -0
- package/.output/public/assets/loader-circle-iTGehfyV.js +1 -0
- package/.output/public/assets/mutation-B4EZNS91.js +1 -0
- package/.output/public/assets/preload-helper-D9SUwQT7.js +1 -0
- package/.output/public/assets/refresh-cw-3fSQ1FYY.js +1 -0
- package/.output/public/assets/routes-CJSxovHS.js +1 -0
- package/.output/public/assets/routes-DyZCr794.js +2 -0
- package/.output/public/assets/sidebar-RBvHzq8e.js +3 -0
- package/.output/public/assets/styles-DwA6mhnh.css +2 -0
- package/.output/public/assets/table-BYmouPt9.js +1 -0
- package/.output/public/assets/useCompositeListItem-BxJspDxS.js +1 -0
- package/.output/public/assets/valueToPercent-Ci2-fmWp.js +1 -0
- package/.output/server/{__23tanstack-start-server-fn-resolver-Dr2ixDgQ.mjs → __23tanstack-start-server-fn-resolver-CUp7Too4.mjs} +60 -52
- package/.output/server/_libs/@base-ui/react+[...].mjs +7219 -3692
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +3802 -4022
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +140 -97
- package/.output/server/_libs/lucide-react.mjs +114 -31
- package/.output/server/_libs/next-themes.mjs +1 -1
- package/.output/server/_libs/react-redux+[...].mjs +1 -1
- package/.output/server/_libs/recharts+[...].mjs +483 -901
- package/.output/server/_libs/sonner.mjs +1 -1
- package/.output/server/_libs/tanstack__history.mjs +68 -41
- package/.output/server/_libs/tanstack__query-core.mjs +1994 -310
- package/.output/server/_libs/tanstack__react-query.mjs +448 -21
- package/.output/server/_libs/verkit.mjs +99 -1
- package/.output/server/_ssr/ConsoleFeatureUnavailable-BxaV7ca0.mjs +58 -0
- package/.output/server/_ssr/EventDetails-B5HHZsCk.mjs +344 -0
- package/.output/server/_ssr/InsightsInfo-C7K_HKHZ.mjs +75 -0
- package/.output/server/_ssr/InsightsPageHeader-BPaYzzkg.mjs +183 -0
- package/.output/server/_ssr/NotFoundPage-CyBONH8d.mjs +37 -0
- package/.output/server/_ssr/{dialog-DUaIgpgd.mjs → alert-dialog-BsqgyNOZ.mjs} +6 -83
- package/.output/server/_ssr/api-keys-CY1d8bCZ.mjs +5 -0
- package/.output/server/_ssr/{api-keys-DJml_XoK.mjs → api-keys-D8R-eRJ-.mjs} +49 -10
- package/.output/server/_ssr/api-keys-rpc-CC1ERVtk.mjs +52 -0
- package/.output/server/_ssr/api-otC0m2Cl.mjs +203 -0
- package/.output/server/_ssr/api-rpc-C99iexLk.mjs +296 -0
- package/.output/server/_ssr/{auth-rpc-D_hv52-J.mjs → auth-rpc-PABg7kHk.mjs} +6 -6
- package/.output/server/_ssr/auth.server-8-IRXBc-.mjs +5712 -0
- package/.output/server/_ssr/bundleActivity-BXSJbaQY.mjs +18 -0
- package/.output/server/_ssr/card-ijGSudc_.mjs +49 -0
- package/.output/server/_ssr/config-nsIcsHh8.mjs +15 -0
- package/.output/server/_ssr/config.server-08RES1G-.mjs +36 -0
- package/.output/server/_ssr/console-access-D0bQJ9tx.mjs +17 -0
- package/.output/server/_ssr/console-features-AGV2b_l5.mjs +55 -0
- package/.output/server/_ssr/console-features-api-BRGAxAgc.mjs +43 -0
- package/.output/server/_ssr/console-features-rpc-845alOXy.mjs +19 -0
- package/.output/server/_ssr/{createServerFn-B2hcXoPM.mjs → createMiddleware-BdBf_ezN.mjs} +67 -56
- package/.output/server/_ssr/{createServerRpc-DB29C_5p.mjs → createServerRpc-B_y2lrwA.mjs} +2 -2
- package/.output/server/_ssr/{databaseJsonValue-d6I3nAS4.mjs → databaseJsonValue-Bhxciy7Z.mjs} +28 -5
- package/.output/server/_ssr/databaseRows-DwMAjaF8.mjs +74 -0
- package/.output/server/_ssr/dialog-BnfVyv4I.mjs +84 -0
- package/.output/server/_ssr/{dist-CyzPaI5v.mjs → dist-Cxo9ghYv.mjs} +140 -6
- package/.output/server/_ssr/{downloadBundle-B3ert-pY.mjs → downloadBundle-D10vIrle.mjs} +10 -10
- package/.output/server/_ssr/empty-CnGZqF1a.mjs +49 -0
- package/.output/server/_ssr/{empty-plugin-adapters-B5QvGpEl.mjs → empty-plugin-adapters-CYdinE-i.mjs} +1 -1
- package/.output/server/_ssr/failureReports-_trbWCVo.mjs +33 -0
- package/.output/server/_ssr/{field-CqNUlqUq.mjs → field-CysUuRJx.mjs} +62 -4
- package/.output/server/_ssr/getBundleChildren-DLGwrnCV.mjs +22 -0
- package/.output/server/_ssr/{input-group-Bb8ueylQ.mjs → input-group-C44twsSf.mjs} +2 -2
- package/.output/server/_ssr/insights-Br6JnctH.mjs +5 -0
- package/.output/server/_ssr/insights-CgRV7dlP.mjs +2314 -0
- package/.output/server/_ssr/insights-CrrlG-bz.mjs +14 -0
- package/.output/server/_ssr/insights-api-MpLvDjmC.mjs +122 -0
- package/.output/server/_ssr/insights-errors-Cy03daYs.mjs +34 -0
- package/.output/server/_ssr/insights-failures-HHiiIbag.mjs +46 -0
- package/.output/server/_ssr/insights-failures-rpc-CGiDJbg-.mjs +36 -0
- package/.output/server/_ssr/{insights-recovery-DSFM-YTL.mjs → insights-recovery-Dpk6Mfb9.mjs} +9 -2
- package/.output/server/_ssr/insights-recovery-rpc-Bul_1cyL.mjs +32 -0
- package/.output/server/_ssr/{insights-rpc-DrIQCjpD.mjs → insights-rpc-D24DKKlx.mjs} +22 -14
- package/.output/server/_ssr/insights-usage-CLUWjUFz.mjs +29 -0
- package/.output/server/_ssr/insights-usage-rpc-iG8wRo4G.mjs +29 -0
- package/.output/server/_ssr/insights-usage-rpc-tVCHkzGH.mjs +41 -0
- package/.output/server/_ssr/insightsUsage-9X2sp3ja.mjs +56 -0
- package/.output/server/_ssr/insights_.distribution-Ckc_O360.mjs +16 -0
- package/.output/server/_ssr/insights_.distribution-DbO4X6X6.mjs +7 -0
- package/.output/server/_ssr/insights_.distribution-DsujaomV.mjs +347 -0
- package/.output/server/_ssr/{installations-YumqpNpa.mjs → installations-DV3sNoM5.mjs} +280 -364
- package/.output/server/_ssr/installations-DkJq_y8i.mjs +5 -0
- package/.output/server/_ssr/installations-F6vBSPUU.mjs +69 -0
- package/.output/server/_ssr/listReleases-BitHzOYB.mjs +79 -0
- package/.output/server/_ssr/release-adoption-NO2DVJwF.mjs +55 -0
- package/.output/server/_ssr/release-adoption-rpc-h_r3KQsi.mjs +41 -0
- package/.output/server/_ssr/releaseAdoption-CwFUzIZA.mjs +114 -0
- package/.output/server/_ssr/releaseManagement-B3e7I8J9.mjs +11 -0
- package/.output/server/_ssr/{router-iP95Vqi2.mjs → router-C_IshN2d.mjs} +134 -138
- package/.output/server/_ssr/{routes-ivsV2TDu.mjs → routes-BEHlOXKL.mjs} +190 -674
- package/.output/server/_ssr/routes-DeSps20R.mjs +391 -0
- package/.output/server/_ssr/runtime.server-C1SVch_-.mjs +1604 -0
- package/.output/server/_ssr/schema-BKY9SqaY.mjs +25 -0
- package/.output/server/_ssr/select-BL10bGzk.mjs +114 -0
- package/.output/server/_ssr/server-DIIIVgcN.mjs +8334 -0
- package/.output/server/_ssr/{createSsrRpc-NHF2PxuK.mjs → sidebar-DLus-ndm.mjs} +107 -47
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/start-BXUOv_n8.mjs +4 -0
- package/.output/server/_ssr/{table-D1mL8fJu.mjs → table-U7InIZlH.mjs} +2 -2
- package/.output/server/_ssr/updateFailures-BLs3R7j0.mjs +40 -0
- package/.output/server/_ssr/{uuidv7-D0QFkPL_.mjs → uuidv7-C8bwiZr8.mjs} +2 -2
- package/.output/server/_tanstack-start-manifest_v-VxUXUIhM.mjs +123 -0
- package/.output/server/index.mjs +240 -163
- package/LICENSE +13 -14
- package/README.md +82 -72
- package/lib/index.d.mts +23 -11
- package/lib/vite-internal.mjs +13 -3
- package/lib/vite.d.mts +2 -0
- package/package.json +14 -14
- package/src/components/AppSidebar.tsx +100 -71
- package/src/components/ConsoleAccessPage.tsx +5 -1
- package/src/components/ConsoleFeatureUnavailable.tsx +80 -0
- package/src/components/NotFoundPage.tsx +7 -7
- package/src/components/features/FeatureSlots.tsx +101 -0
- package/src/components/features/api-keys/apiKeysFeatureUi.tsx +15 -0
- package/src/components/features/bundles/BundleMetadata.tsx +8 -5
- package/src/components/features/bundles/RolloutCohortsDialog.tsx +1 -1
- package/src/components/features/channels/ChannelManagementDialog.tsx +2 -5
- package/src/components/features/insights/AppUsage.tsx +366 -0
- package/src/components/features/insights/BuiltinBundle.tsx +36 -0
- package/src/components/features/insights/ComparedBundlesChart.tsx +310 -0
- package/src/components/features/insights/EstimatedCount.tsx +18 -0
- package/src/components/features/insights/EventDetails.tsx +400 -39
- package/src/components/features/insights/EventHistoryCard.tsx +112 -26
- package/src/components/features/insights/EventHistoryList.tsx +2 -2
- package/src/components/features/insights/FailureReports.tsx +407 -0
- package/src/components/features/insights/InsightsControls.tsx +265 -88
- package/src/components/features/insights/InsightsErrorAlert.tsx +14 -1
- package/src/components/features/insights/InsightsInfo.tsx +48 -0
- package/src/components/features/insights/InsightsOverview.tsx +604 -355
- package/src/components/features/insights/InsightsPageHeader.tsx +35 -20
- package/src/components/features/insights/InsightsPeriodSelector.tsx +89 -0
- package/src/components/features/insights/InstallationHistoryCard.tsx +66 -11
- package/src/components/features/insights/InstallationMatchesCard.tsx +1 -1
- package/src/components/features/insights/ReleaseActivity.tsx +308 -0
- package/src/components/features/insights/ReportingDevicesSummary.tsx +48 -0
- package/src/components/features/insights/RollbackButton.tsx +118 -0
- package/src/components/features/insights/UpdateFailures.tsx +382 -0
- package/src/components/features/insights/insightsFeatureUi.tsx +35 -0
- package/src/components/features/releases/ReleaseEditorSheet.tsx +26 -12
- package/src/components/ui/card.tsx +1 -1
- package/src/components/ui/scroll-area.tsx +52 -0
- package/src/components/ui/sidebar.tsx +22 -29
- package/src/components/ui/tabs.tsx +81 -0
- package/src/index.ts +26 -19
- package/src/lib/api-keys-api.ts +0 -28
- package/src/lib/api-keys-rpc.ts +27 -38
- package/src/lib/api-rpc.ts +189 -266
- package/src/lib/api.ts +19 -102
- package/src/lib/bundle-activity.ts +24 -4
- package/src/lib/console-access.ts +20 -0
- package/src/lib/console-features-api.ts +68 -0
- package/src/lib/console-features-rpc.ts +13 -0
- package/src/lib/console-features.ts +91 -0
- package/src/lib/insights-api.ts +56 -2
- package/src/lib/insights-errors.ts +64 -0
- package/src/lib/insights-failures-rpc.ts +36 -0
- package/src/lib/insights-failures.ts +130 -0
- package/src/lib/insights-recovery-rpc.ts +13 -17
- package/src/lib/insights-recovery.ts +10 -27
- package/src/lib/insights-retention.ts +21 -0
- package/src/lib/insights-rpc.ts +30 -12
- package/src/lib/insights-search.ts +93 -0
- package/src/lib/insights-usage-rpc.ts +29 -0
- package/src/lib/insights-usage.ts +76 -0
- package/src/lib/insights-view.ts +34 -5
- package/src/lib/release-adoption-api.ts +214 -0
- package/src/lib/release-adoption-rpc.ts +49 -0
- package/src/lib/release-adoption.ts +164 -0
- package/src/lib/scroll-restoration.ts +21 -0
- package/src/lib/server/adminInsights.ts +124 -0
- package/src/lib/server/auth.server.ts +13 -5
- package/src/lib/server/bundleActivity.ts +27 -28
- package/src/lib/server/config.server.ts +21 -74
- package/src/lib/server/console-feature-apis.ts +59 -0
- package/src/lib/server/console-runtime.server.ts +82 -38
- package/src/lib/server/downloadBundle.ts +16 -15
- package/src/lib/server/failureReports.ts +49 -0
- package/src/lib/server/getBundleChildren.ts +31 -122
- package/src/lib/server/insightsUsage.ts +63 -0
- package/src/lib/server/listReleases.ts +109 -44
- package/src/lib/server/releaseAdoption.ts +154 -0
- package/src/lib/server/releaseReachability.ts +8 -7
- package/src/lib/server/runtime.server.ts +120 -31
- package/src/lib/server/updateFailures.ts +65 -0
- package/src/routeTree.gen.ts +44 -44
- package/src/router.tsx +3 -2
- package/src/routes/-installations-search.ts +32 -8
- package/src/routes/-releases-search.ts +76 -29
- package/src/routes/__root.tsx +10 -4
- package/src/routes/api/bundles/$bundleId/download.ts +2 -5
- package/src/routes/api-keys.tsx +5 -2
- package/src/routes/index.tsx +210 -152
- package/src/routes/insights.tsx +133 -18
- package/src/routes/insights_.distribution.tsx +422 -0
- package/src/routes/installations.tsx +98 -41
- package/src/styles.css +9 -0
- package/src/vite-internal.ts +15 -3
- package/src/vite.ts +2 -0
- package/.output/public/assets/InsightsPageHeader-C-Xc2MB9.js +0 -1
- package/.output/public/assets/api-keys-C1sgC6ko.js +0 -1
- package/.output/public/assets/api-keys-api-LchP65vQ.js +0 -1
- package/.output/public/assets/badge-BuMDU0Rf.js +0 -1
- package/.output/public/assets/card-BEvx_QKh.js +0 -1
- package/.output/public/assets/chart-no-axes-combined-C0G0fQ3J.js +0 -1
- package/.output/public/assets/composite-CHTH1Xhh.js +0 -1
- package/.output/public/assets/createServerFn-DHc2erub.js +0 -3
- package/.output/public/assets/dialog-dyZ1SphZ.js +0 -1
- package/.output/public/assets/dist-Bh1gaDfB.js +0 -1
- package/.output/public/assets/field-79SVH26s.js +0 -1
- package/.output/public/assets/index-BNkxg4jz.js +0 -10
- package/.output/public/assets/input-group-BbHfaBzQ.js +0 -1
- package/.output/public/assets/insights-D_7uSKfc.js +0 -1
- package/.output/public/assets/installations-BzoHWuXw.js +0 -1
- package/.output/public/assets/installations-DvjbUqd1.js +0 -2
- package/.output/public/assets/lazyRouteComponent-BN0MS05o.js +0 -1
- package/.output/public/assets/link-BG06whwB.js +0 -1
- package/.output/public/assets/loader-circle-Bbp8LGVC.js +0 -1
- package/.output/public/assets/preload-helper-uTix4PVD.js +0 -1
- package/.output/public/assets/refresh-cw-DZgiAOMk.js +0 -1
- package/.output/public/assets/routes-BFE-oRIT.js +0 -1
- package/.output/public/assets/routes-DaPMY31P.js +0 -2
- package/.output/public/assets/shield-check-DoIiaaXU.js +0 -1
- package/.output/public/assets/signing-BTRhaF5D.js +0 -1
- package/.output/public/assets/styles-C7U0oVke.css +0 -2
- package/.output/public/assets/table-BBEzJ7Xl.js +0 -1
- package/.output/public/assets/useCompositeListItem-BkPDaqyj.js +0 -42
- package/.output/server/_ssr/InsightsPageHeader-C5Has8Ry.mjs +0 -60
- package/.output/server/_ssr/api-keys-api-CrCZyvnl.mjs +0 -60
- package/.output/server/_ssr/api-keys-rpc-CFaNf-q0.mjs +0 -136
- package/.output/server/_ssr/api-rpc-B61KL3Eo.mjs +0 -1399
- package/.output/server/_ssr/auth.server-DF_shCeq.mjs +0 -47
- package/.output/server/_ssr/badge-BgsCP9Dp.mjs +0 -28
- package/.output/server/_ssr/bundle-signing-rpc-BBipZnFs.mjs +0 -16
- package/.output/server/_ssr/bundle-signing.server-Co_zHdJx.mjs +0 -12
- package/.output/server/_ssr/bundleActivity-D3_fIda2.mjs +0 -27
- package/.output/server/_ssr/card-DrbxCPtG.mjs +0 -86
- package/.output/server/_ssr/chart-qxa-_30a.mjs +0 -162
- package/.output/server/_ssr/config-Dv8qLDZ0.mjs +0 -13
- package/.output/server/_ssr/config.server-CBr6PDj5.mjs +0 -368
- package/.output/server/_ssr/databaseRows-5bCRTxm-.mjs +0 -126
- package/.output/server/_ssr/deleteBundle-BAq3JuGr.mjs +0 -66
- package/.output/server/_ssr/getBundleChildren-COMt16m_.mjs +0 -50
- package/.output/server/_ssr/insights-B-DUbksX.mjs +0 -502
- package/.output/server/_ssr/insights-recovery-rpc-P71FH66n.mjs +0 -37
- package/.output/server/_ssr/insightsContract-fjJDBeEE.mjs +0 -303
- package/.output/server/_ssr/insightsRecovery-CqcosG7B.mjs +0 -149
- package/.output/server/_ssr/installations-BQrppti7.mjs +0 -29
- package/.output/server/_ssr/routes-BDabsmc7.mjs +0 -37
- package/.output/server/_ssr/runtime.server-jmZOKIQM.mjs +0 -438
- package/.output/server/_ssr/server-p7yrVBfD.mjs +0 -7468
- package/.output/server/_ssr/signing-CxCbnFCt.mjs +0 -134
- package/.output/server/_ssr/start-DpViQGnt.mjs +0 -4
- package/.output/server/_tanstack-start-manifest_v-Cwpu0C9Q.mjs +0 -100
- package/src/components/features/bundles/BundleActivityChart.tsx +0 -95
- package/src/components/features/bundles/BundleInsightsSummary.tsx +0 -121
- package/src/components/features/signing/BundleSigningPage.tsx +0 -139
- package/src/lib/bundle-signing-api.ts +0 -14
- package/src/lib/bundle-signing-rpc.ts +0 -16
- package/src/lib/server/bundle-signing.server.ts +0 -23
- package/src/lib/server/deleteBundle.ts +0 -145
- package/src/lib/server/insightsHistory.ts +0 -52
- package/src/lib/server/insightsRecovery.ts +0 -186
- package/src/routes/signing.tsx +0 -37
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$r as e,Bn as t,Gt as n,Hr as r,Jn as i,Ln as a,Ur as o,Vt as s,ar as c,ni as l,nr as u,rr as d}from"./sidebar-RBvHzq8e.js";import{r as f,t as p}from"./valueToPercent-Ci2-fmWp.js";var m=c(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),h=l(e()),g=h.createContext(void 0);function _(){let e=h.useContext(g);if(e===void 0)throw Error(i(51));return e}var v=function(e){return e.complete=`data-complete`,e.indeterminate=`data-indeterminate`,e.progressing=`data-progressing`,e}({}),y={status(e){return e===`progressing`?{[v.progressing]:``}:e===`complete`?{[v.complete]:``}:e===`indeterminate`?{[v.indeterminate]:``}:null}},b=r();function x(e,t){return t==null?`indeterminate progress`:e||`${t}%`}var S=h.forwardRef(function(e,r){let{format:i,getAriaValueText:a=x,locale:o,max:c=100,min:l=0,value:u,render:d,className:p,children:m,style:_,...v}=e,[S,C]=h.useState(),w=n(i),T=`indeterminate`;Number.isFinite(u)&&(T=u===c?`complete`:`progressing`);let E=f(u,o,w.current),D=h.useMemo(()=>({status:T}),[T]),O={"aria-labelledby":S,"aria-valuemax":c,"aria-valuemin":l,"aria-valuenow":u??void 0,"aria-valuetext":a(E,u),role:`progressbar`,children:(0,b.jsxs)(h.Fragment,{children:[m,(0,b.jsx)(`span`,{role:`presentation`,style:s,children:`x`})]})},k=h.useMemo(()=>({formattedValue:E,max:c,min:l,setLabelId:C,state:D,status:T,value:u}),[E,c,l,C,D,T,u]),A=t(`div`,e,{state:D,ref:r,props:[O,v],stateAttributesMapping:y});return(0,b.jsx)(g.Provider,{value:k,children:A})}),C=h.forwardRef(function(e,n){let{render:r,className:i,style:a,...o}=e,{state:s}=_();return t(`div`,e,{state:s,ref:n,props:o,stateAttributesMapping:y})}),w=h.forwardRef(function(e,n){let{render:r,className:i,style:a,...o}=e,{max:s,min:c,value:l,state:u}=_(),d=Number.isFinite(l)&&l!==null?p(l,c,s):null;return t(`div`,e,{state:u,ref:n,props:[{style:d==null?{}:{insetInlineStart:0,height:`inherit`,width:`${d}%`}},o],stateAttributesMapping:y})});function T({className:e,children:t,value:n,...r}){return(0,b.jsxs)(S,{value:n,"data-slot":`progress`,className:a(`w-full`,e),...r,children:[t,(0,b.jsx)(E,{children:(0,b.jsx)(D,{})})]})}function E({className:e,...t}){return(0,b.jsx)(C,{className:a(`relative flex h-1 w-full items-center overflow-x-hidden rounded-md bg-muted`,e),"data-slot":`progress-track`,...t})}function D({className:e,...t}){return(0,b.jsx)(w,{"data-slot":`progress-indicator`,className:a(`h-full bg-primary transition-transform motion-reduce:transition-none`,e),...t})}var O=d({method:`GET`}).middleware([u]).handler(o(`8a98cd9c178e4a54185d62c25a95f09d3d59850c43d3f5baa1563e1614ad942e`));export{T as n,m as r,O as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/insights_.distribution-WTcKITzb.js","assets/ConsoleFeatureUnavailable-BH7LLqAg.js","assets/sidebar-RBvHzq8e.js","assets/console-features-api-BhUIxeL-.js","assets/empty-DtangHOp.js","assets/NotFoundPage-CkgdpWvl.js","assets/insights_.distribution-O73SKvoa.js","assets/preload-helper-D9SUwQT7.js","assets/valueToPercent-Ci2-fmWp.js","assets/useCompositeListItem-BxJspDxS.js","assets/field-bPoDrs6K.js","assets/InsightsPageHeader-DqCp0vf7.js","assets/card-DKr2pZMA.js","assets/insights-usage-rpc-pz2XQBi3.js","assets/arrow-left-BPK7iqvj.js","assets/InsightsInfo-NUuLFYqg.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./console-features-api-BhUIxeL-.js";import{C as t,t as n,w as r}from"./preload-helper-D9SUwQT7.js";import{i}from"./InsightsInfo-NUuLFYqg.js";var a=r(`/insights_/distribution`)({beforeLoad:({context:t})=>e(t.queryClient,`insightsAnalytics`),notFoundComponent:t(()=>n(()=>import(`./insights_.distribution-WTcKITzb.js`),__vite__mapDeps([0,1,2,3,4,5])),`notFoundComponent`),component:t(()=>n(()=>import(`./insights_.distribution-O73SKvoa.js`),__vite__mapDeps([6,2,7,3,8,9,10,11,12,13,14,4,15])),`component`),validateSearch:i});export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fn as e,Hr as t,In as n,Nn as r,cr as i}from"./sidebar-RBvHzq8e.js";import{l as a}from"./console-features-api-BhUIxeL-.js";import{d as o,s}from"./preload-helper-D9SUwQT7.js";import{t as c}from"./arrow-left-BPK7iqvj.js";import{a as ee,i as te,o as l,r as u,t as d}from"./empty-DtangHOp.js";import{a as f,c as p,d as m,s as h,t as g,u as _}from"./field-bPoDrs6K.js";import{I as v,L as y,a as ne,c as re,i as b,l as x,o as S,s as C}from"./valueToPercent-Ci2-fmWp.js";import{n as w,r as T,t as E}from"./insights-usage-rpc-pz2XQBi3.js";import{a as D,i as O,n as k,o as A,t as j}from"./card-DKr2pZMA.js";import{a as M,t as N}from"./InsightsInfo-NUuLFYqg.js";import{t as P}from"./insights_.distribution-B9MOEnzZ.js";import{f as ie,n as F,o as I,t as L}from"./InsightsPageHeader-DqCp0vf7.js";var R=t(),z=20,B=new Intl.DateTimeFormat(`en`,{month:`short`,day:`numeric`,timeZone:`UTC`}),V=e=>e.releaseId??(e.builtinBundleId?`Built-in bundle ${e.builtinBundleId}`:`Unknown bundle`);function H({bundleId:e}){return(0,R.jsxs)(`div`,{className:`flex min-h-11 min-w-0 flex-wrap items-center gap-2 md:min-h-9`,children:[(0,R.jsx)(F,{}),(0,R.jsx)(y,{bundleId:e,className:`text-muted-foreground`})]})}function U(){let t=P.useSearch(),y=s(),F=P.useNavigate(),U={platform:t.platform??`all`,channel:t.channel??`production`,appVersion:t.appVersion,window:t.window??`24h`},W=i({queryKey:[`insights`,`app-usage`,U],queryFn:()=>E({data:U}),staleTime:3e4}),G=W.error?void 0:W.data,K=G?`since ${B.format(G.distributionSinceMs)}, 00:00 UTC`:`in this period`,q=(G?.bundleDistribution??[]).filter(e=>!t.version||e.appVersion===t.version),J=q.reduce((e,t)=>e+t.installations,0),Y=Math.max(1,Math.ceil(q.length/z)),X=Math.min(t.page??1,Y),Z=[...new Set([...G?.versions.map(e=>e.name)??[],...t.version?[t.version]:[]])],Q=M(t),$=e=>void F({search:{...t,page:void 0,...e}});return(0,R.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,R.jsx)(L,{view:`distribution`,overviewSearch:Q}),(0,R.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 px-4 py-6 sm:p-8`,children:(0,R.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-6`,children:[(0,R.jsxs)(a,{to:`/insights`,search:Q,className:n({variant:`ghost`,className:`h-11 w-fit sm:h-9`}),children:[(0,R.jsx)(c,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Back to overview`]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[(0,R.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight`,children:`Distribution`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(I,{twelveMonths:o(y),window:U.window,onWindowChange:e=>$({window:e})}),(0,R.jsx)(e,{"aria-label":`Refresh distribution`,variant:`ghost`,size:`icon`,className:`size-11 sm:size-9`,disabled:W.isFetching,onClick:()=>void W.refetch(),children:(0,R.jsx)(T,{"aria-hidden":`true`})})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,R.jsxs)(g,{className:`w-full sm:w-64`,children:[(0,R.jsx)(f,{htmlFor:`distribution-version`,children:`App version`}),(0,R.jsxs)(b,{items:Object.fromEntries([[`all`,`All versions`],...Z.map(e=>[`version:${e}`,e])]),value:t.version?`version:${t.version}`:`all`,onValueChange:e=>{e!==null&&$({version:e===`all`?void 0:e.slice(8)})},children:[(0,R.jsx)(re,{id:`distribution-version`,className:`min-h-11 w-full sm:min-h-9`,children:(0,R.jsx)(x,{})}),(0,R.jsx)(ne,{children:(0,R.jsxs)(S,{children:[(0,R.jsx)(C,{value:`all`,children:`All versions`}),Z.map(e=>(0,R.jsx)(C,{value:`version:${e}`,children:e},e))]})})]})]}),(0,R.jsxs)(`div`,{className:`flex min-h-9 flex-wrap items-center gap-2`,"aria-label":`Distribution scope`,children:[(0,R.jsxs)(h,{variant:`outline`,className:`gap-1.5`,children:[U.platform===`all`?null:(0,R.jsx)(v,{platform:U.platform,className:`size-3.5`}),U.platform===`all`?`All platforms`:U.platform===`ios`?`iOS`:`Android`]}),(0,R.jsx)(h,{variant:`outline`,children:U.channel}),U.appVersion?(0,R.jsxs)(h,{variant:`outline`,children:[`Reports from `,U.appVersion]}):null]})]}),(0,R.jsxs)(j,{"aria-label":`Bundles by app version`,role:`region`,className:`min-w-0`,children:[(0,R.jsxs)(D,{className:`flex flex-col gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(A,{children:`Bundles by app version`}),(0,R.jsxs)(N,{label:`How bundle distribution is counted`,children:[`Each installation counts once, by its latest report`,` `,K,`. Shares are within each app version. Built-in bundle: the bundle the native build shipped, by its ID. Unknown bundle: no deployment and no built-in bundle ID.`]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[W.isPending?(0,R.jsx)(r,{className:`h-9 w-16`}):(0,R.jsx)(`p`,{className:`text-3xl font-semibold tabular-nums`,children:G?`${G.truncated?`≥`:``}${J.toLocaleString()}`:`—`}),(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Reporting installations`})]})]}),(0,R.jsxs)(k,{className:`flex min-w-0 flex-col gap-4`,children:[G?.truncated?(0,R.jsxs)(p,{children:[(0,R.jsx)(m,{children:`Partial history`}),(0,R.jsxs)(_,{children:[`Counts and shares reflect reports since`,` `,new Date(G.sinceMs).toLocaleString(`en`,{timeZone:`UTC`}),` `,`UTC. Choose a shorter period for a more complete view.`]})]}):null,W.isPending?(0,R.jsx)(r,{"aria-label":`Loading bundle distribution`,className:`h-64`}):W.error?(0,R.jsxs)(`div`,{className:`flex flex-col items-start gap-4`,children:[(0,R.jsx)(ie,{error:W.error,fallbackTitle:`Distribution unavailable`}),(0,R.jsx)(e,{variant:`outline`,onClick:()=>void W.refetch(),children:`Retry distribution`})]}):q.length===0?(0,R.jsxs)(d,{children:[(0,R.jsxs)(te,{children:[(0,R.jsx)(ee,{children:`No bundles reported`}),(0,R.jsx)(u,{children:`Choose another version or period, or change the filters in the overview.`})]}),(0,R.jsx)(e,{variant:`outline`,onClick:()=>$({version:void 0}),children:`Show all versions`})]}):(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsxs)(`div`,{"aria-hidden":`true`,className:`hidden grid-cols-[8rem_minmax(0,1fr)_7rem_7rem] gap-4 border-b px-3 pb-3 text-xs text-muted-foreground md:grid`,children:[(0,R.jsx)(`span`,{children:`App version`}),(0,R.jsx)(`span`,{children:`Bundle ID`}),(0,R.jsx)(`span`,{className:`text-right`,children:`Active installations`}),(0,R.jsx)(`span`,{className:`text-right`,children:`Version share`})]}),(0,R.jsx)(`ul`,{"aria-label":`Bundle distribution`,className:`divide-y`,children:q.slice((X-1)*z,X*z).map(e=>{let t=G?.versions.find(t=>t.name===e.appVersion)?.installations??0,n=t>0?e.installations/t*100:0;return(0,R.jsxs)(`li`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 gap-y-3 px-1 py-4 md:grid-cols-[8rem_minmax(0,1fr)_7rem_7rem] md:px-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`truncate text-sm font-medium`,title:e.appVersion,children:e.appVersion}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(v,{platform:e.platform,className:`size-3.5`}),e.platform===`ios`?`iOS`:`Android`]})]}),(0,R.jsxs)(`div`,{className:`col-span-2 row-start-2 min-w-0 md:col-span-1 md:row-auto`,children:[e.releaseId?(0,R.jsxs)(a,{to:`/`,search:{releaseId:e.releaseId},"aria-label":`Review bundle ${e.releaseId} for app version ${e.appVersion}`,className:`flex min-h-11 min-w-0 items-center gap-2 text-xs underline-offset-4 hover:underline md:min-h-9`,children:[(0,R.jsx)(`span`,{className:`break-all font-mono`,children:e.releaseId}),(0,R.jsx)(l,{"aria-hidden":`true`,className:`size-3.5 shrink-0`})]}):e.builtinBundleId?null:(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Unknown bundle`}),e.builtinBundleId?(0,R.jsx)(H,{bundleId:e.builtinBundleId}):null]}),(0,R.jsxs)(`div`,{className:`col-start-2 row-start-1 text-right md:col-auto md:row-auto`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:e.installations.toLocaleString()}),(0,R.jsx)(`span`,{className:`ml-1 text-xs text-muted-foreground md:sr-only`,children:`active`}),(0,R.jsxs)(`p`,{className:`mt-1 text-xs tabular-nums text-muted-foreground md:hidden`,children:[n.toFixed(1),`% of version`]})]}),(0,R.jsxs)(`div`,{className:`hidden flex-col gap-2 md:flex`,children:[(0,R.jsxs)(`span`,{className:`text-right text-sm tabular-nums`,children:[n.toFixed(1),`%`]}),(0,R.jsx)(w,{"aria-label":`${V(e)} share in ${e.appVersion} on ${e.platform}`,value:n})]})]},JSON.stringify([e.appVersion,e.platform,e.releaseId,e.builtinBundleId]))})})]})]}),G&&q.length>0?(0,R.jsxs)(O,{className:`flex flex-wrap items-center justify-between gap-3 border-t pt-4`,children:[(0,R.jsxs)(`p`,{className:`text-xs tabular-nums text-muted-foreground`,children:[(X-1)*z+1,`–`,Math.min(X*z,q.length),` of `,q.length]}),(0,R.jsxs)(`nav`,{"aria-label":`Distribution pages`,className:`flex gap-2`,children:[(0,R.jsx)(e,{variant:`outline`,className:`h-11 sm:h-9`,disabled:X<=1,onClick:()=>$({page:X-1}),children:`Previous`}),(0,R.jsx)(e,{variant:`outline`,className:`h-11 sm:h-9`,disabled:X>=Y,onClick:()=>$({page:X+1}),children:`Next`})]})]}):null]})]})})]})}export{U as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./ConsoleFeatureUnavailable-BH7LLqAg.js";var t=e;export{t as notFoundComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./ConsoleFeatureUnavailable-BH7LLqAg.js";var t=e;export{t as notFoundComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$r as e,Fn as t,Hr as n,In as r,Ln as i,Nn as a,Pn as o,ar as s,ir as c,ni as l}from"./sidebar-RBvHzq8e.js";import{d as u,l as d,u as f}from"./console-features-api-BhUIxeL-.js";import{a as p,c as m,i as h,n as ee,o as g,r as _,s as v,t as y}from"./installations-LJBhFDEM.js";import{E as b,a as x,i as S,l as C,o as te,r as ne,s as re,u as w}from"./preload-helper-D9SUwQT7.js";import{a as T,n as E,o as D,r as O,t as k}from"./EventDetails-3DgVjwDn.js";import{t as ie}from"./arrow-left-BPK7iqvj.js";import{o as A}from"./empty-DtangHOp.js";import{a as j,f as M,t as N}from"./field-bPoDrs6K.js";import{o as P}from"./useCompositeListItem-BxJspDxS.js";import{c as ae,i as oe,n as se,r as ce,s as F,t as le}from"./input-group-_PD0i7wZ.js";import{t as I}from"./refresh-cw-3fSQ1FYY.js";import{a as L,n as R,o as z,r as ue,t as B}from"./card-DKr2pZMA.js";import{a as V,i as H,n as U,o as W,r as G,t as K}from"./table-BYmouPt9.js";import{a as de,f as q,n as fe,r as pe,t as me}from"./InsightsPageHeader-DqCp0vf7.js";function he(){m(u(),!0)}function ge(e){return he(),v(u(),e)}function _e(e){let t=u();return f(t.stores.location,b(e,t))}var ve=s(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),J=l(e(),1),Y=n();function ye({events:e,formatter:t,renderIdentity:n}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`px-4 pb-2 text-xs text-muted-foreground sm:px-6`,children:`Time in your browser zone`}),(0,Y.jsx)(`ol`,{"aria-label":`Events`,className:`divide-y border-y`,children:e.map(e=>(0,Y.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-3 px-4 py-4 sm:px-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-1`,children:[(0,Y.jsx)(O,{event:e}),(0,Y.jsx)(`div`,{className:`text-xs tabular-nums`,children:(0,Y.jsx)(E,{value:e.receivedAtMs,formatter:t,touch:!0})})]}),n?.(e),(0,Y.jsxs)(`dl`,{className:`flex flex-wrap gap-x-2 gap-y-1 text-sm`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`sr-only`,children:`App`}),(0,Y.jsxs)(`dd`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]})]}),(0,Y.jsxs)(`div`,{className:`min-w-0 text-muted-foreground`,children:[(0,Y.jsx)(`dt`,{className:`sr-only`,children:`Channel`}),(0,Y.jsx)(`dd`,{className:`wrap-anywhere`,children:e.channel})]})]}),(0,Y.jsx)(`div`,{className:`text-xs`,"aria-label":`Bundle`,children:(0,Y.jsx)(k,{event:e,touch:!0})})]},e.id))})]})}function X({hasPrevious:e,label:n,nextCursor:r,onNext:i,onPrevious:a,pageLength:o,pageNumber:s}){return(0,Y.jsxs)(`nav`,{"aria-label":`${n} pagination`,className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,Y.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`Page `,s,` · `,o.toLocaleString(),` rows`]}),(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsx)(t,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:!e,onClick:a,size:`sm`,type:`button`,variant:`outline`,children:`Previous`}),(0,Y.jsx)(t,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:r===null,onClick:i,size:`sm`,type:`button`,variant:`outline`,children:`Next`})]})]})}var be=e=>_.filter((t,n)=>n===0||p[t].durationMs<=e*864e5);function xe({event:e,eventsLocation:t,touch:n=!1}){return(0,Y.jsxs)(`div`,{className:n?`flex min-w-0 flex-wrap items-center justify-between gap-2`:`flex min-w-0 flex-col items-start gap-2`,children:[(0,Y.jsxs)(d,{className:r({className:n?`-ml-2 h-auto min-h-11 min-w-0 flex-1 justify-start gap-2 whitespace-normal text-sm`:`-ml-2 max-w-full justify-start`,size:`sm`,variant:`ghost`}),to:`/installations`,search:{...t,query:e.installId||void 0,installId:e.installId},state:e=>({insightsPagination:{eventsBack:e.insightsPagination?.eventsBack}}),"aria-label":`View history for ${e.userId??`anonymous installation`} (${e.installId})`,children:[(0,Y.jsx)(`span`,{className:n?`min-w-0 text-left wrap-anywhere`:`truncate`,children:e.userId??`Anonymous installation`}),(0,Y.jsx)(A,{"aria-hidden":`true`,"data-icon":`inline-end`})]}),(0,Y.jsx)(F,{value:e.installId,maxLength:13,buttonClassName:n?`min-h-11 px-3`:void 0})]})}function Se({children:e,description:n,error:r,eventsLocation:i,history:o,isFetching:s,isLoading:c,onNext:l,onPrevious:u,onRangeChange:d,onRefresh:f,pageNumber:m,range:h,rawDays:ee=90,title:_=`All events`}){let v=D(),y=m>1,b=be(ee),x=h===void 0?void 0:g(h),S=x!==void 0&&b.includes(x)?x:void 0,C=S!==void 0&&d?(0,Y.jsx)(t,{className:`h-11 px-3 lg:h-8`,onClick:()=>d(S),type:`button`,variant:`outline`,children:`Show the last ${p[S].period}`}):null;return(0,Y.jsxs)(B,{className:`@container min-w-0 shadow-sm`,"aria-busy":s,children:[(0,Y.jsxs)(L,{className:`gap-4 p-4 sm:p-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsx)(z,{children:(0,Y.jsx)(`h2`,{children:_})}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[h!==void 0&&d?(0,Y.jsx)(de,{label:`Time range`,onPeriodChange:d,period:h,periods:b.map(e=>({value:e,name:`Last ${p[e].period}`}))}):null,(0,Y.jsxs)(t,{className:`h-11 lg:h-8`,disabled:s,onClick:f,size:`lg`,variant:`outline`,children:[(0,Y.jsx)(I,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]})]})]}),n?(0,Y.jsx)(ue,{children:n}):null]}),e]}),(0,Y.jsx)(R,{className:`min-w-0 p-0`,children:c?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,role:`status`,"aria-label":`Loading events`,children:[(0,Y.jsx)(a,{className:`h-12 w-full`}),(0,Y.jsx)(a,{className:`h-12 w-full`}),(0,Y.jsx)(a,{className:`h-12 w-full`})]}):r?(0,Y.jsx)(`div`,{className:`px-6 pb-6`,children:(0,Y.jsx)(q,{error:r,fallbackTitle:`Event history unavailable`})}):o?(0,Y.jsxs)(Y.Fragment,{children:[o.data.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`@[58rem]:hidden`,children:(0,Y.jsx)(ye,{events:o.data,formatter:v,renderIdentity:e=>(0,Y.jsx)(xe,{event:e,eventsLocation:i,touch:!0})})}),(0,Y.jsx)(`div`,{className:`hidden @[58rem]:block`,children:(0,Y.jsxs)(K,{className:`min-w-4xl table-fixed`,children:[(0,Y.jsx)(V,{children:(0,Y.jsxs)(W,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,Y.jsx)(H,{className:`w-64`,children:`Time`}),(0,Y.jsx)(H,{className:`w-48`,children:`Event`}),(0,Y.jsx)(H,{className:`w-48`,children:`User / installation`}),(0,Y.jsx)(H,{className:`w-32`,children:`App`}),(0,Y.jsx)(H,{className:`w-52`,children:`Bundle`})]})}),(0,Y.jsx)(U,{children:o.data.map(e=>(0,Y.jsxs)(W,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,Y.jsx)(G,{className:`whitespace-normal text-xs tabular-nums`,children:(0,Y.jsx)(E,{value:e.receivedAtMs,formatter:v})}),(0,Y.jsx)(G,{children:(0,Y.jsx)(O,{event:e})}),(0,Y.jsx)(G,{children:(0,Y.jsx)(xe,{event:e,eventsLocation:i})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsx)(k,{event:e})})]},e.id))})]})})]}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:y?`No older events in this range.`:h===void 0?_===`All events`?`No events recorded yet`:`No matching reports in this period`:`No events in the last ${p[h].period}.`}),y?null:C]}),h!==void 0&&o.nextCursor===null&&(o.data.length>0||y)?(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Start of range reached`}),C]}):null,o.data.length>0||y||o.nextCursor?(0,Y.jsx)(X,{hasPrevious:y,label:_,nextCursor:o.nextCursor,onNext:l,onPrevious:u,pageLength:o.data.length,pageNumber:m}):null]}):null})]})}var Ce=e=>e.userId??`—`,we=e=>`lastKnownBundleId`in e?e.lastKnownBundleId:e.type===`UPDATE_DOWNLOADED`||e.type===`UPDATE_FAILED`?e.fromBundleId:e.toBundleId;function Te({error:e,history:n,isLoading:r,onNext:i,onPrevious:s,onRefresh:c,pageNumber:l,retention:u=C,selectedEvent:d,selectedInstallId:f}){let p=D(),m=d?we(d):void 0,h=d&&`pendingBundleId`in d?d.pendingBundleId:d&&`type`in d&&d.type===`UPDATE_DOWNLOADED`?d.toBundleId:null;return(0,Y.jsxs)(B,{className:`@container min-h-0 min-w-0 shadow-sm`,children:[(0,Y.jsx)(L,{className:`p-4 sm:p-6`,children:(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,Y.jsx)(z,{className:`text-sm font-medium`,children:(0,Y.jsx)(`h2`,{children:f===void 0?`Select an installation`:`Installation history`})}),f===void 0?null:(0,Y.jsxs)(ue,{children:[`Bundle changes and update failures are kept for`,` `,w(u.rawDays),`; the latest report, for`,` `,w(u.dailyDays),` after the installation last reports.`]})]}),c&&f!==void 0?(0,Y.jsxs)(t,{className:`h-11 lg:h-8`,size:`lg`,variant:`outline`,onClick:c,disabled:r,children:[(0,Y.jsx)(I,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]}):null]})}),(0,Y.jsxs)(R,{className:`min-h-0 p-0`,children:[f!==void 0&&d?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`section`,{"aria-labelledby":`latest-installation-state`,className:`px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,Y.jsx)(`h3`,{className:`sr-only`,id:`latest-installation-state`,children:`Latest reported state`}),(0,Y.jsxs)(`dl`,{className:`grid grid-cols-2 gap-4 @[36rem]:grid-cols-3`,children:[(0,Y.jsxs)(`div`,{className:`col-span-2 min-w-0 @[36rem]:col-span-1`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`User ID`}),(0,Y.jsx)(`dd`,{className:`mt-1 text-sm font-medium wrap-anywhere`,children:Ce(d)})]}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Install ID`}),(0,Y.jsx)(`dd`,{className:`mt-1 font-mono text-xs`,children:(0,Y.jsx)(F,{value:f,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`})})]}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Last known bundle`}),(0,Y.jsxs)(`dd`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2 font-mono text-xs`,children:[m?(0,Y.jsx)(F,{value:m,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`}):`—`,pe(m,d.minBundleId)?(0,Y.jsx)(fe,{}):null]})]}),h?(0,Y.jsxs)(`div`,{className:`col-span-2 min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Downloaded · Not launched yet`}),(0,Y.jsx)(`dd`,{className:`mt-1 text-xs`,children:(0,Y.jsx)(F,{value:h})})]}):null]}),d.httpResponse?(0,Y.jsx)(`div`,{className:`mt-4`,children:(0,Y.jsx)(T,{event:d})}):null]}),(0,Y.jsx)(o,{})]}):null,f===void 0?null:r?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3 p-6`,role:`status`,"aria-label":`Loading installation history`,children:[(0,Y.jsx)(a,{className:`h-10 w-full`}),(0,Y.jsx)(a,{className:`h-10 w-full`}),(0,Y.jsx)(a,{className:`h-10 w-full`})]}):e?(0,Y.jsx)(`div`,{className:`p-6`,children:(0,Y.jsx)(q,{error:e instanceof Error?e:Error(),fallbackTitle:`Installation history unavailable`})}):n&&n.data.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`@[48rem]:hidden`,children:(0,Y.jsx)(ye,{events:n.data,formatter:p})}),(0,Y.jsx)(`div`,{className:`hidden @[48rem]:block`,children:(0,Y.jsxs)(K,{className:`min-w-3xl table-fixed`,children:[(0,Y.jsx)(V,{children:(0,Y.jsxs)(W,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,Y.jsx)(H,{className:`w-64`,children:`Time`}),(0,Y.jsx)(H,{className:`w-48`,children:`Event`}),(0,Y.jsx)(H,{className:`w-32`,children:`App`}),(0,Y.jsx)(H,{className:`w-52`,children:`Bundle`})]})}),(0,Y.jsx)(U,{children:n.data.map(e=>(0,Y.jsxs)(W,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,Y.jsx)(G,{className:`whitespace-normal text-xs tabular-nums`,children:(0,Y.jsx)(E,{value:e.receivedAtMs,formatter:p})}),(0,Y.jsx)(G,{children:(0,Y.jsx)(O,{event:e})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsx)(k,{event:e})})]},e.id))})]})}),(0,Y.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:n.nextCursor,onNext:i,onPrevious:s,pageLength:n.data.length,pageNumber:l})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:l>1?`No older bundle changes.`:`No bundle changes recorded yet.`}),n&&(l>1||n.nextCursor)?(0,Y.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:n.nextCursor,onNext:i,onPrevious:s,pageLength:0,pageNumber:l}):null]})]})]})}var Ee=e=>e.lastKnownBundleId,De=e=>e.userId??`—`;function Oe({error:e,onNext:n,onPrevious:a,onSelect:o,pageNumber:s,results:c,selectedInstallId:l}){let[u,d]=(0,J.useState)(!1),f=(0,J.useId)(),p=(0,J.useRef)(null),m=!e&&c&&c.data.length>0;return(0,Y.jsxs)(B,{className:`min-h-0 min-w-0 shadow-sm`,children:[(0,Y.jsx)(L,{className:`p-4 sm:px-6`,children:(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:(0,Y.jsx)(z,{className:`text-sm font-medium`,children:(0,Y.jsx)(`h2`,{children:`Matching installations`})})}),(0,Y.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:m?(0,Y.jsx)(t,{"aria-controls":f,"aria-expanded":u,"aria-label":u?`Hide matching installations`:`Show matching installations`,className:`size-11 lg:hidden`,onClick:()=>d(!u),ref:p,size:`icon-lg`,variant:`ghost`,children:(0,Y.jsx)(P,{"aria-hidden":`true`,className:i(u&&`rotate-180`)})}):null})]})}),(0,Y.jsxs)(R,{className:i(`min-h-0 p-0`,m&&!u&&`hidden lg:block`),id:f,children:[e?(0,Y.jsx)(`div`,{className:`p-6`,children:(0,Y.jsx)(q,{error:e instanceof Error?e:Error(),fallbackTitle:`Installation search unavailable`})}):c&&c.data.length>0?(0,Y.jsx)(`ul`,{"aria-label":`Matching installations`,className:`divide-y`,children:c.data.map(e=>{let t=Ee(e),n=e.installId===l;return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{"aria-label":`${De(e)}, install ID ${e.installId}`,"aria-pressed":n,className:`group flex w-full min-w-0 flex-col gap-2 border-l-2 border-transparent px-4 py-4 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/30 aria-pressed:border-primary aria-pressed:bg-muted/60 motion-reduce:transition-none sm:px-6`,onClick:()=>{o(e.installId),d(!1),p.current?.focus()},type:`button`,children:[(0,Y.jsxs)(`span`,{className:`flex w-full min-w-0 items-center justify-between gap-3`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:De(e)}),n?(0,Y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs font-medium text-primary`,children:[(0,Y.jsx)(M,{"aria-hidden":`true`,className:`size-3.5`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Selected`})]}):null]}),(0,Y.jsx)(`span`,{className:`flex flex-wrap items-center gap-2`,children:(0,Y.jsx)(`span`,{className:`font-mono text-xs`,title:e.installId,children:ae(e.installId)})}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Bundle`}),t?(0,Y.jsx)(`span`,{className:`font-mono text-xs`,title:t,children:ae(t)}):(0,Y.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`—`})]})]})},e.installId)})}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 p-4 sm:px-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No matches`}),(0,Y.jsx)(`a`,{className:r({variant:`outline`,className:`h-11 px-3 lg:h-8`}),href:`#installation-history-search`,children:`Edit search`})]}),c&&(c.data.length>0||s>1||c.nextCursor)?(0,Y.jsx)(X,{hasPrevious:s>1,label:`Installation results`,nextCursor:c.nextCursor,onNext:n,onPrevious:a,pageLength:c.data.length,pageNumber:s}):null]})]})}function ke({draftQuery:e,onDraftQueryChange:n,onSubmit:r,onClear:i}){return(0,Y.jsx)(`form`,{"aria-label":`Find installation`,onSubmit:t=>{t.preventDefault(),e.trim()&&r()},role:`search`,children:(0,Y.jsxs)(N,{className:`gap-2`,children:[(0,Y.jsx)(j,{className:`sr-only`,htmlFor:`installation-history-search`,children:`User ID or installation ID`}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Y.jsxs)(le,{className:`h-11 w-auto min-w-0 flex-1 basis-44 lg:h-8`,children:[(0,Y.jsx)(se,{children:(0,Y.jsx)(ve,{"aria-hidden":`true`})}),(0,Y.jsx)(oe,{autoComplete:`off`,className:`h-11 text-base md:text-base lg:h-8 lg:text-xs`,id:`installation-history-search`,maxLength:1024,name:`installation`,onChange:e=>n(e.target.value),placeholder:`User ID or installation ID`,spellCheck:!1,type:`search`,value:e}),e.length>0?(0,Y.jsx)(se,{align:`inline-end`,children:(0,Y.jsx)(ce,{"aria-label":`Clear installation lookup`,className:`size-11 lg:size-5`,onClick:i,size:`icon-xs`,children:(0,Y.jsx)(c,{"aria-hidden":`true`})})}):null]}),(0,Y.jsx)(t,{"aria-label":`Find installation`,className:`h-11 px-3 lg:h-8`,disabled:e.trim().length===0,size:`lg`,type:`submit`,variant:`outline`,children:`Find`})]})]})})}function Ae(){return(0,Y.jsxs)(`div`,{className:`grid items-stretch gap-6 lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`,children:[(0,Y.jsx)(a,{className:`h-64 w-full lg:h-full`}),(0,Y.jsx)(a,{className:`h-64 w-full lg:h-full`})]})}var je=20,Me=50,Z=()=>Date.now(),Q=(e,t)=>[...e,t??``],$=e=>({cursor:e?.at(-1)||void 0,stack:e.slice(0,-1)});function Ne(){let e=y.useSearch(),n=y.useNavigate(),r=re(),[i,a]=(0,J.useState)(e.query??``),[o]=(0,J.useState)(Z),[s]=(0,J.useState)(Z),c=_e({select:e=>e.state.insightsPagination}),l=c?.eventsBack??[],u=c?.searchBack??[],d=c?.historyBack??[],f=e.query?.trim()??``,p=f.length>0,m=e.installId!==void 0,g=p||m,_=e.eventsBefore??o,v=e.eventsRange??`7d`,b=e.historyBefore??s,C=(t,r=!1,i={})=>{n({to:`/installations`,search:{...e,...t},state:e=>({...e,insightsPagination:{...e.insightsPagination,...i}}),replace:r})};(0,J.useEffect)(()=>{a(e.query??``)},[e.query]),(0,J.useEffect)(()=>{e.eventsBefore===void 0&&C({eventsBefore:_},!0)},[_,e.eventsBefore]),(0,J.useEffect)(()=>{m&&e.historyBefore===void 0&&C({historyBefore:b},!0)},[m,b,e.historyBefore]);let T=ne({...h(v,_),cursor:e.eventsCursor,limit:20},!g),E=te({cursor:e.searchCursor,identity:f,limit:je},p);(0,J.useEffect)(()=>{let e=E.data?.data[0]?.installId;!p||m||e===void 0||C({historyBefore:Z(),historyCursor:void 0,installId:e},!0,{historyBack:[]})},[p,m,E.data?.data]);let D=x(e.installId??``,m),O=S({beforeReceivedAtMs:b,cursor:e.historyCursor,installId:e.installId??``,limit:Me},m),k=D.data??E.data?.data.find(({installId:t})=>t===e.installId)??O.data?.data[0],A=g?`installation-history-${e.historyCursor??`first`}`:`all-events-${e.eventsCursor??`first`}`,j=(0,J.useRef)(null),M=ge({id:A,getKey:ee});(0,J.useLayoutEffect)(()=>{!g&&!T.isLoading&&j.current&&(j.current.scrollTop=M?.scrollY??0)},[T.isLoading,g,M?.scrollY,A]);let N=()=>{a(``),C({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:void 0,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})},P=(0,Y.jsx)(ke,{draftQuery:i,onClear:N,onDraftQueryChange:a,onSubmit:()=>{let e=i.trim();if(!e){N();return}C({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:e,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})}});return(0,Y.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,Y.jsx)(me,{view:`events`}),(0,Y.jsx)(`div`,{ref:j,"data-scroll-restoration-id":A,id:`insights-events-scroll`,className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:(0,Y.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-col gap-4 sm:gap-6`,children:[g?(0,Y.jsx)(B,{className:`shadow-sm`,children:(0,Y.jsxs)(R,{className:`flex flex-col gap-3 p-4 sm:p-6`,children:[(0,Y.jsxs)(t,{className:`-ml-2 h-11 self-start lg:h-8`,onClick:N,variant:`ghost`,children:[(0,Y.jsx)(ie,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Back to all events`]}),P]})}):null,g?E.isLoading&&p?(0,Y.jsx)(Ae,{}):(0,Y.jsxs)(`div`,{className:`grid min-h-0 min-w-0 items-stretch gap-4 sm:gap-6 ${p?`lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`:`lg:grid-cols-1`}`,children:[p?(0,Y.jsx)(Oe,{error:E.error,onNext:()=>{E.data?.nextCursor&&C({installId:void 0,searchCursor:E.data.nextCursor},!0,{searchBack:Q(u,e.searchCursor)})},onPrevious:()=>{let e=$(u);C({installId:void 0,searchCursor:e.cursor},!0,{searchBack:e.stack})},onSelect:e=>{C({historyBefore:Z(),historyCursor:void 0,installId:e},!1,{historyBack:[]})},pageNumber:u.length+1,results:E.data,selectedInstallId:e.installId}):null,(0,Y.jsx)(Te,{error:O.error??D.error,history:O.data,isLoading:O.isLoading||D.isLoading,onNext:()=>{O.data?.nextCursor&&C({historyCursor:O.data.nextCursor},!0,{historyBack:Q(d,e.historyCursor)})},onPrevious:()=>{let e=$(d);C({historyCursor:e.cursor},!0,{historyBack:e.stack})},onRefresh:()=>{C({historyBefore:Z(),historyCursor:void 0},!0,{historyBack:[]})},pageNumber:d.length+1,retention:r,selectedEvent:k,selectedInstallId:e.installId})]}):(0,Y.jsx)(Se,{description:`Downloads, launches, crashes, update failures, and other changes to what an installation runs, newest first, kept for ${w(r.rawDays)}. Launches that change nothing aren't listed.`,error:T.error,eventsLocation:{eventsBefore:_,eventsCursor:e.eventsCursor,eventsRange:e.eventsRange},history:T.data,isFetching:T.isFetching,isLoading:T.isLoading,onNext:()=>{T.data?.nextCursor&&C({eventsCursor:T.data.nextCursor},!0,{eventsBack:Q(l,e.eventsCursor)})},onPrevious:()=>{let e=$(l);C({eventsCursor:e.cursor},!0,{eventsBack:e.stack})},onRangeChange:e=>{C({eventsBefore:Z(),eventsCursor:void 0,eventsRange:e},!1,{eventsBack:[]})},onRefresh:()=>{C({eventsBefore:Z(),eventsCursor:void 0},!0,{eventsBack:[]})},pageNumber:l.length+1,range:v,rawDays:r.rawDays,children:P})]})},A)]})}export{Ne as component};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/installations-CstW4tEL.js","assets/ConsoleFeatureUnavailable-BH7LLqAg.js","assets/sidebar-RBvHzq8e.js","assets/console-features-api-BhUIxeL-.js","assets/empty-DtangHOp.js","assets/NotFoundPage-CkgdpWvl.js","assets/installations-DtZj5jk2.js","assets/preload-helper-D9SUwQT7.js","assets/InsightsPageHeader-DqCp0vf7.js","assets/useCompositeListItem-BxJspDxS.js","assets/field-bPoDrs6K.js","assets/card-DKr2pZMA.js","assets/EventDetails-3DgVjwDn.js","assets/input-group-_PD0i7wZ.js","assets/dist-BzWwzt98.js","assets/arrow-left-BPK7iqvj.js","assets/refresh-cw-3fSQ1FYY.js","assets/table-BYmouPt9.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./console-features-api-BhUIxeL-.js";import{C as t,t as n,w as r}from"./preload-helper-D9SUwQT7.js";function i(){try{return sessionStorage}catch{return}}var a=`tsr-scroll-restoration-v1_3`,o=i();function s(){try{return JSON.parse(o?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var c=s(),l=`data-scroll-restoration-id`,u=e=>e.state.__TSR_key||e.href;function d(e){let t=e.getAttribute(l);if(t)return`[${l}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}function f(e,t){let n=c[(t.getKey||u)(e.latestLocation)];if(!n)return;if(t.id)return n[`[${l}="${t.id}"]`];let r=t.getElement?.();if(r)return n[r===window?m:d(r)]}var p=!1,m=`window`;function h(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function g(e){let t=new Set;for(let n of e){if(n===m)continue;let e=h(n);e&&t.add(e)}return t}function _(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||u,s=new Set,l=e=>{let t=c[e]||={};for(let e of s)e===document?t[m]={scrollX,scrollY}:e.isConnected&&(t[d(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,p=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{p||s.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&l(i(e.fromLocation)),s.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,l(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{o?.setItem(a,JSON.stringify(c))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),!r.r&&(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,a=e.options.scrollToTopSelectors,o=r.n,l=r.h,u;if(s.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let d=i(t.toLocation),f=t.fromLocation&&i(t.fromLocation);if(r.e&&f&&f!==d){let e=c[f];if(e){let t=c[d];for(let n in e){if(n===m){if(o)continue}else{let e=h(n);if(!e||o&&a&&(u??=g(a),u.has(e)))continue}t||=c[d]={},t[n]??=e[n]}}}p=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,s=!1;if(o){!e&&a&&(u??=g(a));let t=e&&i&&l,o=r.e?c[d]:void 0;if(o)for(let e in o){let{scrollX:r,scrollY:i}=o[e];if(e===m){if(t)continue;scrollTo({top:i,left:r,behavior:n}),s=!0}else{let t=h(e);t&&(t.scrollLeft=r,t.scrollTop=i,u?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(s||scrollTo(e),u)for(let t of u)t.scrollTo(e)}}!s&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{p=!1}}))}var v=864e5,y={"24h":{period:`24 hours`,durationMs:v},"7d":{period:`7 days`,durationMs:7*v},"30d":{period:`30 days`,durationMs:30*v},"90d":{period:`90 days`,durationMs:90*v}},b=Object.keys(y),x=e=>b[b.indexOf(e)+1],S=(e,t)=>({beforeReceivedAtMs:t,sinceMs:Math.max(0,t-y[e].durationMs)}),C=e=>typeof e==`string`&&e.length>0?e:void 0,w=e=>typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:void 0,T=e=>b.find(t=>t===e);function E(e){let t=D(e.search);return t.query===void 0&&t.installId===void 0?`/installations?eventsBefore=${t.eventsBefore??`new`}&eventsRange=${t.eventsRange??`7d`}&eventsCursor=${t.eventsCursor??`first`}`:e.state.__TSR_key}function D(e){return{query:typeof e.query==`string`?e.query:void 0,installId:typeof e.installId==`string`?e.installId:void 0,eventsCursor:C(e.eventsCursor),eventsBefore:w(e.eventsBefore),eventsRange:T(e.eventsRange),searchCursor:C(e.searchCursor),historyCursor:C(e.historyCursor),historyBefore:w(e.historyBefore)}}var O=r(`/installations`)({beforeLoad:({context:t})=>e(t.queryClient,`insights`),notFoundComponent:t(()=>n(()=>import(`./installations-CstW4tEL.js`),__vite__mapDeps([0,1,2,3,4,5])),`notFoundComponent`),component:t(()=>n(()=>import(`./installations-DtZj5jk2.js`),__vite__mapDeps([6,2,7,3,8,9,10,11,12,4,13,14,15,16,17])),`component`),staticData:{scrollRestorationKey:E},validateSearch:D});export{y as a,_ as c,S as i,E as n,x as o,b as r,f as s,O as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ar as e}from"./sidebar-RBvHzq8e.js";var t=e(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),n=e(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]);export{t as n,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Cr as e,Sr as t,Tr as n}from"./sidebar-RBvHzq8e.js";var r=class extends t{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||i(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(t){let n=()=>{this.#i({type:`continue`})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},i=this.#r=e({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),a=this.state.status===`pending`,o=!i.canStart();try{if(a)n();else{this.#i({type:`pending`,variables:t,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,r);let e=await this.options.onMutate?.(t,r);e!==this.state.context&&this.#i({type:`pending`,context:e,variables:t,isPaused:o})}let e=await i.start();return await this.#n.config.onSuccess?.(e,t,this.state.context,this,r),await this.options.onSuccess?.(e,t,this.state.context,r),await this.#n.config.onSettled?.(e,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(e,null,t,this.state.context,r),this.#i({type:`success`,data:e}),e}catch(e){try{await this.#n.config.onError?.(e,t,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(e,t,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,e,t,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:e}),e}finally{this.#r===i&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),n.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function i(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}export{i as n,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$r as e,Hr as t,Jr as n,Kr as r,Ur as i,ar as a,br as o,cr as s,lr as c,ni as l,nr as u,rr as d,vr as f,xr as p}from"./sidebar-RBvHzq8e.js";import{P as m,R as ee,b as te,d as h,h as g,l as _,u as ne,x as re}from"./console-features-api-BhUIxeL-.js";var v=`__root__`,y=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=v:this.parentRoute||r();let i=n?v:t?.path;i&&i!==`/`&&(i=te(i));let a=t?.id||i,o=n?v:g((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(a??``));i===`__root__`&&(i=`/`);let s=o===`__root__`?`/`:i===void 0?this.parentRoute.fullPath:g(this.parentRoute.fullPath+`/`+i);this._path=i,this._id=o,this._fullPath=s,this._to=re(s)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>n({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},ie=class extends y{constructor(e){super(e)}},ae=class extends f{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:s,isRefetchError:c}=r,l=n.fetchMeta?.fetchMore?.direction,u=s&&l===`forward`,d=i&&l===`forward`,f=s&&l===`backward`,m=i&&l===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:o(t,n.data),hasPreviousPage:p(t,n.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:m,isRefetchError:c&&!u&&!f,isRefetching:a&&!d&&!m}}};function oe(e,t){return c(e,ae,t)}var b=l(e(),1),x=b.use,se=b.useLayoutEffect,S=b.createContext(void 0),ce=b.createContext(void 0),C={};function w(e,t){let n=b.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=ee(n.current,i):i}}function T(e){let t=h(),n=b.useContext(e.from?ce:S),i=e.from??n,a=t.stores.getMatchStore(i),o=w(e,t),s=ne(a,e=>e?o(e):C);if(s!==C)return s;(e.shouldThrow??!0)&&r()}function E(e){return T({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function D(e){let{select:t,...n}=e;return T({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function O(e){return T({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function k(e){return T({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function A(e){let t=h();return b.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function j(e){return T({...e,select:t=>e.select?e.select(t.context):t.context})}var M=t(),N=class extends y{constructor(e){super(e),this.useMatch=e=>T({...e,from:this.id}),this.useRouteContext=e=>j({...e,from:this.id}),this.useSearch=e=>k({...e,from:this.id}),this.useParams=e=>O({...e,from:this.id}),this.useLoaderDeps=e=>D({...e,from:this.id}),this.useLoaderData=e=>E({...e,from:this.id}),this.useNavigate=()=>A({from:this.fullPath}),this.Link=b.forwardRef((e,t)=>(0,M.jsx)(_,{ref:t,from:this.fullPath,...e}))}};function P(e){return new N(e)}function F(){return e=>L(e)}var I=class extends ie{constructor(e){super(e),this.useMatch=e=>T({...e,from:this.id}),this.useRouteContext=e=>j({...e,from:this.id}),this.useSearch=e=>k({...e,from:this.id}),this.useParams=e=>O({...e,from:this.id}),this.useLoaderDeps=e=>D({...e,from:this.id}),this.useLoaderData=e=>E({...e,from:this.id}),this.useNavigate=()=>A({from:this.fullPath}),this.Link=b.forwardRef((e,t)=>(0,M.jsx)(_,{ref:t,from:this.fullPath,...e}))}};function L(e){return new I(e)}function R(e){return e=>{let t=P(e);return t.isRoot=!1,t}}function z(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,o.preload=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(m(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r)if(x)x(a());else throw a();return b.createElement(r,e)};return o.preload=a,o}var B=a(`chart-no-axes-combined`,[[`path`,{d:`M12 16v5`,key:`zza2cw`}],[`path`,{d:`M16 14v7`,key:`1g90b9`}],[`path`,{d:`M20 10v11`,key:`1iqoj0`}],[`path`,{d:`m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15`,key:`1fw8x9`}],[`path`,{d:`M4 18v3`,key:`1yp0dc`}],[`path`,{d:`M8 14v7`,key:`n3cwzv`}]]),V=a(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),H={"24h":{durationMs:864e5,intervalMs:36e5},"7d":{durationMs:7*864e5,intervalMs:6*36e5},"30d":{durationMs:30*864e5,intervalMs:864e5}},U=e=>Math.ceil(e/36e5)*36e5;function W(e){if(!e||e.platform!==`ios`&&e.platform!==`android`||typeof e.channel!=`string`||!e.channel.trim()||e.channel.length>1024||e.releaseId!==void 0&&(typeof e.releaseId!=`string`||!e.releaseId.trim()||e.releaseId.length>36)||(e.window===void 0?e.releaseId===void 0:!Object.hasOwn(H,e.window)))throw Error(`Choose a platform, channel, and time window.`);return e}var G=({failedUpdates:e,downloads:t})=>e+t===0?null:e/(e+t),le=({failedInstallations:e,activeInstallations:t})=>t===0?null:Math.min(1,e/t),ue=e=>e===null?`—`:`${(e*100).toFixed(2)}%`,de={check:`Update check`,download:`Download`,install:`Install`},fe={network:`Network`,http:`HTTP error`,invalid_response:`Invalid response`,hash_mismatch:`Hash mismatch`,signature:`Signature`,patch:`Patch`,extract:`Extract`,storage:`Storage`,unknown:`No reason reported`},K=e=>de[e]??`Unknown stage`,q=e=>fe[e]??`Unknown reason`,J=e=>[...e.httpStatus==null?[]:[`HTTP ${e.httpStatus}`],...e.originCode==null?[]:[e.originCode],...e.transport==null?[]:[e.transport],...e.resource==null?[]:[e.resource]],pe=e=>{let t=e.errorMessage||(e.reason===`unknown`?`The client did not report a detailed cause`:q(e.reason));return[`${K(e.stage)} failed: ${t}`,...J(e)].join(` · `)},me=d({method:`GET`}).middleware([u]).handler(i(`0d1dacdd1e5ee6b100e5c142fb9af03602b6f2c6fe6af79312b36c223d7f8f97`)),he=d({method:`GET`}).middleware([u]).handler(i(`b4388826a9b515fb4d2113270aa8ded1c50ba13d7f07ac2b268c41396e87d0a3`)),Y={rawDays:90,dailyDays:400},ge=e=>`${e.toLocaleString(`en`)} ${e===1?`day`:`days`}`,_e=({dailyDays:e})=>e>=364;d({method:`GET`}).middleware([u]).handler(i(`ff00311d412c8cdfa8ad5b0ba1eb6aa7471d0cc12170e6cc645deb91603d42dd`));var ve=d({method:`GET`}).middleware([u]).handler(i(`d4c50f40701055145f24873dc90f3c55a5494457a6a03a743339b2ac4545eb19`)),ye=d({method:`GET`}).middleware([u]).handler(i(`3c04bc6624be6dfdd80cf96819f9c6d0455e59a7bb4c0374b6afb0162ffd15b0`)),be=d({method:`GET`}).middleware([u]).handler(i(`6726f1ed9eda1f0cb4c1f1ad1023faee435ddcfd0b7c55ef08ca7f2f7f577370`)),xe=d({method:`GET`}).middleware([u]).handler(i(`c6f18db42ac40385dbff247095197ee9f3fd3a97dc914efd368ce0ded1f098c6`)),Se=d({method:`GET`}).middleware([u]).handler(i(`735c501f6d5ea81a445ff2b6b2ea6a1b589e3c6f63a465a881822c80ae71e7d1`)),X=3e4,Z={reportingInstallations:e=>[`insights`,`reporting-installations`,e],events:e=>[`insights`,`events`,e],installations:e=>[`insights`,`installations`,e],installation:e=>[`insights`,`installation`,e],installationEvents:e=>[`insights`,`installation-events`,e]},Ce=(e,t)=>s({queryKey:Z.events(e),queryFn:()=>ve({data:e}),enabled:t,refetchOnWindowFocus:!0,staleTime:X}),we=(e,t)=>s({queryKey:Z.installations(e),queryFn:()=>Se({data:e}),enabled:t&&e.identity.length>0,staleTime:X}),Q=(e,t)=>s({queryKey:Z.installation(e),queryFn:()=>be({data:{installId:e}}),enabled:t&&e.length>0,staleTime:X}),Te=(e,t)=>s({queryKey:Z.installationEvents(e),queryFn:()=>ye({data:e}),enabled:t&&e.installId.length>0,refetchOnWindowFocus:!0,staleTime:X}),Ee=(e,t=!0)=>s({queryKey:[`insights`,`update-failures`,e],queryFn:()=>me({data:W(e)}),enabled:t,refetchOnWindowFocus:!0,staleTime:X}),De=()=>s({queryKey:[`insights`,`retention`],queryFn:()=>xe(),staleTime:1/0}).data??Y,Oe=(e,t)=>oe({queryKey:[`insights`,`failure-reports`,e],queryFn:({pageParam:t})=>he({data:{...e,cursor:t}}),initialPageParam:void 0,getNextPageParam:e=>e.nextCursor??void 0,enabled:t,staleTime:X}),ke=`modulepreload`,Ae=function(e){return`/`+e},$={},je=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Ae(t,n),t in $)return;$[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:ke,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{v as A,z as C,S as D,w as E,x as O,B as S,F as T,K as _,Q as a,H as b,Ee as c,_e as d,le as f,q as g,G as h,Te as i,se as k,Y as l,J as m,Oe as n,we as o,pe as p,Ce as r,De as s,je as t,ge as u,ue as v,R as w,V as x,U as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ar as e}from"./sidebar-RBvHzq8e.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$n as e,$r as t,$t as n,Bn as r,F as i,Fn as a,Gn as o,Gt as s,H as c,Hn as l,Hr as u,Ht as d,I as f,In as p,Jn as m,Jt as h,Kt as g,L as _,Ln as v,M as y,Nn as b,P as x,Pn as S,R as C,U as w,Un as T,Ut as E,Vt as ee,Wn as te,Wt as ne,Xn as re,Yn as ie,Z as ae,Zn as D,_ as oe,_n as se,ar as O,b as ce,ct as k,ei as A,er as le,fn as j,g as ue,gn as de,h as M,ir as N,ni as P,p as fe,qt as F,rn as I,sn as L,sr as R,st as z,un as B,v as pe,vn as me,w as he,y as ge,yn as _e}from"./sidebar-RBvHzq8e.js";import{l as V}from"./console-features-api-BhUIxeL-.js";import{a as H,i as U,l as ve,n as ye,o as W,r as G,s as be,t as xe}from"./alert-dialog-DXxrSU0G.js";import{a as Se,c as Ce,d as we,f as Te,g as Ee,h as De,i as Oe,l as ke,m as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as K,u as Ie}from"./api-BiZP_i-u.js";import{a as Le,c as Re,i as ze,n as Be,r as Ve,s as He,t as Ue}from"./routes-DyZCr794.js";import{a as We,c as Ge,d as Ke,f as qe,i as Je,n as Ye,o as Xe,r as Ze,s as q,t as Qe,u as $e}from"./field-bPoDrs6K.js";import{a as et,i as tt,n as nt,o as rt,r as it}from"./useCompositeListItem-BxJspDxS.js";import{A as at,F as ot,I as st,L as ct,N as lt,O as ut,_ as dt,a as ft,c as pt,h as mt,i as ht,k as gt,l as _t,m as vt,n as yt,o as bt,s as xt,t as St,u as Ct,v as wt}from"./valueToPercent-Ci2-fmWp.js";import{a as Tt,i as Et,l as Dt,n as Ot,o as kt,s as At,t as jt,u as Mt}from"./input-group-_PD0i7wZ.js";import{t as Nt}from"./loader-circle-iTGehfyV.js";import{a as Pt,c as Ft,i as It,n as Lt,o as Rt,r as zt,s as Bt,t as Vt}from"./dialog-DxjO7ofz.js";import{a as Ht,n as Ut,o as Wt,r as Gt,s as Kt,t as qt}from"./card-DKr2pZMA.js";import{n as Jt}from"./dist-BzWwzt98.js";import{c as Yt,d as Xt,f as Zt,h as Qt,l as $t,m as en,o as tn,p as nn,s as rn,u as an}from"./InsightsInfo-NUuLFYqg.js";import{a as on,i as J,n as sn,o as cn,r as Y,t as ln}from"./table-BYmouPt9.js";var un=O(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),dn=O(`circle-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.35 2.69A10 10 0 0 1 21.3 15.65`,key:`1pfsoa`}],[`path`,{d:`M19.08 19.08A10 10 0 1 1 4.92 4.92`,key:`1ablyi`}]]),fn=O(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),pn=O(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),mn=O(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),hn=O(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),gn=O(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),_n=O(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),vn=O(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),X=P(t(),1),Z=u(),yn={production:`bg-green-500/10 text-green-700 dark:text-green-400 border-green-500/20`,dev:`bg-blue-500/10 text-blue-700 dark:text-blue-400 border-blue-500/20`,staging:`bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 border-yellow-500/20`};function bn({channel:e,className:t}){return(0,Z.jsx)(q,{variant:`outline`,className:v(yn[e.toLowerCase()]||`bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20`,t),children:e})}function xn({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(qe,{className:v(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(hn,{className:v(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Z.jsx)(N,{className:v(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}var Sn=A(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),ee=E.prototype;return w.prototype=ee,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){ee[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),Cn=A(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e||={};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],p=f.length,m=0;m<p;m+=1){var h=f[m];h.d&&(c=o?n(t).diff(a,h.d,!0):a.diff(t,h.d,!0));var g=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,g<=h.r||!h.r){g<=1&&m>0&&(h=f[m-1]);var _=d[h.l];s&&(g=s(``+g)),l=typeof _==`string`?_.replace(`%d`,g):_(g,r,h.l,u);break}}if(r)return l;var v=u?d.future:d.past;return typeof v==`function`?v(l):v.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))})),wn=P(Sn(),1),Tn=P(Cn(),1);wn.default.extend(Tn.default);function En({uuid:e,format:t=`relative`}){let n=(0,wn.default)(tn(e));return t===`relative`?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.fromNow()}):t===`absolute`?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)}):(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{className:`text-sm`,children:n.fromNow()}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)})]})}function Dn({panelId:e,bundle:t,bundles:n,loading:r,onDetailClick:i}){let o=M();return(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id:e,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Advanced artifact diagnostics`}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 text-sm sm:items-center`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`Base artifact ID`}),(0,Z.jsx)(ct,{bundleId:t.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(q,{variant:`outline`,children:[n.length,` `,n.length===1?`patch`:`patches`]})]}),r?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(b,{className:`h-10 w-full`}),(0,Z.jsx)(b,{className:`h-10 w-full`})]}):n.length>0?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),o?(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.map(e=>(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Target artifact ID`}),(0,Z.jsx)(ct,{bundleId:e.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Relation`}),(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-1 text-sm`,children:[(0,Z.jsx)(ct,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(Ee,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(ct,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Artifact`}),(0,Z.jsx)(q,{variant:`secondary`,children:`bsdiff`})]}),(0,Z.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Created`}),(0,Z.jsx)(`div`,{className:`text-xs tabular-nums text-foreground`,children:(0,Z.jsx)(En,{uuid:e.id})})]})]}),(0,Z.jsx)(a,{className:`w-full`,onClick:()=>i(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})]})},e.id))}):(0,Z.jsx)(`div`,{className:`overflow-x-auto rounded-md border bg-background`,children:(0,Z.jsxs)(ln,{className:`min-w-max`,children:[(0,Z.jsx)(on,{children:(0,Z.jsxs)(cn,{className:`hover:bg-transparent`,children:[(0,Z.jsx)(J,{children:`Target artifact ID`}),(0,Z.jsx)(J,{children:`Relation`}),(0,Z.jsx)(J,{children:`Artifact`}),(0,Z.jsx)(J,{children:`Created`}),(0,Z.jsx)(J,{className:`w-24 text-right`,children:`Detail`})]})}),(0,Z.jsx)(sn,{children:n.map(e=>(0,Z.jsxs)(cn,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(ct,{bundleId:e.id,fullOnMobile:!0,maxLength:18})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`div`,{className:`flex min-w-[280px] flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[(0,Z.jsx)(ct,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(Ee,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(ct,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(q,{variant:`secondary`,children:`bsdiff`})}),(0,Z.jsx)(Y,{className:`tabular-nums`,children:(0,Z.jsx)(En,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(a,{onClick:()=>i(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})})]},e.id))})]})})]}):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3 text-sm text-muted-foreground`,children:`No direct patch artifacts.`})]})]})})}function On({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[i,o]=(0,X.useState)(null),{data:s=[],isPending:c}=Oe(),l=Me(),u=Fe(),d=n.trim(),f=async e=>{if(e.preventDefault(),!(!d||l.isPending))try{let e=await l.mutateAsync({name:d});r(``),e.inserted?Jt.success(`Channel ${e.row.name} created`):Jt.info(`Channel ${e.row.name} already exists`)}catch(e){Jt.error(`Failed to create channel`),console.error(e)}},p=async()=>{if(!(!i||u.isPending))try{let e=await u.mutateAsync({id:i.id});e.deleted?Jt.success(`Channel ${i.name} deleted`):e.reason===`not_empty`?Jt.error(`Channel ${i.name} is still in use and cannot be deleted`):Jt.error(`Channel ${i.name} no longer exists`),o(null)}catch(e){Jt.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Vt,{open:e,onOpenChange:t,children:(0,Z.jsxs)(Lt,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsxs)(Rt,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(gn,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(zt,{children:`Create deployment channels and remove them when no bundle uses them. Empty channels remain available until you delete them.`})]}),(0,Z.jsx)(`form`,{onSubmit:f,children:(0,Z.jsx)(Je,{className:`gap-2`,children:(0,Z.jsxs)(Qe,{orientation:`horizontal`,children:[(0,Z.jsx)(We,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(ae,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:l.isPending}),(0,Z.jsxs)(a,{type:`submit`,disabled:!d||l.isPending,children:[l.isPending?(0,Z.jsx)(Nt,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(Ft,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,Z.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:c?(0,Z.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,Z.jsx)(Nt,{className:`mr-2 size-3.5 animate-spin`}),`Loading channels`]}):s.length===0?(0,Z.jsx)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:`No channels yet`}):(0,Z.jsx)(`ul`,{className:`divide-y`,children:s.map(e=>(0,Z.jsxs)(`li`,{className:`flex min-h-12 items-center gap-3 px-3 py-2`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`p`,{className:`truncate text-xs font-medium`,children:e.name}),(0,Z.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:e.id})]}),(0,Z.jsx)(a,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:u.isPending,onClick:()=>o(e),className:`text-muted-foreground hover:text-destructive`,children:(0,Z.jsx)(vn,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(xe,{open:i!==null,onOpenChange:e=>{!e&&!u.isPending&&o(null)},children:(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(be,{children:[(0,Z.jsxs)(ve,{children:[`Delete `,i?.name,`?`]}),(0,Z.jsx)(H,{children:`Only empty channels can be removed. The server checks this when you delete it, and the channel can be created again later with a new ID.`})]}),(0,Z.jsxs)(W,{children:[(0,Z.jsx)(G,{disabled:u.isPending,children:`Cancel`}),(0,Z.jsx)(ye,{variant:`destructive`,disabled:u.isPending,onClick:e=>{e.preventDefault(),p()},children:u.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var kn=`[a-zA-Z0-9-]`,An=String.raw`0|[1-9]\d*`,jn=String.raw`\d+`,Mn=String.raw`\d*[a-zA-Z-]${kn}*`,Nn=String.raw`(${An})\.(${An})\.(${An})`,Pn=String.raw`(${jn})\.(${jn})\.(${jn})`,Fn=`(?:${Mn}|${An})`,In=`(?:${Mn}|${jn})`,Ln=String.raw`(?:-(${Fn}(?:\.${Fn})*))`,Rn=String.raw`(?:-?(${In}(?:\.${In})*))`,zn=`${kn}+`,Bn=String.raw`(?:\+(${zn}(?:\.${zn})*))`,Vn=`v?${Nn}${Ln}?${Bn}?`,Hn=String.raw`[v=\s]*${Pn}${Rn}?${Bn}?`,Un=`((?:<|>)?=?)`,Wn=String.raw`${An}|x|X|\*`,Gn=String.raw`${jn}|x|X|\*`,Kn=String.raw`[v=\s]*(${Wn})(?:\.(${Wn})(?:\.(${Wn})(?:${Ln})?${Bn}?)?)?`,qn=String.raw`[v=\s]*(${Gn})(?:\.(${Gn})(?:\.(${Gn})(?:${Rn})?${Bn}?)?)?`,Jn=`(?:~>?)`,Yn=String.raw`(?:\^)`,Xn=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${Xn}(?:$|[^\d])`,String.raw`${Xn}(?:${Ln})?(?:${Bn})?(?:$|[^\d])`;function Zn(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[kn,250]];for(let[n,r]of t)e=e.split(`${n}*`).join(`${n}{0,${r}}`).split(`${n}+`).join(`${n}{1,${r}}`);return e}function Q(e,t){return new RegExp(Zn(e),t)}var Qn=Q(`^${Vn}$`),$n=Q(`^${Hn}$`),er=/^\d+$/;function tr(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function nr(e,t={}){if(typeof e!=`string`)return e;if(e.length>256)throw TypeError(`Version exceeds the maximum length of 256 characters`);let n=e.trim().match(t.loose?$n:Qn);if(!n)throw TypeError(`Invalid version syntax: ${e}`);let r=Number(n[1]),i=Number(n[2]),a=Number(n[3]);if(r>2**53-1||r<0)throw TypeError(`Invalid major version: ${n[1]}`);if(i>2**53-1||i<0)throw TypeError(`Invalid minor version: ${n[2]}`);if(a>2**53-1||a<0)throw TypeError(`Invalid patch version: ${n[3]}`);let o=n[4]?n[4].split(`.`).map(e=>{if(er.test(e)){let t=Number(e);if(t>=0&&t<2**53-1)return t}return e}):void 0;return{build:n[5]?.split(`.`),major:r,minor:i,patch:a,prerelease:o}}var rr=Q(String.raw`^${Un}\s*(${Vn})$|^$`),ir=Q(String.raw`^${Un}\s*(${Hn})$|^$`);function ar(e){return e.version?`${e.operator}${tr(e.version)}`:``}function or(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?ir:rr);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?nr(r[2],t):null;return{operator:i,options:t,value:a?`${i}${tr(a)}`:``,version:a}}function sr(e){return e.sets.map(e=>e.map(ar).join(` `)).join(`||`)}var cr=new RegExp(Bn,`g`),lr=Q(Bn),ur=Q(String.raw`^\s*(${Kn})\s+-\s+(${Kn})\s*$`),dr=Q(String.raw`^\s*(${qn})\s+-\s+(${qn})\s*$`),fr=Q(String.raw`(\s*)${Un}\s*(${Hn}|${Kn})`,`g`),pr=Q(String.raw`(\s*)${Jn}\s+`,`g`),mr=Q(String.raw`(\s*)${Yn}\s+`,`g`),hr=Q(`^${Jn}${Kn}$`),gr=Q(`^${Jn}${qn}$`),_r=Q(`^${Yn}${Kn}$`),vr=Q(`^${Yn}${qn}$`),yr=Q(String.raw`^${Un}\s*${Kn}$`),br=Q(String.raw`^${Un}\s*${qn}$`),xr=Q(String.raw`(<|>)?=?\s*\*`),Sr=/^\s*>=\s*0\.0\.0\s*$/,Cr=/^\s*>=\s*0\.0\.0-0\s*$/,wr=Q(String.raw`^${Un}\s*(${Hn})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Tr(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function Er(e,t){let n=t.loose?gr:hr,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:a?`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`)}function Dr(e,t){return e.trim().split(/\s+/).map(e=>Er(e,t)).join(` `)}function Or(e,t){let n=t.loose?vr:_r,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?t===`0`?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.0${r} <${Number(t)+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${i}-${a} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i}-${a} <${Number(t)+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${i} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${Number(t)+1}.0.0-0`)}function kr(e,t){return e.trim().split(/\s+/).map(e=>Or(e,t)).join(` `)}function Ar(e,t){let n=t.loose?br:yr;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Tr(String(c),l===void 0?void 0:String(l),u===void 0?void 0:String(u)))return e;let d=$(c),f=d||$(l),p=f||$(u);if(s===`=`&&p&&(s=``),d)return s===`>`||s===`<`?`<0.0.0-0`:`*`;let m=t.includePrerelease?`-0`:``;return s&&p?(f&&(l=0),u=0,s===`>`?(s=`>=`,f?(c=Number(c)+1,l=0):l=Number(l)+1):s===`<=`&&(s=`<`,f?c=Number(c)+1:l=Number(l)+1),s===`<`&&(m=`-0`),`${s}${c}.${l}.${u}${m}`):f?`>=${c}.0.0${m} <${Number(c)+1}.0.0-0`:p?`>=${c}.${l}.0${m} <${c}.${Number(l)+1}.0-0`:n})}function jr(e,t){return e.split(/\s+/).map(e=>Ar(e,t)).join(` `)}function Mr(e,t){let n=t.loose?dr:ur;return e.replace(n,(e,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n,m=c;return p=$(r)?``:$(i)?`>=${r}.0.0${t.includePrerelease?`-0`:``}`:$(a)?`>=${r}.${i}.0${t.includePrerelease?`-0`:``}`:o?`>=${p}`:`>=${p}${t.includePrerelease?`-0`:``}`,m=$(l)?``:$(u)?`<${Number(l)+1}.0.0-0`:$(d)?`<${l}.${Number(u)+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:t.includePrerelease?`<${l}.${u}.${Number(d)+1}-0`:`<=${m}`,`${p} ${m}`.trim()})}function Nr(e,t){return jr(Dr(kr(e.replace(lr,``),t),t),t).trim().replace(xr,``)}function Pr(e,t){let n=Mr(e.replace(cr,``),t).replace(fr,`$1$2$3`).replace(pr,`$1~`).replace(mr,`$1^`).split(` `).map(e=>Nr(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Cr:Sr,``));t.loose&&(n=n.filter(e=>wr.test(e)));let r=new Map;for(let e of n.map(e=>or(e,t))){if(e.value===`<0.0.0-0`)return[e];r.set(e.value,e)}return r.size>1&&r.delete(``),[...r.values()]}function Fr(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Pr(e.trim(),n)).filter(e=>e.length);if(!i.length)throw TypeError(`Range contains no valid comparator sets: ${r}`);if(i.length>1){let e=i[0];if(i=i.filter(e=>e[0]?.value!==`<0.0.0-0`),!i.length)i=[e];else if(i.length>1){let e=i.find(e=>e.length===1&&e[0]?.value===``);e&&(i=[e])}}return{options:n,sets:i}}function Ir(e,t={}){try{return Fr(e,t)}catch{return null}}function Lr(e,t={}){let n=Ir(e,t);return n?sr(n)||`*`:null}var Rr=e=>{let t=e.trim();if(t.startsWith(`git@`)){let e=t.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(e)return`https://${e[1]}/${e[2]}`}if(t.startsWith(`ssh://`))try{let e=new URL(t);return`https://${e.hostname}${e.pathname}`.replace(/\/+$/,``).replace(/\.git$/,``)}catch{return t.replace(/\/+$/,``).replace(/\.git$/,``)}return t.replace(/\/+$/,``).replace(/\.git$/,``)},zr=(e,t)=>{if(!e?.trim())return null;let n=Rr(e);try{let{hostname:e}=new URL(n);if(e.includes(`gitlab`))return`${n}/-/commit/${t}`;if(e.includes(`bitbucket`))return`${n}/commits/${t}`}catch{}return`${n}/commit/${t}`};function Br({label:e,value:t}){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-start sm:justify-between sm:gap-4`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,Z.jsx)(`dd`,{className:`min-w-0 text-left text-sm sm:text-right`,children:t})]})}function Vr({bundle:e,release:t}){let{data:n,isFetched:r}=Se(),i=e?Zt(e):null,a=e?Xt(e):null,o=e?.gitCommitHash&&r?zr(n?.console.gitUrl,e.gitCommitHash):null,s=t.strategy===`APP_VERSION`?t.target_app_version:t.fingerprint_hash;return s||e?.gitCommitHash||e?.manifestFileHash||a||i?(0,Z.jsxs)(qt,{children:[(0,Z.jsx)(Ht,{className:`p-4 pb-3`,children:(0,Z.jsx)(Wt,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(Ut,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(Br,{label:t.strategy===`APP_VERSION`?`Target app version`:`Fingerprint target`,value:(0,Z.jsx)(`span`,{className:`break-all font-mono text-xs`,translate:`no`,children:s??`—`})}),e?.gitCommitHash?(0,Z.jsx)(Br,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(At,{className:o?`text-primary`:void 0,maxLength:12,value:e.gitCommitHash}),o?(0,Z.jsx)(`a`,{"aria-label":`Open git commit`,className:`shrink-0 text-primary hover:underline`,href:o,rel:`noopener noreferrer`,target:`_blank`,children:(0,Z.jsx)(fn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(Br,{label:`Manifest hash`,value:(0,Z.jsx)(At,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(Br,{label:`Base hash`,value:(0,Z.jsx)(At,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(Br,{label:`Patch hash`,value:(0,Z.jsx)(At,{maxLength:16,value:i})}):null]})})]}):null}var Hr=Array.from({length:Yt},(e,t)=>t+1);function Ur({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=Qt(t),i=n??[],o=i.length>0,s=r>0&&r<1e3,c=r===Yt,l=M(),u=c?Hr:s?Hr.filter(t=>$t(e,t)<r):[],d=(r/10).toFixed(1),f=c?Yt:u.length,p=Yt-f,m=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,Z.jsx)(qt,{children:(0,Z.jsxs)(Ht,{className:`p-4`,children:[(0,Z.jsx)(Gt,{children:`Selected cohorts`}),(0,Z.jsx)(Wt,{className:`font-mono text-2xl tabular-nums`,children:f})]})}),(0,Z.jsx)(qt,{children:(0,Z.jsxs)(Ht,{className:`p-4`,children:[(0,Z.jsx)(Gt,{children:`Excluded cohorts`}),(0,Z.jsx)(Wt,{className:`font-mono text-2xl tabular-nums`,children:p})]})})]}),o?(0,Z.jsxs)(qt,{children:[(0,Z.jsxs)(Ht,{className:`p-4 pb-3`,children:[(0,Z.jsx)(Wt,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(Gt,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(Ut,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-lg border bg-muted/20 p-3`,children:i.map(e=>(0,Z.jsx)(q,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Z.jsxs)(qt,{children:[(0,Z.jsx)(Ht,{className:`p-4 pb-3`,children:(0,Z.jsx)(Wt,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(Ut,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`max-h-[50vh] overflow-y-auto overscroll-contain rounded-lg border bg-muted/20 p-3 sm:max-h-[45vh]`,children:u.length>0?(0,Z.jsx)(`div`,{"aria-label":`Included numeric cohorts`,className:`grid grid-cols-3 gap-2 sm:grid-cols-6 lg:grid-cols-8`,role:`list`,children:u.map(e=>(0,Z.jsx)(q,{className:`justify-center font-mono tabular-nums`,role:`listitem`,variant:`outline`,children:e},e))}):(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No numeric cohorts are included.`})})})]})]});return(0,Z.jsxs)(Vt,{children:[(0,Z.jsxs)(Bt,{render:(0,Z.jsx)(a,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(et,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(Lt,{className:l?`top-0 left-0 h-dvh max-w-none translate-x-0 translate-y-0 rounded-none border-0 p-0`:`sm:max-w-3xl`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,Z.jsxs)(Pt,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(Rt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(zt,{children:[d,`% includes `,f,` of`,` `,Yt,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain px-4 py-4`,children:m}),(0,Z.jsx)(It,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Rt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(zt,{children:[d,`% includes `,f,` of`,` `,Yt,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),m,(0,Z.jsx)(It,{showCloseButton:!0})]})})]})}function Wr(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Gr(e,t){return e-t}function Kr(e,t,n){let r=e.slice();return r[t]=n,r.sort(Gr)}function qr(e,t,n,r,i,a){let o=e;return o=dt(o,n,r),i&&(o=Kr(a,t,dt(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function Jr(e,t,n){if(!Array.isArray(e))return!0;let r=e.reduce((e,t,n,r)=>(n===r.length-1||e.push(Math.abs(t-r[n+1])),e),[]);return Math.min(...r)>=t*n}var Yr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...ot},Xr=X.createContext(void 0);function Zr(){let e=X.useContext(Xr);if(e===void 0)throw Error(m(62));return e}function Qr(e){return`key`in e?L:I}function $r(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?Wr(e,t):!1}var ei=X.forwardRef(function(e,t){let{"aria-labelledby":n,className:i,defaultValue:a,disabled:o=!1,id:c,format:l,largeStep:u=10,locale:d,render:f,max:p=100,min:m=0,minStepsBetweenValues:g=0,form:_,name:v,onValueChange:y,onValueCommitted:b,orientation:x=`horizontal`,step:S=1,thumbCollisionBehavior:C=`push`,thumbAlignment:w=`center`,value:T,style:ee,...te}=e,ne=k(c),ie=vt(ne),ae=D(y),oe=D(b),{clearErrors:O}=wt(),{state:ce,disabled:A,name:le,setTouched:j,setDirty:ue,validityData:de,shouldValidateOnChange:M,validation:N}=lt(),{labelId:P}=gt(),[fe,I]=X.useState(),L=n??mt(P,fe),R=A||o,z=le??v,[B,pe]=tt({controlled:T,default:a??m,name:`Slider`}),ge=X.useRef(null),_e=X.useRef(null),V=X.useRef([]),H=X.useRef(null),U=X.useRef(null),ve=X.useRef(-1),ye=X.useRef(null),W=X.useRef(null),G=X.useRef(`none`),be=s(l),[xe,Se]=X.useState(-1),[Ce,we]=X.useState(-1),[Te,Ee]=X.useState(!1),[De,Oe]=X.useState(()=>new Map),[ke,Ae]=X.useState([void 0,void 0]),je=D(e=>{Se(e),e!==-1&&we(e)});at(_e,ne,B),he(B,()=>{O(z),M()?N.commit(B):N.commit(B,!0);let e=de.initialValue,t;t=Array.isArray(B)&&Array.isArray(e)?!Wr(B,e):B!==e,ue(t)});let Me=D(e=>{e&&(_e.current=e)}),Ne=Array.isArray(B),Pe=X.useMemo(()=>Ne?B.slice().sort(Gr):[dt(B,m,p)],[p,m,Ne,B]),Fe=D((e,t)=>{if(Number.isNaN(e)||$r(e,B))return;let n=t??F(`none`,void 0,void 0,{activeThumbIndex:-1});G.current=n.reason;let r=n.event,i=new(r.constructor??Event)(r.type,r);Object.defineProperty(i,`target`,{writable:!0,value:{value:e,name:z}}),n.event=i,W.current=e,ae(e,n),!n.isCanceled&&pe(e)}),K=D((e,t,n)=>{let r=qr(e,t,m,p,Ne,Pe);if(Jr(r,S,g)){let e=Qr(n);Fe(r,F(e,n.nativeEvent,void 0,{activeThumbIndex:t})),j(!0),oe(W.current??r,h(e,n.nativeEvent))}});re(()=>{let e=se(E(ge.current));R&&me(ge.current,e)&&e.blur()},[R]),R&&xe!==-1&&je(-1);let Ie=X.useMemo(()=>({...ce,activeThumbIndex:xe,disabled:R,dragging:Te,orientation:x,max:p,min:m,minStepsBetweenValues:g,step:S,values:Pe}),[ce,xe,R,Te,p,m,g,x,S,Pe]),Le=X.useMemo(()=>({active:xe,controlRef:_e,disabled:R,dragging:Te,validation:N,formatOptionsRef:be,handleInputChange:K,indicatorPosition:ke,inset:w!==`center`,labelId:L,rootLabelId:ie,largeStep:u,lastUsedThumbIndex:Ce,lastChangedValueRef:W,lastChangeReasonRef:G,form:_,locale:d,max:p,min:m,minStepsBetweenValues:g,name:z,onValueCommitted:oe,orientation:x,pressedInputRef:H,pressedThumbCenterOffsetRef:U,pressedThumbIndexRef:ve,pressedValuesRef:ye,registerFieldControlRef:Me,renderBeforeHydration:w===`edge`,setActive:je,setDragging:Ee,setIndicatorPosition:Ae,setLabelId:I,setValue:Fe,state:Ie,step:S,thumbCollisionBehavior:C,thumbMap:De,thumbRefs:V,values:Pe}),[xe,_e,L,ie,R,Te,N,be,K,ke,u,Ce,W,G,_,d,p,m,g,z,oe,x,H,U,ve,ye,Me,je,Ee,Ae,I,Fe,Ie,S,C,w,De,V,Pe]),Re=r(`div`,e,{state:Ie,ref:[t,ge],props:[{"aria-labelledby":L,id:ne,role:`group`},N.getValidationProps,te],stateAttributesMapping:Yr});return(0,Z.jsx)(Xr.Provider,{value:Le,children:(0,Z.jsx)(it,{elementsRef:V,onMapChange:Oe,children:Re})})});function ti(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function ni(e){if(e===0)return 0;if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function ri(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(ni(t),ni(n))))}function ii({values:e,index:t,nextValue:n,min:r,max:i,step:a,minStepsBetweenValues:o,initialValues:s}){if(e.length===0)return[];let c=e.slice(),l=a*o,u=c.length-1,d=s??e;c[t]=dt(n,r+t*l,i-(u-t)*l);for(let e=t+1;e<=u;e+=1){let t=c[e-1]+l,n=i-(u-e)*l,r=d[e]??c[e],a=Math.max(c[e],t);r<a&&(a=Math.max(r,t)),c[e]=dt(a,t,n)}for(let e=t-1;e>=0;--e){let t=c[e+1]-l,n=r+e*l,i=d[e]??c[e],a=Math.min(c[e],t);i>a&&(a=Math.min(i,t)),c[e]=dt(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function ai({behavior:e,values:t,currentValues:n,initialValues:r,pressedIndex:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}){let u=n??t,d=r??t;if(!(u.length>1))return{value:a,thumbIndex:0,didSwap:!1};let f=c*l;switch(e){case`swap`:{let e=u[i],t=1e-7,n=u.slice(),r=n[i-1],p=n[i+1],m=dt(a,r==null?o:r+f,p==null?s:p-f),h=Number(m.toFixed(12));n[i]=h;let g=a>e,_=a<e,v=g&&p!=null&&a>=p-t,y=_&&r!=null&&a<=r+t;if(!v&&!y)return{value:n,thumbIndex:i,didSwap:!1};let b=v?i+1:i-1,x=n.map((e,t)=>t===i?h:d[t]??u[t]),S=a;S=v?Math.max(a,n[b]):Math.min(a,n[b]);let C=ii({values:n,index:b,nextValue:S,min:o,max:s,step:c,minStepsBetweenValues:l,initialValues:x}),w=v?b-1:b+1;if(w>=0&&w<C.length){let e=C[w-1],t=C[w+1],n=e==null?o:e+f;n=Math.max(n,o+w*f);let r=t==null?s:t-f;r=Math.min(r,s-(C.length-1-w)*f);let i=dt(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:ii({values:u,index:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}),thumbIndex:i,didSwap:!1};default:{let e=u.slice(),t=e[i-1],n=e[i+1],r=dt(a,t==null?o:t+f,n==null?s:n-f);return e[i]=Number(r.toFixed(12)),{value:e,thumbIndex:i,didSwap:!1}}}}var oi=2;function si(e,t){if(!e)return{start:0,end:0};function n(e){let t=e==null?0:parseFloat(e);return Number.isNaN(t)?0:t}let r=t?`Top`:`InlineStart`,i=t?`Bottom`:`InlineEnd`;return{start:n(e[`border${r}Width`])+n(e[`padding${r}`]),end:n(e[`border${i}Width`])+n(e[`padding${i}`])}}function ci(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return null}return{x:e.clientX,y:e.clientY}}var li=X.forwardRef(function(t,i){let{render:a,className:o,style:c,...l}=t,{disabled:u,dragging:d,inset:f,lastChangedValueRef:p,lastChangeReasonRef:m,max:_,min:v,minStepsBetweenValues:y,onValueCommitted:b,orientation:x,pressedInputRef:S,pressedThumbCenterOffsetRef:C,pressedThumbIndexRef:w,pressedValuesRef:T,registerFieldControlRef:ee,renderBeforeHydration:te,setActive:re,setDragging:ie,setValue:ae,state:oe,step:O,thumbCollisionBehavior:ce,thumbRefs:k,values:A}=Zr(),ue=z(),de=A.length>1,M=x===`vertical`,N=X.useRef(null),P=X.useRef(null),fe=D(t=>{t&&P.current==null&&(P.current=e(t).getComputedStyle(t))}),I=X.useRef(null),L=X.useRef(0),R=X.useRef(0),B=s(A);function pe(e){w.current!==e&&(w.current=e);let t=k.current[e];if(!t){C.current=null,S.current=null;return}S.current=t.querySelector(`input[type="range"]`)}function he(e){let t=N.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=si(P.current,M),c=R.current,l=(M?r:n)-s.start-s.end-c*2,u=C.current??0,d=e.x-u,f=e.y-u,p=dt(((M?i-f-s.end:(ue===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(_-v)*p+v;if(m=ri(m,O,v),m=dt(m,v,_),!de)return{value:m,thumbIndex:0,didSwap:!1};let h=w.current;if(h<0)return null;let g=ai({behavior:ce,values:A,currentValues:B.current??A,initialValues:T.current,pressedIndex:h,nextValue:m,min:v,max:_,step:O,minStepsBetweenValues:y});return ce===`swap`&&g.didSwap?pe(g.thumbIndex):w.current=g.thumbIndex,g}function ge(e){T.current=de?A.slice():null,B.current=A;let t=w.current,n=t;if(t>-1&&t<A.length){if(A[t]===_){let e=t;for(;e>0&&A[e-1]===_;)--e;n=e}}else{let t=M?`y`:`x`,r;n=-1;for(let i=0;i<k.current.length;i+=1){let a=k.current[i];if(le(a)){let o=ti(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&pe(n),f){let e=k.current[n];le(e)&&(R.current=e.getBoundingClientRect()[M?`height`:`width`]/2)}}function V(e){let t=k.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let H=D(e=>{let t=ci(e,I);if(t==null)return;if(L.current+=1,e.type===`pointermove`&&e.buttons===0){U(e);return}let r=he(t);r!=null&&Jr(r.value,O,y)&&(!d&&L.current>oi&&ie(!0),ae(r.value,F(n,e,void 0,{activeThumbIndex:r.thumbIndex})),B.current=Array.isArray(r.value)?r.value:[r.value],r.didSwap&&V(r.thumbIndex))});function U(e){re(-1),ie(!1),S.current=null,C.current=null;let t=ci(e,I),n=t==null?null:he(t);if(n!=null){let t=m.current;b(p.current??n.value,h(t,e))}`pointerType`in e&&N.current?.hasPointerCapture(e.pointerId)&&N.current?.releasePointerCapture(e.pointerId),w.current=-1,I.current=null,T.current=null,ye()}let ve=D(e=>{if(u)return;let t=e.changedTouches[0];t!=null&&(I.current=t.identifier);let n=ci(e,I);if(n!=null){ge(n);let t=he(n);if(t==null)return;V(t.thumbIndex),ae(t.value,F(j,e,void 0,{activeThumbIndex:t.thumbIndex})),B.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&V(t.thumbIndex)}L.current=0;let r=E(N.current);r.addEventListener(`touchmove`,H,{passive:!0}),r.addEventListener(`touchend`,U,{passive:!0})}),ye=D(()=>{let e=E(N.current);e.removeEventListener(`pointermove`,H),e.removeEventListener(`pointerup`,U),e.removeEventListener(`touchmove`,H),e.removeEventListener(`touchend`,U),T.current=null}),W=ne();return X.useEffect(()=>{let e=N.current;if(!e)return()=>ye();let t=g(e,`touchstart`,ve,{passive:!0});return()=>{t(),W.cancel(),ye()}},[ye,ve,N,W]),X.useEffect(()=>{u&&ye()},[u,ye]),r(`div`,t,{state:oe,ref:[i,ee,N,fe],props:[{"data-base-ui-slider-control":te?``:void 0,onPointerDown(e){let t=N.current,n=_e(e.nativeEvent);if(!t||u||e.defaultPrevented||!le(n)||e.button!==0)return;let r=ci(e,I);if(r!=null){ge(r);let n=he(r);if(n==null)return;me(k.current[n.thumbIndex],se(E(t)))?e.preventDefault():W.request(()=>{V(n.thumbIndex)}),ie(!0),C.current??(ae(n.value,F(j,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),B.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&V(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),L.current=0;let i=E(N.current);i.addEventListener(`pointermove`,H,{passive:!0}),i.addEventListener(`pointerup`,U,{once:!0})}},l],stateAttributesMapping:Yr})}),ui=X.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,{state:s}=Zr();return r(`div`,e,{state:s,ref:t,props:[{style:{position:`relative`}},o],stateAttributesMapping:Yr})}),di=R();function fi(){return T}function pi(){return!1}function mi(){return!0}function hi(){return(0,di.useSyncExternalStore)(fi,pi,mi)}var gi=function(e){return e.index=`data-index`,e.dragging=`data-dragging`,e.orientation=`data-orientation`,e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.focused=`data-focused`,e}({}),_i=new Set([..._,w,c]);function vi(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${yt(e[t],r,n)} start range`:`${yt(e[t],r,n)} end range`:n?yt(e[t],r,n):void 0}function yi(e,t,n,r,i){let a=n===1?e+t:e-t;return dt(Number(a.toFixed(Math.max(ni(e),ni(t),ni(r)))),r,i)}var bi=X.forwardRef(function(t,n){let{render:a,children:o,className:s,"aria-describedby":l,"aria-label":u,"aria-labelledby":d,disabled:p=!1,getAriaLabel:m,getAriaValueText:h,id:g,index:v,inputRef:b,onBlur:S,onFocus:T,onKeyDown:E,tabIndex:ne,style:ae,...oe}=t,{nonce:se}=Ct(),O=k(g),{active:ce,lastUsedThumbIndex:A,controlRef:le,disabled:j,validation:ue,formatOptionsRef:M,handleInputChange:N,inset:P,labelId:fe,largeStep:F,locale:I,max:L,min:R,minStepsBetweenValues:B,form:pe,name:me,orientation:he,pressedInputRef:ge,pressedThumbCenterOffsetRef:_e,pressedThumbIndexRef:V,renderBeforeHydration:H,setActive:U,setIndicatorPosition:ve,state:ye,step:W,values:G}=Zr(),be=z(),xe=p||j,Se=G.length>1,Ce=he===`vertical`,we=be===`rtl`,{setTouched:Te,setFocused:Ee,validationMode:De}=lt(),Oe=X.useRef(null),ke=X.useRef(null),Ae=X.useRef(!1),je=k(),Me=ut(),Ne=Se?je:Me,{ref:Pe,index:Fe}=nt({metadata:X.useMemo(()=>({inputId:Ne}),[Ne])}),K=Se?v??Fe:0,Ie=K===G.length-1,Le=G[K],Re=St(Le,R,L),[ze,Be]=X.useState(),Ve=hi(),He=A>=0&&A<G.length?A:-1,Ue=D(()=>{let e=le.current,t=Oe.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Ce?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Re/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Be(s),K===0?ve(e=>[s,e[1]]):Ie&&ve(e=>[e[0],s])});re(()=>{P&&queueMicrotask(Ue)},[Ue,P]),re(()=>{P&&Ue()},[Ue,P,Re]),re(()=>{if(!P)return;let t=le.current,n=Oe.current;if(!t||!n)return;let r=e(t).ResizeObserver;if(typeof r!=`function`)return;let i=new r(Ue);return i.observe(t),i.observe(n),()=>{i.disconnect()}},[le,Ue,P]);let We=Ce?`bottom`:`insetInlineStart`,Ge=Ce?`left`:`top`,Ke;Se?ce===K?Ke=2:He===K&&(Ke=1):ce===K&&(Ke=1);let qe;qe=P?{"--position":`${ze??0}%`,visibility:H&&Ve||ze===void 0?`hidden`:void 0,position:`absolute`,[We]:`var(--position)`,[Ge]:`50%`,translate:`${(Ce||!we?-1:1)*50}% ${(Ce?1:-1)*50}%`,zIndex:Ke}:Number.isFinite(Re)?{position:`absolute`,[We]:`${Re}%`,[Ge]:`50%`,translate:`${(Ce||!we?-1:1)*50}% ${(Ce?1:-1)*50}%`,zIndex:Ke}:ee;let Je;he===`vertical`&&(Je=we?`vertical-rl`:`vertical-lr`);let Ye=typeof m==`function`?m(K):u,Xe=ie({"aria-label":Ye,"aria-labelledby":d??(Ye==null?fe:void 0),"aria-describedby":l,"aria-orientation":he,"aria-valuenow":Le,"aria-valuetext":typeof h==`function`?h(yt(Le,I,M.current??void 0),Le,K):vi(G,K,M.current??void 0,I),disabled:xe,form:pe,id:Ne,max:L,min:R,name:me,onChange(e){N(e.currentTarget.valueAsNumber,K,e)},onFocus(e){let t=Ae.current;Ae.current=!1,U(K),Ee(!0),t&&e.stopPropagation()},onBlur(e){if(Ae.current){e.stopPropagation();return}Oe.current&&(U(-1),Te(!0),Ee(!1),De===`onBlur`&&ue.commit(qr(Le,K,R,L,Se,G)))},onKeyDown(e){if(!_i.has(e.key))return;_.has(e.key)&&e.stopPropagation();let t=null,n=ri(Le,W,R);switch(e.key){case f:t=yi(n,e.shiftKey?F:W,1,R,L);break;case i:t=yi(n,e.shiftKey?F:W,we?-1:1,R,L);break;case y:t=yi(n,e.shiftKey?F:W,-1,R,L);break;case x:t=yi(n,e.shiftKey?F:W,we?1:-1,R,L);break;case w:t=yi(n,F,1,R,L);break;case c:t=yi(n,F,-1,R,L);break;case`End`:t=L,Se&&(t=Number.isFinite(G[K+1])?G[K+1]-W*B:L);break;case C:t=R,Se&&(t=Number.isFinite(G[K-1])?G[K-1]+W*B:R);break;default:break}if(t!==null){let n=e.currentTarget;de(n)||(Ae.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),N(t,K,e),e.preventDefault()}},step:W,style:{...ee,width:`100%`,height:`100%`,writingMode:Je},tabIndex:ne??void 0,type:`range`,value:Le??``},ue.getInputValidationProps),Ze=te(ke,ue.inputRef,b);return r(`div`,t,{state:ye,ref:[n,Pe,Oe],props:[{[gi.index]:K,children:(0,Z.jsxs)(X.Fragment,{children:[o,(0,Z.jsx)(`input`,{ref:Ze,...Xe,suppressHydrationWarning:!0}),P&&Ve&&H&&Ie&&(0,Z.jsx)(`script`,{nonce:se,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();'},suppressHydrationWarning:!0})]}),id:O,onBlur:S,onFocus:T,onPointerDown(e){if(V.current=K,Oe.current!=null){let t=he===`horizontal`?`x`:`y`,n=ti(Oe.current);_e.current=(he===`horizontal`?e.clientX:e.clientY)-n[t]}ke.current!=null&&ge.current!==ke.current&&(ge.current=ke.current)},style:qe,suppressHydrationWarning:H||void 0},oe],stateAttributesMapping:Yr})});function xi(e,t,n,r,i,a){let o=n===void 0||t&&r===void 0?`hidden`:void 0,s=e?`bottom`:`insetInlineStart`,c=e?`height`:`width`,l={visibility:i&&a?`hidden`:o,position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};return l[`--start-position`]=`${n??0}%`,t?(l[`--relative-size`]=`${(r??0)-(n??0)}%`,l[s]=`var(--start-position)`,l[c]=`var(--relative-size)`,l):(l[s]=0,l[c]=`var(--start-position)`,l)}function Si(e,t,n,r){let i=e?`bottom`:`insetInlineStart`,a=e?`height`:`width`,o={position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};if(!t)return o[i]=0,o[a]=`${n}%`,o;let s=r-n;return o[i]=`${n}%`,o[a]=`${s}%`,o}var Ci=X.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,{indicatorPosition:s,inset:c,max:l,min:u,orientation:d,renderBeforeHydration:f,state:p,values:m}=Zr(),h=hi(),g=d===`vertical`,_=m.length>1,v=c?xi(g,_,s[0],s[1],f,h):Si(g,_,St(m[0],u,l),St(m[m.length-1],u,l));return r(`div`,e,{state:p,ref:t,props:[{"data-base-ui-slider-indicator":f?``:void 0,style:v,suppressHydrationWarning:f||void 0},o],stateAttributesMapping:Yr})});function wi({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...a}){let o=Array.isArray(n)?n:n===void 0?Array.isArray(t)?t:t===void 0?[r]:[t]:[n];return(0,Z.jsx)(ei,{className:v(`data-horizontal:w-full data-vertical:h-full`,e),"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,thumbAlignment:`edge`,...a,children:(0,Z.jsxs)(li,{className:`relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col`,children:[(0,Z.jsx)(ui,{"data-slot":`slider-track`,className:`relative grow overflow-hidden rounded-full bg-primary/20 select-none data-horizontal:h-1.5 data-horizontal:w-full data-vertical:h-full data-vertical:w-1.5`,children:(0,Z.jsx)(Ci,{"data-slot":`slider-range`,className:`bg-primary select-none data-horizontal:h-full data-vertical:w-full`})}),Array.from({length:o.length},(e,t)=>(0,Z.jsx)(bi,{"data-slot":`slider-thumb`,className:`relative block size-4 shrink-0 rounded-full border border-primary/50 bg-background shadow transition-colors select-none after:absolute after:-inset-2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-disabled:pointer-events-none data-disabled:opacity-50`},t))]})})}var Ti=X.createContext(void 0);function Ei(){let e=X.useContext(Ti);if(e===void 0)throw Error(m(63));return e}var Di=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),Oi={...ot,checked(e){return e?{[Di.checked]:``}:{[Di.unchecked]:``}}};function ki(e,t,n,r=!0,i){let[a,o]=X.useState(),s=k(i?`${i}-label`:void 0),c=e??t??a;return re(()=>{let i=e||t||!r?void 0:Ai(n.current,s);a!==i&&o(i)}),c}function Ai(e,t){let n=ji(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function ji(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var Mi=X.forwardRef(function(t,n){let{checked:i,className:a,defaultChecked:s,"aria-labelledby":c,form:u,id:f,inputRef:p,name:m,nativeButton:h=!1,onCheckedChange:g,readOnly:_=!1,required:v=!1,disabled:y=!1,render:b,uncheckedValue:x,value:S,style:C,...w}=t,{clearErrors:T}=wt(),{state:E,setTouched:ne,setDirty:ae,validityData:D,setFilled:oe,setFocused:se,shouldValidateOnChange:O,validationMode:ce,disabled:A,name:le,validation:j}=lt(),{labelId:ue}=gt(),de=A||y,M=le??m,N=X.useRef(null),P=te(N,p,j.inputRef),fe=X.useRef(null),I=k(),L=ut({id:f,implicit:!1,controlRef:fe}),R=h?void 0:L,[z,pe]=tt({controlled:i,default:!!s,name:`Switch`,state:`checked`});at(fe,I,z),re(()=>{N.current&&oe(N.current.checked)},[N,oe]),he(z,()=>{T(M),ae(z!==D.initialValue),oe(z),O()?j.commit(z):j.commit(z,!0)});let{getButtonProps:me,buttonRef:ge}=o({disabled:de,native:h}),_e=ki(c,ue,N,!h,R),V={id:h?L:I,role:`switch`,"aria-checked":z,"aria-readonly":_||void 0,"aria-required":v||void 0,"aria-labelledby":_e,onFocus(){de||se(!0)},onBlur(){let e=N.current;!e||de||(ne(!0),se(!1),ce===`onBlur`&&j.commit(e.checked))},onClick(t){if(_||de)return;t.preventDefault();let n=N.current;n&&n.dispatchEvent(new(e(n)).PointerEvent(`click`,{bubbles:!0,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}},H=ie({checked:z,disabled:de,form:u,id:R,name:M,required:v,style:M?d:ee,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:P,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(_){e.preventDefault();return}let t=e.currentTarget.checked,n=F(B,e.nativeEvent);g?.(t,n),!n.isCanceled&&pe(t)},onFocus(){fe.current?.focus()}},j.getInputValidationProps,S===void 0?l:{value:S}),U=X.useMemo(()=>({...E,checked:z,disabled:de,readOnly:_,required:v}),[E,z,de,_,v]),ve=r(`span`,t,{state:U,ref:[n,fe,ge],props:[V,j.getValidationProps,w,me],stateAttributesMapping:Oi});return(0,Z.jsxs)(Ti.Provider,{value:U,children:[ve,!z&&M&&x!==void 0&&(0,Z.jsx)(`input`,{type:`hidden`,form:u,name:M,value:x}),(0,Z.jsx)(`input`,{...H,suppressHydrationWarning:!0})]})}),Ni=X.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e;return r(`span`,e,{state:Ei(),ref:t,stateAttributesMapping:Oi,props:o})});function Pi({className:e,...t}){return(0,Z.jsx)(Mi,{"data-slot":`switch`,className:v(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...t,children:(0,Z.jsx)(Ni,{"data-slot":`switch-thumb`,className:`pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-checked:translate-x-4 data-unchecked:translate-x-0`})})}var Fi=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],Ii=e=>({enabled:e.enabled,message:e.message??``,rolloutCohortCount:e.rollout_cohort_count,shouldForceUpdate:e.should_force_update,targetAppVersion:e.target_app_version??``,targetCohorts:[...e.target_cohorts]}),Li=(e,t)=>({enabled:t.enabled,message:t.message.trim()||null,rolloutCohortCount:t.rolloutCohortCount,shouldForceUpdate:t.shouldForceUpdate,...e.strategy===`APP_VERSION`?{targetAppVersion:t.targetAppVersion.trim()}:{},targetCohorts:t.targetCohorts}),Ri=e=>(e/10).toFixed(1),zi=e=>{let t=e.replace(`,`,`.`),[n=``,...r]=t.split(`.`),i=n.replace(/\D/g,``).slice(0,3),a=r.join(``).replace(/\D/g,``).slice(0,1);return t.includes(`.`)?`${i}.${a}`:i},Bi=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function Vi({value:e,onChange:t}){let[n,r]=(0,X.useState)(Ri(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(Ri(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(wi,{"aria-label":`Rollout percentage`,max:1e3,min:0,onValueChange:n=>t(Array.isArray(n)?n[0]??e:n),step:1,value:e}),(0,Z.jsxs)(jt,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(Et,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=Bi(n)??e;a(!1),r(Ri(i)),t(i)},onChange:e=>{let n=zi(e.target.value);r(n);let i=Bi(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(Ot,{align:`inline-end`,children:(0,Z.jsx)(Tt,{children:`%`})})]})]})}function Hi({channels:e,onOpenChange:t,onShowScope:n,open:r,releaseId:i}){let o=Te(i),s=o.data,c=Pe(s?.bundle_id??``),l=c.data,u=l?an(l):null,d=we(s?.scope_key??``),f=Ae(),p=ke(),m=Ce(),h=Ie(),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(``),[x,C]=(0,X.useState)(``),[w,T]=(0,X.useState)(!1),[E,ee]=(0,X.useState)(!1),[te,ne]=(0,X.useState)(!1),[re,ie]=(0,X.useState)(``),[D,se]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{_(s?Ii(s):null),C(``)},[s]);let O=s?Ii(s):null,k=g!==null&&O!==null&&JSON.stringify(g)!==JSON.stringify(O),A=p.isPending||f.isPending||m.isPending||h.isPending,le=()=>{if(!A){if(k){T(!0);return}t(!1)}},j=()=>{if(!g)return;let e=en(v);if(!nn(e)){C(rn);return}_({...g,targetCohorts:Array.from(new Set([...g.targetCohorts,e]))}),y(``),C(``)},de=async()=>{if(!s||!g)return;let e=g.targetCohorts.map(en);if(e.some(e=>!nn(e))){C(rn);return}if(s.strategy===`APP_VERSION`&&!Lr(g.targetAppVersion.trim())){C(`Enter a valid target app version range.`);return}let n={expectedRevision:s.revision,patch:Li(s,{...g,targetCohorts:e}),releaseId:s.id};C(``);try{await p.mutateAsync(n),await f.mutateAsync(n),Jt.success(`Bundle settings saved`),t(!1)}catch(e){C(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},M=e.find(e=>e.id===s?.channel_id)?.name??s?.channel_id,P=e.filter(e=>e.id!==s?.channel_id),fe=P.map(e=>({label:e.name,value:e.name})),F=re.trim(),I=D===`copy`,L=g?Lr(g.targetAppVersion.trim()):null,R=()=>{ie(``),se(`move`)},z=e=>{!e&&h.isPending||(ne(e),e||R())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ue,{onOpenChange:e=>e?void 0:le(),open:r,children:(0,Z.jsxs)(oe,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(ge,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(ce,{children:`Bundle Detail`}),(0,Z.jsx)(pe,{className:`sr-only`,children:`Edit bundle delivery settings.`}),s?(0,Z.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-col gap-3 text-sm`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(st,{className:`size-4`,platform:s.platform}),(0,Z.jsx)(`span`,{className:`font-medium`,children:s.platform===`ios`?`iOS`:`Android`})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`ID`}),(0,Z.jsxs)(`span`,{className:`min-w-0 basis-full sm:basis-auto`,children:[(0,Z.jsx)(ct,{bundleId:s.id,fullOnMobile:!0,maxLength:18}),s.bundle_id?null:(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:`Built-in bundle`})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Channel`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,translate:`no`,children:M})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Platform`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:s.platform===`ios`?`iOS`:`Android`})]})]}):(0,Z.jsx)(b,{className:`h-12 w-full`})]}),(0,Z.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[o.isError?(0,Z.jsxs)(Ge,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(Ke,{children:`Bundle details could not be loaded`}),(0,Z.jsx)($e,{children:o.error.message})]}):null,s&&g?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[M?(0,Z.jsx)(Le,{release:{platform:s.platform,channel:M,releaseId:s.id,builtIn:!s.bundle_id}}):null,(0,Z.jsxs)(`section`,{"aria-labelledby":`delivery-settings-heading`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,id:`delivery-settings-heading`,children:`Delivery settings`}),(0,Z.jsxs)(Je,{className:`gap-6`,children:[(0,Z.jsxs)(Qe,{children:[(0,Z.jsx)(We,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(kt,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>_({...g,message:e.target.value}),rows:3,value:g.message})]}),s.strategy===`APP_VERSION`?(0,Z.jsxs)(Qe,{children:[(0,Z.jsx)(We,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(ae,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>_({...g,targetAppVersion:e.target.value}),value:g.targetAppVersion}),L?(0,Z.jsx)(Ye,{children:L}):null]}):null,(0,Z.jsxs)(Qe,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsx)(We,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(Pi,{"aria-label":`Enabled`,checked:g.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>_({...g,enabled:e})})]}),(0,Z.jsx)(Ye,{children:`Disabling rolls devices back to the previous enabled bundle on their next check, or to the built-in app when none remains.`})]}),(0,Z.jsxs)(Qe,{orientation:`horizontal`,children:[(0,Z.jsx)(We,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(Pi,{"aria-label":`Force update`,checked:g.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>_({...g,shouldForceUpdate:e})})]}),(0,Z.jsxs)(Qe,{children:[(0,Z.jsx)(We,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(Vi,{onChange:e=>_({...g,rolloutCohortCount:e}),value:g.rolloutCohortCount})]}),(0,Z.jsxs)(Qe,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(We,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Z.jsx)(Ur,{releaseId:s.id,rolloutCohortCount:g.rolloutCohortCount,targetCohorts:g.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(ae,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>y(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),j())},placeholder:`e.g. qa-team…`,value:v}),(0,Z.jsx)(a,{"aria-label":`Add cohort`,disabled:!v.trim(),onClick:j,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(Ft,{})})]}),g.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:g.targetCohorts.map(e=>(0,Z.jsxs)(q,{className:`gap-1 font-mono`,variant:`secondary`,children:[e,(0,Z.jsx)(`button`,{"aria-label":`Remove cohort ${e}`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>_({...g,targetCohorts:g.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Z.jsx)(N,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Ye,{children:`Public names—no IDs or secrets.`})]})]}),x?(0,Z.jsx)(Ze,{children:x}):null,(0,Z.jsx)(a,{className:`w-full`,disabled:!k||A,onClick:de,size:`lg`,children:p.isPending||f.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(S,{className:`my-2`}),(0,Z.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Actions`}),(0,Z.jsx)(a,{className:`w-full`,disabled:s.kind!==`BUNDLE`||A,onClick:()=>ne(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),s.bundle_id?(0,Z.jsxs)(a,{className:`w-full`,disabled:A,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(s.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),Jt.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(Mt,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(a,{className:`w-full`,disabled:s.enabled||A,onClick:()=>ee(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),s.bundle_id&&c.isPending?(0,Z.jsx)(b,{className:`h-40 w-full`}):null,s.bundle_id&&c.isError?(0,Z.jsxs)(Ge,{variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(Ke,{children:`Build details are unavailable`}),(0,Z.jsx)($e,{children:`Delivery settings are unaffected.`})]}):null,!s.bundle_id||!c.isPending?(0,Z.jsx)(Vr,{bundle:l,release:s}):null,(0,Z.jsxs)(`details`,{className:`rounded-lg border bg-muted/10 p-4 text-xs`,children:[(0,Z.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:`Advanced diagnostics`}),(0,Z.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-muted-foreground sm:grid-cols-2`,children:[(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:s.bundle_id??`Built-in bundle`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Revision`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:s.revision})]}),u?(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Patch base artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:u})]}):null,(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog generation`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:d.data?.generation??`—`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog size`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:d.data?`${d.data.byte_size} bytes`:`—`})]}),(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Scope key`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:s.scope_key}),n?(0,Z.jsx)(a,{className:`mt-1 h-auto px-0 text-xs`,onClick:()=>n(s.scope_key),size:`sm`,variant:`link`,children:`Show bundles for this target`}):null]})]}),d.isError?(0,Z.jsx)(`p`,{className:`mt-3 text-destructive`,children:`Diagnostics are unavailable. Bundle settings are unaffected.`}):null]})]}):null]})]})}),(0,Z.jsx)(xe,{onOpenChange:T,open:w,children:(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(be,{children:[(0,Z.jsx)(ve,{children:`Discard unsaved changes?`}),(0,Z.jsx)(H,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(W,{children:[(0,Z.jsx)(G,{children:`Keep editing`}),(0,Z.jsx)(ye,{onClick:()=>{T(!1),t(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(xe,{onOpenChange:ee,open:E,children:(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(be,{children:[(0,Z.jsxs)(ve,{children:[`Remove this Bundle from `,M??`the channel`,`?`]}),(0,Z.jsx)(H,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(W,{children:[(0,Z.jsx)(G,{children:`Cancel`}),(0,Z.jsx)(ye,{onClick:async()=>{if(s)try{await m.mutateAsync({expectedRevision:s.revision,releaseId:s.id}),Jt.success(`Bundle removed from ${M??`the channel`}`),ee(!1),t(!1)}catch(e){C(e instanceof Error?e.message:`Bundle could not be removed from the channel.`)}},variant:`destructive`,children:`Remove from channel`})]})]})}),(0,Z.jsx)(Vt,{onOpenChange:z,open:te,children:(0,Z.jsxs)(Lt,{showCloseButton:!h.isPending,children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Rt,{children:`Promote to Channel`}),(0,Z.jsx)(zt,{children:`Choose how to promote this Bundle, then select the target channel.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-4 py-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Xe,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(ht,{disabled:h.isPending,items:Fi,onValueChange:e=>se(e),value:D,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(_t,{placeholder:`Select an action`})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(xt,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:I?`Make this Bundle available in the target channel and keep it in the current channel.`:`Move this Bundle to the target channel. Devices in the current channel may fall back to an earlier Bundle.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Xe,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(ht,{disabled:h.isPending,items:fe,onValueChange:e=>ie(e??``),value:re||null,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(_t,{placeholder:`Select a channel`})}),(0,Z.jsx)(ft,{className:`max-h-64`,children:(0,Z.jsx)(bt,{children:P.map(e=>(0,Z.jsx)(xt,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(It,{children:[(0,Z.jsx)(a,{disabled:h.isPending,onClick:()=>z(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(a,{disabled:!F||h.isPending,onClick:async()=>{if(s)try{await h.mutateAsync({action:D,expectedRevision:s.revision,releaseId:s.id,targetChannel:F}),z(!1),Jt.success(I?`Bundle copied to ${F}`:`Bundle moved to ${F}`)}catch(e){Jt.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:h.isPending?I?`Copying…`:`Moving…`:I?`Copy`:`Move`})]})]})})]})}function Ui({release:e}){return(0,Z.jsxs)(q,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(qe,{className:`size-3`}):(0,Z.jsx)(dn,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}function Wi({percentage:e,className:t}){let n=e<100,r=e.toFixed(1);return(0,Z.jsxs)(q,{className:v(`gap-1`,t),variant:n?`secondary`:`default`,children:[n?(0,Z.jsx)(Kt,{className:`h-3 w-3`}):null,r,`%`]})}var Gi=20,Ki=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],qi=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}],Ji=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),Yi=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`}),Xi=e=>t=>{t.target instanceof Element&&t.target.closest(`button, a, input, select, textarea`)||e()};function Zi({channels:e,onChange:t,onClear:n,onManageChannels:r,search:i}){let o=Be(i),s=i.channelId!==void 0,c=[{label:`All Channels`,value:`all`},...e.map(e=>({label:e.name,value:e.id}))];return(0,Z.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-2 border-b bg-background px-3 py-3 sm:h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:py-0 sm:backdrop-blur-sm`,children:[(0,Z.jsx)(fe,{className:`-ml-1`}),(0,Z.jsx)(`h1`,{className:`sr-only`,children:`Bundles`}),(0,Z.jsxs)(`div`,{className:`ml-1 flex items-center gap-1.5 text-muted-foreground sm:ml-2`,children:[(0,Z.jsx)(mn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsxs)(ht,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:i.channelId??`all`,children:[(0,Z.jsx)(pt,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(_t,{})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(xt,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(ht,{disabled:!s,items:Ki,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:i.platform??`ios`,children:[(0,Z.jsx)(pt,{"aria-label":`Platform`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,title:s?void 0:`Choose a channel first`,children:(0,Z.jsx)(_t,{})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`ios`,children:`iOS`}),(0,Z.jsx)(xt,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(ht,{disabled:!s&&i.scopeKey===void 0,items:qi,onValueChange:e=>t({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:i.enabled===void 0?`all`:i.enabled?`enabled`:`disabled`,children:[(0,Z.jsx)(pt,{"aria-label":`Status`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(_t,{})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`all`,children:`Any Status`}),(0,Z.jsx)(xt,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(xt,{value:`disabled`,children:`Disabled`})]})})]}),(0,Z.jsx)(a,{"aria-label":`Manage channels`,onClick:r,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Z.jsx)(_n,{})}),i.bundleId?(0,Z.jsxs)(q,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Artifact filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear artifact filter`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>t({bundleId:void 0}),type:`button`,children:(0,Z.jsx)(N,{className:`size-3`})})]}):null,i.scopeKey?(0,Z.jsxs)(q,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Target filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear target filter`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>t({scopeKey:void 0}),type:`button`,children:(0,Z.jsx)(N,{className:`size-3`})})]}):null,o?(0,Z.jsxs)(a,{className:`h-8 px-2 text-xs text-muted-foreground hover:text-foreground sm:ml-auto`,onClick:n,size:`sm`,variant:`ghost`,children:[(0,Z.jsx)(N,{"data-icon":`inline-start`}),`Clear`]}):null]})}function Qi({expanded:e,onOpen:t,onToggleExpand:n,release:r}){let i=r.operation===`PROMOTE`?`Promoted`:r.operation===`ROLLBACK`?`Rollback`:null;return(0,Z.jsxs)(`div`,{className:`flex min-w-[240px] items-center gap-3`,children:[r.bundle_id?(0,Z.jsx)(a,{"aria-controls":`bundle-lineage-panel-${r.id}`,"aria-expanded":e,"aria-label":e?`Hide advanced artifact diagnostics`:`Show advanced artifact diagnostics`,title:`Advanced artifact diagnostics`,className:`size-8 shrink-0 touch-manipulation`,onClick:n,size:`icon`,type:`button`,variant:`ghost`,children:e?(0,Z.jsx)(rt,{}):(0,Z.jsx)(De,{})}):(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-8 shrink-0`}),(0,Z.jsxs)(`button`,{"aria-label":`Open details for ID ${r.id}`,className:`min-w-0 rounded-sm text-left text-foreground transition-colors underline-offset-4 hover:text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:t,title:r.id,type:`button`,children:[(0,Z.jsx)(ct,{bundleId:r.id,fullOnMobile:!0}),r.bundle_id?null:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,Z.jsx)(Dt,{className:`size-3.5`}),` Built-in bundle`]})]}),i?(0,Z.jsx)(q,{className:`shrink-0 font-normal`,variant:`secondary`,children:i}):null,r.currentlyUnreachable?(0,Z.jsxs)(`span`,{"aria-label":`Unreachable: no device gets this bundle with the current delivery settings.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No device gets this bundle with the current delivery settings.`,children:[(0,Z.jsx)(dn,{className:`size-3.5`}),`Unreachable`]}):null]})}function $i({onDetailClick:e,panelId:t,release:n}){let r=n.bundle_id??``,i=Pe(r),a=je(r);return i.isError||a.isError?(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:t,children:`Patch lineage could not be loaded.`}):i.isPending?(0,Z.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:t,children:[(0,Z.jsx)(b,{className:`h-10 w-full`}),(0,Z.jsx)(b,{className:`h-10 w-full`})]}):i.data?(0,Z.jsx)(Dn,{bundle:i.data,bundles:a.data??[],loading:a.isPending,onDetailClick:e,panelId:t}):(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:t,children:`Bundle details are unavailable.`})}function ea(){let e=Ue.useSearch(),t=Ue.useNavigate(),n=M(),[r,i]=(0,X.useState)(!1),[o,s]=(0,X.useState)(),c=Ne({afterReleaseId:e.afterReleaseId,beforeReleaseId:e.beforeReleaseId,filter:Ve(e),limit:Gi}),l=Oe().data??[],u=c.data?.data??[],d=K(Array.from(new Set(u.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},f=c.data?.next,m=c.data?.previous,h=u.flatMap(e=>{let t=l.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t,builtIn:!e.bundle_id}]:[]}),g=He(),_=10+g.length,y=new Map(l.map(e=>[e.id,e.name]));(0,X.useEffect)(()=>{o&&!u.some(e=>e.id===o)&&s(void 0)},[o,u]);let x=(e,n=!0)=>void t({resetScroll:n,search:e,to:`/`}),S=t=>x(ze(e,t)),C=t=>{let n=u.find(e=>e.bundle_id===t.id);if(s(void 0),n){x({...e,releaseId:n.id},!1);return}S({bundleId:t.id})},w=e.afterReleaseId!==void 0||e.beforeReleaseId!==void 0,T=m?{...e,afterReleaseId:m,beforeReleaseId:void 0,releaseId:void 0}:null,E=f?{...e,afterReleaseId:void 0,beforeReleaseId:f,releaseId:void 0}:null,ee={...e,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0};return(0,Z.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,Z.jsx)(Zi,{channels:l,onChange:S,onClear:()=>x({}),onManageChannels:()=>i(!0),search:e}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-6 bg-muted/5 p-3 sm:p-6`,children:[c.isError?(0,Z.jsxs)(Ge,{variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(Ke,{children:`Bundles could not be loaded`}),(0,Z.jsx)($e,{children:c.error.message})]}):(0,Z.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden rounded-lg border bg-card text-card-foreground shadow-sm [&_[data-slot=table-container]]:h-full [&_[data-slot=table-container]]:overflow-auto`,children:n?(0,Z.jsx)(`div`,{className:`h-full overflow-y-auto`,children:c.isPending?(0,Z.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:Array.from({length:5},(e,t)=>(0,Z.jsx)(b,{className:`h-44 w-full`},t))}):u.length?u.map(t=>{let n=y.get(t.channel_id)??t.channel_id,r=t.bundle_id?d[t.bundle_id]:0,i=o===t.id,a=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(`article`,{"aria-label":`Bundle ${t.id}`,className:v(`flex cursor-pointer touch-manipulation flex-col gap-4 border-b p-4 transition-[background-color,filter] last:border-b-0 hover:bg-muted/10 active:bg-muted/20 motion-reduce:transition-none data-[state=selected]:bg-muted/15`,t.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,i&&`border-b-0 bg-primary/5`),"data-state":e.releaseId===t.id?`selected`:void 0,onClick:Xi(()=>x({...e,releaseId:t.id},!1)),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(Qi,{expanded:i,onOpen:()=>x({...e,releaseId:t.id},!1),onToggleExpand:()=>s(i?void 0:t.id),release:t}),(0,Z.jsx)(bn,{channel:n,className:`shrink-0`})]}),(0,Z.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 text-xs`,children:[(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Platform`}),(0,Z.jsxs)(`dd`,{className:`mt-1 flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(st,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created`}),(0,Z.jsx)(`dd`,{className:`mt-1 tabular-nums`,children:Ji.format(t.created_at_ms)})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Rollout`}),(0,Z.jsx)(`dd`,{className:`mt-1`,children:(0,Z.jsx)(Wi,{percentage:t.rollout_cohort_count/10})})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Patches`}),(0,Z.jsx)(`dd`,{className:`mt-1`,children:r===void 0?`Checking`:r>0?`${r} ${r===1?`patch`:`patches`}`:`—`})]}),g.map(({Cell:e,feature:n,label:r})=>(0,Z.jsxs)(`div`,{className:`col-span-2 rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`mb-2 text-muted-foreground`,children:r}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(e,{releaseId:t.id,releases:h})})]},n)),(0,Z.jsxs)(`div`,{className:`col-span-2 flex flex-wrap items-center gap-2 rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(Ui,{release:t}),t.should_force_update?(0,Z.jsx)(q,{variant:`secondary`,children:`Force update`}):null]}),(0,Z.jsxs)(`div`,{className:`col-span-2 grid grid-cols-1 gap-2 rounded-md border bg-background/80 p-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Target`}),(0,Z.jsx)(`dd`,{className:`min-w-0 truncate text-right font-mono`,children:t.target_app_version??t.fingerprint_hash??`—`})]}),(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Message`}),(0,Z.jsx)(`dd`,{className:`min-w-0 text-right text-foreground`,children:t.message||`—`})]})]})]})]}),i&&t.bundle_id?(0,Z.jsx)($i,{onDetailClick:C,panelId:a,release:t}):null]},t.id)}):(0,Z.jsx)(`p`,{className:`p-8 text-center text-sm text-muted-foreground`,children:w?`No more bundles on this side.`:Be(e)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,Z.jsxs)(ln,{className:`min-w-max`,children:[(0,Z.jsx)(on,{className:`bg-muted/40`,children:(0,Z.jsxs)(cn,{className:`border-b border-border/60 hover:bg-transparent [&>th]:h-10 [&>th]:text-xs [&>th]:font-semibold [&>th]:uppercase [&>th]:text-muted-foreground/70`,children:[(0,Z.jsx)(J,{children:`ID`}),(0,Z.jsx)(J,{children:`Channel`}),(0,Z.jsx)(J,{children:`Platform`}),(0,Z.jsx)(J,{children:`Patches`}),(0,Z.jsx)(J,{children:`Target`}),(0,Z.jsx)(J,{children:`Enabled`}),(0,Z.jsx)(J,{children:`Force update`}),(0,Z.jsx)(J,{children:`Rollout`}),g.map(({feature:e,label:t})=>(0,Z.jsx)(J,{children:t},e)),(0,Z.jsx)(J,{children:`Message`}),(0,Z.jsx)(J,{children:`Created`})]})}),(0,Z.jsxs)(sn,{children:[c.isPending?Array.from({length:7},(e,t)=>(0,Z.jsx)(cn,{children:(0,Z.jsx)(Y,{colSpan:_,children:(0,Z.jsx)(b,{className:`h-8 w-full`})})},t)):u.map(t=>{let n=o===t.id,r=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(cn,{"aria-label":`Open bundle ${t.id}`,className:v(`cursor-pointer transition-[background-color,filter] hover:bg-muted/10 focus-within:bg-muted/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring motion-reduce:transition-none data-[state=selected]:bg-muted/15 [&>td]:py-3`,t.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,n&&`bg-primary/5`),"data-state":e.releaseId===t.id?`selected`:void 0,onClick:Xi(()=>x({...e,releaseId:t.id},!1)),onKeyDown:n=>{n.target!==n.currentTarget||n.key!==`Enter`&&n.key!==` `||(n.preventDefault(),x({...e,releaseId:t.id},!1))},tabIndex:0,children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(Qi,{expanded:n,onOpen:()=>x({...e,releaseId:t.id},!1),onToggleExpand:()=>s(n?void 0:t.id),release:t})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(bn,{channel:y.get(t.channel_id)??t.channel_id})}),(0,Z.jsx)(Y,{className:`whitespace-nowrap`,children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(st,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]})}),(0,Z.jsx)(Y,{children:t.bundle_id&&d[t.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):t.bundle_id&&d[t.bundle_id]>0?(0,Z.jsxs)(q,{variant:`secondary`,children:[d[t.bundle_id],` `,d[t.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:t.target_app_version?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Re,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`font-medium`,children:t.target_app_version})]}):t.fingerprint_hash?(0,Z.jsxs)(`span`,{className:`flex min-w-[160px] items-center gap-2`,children:[(0,Z.jsx)(pn,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(At,{maxLength:12,value:t.fingerprint_hash})]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(xn,{enabled:t.enabled}),(0,Z.jsx)(`span`,{className:`sr-only`,children:t.enabled?`Enabled`:`Disabled`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(xn,{enabled:t.should_force_update,falseIcon:`minus`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:t.should_force_update?`Required`:`Optional`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Wi,{percentage:t.rollout_cohort_count/10})}),g.map(({Cell:e,feature:n})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(e,{releaseId:t.id,releases:h})},n)),(0,Z.jsx)(Y,{className:`text-sm text-muted-foreground`,title:t.message??void 0,children:t.message||`-`}),(0,Z.jsx)(Y,{className:`whitespace-nowrap text-xs text-muted-foreground`,title:Ji.format(t.created_at_ms),children:Yi.format(t.created_at_ms)})]}),n&&t.bundle_id?(0,Z.jsx)(cn,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:_,children:(0,Z.jsx)($i,{onDetailClick:C,panelId:r,release:t})})}):null]},t.id)}),!c.isPending&&u.length===0?(0,Z.jsx)(cn,{children:(0,Z.jsx)(Y,{className:`h-40 text-center text-muted-foreground`,colSpan:_,children:w?`No more bundles on this side.`:Be(e)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):null]})]})}),!c.isError&&!c.isPending?(0,Z.jsxs)(`nav`,{"aria-label":`Bundle pagination`,className:`flex flex-col gap-3 px-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Z.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:[(0,Z.jsx)(`span`,{className:`text-foreground`,children:u.length}),` `,u.length===1?`entry`:`entries`,`, newest first`]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 sm:justify-end`,children:[w?(0,Z.jsx)(V,{className:p({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`ghost`}),search:ee,to:`/`,children:`Newest`}):null,T?(0,Z.jsxs)(V,{className:p({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:T,to:`/`,children:[(0,Z.jsx)(un,{"data-icon":`inline-start`}),`Previous`]}):(0,Z.jsxs)(a,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[(0,Z.jsx)(un,{"data-icon":`inline-start`}),`Previous`]}),E?(0,Z.jsxs)(V,{className:p({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:E,to:`/`,children:[`Next`,(0,Z.jsx)(De,{"data-icon":`inline-end`})]}):(0,Z.jsxs)(a,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[`Next`,(0,Z.jsx)(De,{"data-icon":`inline-end`})]})]})]}):null]}),(0,Z.jsx)(Hi,{channels:l,onOpenChange:t=>!t&&x({...e,releaseId:void 0},!1),onShowScope:e=>S({scopeKey:e}),open:!!e.releaseId,releaseId:e.releaseId??``}),(0,Z.jsx)(On,{onOpenChange:i,open:r})]})}export{ea as component};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-CJSxovHS.js","assets/sidebar-RBvHzq8e.js","assets/alert-dialog-DXxrSU0G.js","assets/mutation-B4EZNS91.js","assets/valueToPercent-Ci2-fmWp.js","assets/useCompositeListItem-BxJspDxS.js","assets/field-bPoDrs6K.js","assets/console-features-api-BhUIxeL-.js","assets/api-BiZP_i-u.js","assets/input-group-_PD0i7wZ.js","assets/dist-BzWwzt98.js","assets/loader-circle-iTGehfyV.js","assets/dialog-DxjO7ofz.js","assets/card-DKr2pZMA.js","assets/InsightsInfo-NUuLFYqg.js","assets/preload-helper-D9SUwQT7.js","assets/table-BYmouPt9.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Hr as e,In as t,Ln as n,Nn as r,Pn as i,Ur as a,ar as o,cr as s,nr as c,rr as l}from"./sidebar-RBvHzq8e.js";import{a as u,i as d,l as f,o as p}from"./console-features-api-BhUIxeL-.js";import{C as m,S as h,c as g,h as _,t as v,v as y,w as b}from"./preload-helper-D9SUwQT7.js";import{n as x}from"./loader-circle-iTGehfyV.js";import{a as S,i as C,n as w,o as T,t as E}from"./card-DKr2pZMA.js";import{n as D,t as O}from"./InsightsInfo-NUuLFYqg.js";var k=o(`chart-line`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`m19 9-5 5-4-4-3 3`,key:`2osh9i`}]]),A=o(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),j=e(),M={apiKeys:{navigation:{icon:(0,j.jsx)(x,{}),paths:[`/api-keys`],link:({onClick:e})=>(0,j.jsx)(f,{to:`/api-keys`,onClick:e})}}},N=l({method:`GET`}).middleware([c]).handler(a(`b4bf4c461903edcdc44eea52468c737b5b600a586f542138ff022dcbbe86c45c`));function P(e){let t=e.map(({releaseId:e,platform:t,channel:n})=>({releaseId:e,platform:t,channel:n})).sort((e,t)=>e.releaseId.localeCompare(t.releaseId));return s({queryKey:[`bundle-activity`,t],queryFn:()=>N({data:t}),enabled:t.length>0,staleTime:3e4})}var F=[{label:`Downloaded`,field:`downloads`,color:`text-primary/85`},{label:`Launched`,field:`launched`,color:`text-success/85`},{label:`Crashed`,field:`failedLaunches`,color:`text-warning/85`}],I=e=>{let t=e.launched+e.failedLaunches;return t===0?`—`:`${(e.failedLaunches/t*100).toFixed(2)}%`},L=e=>Math.max(0,e.downloads-e.launched-e.failedLaunches);function R(){return(0,j.jsx)(O,{label:`About release insight metrics`,children:`Downloaded: got this bundle. Launched: ran it. Crashed: crashed on it and rolled back. Once every installation restarts, Downloaded = Launched + Crashed.`})}function z({report:e,loading:t=!1,input:i,variant:a=`inline`}){if(!e)return t?(0,j.jsx)(r,{"aria-label":`Loading release insights`,className:a===`card`?`h-16 w-full`:`h-4 w-40`}):(0,j.jsx)(`span`,{"aria-label":`Release insights unavailable`,className:`text-sm text-muted-foreground`,children:`—`});let o=i?.builtIn===!0,s=o?0:L(e),c=(0,j.jsx)(`dl`,{className:n(a===`card`?`grid grid-cols-[1fr_1fr_auto] gap-4`:`flex min-w-[220px] flex-wrap items-baseline gap-x-3 gap-y-1`),children:F.map(({label:t,field:r,color:i})=>(0,j.jsxs)(`div`,{className:n(`flex`,a===`card`?`min-w-0 flex-col gap-1`:`items-baseline gap-1.5 whitespace-nowrap`),children:[(0,j.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:t}),(0,j.jsxs)(`dd`,{className:n(`flex flex-wrap items-baseline gap-x-1.5 tabular-nums`,a===`card`?`text-xl font-semibold`:`text-sm font-medium`,e[r]>0&&!(r===`downloads`&&o)?i:`text-muted-foreground`),children:[r===`downloads`&&o?(0,j.jsx)(`span`,{title:`The built-in bundle is never downloaded`,children:`—`}):e[r].toLocaleString(),r===`failedLaunches`?(0,j.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,I(e),`)`]}):null]})]},r))});return(0,j.jsxs)(`div`,{className:n(`flex`,a===`card`?`flex-col gap-2`:`items-center gap-1`),children:[i?(0,j.jsx)(f,{className:`min-w-0 rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,to:`/insights`,search:{healthPlatform:i.platform,healthChannel:i.channel,releaseId:i.releaseId,bundleWindow:D(i.releaseId)},children:c}):c,a===`card`&&s>0?(0,j.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[s.toLocaleString(),` downloaded but not launched yet: waiting for a restart, or passed over for a newer bundle.`]}):null,a===`inline`?(0,j.jsx)(R,{}):null]})}function B({input:e}){let t=g({platform:e.platform,channel:e.channel,releaseId:e.releaseId}),i=t.data;return(0,j.jsxs)(`div`,{className:`flex items-center gap-1`,children:[i?(0,j.jsx)(`dl`,{children:(0,j.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,j.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Download failures`}),(0,j.jsxs)(`dd`,{className:n(`flex items-baseline gap-1.5 text-sm font-medium tabular-nums`,i.failedUpdates>0?`text-warning/85`:`text-muted-foreground`),children:[i.failedUpdates.toLocaleString(),(0,j.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,y(_(i)),`)`]})]})]})}):t.isPending?(0,j.jsx)(r,{"aria-label":`Loading download failures`,className:`h-4 w-40`}):(0,j.jsx)(`span`,{"aria-label":`Download failures unavailable`,className:`text-sm text-muted-foreground`,children:`—`}),(0,j.jsx)(O,{label:`About download failures`,children:`Failed downloads or installs of this bundle, at most one per installation a day. Rate = failures ÷ (failures + downloads).`})]})}function V({input:e}){let n=P([e]);return(0,j.jsxs)(E,{children:[(0,j.jsxs)(S,{className:`flex-row items-center justify-between px-4 pt-4 pb-3`,children:[(0,j.jsx)(T,{className:`text-sm font-medium`,children:`Insights`}),(0,j.jsx)(R,{})]}),(0,j.jsxs)(w,{className:`flex flex-col gap-3 px-4 pb-4`,children:[(0,j.jsx)(z,{variant:`card`,input:e,loading:n.isFetching,report:n.data?.[e.releaseId]}),(0,j.jsx)(i,{}),(0,j.jsx)(B,{input:e})]}),(0,j.jsx)(C,{className:`px-4 pb-4`,children:(0,j.jsxs)(f,{className:t({variant:`outline`,size:`sm`}),to:`/insights`,search:{healthPlatform:e.platform,healthChannel:e.channel,releaseId:e.releaseId,bundleWindow:D(e.releaseId),healthChart:`adoption`},children:[(0,j.jsx)(k,{"aria-hidden":`true`,"data-icon":`inline-start`}),`View adoption`]})})]})}function H({input:e}){return d(`insightsAnalytics`)?null:(0,j.jsxs)(E,{children:[(0,j.jsx)(S,{className:`px-4 pt-4 pb-3`,children:(0,j.jsx)(T,{className:`text-sm font-medium`,children:`Insights`})}),(0,j.jsx)(w,{className:`px-4 pb-4`,children:(0,j.jsx)(B,{input:e})})]})}function U({releaseId:e,releases:t}){let n=P(t);return(0,j.jsx)(z,{input:t.find(t=>t.releaseId===e),loading:n.isFetching,report:n.data?.[e]})}var W={Cell:U},G={insights:{navigation:{icon:(0,j.jsx)(h,{}),paths:[`/insights`,`/insights/distribution`,`/installations`],link:({features:e,onClick:t})=>e.insightsAnalytics?(0,j.jsx)(f,{to:`/insights`,onClick:t}):(0,j.jsx)(f,{to:`/installations`,onClick:t})},releaseSection:({release:e})=>(0,j.jsx)(H,{input:e})},insightsAnalytics:{releaseColumn:W,releaseSection:({release:e})=>(0,j.jsx)(V,{input:e})},...M},K=Object.keys(p),q=()=>{let e=u().data?.features;return e===void 0?[]:K.flatMap(t=>{let n=G[t];return n!==void 0&&e[t]?[{...n,feature:t,label:p[t].label,features:e}]:[]})},J=()=>q().flatMap(({feature:e,label:t,releaseColumn:n})=>n===void 0?[]:[{...n,feature:e,label:t}]);function Y({release:e}){return q().map(({feature:t,releaseSection:n})=>n===void 0?null:(0,j.jsx)(n,{release:e},t))}var X=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function Z(e){let t=X(e.beforeReleaseId),n=t?void 0:X(e.afterReleaseId),r=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0,i=X(e.bundleId),a=i?void 0:X(e.scopeKey),o=i||a?void 0:X(e.channelId),s=o===void 0?void 0:e.platform===`android`?`android`:`ios`;return{afterReleaseId:n,beforeReleaseId:t,bundleId:i,channelId:o,enabled:a||o?r:void 0,platform:s,releaseId:X(e.releaseId),scopeKey:a}}function Q(e){let t=e.enabled===void 0?{}:{enabled:e.enabled};return e.bundleId?{kind:`bundle`,bundleId:e.bundleId}:e.scopeKey?{kind:`scope`,scopeKey:e.scopeKey,...t}:e.channelId&&e.platform?{kind:`channelPlatform`,channelId:e.channelId,platform:e.platform,...t}:{kind:`all`}}function $(e){return Q(e).kind!==`all`}function ee(e,t){let n={...e,...t};return t.bundleId?Z({bundleId:n.bundleId}):t.scopeKey?Z({scopeKey:n.scopeKey,enabled:n.enabled}):`channelId`in t||`platform`in t?Z({channelId:n.channelId,enabled:n.enabled,platform:n.platform}):Z({bundleId:n.bundleId,channelId:n.channelId,enabled:n.enabled,platform:n.platform,scopeKey:n.scopeKey})}var te=b(`/`)({component:m(()=>v(()=>import(`./routes-CJSxovHS.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])),`component`),validateSearch:Z});export{Y as a,A as c,ee as i,$ as n,q as o,Q as r,J as s,te as t};
|