@hot-updater/console 1.0.0-rc.3 → 1.0.0-rc.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/ConsoleFeatureUnavailable-C2A-IEUj.js +1 -0
  3. package/.output/public/assets/EventDetails-Cmr-5qyj.js +1 -0
  4. package/.output/public/assets/InsightsInfo-BSBCWe3-.js +1 -0
  5. package/.output/public/assets/InsightsPageHeader-CD2fNN6p.js +1 -0
  6. package/.output/public/assets/NotFoundPage-jCpnR_sf.js +1 -0
  7. package/.output/public/assets/api-M5QUCPtH.js +1 -0
  8. package/.output/public/assets/api-keys-C07wGYuv.js +1 -0
  9. package/.output/public/assets/api-keys-EE1NZMDt.js +1 -0
  10. package/.output/public/assets/arrow-left-DD46PnTE.js +1 -0
  11. package/.output/public/assets/card-CYvj5tZx.js +1 -0
  12. package/.output/public/assets/console-features-api-Bk59EJ3s.js +1 -0
  13. package/.output/public/assets/dialog-JCXymiUi.js +1 -0
  14. package/.output/public/assets/dist-D6GJh2KA.js +1 -0
  15. package/.output/public/assets/empty-XdPINXx1.js +1 -0
  16. package/.output/public/assets/field-DzzNtTQg.js +1 -0
  17. package/.output/public/assets/index-GU56hAuf.js +11 -0
  18. package/.output/public/assets/input-group-BYLaHtwW.js +1 -0
  19. package/.output/public/assets/insights-BszMgsRK.js +42 -0
  20. package/.output/public/assets/insights-DQsl_Td9.js +1 -0
  21. package/.output/public/assets/insights-DpOzhVW7.js +2 -0
  22. package/.output/public/assets/insights-recovery-rpc-CTHkGU7B.js +1 -0
  23. package/.output/public/assets/insights-usage-rpc-D2B6f_Xe.js +1 -0
  24. package/.output/public/assets/insights_.distribution-DTT6zAk9.js +2 -0
  25. package/.output/public/assets/insights_.distribution-Dmk5sx7P.js +1 -0
  26. package/.output/public/assets/insights_.distribution-x-J185Zc.js +1 -0
  27. package/.output/public/assets/installations-2Z3CVLeT.js +2 -0
  28. package/.output/public/assets/installations-BF2P7U-4.js +1 -0
  29. package/.output/public/assets/installations-BcENidrS.js +1 -0
  30. package/.output/public/assets/loader-circle-OFX0xgRO.js +1 -0
  31. package/.output/public/assets/mutation-T1TB7pc4.js +1 -0
  32. package/.output/public/assets/preload-helper-I1Qxz43W.js +1 -0
  33. package/.output/public/assets/refresh-cw-Dq9bXycn.js +1 -0
  34. package/.output/public/assets/routes-BiY8Stye.js +2 -0
  35. package/.output/public/assets/routes-DwBZ3XAM.js +1 -0
  36. package/.output/public/assets/sidebar-CZeTS8e7.js +3 -0
  37. package/.output/public/assets/styles-BHmFL3Ss.css +2 -0
  38. package/.output/public/assets/table-BkWY5miS.js +1 -0
  39. package/.output/public/assets/useCompositeListItem-CnQYUiF9.js +1 -0
  40. package/.output/public/assets/useMutation-CowW32bj.js +1 -0
  41. package/.output/public/assets/valueToPercent-Bg4L42av.js +1 -0
  42. package/.output/server/{__23tanstack-start-server-fn-resolver-EMel9KYs.mjs → __23tanstack-start-server-fn-resolver-BhCfmV4w.mjs} +52 -48
  43. package/.output/server/_libs/@base-ui/react+[...].mjs +6891 -3364
  44. package/.output/server/_libs/@tanstack/react-router+[...].mjs +3802 -4022
  45. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +140 -97
  46. package/.output/server/_libs/lucide-react.mjs +64 -31
  47. package/.output/server/_libs/next-themes.mjs +1 -1
  48. package/.output/server/_libs/react-redux+[...].mjs +1 -1
  49. package/.output/server/_libs/recharts+[...].mjs +494 -780
  50. package/.output/server/_libs/sonner.mjs +1 -1
  51. package/.output/server/_libs/tanstack__history.mjs +68 -41
  52. package/.output/server/_libs/tanstack__query-core.mjs +1772 -310
  53. package/.output/server/_libs/tanstack__react-query.mjs +266 -21
  54. package/.output/server/_libs/verkit.mjs +99 -1
  55. package/.output/server/_ssr/ConsoleFeatureUnavailable-CxmgKN3V.mjs +58 -0
  56. package/.output/server/_ssr/EventDetails-BZ63i9RG.mjs +289 -0
  57. package/.output/server/_ssr/InsightsInfo-Dzb4MOKu.mjs +72 -0
  58. package/.output/server/_ssr/InsightsPageHeader-vA0_nYCk.mjs +161 -0
  59. package/.output/server/_ssr/NotFoundPage-B5W9MyXy.mjs +37 -0
  60. package/.output/server/_ssr/api-DeEqnrrM.mjs +203 -0
  61. package/.output/server/_ssr/api-keys-BgGUDfDY.mjs +5 -0
  62. package/.output/server/_ssr/api-keys-rpc-BQxVQR3u.mjs +52 -0
  63. package/.output/server/_ssr/{api-keys-BBl84_lN.mjs → api-keys-s5hSUx3p.mjs} +48 -8
  64. package/.output/server/_ssr/api-rpc-Cu2b-52B.mjs +296 -0
  65. package/.output/server/_ssr/{auth-rpc-gaibR719.mjs → auth-rpc-C5nwIq5q.mjs} +6 -6
  66. package/.output/server/_ssr/auth.server-BEWisUh1.mjs +5712 -0
  67. package/.output/server/_ssr/bundleActivity-DebSrpG0.mjs +19 -0
  68. package/.output/server/_ssr/card-BrzHgIMV.mjs +49 -0
  69. package/.output/server/_ssr/config-nsIcsHh8.mjs +15 -0
  70. package/.output/server/_ssr/config.server-CTZ2j8hg.mjs +36 -0
  71. package/.output/server/_ssr/console-access-CzZK7n93.mjs +17 -0
  72. package/.output/server/_ssr/console-features-BsjUyRwC.mjs +55 -0
  73. package/.output/server/_ssr/console-features-api-D87zBT2j.mjs +43 -0
  74. package/.output/server/_ssr/console-features-rpc-CT9CgHjn.mjs +19 -0
  75. package/.output/server/_ssr/{createServerFn-B2hcXoPM.mjs → createMiddleware-BdBf_ezN.mjs} +67 -56
  76. package/.output/server/_ssr/{createServerRpc-DB29C_5p.mjs → createServerRpc-B_y2lrwA.mjs} +2 -2
  77. package/.output/server/_ssr/{databaseJsonValue-d6I3nAS4.mjs → databaseJsonValue-Bhxciy7Z.mjs} +28 -5
  78. package/.output/server/_ssr/databaseRows-DwMAjaF8.mjs +74 -0
  79. package/.output/server/_ssr/{dialog-DNtKYR5K.mjs → dialog-Com7blkc.mjs} +2 -2
  80. package/.output/server/_ssr/{dist-CyzPaI5v.mjs → dist-Cxo9ghYv.mjs} +140 -6
  81. package/.output/server/_ssr/{downloadBundle-A9zYC2go.mjs → downloadBundle-J1h1ilVu.mjs} +10 -10
  82. package/.output/server/_ssr/{empty-plugin-adapters-B5QvGpEl.mjs → empty-plugin-adapters-CYdinE-i.mjs} +1 -1
  83. package/.output/server/_ssr/empty-xB4Oxqe5.mjs +49 -0
  84. package/.output/server/_ssr/failureReports-C72EOpNj.mjs +33 -0
  85. package/.output/server/_ssr/{table-QQ9cnWf2.mjs → field-DHadIunv.mjs} +62 -50
  86. package/.output/server/_ssr/getBundleChildren-h_jo7zPh.mjs +22 -0
  87. package/.output/server/_ssr/{input-group-Oj4kUnE4.mjs → input-group-BoLVd6aM.mjs} +52 -3
  88. package/.output/server/_ssr/insights-C9yYMr6S.mjs +5 -0
  89. package/.output/server/_ssr/insights-D5Vr1-LU.mjs +14 -0
  90. package/.output/server/_ssr/insights-api-CwoqDPIC.mjs +122 -0
  91. package/.output/server/_ssr/insights-errors-F-7hOApm.mjs +34 -0
  92. package/.output/server/_ssr/insights-failures-BZaGNNij.mjs +47 -0
  93. package/.output/server/_ssr/insights-failures-rpc-Cn0h5GQN.mjs +36 -0
  94. package/.output/server/_ssr/insights-k-z2boTq.mjs +2140 -0
  95. package/.output/server/_ssr/{insights-recovery-DSFM-YTL.mjs → insights-recovery-Dpk6Mfb9.mjs} +9 -2
  96. package/.output/server/_ssr/insights-recovery-rpc-8zC6yDQG.mjs +20 -0
  97. package/.output/server/_ssr/insights-recovery-rpc-f1GkDalD.mjs +46 -0
  98. package/.output/server/_ssr/{insights-rpc-DBf0ouen.mjs → insights-rpc-BMZYat_c.mjs} +22 -14
  99. package/.output/server/_ssr/insights-usage-CLUWjUFz.mjs +29 -0
  100. package/.output/server/_ssr/insights-usage-rpc-C_rbTlzm.mjs +41 -0
  101. package/.output/server/_ssr/insights-usage-rpc-xA0701F_.mjs +29 -0
  102. package/.output/server/_ssr/insightsRecovery-9_N8XFIa.mjs +106 -0
  103. package/.output/server/_ssr/insightsUsage-BcqsRERl.mjs +56 -0
  104. package/.output/server/_ssr/insights_.distribution-BD8N3-RC.mjs +334 -0
  105. package/.output/server/_ssr/insights_.distribution-BW9aXDcX.mjs +5 -0
  106. package/.output/server/_ssr/insights_.distribution-DJJYtovL.mjs +14 -0
  107. package/.output/server/_ssr/installations-B5Mvy3PT.mjs +5 -0
  108. package/.output/server/_ssr/installations-COslBIxT.mjs +69 -0
  109. package/.output/server/_ssr/{installations-DQyJN-pZ.mjs → installations-CPTYrBnY.mjs} +428 -97
  110. package/.output/server/_ssr/listReleases-BitHzOYB.mjs +79 -0
  111. package/.output/server/_ssr/releaseManagement-B3e7I8J9.mjs +11 -0
  112. package/.output/server/_ssr/{router-C8J4nYEG.mjs → router-ChZfGLQb.mjs} +134 -138
  113. package/.output/server/_ssr/{routes-NlTRKPML.mjs → routes-BzIV6_XR.mjs} +174 -389
  114. package/.output/server/_ssr/routes-CwFJq8fZ.mjs +362 -0
  115. package/.output/server/_ssr/runtime.server-0kKViz4u.mjs +1597 -0
  116. package/.output/server/_ssr/schema-BKY9SqaY.mjs +25 -0
  117. package/.output/server/_ssr/select-1btAqVz9.mjs +107 -0
  118. package/.output/server/_ssr/server-ET4AuHDX.mjs +8330 -0
  119. package/.output/server/_ssr/{createSsrRpc-4rr4IJh3.mjs → sidebar-1gxSH3tz.mjs} +107 -47
  120. package/.output/server/_ssr/ssr.mjs +1 -1
  121. package/.output/server/_ssr/start-BXUOv_n8.mjs +4 -0
  122. package/.output/server/_ssr/table-CpDxIWGg.mjs +53 -0
  123. package/.output/server/_ssr/updateFailures-BI2k_oIa.mjs +40 -0
  124. package/.output/server/_ssr/{uuidv7-D0QFkPL_.mjs → uuidv7-C8bwiZr8.mjs} +2 -2
  125. package/.output/server/_tanstack-start-manifest_v-DEx0iQr9.mjs +122 -0
  126. package/.output/server/index.mjs +253 -169
  127. package/LICENSE +13 -14
  128. package/README.md +82 -72
  129. package/lib/index.d.mts +23 -11
  130. package/lib/vite-internal.mjs +13 -3
  131. package/lib/vite.d.mts +2 -0
  132. package/package.json +14 -14
  133. package/src/components/AppSidebar.tsx +100 -71
  134. package/src/components/ConsoleAccessPage.tsx +5 -1
  135. package/src/components/ConsoleFeatureUnavailable.tsx +80 -0
  136. package/src/components/NotFoundPage.tsx +7 -7
  137. package/src/components/features/FeatureSlots.tsx +99 -0
  138. package/src/components/features/api-keys/apiKeysFeatureUi.tsx +15 -0
  139. package/src/components/features/bundles/BundleMetadata.tsx +8 -5
  140. package/src/components/features/bundles/RolloutCohortsDialog.tsx +1 -1
  141. package/src/components/features/channels/ChannelManagementDialog.tsx +2 -5
  142. package/src/components/features/insights/AppUsage.tsx +370 -0
  143. package/src/components/features/insights/BundleDistributionChart.tsx +253 -0
  144. package/src/components/features/insights/EstimatedCount.tsx +18 -0
  145. package/src/components/features/insights/EventDetails.tsx +294 -37
  146. package/src/components/features/insights/EventHistoryCard.tsx +112 -26
  147. package/src/components/features/insights/EventHistoryList.tsx +2 -2
  148. package/src/components/features/insights/FailureReports.tsx +394 -0
  149. package/src/components/features/insights/InsightsControls.tsx +265 -102
  150. package/src/components/features/insights/InsightsErrorAlert.tsx +14 -1
  151. package/src/components/features/insights/InsightsInfo.tsx +48 -0
  152. package/src/components/features/insights/InsightsOverview.tsx +257 -173
  153. package/src/components/features/insights/InsightsPageHeader.tsx +35 -20
  154. package/src/components/features/insights/InsightsPeriodSelector.tsx +89 -0
  155. package/src/components/features/insights/InstallationHistoryCard.tsx +58 -10
  156. package/src/components/features/insights/InstallationMatchesCard.tsx +1 -1
  157. package/src/components/features/insights/ReleaseActivity.tsx +293 -0
  158. package/src/components/features/insights/ReleaseAdoptionChart.tsx +325 -0
  159. package/src/components/features/insights/ReportingDevicesSummary.tsx +65 -0
  160. package/src/components/features/insights/UpdateFailures.tsx +451 -0
  161. package/src/components/features/insights/insightsFeatureUi.tsx +35 -0
  162. package/src/components/features/releases/ReleaseEditorSheet.tsx +30 -20
  163. package/src/components/ui/card.tsx +1 -1
  164. package/src/components/ui/scroll-area.tsx +52 -0
  165. package/src/components/ui/sidebar.tsx +22 -29
  166. package/src/components/ui/tabs.tsx +81 -0
  167. package/src/index.ts +26 -19
  168. package/src/lib/api-keys-api.ts +0 -28
  169. package/src/lib/api-keys-rpc.ts +27 -38
  170. package/src/lib/api-rpc.ts +189 -266
  171. package/src/lib/api.ts +19 -102
  172. package/src/lib/bundle-activity.ts +31 -0
  173. package/src/lib/bundle-distribution.ts +81 -0
  174. package/src/lib/console-access.ts +20 -0
  175. package/src/lib/console-features-api.ts +68 -0
  176. package/src/lib/console-features-rpc.ts +13 -0
  177. package/src/lib/console-features.ts +91 -0
  178. package/src/lib/insights-api.ts +56 -2
  179. package/src/lib/insights-errors.ts +64 -0
  180. package/src/lib/insights-failures-rpc.ts +36 -0
  181. package/src/lib/insights-failures.ts +140 -0
  182. package/src/lib/insights-recovery-rpc.ts +43 -6
  183. package/src/lib/insights-recovery.ts +53 -17
  184. package/src/lib/insights-retention.ts +21 -0
  185. package/src/lib/insights-rpc.ts +30 -12
  186. package/src/lib/insights-search.ts +83 -0
  187. package/src/lib/insights-usage-rpc.ts +29 -0
  188. package/src/lib/insights-usage.ts +74 -0
  189. package/src/lib/insights-view.ts +38 -2
  190. package/src/lib/scroll-restoration.ts +21 -0
  191. package/src/lib/server/adminInsights.ts +124 -0
  192. package/src/lib/server/auth.server.ts +13 -5
  193. package/src/lib/server/bundleActivity.ts +37 -0
  194. package/src/lib/server/config.server.ts +21 -74
  195. package/src/lib/server/console-feature-apis.ts +59 -0
  196. package/src/lib/server/console-runtime.server.ts +82 -38
  197. package/src/lib/server/downloadBundle.ts +16 -15
  198. package/src/lib/server/failureReports.ts +49 -0
  199. package/src/lib/server/getBundleChildren.ts +31 -122
  200. package/src/lib/server/insightsRecovery.ts +129 -138
  201. package/src/lib/server/insightsUsage.ts +63 -0
  202. package/src/lib/server/listReleases.ts +109 -44
  203. package/src/lib/server/releaseReachability.ts +8 -7
  204. package/src/lib/server/runtime.server.ts +120 -31
  205. package/src/lib/server/updateFailures.ts +65 -0
  206. package/src/routeTree.gen.ts +44 -44
  207. package/src/router.tsx +3 -2
  208. package/src/routes/-installations-search.ts +32 -8
  209. package/src/routes/-releases-search.ts +76 -29
  210. package/src/routes/__root.tsx +10 -4
  211. package/src/routes/api/bundles/$bundleId/download.ts +2 -5
  212. package/src/routes/api-keys.tsx +5 -2
  213. package/src/routes/index.tsx +167 -104
  214. package/src/routes/insights.tsx +131 -61
  215. package/src/routes/insights_.distribution.tsx +398 -0
  216. package/src/routes/installations.tsx +98 -41
  217. package/src/vite-internal.ts +15 -3
  218. package/src/vite.ts +2 -0
  219. package/.output/public/assets/InsightsErrorAlert-1cg6LDJG.js +0 -1
  220. package/.output/public/assets/InsightsPageHeader-oNIg_lcd.js +0 -1
  221. package/.output/public/assets/InsightsRolloutCard-Zsv9gBjU.js +0 -42
  222. package/.output/public/assets/api-keys-ChJjsbP2.js +0 -1
  223. package/.output/public/assets/api-keys-api-LchP65vQ.js +0 -1
  224. package/.output/public/assets/card-iD7iiy4T.js +0 -1
  225. package/.output/public/assets/chart-no-axes-combined-C0G0fQ3J.js +0 -1
  226. package/.output/public/assets/createServerFn-DHc2erub.js +0 -3
  227. package/.output/public/assets/dialog-DX6o8qCL.js +0 -1
  228. package/.output/public/assets/dist-BPrb_vuw.js +0 -1
  229. package/.output/public/assets/index-C6Nb14xG.js +0 -10
  230. package/.output/public/assets/input-group-Pa3SAbEI.js +0 -1
  231. package/.output/public/assets/insights-C1uKy3p2.js +0 -1
  232. package/.output/public/assets/installations-Bj5AzZ3T.js +0 -1
  233. package/.output/public/assets/installations-DDTw9DSK.js +0 -2
  234. package/.output/public/assets/lazyRouteComponent-BN0MS05o.js +0 -1
  235. package/.output/public/assets/link-BG06whwB.js +0 -1
  236. package/.output/public/assets/loader-circle-Bbp8LGVC.js +0 -1
  237. package/.output/public/assets/preload-helper-B_l5jfgx.js +0 -1
  238. package/.output/public/assets/refresh-cw-DZgiAOMk.js +0 -1
  239. package/.output/public/assets/routes-9E2okfpG.js +0 -1
  240. package/.output/public/assets/routes-B3JviaDV.js +0 -2
  241. package/.output/public/assets/shield-check-DoIiaaXU.js +0 -1
  242. package/.output/public/assets/signing-BKy9fIdB.js +0 -1
  243. package/.output/public/assets/styles-C5-su40i.css +0 -2
  244. package/.output/public/assets/table-bpgpQkPz.js +0 -1
  245. package/.output/public/assets/useOpenInteractionType-4dPacbwb.js +0 -1
  246. package/.output/public/assets/x-Cr_sPM8E.js +0 -1
  247. package/.output/server/_ssr/InsightsErrorAlert-DzDVdfgW.mjs +0 -169
  248. package/.output/server/_ssr/InsightsPageHeader-CZ2AaQGk.mjs +0 -372
  249. package/.output/server/_ssr/InsightsRolloutCard-DHB2iM4t.mjs +0 -693
  250. package/.output/server/_ssr/api-keys-api-KSH04dLB.mjs +0 -60
  251. package/.output/server/_ssr/api-keys-rpc-DBmgnW5o.mjs +0 -136
  252. package/.output/server/_ssr/api-rpc-DX5B6b-L.mjs +0 -1399
  253. package/.output/server/_ssr/auth.server-DF_shCeq.mjs +0 -47
  254. package/.output/server/_ssr/bundle-signing-rpc-C01EKpb-.mjs +0 -16
  255. package/.output/server/_ssr/bundle-signing.server-Co_zHdJx.mjs +0 -12
  256. package/.output/server/_ssr/card-gGh8F6kQ.mjs +0 -108
  257. package/.output/server/_ssr/config-Dv8qLDZ0.mjs +0 -13
  258. package/.output/server/_ssr/config.server-NIXXHk-e.mjs +0 -368
  259. package/.output/server/_ssr/databaseRows-5bCRTxm-.mjs +0 -126
  260. package/.output/server/_ssr/deleteBundle-C71v1GBr.mjs +0 -66
  261. package/.output/server/_ssr/getBundleChildren-CMGSGBWv.mjs +0 -50
  262. package/.output/server/_ssr/insights-oK2n5WBp.mjs +0 -406
  263. package/.output/server/_ssr/insights-recovery-rpc-CgeCAs2K.mjs +0 -16
  264. package/.output/server/_ssr/insightsContract-fjJDBeEE.mjs +0 -303
  265. package/.output/server/_ssr/insightsRecovery-DFkXGFjd.mjs +0 -108
  266. package/.output/server/_ssr/installations-DBmYuVBi.mjs +0 -29
  267. package/.output/server/_ssr/routes-C2RIYhyl.mjs +0 -37
  268. package/.output/server/_ssr/runtime.server-DLZpzphL.mjs +0 -438
  269. package/.output/server/_ssr/server-hgrXpJQY.mjs +0 -7468
  270. package/.output/server/_ssr/signing-bfOvUMSJ.mjs +0 -133
  271. package/.output/server/_ssr/start-DpViQGnt.mjs +0 -4
  272. package/.output/server/_tanstack-start-manifest_v-BAb_a_eC.mjs +0 -97
  273. package/src/components/features/insights/InsightsBundleReports.tsx +0 -51
  274. package/src/components/features/insights/InsightsRolloutCard.tsx +0 -505
  275. package/src/components/features/signing/BundleSigningPage.tsx +0 -139
  276. package/src/lib/bundle-signing-api.ts +0 -14
  277. package/src/lib/bundle-signing-rpc.ts +0 -16
  278. package/src/lib/server/bundle-signing.server.ts +0 -23
  279. package/src/lib/server/deleteBundle.ts +0 -145
  280. package/src/routes/signing.tsx +0 -37
@@ -0,0 +1 @@
1
+ import{t as e}from"./ConsoleFeatureUnavailable-C2A-IEUj.js";var t=e;export{t as notFoundComponent};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/insights-DQsl_Td9.js","assets/ConsoleFeatureUnavailable-C2A-IEUj.js","assets/sidebar-CZeTS8e7.js","assets/console-features-api-Bk59EJ3s.js","assets/empty-XdPINXx1.js","assets/NotFoundPage-jCpnR_sf.js","assets/insights-BszMgsRK.js","assets/preload-helper-I1Qxz43W.js","assets/valueToPercent-Bg4L42av.js","assets/useCompositeListItem-CnQYUiF9.js","assets/field-DzzNtTQg.js","assets/InsightsPageHeader-CD2fNN6p.js","assets/card-CYvj5tZx.js","assets/insights-usage-rpc-D2B6f_Xe.js","assets/EventDetails-Cmr-5qyj.js","assets/input-group-BYLaHtwW.js","assets/dist-D6GJh2KA.js","assets/api-M5QUCPtH.js","assets/useMutation-CowW32bj.js","assets/mutation-T1TB7pc4.js","assets/refresh-cw-Dq9bXycn.js","assets/InsightsInfo-BSBCWe3-.js","assets/table-BkWY5miS.js","assets/insights-recovery-rpc-CTHkGU7B.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./console-features-api-Bk59EJ3s.js";import{C as t,S as n,t as r}from"./preload-helper-I1Qxz43W.js";import{i}from"./InsightsInfo-BSBCWe3-.js";var a=t(`/insights`)({beforeLoad:({context:t})=>e(t.queryClient,`insightsAnalytics`),notFoundComponent:n(()=>r(()=>import(`./insights-DQsl_Td9.js`),__vite__mapDeps([0,1,2,3,4,5])),`notFoundComponent`),component:n(()=>r(()=>import(`./insights-BszMgsRK.js`),__vite__mapDeps([6,2,7,3,8,9,10,11,12,13,14,4,15,16,17,18,19,20,21,22,23])),`component`),validateSearch:i});export{a as t};
@@ -0,0 +1 @@
1
+ import{Fr as e,nr as t,rr as n}from"./sidebar-CZeTS8e7.js";var r=n({method:`GET`}).middleware([t]).handler(e(`b4bf4c461903edcdc44eea52468c737b5b600a586f542138ff022dcbbe86c45c`)),i=n({method:`GET`}).middleware([t]).handler(e(`69cd8e2488b082eb2a22e7058be56ad6566f338c471c62557fa6beed5dc1352a`));export{i as n,r as t};
@@ -0,0 +1 @@
1
+ import{Bn as e,Fr as t,Gr as n,Gt as r,Jn as i,Jr as a,Ln as o,Pr as s,Vt as c,ar as l,nr as u,rr as d}from"./sidebar-CZeTS8e7.js";import{r as f,t as p}from"./valueToPercent-Bg4L42av.js";var m=l(`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=a(n()),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=s();function x(e,t){return t==null?`indeterminate progress`:e||`${t}%`}var S=h.forwardRef(function(t,n){let{format:i,getAriaValueText:a=x,locale:o,max:s=100,min:l=0,value:u,render:d,className:p,children:m,style:_,...v}=t,[S,C]=h.useState(),w=r(i),T=`indeterminate`;Number.isFinite(u)&&(T=u===s?`complete`:`progressing`);let E=f(u,o,w.current),D=h.useMemo(()=>({status:T}),[T]),O={"aria-labelledby":S,"aria-valuemax":s,"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:c,children:`x`})]})},k=h.useMemo(()=>({formattedValue:E,max:s,min:l,setLabelId:C,state:D,status:T,value:u}),[E,s,l,C,D,T,u]),A=e(`div`,t,{state:D,ref:n,props:[O,v],stateAttributesMapping:y});return(0,b.jsx)(g.Provider,{value:k,children:A})}),C=h.forwardRef(function(t,n){let{render:r,className:i,style:a,...o}=t,{state:s}=_();return e(`div`,t,{state:s,ref:n,props:o,stateAttributesMapping:y})}),w=h.forwardRef(function(t,n){let{render:r,className:i,style:a,...o}=t,{max:s,min:c,value:l,state:u}=_(),d=Number.isFinite(l)&&l!==null?p(l,c,s):null;return e(`div`,t,{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:o(`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:o(`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:o(`h-full bg-primary transition-transform motion-reduce:transition-none`,e),...t})}var O=d({method:`GET`}).middleware([u]).handler(t(`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-x-J185Zc.js","assets/ConsoleFeatureUnavailable-C2A-IEUj.js","assets/sidebar-CZeTS8e7.js","assets/console-features-api-Bk59EJ3s.js","assets/empty-XdPINXx1.js","assets/NotFoundPage-jCpnR_sf.js","assets/insights_.distribution-Dmk5sx7P.js","assets/preload-helper-I1Qxz43W.js","assets/valueToPercent-Bg4L42av.js","assets/useCompositeListItem-CnQYUiF9.js","assets/field-DzzNtTQg.js","assets/InsightsPageHeader-CD2fNN6p.js","assets/card-CYvj5tZx.js","assets/insights-usage-rpc-D2B6f_Xe.js","assets/arrow-left-DD46PnTE.js","assets/InsightsInfo-BSBCWe3-.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./console-features-api-Bk59EJ3s.js";import{C as t,S as n,t as r}from"./preload-helper-I1Qxz43W.js";import{r as i}from"./InsightsInfo-BSBCWe3-.js";var a=t(`/insights_/distribution`)({beforeLoad:({context:t})=>e(t.queryClient,`insightsAnalytics`),notFoundComponent:n(()=>r(()=>import(`./insights_.distribution-x-J185Zc.js`),__vite__mapDeps([0,1,2,3,4,5])),`notFoundComponent`),component:n(()=>r(()=>import(`./insights_.distribution-Dmk5sx7P.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,In as t,Nn as n,Pr as r,cr as i}from"./sidebar-CZeTS8e7.js";import{l as a}from"./console-features-api-Bk59EJ3s.js";import{d as ee,s as o}from"./preload-helper-I1Qxz43W.js";import{t as s}from"./arrow-left-DD46PnTE.js";import{a as c,i as l,o as u,r as d,t as f}from"./empty-XdPINXx1.js";import{a as p,c as m,d as h,s as g,t as _,u as v}from"./field-DzzNtTQg.js";import{I as y,a as te,c as b,i as x,l as S,o as C,s as w}from"./valueToPercent-Bg4L42av.js";import{n as T,r as E,t as D}from"./insights-usage-rpc-D2B6f_Xe.js";import{a as O,i as k,n as A,o as j,t as M}from"./card-CYvj5tZx.js";import{i as N,t as P}from"./InsightsInfo-BSBCWe3-.js";import{t as F}from"./insights_.distribution-DTT6zAk9.js";import{i as ne,t as I,u as L}from"./InsightsPageHeader-CD2fNN6p.js";var R=r(),z=20,B=new Intl.DateTimeFormat(`en`,{month:`short`,day:`numeric`,timeZone:`UTC`});function V(){let r=F.useSearch(),V=o(),H=F.useNavigate(),U={platform:r.platform??`all`,channel:r.channel??`production`,appVersion:r.appVersion,window:r.window??`24h`},W=i({queryKey:[`insights`,`app-usage`,U],queryFn:()=>D({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=>!r.version||e.appVersion===r.version),J=q.reduce((e,t)=>e+t.installations,0),Y=Math.max(1,Math.ceil(q.length/z)),X=Math.min(r.page??1,Y),Z=[...new Set([...G?.versions.map(e=>e.name)??[],...r.version?[r.version]:[]])],Q=N(r),$=e=>void H({search:{...r,page:void 0,...e}});return(0,R.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,R.jsx)(I,{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:t({variant:`ghost`,className:`h-11 w-fit sm:h-9`}),children:[(0,R.jsx)(s,{"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)(ne,{twelveMonths:ee(V),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)(E,{"aria-hidden":`true`})})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,R.jsxs)(_,{className:`w-full sm:w-64`,children:[(0,R.jsx)(p,{htmlFor:`distribution-version`,children:`App version`}),(0,R.jsxs)(x,{items:Object.fromEntries([[`all`,`All versions`],...Z.map(e=>[`version:${e}`,e])]),value:r.version?`version:${r.version}`:`all`,onValueChange:e=>{e!==null&&$({version:e===`all`?void 0:e.slice(8)})},children:[(0,R.jsx)(b,{id:`distribution-version`,className:`min-h-11 w-full sm:min-h-9`,children:(0,R.jsx)(S,{})}),(0,R.jsx)(te,{children:(0,R.jsxs)(C,{children:[(0,R.jsx)(w,{value:`all`,children:`All versions`}),Z.map(e=>(0,R.jsx)(w,{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)(g,{variant:`outline`,className:`gap-1.5`,children:[U.platform===`all`?null:(0,R.jsx)(y,{platform:U.platform,className:`size-3.5`}),U.platform===`all`?`All platforms`:U.platform===`ios`?`iOS`:`Android`]}),(0,R.jsx)(g,{variant:`outline`,children:U.channel}),U.appVersion?(0,R.jsxs)(g,{variant:`outline`,children:[`Reports from `,U.appVersion]}):null]})]}),(0,R.jsxs)(M,{"aria-label":`Bundles by app version`,role:`region`,className:`min-w-0`,children:[(0,R.jsxs)(O,{className:`flex flex-col gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(j,{children:`Bundles by app version`}),(0,R.jsxs)(P,{label:`How bundle distribution is counted`,children:[`Each installation counts once by its latest matching report`,` `,K,`. Latest reports are counted by UTC day. Share is within its app version. Unknown bundle means no deployment ID was observed for the reported file. These counts describe reporting installations, not all installed devices.`]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[W.isPending?(0,R.jsx)(n,{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)(A,{className:`flex min-w-0 flex-col gap-4`,children:[G?.truncated?(0,R.jsxs)(m,{children:[(0,R.jsx)(h,{children:`Partial history`}),(0,R.jsxs)(v,{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)(n,{"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)(L,{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)(f,{children:[(0,R.jsxs)(l,{children:[(0,R.jsx)(c,{children:`No bundles reported`}),(0,R.jsx)(d,{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)(y,{platform:e.platform,className:`size-3.5`}),e.platform===`ios`?`iOS`:`Android`]})]}),(0,R.jsx)(`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)(u,{"aria-hidden":`true`,className:`size-3.5 shrink-0`})]}):(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Unknown bundle`})}),(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)(T,{"aria-label":`${e.releaseId??`Unknown bundle`} share in ${e.appVersion} on ${e.platform}`,value:n})]})]},JSON.stringify([e.appVersion,e.platform,e.releaseId]))})})]})]}),G&&q.length>0?(0,R.jsxs)(k,{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{V as component};
@@ -0,0 +1 @@
1
+ import{t as e}from"./ConsoleFeatureUnavailable-C2A-IEUj.js";var t=e;export{t as notFoundComponent};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/installations-BcENidrS.js","assets/ConsoleFeatureUnavailable-C2A-IEUj.js","assets/sidebar-CZeTS8e7.js","assets/console-features-api-Bk59EJ3s.js","assets/empty-XdPINXx1.js","assets/NotFoundPage-jCpnR_sf.js","assets/installations-BF2P7U-4.js","assets/preload-helper-I1Qxz43W.js","assets/InsightsPageHeader-CD2fNN6p.js","assets/useCompositeListItem-CnQYUiF9.js","assets/field-DzzNtTQg.js","assets/card-CYvj5tZx.js","assets/EventDetails-Cmr-5qyj.js","assets/input-group-BYLaHtwW.js","assets/dist-D6GJh2KA.js","assets/arrow-left-DD46PnTE.js","assets/refresh-cw-Dq9bXycn.js","assets/table-BkWY5miS.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./console-features-api-Bk59EJ3s.js";import{C as t,S as n,t as r}from"./preload-helper-I1Qxz43W.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=t(`/installations`)({beforeLoad:({context:t})=>e(t.queryClient,`insights`),notFoundComponent:n(()=>r(()=>import(`./installations-BcENidrS.js`),__vite__mapDeps([0,1,2,3,4,5])),`notFoundComponent`),component:n(()=>r(()=>import(`./installations-BF2P7U-4.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{Fn as e,Gr as t,In as n,Jr as r,Ln as i,Nn as a,Pn as o,Pr as s,ar as c,ir as l}from"./sidebar-CZeTS8e7.js";import{d as u,l as d,u as f}from"./console-features-api-Bk59EJ3s.js";import{a as p,c as m,i as h,n as g,o as _,r as v,s as y,t as b}from"./installations-2Z3CVLeT.js";import{T as x,a as S,i as C,l as w,o as ee,r as te,s as ne,u as T}from"./preload-helper-I1Qxz43W.js";import{a as E,n as D,o as O,r as k,t as A}from"./EventDetails-Cmr-5qyj.js";import{t as re}from"./arrow-left-DD46PnTE.js";import{o as j}from"./empty-XdPINXx1.js";import{a as M,f as N,t as P}from"./field-DzzNtTQg.js";import{o as F}from"./useCompositeListItem-CnQYUiF9.js";import{c as ie,i as ae,n as oe,r as se,s as I,t as ce}from"./input-group-BYLaHtwW.js";import{t as L}from"./refresh-cw-Dq9bXycn.js";import{a as R,n as z,o as B,r as V,t as H}from"./card-CYvj5tZx.js";import{a as U,i as W,n as le,o as G,r as K,t as ue}from"./table-BkWY5miS.js";import{r as de,t as fe,u as q}from"./InsightsPageHeader-CD2fNN6p.js";function pe(){m(u(),!0)}function me(e){return pe(),y(u(),e)}function he(e){let t=u();return f(t.stores.location,x(e,t))}var ge=c(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),J=r(t(),1),Y=s();function _e({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)(k,{event:e}),(0,Y.jsx)(`div`,{className:`text-xs tabular-nums`,children:(0,Y.jsx)(D,{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)(A,{event:e,touch:!0})})]},e.id))})]})}function X({hasPrevious:t,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)(e,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:!t,onClick:a,size:`sm`,type:`button`,variant:`outline`,children:`Previous`}),(0,Y.jsx)(e,{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 ve=e=>v.filter((t,n)=>n===0||p[t].durationMs<=e*864e5);function ye({event:e,eventsLocation:t,touch:r=!1}){return(0,Y.jsxs)(`div`,{className:r?`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:n({className:r?`-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:r?`min-w-0 text-left wrap-anywhere`:`truncate`,children:e.userId??`Anonymous installation`}),(0,Y.jsx)(j,{"aria-hidden":`true`,"data-icon":`inline-end`})]}),(0,Y.jsx)(I,{value:e.installId,maxLength:13,buttonClassName:r?`min-h-11 px-3`:void 0})]})}function be({children:t,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:g=90,title:v=`All events`}){let y=O(),b=m>1,x=ve(g),S=h===void 0?void 0:_(h),C=S!==void 0&&x.includes(S)?S:void 0,w=C!==void 0&&d?(0,Y.jsx)(e,{className:`h-11 px-3 lg:h-8`,onClick:()=>d(C),type:`button`,variant:`outline`,children:`Show the last ${p[C].period}`}):null;return(0,Y.jsxs)(H,{className:`@container min-w-0 shadow-sm`,"aria-busy":s,children:[(0,Y.jsxs)(R,{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)(B,{children:(0,Y.jsx)(`h2`,{children:v})}),(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:x.map(e=>({value:e,name:`Last ${p[e].period}`}))}):null,(0,Y.jsxs)(e,{className:`h-11 lg:h-8`,disabled:s,onClick:f,size:`lg`,variant:`outline`,children:[(0,Y.jsx)(L,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]})]})]}),n?(0,Y.jsx)(V,{children:n}):null]}),t]}),(0,Y.jsx)(z,{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)(_e,{events:o.data,formatter:y,renderIdentity:e=>(0,Y.jsx)(ye,{event:e,eventsLocation:i,touch:!0})})}),(0,Y.jsx)(`div`,{className:`hidden @[58rem]:block`,children:(0,Y.jsxs)(ue,{className:`min-w-4xl table-fixed`,children:[(0,Y.jsx)(U,{children:(0,Y.jsxs)(G,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,Y.jsx)(W,{className:`w-64`,children:`Time`}),(0,Y.jsx)(W,{className:`w-48`,children:`Event`}),(0,Y.jsx)(W,{className:`w-48`,children:`User / installation`}),(0,Y.jsx)(W,{className:`w-32`,children:`App`}),(0,Y.jsx)(W,{className:`w-52`,children:`Bundle`})]})}),(0,Y.jsx)(le,{children:o.data.map(e=>(0,Y.jsxs)(G,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,Y.jsx)(K,{className:`whitespace-normal text-xs tabular-nums`,children:(0,Y.jsx)(D,{value:e.receivedAtMs,formatter:y})}),(0,Y.jsx)(K,{children:(0,Y.jsx)(k,{event:e})}),(0,Y.jsx)(K,{children:(0,Y.jsx)(ye,{event:e,eventsLocation:i})}),(0,Y.jsx)(K,{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)(K,{className:`whitespace-normal text-xs`,children:(0,Y.jsx)(A,{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:b?`No older events in this range.`:h===void 0?v===`All events`?`No events recorded yet`:`No matching reports in this period`:`No events in the last ${p[h].period}.`}),b?null:w]}),h!==void 0&&o.nextCursor===null&&(o.data.length>0||b)?(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`}),w]}):null,o.data.length>0||b||o.nextCursor?(0,Y.jsx)(X,{hasPrevious:b,label:v,nextCursor:o.nextCursor,onNext:l,onPrevious:u,pageLength:o.data.length,pageNumber:m}):null]}):null})]})}var xe=e=>e.userId??`—`,Se=e=>`lastKnownBundleId`in e?e.lastKnownBundleId:e.type===`UPDATE_DOWNLOADED`||e.type===`UPDATE_FAILED`?e.fromBundleId:e.toBundleId;function Ce({error:t,history:n,isLoading:r,onNext:i,onPrevious:s,onRefresh:c,pageNumber:l,retention:u=w,selectedEvent:d,selectedInstallId:f}){let p=O(),m=d?Se(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)(H,{className:`@container min-h-0 min-w-0 shadow-sm`,children:[(0,Y.jsx)(R,{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)(B,{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)(V,{children:[`Bundle changes and update failures are kept for`,` `,T(u.rawDays),`; the latest report, for`,` `,T(u.dailyDays),` after the installation last reports.`]})]}),c&&f!==void 0?(0,Y.jsxs)(e,{className:`h-11 lg:h-8`,size:`lg`,variant:`outline`,onClick:c,disabled:r,children:[(0,Y.jsx)(L,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]}):null]})}),(0,Y.jsxs)(z,{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:xe(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)(I,{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.jsx)(`dd`,{className:`mt-1 font-mono text-xs`,children:m?(0,Y.jsx)(I,{value:m,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`}):`—`})]}),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 · Pending apply`}),(0,Y.jsx)(`dd`,{className:`mt-1 text-xs`,children:(0,Y.jsx)(I,{value:h})})]}):null]}),d.httpResponse?(0,Y.jsx)(`div`,{className:`mt-4`,children:(0,Y.jsx)(E,{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`})]}):t?(0,Y.jsx)(`div`,{className:`p-6`,children:(0,Y.jsx)(q,{error:t instanceof Error?t: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)(_e,{events:n.data,formatter:p})}),(0,Y.jsx)(`div`,{className:`hidden @[48rem]:block`,children:(0,Y.jsxs)(ue,{className:`min-w-3xl table-fixed`,children:[(0,Y.jsx)(U,{children:(0,Y.jsxs)(G,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,Y.jsx)(W,{className:`w-64`,children:`Time`}),(0,Y.jsx)(W,{className:`w-48`,children:`Event`}),(0,Y.jsx)(W,{className:`w-32`,children:`App`}),(0,Y.jsx)(W,{className:`w-52`,children:`Bundle`})]})}),(0,Y.jsx)(le,{children:n.data.map(e=>(0,Y.jsxs)(G,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,Y.jsx)(K,{className:`whitespace-normal text-xs tabular-nums`,children:(0,Y.jsx)(D,{value:e.receivedAtMs,formatter:p})}),(0,Y.jsx)(K,{children:(0,Y.jsx)(k,{event:e})}),(0,Y.jsx)(K,{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)(K,{className:`whitespace-normal text-xs`,children:(0,Y.jsx)(A,{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 we=e=>e.lastKnownBundleId,Te=e=>e.userId??`—`;function Ee({error:t,onNext:r,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=!t&&c&&c.data.length>0;return(0,Y.jsxs)(H,{className:`min-h-0 min-w-0 shadow-sm`,children:[(0,Y.jsx)(R,{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)(B,{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)(e,{"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)(F,{"aria-hidden":`true`,className:i(u&&`rotate-180`)})}):null})]})}),(0,Y.jsxs)(z,{className:i(`min-h-0 p-0`,m&&!u&&`hidden lg:block`),id:f,children:[t?(0,Y.jsx)(`div`,{className:`p-6`,children:(0,Y.jsx)(q,{error:t instanceof Error?t: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=we(e),n=e.installId===l;return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{"aria-label":`${Te(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:Te(e)}),n?(0,Y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs font-medium text-primary`,children:[(0,Y.jsx)(N,{"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:ie(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:ie(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:n({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:r,onPrevious:a,pageLength:c.data.length,pageNumber:s}):null]})]})}function De({draftQuery:t,onDraftQueryChange:n,onSubmit:r,onClear:i}){return(0,Y.jsx)(`form`,{"aria-label":`Find installation`,onSubmit:e=>{e.preventDefault(),t.trim()&&r()},role:`search`,children:(0,Y.jsxs)(P,{className:`gap-2`,children:[(0,Y.jsx)(M,{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)(ce,{className:`h-11 w-auto min-w-0 flex-1 basis-44 lg:h-8`,children:[(0,Y.jsx)(oe,{children:(0,Y.jsx)(ge,{"aria-hidden":`true`})}),(0,Y.jsx)(ae,{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:t}),t.length>0?(0,Y.jsx)(oe,{align:`inline-end`,children:(0,Y.jsx)(se,{"aria-label":`Clear installation lookup`,className:`size-11 lg:size-5`,onClick:i,size:`icon-xs`,children:(0,Y.jsx)(l,{"aria-hidden":`true`})})}):null]}),(0,Y.jsx)(e,{"aria-label":`Find installation`,className:`h-11 px-3 lg:h-8`,disabled:t.trim().length===0,size:`lg`,type:`submit`,variant:`outline`,children:`Find`})]})]})})}function Oe(){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 ke=20,Ae=50,Z=()=>Date.now(),Q=(e,t)=>[...e,t??``],$=e=>({cursor:e?.at(-1)||void 0,stack:e.slice(0,-1)});function je(){let t=b.useSearch(),n=b.useNavigate(),r=ne(),[i,a]=(0,J.useState)(t.query??``),[o]=(0,J.useState)(Z),[s]=(0,J.useState)(Z),c=he({select:e=>e.state.insightsPagination}),l=c?.eventsBack??[],u=c?.searchBack??[],d=c?.historyBack??[],f=t.query?.trim()??``,p=f.length>0,m=t.installId!==void 0,_=p||m,v=t.eventsBefore??o,y=t.eventsRange??`7d`,x=t.historyBefore??s,w=(e,r=!1,i={})=>{n({to:`/installations`,search:{...t,...e},state:e=>({...e,insightsPagination:{...e.insightsPagination,...i}}),replace:r})};(0,J.useEffect)(()=>{a(t.query??``)},[t.query]),(0,J.useEffect)(()=>{t.eventsBefore===void 0&&w({eventsBefore:v},!0)},[v,t.eventsBefore]),(0,J.useEffect)(()=>{m&&t.historyBefore===void 0&&w({historyBefore:x},!0)},[m,x,t.historyBefore]);let E=te({...h(y,v),cursor:t.eventsCursor,limit:20},!_),D=ee({cursor:t.searchCursor,identity:f,limit:ke},p);(0,J.useEffect)(()=>{let e=D.data?.data[0]?.installId;!p||m||e===void 0||w({historyBefore:Z(),historyCursor:void 0,installId:e},!0,{historyBack:[]})},[p,m,D.data?.data]);let O=S(t.installId??``,m),k=C({beforeReceivedAtMs:x,cursor:t.historyCursor,installId:t.installId??``,limit:Ae},m),A=O.data??D.data?.data.find(({installId:e})=>e===t.installId)??k.data?.data[0],j=_?`installation-history-${t.historyCursor??`first`}`:`all-events-${t.eventsCursor??`first`}`,M=(0,J.useRef)(null),N=me({id:j,getKey:g});(0,J.useLayoutEffect)(()=>{!_&&!E.isLoading&&M.current&&(M.current.scrollTop=N?.scrollY??0)},[E.isLoading,_,N?.scrollY,j]);let P=()=>{a(``),w({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:void 0,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})},F=(0,Y.jsx)(De,{draftQuery:i,onClear:P,onDraftQueryChange:a,onSubmit:()=>{let e=i.trim();if(!e){P();return}w({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)(fe,{view:`events`}),(0,Y.jsx)(`div`,{ref:M,"data-scroll-restoration-id":j,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:[_?(0,Y.jsx)(H,{className:`shadow-sm`,children:(0,Y.jsxs)(z,{className:`flex flex-col gap-3 p-4 sm:p-6`,children:[(0,Y.jsxs)(e,{className:`-ml-2 h-11 self-start lg:h-8`,onClick:P,variant:`ghost`,children:[(0,Y.jsx)(re,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Back to all events`]}),F]})}):null,_?D.isLoading&&p?(0,Y.jsx)(Oe,{}):(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)(Ee,{error:D.error,onNext:()=>{D.data?.nextCursor&&w({installId:void 0,searchCursor:D.data.nextCursor},!0,{searchBack:Q(u,t.searchCursor)})},onPrevious:()=>{let e=$(u);w({installId:void 0,searchCursor:e.cursor},!0,{searchBack:e.stack})},onSelect:e=>{w({historyBefore:Z(),historyCursor:void 0,installId:e},!1,{historyBack:[]})},pageNumber:u.length+1,results:D.data,selectedInstallId:t.installId}):null,(0,Y.jsx)(Ce,{error:k.error??O.error,history:k.data,isLoading:k.isLoading||O.isLoading,onNext:()=>{k.data?.nextCursor&&w({historyCursor:k.data.nextCursor},!0,{historyBack:Q(d,t.historyCursor)})},onPrevious:()=>{let e=$(d);w({historyCursor:e.cursor},!0,{historyBack:e.stack})},onRefresh:()=>{w({historyBefore:Z(),historyCursor:void 0},!0,{historyBack:[]})},pageNumber:d.length+1,retention:r,selectedEvent:A,selectedInstallId:t.installId})]}):(0,Y.jsx)(be,{description:`Downloads, applies, recoveries, and update failures, newest first, kept for ${T(r.rawDays)}. A launch without an update counts in App usage and in its installation's latest report.`,error:E.error,eventsLocation:{eventsBefore:v,eventsCursor:t.eventsCursor,eventsRange:t.eventsRange},history:E.data,isFetching:E.isFetching,isLoading:E.isLoading,onNext:()=>{E.data?.nextCursor&&w({eventsCursor:E.data.nextCursor},!0,{eventsBack:Q(l,t.eventsCursor)})},onPrevious:()=>{let e=$(l);w({eventsCursor:e.cursor},!0,{eventsBack:e.stack})},onRangeChange:e=>{w({eventsBefore:Z(),eventsCursor:void 0,eventsRange:e},!1,{eventsBack:[]})},onRefresh:()=>{w({eventsBefore:Z(),eventsCursor:void 0},!0,{eventsBack:[]})},pageNumber:l.length+1,range:y,rawDays:r.rawDays,children:F})]})},j)]})}export{je as component};
@@ -0,0 +1 @@
1
+ import{t as e}from"./ConsoleFeatureUnavailable-C2A-IEUj.js";var t=e;export{t as notFoundComponent};
@@ -0,0 +1 @@
1
+ import{ar as e}from"./sidebar-CZeTS8e7.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{_r as e,hr as t,mr as n}from"./sidebar-CZeTS8e7.js";var r=class extends n{#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(e){let n=()=>{this.#i({type:`continue`})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},i=this.#r=t({fn:()=>this.options.mutationFn?this.options.mutationFn(e,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:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:o})}let t=await i.start();return await this.#n.config.onSuccess?.(t,e,this.state.context,this,r),await this.options.onSuccess?.(t,e,this.state.context,r),await this.#n.config.onSettled?.(t,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(t,null,e,this.state.context,r),this.#i({type:`success`,data:t}),t}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===i&&(this.#r=void 0),this.#n.runNext(this)}}#i(t){this.state=(e=>{switch(t.type){case`failed`:return{...e,failureCount:t.failureCount,failureReason:t.error};case`pause`:return{...e,isPaused:!0};case`continue`:return{...e,isPaused:!1};case`pending`:return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:`pending`,variables:t.variables,submittedAt:Date.now()};case`success`:return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:`error`}}})(this.state),e.batch(()=>{this.#t.forEach(e=>{e.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:`updated`,action:t})})}};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{Br as e,Fr as t,Gr as n,Jr as r,Pr as i,Rr as a,ar as o,cr as s,fr as ee,lr as c,nr as l,pr as te,rr as u,ur as d}from"./sidebar-CZeTS8e7.js";import{P as f,R as ne,b as re,d as p,h as m,l as h,u as g,x as ie}from"./console-features-api-Bk59EJ3s.js";var _=`__root__`,v=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=_:this.parentRoute||a();let r=n?_:t?.path;r&&r!==`/`&&(r=re(r));let i=t?.id||r,o=n?_:m((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let s=o===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:m(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=o,this._fullPath=s,this._to=ie(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=t=>e({from:this.fullPath,...t}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},ae=class extends v{constructor(e){super(e)}},oe=class extends d{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:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:ee(t,n.data),hasPreviousPage:te(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}};function se(e,t){return c(e,oe,t)}var y=r(n(),1),b=y.use,x=y.useLayoutEffect,S=y.createContext(void 0),ce=y.createContext(void 0),C={};function w(e,t){let n=y.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=ne(n.current,i):i}}function T(e){let t=p(),n=y.useContext(e.from?ce:S),r=e.from??n,i=t.stores.getMatchStore(r),o=w(e,t),s=g(i,e=>e?o(e):C);if(s!==C)return s;(e.shouldThrow??!0)&&a()}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=p();return y.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=i(),N=class extends v{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=y.forwardRef((e,t)=>(0,M.jsx)(h,{ref:t,from:this.fullPath,...e}))}};function P(e){return new N(e)}function F(){return e=>L(e)}var I=class extends ae{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=y.forwardRef((e,t)=>(0,M.jsx)(h,{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(f(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(b)b(a());else throw a();return y.createElement(r,e)};return o.preload=a,o}var B=o(`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=o(`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}};function U(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 W=({failedUpdates:e,downloads:t})=>e+t===0?null:e/(e+t),G=({patchDownloads:e,patchFallbacks:t})=>e+t===0?null:t/(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`},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=u({method:`GET`}).middleware([l]).handler(t(`0d1dacdd1e5ee6b100e5c142fb9af03602b6f2c6fe6af79312b36c223d7f8f97`)),he=u({method:`GET`}).middleware([l]).handler(t(`b4388826a9b515fb4d2113270aa8ded1c50ba13d7f07ac2b268c41396e87d0a3`)),Y={rawDays:90,dailyDays:400},ge=e=>`${e.toLocaleString(`en`)} ${e===1?`day`:`days`}`,_e=({dailyDays:e})=>e>=364;u({method:`GET`}).middleware([l]).handler(t(`ff00311d412c8cdfa8ad5b0ba1eb6aa7471d0cc12170e6cc645deb91603d42dd`));var ve=u({method:`GET`}).middleware([l]).handler(t(`d4c50f40701055145f24873dc90f3c55a5494457a6a03a743339b2ac4545eb19`)),ye=u({method:`GET`}).middleware([l]).handler(t(`3c04bc6624be6dfdd80cf96819f9c6d0455e59a7bb4c0374b6afb0162ffd15b0`)),be=u({method:`GET`}).middleware([l]).handler(t(`6726f1ed9eda1f0cb4c1f1ad1023faee435ddcfd0b7c55ef08ca7f2f7f577370`)),xe=u({method:`GET`}).middleware([l]).handler(t(`c6f18db42ac40385dbff247095197ee9f3fd3a97dc914efd368ce0ded1f098c6`)),Se=u({method:`GET`}).middleware([l]).handler(t(`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:U(e)}),enabled:t,refetchOnWindowFocus:!0,staleTime:X}),De=()=>s({queryKey:[`insights`,`retention`],queryFn:()=>xe(),staleTime:1/0}).data??Y,Oe=(e,t)=>se({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{R as C,b as D,S as E,x as O,z as S,w as T,K as _,Q as a,V as b,Ee as c,_e as d,le as f,q as g,W as h,Te as i,_ 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,F as w,B as x,G as y};
@@ -0,0 +1 @@
1
+ import{ar as e}from"./sidebar-CZeTS8e7.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,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-DwBZ3XAM.js","assets/sidebar-CZeTS8e7.js","assets/dialog-JCXymiUi.js","assets/valueToPercent-Bg4L42av.js","assets/useCompositeListItem-CnQYUiF9.js","assets/field-DzzNtTQg.js","assets/console-features-api-Bk59EJ3s.js","assets/api-M5QUCPtH.js","assets/useMutation-CowW32bj.js","assets/mutation-T1TB7pc4.js","assets/input-group-BYLaHtwW.js","assets/dist-D6GJh2KA.js","assets/loader-circle-OFX0xgRO.js","assets/card-CYvj5tZx.js","assets/InsightsInfo-BSBCWe3-.js","assets/preload-helper-I1Qxz43W.js","assets/table-BkWY5miS.js"])))=>i.map(i=>d[i]);
2
+ import{In as e,Ln as t,Nn as n,Pn as r,Pr as i,ar as a,cr as o}from"./sidebar-CZeTS8e7.js";import{a as s,i as c,l,o as u}from"./console-features-api-Bk59EJ3s.js";import{C as d,S as f,c as p,h as m,t as h,v as g,x as _}from"./preload-helper-I1Qxz43W.js";import{n as v}from"./loader-circle-OFX0xgRO.js";import{a as y,i as b,n as x,o as S,t as C}from"./card-CYvj5tZx.js";import{t as w}from"./insights-recovery-rpc-CTHkGU7B.js";import{n as T,t as E}from"./InsightsInfo-BSBCWe3-.js";var D=a(`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`}]]),O=a(`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`}]]),k=i(),A={apiKeys:{navigation:{icon:(0,k.jsx)(v,{}),paths:[`/api-keys`],link:({onClick:e})=>(0,k.jsx)(l,{to:`/api-keys`,onClick:e})}}};function j(e){let t=[...e].sort((e,t)=>e.releaseId.localeCompare(t.releaseId));return o({queryKey:[`bundle-activity`,t],queryFn:()=>w({data:t}),enabled:t.length>0,staleTime:3e4})}var M=[{label:`Downloads`,field:`downloads`,color:`text-primary/85`},{label:`Active days`,field:`activeDays`,color:`text-success/85`},{label:`Known crashes`,field:`failedLaunches`,color:`text-warning/85`}],N=e=>{let t=e.activeDays+e.failedLaunches;return t===0?`—`:`${(e.failedLaunches/t*100).toFixed(2)}%`};function P(){return(0,k.jsx)(E,{label:`About release insight metrics`,children:`Active days count each installation once for each UTC day it launched this release. Known crashes are reported OTA launch failures that triggered recovery. The rate is known crashes divided by active days plus known crashes.`})}function F({report:e,loading:r=!1,input:i,variant:a=`inline`}){if(!e)return r?(0,k.jsx)(n,{"aria-label":`Loading release insights`,className:a===`card`?`h-16 w-full`:`h-4 w-40`}):(0,k.jsx)(`span`,{"aria-label":`Release insights unavailable`,className:`text-sm text-muted-foreground`,children:`—`});let o=(0,k.jsx)(`dl`,{className:t(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:M.map(({label:n,field:r,color:i})=>(0,k.jsxs)(`div`,{className:t(`flex`,a===`card`?`min-w-0 flex-col gap-1`:`items-baseline gap-1.5 whitespace-nowrap`),children:[(0,k.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n}),(0,k.jsxs)(`dd`,{className:t(`flex flex-wrap items-baseline gap-x-1.5 tabular-nums`,a===`card`?`text-xl font-semibold`:`text-sm font-medium`,e[r]>0?i:`text-muted-foreground`),children:[e[r].toLocaleString(),r===`failedLaunches`?(0,k.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,N(e),`)`]}):null]})]},r))});return(0,k.jsxs)(`div`,{className:t(`flex`,a===`card`?`flex-col gap-2`:`items-center gap-1`),children:[i?(0,k.jsx)(l,{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:`7d`},children:o}):o,e.coverage.kind===`partial`?(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Partial`}):null,a===`inline`?(0,k.jsx)(P,{}):null]})}function I({input:e}){let r=p({platform:e.platform,channel:e.channel,releaseId:e.releaseId}),i=r.data;return(0,k.jsxs)(`div`,{className:`flex items-center gap-1`,children:[i?(0,k.jsx)(`dl`,{children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,k.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Download failures`}),(0,k.jsxs)(`dd`,{className:t(`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,k.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,g(m(i)),`)`]})]})]})}):r.isPending?(0,k.jsx)(n,{"aria-label":`Loading download failures`,className:`h-4 w-40`}):(0,k.jsx)(`span`,{"aria-label":`Download failures unavailable`,className:`text-sm text-muted-foreground`,children:`—`}),(0,k.jsx)(E,{label:`About download failures`,children:`Reported failures to download or install this release, since its first report; each client reports one at most once a UTC day. The rate is the failure rate of update attempts: failures divided by failures plus download reports.`})]})}function L({input:t}){let n=j([t]);return(0,k.jsxs)(C,{children:[(0,k.jsxs)(y,{className:`flex-row items-center justify-between px-4 pt-4 pb-3`,children:[(0,k.jsx)(S,{className:`text-sm font-medium`,children:`Insights`}),(0,k.jsx)(P,{})]}),(0,k.jsxs)(x,{className:`flex flex-col gap-3 px-4 pb-4`,children:[(0,k.jsx)(F,{variant:`card`,input:t,loading:n.isFetching,report:n.data?.[t.releaseId]}),(0,k.jsx)(r,{}),(0,k.jsx)(I,{input:t})]}),(0,k.jsx)(b,{className:`px-4 pb-4`,children:(0,k.jsxs)(l,{className:e({variant:`outline`,size:`sm`}),to:`/insights`,search:{healthPlatform:t.platform,healthChannel:t.channel,releaseId:t.releaseId,bundleWindow:T(t.releaseId),healthChart:`adoption`},children:[(0,k.jsx)(D,{"aria-hidden":`true`,"data-icon":`inline-start`}),`View adoption`]})})]})}function R({input:e}){return c(`insightsAnalytics`)?null:(0,k.jsxs)(C,{children:[(0,k.jsx)(y,{className:`px-4 pt-4 pb-3`,children:(0,k.jsx)(S,{className:`text-sm font-medium`,children:`Insights`})}),(0,k.jsx)(x,{className:`px-4 pb-4`,children:(0,k.jsx)(I,{input:e})})]})}function z({releaseId:e,releases:t}){let n=j(t);return(0,k.jsx)(F,{input:t.find(t=>t.releaseId===e),loading:n.isFetching,report:n.data?.[e]})}var B={Cell:z},V={insights:{navigation:{icon:(0,k.jsx)(_,{}),paths:[`/insights`,`/insights/distribution`,`/installations`],link:({features:e,onClick:t})=>e.insightsAnalytics?(0,k.jsx)(l,{to:`/insights`,onClick:t}):(0,k.jsx)(l,{to:`/installations`,onClick:t})},releaseSection:({release:e})=>(0,k.jsx)(R,{input:e})},insightsAnalytics:{releaseColumn:B,releaseSection:({release:e})=>(0,k.jsx)(L,{input:e})},...A},H=Object.keys(u),U=()=>{let e=s().data?.features;return e===void 0?[]:H.flatMap(t=>{let n=V[t];return n!==void 0&&e[t]?[{...n,feature:t,label:u[t].label,features:e}]:[]})},W=()=>U().flatMap(({feature:e,label:t,releaseColumn:n})=>n===void 0?[]:[{...n,feature:e,label:t}]);function G({release:e}){return U().map(({feature:t,releaseSection:n})=>n===void 0?null:(0,k.jsx)(n,{release:e},t))}var K=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function q(e){let t=K(e.beforeReleaseId),n=t?void 0:K(e.afterReleaseId),r=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0,i=K(e.bundleId),a=i?void 0:K(e.scopeKey),o=i||a?void 0:K(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:K(e.releaseId),scopeKey:a}}function J(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 Y(e){return J(e).kind!==`all`}function X(e,t){let n={...e,...t};return t.bundleId?q({bundleId:n.bundleId}):t.scopeKey?q({scopeKey:n.scopeKey,enabled:n.enabled}):`channelId`in t||`platform`in t?q({channelId:n.channelId,enabled:n.enabled,platform:n.platform}):q({bundleId:n.bundleId,channelId:n.channelId,enabled:n.enabled,platform:n.platform,scopeKey:n.scopeKey})}var Z=d(`/`)({component:f(()=>h(()=>import(`./routes-DwBZ3XAM.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])),`component`),validateSearch:q});export{G as a,O as c,X as i,Y as n,U as o,J as r,W as s,Z as t};
@@ -0,0 +1 @@
1
+ import{$n as e,$t as t,Bn as n,F as r,Fn as i,Gn as a,Gr as o,Gt as s,H as c,Hn as l,Ht as u,I as d,In as f,Jn as p,Jr as m,Jt as h,Kr as g,Kt as _,L as v,Ln as y,M as b,Nn as x,P as S,Pn as C,Pr as w,R as T,U as E,Un as ee,Ut as te,Vt as ne,Wn as re,Wt as ie,Xn as ae,Yn as oe,Z as se,Zn as D,_ as ce,_n as le,ar as O,b as k,ct as ue,er as A,fn as de,g as j,gn as M,h as N,ir 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-CZeTS8e7.js";import{l as V}from"./console-features-api-Bk59EJ3s.js";import{a as ve,c as H,d as ye,f as be,g as U,h as W,i as xe,l as Se,m as Ce,n as we,o as Te,p as Ee,r as De,s as Oe,t as ke,u as Ae}from"./api-M5QUCPtH.js";import{a as je,c as Me,i as Ne,n as Pe,r as Fe,s as Ie,t as G}from"./routes-BiY8Stye.js";import{a as Le,c as Re,d as ze,f as Be,i as Ve,n as He,o as Ue,r as We,s as K,t as Ge,u as Ke}from"./field-DzzNtTQg.js";import{a as qe,i as Je,n as Ye,o as Xe,r as Ze}from"./useCompositeListItem-CnQYUiF9.js";import{A as Qe,F as $e,I as et,N as tt,O as nt,_ as rt,a as it,c as at,h as ot,i as st,k as ct,l as lt,m as ut,n as dt,o as ft,s as pt,t as mt,u as ht,v as gt}from"./valueToPercent-Bg4L42av.js";import{a as _t,i as vt,l as yt,n as bt,o as xt,s as St,t as Ct,u as wt}from"./input-group-BYLaHtwW.js";import{t as Tt}from"./loader-circle-OFX0xgRO.js";import{a as Et,c as Dt,d as Ot,f as kt,g as At,i as jt,l as Mt,m as Nt,n as Pt,o as Ft,p as It,r as Lt,s as Rt,t as zt,u as Bt,v as Vt}from"./dialog-JCXymiUi.js";import{a as Ht,n as Ut,o as Wt,r as Gt,s as Kt,t as qt}from"./card-CYvj5tZx.js";import{n as q}from"./dist-D6GJh2KA.js";import{a as Jt,c as Yt,d as Xt,h as Zt,l as Qt,m as $t,o as en,p as tn,s as nn,u as rn}from"./InsightsInfo-BSBCWe3-.js";import{a as an,i as J,n as on,o as sn,r as Y,t as cn}from"./table-BkWY5miS.js";var ln=O(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),un=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`}]]),dn=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`}]]),fn=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`}]]),pn=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`}]]),mn=O(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),hn=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`}]]),gn=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`}]]),_n=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=m(o(),1),Z=w();function vn({bundleId:e,className:t}){return(0,Z.jsx)(`span`,{translate:`no`,className:y(`break-all font-mono text-xs tabular-nums`,t),children:e})}var 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)(K,{variant:`outline`,className:y(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)(Be,{className:y(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(mn,{className:y(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Z.jsx)(P,{className:y(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}var Sn=g(((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=g(((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=m(Sn(),1),Tn=m(Cn(),1);wn.default.extend(Tn.default);function En({uuid:e,format:t=`relative`}){let n=(0,wn.default)(Jt(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:a}){let o=N();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)(vn,{bundleId:t.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(K,{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)(x,{className:`h-10 w-full`}),(0,Z.jsx)(x,{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)(vn,{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)(vn,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(U,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(vn,{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)(K,{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)(i,{className:`w-full`,onClick:()=>a(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)(cn,{className:`min-w-max`,children:[(0,Z.jsx)(an,{children:(0,Z.jsxs)(sn,{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)(on,{children:n.map(e=>(0,Z.jsxs)(sn,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(vn,{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)(vn,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(U,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(vn,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(K,{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)(i,{onClick:()=>a(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)(``),[a,o]=(0,X.useState)(null),{data:s=[],isPending:c}=xe(),l=Te(),u=Oe(),d=n.trim(),f=async e=>{if(e.preventDefault(),!(!d||l.isPending))try{let e=await l.mutateAsync({name:d});r(``),e.inserted?q.success(`Channel ${e.row.name} created`):q.info(`Channel ${e.row.name} already exists`)}catch(e){q.error(`Failed to create channel`),console.error(e)}},p=async()=>{if(!(!a||u.isPending))try{let e=await u.mutateAsync({id:a.id});e.deleted?q.success(`Channel ${a.name} deleted`):e.reason===`not_empty`?q.error(`Channel ${a.name} is still in use and cannot be deleted`):q.error(`Channel ${a.name} no longer exists`),o(null)}catch(e){q.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(zt,{open:e,onOpenChange:t,children:(0,Z.jsxs)(Pt,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(Et,{children:[(0,Z.jsxs)(Ft,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(hn,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(Lt,{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)(Ve,{className:`gap-2`,children:(0,Z.jsxs)(Ge,{orientation:`horizontal`,children:[(0,Z.jsx)(Le,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(se,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:l.isPending}),(0,Z.jsxs)(i,{type:`submit`,disabled:!d||l.isPending,children:[l.isPending?(0,Z.jsx)(Tt,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(Vt,{"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)(Tt,{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)(i,{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)(_n,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(Dt,{open:a!==null,onOpenChange:e=>{!e&&!u.isPending&&o(null)},children:(0,Z.jsxs)(Ot,{children:[(0,Z.jsxs)(Nt,{children:[(0,Z.jsxs)(At,{children:[`Delete `,a?.name,`?`]}),(0,Z.jsx)(kt,{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)(It,{children:[(0,Z.jsx)(Bt,{disabled:u.isPending,children:`Cancel`}),(0,Z.jsx)(Mt,{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}=ve(),i=e?Xt(e):null,a=e?rn(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)(St,{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)(dn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(Br,{label:`Manifest hash`,value:(0,Z.jsx)(St,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(Br,{label:`Base hash`,value:(0,Z.jsx)(St,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(Br,{label:`Patch hash`,value:(0,Z.jsx)(St,{maxLength:16,value:i})}):null]})})]}):null}var Hr=Array.from({length:nn},(e,t)=>t+1);function Ur({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=Zt(t),a=n??[],o=a.length>0,s=r>0&&r<1e3,c=r===nn,l=N(),u=c?Hr:s?Hr.filter(t=>Yt(e,t)<r):[],d=(r/10).toFixed(1),f=c?nn:u.length,p=nn-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:a.map(e=>(0,Z.jsx)(K,{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)(K,{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)(zt,{children:[(0,Z.jsxs)(Rt,{render:(0,Z.jsx)(i,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(qe,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(Pt,{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)(Et,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(Ft,{children:`Rolled out cohorts`}),(0,Z.jsxs)(Lt,{children:[d,`% includes `,f,` of`,` `,nn,` 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)(jt,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Et,{children:[(0,Z.jsx)(Ft,{children:`Rolled out cohorts`}),(0,Z.jsxs)(Lt,{children:[d,`% includes `,f,` of`,` `,nn,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),m,(0,Z.jsx)(jt,{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=rt(o,n,r),i&&(o=Kr(a,t,rt(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,...$e},Xr=X.createContext(void 0);function Zr(){let e=X.useContext(Xr);if(e===void 0)throw Error(p(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":r,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:E,...ee}=e,ne=ue(c),re=ut(ne),ie=D(y),oe=D(b),{clearErrors:se}=gt(),{state:ce,disabled:O,name:k,setTouched:A,setDirty:de,validityData:j,shouldValidateOnChange:M,validation:N}=tt(),{labelId:P}=ct(),[fe,I]=X.useState(),L=r??ot(P,fe),R=O||o,z=k??v,[B,pe]=Je({controlled:T,default:a??m,name:`Slider`}),ge=X.useRef(null),_e=X.useRef(null),V=X.useRef([]),ve=X.useRef(null),H=X.useRef(null),ye=X.useRef(-1),be=X.useRef(null),U=X.useRef(null),W=X.useRef(`none`),xe=s(l),[Se,Ce]=X.useState(-1),[we,Te]=X.useState(-1),[Ee,De]=X.useState(!1),[Oe,ke]=X.useState(()=>new Map),[Ae,je]=X.useState([void 0,void 0]),Me=D(e=>{Ce(e),e!==-1&&Te(e)});Qe(_e,ne,B),he(B,()=>{se(z),M()?N.commit(B):N.commit(B,!0);let e=j.initialValue,t;t=Array.isArray(B)&&Array.isArray(e)?!Wr(B,e):B!==e,de(t)});let Ne=D(e=>{e&&(_e.current=e)}),Pe=Array.isArray(B),Fe=X.useMemo(()=>Pe?B.slice().sort(Gr):[rt(B,m,p)],[p,m,Pe,B]),Ie=D((e,t)=>{if(Number.isNaN(e)||$r(e,B))return;let n=t??F(`none`,void 0,void 0,{activeThumbIndex:-1});W.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,U.current=e,ie(e,n),!n.isCanceled&&pe(e)}),G=D((e,t,n)=>{let r=qr(e,t,m,p,Pe,Fe);if(Jr(r,S,g)){let e=Qr(n);Ie(r,F(e,n.nativeEvent,void 0,{activeThumbIndex:t})),A(!0),oe(U.current??r,h(e,n.nativeEvent))}});ae(()=>{let e=le(te(ge.current));R&&me(ge.current,e)&&e.blur()},[R]),R&&Se!==-1&&Me(-1);let Le=X.useMemo(()=>({...ce,activeThumbIndex:Se,disabled:R,dragging:Ee,orientation:x,max:p,min:m,minStepsBetweenValues:g,step:S,values:Fe}),[ce,Se,R,Ee,p,m,g,x,S,Fe]),Re=X.useMemo(()=>({active:Se,controlRef:_e,disabled:R,dragging:Ee,validation:N,formatOptionsRef:xe,handleInputChange:G,indicatorPosition:Ae,inset:w!==`center`,labelId:L,rootLabelId:re,largeStep:u,lastUsedThumbIndex:we,lastChangedValueRef:U,lastChangeReasonRef:W,form:_,locale:d,max:p,min:m,minStepsBetweenValues:g,name:z,onValueCommitted:oe,orientation:x,pressedInputRef:ve,pressedThumbCenterOffsetRef:H,pressedThumbIndexRef:ye,pressedValuesRef:be,registerFieldControlRef:Ne,renderBeforeHydration:w===`edge`,setActive:Me,setDragging:De,setIndicatorPosition:je,setLabelId:I,setValue:Ie,state:Le,step:S,thumbCollisionBehavior:C,thumbMap:Oe,thumbRefs:V,values:Fe}),[Se,_e,L,re,R,Ee,N,xe,G,Ae,u,we,U,W,_,d,p,m,g,z,oe,x,ve,H,ye,be,Ne,Me,De,je,I,Ie,Le,S,C,w,Oe,V,Fe]),ze=n(`div`,e,{state:Le,ref:[t,ge],props:[{"aria-labelledby":L,id:ne,role:`group`},N.getValidationProps,ee],stateAttributesMapping:Yr});return(0,Z.jsx)(Xr.Provider,{value:Re,children:(0,Z.jsx)(Ze,{elementsRef:V,onMapChange:ke,children:ze})})});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]=rt(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]=rt(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]=rt(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=rt(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=rt(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=rt(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(r,i){let{render:a,className:o,style:c,...l}=r,{disabled:u,dragging:d,inset:f,lastChangedValueRef:p,lastChangeReasonRef:m,max:g,min:v,minStepsBetweenValues:y,onValueCommitted:b,orientation:x,pressedInputRef:S,pressedThumbCenterOffsetRef:C,pressedThumbIndexRef:w,pressedValuesRef:T,registerFieldControlRef:E,renderBeforeHydration:ee,setActive:ne,setDragging:re,setValue:ae,state:oe,step:se,thumbCollisionBehavior:ce,thumbRefs:O,values:k}=Zr(),ue=z(),j=k.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(k);function pe(e){w.current!==e&&(w.current=e);let t=O.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=rt(((M?i-f-s.end:(ue===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(g-v)*p+v;if(m=ri(m,se,v),m=rt(m,v,g),!j)return{value:m,thumbIndex:0,didSwap:!1};let h=w.current;if(h<0)return null;let _=ai({behavior:ce,values:k,currentValues:B.current??k,initialValues:T.current,pressedIndex:h,nextValue:m,min:v,max:g,step:se,minStepsBetweenValues:y});return ce===`swap`&&_.didSwap?pe(_.thumbIndex):w.current=_.thumbIndex,_}function ge(e){T.current=j?k.slice():null,B.current=k;let t=w.current,n=t;if(t>-1&&t<k.length){if(k[t]===g){let e=t;for(;e>0&&k[e-1]===g;)--e;n=e}}else{let t=M?`y`:`x`,r;n=-1;for(let i=0;i<O.current.length;i+=1){let a=O.current[i];if(A(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=O.current[n];A(e)&&(R.current=e.getBoundingClientRect()[M?`height`:`width`]/2)}}function V(e){let t=O.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let ve=D(e=>{let n=ci(e,I);if(n==null)return;if(L.current+=1,e.type===`pointermove`&&e.buttons===0){H(e);return}let r=he(n);r!=null&&Jr(r.value,se,y)&&(!d&&L.current>oi&&re(!0),ae(r.value,F(t,e,void 0,{activeThumbIndex:r.thumbIndex})),B.current=Array.isArray(r.value)?r.value:[r.value],r.didSwap&&V(r.thumbIndex))});function H(e){ne(-1),re(!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,be()}let ye=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(de,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=te(N.current);r.addEventListener(`touchmove`,ve,{passive:!0}),r.addEventListener(`touchend`,H,{passive:!0})}),be=D(()=>{let e=te(N.current);e.removeEventListener(`pointermove`,ve),e.removeEventListener(`pointerup`,H),e.removeEventListener(`touchmove`,ve),e.removeEventListener(`touchend`,H),T.current=null}),U=ie();return X.useEffect(()=>{let e=N.current;if(!e)return()=>be();let t=_(e,`touchstart`,ye,{passive:!0});return()=>{t(),U.cancel(),be()}},[be,ye,N,U]),X.useEffect(()=>{u&&be()},[u,be]),n(`div`,r,{state:oe,ref:[i,E,N,fe],props:[{"data-base-ui-slider-control":ee?``:void 0,onPointerDown(e){let t=N.current,n=_e(e.nativeEvent);if(!t||u||e.defaultPrevented||!A(n)||e.button!==0)return;let r=ci(e,I);if(r!=null){ge(r);let n=he(r);if(n==null)return;me(O.current[n.thumbIndex],le(te(t)))?e.preventDefault():U.request(()=>{V(n.thumbIndex)}),re(!0),C.current??(ae(n.value,F(de,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=te(N.current);i.addEventListener(`pointermove`,ve,{passive:!0}),i.addEventListener(`pointerup`,H,{once:!0})}},l],stateAttributesMapping:Yr})}),ui=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{state:s}=Zr();return n(`div`,e,{state:s,ref:t,props:[{style:{position:`relative`}},o],stateAttributesMapping:Yr})}),di=R();function fi(){return ee}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([...v,E,c]);function vi(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${dt(e[t],r,n)} start range`:`${dt(e[t],r,n)} end range`:n?dt(e[t],r,n):void 0}function yi(e,t,n,r,i){let a=n===1?e+t:e-t;return rt(Number(a.toFixed(Math.max(ni(e),ni(t),ni(r)))),r,i)}var bi=X.forwardRef(function(t,i){let{render:a,children:o,className:s,"aria-describedby":l,"aria-label":u,"aria-labelledby":f,disabled:p=!1,getAriaLabel:m,getAriaValueText:h,id:g,index:_,inputRef:y,onBlur:x,onFocus:C,onKeyDown:w,tabIndex:ee,style:te,...ie}=t,{nonce:se}=ht(),ce=ue(g),{active:le,lastUsedThumbIndex:O,controlRef:k,disabled:A,validation:de,formatOptionsRef:j,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:ve,setActive:H,setIndicatorPosition:ye,state:be,step:U,values:W}=Zr(),xe=z(),Se=p||A,Ce=W.length>1,we=he===`vertical`,Te=xe===`rtl`,{setTouched:Ee,setFocused:De,validationMode:Oe}=tt(),ke=X.useRef(null),Ae=X.useRef(null),je=X.useRef(!1),Me=ue(),Ne=nt(),Pe=Ce?Me:Ne,{ref:Fe,index:Ie}=Ye({metadata:X.useMemo(()=>({inputId:Pe}),[Pe])}),G=Ce?_??Ie:0,Le=G===W.length-1,Re=W[G],ze=mt(Re,R,L),[Be,Ve]=X.useState(),He=hi(),Ue=O>=0&&O<W.length?O:-1,We=D(()=>{let e=k.current,t=ke.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=we?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*ze/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Ve(s),G===0?ye(e=>[s,e[1]]):Le&&ye(e=>[e[0],s])});ae(()=>{P&&queueMicrotask(We)},[We,P]),ae(()=>{P&&We()},[We,P,ze]),ae(()=>{if(!P)return;let t=k.current,n=ke.current;if(!t||!n)return;let r=e(t).ResizeObserver;if(typeof r!=`function`)return;let i=new r(We);return i.observe(t),i.observe(n),()=>{i.disconnect()}},[k,We,P]);let K=we?`bottom`:`insetInlineStart`,Ge=we?`left`:`top`,Ke;Ce?le===G?Ke=2:Ue===G&&(Ke=1):le===G&&(Ke=1);let qe;qe=P?{"--position":`${Be??0}%`,visibility:ve&&He||Be===void 0?`hidden`:void 0,position:`absolute`,[K]:`var(--position)`,[Ge]:`50%`,translate:`${(we||!Te?-1:1)*50}% ${(we?1:-1)*50}%`,zIndex:Ke}:Number.isFinite(ze)?{position:`absolute`,[K]:`${ze}%`,[Ge]:`50%`,translate:`${(we||!Te?-1:1)*50}% ${(we?1:-1)*50}%`,zIndex:Ke}:ne;let Je;he===`vertical`&&(Je=Te?`vertical-rl`:`vertical-lr`);let Xe=typeof m==`function`?m(G):u,Ze=oe({"aria-label":Xe,"aria-labelledby":f??(Xe==null?fe:void 0),"aria-describedby":l,"aria-orientation":he,"aria-valuenow":Re,"aria-valuetext":typeof h==`function`?h(dt(Re,I,j.current??void 0),Re,G):vi(W,G,j.current??void 0,I),disabled:Se,form:pe,id:Pe,max:L,min:R,name:me,onChange(e){N(e.currentTarget.valueAsNumber,G,e)},onFocus(e){let t=je.current;je.current=!1,H(G),De(!0),t&&e.stopPropagation()},onBlur(e){if(je.current){e.stopPropagation();return}ke.current&&(H(-1),Ee(!0),De(!1),Oe===`onBlur`&&de.commit(qr(Re,G,R,L,Ce,W)))},onKeyDown(e){if(!_i.has(e.key))return;v.has(e.key)&&e.stopPropagation();let t=null,n=ri(Re,U,R);switch(e.key){case d:t=yi(n,e.shiftKey?F:U,1,R,L);break;case r:t=yi(n,e.shiftKey?F:U,Te?-1:1,R,L);break;case b:t=yi(n,e.shiftKey?F:U,-1,R,L);break;case S:t=yi(n,e.shiftKey?F:U,Te?1:-1,R,L);break;case E:t=yi(n,F,1,R,L);break;case c:t=yi(n,F,-1,R,L);break;case`End`:t=L,Ce&&(t=Number.isFinite(W[G+1])?W[G+1]-U*B:L);break;case T:t=R,Ce&&(t=Number.isFinite(W[G-1])?W[G-1]+U*B:R);break;default:break}if(t!==null){let n=e.currentTarget;M(n)||(je.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),N(t,G,e),e.preventDefault()}},step:U,style:{...ne,width:`100%`,height:`100%`,writingMode:Je},tabIndex:ee??void 0,type:`range`,value:Re??``},de.getInputValidationProps),Qe=re(Ae,de.inputRef,y);return n(`div`,t,{state:be,ref:[i,Fe,ke],props:[{[gi.index]:G,children:(0,Z.jsxs)(X.Fragment,{children:[o,(0,Z.jsx)(`input`,{ref:Qe,...Ze,suppressHydrationWarning:!0}),P&&He&&ve&&Le&&(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:ce,onBlur:x,onFocus:C,onPointerDown(e){if(V.current=G,ke.current!=null){let t=he===`horizontal`?`x`:`y`,n=ti(ke.current);_e.current=(he===`horizontal`?e.clientX:e.clientY)-n[t]}Ae.current!=null&&ge.current!==Ae.current&&(ge.current=Ae.current)},style:qe,suppressHydrationWarning:ve||void 0},ie],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:r,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,_,mt(m[0],u,l),mt(m[m.length-1],u,l));return n(`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:y(`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(p(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={...$e,checked(e){return e?{[Di.checked]:``}:{[Di.unchecked]:``}}};function ki(e,t,n,r=!0,i){let[a,o]=X.useState(),s=ue(i?`${i}-label`:void 0),c=e??t??a;return ae(()=>{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,r){let{checked:i,className:o,defaultChecked:s,"aria-labelledby":c,form:d,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}=gt(),{state:E,setTouched:ee,setDirty:te,validityData:ie,setFilled:se,setFocused:D,shouldValidateOnChange:ce,validationMode:le,disabled:O,name:k,validation:A}=tt(),{labelId:de}=ct(),j=O||y,M=k??m,N=X.useRef(null),P=re(N,p,A.inputRef),fe=X.useRef(null),I=ue(),L=nt({id:f,implicit:!1,controlRef:fe}),R=h?void 0:L,[z,pe]=Je({controlled:i,default:!!s,name:`Switch`,state:`checked`});Qe(fe,I,z),ae(()=>{N.current&&se(N.current.checked)},[N,se]),he(z,()=>{T(M),te(z!==ie.initialValue),se(z),ce()?A.commit(z):A.commit(z,!0)});let{getButtonProps:me,buttonRef:ge}=a({disabled:j,native:h}),_e=ki(c,de,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(){j||D(!0)},onBlur(){let e=N.current;!e||j||(ee(!0),D(!1),le===`onBlur`&&A.commit(e.checked))},onClick(t){if(_||j)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}))}},ve=oe({checked:z,disabled:j,form:d,id:R,name:M,required:v,style:M?u:ne,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()}},A.getInputValidationProps,S===void 0?l:{value:S}),H=X.useMemo(()=>({...E,checked:z,disabled:j,readOnly:_,required:v}),[E,z,j,_,v]),ye=n(`span`,t,{state:H,ref:[r,fe,ge],props:[V,A.getValidationProps,w,me],stateAttributesMapping:Oi});return(0,Z.jsxs)(Ti.Provider,{value:H,children:[ye,!z&&M&&x!==void 0&&(0,Z.jsx)(`input`,{type:`hidden`,form:d,name:M,value:x}),(0,Z.jsx)(`input`,{...ve,suppressHydrationWarning:!0})]})}),Ni=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e;return n(`span`,e,{state:Ei(),ref:t,stateAttributesMapping:Oi,props:o})});function Pi({className:e,...t}){return(0,Z.jsx)(Mi,{"data-slot":`switch`,className:y(`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)(Ct,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(vt,{"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)(bt,{align:`inline-end`,children:(0,Z.jsx)(_t,{children:`%`})})]})]})}function Hi({channels:e,onOpenChange:t,onShowScope:n,open:r,releaseId:a}){let o=be(a),s=o.data,c=De(s?.bundle_id??``),l=c.data,u=l?Qt(l):null,d=ye(s?.scope_key??``),f=Ce(),p=Se(),m=H(),h=Ae(),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(``),[b,S]=(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)(``),[ae,oe]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{_(s?Ii(s):null),S(``)},[s]);let D=s?Ii(s):null,le=g!==null&&D!==null&&JSON.stringify(g)!==JSON.stringify(D),O=p.isPending||f.isPending||m.isPending||h.isPending,ue=()=>{if(!O){if(le){T(!0);return}t(!1)}},A=()=>{if(!g)return;let e=$t(v);if(!tn(e)){S(en);return}_({...g,targetCohorts:Array.from(new Set([...g.targetCohorts,e]))}),y(``),S(``)},de=async()=>{if(!s||!g)return;let e=g.targetCohorts.map($t);if(e.some(e=>!tn(e))){S(en);return}if(s.strategy===`APP_VERSION`&&!Lr(g.targetAppVersion.trim())){S(`Enter a valid target app version range.`);return}let n={expectedRevision:s.revision,patch:Li(s,{...g,targetCohorts:e}),releaseId:s.id};S(``);try{await p.mutateAsync(n),await f.mutateAsync(n),q.success(`Bundle settings saved`),t(!1)}catch(e){S(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},M=e.find(e=>e.id===s?.channel_id)?.name??s?.channel_id,N=e.filter(e=>e.id!==s?.channel_id),fe=N.map(e=>({label:e.name,value:e.name})),F=re.trim(),I=ae===`copy`,L=g?Lr(g.targetAppVersion.trim()):null,R=()=>{ie(``),oe(`move`)},z=e=>{!e&&h.isPending||(ne(e),e||R())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(j,{onOpenChange:e=>e?void 0:ue(),open:r,children:(0,Z.jsxs)(ce,{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)(k,{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)(et,{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)(vn,{bundleId:s.id,fullOnMobile:!0,maxLength:18}),s.bundle_id?null:(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:`Built-in app`})]})]}),(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)(x,{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)(Re,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(ze,{children:`Bundle details could not be loaded`}),(0,Z.jsx)(Ke,{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)(je,{release:{platform:s.platform,channel:M,releaseId:s.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)(Ve,{className:`gap-6`,children:[(0,Z.jsxs)(Ge,{children:[(0,Z.jsx)(Le,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(xt,{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)(Ge,{children:[(0,Z.jsx)(Le,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(se,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>_({...g,targetAppVersion:e.target.value}),value:g.targetAppVersion}),L?(0,Z.jsx)(He,{children:L}):null]}):null,(0,Z.jsxs)(Ge,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsx)(Le,{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)(He,{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)(Ge,{orientation:`horizontal`,children:[(0,Z.jsx)(Le,{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)(Ge,{children:[(0,Z.jsx)(Le,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(Vi,{onChange:e=>_({...g,rolloutCohortCount:e}),value:g.rolloutCohortCount})]}),(0,Z.jsxs)(Ge,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(Le,{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)(se,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>y(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),A())},placeholder:`e.g. qa-team…`,value:v}),(0,Z.jsx)(i,{"aria-label":`Add cohort`,disabled:!v.trim(),onClick:A,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(Vt,{})})]}),g.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:g.targetCohorts.map(e=>(0,Z.jsxs)(K,{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)(P,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(He,{children:`Public names—no IDs or secrets.`})]})]}),b?(0,Z.jsx)(We,{children:b}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:!le||O,onClick:de,size:`lg`,children:p.isPending||f.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(C,{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)(i,{className:`w-full`,disabled:s.kind!==`BUNDLE`||O,onClick:()=>ne(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),s.bundle_id?(0,Z.jsxs)(i,{className:`w-full`,disabled:O,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(s.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),q.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(wt,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:s.enabled||O,onClick:()=>ee(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),s.bundle_id&&c.isPending?(0,Z.jsx)(x,{className:`h-40 w-full`}):null,s.bundle_id&&c.isError?(0,Z.jsxs)(Re,{variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(ze,{children:`Build details are unavailable`}),(0,Z.jsx)(Ke,{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 app`})]}),(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)(i,{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)(Dt,{onOpenChange:T,open:w,children:(0,Z.jsxs)(Ot,{children:[(0,Z.jsxs)(Nt,{children:[(0,Z.jsx)(At,{children:`Discard unsaved changes?`}),(0,Z.jsx)(kt,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(It,{children:[(0,Z.jsx)(Bt,{children:`Keep editing`}),(0,Z.jsx)(Mt,{onClick:()=>{T(!1),t(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(Dt,{onOpenChange:ee,open:E,children:(0,Z.jsxs)(Ot,{children:[(0,Z.jsxs)(Nt,{children:[(0,Z.jsxs)(At,{children:[`Remove this Bundle from `,M??`the channel`,`?`]}),(0,Z.jsx)(kt,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(It,{children:[(0,Z.jsx)(Bt,{children:`Cancel`}),(0,Z.jsx)(Mt,{onClick:async()=>{if(s)try{await m.mutateAsync({expectedRevision:s.revision,releaseId:s.id}),q.success(`Bundle removed from ${M??`the channel`}`),ee(!1),t(!1)}catch(e){S(e instanceof Error?e.message:`Bundle could not be removed from the channel.`)}},variant:`destructive`,children:`Remove from channel`})]})]})}),(0,Z.jsx)(zt,{onOpenChange:z,open:te,children:(0,Z.jsxs)(Pt,{showCloseButton:!h.isPending,children:[(0,Z.jsxs)(Et,{children:[(0,Z.jsx)(Ft,{children:`Promote to Channel`}),(0,Z.jsx)(Lt,{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)(Ue,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(st,{disabled:h.isPending,items:Fi,onValueChange:e=>oe(e),value:ae,children:[(0,Z.jsx)(at,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(lt,{placeholder:`Select an action`})}),(0,Z.jsx)(it,{children:(0,Z.jsxs)(ft,{children:[(0,Z.jsx)(pt,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(pt,{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)(Ue,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(st,{disabled:h.isPending,items:fe,onValueChange:e=>ie(e??``),value:re||null,children:[(0,Z.jsx)(at,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(lt,{placeholder:`Select a channel`})}),(0,Z.jsx)(it,{className:`max-h-64`,children:(0,Z.jsx)(ft,{children:N.map(e=>(0,Z.jsx)(pt,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(jt,{children:[(0,Z.jsx)(i,{disabled:h.isPending,onClick:()=>z(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(i,{disabled:!F||h.isPending,onClick:async()=>{if(s)try{await h.mutateAsync({action:ae,expectedRevision:s.revision,releaseId:s.id,targetChannel:F}),z(!1),q.success(I?`Bundle copied to ${F}`:`Bundle moved to ${F}`)}catch(e){q.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)(K,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(Be,{className:`size-3`}):(0,Z.jsx)(un,{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)(K,{className:y(`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`});function Xi({channels:e,onChange:t,onClear:n,onManageChannels:r,search:a}){let o=Pe(a),s=a.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)(pn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsxs)(st,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:a.channelId??`all`,children:[(0,Z.jsx)(at,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(lt,{})}),(0,Z.jsx)(it,{children:(0,Z.jsxs)(ft,{children:[(0,Z.jsx)(pt,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(pt,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(st,{disabled:!s,items:Ki,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:a.platform??`ios`,children:[(0,Z.jsx)(at,{"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)(lt,{})}),(0,Z.jsx)(it,{children:(0,Z.jsxs)(ft,{children:[(0,Z.jsx)(pt,{value:`ios`,children:`iOS`}),(0,Z.jsx)(pt,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(st,{disabled:!s&&a.scopeKey===void 0,items:qi,onValueChange:e=>t({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:a.enabled===void 0?`all`:a.enabled?`enabled`:`disabled`,children:[(0,Z.jsx)(at,{"aria-label":`Status`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(lt,{})}),(0,Z.jsx)(it,{children:(0,Z.jsxs)(ft,{children:[(0,Z.jsx)(pt,{value:`all`,children:`Any Status`}),(0,Z.jsx)(pt,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(pt,{value:`disabled`,children:`Disabled`})]})})]}),(0,Z.jsx)(i,{"aria-label":`Manage channels`,onClick:r,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Z.jsx)(gn,{})}),a.bundleId?(0,Z.jsxs)(K,{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)(P,{className:`size-3`})})]}):null,a.scopeKey?(0,Z.jsxs)(K,{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)(P,{className:`size-3`})})]}):null,o?(0,Z.jsxs)(i,{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)(P,{"data-icon":`inline-start`}),`Clear`]}):null]})}function Zi({expanded:e,onOpen:t,onToggleExpand:n,release:r}){let a=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)(i,{"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)(Xe,{}):(0,Z.jsx)(W,{})}):(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)(vn,{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)(yt,{className:`size-3.5`}),` Built-in app`]})]}),a?(0,Z.jsx)(K,{className:`shrink-0 font-normal`,variant:`secondary`,children:a}):null,r.currentlyUnreachable?(0,Z.jsxs)(`span`,{"aria-label":`Currently unreachable. No catalog segment or cohort selects this bundle first.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No catalog segment or cohort selects this bundle first with the current delivery settings.`,children:[(0,Z.jsx)(un,{className:`size-3.5`}),`Unreachable`]}):null]})}function Qi({onDetailClick:e,panelId:t,release:n}){let r=n.bundle_id??``,i=De(r),a=we(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)(x,{className:`h-10 w-full`}),(0,Z.jsx)(x,{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 $i(){let e=G.useSearch(),t=G.useNavigate(),n=N(),[r,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(),c=Ee({afterReleaseId:e.afterReleaseId,beforeReleaseId:e.beforeReleaseId,filter:Fe(e),limit:Gi}),l=xe().data??[],u=c.data?.data??[],d=ke(Array.from(new Set(u.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},p=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}]:[]}),g=Ie(),_=10+g.length,v=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 b=(e,n=!0)=>void t({resetScroll:n,search:e,to:`/`}),S=t=>b(Ne(e,t)),C=t=>{let n=u.find(e=>e.bundle_id===t.id);if(s(void 0),n){b({...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=p?{...e,afterReleaseId:void 0,beforeReleaseId:p,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)(Xi,{channels:l,onChange:S,onClear:()=>b({}),onManageChannels:()=>a(!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)(Re,{variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(ze,{children:`Bundles could not be loaded`}),(0,Z.jsx)(Ke,{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)(x,{className:`h-44 w-full`},t))}):u.length?u.map(t=>{let n=v.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`,{className:y(`flex flex-col gap-4 border-b p-4 last:border-b-0`,t.currentlyUnreachable&&`bg-muted/35 saturate-50 transition-[background-color,filter] focus-within:saturate-100 motion-reduce:transition-none`,i&&`border-b-0 bg-primary/5`),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(Zi,{expanded:i,onOpen:()=>b({...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)(et,{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)(K,{variant:`secondary`,children:`Force update`}):null]}),(0,Z.jsxs)(`div`,{className:`col-span-2 grid 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)(Qi,{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.`:Pe(e)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,Z.jsxs)(cn,{className:`min-w-max`,children:[(0,Z.jsx)(an,{className:`bg-muted/40`,children:(0,Z.jsxs)(sn,{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)(on,{children:[c.isPending?Array.from({length:7},(e,t)=>(0,Z.jsx)(sn,{children:(0,Z.jsx)(Y,{colSpan:_,children:(0,Z.jsx)(x,{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)(sn,{"aria-label":`Open bundle ${t.id}`,className:y(`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:n=>{n.target instanceof Element&&n.target.closest(`button, a, input, select, textarea`)||b({...e,releaseId:t.id},!1)},onKeyDown:n=>{n.target!==n.currentTarget||n.key!==`Enter`&&n.key!==` `||(n.preventDefault(),b({...e,releaseId:t.id},!1))},tabIndex:0,children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(Zi,{expanded:n,onOpen:()=>b({...e,releaseId:t.id},!1),onToggleExpand:()=>s(n?void 0:t.id),release:t})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(bn,{channel:v.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)(et,{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)(K,{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)(Me,{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)(fn,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(St,{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)(sn,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:_,children:(0,Z.jsx)(Qi,{onDetailClick:C,panelId:r,release:t})})}):null]},t.id)}),!c.isPending&&u.length===0?(0,Z.jsx)(sn,{children:(0,Z.jsx)(Y,{className:`h-40 text-center text-muted-foreground`,colSpan:_,children:w?`No more bundles on this side.`:Pe(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:f({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:f({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:T,to:`/`,children:[(0,Z.jsx)(ln,{"data-icon":`inline-start`}),`Previous`]}):(0,Z.jsxs)(i,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[(0,Z.jsx)(ln,{"data-icon":`inline-start`}),`Previous`]}),E?(0,Z.jsxs)(V,{className:f({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:E,to:`/`,children:[`Next`,(0,Z.jsx)(W,{"data-icon":`inline-end`})]}):(0,Z.jsxs)(i,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[`Next`,(0,Z.jsx)(W,{"data-icon":`inline-end`})]})]})]}):null]}),(0,Z.jsx)(Hi,{channels:l,onOpenChange:t=>!t&&b({...e,releaseId:void 0},!1),onShowScope:e=>S({scopeKey:e}),open:!!e.releaseId,releaseId:e.releaseId??``}),(0,Z.jsx)(On,{onOpenChange:a,open:r})]})}export{$i as component};