@hot-updater/console 1.0.3 → 1.0.5

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 (137) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/{ConsoleFeatureUnavailable-Bf8tgug-.js → ConsoleFeatureUnavailable-B-iNWpuE.js} +1 -1
  3. package/.output/public/assets/{EventDetails-CgtEWl-Y.js → EventDetails-CSX2ayg9.js} +1 -1
  4. package/.output/public/assets/{HashValueDisplay-DvXl147n.js → HashValueDisplay-BGkDPaYi.js} +1 -1
  5. package/.output/public/assets/{InsightsPageHeader-eViliItR.js → InsightsPageHeader-SYEOMClX.js} +1 -1
  6. package/.output/public/assets/{NotFoundPage-HomiHjdL.js → NotFoundPage-Cei6W2lm.js} +1 -1
  7. package/.output/public/assets/{alert-dialog-BSs_5Od-.js → alert-dialog-BtVg50WQ.js} +1 -1
  8. package/.output/public/assets/{api-DSWk32Mz.js → api-DoicFJfd.js} +1 -1
  9. package/.output/public/assets/{api-keys-CHA2X9W0.js → api-keys-BEdLKiib.js} +1 -1
  10. package/.output/public/assets/api-keys-TdTtKm2b.js +1 -0
  11. package/.output/public/assets/arrow-left-DsivSewE.js +1 -0
  12. package/.output/public/assets/arrow-up-right-B5aM0F7f.js +1 -0
  13. package/.output/public/assets/chevron-right-BnvHIJdZ.js +1 -0
  14. package/.output/public/assets/{clipboard-BYT_TJ0K.js → clipboard-DTkrlIMn.js} +1 -1
  15. package/.output/public/assets/console-features-api-DPE4C06Y.js +2 -0
  16. package/.output/public/assets/{dialog-YKZpU5St.js → dialog-CGKPxz3n.js} +1 -1
  17. package/.output/public/assets/{dist-B7eA4Mtf.js → dist-dDj-R6uh.js} +1 -1
  18. package/.output/public/assets/{empty-L3UcNk_l.js → empty-Bf4DanOL.js} +1 -1
  19. package/.output/public/assets/{field-DNqNwq7i.js → field-DBMkBfkD.js} +1 -1
  20. package/.output/public/assets/index-C5S4DrO2.js +10 -0
  21. package/.output/public/assets/{input-group-C9ZIjV0o.js → input-group-B4nrqIh0.js} +1 -1
  22. package/.output/public/assets/insights-BMKRCIg1.js +2 -0
  23. package/.output/public/assets/{insights-SVMoazdd.js → insights-CPyViuyC.js} +1 -1
  24. package/.output/public/assets/insights-D0PbX-Rm.js +1 -0
  25. package/.output/public/assets/{insights-api-BsX1zQDf.js → insights-api-Dmd_LgT3.js} +1 -1
  26. package/.output/public/assets/{insights-search-B-F2wop6.js → insights-search-DAa0f7Dr.js} +1 -1
  27. package/.output/public/assets/{insights-usage-rpc-CSAoKS_b.js → insights-usage-rpc-DTL0_Rp8.js} +1 -1
  28. package/.output/public/assets/insights_.distribution-BaOQlBV9.js +1 -0
  29. package/.output/public/assets/insights_.distribution-CxXMIEb5.js +2 -0
  30. package/.output/public/assets/{insights_.distribution-oxPmgcHr.js → insights_.distribution-EE5OqxyL.js} +1 -1
  31. package/.output/public/assets/installations-BgISglUQ.js +1 -0
  32. package/.output/public/assets/installations-DQbgRkSi.js +1 -0
  33. package/.output/public/assets/installations-we1IV0xp.js +2 -0
  34. package/.output/public/assets/{key-round-CrqLmblG.js → key-round-B4fI1psK.js} +1 -1
  35. package/.output/public/assets/{list-BSpjGUS6.js → list-Dtj7TtzV.js} +1 -1
  36. package/.output/public/assets/{refresh-cw-BMlpOsfM.js → refresh-cw-DjIKjmrS.js} +1 -1
  37. package/.output/public/assets/remote-config-AQmdmbT8.js +1 -0
  38. package/.output/public/assets/remote-config-DyTLPRKh.js +1 -0
  39. package/.output/public/assets/{remote-config-Cwwsatrr.js → remote-config-uBgCaI-p.js} +3 -3
  40. package/.output/public/assets/{routes-Bxu5_zNh.js → routes-Br26jzt9.js} +1 -1
  41. package/.output/public/assets/{routes-Bc3J564t.js → routes-CyirpG2O.js} +2 -2
  42. package/.output/public/assets/search-DuI1FBpg.js +1 -0
  43. package/.output/public/assets/{select-BE-xONpm.js → select-CV8nkfsf.js} +1 -1
  44. package/.output/public/assets/sidebar-BqX460IW.js +3 -0
  45. package/.output/public/assets/smartphone-CtsHuiIC.js +1 -0
  46. package/.output/public/assets/{switch-DR0WP2g8.js → switch-C8ycp9AH.js} +1 -1
  47. package/.output/public/assets/{table-DW0243Jw.js → table-DgGD67Fx.js} +1 -1
  48. package/.output/public/assets/{tabs-B4Ffq4fD.js → tabs-CgEH_fMT.js} +1 -1
  49. package/.output/public/assets/{undo-2-Dcq6sgUo.js → undo-2-DxXx9Zvr.js} +1 -1
  50. package/.output/public/assets/useCompositeListItem-B-UkrDlu.js +1 -0
  51. package/.output/public/assets/{valueToPercent-C-rPd_Or.js → valueToPercent-C4C1WZVn.js} +1 -1
  52. package/.output/server/{__23tanstack-start-server-fn-resolver-DUiQynZZ.mjs → __23tanstack-start-server-fn-resolver-jmie-36L.mjs} +40 -40
  53. package/.output/server/_libs/@tanstack/react-router+[...].mjs +85 -91
  54. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +2 -2
  55. package/.output/server/_libs/tanstack__history.mjs +11 -16
  56. package/.output/server/_ssr/{BundleIdDisplay-B9YDxqwO.mjs → BundleIdDisplay-4jSO7w-V.mjs} +2 -2
  57. package/.output/server/_ssr/{ConsoleFeatureUnavailable-DW_SuU2B.mjs → ConsoleFeatureUnavailable-Br9nSv0f.mjs} +5 -5
  58. package/.output/server/_ssr/{EventDetails-AX5_szV5.mjs → EventDetails-DvEKDuRM.mjs} +6 -6
  59. package/.output/server/_ssr/{HashValueDisplay-CzPPv9pu.mjs → HashValueDisplay-BEaPTxlK.mjs} +2 -2
  60. package/.output/server/_ssr/{InsightsPageHeader-B4T_tzBH.mjs → InsightsPageHeader-lv9lVo29.mjs} +5 -5
  61. package/.output/server/_ssr/{NotFoundPage-BSvLmM7r.mjs → NotFoundPage-_ybIUFhU.mjs} +2 -2
  62. package/.output/server/_ssr/{alert-dialog-CITtSrHe.mjs → alert-dialog-DIGB-_50.mjs} +1 -1
  63. package/.output/server/_ssr/{api-keys-B3dlDbG7.mjs → api-keys-CeyREjvb.mjs} +2 -2
  64. package/.output/server/_ssr/{api-keys-CoijitVW.mjs → api-keys-eO1EahwF.mjs} +8 -8
  65. package/.output/server/_ssr/{api-keys-rpc-CSH6tVgw.mjs → api-keys-rpc-B6jsUMOy.mjs} +5 -5
  66. package/.output/server/_ssr/{api-rpc-BEUUwdwU.mjs → api-rpc-C6PKrZHs.mjs} +5 -5
  67. package/.output/server/_ssr/{api-aY8pkdgM.mjs → api-rsoui6JK.mjs} +4 -4
  68. package/.output/server/_ssr/{auth-rpc-ncS3ncJo.mjs → auth-rpc-D1ebZxoP.mjs} +6 -6
  69. package/.output/server/_ssr/{auth.server-COCIt_qp.mjs → auth.server-BNKPJ95k.mjs} +2 -2
  70. package/.output/server/_ssr/{config.server-BnsrQ-R0.mjs → config.server-CDc3T2Ik.mjs} +3 -3
  71. package/.output/server/_ssr/{console-access-CH4F-Ze4.mjs → console-access-BTZBfsbE.mjs} +3 -3
  72. package/.output/server/_ssr/{console-features-api-k6t4zQyv.mjs → console-features-api-CvQD7xrZ.mjs} +4 -4
  73. package/.output/server/_ssr/{console-features-rpc-BJDl2mth.mjs → console-features-rpc-4DFAhPjK.mjs} +5 -5
  74. package/.output/server/_ssr/createMiddleware-B1iPez7u.mjs +619 -0
  75. package/.output/server/_ssr/{createServerRpc-RLR4H-Fn.mjs → createServerRpc-BaDJLGBx.mjs} +2 -2
  76. package/.output/server/_ssr/{dialog-C9Tu_DpM.mjs → dialog-DfjXyWGZ.mjs} +1 -1
  77. package/.output/server/_ssr/{empty-Cv_hFA2s.mjs → empty-CAll1ROu.mjs} +2 -2
  78. package/.output/server/_ssr/{empty-plugin-adapters-CPtwX8a7.mjs → empty-plugin-adapters-CpCHi1TV.mjs} +1 -1
  79. package/.output/server/_ssr/{field-B8GTIqH4.mjs → field-DXfKM72E.mjs} +2 -2
  80. package/.output/server/_ssr/{input-group-jxUgZZpq.mjs → input-group-JgNkHlo6.mjs} +1 -1
  81. package/.output/server/_ssr/{insights-_pls6uDt.mjs → insights-Z9hNQzJz.mjs} +19 -19
  82. package/.output/server/_ssr/{insights-api-CdvdhcBM.mjs → insights-api-BHP5zN92.mjs} +4 -4
  83. package/.output/server/_ssr/{insights-AmnGk2ru.mjs → insights-ddfefZlb.mjs} +5 -5
  84. package/.output/server/_ssr/{insights-failures-rpc-CtCvU7Lb.mjs → insights-failures-rpc-B2Lq-cs5.mjs} +6 -6
  85. package/.output/server/_ssr/{insights-recovery-rpc-ClEMqX8q.mjs → insights-recovery-rpc-DLDu-KiX.mjs} +5 -5
  86. package/.output/server/_ssr/{insights-rpc-Cyf6NtSN.mjs → insights-rpc-Rg6L-Jvj.mjs} +5 -5
  87. package/.output/server/_ssr/{insights-search-C9ObTuJj.mjs → insights-search-B2u8wXrS.mjs} +2 -2
  88. package/.output/server/_ssr/{insights-usage-rpc-CSFdSxsS.mjs → insights-usage-rpc-DdafF6eA.mjs} +5 -5
  89. package/.output/server/_ssr/{insights-usage-rpc-BGvQPLc_.mjs → insights-usage-rpc-DoLbrAou.mjs} +4 -4
  90. package/.output/server/_ssr/{insights-DLsn0DWL.mjs → insights-uzl3049G.mjs} +2 -2
  91. package/.output/server/_ssr/{insights_.distribution-D7LNG2RM.mjs → insights_.distribution-6PcJu9QZ.mjs} +2 -2
  92. package/.output/server/_ssr/{insights_.distribution-BzKRKuCV.mjs → insights_.distribution-BTVwfr_Q.mjs} +5 -5
  93. package/.output/server/_ssr/{insights_.distribution-BNjZKiSw.mjs → insights_.distribution-PtyLQdMn.mjs} +11 -11
  94. package/.output/server/_ssr/{installations-RHGmrb7R.mjs → installations-CXNxcPvc.mjs} +4 -4
  95. package/.output/server/_ssr/{installations-BCPJ4e7D.mjs → installations-DVhWilEc.mjs} +2 -2
  96. package/.output/server/_ssr/{installations-CFEg7buT.mjs → installations-v4nw05I-.mjs} +10 -10
  97. package/.output/server/_ssr/{release-adoption-rpc-BN6ugXDb.mjs → release-adoption-rpc-DRG07Y07.mjs} +7 -7
  98. package/.output/server/_ssr/{remote-config-fO53DVpy.mjs → remote-config-CCpkJZD6.mjs} +16 -16
  99. package/.output/server/_ssr/{remote-config-rZZmYHbP.mjs → remote-config-Dt7E5KSB.mjs} +2 -2
  100. package/.output/server/_ssr/{remote-config-Dek-Yq_z.mjs → remote-config-H5FfUxiR.mjs} +2 -2
  101. package/.output/server/_ssr/{remote-config-rpc-B-HKKmZj.mjs → remote-config-rpc-DmxSUh2f.mjs} +5 -5
  102. package/.output/server/_ssr/{router-CDybUhRQ.mjs → router-DzoZ6RiZ.mjs} +14 -14
  103. package/.output/server/_ssr/{routes-D-Stxlx3.mjs → routes-BcCBFt_B.mjs} +14 -14
  104. package/.output/server/_ssr/{routes-28yO3P55.mjs → routes-hBT2gLcc.mjs} +9 -9
  105. package/.output/server/_ssr/{select-BJLdlpRq.mjs → select-B-_QqBKv.mjs} +1 -1
  106. package/.output/server/_ssr/{server-CgmoK4sV.mjs → server-DLJxXUG3.mjs} +1228 -1963
  107. package/.output/server/_ssr/{sidebar-8IDTQ6RN.mjs → sidebar-CvkhVxly.mjs} +3 -3
  108. package/.output/server/_ssr/ssr.mjs +2 -6
  109. package/.output/server/_ssr/start-B6ECIE_7.mjs +4 -0
  110. package/.output/server/_ssr/{switch-BAprAKiW.mjs → switch-CcliGpYm.mjs} +2 -2
  111. package/.output/server/_ssr/{table-CjyTJRXE.mjs → table-BQwxbG7k.mjs} +1 -1
  112. package/.output/server/_ssr/{tabs-DZksXxkh.mjs → tabs-CyNj4x4I.mjs} +2 -2
  113. package/.output/server/_tanstack-start-manifest_v-DTOQk1l4.mjs +135 -0
  114. package/.output/server/index.mjs +232 -232
  115. package/package.json +10 -10
  116. package/.output/public/assets/api-keys-D0yD891K.js +0 -1
  117. package/.output/public/assets/arrow-left-vK2qGQsd.js +0 -1
  118. package/.output/public/assets/arrow-up-right-Dz8o-Kab.js +0 -1
  119. package/.output/public/assets/chevron-right-CBl7aqu_.js +0 -1
  120. package/.output/public/assets/console-features-api-BD7j--gS.js +0 -1
  121. package/.output/public/assets/index-C-dDMnWK.js +0 -11
  122. package/.output/public/assets/insights-C54__dPi.js +0 -1
  123. package/.output/public/assets/insights-DM0CTj58.js +0 -2
  124. package/.output/public/assets/insights_.distribution-BAaD6rZK.js +0 -1
  125. package/.output/public/assets/insights_.distribution-C6tGV7qU.js +0 -2
  126. package/.output/public/assets/installations-1jALHnM3.js +0 -1
  127. package/.output/public/assets/installations-DUidui9Z.js +0 -1
  128. package/.output/public/assets/installations-RfpwK-ld.js +0 -2
  129. package/.output/public/assets/remote-config-BcoOZ9fs.js +0 -1
  130. package/.output/public/assets/remote-config-BtStN5bt.js +0 -1
  131. package/.output/public/assets/search-B_o3avCI.js +0 -1
  132. package/.output/public/assets/sidebar-CQ6iq0qe.js +0 -3
  133. package/.output/public/assets/smartphone--CTny1h9.js +0 -1
  134. package/.output/public/assets/useCompositeListItem-VmWjhZ9j.js +0 -1
  135. package/.output/server/_ssr/createMiddleware-Cm6Tn0_Y.mjs +0 -370
  136. package/.output/server/_ssr/start-BfFbHKMK.mjs +0 -4
  137. package/.output/server/_tanstack-start-manifest_v-DaM-WBL0.mjs +0 -139
@@ -1 +1 @@
1
- import{$ as e,$n as t,Bn as n,F as r,Fn as i,Gt as a,H as o,I as s,In as c,Jn as l,Jt as u,Kt as d,L as f,Ln as p,M as m,P as h,R as g,U as _,Un as v,Ur as y,Ut as b,Wn as x,Xn as S,Xt as C,Yn as w,Yt as ee,Z as T,Zn as E,_ as te,an as ne,ar as D,b as re,bn as ie,ei as ae,er as oe,et as se,g as ce,h as le,ir as O,ln as k,lt as ue,mn as de,p as fe,qt as pe,ri as me,sr as A,tn as he,ut as j,v as ge,vn as _e,w as M,xn as N,y as P,yn as ve}from"./sidebar-CQ6iq0qe.js";import{l as F}from"./console-features-api-BD7j--gS.js";import{i as ye,n as I,o as be,r as xe}from"./useCompositeListItem-VmWjhZ9j.js";import{a as L,i as R,l as z,n as Se,o as B,r as Ce,s as V,t as H}from"./alert-dialog-BSs_5Od-.js";import{a as we,c as Te,d as U,f as Ee,h as De,i as Oe,l as ke,m as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as Ie,u as Le}from"./api-DSWk32Mz.js";import{a as Re,c as W,i as ze,n as G,r as Be,s as Ve,t as He}from"./routes-Bc3J564t.js";import{a as Ue,b as We,c as Ge,f as Ke,g as qe,h as Je,i as Ye,l as K,m as Xe,n as Ze,p as Qe,r as $e,t as et,u as tt,v as nt,x as rt,y as it}from"./field-DNqNwq7i.js";import{t as at}from"./chevron-right-CBl7aqu_.js";import{A as ot,D as st,E as ct,M as lt,N as ut,P as dt,T as ft,a as pt,d as mt,f as ht,h as gt,i as _t,m as q,n as vt,o as yt,r as bt,t as xt}from"./select-BE-xONpm.js";import{r as St,t as Ct}from"./HashValueDisplay-DvXl147n.js";import{t as wt}from"./list-BSpjGUS6.js";import{a as Tt,c as Et,i as Dt,l as Ot,n as kt,o as At,r as jt,s as Mt,t as Nt}from"./dialog-YKZpU5St.js";import{a as Pt,i as Ft,n as It,o as Lt,s as Rt,t as zt}from"./input-group-C9ZIjV0o.js";import{a as Bt,i as Vt,n as Ht,o as Ut,t as Wt}from"./switch-DR0WP2g8.js";import{n as Gt}from"./dist-B7eA4Mtf.js";import{a as Kt,c as qt,d as Jt,f as Yt,h as Xt,l as Zt,m as Qt,o as $t,p as en,s as tn,u as nn}from"./insights-search-B-F2wop6.js";import{a as rn,i as J,n as an,o as on,r as Y,t as sn}from"./table-DW0243Jw.js";import{i as cn,n as ln,t as un}from"./valueToPercent-C-rPd_Or.js";var dn=D(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),fn=D(`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`}]]),pn=D(`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`}]]),mn=D(`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`}]]),hn=D(`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`}]]),gn=D(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),_n=D(`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`}]]),vn=D(`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`}]]),yn=A();function bn(){return v}function xn(){return!1}function Sn(){return!0}function Cn(){return(0,yn.useSyncExternalStore)(bn,xn,Sn)}var X=me(ae(),1),Z=y(),wn={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 Tn({channel:e,className:t}){return(0,Z.jsx)(K,{variant:`outline`,className:p(wn[e.toLowerCase()]||`bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20`,t),children:e})}function En({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(rt,{className:p(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(gn,{className:p(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Z.jsx)(O,{className:p(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}var Dn=me(Bt(),1),On=me(Vt(),1);Dn.default.extend(On.default);function kn({uuid:e,format:t=`relative`}){let n=(0,Dn.default)(Kt(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 An({panelId:t,bundle:n,bundles:r,loading:a,onDetailClick:o}){let s=le();return(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id:t,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)(cn,{bundleId:n.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(K,{variant:`outline`,children:[r.length,` `,r.length===1?`patch`:`patches`]})]}),a?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):r.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`}),s?(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.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)(cn,{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)(cn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(De,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(cn,{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)(kn,{uuid:e.id})})]})]}),(0,Z.jsx)(i,{className:`w-full`,onClick:()=>o(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)(sn,{className:`min-w-max`,children:[(0,Z.jsx)(rn,{children:(0,Z.jsxs)(on,{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)(an,{children:r.map(e=>(0,Z.jsxs)(on,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(cn,{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)(cn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(De,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(cn,{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)(kn,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(i,{onClick:()=>o(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 jn({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[a,o]=(0,X.useState)(null),s=Ht(a),{data:c=[],isPending:l}=Oe(),u=Me(),d=Fe(),f=n.trim(),p=async e=>{if(e.preventDefault(),!(!f||u.isPending))try{let e=await u.mutateAsync({name:f});r(``),e.inserted?Gt.success(`Channel ${e.row.name} created`):Gt.info(`Channel ${e.row.name} already exists`)}catch(e){Gt.error(`Failed to create channel`),console.error(e)}},m=async()=>{if(!(!a||d.isPending))try{let e=await d.mutateAsync({id:a.id});e.deleted?Gt.success(`Channel ${a.name} deleted`):e.reason===`not_empty`?Gt.error(`Channel ${a.name} is still in use and cannot be deleted`):Gt.error(`Channel ${a.name} no longer exists`),o(null)}catch(e){Gt.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Nt,{open:e,onOpenChange:t,children:(0,Z.jsxs)(kt,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(Tt,{children:[(0,Z.jsxs)(At,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(_n,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(jt,{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:p,children:(0,Z.jsx)(Ye,{className:`gap-2`,children:(0,Z.jsxs)(et,{orientation:`horizontal`,children:[(0,Z.jsx)(Ue,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(T,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:u.isPending}),(0,Z.jsxs)(i,{type:`submit`,disabled:!f||u.isPending,children:[u.isPending?(0,Z.jsx)(Ot,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(Et,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,Z.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,Z.jsx)(Ot,{className:`mr-2 size-3.5 animate-spin`}),`Loading channels`]}):c.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:c.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:d.isPending,onClick:()=>o(e),className:`text-muted-foreground hover:text-destructive`,children:(0,Z.jsx)(Ut,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(H,{open:a!==null,onOpenChange:e=>{!e&&!d.isPending&&o(null)},children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(V,{children:[(0,Z.jsxs)(z,{children:[`Delete `,s?.name,`?`]}),(0,Z.jsx)(L,{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)(B,{children:[(0,Z.jsx)(Ce,{disabled:d.isPending,children:`Cancel`}),(0,Z.jsx)(Se,{variant:`destructive`,disabled:d.isPending,onClick:e=>{e.preventDefault(),m()},children:d.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var Mn=`[a-zA-Z0-9-]`,Nn=String.raw`0|[1-9]\d*`,Pn=String.raw`\d+`,Fn=String.raw`\d*[a-zA-Z-]${Mn}*`,In=String.raw`(${Nn})\.(${Nn})\.(${Nn})`,Ln=String.raw`(${Pn})\.(${Pn})\.(${Pn})`,Rn=`(?:${Fn}|${Nn})`,zn=`(?:${Fn}|${Pn})`,Bn=String.raw`(?:-(${Rn}(?:\.${Rn})*))`,Vn=String.raw`(?:-?(${zn}(?:\.${zn})*))`,Hn=`${Mn}+`,Un=String.raw`(?:\+(${Hn}(?:\.${Hn})*))`,Wn=`v?${In}${Bn}?${Un}?`,Gn=String.raw`[v=\s]*${Ln}${Vn}?${Un}?`,Kn=`((?:<|>)?=?)`,qn=String.raw`${Nn}|x|X|\*`,Jn=String.raw`${Pn}|x|X|\*`,Yn=String.raw`[v=\s]*(${qn})(?:\.(${qn})(?:\.(${qn})(?:${Bn})?${Un}?)?)?`,Xn=String.raw`[v=\s]*(${Jn})(?:\.(${Jn})(?:\.(${Jn})(?:${Vn})?${Un}?)?)?`,Zn=`(?:~>?)`,Qn=String.raw`(?:\^)`,$n=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${$n}(?:$|[^\d])`,String.raw`${$n}(?:${Bn})?(?:${Un})?(?:$|[^\d])`;function er(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[Mn,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(er(e),t)}var tr=Q(`^${Wn}$`),nr=Q(`^${Gn}$`),rr=/^\d+$/;function ir(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function ar(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?nr:tr);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(rr.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 or=Q(String.raw`^${Kn}\s*(${Wn})$|^$`),sr=Q(String.raw`^${Kn}\s*(${Gn})$|^$`);function cr(e){return e.version?`${e.operator}${ir(e.version)}`:``}function lr(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?sr:or);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?ar(r[2],t):null;return{operator:i,options:t,value:a?`${i}${ir(a)}`:``,version:a}}function ur(e){return e.sets.map(e=>e.map(cr).join(` `)).join(`||`)}var dr=new RegExp(Un,`g`),fr=Q(Un),pr=Q(String.raw`^\s*(${Yn})\s+-\s+(${Yn})\s*$`),mr=Q(String.raw`^\s*(${Xn})\s+-\s+(${Xn})\s*$`),hr=Q(String.raw`(\s*)${Kn}\s*(${Gn}|${Yn})`,`g`),gr=Q(String.raw`(\s*)${Zn}\s+`,`g`),_r=Q(String.raw`(\s*)${Qn}\s+`,`g`),vr=Q(`^${Zn}${Yn}$`),yr=Q(`^${Zn}${Xn}$`),br=Q(`^${Qn}${Yn}$`),xr=Q(`^${Qn}${Xn}$`),Sr=Q(String.raw`^${Kn}\s*${Yn}$`),Cr=Q(String.raw`^${Kn}\s*${Xn}$`),wr=Q(String.raw`(<|>)?=?\s*\*`),Tr=/^\s*>=\s*0\.0\.0\s*$/,Er=/^\s*>=\s*0\.0\.0-0\s*$/,Dr=Q(String.raw`^${Kn}\s*(${Gn})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Or(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function kr(e,t){let n=t.loose?yr:vr,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 Ar(e,t){return e.trim().split(/\s+/).map(e=>kr(e,t)).join(` `)}function jr(e,t){let n=t.loose?xr:br,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 Mr(e,t){return e.trim().split(/\s+/).map(e=>jr(e,t)).join(` `)}function Nr(e,t){let n=t.loose?Cr:Sr;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Or(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 Pr(e,t){return e.split(/\s+/).map(e=>Nr(e,t)).join(` `)}function Fr(e,t){let n=t.loose?mr:pr;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 Ir(e,t){return Pr(Ar(Mr(e.replace(fr,``),t),t),t).trim().replace(wr,``)}function Lr(e,t){let n=Fr(e.replace(dr,``),t).replace(hr,`$1$2$3`).replace(gr,`$1~`).replace(_r,`$1^`).split(` `).map(e=>Ir(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Er:Tr,``));t.loose&&(n=n.filter(e=>Dr.test(e)));let r=new Map;for(let e of n.map(e=>lr(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 Rr(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Lr(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 zr(e,t={}){try{return Rr(e,t)}catch{return null}}function Br(e,t={}){let n=zr(e,t);return n?ur(n)||`*`:null}var Vr=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$/,``)},Hr=(e,t)=>{if(!e?.trim())return null;let n=Vr(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 Ur({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 Wr({bundle:e,release:t}){let{data:n,isFetched:r}=we(),i=e?Jt(e):null,a=e?nn(e):null,o=e?.gitCommitHash&&r?Hr(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)(Xe,{children:[(0,Z.jsx)(nt,{className:`p-4 pb-3`,children:(0,Z.jsx)(it,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(Je,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(Ur,{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)(Ur,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(Ct,{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)(pn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(Ur,{label:`Manifest hash`,value:(0,Z.jsx)(Ct,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(Ur,{label:`Base hash`,value:(0,Z.jsx)(Ct,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(Ur,{label:`Patch hash`,value:(0,Z.jsx)(Ct,{maxLength:16,value:i})}):null]})})]}):null}var Gr=Array.from({length:tn},(e,t)=>t+1);function Kr({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=Qt(t),a=n??[],o=a.length>0,s=r>0&&r<1e3,c=r===tn,l=le(),u=c?Gr:s?Gr.filter(t=>qt(e,t)<r):[],d=(r/10).toFixed(1),f=c?tn:u.length,p=tn-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)(Xe,{children:(0,Z.jsxs)(nt,{className:`p-4`,children:[(0,Z.jsx)(qe,{children:`Selected cohorts`}),(0,Z.jsx)(it,{className:`font-mono text-2xl tabular-nums`,children:f})]})}),(0,Z.jsx)(Xe,{children:(0,Z.jsxs)(nt,{className:`p-4`,children:[(0,Z.jsx)(qe,{children:`Excluded cohorts`}),(0,Z.jsx)(it,{className:`font-mono text-2xl tabular-nums`,children:p})]})})]}),o?(0,Z.jsxs)(Xe,{children:[(0,Z.jsxs)(nt,{className:`p-4 pb-3`,children:[(0,Z.jsx)(it,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(qe,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(Je,{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)(Xe,{children:[(0,Z.jsx)(nt,{className:`p-4 pb-3`,children:(0,Z.jsx)(it,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(Je,{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)(Nt,{children:[(0,Z.jsxs)(Mt,{render:(0,Z.jsx)(i,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(wt,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(kt,{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)(Tt,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(At,{children:`Rolled out cohorts`}),(0,Z.jsxs)(jt,{children:[d,`% includes `,f,` of`,` `,tn,` 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)(Dt,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Tt,{children:[(0,Z.jsx)(At,{children:`Rolled out cohorts`}),(0,Z.jsxs)(jt,{children:[d,`% includes `,f,` of`,` `,tn,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),m,(0,Z.jsx)(Dt,{showCloseButton:!0})]})})]})}function qr(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Jr(e,t){return e-t}function Yr(e,t,n){let r=e.slice();return r[t]=n,r.sort(Jr)}function Xr(e,t,n,r,i,a){let o=e;return o=q(o,n,r),i&&(o=Yr(a,t,q(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function Zr(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 Qr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...lt},$r=X.createContext(void 0);function ei(){let e=X.useContext($r);if(e===void 0)throw Error(l(62));return e}function ti(e){return`key`in e?k:ne}function ni(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?qr(e,t):!1}var ri=X.forwardRef(function(e,t){let{"aria-labelledby":r,className:i,defaultValue:o,disabled:s=!1,id:c,format:l,largeStep:u=10,locale:d,render:f,max:p=100,min:m=0,minStepsBetweenValues:h=0,form:g,name:_,onValueChange:v,onValueCommitted:y,orientation:b=`horizontal`,step:x=1,thumbCollisionBehavior:w=`push`,thumbAlignment:T=`center`,value:te,style:ne,...D}=e,re=j(c),ae=mt(re),oe=E(v),se=E(y),{clearErrors:ce}=gt(),{state:le,disabled:O,name:k,setTouched:ue,setDirty:de,validityData:fe,shouldValidateOnChange:me,validation:A}=ot(),{labelId:he}=ct(),[ge,_e]=X.useState(),N=r??ht(he,ge),P=O||s,F=k??_,[I,be]=ye({controlled:te,default:o??m,name:`Slider`}),L=X.useRef(null),R=X.useRef(null),z=X.useRef([]),Se=X.useRef(null),B=X.useRef(null),Ce=X.useRef(-1),V=X.useRef(null),H=X.useRef(null),we=X.useRef(`none`),Te=pe(l),[U,Ee]=X.useState(-1),[De,Oe]=X.useState(-1),[ke,Ae]=X.useState(!1),[je,Me]=X.useState(()=>new Map),[Ne,Pe]=X.useState([void 0,void 0]),Fe=E(e=>{Ee(e),e!==-1&&Oe(e)});st(R,re,I),M(I,()=>{ce(F),me()?A.commit(I):A.commit(I,!0);let e=fe.initialValue,t;t=Array.isArray(I)&&Array.isArray(e)?!qr(I,e):I!==e,de(t)});let Ie=E(e=>{e&&(R.current=e)}),Le=Array.isArray(I),Re=X.useMemo(()=>Le?I.slice().sort(Jr):[q(I,m,p)],[p,m,Le,I]),W=E((e,t)=>{if(Number.isNaN(e)||ni(e,I))return;let n=t??ee(`none`,void 0,void 0,{activeThumbIndex:-1});we.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:F}}),n.event=i,H.current=e,oe(e,n),!n.isCanceled&&be(e)}),ze=E((e,t,n)=>{let r=Xr(e,t,m,p,Le,Re);if(Zr(r,x,h)){let e=ti(n);W(r,ee(e,n.nativeEvent,void 0,{activeThumbIndex:t})),ue(!0),se(H.current??r,C(e,n.nativeEvent))}});S(()=>{let e=ve(a(L.current));P&&ie(L.current,e)&&e.blur()},[P]),P&&U!==-1&&Fe(-1);let G=X.useMemo(()=>({...le,activeThumbIndex:U,disabled:P,dragging:ke,orientation:b,max:p,min:m,minStepsBetweenValues:h,step:x,values:Re}),[le,U,P,ke,p,m,h,b,x,Re]),Be=X.useMemo(()=>({active:U,controlRef:R,disabled:P,dragging:ke,validation:A,formatOptionsRef:Te,handleInputChange:ze,indicatorPosition:Ne,inset:T!==`center`,labelId:N,rootLabelId:ae,largeStep:u,lastUsedThumbIndex:De,lastChangedValueRef:H,lastChangeReasonRef:we,form:g,locale:d,max:p,min:m,minStepsBetweenValues:h,name:F,onValueCommitted:se,orientation:b,pressedInputRef:Se,pressedThumbCenterOffsetRef:B,pressedThumbIndexRef:Ce,pressedValuesRef:V,registerFieldControlRef:Ie,renderBeforeHydration:T===`edge`,setActive:Fe,setDragging:Ae,setIndicatorPosition:Pe,setLabelId:_e,setValue:W,state:G,step:x,thumbCollisionBehavior:w,thumbMap:je,thumbRefs:z,values:Re}),[U,R,N,ae,P,ke,A,Te,ze,Ne,u,De,H,we,g,d,p,m,h,F,se,b,Se,B,Ce,V,Ie,Fe,Ae,Pe,_e,W,G,x,w,T,je,z,Re]),Ve=n(`div`,e,{state:G,ref:[t,L],props:[{"aria-labelledby":N,id:re,role:`group`},A.getValidationProps,D],stateAttributesMapping:Qr});return(0,Z.jsx)($r.Provider,{value:Be,children:(0,Z.jsx)(xe,{elementsRef:z,onMapChange:Me,children:Ve})})});function ii(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function ai(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 oi(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(ai(t),ai(n))))}function si({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]=q(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]=q(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]=q(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function ci({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=q(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=si({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=q(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:si({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=q(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 li=2;function ui(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 di(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 fi=X.forwardRef(function(e,r){let{render:i,className:o,style:s,...c}=e,{disabled:l,dragging:f,inset:p,lastChangedValueRef:m,lastChangeReasonRef:h,max:g,min:_,minStepsBetweenValues:v,onValueCommitted:y,orientation:b,pressedInputRef:x,pressedThumbCenterOffsetRef:S,pressedThumbIndexRef:w,pressedValuesRef:T,registerFieldControlRef:te,renderBeforeHydration:ne,setActive:D,setDragging:re,setValue:ae,state:se,step:ce,thumbCollisionBehavior:le,thumbRefs:O,values:k}=ei(),fe=ue(),me=k.length>1,A=b===`vertical`,j=X.useRef(null),ge=X.useRef(null),_e=E(e=>{e&&ge.current==null&&(ge.current=t(e).getComputedStyle(e))}),M=X.useRef(null),P=X.useRef(0),F=X.useRef(0),ye=pe(k);function I(e){w.current!==e&&(w.current=e);let t=O.current[e];if(!t){S.current=null,x.current=null;return}x.current=t.querySelector(`input[type="range"]`)}function be(e){let t=j.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=ui(ge.current,A),c=F.current,l=(A?r:n)-s.start-s.end-c*2,u=S.current??0,d=e.x-u,f=e.y-u,p=q(((A?i-f-s.end:(fe===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(g-_)*p+_;if(m=oi(m,ce,_),m=q(m,_,g),!me)return{value:m,thumbIndex:0,didSwap:!1};let h=w.current;if(h<0)return null;let y=ci({behavior:le,values:k,currentValues:ye.current??k,initialValues:T.current,pressedIndex:h,nextValue:m,min:_,max:g,step:ce,minStepsBetweenValues:v});return le===`swap`&&y.didSwap?I(y.thumbIndex):w.current=y.thumbIndex,y}function xe(e){T.current=me?k.slice():null,ye.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=A?`y`:`x`,r;n=-1;for(let i=0;i<O.current.length;i+=1){let a=O.current[i];if(oe(a)){let o=ii(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&I(n),p){let e=O.current[n];oe(e)&&(F.current=e.getBoundingClientRect()[A?`height`:`width`]/2)}}function L(e){let t=O.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let R=E(e=>{let t=di(e,M);if(t==null)return;if(P.current+=1,e.type===`pointermove`&&e.buttons===0){z(e);return}let n=be(t);n!=null&&Zr(n.value,ce,v)&&(!f&&P.current>li&&re(!0),ae(n.value,ee(he,e,void 0,{activeThumbIndex:n.thumbIndex})),ye.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&L(n.thumbIndex))});function z(e){D(-1),re(!1),x.current=null,S.current=null;let t=di(e,M),n=t==null?null:be(t);if(n!=null){let t=h.current;y(m.current??n.value,C(t,e))}`pointerType`in e&&j.current?.hasPointerCapture(e.pointerId)&&j.current?.releasePointerCapture(e.pointerId),w.current=-1,M.current=null,T.current=null,B()}let Se=E(e=>{if(l)return;let t=e.changedTouches[0];t!=null&&(M.current=t.identifier);let n=di(e,M);if(n!=null){xe(n);let t=be(n);if(t==null)return;L(t.thumbIndex),ae(t.value,ee(de,e,void 0,{activeThumbIndex:t.thumbIndex})),ye.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&L(t.thumbIndex)}P.current=0;let r=a(j.current);r.addEventListener(`touchmove`,R,{passive:!0}),r.addEventListener(`touchend`,z,{passive:!0})}),B=E(()=>{let e=a(j.current);e.removeEventListener(`pointermove`,R),e.removeEventListener(`pointerup`,z),e.removeEventListener(`touchmove`,R),e.removeEventListener(`touchend`,z),T.current=null}),Ce=d();return X.useEffect(()=>{let e=j.current;if(!e)return()=>B();let t=u(e,`touchstart`,Se,{passive:!0});return()=>{t(),Ce.cancel(),B()}},[B,Se,j,Ce]),X.useEffect(()=>{l&&B()},[l,B]),n(`div`,e,{state:se,ref:[r,te,j,_e],props:[{"data-base-ui-slider-control":ne?``:void 0,onPointerDown(e){let t=j.current,n=N(e.nativeEvent);if(!t||l||e.defaultPrevented||!oe(n)||e.button!==0)return;let r=di(e,M);if(r!=null){xe(r);let n=be(r);if(n==null)return;ie(O.current[n.thumbIndex],ve(a(t)))?e.preventDefault():Ce.request(()=>{L(n.thumbIndex)}),re(!0),S.current??(ae(n.value,ee(de,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),ye.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&L(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),P.current=0;let i=a(j.current);i.addEventListener(`pointermove`,R,{passive:!0}),i.addEventListener(`pointerup`,z,{once:!0})}},c],stateAttributesMapping:Qr})}),pi=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{state:s}=ei();return n(`div`,e,{state:s,ref:t,props:[{style:{position:`relative`}},o],stateAttributesMapping:Qr})}),mi=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}({}),hi=new Set([...f,_,o]);function gi(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${ln(e[t],r,n)} start range`:`${ln(e[t],r,n)} end range`:n?ln(e[t],r,n):void 0}function _i(e,t,n,r,i){let a=n===1?e+t:e-t;return q(Number(a.toFixed(Math.max(ai(e),ai(t),ai(r)))),r,i)}var vi=X.forwardRef(function(e,i){let{render:a,children:c,className:l,"aria-describedby":u,"aria-label":d,"aria-labelledby":p,disabled:v=!1,getAriaLabel:y,getAriaValueText:C,id:ee,index:T,inputRef:te,onBlur:ne,onFocus:D,onKeyDown:re,tabIndex:ie,style:ae,...oe}=e,{nonce:se}=dt(),ce=j(ee),{active:le,lastUsedThumbIndex:O,controlRef:k,disabled:de,validation:fe,formatOptionsRef:pe,handleInputChange:me,inset:A,labelId:he,largeStep:ge,locale:M,max:N,min:P,minStepsBetweenValues:ve,form:F,name:ye,orientation:be,pressedInputRef:xe,pressedThumbCenterOffsetRef:L,pressedThumbIndexRef:R,renderBeforeHydration:z,setActive:Se,setIndicatorPosition:B,state:Ce,step:V,values:H}=ei(),we=ue(),Te=v||de,U=H.length>1,Ee=be===`vertical`,De=we===`rtl`,{setTouched:Oe,setFocused:ke,validationMode:Ae}=ot(),je=X.useRef(null),Me=X.useRef(null),Ne=X.useRef(!1),Pe=j(),Fe=ft(),Ie=U?Pe:Fe,{ref:Le,index:Re}=I({metadata:X.useMemo(()=>({inputId:Ie}),[Ie])}),W=U?T??Re:0,ze=W===H.length-1,G=H[W],Be=un(G,P,N),[Ve,He]=X.useState(),Ue=Cn(),We=O>=0&&O<H.length?O:-1,Ge=E(()=>{let e=k.current,t=je.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Ee?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Be/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;He(s),W===0?B(e=>[s,e[1]]):ze&&B(e=>[e[0],s])});S(()=>{A&&queueMicrotask(Ge)},[Ge,A]),S(()=>{A&&Ge()},[Ge,A,Be]),S(()=>{if(!A)return;let e=k.current,n=je.current;if(!e||!n)return;let r=t(e).ResizeObserver;if(typeof r!=`function`)return;let i=new r(Ge);return i.observe(e),i.observe(n),()=>{i.disconnect()}},[k,Ge,A]);let Ke=Ee?`bottom`:`insetInlineStart`,qe=Ee?`left`:`top`,Je;U?le===W?Je=2:We===W&&(Je=1):le===W&&(Je=1);let Ye;Ye=A?{"--position":`${Ve??0}%`,visibility:z&&Ue||Ve===void 0?`hidden`:void 0,position:`absolute`,[Ke]:`var(--position)`,[qe]:`50%`,translate:`${(Ee||!De?-1:1)*50}% ${(Ee?1:-1)*50}%`,zIndex:Je}:Number.isFinite(Be)?{position:`absolute`,[Ke]:`${Be}%`,[qe]:`50%`,translate:`${(Ee||!De?-1:1)*50}% ${(Ee?1:-1)*50}%`,zIndex:Je}:b;let K;be===`vertical`&&(K=De?`vertical-rl`:`vertical-lr`);let Xe=typeof y==`function`?y(W):d,Ze=w({"aria-label":Xe,"aria-labelledby":p??(Xe==null?he:void 0),"aria-describedby":u,"aria-orientation":be,"aria-valuenow":G,"aria-valuetext":typeof C==`function`?C(ln(G,M,pe.current??void 0),G,W):gi(H,W,pe.current??void 0,M),disabled:Te,form:F,id:Ie,max:N,min:P,name:ye,onChange(e){me(e.currentTarget.valueAsNumber,W,e)},onFocus(e){let t=Ne.current;Ne.current=!1,Se(W),ke(!0),t&&e.stopPropagation()},onBlur(e){if(Ne.current){e.stopPropagation();return}je.current&&(Se(-1),Oe(!0),ke(!1),Ae===`onBlur`&&fe.commit(Xr(G,W,P,N,U,H)))},onKeyDown(e){if(!hi.has(e.key))return;f.has(e.key)&&e.stopPropagation();let t=null,n=oi(G,V,P);switch(e.key){case s:t=_i(n,e.shiftKey?ge:V,1,P,N);break;case r:t=_i(n,e.shiftKey?ge:V,De?-1:1,P,N);break;case m:t=_i(n,e.shiftKey?ge:V,-1,P,N);break;case h:t=_i(n,e.shiftKey?ge:V,De?1:-1,P,N);break;case _:t=_i(n,ge,1,P,N);break;case o:t=_i(n,ge,-1,P,N);break;case`End`:t=N,U&&(t=Number.isFinite(H[W+1])?H[W+1]-V*ve:N);break;case g:t=P,U&&(t=Number.isFinite(H[W-1])?H[W-1]+V*ve:P);break;default:break}if(t!==null){let n=e.currentTarget;_e(n)||(Ne.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),me(t,W,e),e.preventDefault()}},step:V,style:{...b,width:`100%`,height:`100%`,writingMode:K},tabIndex:ie??void 0,type:`range`,value:G??``},fe.getInputValidationProps),Qe=x(Me,fe.inputRef,te);return n(`div`,e,{state:Ce,ref:[i,Le,je],props:[{[mi.index]:W,children:(0,Z.jsxs)(X.Fragment,{children:[c,(0,Z.jsx)(`input`,{ref:Qe,...Ze,suppressHydrationWarning:!0}),A&&Ue&&z&&ze&&(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:ne,onFocus:D,onPointerDown(e){if(R.current=W,je.current!=null){let t=be===`horizontal`?`x`:`y`,n=ii(je.current);L.current=(be===`horizontal`?e.clientX:e.clientY)-n[t]}Me.current!=null&&xe.current!==Me.current&&(xe.current=Me.current)},style:Ye,suppressHydrationWarning:z||void 0},oe],stateAttributesMapping:Qr})});function yi(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 bi(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 xi=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}=ei(),h=Cn(),g=d===`vertical`,_=m.length>1,v=c?yi(g,_,s[0],s[1],f,h):bi(g,_,un(m[0],u,l),un(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:Qr})});function Si({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)(ri,{className:p(`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)(fi,{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)(pi,{"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)(xi,{"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)(vi,{"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 Ci=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],wi=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]}),Ti=(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}),Ei=e=>(e/10).toFixed(1),Di=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},Oi=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function ki({value:e,onChange:t}){let[n,r]=(0,X.useState)(Ei(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(Ei(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Si,{"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)(zt,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(Ft,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=Oi(n)??e;a(!1),r(Ei(i)),t(i)},onChange:e=>{let n=Di(e.target.value);r(n);let i=Oi(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(It,{align:`inline-end`,children:(0,Z.jsx)(Pt,{children:`%`})})]})]})}function Ai({channels:t,onOpenChange:n,onShowScope:r,open:a,releaseId:o}){let s=Ee(o),c=s.data,l=Pe(c?.bundle_id??``),u=l.data,d=u?Zt(u):null,f=U(c?.scope_key??``),p=Ae(),m=ke(),h=Te(),g=Le(),[_,v]=(0,X.useState)(null),[y,b]=(0,X.useState)(``),[x,S]=(0,X.useState)(``),[C,w]=(0,X.useState)(!1),[ee,E]=(0,X.useState)(!1),[ne,D]=(0,X.useState)(!1),[ie,ae]=(0,X.useState)(``),[oe,le]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{v(c?wi(c):null),S(``)},[c]);let k=c?wi(c):null,ue=_!==null&&k!==null&&JSON.stringify(_)!==JSON.stringify(k),de=m.isPending||p.isPending||h.isPending||g.isPending,fe=()=>{if(!de){if(ue){w(!0);return}n(!1)}},pe=()=>{if(!_)return;let e=en(y);if(!Yt(e)){S($t);return}v({..._,targetCohorts:Array.from(new Set([..._.targetCohorts,e]))}),b(``),S(``)},me=async()=>{if(!c||!_)return;let e=_.targetCohorts.map(en);if(e.some(e=>!Yt(e))){S($t);return}if(c.strategy===`APP_VERSION`&&!Br(_.targetAppVersion.trim())){S(`Enter a valid target app version range.`);return}let t={expectedRevision:c.revision,patch:Ti(c,{..._,targetCohorts:e}),releaseId:c.id};S(``);try{await m.mutateAsync(t),await p.mutateAsync(t),Gt.success(`Bundle settings saved`),n(!1)}catch(e){S(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},A=t.find(e=>e.id===c?.channel_id)?.name??c?.channel_id,he=t.filter(e=>e.id!==c?.channel_id),j=he.map(e=>({label:e.name,value:e.name})),_e=ie.trim(),M=oe===`copy`,N=_?Br(_.targetAppVersion.trim()):null,ve=()=>{ae(``),le(`move`)},F=e=>{!e&&g.isPending||(D(e),e||ve())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ce,{onOpenChange:e=>e?void 0:fe(),open:a,children:(0,Z.jsxs)(te,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(P,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(re,{children:`Bundle Detail`}),(0,Z.jsx)(ge,{className:`sr-only`,children:`Edit bundle delivery settings.`}),c?(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)(ut,{className:`size-4`,platform:c.platform}),(0,Z.jsx)(`span`,{className:`font-medium`,children:c.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)(cn,{bundleId:c.id,fullOnMobile:!0,maxLength:18}),c.bundle_id?null:(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:`Built-in bundle`})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Channel`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,translate:`no`,children:A})]}),(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:c.platform===`ios`?`iOS`:`Android`})]})]}):(0,Z.jsx)(e,{className:`h-12 w-full`})]}),(0,Z.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[s.isError?(0,Z.jsxs)(tt,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(We,{}),(0,Z.jsx)(Qe,{children:`Bundle details could not be loaded`}),(0,Z.jsx)(Ke,{children:s.error.message})]}):null,c&&_?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[A?(0,Z.jsx)(Re,{release:{platform:c.platform,channel:A,releaseId:c.id,builtIn:!c.bundle_id}}):null,(0,Z.jsxs)(`section`,{"aria-labelledby":`delivery-settings-heading`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,id:`delivery-settings-heading`,children:`Delivery settings`}),(0,Z.jsxs)(Ye,{className:`gap-6`,children:[(0,Z.jsxs)(et,{children:[(0,Z.jsx)(Ue,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(Lt,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>v({..._,message:e.target.value}),rows:3,value:_.message})]}),c.strategy===`APP_VERSION`?(0,Z.jsxs)(et,{children:[(0,Z.jsx)(Ue,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(T,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>v({..._,targetAppVersion:e.target.value}),value:_.targetAppVersion}),N?(0,Z.jsx)(Ze,{children:N}):null]}):null,(0,Z.jsx)(et,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(Ue,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(Xt,{label:`About Enabled`,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.jsx)(Wt,{"aria-label":`Enabled`,checked:_.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>v({..._,enabled:e})})]})}),(0,Z.jsx)(et,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(Ue,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(Xt,{label:`About Force update`,children:`Devices apply this bundle right away, and so do devices that skip it to update straight to a newer bundle.`})]}),(0,Z.jsx)(Wt,{"aria-label":`Force update`,checked:_.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>v({..._,shouldForceUpdate:e})})]})}),(0,Z.jsxs)(et,{children:[(0,Z.jsx)(Ue,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(ki,{onChange:e=>v({..._,rolloutCohortCount:e}),value:_.rolloutCohortCount})]}),(0,Z.jsxs)(et,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(Ue,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Z.jsx)(Kr,{releaseId:c.id,rolloutCohortCount:_.rolloutCohortCount,targetCohorts:_.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(T,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>b(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),pe())},placeholder:`e.g. qa-team…`,value:y}),(0,Z.jsx)(i,{"aria-label":`Add cohort`,disabled:!y.trim(),onClick:pe,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(Et,{})})]}),_.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:_.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:()=>v({..._,targetCohorts:_.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Z.jsx)(O,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Ze,{children:`Public names—no IDs or secrets.`})]})]}),x?(0,Z.jsx)($e,{children:x}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:!ue||de,onClick:me,size:`lg`,children:m.isPending||p.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(se,{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:!c.bundle_id||de,onClick:()=>D(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),c.bundle_id?(0,Z.jsxs)(i,{className:`w-full`,disabled:de,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(c.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),Gt.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(St,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:c.enabled||de,onClick:()=>E(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),c.bundle_id&&l.isPending?(0,Z.jsx)(e,{className:`h-40 w-full`}):null,c.bundle_id&&l.isError?(0,Z.jsxs)(tt,{variant:`destructive`,children:[(0,Z.jsx)(We,{}),(0,Z.jsx)(Qe,{children:`Build details are unavailable`}),(0,Z.jsx)(Ke,{children:`Delivery settings are unaffected.`})]}):null,!c.bundle_id||!l.isPending?(0,Z.jsx)(Wr,{bundle:u,release:c}):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:c.bundle_id??`Built-in bundle`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Revision`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:c.revision})]}),d?(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:d})]}):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:f.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:f.data?`${f.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:c.scope_key}),r?(0,Z.jsx)(i,{className:`mt-1 h-auto px-0 text-xs`,onClick:()=>r(c.scope_key),size:`sm`,variant:`link`,children:`Show bundles for this target`}):null]})]}),f.isError?(0,Z.jsx)(`p`,{className:`mt-3 text-destructive`,children:`Diagnostics are unavailable. Bundle settings are unaffected.`}):null]})]}):null]})]})}),(0,Z.jsx)(H,{onOpenChange:w,open:C,children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(V,{children:[(0,Z.jsx)(z,{children:`Discard unsaved changes?`}),(0,Z.jsx)(L,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(Ce,{children:`Keep editing`}),(0,Z.jsx)(Se,{onClick:()=>{w(!1),n(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(H,{onOpenChange:E,open:ee,children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(V,{children:[(0,Z.jsxs)(z,{children:[`Remove this Bundle from `,A??`the channel`,`?`]}),(0,Z.jsx)(L,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(Ce,{children:`Cancel`}),(0,Z.jsx)(Se,{onClick:async()=>{if(c)try{await h.mutateAsync({expectedRevision:c.revision,releaseId:c.id}),Gt.success(`Bundle removed from ${A??`the channel`}`),E(!1),n(!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)(Nt,{onOpenChange:F,open:ne,children:(0,Z.jsxs)(kt,{showCloseButton:!g.isPending,children:[(0,Z.jsxs)(Tt,{children:[(0,Z.jsx)(At,{children:`Promote to Channel`}),(0,Z.jsx)(jt,{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)(Ge,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(xt,{disabled:g.isPending,items:Ci,onValueChange:e=>le(e),value:oe,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(yt,{placeholder:`Select an action`})}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(_t,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(_t,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:M?`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)(Ge,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(xt,{disabled:g.isPending,items:j,onValueChange:e=>ae(e??``),value:ie||null,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(yt,{placeholder:`Select a channel`})}),(0,Z.jsx)(vt,{className:`max-h-64`,children:(0,Z.jsx)(bt,{children:he.map(e=>(0,Z.jsx)(_t,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(Dt,{children:[(0,Z.jsx)(i,{disabled:g.isPending,onClick:()=>F(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(i,{disabled:!_e||g.isPending,onClick:async()=>{if(c)try{await g.mutateAsync({action:oe,expectedRevision:c.revision,releaseId:c.id,targetChannel:_e}),F(!1),Gt.success(M?`Bundle copied to ${_e}`:`Bundle moved to ${_e}`)}catch(e){Gt.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:g.isPending?M?`Copying…`:`Moving…`:M?`Copy`:`Move`})]})]})})]})}function ji({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)(rt,{className:`size-3`}):(0,Z.jsx)(fn,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}function Mi({percentage:e,className:t}){let n=e<100,r=e.toFixed(1);return(0,Z.jsxs)(K,{className:p(`gap-1`,t),variant:n?`secondary`:`default`,children:[n?(0,Z.jsx)(We,{className:`h-3 w-3`}):null,r,`%`]})}var Ni=20,Pi=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],Fi=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}],Ii=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),Li=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`}),Ri=e=>t=>{t.target instanceof Element&&t.target.closest(`button, a, input, select, textarea`)||e()};function zi({channels:e,onChange:t,onClear:n,onManageChannels:r,search:a}){let o=G(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)(hn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsxs)(xt,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:a.channelId??`all`,children:[(0,Z.jsx)(pt,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(yt,{})}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(_t,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(_t,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(xt,{disabled:!s,items:Pi,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:a.platform??`ios`,children:[(0,Z.jsx)(pt,{"aria-label":`Platform`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,title:s?void 0:`Choose a channel first`,children:(0,Z.jsx)(yt,{})}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(_t,{value:`ios`,children:`iOS`}),(0,Z.jsx)(_t,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(xt,{disabled:!s&&a.scopeKey===void 0,items:Fi,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)(pt,{"aria-label":`Status`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(yt,{})}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(_t,{value:`all`,children:`Any Status`}),(0,Z.jsx)(_t,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(_t,{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)(vn,{})}),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)(O,{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)(O,{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)(O,{"data-icon":`inline-start`}),`Clear`]}):null]})}function Bi({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)(be,{}):(0,Z.jsx)(at,{})}):(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)(cn,{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)(Rt,{className:`size-3.5`}),` Built-in bundle`]})]}),a?(0,Z.jsx)(K,{className:`shrink-0 font-normal`,variant:`secondary`,children:a}):null,r.currentlyUnreachable?(0,Z.jsxs)(`span`,{"aria-label":`Unreachable: no device gets this bundle with the current delivery settings.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No device gets this bundle with the current delivery settings.`,children:[(0,Z.jsx)(fn,{className:`size-3.5`}),`Unreachable`]}):null]})}function Vi({onDetailClick:t,panelId:n,release:r}){let i=r.bundle_id??``,a=Pe(i),o=je(i);return a.isError||o.isError?(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Patch lineage could not be loaded.`}):a.isPending?(0,Z.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:n,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):a.data?(0,Z.jsx)(An,{bundle:a.data,bundles:o.data??[],loading:o.isPending,onDetailClick:t,panelId:n}):(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Bundle details are unavailable.`})}function Hi(){let t=He.useSearch(),n=He.useNavigate(),r=le(),[a,o]=(0,X.useState)(!1),[s,l]=(0,X.useState)(),u=Ne({afterReleaseId:t.afterReleaseId,beforeReleaseId:t.beforeReleaseId,filter:Be(t),limit:Ni}),d=Oe().data??[],f=u.data?.data??[],m=Ie(Array.from(new Set(f.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},h=u.data?.next,g=u.data?.previous,_=f.flatMap(e=>{let t=d.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t,builtIn:!e.bundle_id}]:[]}),v=Ve(),y=10+v.length,b=new Map(d.map(e=>[e.id,e.name]));(0,X.useEffect)(()=>{s&&!f.some(e=>e.id===s)&&l(void 0)},[s,f]);let x=(e,t=!0)=>void n({resetScroll:t,search:e,to:`/`}),S=e=>x(ze(t,e)),C=e=>{let n=f.find(t=>t.bundle_id===e.id);if(l(void 0),n){x({...t,releaseId:n.id},!1);return}S({bundleId:e.id})},w=t.afterReleaseId!==void 0||t.beforeReleaseId!==void 0,ee=g?{...t,afterReleaseId:g,beforeReleaseId:void 0,releaseId:void 0}:null,T=h?{...t,afterReleaseId:void 0,beforeReleaseId:h,releaseId:void 0}:null,E={...t,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0};return(0,Z.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,Z.jsx)(zi,{channels:d,onChange:S,onClear:()=>x({}),onManageChannels:()=>o(!0),search:t}),(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:[u.isError?(0,Z.jsxs)(tt,{variant:`destructive`,children:[(0,Z.jsx)(We,{}),(0,Z.jsx)(Qe,{children:`Bundles could not be loaded`}),(0,Z.jsx)(Ke,{children:u.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:r?(0,Z.jsx)(`div`,{className:`h-full overflow-y-auto`,children:u.isPending?(0,Z.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:Array.from({length:5},(t,n)=>(0,Z.jsx)(e,{className:`h-44 w-full`},n))}):f.length?f.map(e=>{let n=b.get(e.channel_id)??e.channel_id,r=e.bundle_id?m[e.bundle_id]:0,i=s===e.id,a=`bundle-lineage-panel-${e.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(`article`,{"aria-label":`Bundle ${e.id}`,className:p(`flex cursor-pointer touch-manipulation flex-col gap-4 border-b p-4 transition-[background-color,filter] last:border-b-0 hover:bg-muted/10 active:bg-muted/20 motion-reduce:transition-none data-[state=selected]:bg-muted/15`,e.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,i&&`border-b-0 bg-primary/5`),"data-state":t.releaseId===e.id?`selected`:void 0,onClick:Ri(()=>x({...t,releaseId:e.id},!1)),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(Bi,{expanded:i,onOpen:()=>x({...t,releaseId:e.id},!1),onToggleExpand:()=>l(i?void 0:e.id),release:e}),(0,Z.jsx)(Tn,{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)(ut,{className:`size-4`,platform:e.platform}),e.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:Ii.format(e.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)(Mi,{percentage:e.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`}`:`—`})]}),v.map(({Cell:t,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)(t,{releaseId:e.id,releases:_})})]},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)(ji,{release:e}),e.should_force_update?(0,Z.jsx)(K,{variant:`secondary`,children:`Force update`}):null]}),(0,Z.jsxs)(`div`,{className:`col-span-2 grid grid-cols-1 gap-2 rounded-md border bg-background/80 p-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Target`}),(0,Z.jsx)(`dd`,{className:`min-w-0 truncate text-right font-mono`,children:e.target_app_version??e.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:e.message||`—`})]})]})]})]}),i&&e.bundle_id?(0,Z.jsx)(Vi,{onDetailClick:C,panelId:a,release:e}):null]},e.id)}):(0,Z.jsx)(`p`,{className:`p-8 text-center text-sm text-muted-foreground`,children:w?`No more bundles on this side.`:G(t)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,Z.jsxs)(sn,{className:`min-w-max`,children:[(0,Z.jsx)(rn,{className:`bg-muted/40`,children:(0,Z.jsxs)(on,{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`}),v.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)(an,{children:[u.isPending?Array.from({length:7},(t,n)=>(0,Z.jsx)(on,{children:(0,Z.jsx)(Y,{colSpan:y,children:(0,Z.jsx)(e,{className:`h-8 w-full`})})},n)):f.map(e=>{let n=s===e.id,r=`bundle-lineage-panel-${e.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(on,{"aria-label":`Open bundle ${e.id}`,className:p(`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`,e.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,n&&`bg-primary/5`),"data-state":t.releaseId===e.id?`selected`:void 0,onClick:Ri(()=>x({...t,releaseId:e.id},!1)),onKeyDown:n=>{n.target!==n.currentTarget||n.key!==`Enter`&&n.key!==` `||(n.preventDefault(),x({...t,releaseId:e.id},!1))},tabIndex:0,children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(Bi,{expanded:n,onOpen:()=>x({...t,releaseId:e.id},!1),onToggleExpand:()=>l(n?void 0:e.id),release:e})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Tn,{channel:b.get(e.channel_id)??e.channel_id})}),(0,Z.jsx)(Y,{className:`whitespace-nowrap`,children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(ut,{className:`size-4`,platform:e.platform}),e.platform===`ios`?`iOS`:`Android`]})}),(0,Z.jsx)(Y,{children:e.bundle_id&&m[e.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):e.bundle_id&&m[e.bundle_id]>0?(0,Z.jsxs)(K,{variant:`secondary`,children:[m[e.bundle_id],` `,m[e.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:e.target_app_version?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(W,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`font-medium`,children:e.target_app_version})]}):e.fingerprint_hash?(0,Z.jsxs)(`span`,{className:`flex min-w-[160px] items-center gap-2`,children:[(0,Z.jsx)(mn,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(Ct,{maxLength:12,value:e.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)(En,{enabled:e.enabled}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.enabled?`Enabled`:`Disabled`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(En,{enabled:e.should_force_update,falseIcon:`minus`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.should_force_update?`Required`:`Optional`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Mi,{percentage:e.rollout_cohort_count/10})}),v.map(({Cell:t,feature:n})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(t,{releaseId:e.id,releases:_})},n)),(0,Z.jsx)(Y,{className:`text-sm text-muted-foreground`,title:e.message??void 0,children:e.message||`-`}),(0,Z.jsx)(Y,{className:`whitespace-nowrap text-xs text-muted-foreground`,title:Ii.format(e.created_at_ms),children:Li.format(e.created_at_ms)})]}),n&&e.bundle_id?(0,Z.jsx)(on,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:y,children:(0,Z.jsx)(Vi,{onDetailClick:C,panelId:r,release:e})})}):null]},e.id)}),!u.isPending&&f.length===0?(0,Z.jsx)(on,{children:(0,Z.jsx)(Y,{className:`h-40 text-center text-muted-foreground`,colSpan:y,children:w?`No more bundles on this side.`:G(t)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):null]})]})}),!u.isError&&!u.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:f.length}),` `,f.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)(F,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`ghost`}),search:E,to:`/`,children:`Newest`}):null,ee?(0,Z.jsxs)(F,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:ee,to:`/`,children:[(0,Z.jsx)(dn,{"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)(dn,{"data-icon":`inline-start`}),`Previous`]}),T?(0,Z.jsxs)(F,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:T,to:`/`,children:[`Next`,(0,Z.jsx)(at,{"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)(at,{"data-icon":`inline-end`})]})]})]}):null]}),(0,Z.jsx)(Ai,{channels:d,onOpenChange:e=>!e&&x({...t,releaseId:void 0},!1),onShowScope:e=>S({scopeKey:e}),open:!!t.releaseId,releaseId:t.releaseId??``}),(0,Z.jsx)(jn,{onOpenChange:o,open:a})]})}export{Hi as component};
1
+ import{$ as e,$n as t,Bn as n,F as r,Fn as i,Gt as a,H as o,I as s,In as c,Jn as l,Jt as u,Kt as d,L as f,Ln as p,M as m,P as h,R as g,U as _,Un as v,Ur as y,Ut as b,Wn as x,Xn as S,Xt as C,Yn as w,Yt as ee,Z as T,Zn as E,_ as te,an as ne,ar as D,b as re,bn as ie,ei as ae,er as oe,et as se,g as ce,h as le,ir as O,ln as k,lt as ue,mn as de,p as fe,qt as pe,ri as me,sr as A,tn as he,ut as j,v as ge,vn as _e,w as M,xn as N,y as P,yn as ve}from"./sidebar-BqX460IW.js";import{l as F}from"./console-features-api-DPE4C06Y.js";import{i as ye,n as I,o as be,r as xe}from"./useCompositeListItem-B-UkrDlu.js";import{a as L,i as R,l as z,n as Se,o as B,r as Ce,s as V,t as H}from"./alert-dialog-BtVg50WQ.js";import{a as we,c as Te,d as U,f as Ee,h as De,i as Oe,l as ke,m as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as Ie,u as Le}from"./api-DoicFJfd.js";import{a as Re,c as W,i as ze,n as G,r as Be,s as Ve,t as He}from"./routes-CyirpG2O.js";import{a as Ue,b as We,c as Ge,f as Ke,g as qe,h as Je,i as Ye,l as K,m as Xe,n as Ze,p as Qe,r as $e,t as et,u as tt,v as nt,x as rt,y as it}from"./field-DBMkBfkD.js";import{t as at}from"./chevron-right-BnvHIJdZ.js";import{A as ot,D as st,E as ct,M as lt,N as ut,P as dt,T as ft,a as pt,d as mt,f as ht,h as gt,i as _t,m as q,n as vt,o as yt,r as bt,t as xt}from"./select-CV8nkfsf.js";import{r as St,t as Ct}from"./HashValueDisplay-BGkDPaYi.js";import{t as wt}from"./list-Dtj7TtzV.js";import{a as Tt,c as Et,i as Dt,l as Ot,n as kt,o as At,r as jt,s as Mt,t as Nt}from"./dialog-CGKPxz3n.js";import{a as Pt,i as Ft,n as It,o as Lt,s as Rt,t as zt}from"./input-group-B4nrqIh0.js";import{a as Bt,i as Vt,n as Ht,o as Ut,t as Wt}from"./switch-C8ycp9AH.js";import{n as Gt}from"./dist-dDj-R6uh.js";import{a as Kt,c as qt,d as Jt,f as Yt,h as Xt,l as Zt,m as Qt,o as $t,p as en,s as tn,u as nn}from"./insights-search-DAa0f7Dr.js";import{a as rn,i as J,n as an,o as on,r as Y,t as sn}from"./table-DgGD67Fx.js";import{i as cn,n as ln,t as un}from"./valueToPercent-C4C1WZVn.js";var dn=D(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),fn=D(`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`}]]),pn=D(`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`}]]),mn=D(`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`}]]),hn=D(`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`}]]),gn=D(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),_n=D(`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`}]]),vn=D(`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`}]]),yn=A();function bn(){return v}function xn(){return!1}function Sn(){return!0}function Cn(){return(0,yn.useSyncExternalStore)(bn,xn,Sn)}var X=me(ae(),1),Z=y(),wn={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 Tn({channel:e,className:t}){return(0,Z.jsx)(K,{variant:`outline`,className:p(wn[e.toLowerCase()]||`bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20`,t),children:e})}function En({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(rt,{className:p(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(gn,{className:p(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Z.jsx)(O,{className:p(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}var Dn=me(Bt(),1),On=me(Vt(),1);Dn.default.extend(On.default);function kn({uuid:e,format:t=`relative`}){let n=(0,Dn.default)(Kt(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 An({panelId:t,bundle:n,bundles:r,loading:a,onDetailClick:o}){let s=le();return(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id:t,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)(cn,{bundleId:n.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(K,{variant:`outline`,children:[r.length,` `,r.length===1?`patch`:`patches`]})]}),a?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):r.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`}),s?(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.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)(cn,{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)(cn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(De,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(cn,{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)(kn,{uuid:e.id})})]})]}),(0,Z.jsx)(i,{className:`w-full`,onClick:()=>o(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)(sn,{className:`min-w-max`,children:[(0,Z.jsx)(rn,{children:(0,Z.jsxs)(on,{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)(an,{children:r.map(e=>(0,Z.jsxs)(on,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(cn,{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)(cn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(De,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(cn,{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)(kn,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(i,{onClick:()=>o(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 jn({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[a,o]=(0,X.useState)(null),s=Ht(a),{data:c=[],isPending:l}=Oe(),u=Me(),d=Fe(),f=n.trim(),p=async e=>{if(e.preventDefault(),!(!f||u.isPending))try{let e=await u.mutateAsync({name:f});r(``),e.inserted?Gt.success(`Channel ${e.row.name} created`):Gt.info(`Channel ${e.row.name} already exists`)}catch(e){Gt.error(`Failed to create channel`),console.error(e)}},m=async()=>{if(!(!a||d.isPending))try{let e=await d.mutateAsync({id:a.id});e.deleted?Gt.success(`Channel ${a.name} deleted`):e.reason===`not_empty`?Gt.error(`Channel ${a.name} is still in use and cannot be deleted`):Gt.error(`Channel ${a.name} no longer exists`),o(null)}catch(e){Gt.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Nt,{open:e,onOpenChange:t,children:(0,Z.jsxs)(kt,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(Tt,{children:[(0,Z.jsxs)(At,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(_n,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(jt,{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:p,children:(0,Z.jsx)(Ye,{className:`gap-2`,children:(0,Z.jsxs)(et,{orientation:`horizontal`,children:[(0,Z.jsx)(Ue,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(T,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:u.isPending}),(0,Z.jsxs)(i,{type:`submit`,disabled:!f||u.isPending,children:[u.isPending?(0,Z.jsx)(Ot,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(Et,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,Z.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,Z.jsx)(Ot,{className:`mr-2 size-3.5 animate-spin`}),`Loading channels`]}):c.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:c.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:d.isPending,onClick:()=>o(e),className:`text-muted-foreground hover:text-destructive`,children:(0,Z.jsx)(Ut,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(H,{open:a!==null,onOpenChange:e=>{!e&&!d.isPending&&o(null)},children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(V,{children:[(0,Z.jsxs)(z,{children:[`Delete `,s?.name,`?`]}),(0,Z.jsx)(L,{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)(B,{children:[(0,Z.jsx)(Ce,{disabled:d.isPending,children:`Cancel`}),(0,Z.jsx)(Se,{variant:`destructive`,disabled:d.isPending,onClick:e=>{e.preventDefault(),m()},children:d.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var Mn=`[a-zA-Z0-9-]`,Nn=String.raw`0|[1-9]\d*`,Pn=String.raw`\d+`,Fn=String.raw`\d*[a-zA-Z-]${Mn}*`,In=String.raw`(${Nn})\.(${Nn})\.(${Nn})`,Ln=String.raw`(${Pn})\.(${Pn})\.(${Pn})`,Rn=`(?:${Fn}|${Nn})`,zn=`(?:${Fn}|${Pn})`,Bn=String.raw`(?:-(${Rn}(?:\.${Rn})*))`,Vn=String.raw`(?:-?(${zn}(?:\.${zn})*))`,Hn=`${Mn}+`,Un=String.raw`(?:\+(${Hn}(?:\.${Hn})*))`,Wn=`v?${In}${Bn}?${Un}?`,Gn=String.raw`[v=\s]*${Ln}${Vn}?${Un}?`,Kn=`((?:<|>)?=?)`,qn=String.raw`${Nn}|x|X|\*`,Jn=String.raw`${Pn}|x|X|\*`,Yn=String.raw`[v=\s]*(${qn})(?:\.(${qn})(?:\.(${qn})(?:${Bn})?${Un}?)?)?`,Xn=String.raw`[v=\s]*(${Jn})(?:\.(${Jn})(?:\.(${Jn})(?:${Vn})?${Un}?)?)?`,Zn=`(?:~>?)`,Qn=String.raw`(?:\^)`,$n=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${$n}(?:$|[^\d])`,String.raw`${$n}(?:${Bn})?(?:${Un})?(?:$|[^\d])`;function er(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[Mn,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(er(e),t)}var tr=Q(`^${Wn}$`),nr=Q(`^${Gn}$`),rr=/^\d+$/;function ir(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function ar(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?nr:tr);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(rr.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 or=Q(String.raw`^${Kn}\s*(${Wn})$|^$`),sr=Q(String.raw`^${Kn}\s*(${Gn})$|^$`);function cr(e){return e.version?`${e.operator}${ir(e.version)}`:``}function lr(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?sr:or);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?ar(r[2],t):null;return{operator:i,options:t,value:a?`${i}${ir(a)}`:``,version:a}}function ur(e){return e.sets.map(e=>e.map(cr).join(` `)).join(`||`)}var dr=new RegExp(Un,`g`),fr=Q(Un),pr=Q(String.raw`^\s*(${Yn})\s+-\s+(${Yn})\s*$`),mr=Q(String.raw`^\s*(${Xn})\s+-\s+(${Xn})\s*$`),hr=Q(String.raw`(\s*)${Kn}\s*(${Gn}|${Yn})`,`g`),gr=Q(String.raw`(\s*)${Zn}\s+`,`g`),_r=Q(String.raw`(\s*)${Qn}\s+`,`g`),vr=Q(`^${Zn}${Yn}$`),yr=Q(`^${Zn}${Xn}$`),br=Q(`^${Qn}${Yn}$`),xr=Q(`^${Qn}${Xn}$`),Sr=Q(String.raw`^${Kn}\s*${Yn}$`),Cr=Q(String.raw`^${Kn}\s*${Xn}$`),wr=Q(String.raw`(<|>)?=?\s*\*`),Tr=/^\s*>=\s*0\.0\.0\s*$/,Er=/^\s*>=\s*0\.0\.0-0\s*$/,Dr=Q(String.raw`^${Kn}\s*(${Gn})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Or(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function kr(e,t){let n=t.loose?yr:vr,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 Ar(e,t){return e.trim().split(/\s+/).map(e=>kr(e,t)).join(` `)}function jr(e,t){let n=t.loose?xr:br,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 Mr(e,t){return e.trim().split(/\s+/).map(e=>jr(e,t)).join(` `)}function Nr(e,t){let n=t.loose?Cr:Sr;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Or(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 Pr(e,t){return e.split(/\s+/).map(e=>Nr(e,t)).join(` `)}function Fr(e,t){let n=t.loose?mr:pr;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 Ir(e,t){return Pr(Ar(Mr(e.replace(fr,``),t),t),t).trim().replace(wr,``)}function Lr(e,t){let n=Fr(e.replace(dr,``),t).replace(hr,`$1$2$3`).replace(gr,`$1~`).replace(_r,`$1^`).split(` `).map(e=>Ir(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Er:Tr,``));t.loose&&(n=n.filter(e=>Dr.test(e)));let r=new Map;for(let e of n.map(e=>lr(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 Rr(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Lr(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 zr(e,t={}){try{return Rr(e,t)}catch{return null}}function Br(e,t={}){let n=zr(e,t);return n?ur(n)||`*`:null}var Vr=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$/,``)},Hr=(e,t)=>{if(!e?.trim())return null;let n=Vr(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 Ur({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 Wr({bundle:e,release:t}){let{data:n,isFetched:r}=we(),i=e?Jt(e):null,a=e?nn(e):null,o=e?.gitCommitHash&&r?Hr(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)(Xe,{children:[(0,Z.jsx)(nt,{className:`p-4 pb-3`,children:(0,Z.jsx)(it,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(Je,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(Ur,{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)(Ur,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(Ct,{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)(pn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(Ur,{label:`Manifest hash`,value:(0,Z.jsx)(Ct,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(Ur,{label:`Base hash`,value:(0,Z.jsx)(Ct,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(Ur,{label:`Patch hash`,value:(0,Z.jsx)(Ct,{maxLength:16,value:i})}):null]})})]}):null}var Gr=Array.from({length:tn},(e,t)=>t+1);function Kr({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=Qt(t),a=n??[],o=a.length>0,s=r>0&&r<1e3,c=r===tn,l=le(),u=c?Gr:s?Gr.filter(t=>qt(e,t)<r):[],d=(r/10).toFixed(1),f=c?tn:u.length,p=tn-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)(Xe,{children:(0,Z.jsxs)(nt,{className:`p-4`,children:[(0,Z.jsx)(qe,{children:`Selected cohorts`}),(0,Z.jsx)(it,{className:`font-mono text-2xl tabular-nums`,children:f})]})}),(0,Z.jsx)(Xe,{children:(0,Z.jsxs)(nt,{className:`p-4`,children:[(0,Z.jsx)(qe,{children:`Excluded cohorts`}),(0,Z.jsx)(it,{className:`font-mono text-2xl tabular-nums`,children:p})]})})]}),o?(0,Z.jsxs)(Xe,{children:[(0,Z.jsxs)(nt,{className:`p-4 pb-3`,children:[(0,Z.jsx)(it,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(qe,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(Je,{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)(Xe,{children:[(0,Z.jsx)(nt,{className:`p-4 pb-3`,children:(0,Z.jsx)(it,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(Je,{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)(Nt,{children:[(0,Z.jsxs)(Mt,{render:(0,Z.jsx)(i,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(wt,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(kt,{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)(Tt,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(At,{children:`Rolled out cohorts`}),(0,Z.jsxs)(jt,{children:[d,`% includes `,f,` of`,` `,tn,` 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)(Dt,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Tt,{children:[(0,Z.jsx)(At,{children:`Rolled out cohorts`}),(0,Z.jsxs)(jt,{children:[d,`% includes `,f,` of`,` `,tn,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),m,(0,Z.jsx)(Dt,{showCloseButton:!0})]})})]})}function qr(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Jr(e,t){return e-t}function Yr(e,t,n){let r=e.slice();return r[t]=n,r.sort(Jr)}function Xr(e,t,n,r,i,a){let o=e;return o=q(o,n,r),i&&(o=Yr(a,t,q(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function Zr(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 Qr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...lt},$r=X.createContext(void 0);function ei(){let e=X.useContext($r);if(e===void 0)throw Error(l(62));return e}function ti(e){return`key`in e?k:ne}function ni(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?qr(e,t):!1}var ri=X.forwardRef(function(e,t){let{"aria-labelledby":r,className:i,defaultValue:o,disabled:s=!1,id:c,format:l,largeStep:u=10,locale:d,render:f,max:p=100,min:m=0,minStepsBetweenValues:h=0,form:g,name:_,onValueChange:v,onValueCommitted:y,orientation:b=`horizontal`,step:x=1,thumbCollisionBehavior:w=`push`,thumbAlignment:T=`center`,value:te,style:ne,...D}=e,re=j(c),ae=mt(re),oe=E(v),se=E(y),{clearErrors:ce}=gt(),{state:le,disabled:O,name:k,setTouched:ue,setDirty:de,validityData:fe,shouldValidateOnChange:me,validation:A}=ot(),{labelId:he}=ct(),[ge,_e]=X.useState(),N=r??ht(he,ge),P=O||s,F=k??_,[I,be]=ye({controlled:te,default:o??m,name:`Slider`}),L=X.useRef(null),R=X.useRef(null),z=X.useRef([]),Se=X.useRef(null),B=X.useRef(null),Ce=X.useRef(-1),V=X.useRef(null),H=X.useRef(null),we=X.useRef(`none`),Te=pe(l),[U,Ee]=X.useState(-1),[De,Oe]=X.useState(-1),[ke,Ae]=X.useState(!1),[je,Me]=X.useState(()=>new Map),[Ne,Pe]=X.useState([void 0,void 0]),Fe=E(e=>{Ee(e),e!==-1&&Oe(e)});st(R,re,I),M(I,()=>{ce(F),me()?A.commit(I):A.commit(I,!0);let e=fe.initialValue,t;t=Array.isArray(I)&&Array.isArray(e)?!qr(I,e):I!==e,de(t)});let Ie=E(e=>{e&&(R.current=e)}),Le=Array.isArray(I),Re=X.useMemo(()=>Le?I.slice().sort(Jr):[q(I,m,p)],[p,m,Le,I]),W=E((e,t)=>{if(Number.isNaN(e)||ni(e,I))return;let n=t??ee(`none`,void 0,void 0,{activeThumbIndex:-1});we.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:F}}),n.event=i,H.current=e,oe(e,n),!n.isCanceled&&be(e)}),ze=E((e,t,n)=>{let r=Xr(e,t,m,p,Le,Re);if(Zr(r,x,h)){let e=ti(n);W(r,ee(e,n.nativeEvent,void 0,{activeThumbIndex:t})),ue(!0),se(H.current??r,C(e,n.nativeEvent))}});S(()=>{let e=ve(a(L.current));P&&ie(L.current,e)&&e.blur()},[P]),P&&U!==-1&&Fe(-1);let G=X.useMemo(()=>({...le,activeThumbIndex:U,disabled:P,dragging:ke,orientation:b,max:p,min:m,minStepsBetweenValues:h,step:x,values:Re}),[le,U,P,ke,p,m,h,b,x,Re]),Be=X.useMemo(()=>({active:U,controlRef:R,disabled:P,dragging:ke,validation:A,formatOptionsRef:Te,handleInputChange:ze,indicatorPosition:Ne,inset:T!==`center`,labelId:N,rootLabelId:ae,largeStep:u,lastUsedThumbIndex:De,lastChangedValueRef:H,lastChangeReasonRef:we,form:g,locale:d,max:p,min:m,minStepsBetweenValues:h,name:F,onValueCommitted:se,orientation:b,pressedInputRef:Se,pressedThumbCenterOffsetRef:B,pressedThumbIndexRef:Ce,pressedValuesRef:V,registerFieldControlRef:Ie,renderBeforeHydration:T===`edge`,setActive:Fe,setDragging:Ae,setIndicatorPosition:Pe,setLabelId:_e,setValue:W,state:G,step:x,thumbCollisionBehavior:w,thumbMap:je,thumbRefs:z,values:Re}),[U,R,N,ae,P,ke,A,Te,ze,Ne,u,De,H,we,g,d,p,m,h,F,se,b,Se,B,Ce,V,Ie,Fe,Ae,Pe,_e,W,G,x,w,T,je,z,Re]),Ve=n(`div`,e,{state:G,ref:[t,L],props:[{"aria-labelledby":N,id:re,role:`group`},A.getValidationProps,D],stateAttributesMapping:Qr});return(0,Z.jsx)($r.Provider,{value:Be,children:(0,Z.jsx)(xe,{elementsRef:z,onMapChange:Me,children:Ve})})});function ii(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function ai(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 oi(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(ai(t),ai(n))))}function si({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]=q(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]=q(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]=q(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function ci({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=q(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=si({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=q(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:si({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=q(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 li=2;function ui(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 di(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 fi=X.forwardRef(function(e,r){let{render:i,className:o,style:s,...c}=e,{disabled:l,dragging:f,inset:p,lastChangedValueRef:m,lastChangeReasonRef:h,max:g,min:_,minStepsBetweenValues:v,onValueCommitted:y,orientation:b,pressedInputRef:x,pressedThumbCenterOffsetRef:S,pressedThumbIndexRef:w,pressedValuesRef:T,registerFieldControlRef:te,renderBeforeHydration:ne,setActive:D,setDragging:re,setValue:ae,state:se,step:ce,thumbCollisionBehavior:le,thumbRefs:O,values:k}=ei(),fe=ue(),me=k.length>1,A=b===`vertical`,j=X.useRef(null),ge=X.useRef(null),_e=E(e=>{e&&ge.current==null&&(ge.current=t(e).getComputedStyle(e))}),M=X.useRef(null),P=X.useRef(0),F=X.useRef(0),ye=pe(k);function I(e){w.current!==e&&(w.current=e);let t=O.current[e];if(!t){S.current=null,x.current=null;return}x.current=t.querySelector(`input[type="range"]`)}function be(e){let t=j.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=ui(ge.current,A),c=F.current,l=(A?r:n)-s.start-s.end-c*2,u=S.current??0,d=e.x-u,f=e.y-u,p=q(((A?i-f-s.end:(fe===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(g-_)*p+_;if(m=oi(m,ce,_),m=q(m,_,g),!me)return{value:m,thumbIndex:0,didSwap:!1};let h=w.current;if(h<0)return null;let y=ci({behavior:le,values:k,currentValues:ye.current??k,initialValues:T.current,pressedIndex:h,nextValue:m,min:_,max:g,step:ce,minStepsBetweenValues:v});return le===`swap`&&y.didSwap?I(y.thumbIndex):w.current=y.thumbIndex,y}function xe(e){T.current=me?k.slice():null,ye.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=A?`y`:`x`,r;n=-1;for(let i=0;i<O.current.length;i+=1){let a=O.current[i];if(oe(a)){let o=ii(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&I(n),p){let e=O.current[n];oe(e)&&(F.current=e.getBoundingClientRect()[A?`height`:`width`]/2)}}function L(e){let t=O.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let R=E(e=>{let t=di(e,M);if(t==null)return;if(P.current+=1,e.type===`pointermove`&&e.buttons===0){z(e);return}let n=be(t);n!=null&&Zr(n.value,ce,v)&&(!f&&P.current>li&&re(!0),ae(n.value,ee(he,e,void 0,{activeThumbIndex:n.thumbIndex})),ye.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&L(n.thumbIndex))});function z(e){D(-1),re(!1),x.current=null,S.current=null;let t=di(e,M),n=t==null?null:be(t);if(n!=null){let t=h.current;y(m.current??n.value,C(t,e))}`pointerType`in e&&j.current?.hasPointerCapture(e.pointerId)&&j.current?.releasePointerCapture(e.pointerId),w.current=-1,M.current=null,T.current=null,B()}let Se=E(e=>{if(l)return;let t=e.changedTouches[0];t!=null&&(M.current=t.identifier);let n=di(e,M);if(n!=null){xe(n);let t=be(n);if(t==null)return;L(t.thumbIndex),ae(t.value,ee(de,e,void 0,{activeThumbIndex:t.thumbIndex})),ye.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&L(t.thumbIndex)}P.current=0;let r=a(j.current);r.addEventListener(`touchmove`,R,{passive:!0}),r.addEventListener(`touchend`,z,{passive:!0})}),B=E(()=>{let e=a(j.current);e.removeEventListener(`pointermove`,R),e.removeEventListener(`pointerup`,z),e.removeEventListener(`touchmove`,R),e.removeEventListener(`touchend`,z),T.current=null}),Ce=d();return X.useEffect(()=>{let e=j.current;if(!e)return()=>B();let t=u(e,`touchstart`,Se,{passive:!0});return()=>{t(),Ce.cancel(),B()}},[B,Se,j,Ce]),X.useEffect(()=>{l&&B()},[l,B]),n(`div`,e,{state:se,ref:[r,te,j,_e],props:[{"data-base-ui-slider-control":ne?``:void 0,onPointerDown(e){let t=j.current,n=N(e.nativeEvent);if(!t||l||e.defaultPrevented||!oe(n)||e.button!==0)return;let r=di(e,M);if(r!=null){xe(r);let n=be(r);if(n==null)return;ie(O.current[n.thumbIndex],ve(a(t)))?e.preventDefault():Ce.request(()=>{L(n.thumbIndex)}),re(!0),S.current??(ae(n.value,ee(de,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),ye.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&L(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),P.current=0;let i=a(j.current);i.addEventListener(`pointermove`,R,{passive:!0}),i.addEventListener(`pointerup`,z,{once:!0})}},c],stateAttributesMapping:Qr})}),pi=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{state:s}=ei();return n(`div`,e,{state:s,ref:t,props:[{style:{position:`relative`}},o],stateAttributesMapping:Qr})}),mi=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}({}),hi=new Set([...f,_,o]);function gi(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${ln(e[t],r,n)} start range`:`${ln(e[t],r,n)} end range`:n?ln(e[t],r,n):void 0}function _i(e,t,n,r,i){let a=n===1?e+t:e-t;return q(Number(a.toFixed(Math.max(ai(e),ai(t),ai(r)))),r,i)}var vi=X.forwardRef(function(e,i){let{render:a,children:c,className:l,"aria-describedby":u,"aria-label":d,"aria-labelledby":p,disabled:v=!1,getAriaLabel:y,getAriaValueText:C,id:ee,index:T,inputRef:te,onBlur:ne,onFocus:D,onKeyDown:re,tabIndex:ie,style:ae,...oe}=e,{nonce:se}=dt(),ce=j(ee),{active:le,lastUsedThumbIndex:O,controlRef:k,disabled:de,validation:fe,formatOptionsRef:pe,handleInputChange:me,inset:A,labelId:he,largeStep:ge,locale:M,max:N,min:P,minStepsBetweenValues:ve,form:F,name:ye,orientation:be,pressedInputRef:xe,pressedThumbCenterOffsetRef:L,pressedThumbIndexRef:R,renderBeforeHydration:z,setActive:Se,setIndicatorPosition:B,state:Ce,step:V,values:H}=ei(),we=ue(),Te=v||de,U=H.length>1,Ee=be===`vertical`,De=we===`rtl`,{setTouched:Oe,setFocused:ke,validationMode:Ae}=ot(),je=X.useRef(null),Me=X.useRef(null),Ne=X.useRef(!1),Pe=j(),Fe=ft(),Ie=U?Pe:Fe,{ref:Le,index:Re}=I({metadata:X.useMemo(()=>({inputId:Ie}),[Ie])}),W=U?T??Re:0,ze=W===H.length-1,G=H[W],Be=un(G,P,N),[Ve,He]=X.useState(),Ue=Cn(),We=O>=0&&O<H.length?O:-1,Ge=E(()=>{let e=k.current,t=je.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Ee?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Be/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;He(s),W===0?B(e=>[s,e[1]]):ze&&B(e=>[e[0],s])});S(()=>{A&&queueMicrotask(Ge)},[Ge,A]),S(()=>{A&&Ge()},[Ge,A,Be]),S(()=>{if(!A)return;let e=k.current,n=je.current;if(!e||!n)return;let r=t(e).ResizeObserver;if(typeof r!=`function`)return;let i=new r(Ge);return i.observe(e),i.observe(n),()=>{i.disconnect()}},[k,Ge,A]);let Ke=Ee?`bottom`:`insetInlineStart`,qe=Ee?`left`:`top`,Je;U?le===W?Je=2:We===W&&(Je=1):le===W&&(Je=1);let Ye;Ye=A?{"--position":`${Ve??0}%`,visibility:z&&Ue||Ve===void 0?`hidden`:void 0,position:`absolute`,[Ke]:`var(--position)`,[qe]:`50%`,translate:`${(Ee||!De?-1:1)*50}% ${(Ee?1:-1)*50}%`,zIndex:Je}:Number.isFinite(Be)?{position:`absolute`,[Ke]:`${Be}%`,[qe]:`50%`,translate:`${(Ee||!De?-1:1)*50}% ${(Ee?1:-1)*50}%`,zIndex:Je}:b;let K;be===`vertical`&&(K=De?`vertical-rl`:`vertical-lr`);let Xe=typeof y==`function`?y(W):d,Ze=w({"aria-label":Xe,"aria-labelledby":p??(Xe==null?he:void 0),"aria-describedby":u,"aria-orientation":be,"aria-valuenow":G,"aria-valuetext":typeof C==`function`?C(ln(G,M,pe.current??void 0),G,W):gi(H,W,pe.current??void 0,M),disabled:Te,form:F,id:Ie,max:N,min:P,name:ye,onChange(e){me(e.currentTarget.valueAsNumber,W,e)},onFocus(e){let t=Ne.current;Ne.current=!1,Se(W),ke(!0),t&&e.stopPropagation()},onBlur(e){if(Ne.current){e.stopPropagation();return}je.current&&(Se(-1),Oe(!0),ke(!1),Ae===`onBlur`&&fe.commit(Xr(G,W,P,N,U,H)))},onKeyDown(e){if(!hi.has(e.key))return;f.has(e.key)&&e.stopPropagation();let t=null,n=oi(G,V,P);switch(e.key){case s:t=_i(n,e.shiftKey?ge:V,1,P,N);break;case r:t=_i(n,e.shiftKey?ge:V,De?-1:1,P,N);break;case m:t=_i(n,e.shiftKey?ge:V,-1,P,N);break;case h:t=_i(n,e.shiftKey?ge:V,De?1:-1,P,N);break;case _:t=_i(n,ge,1,P,N);break;case o:t=_i(n,ge,-1,P,N);break;case`End`:t=N,U&&(t=Number.isFinite(H[W+1])?H[W+1]-V*ve:N);break;case g:t=P,U&&(t=Number.isFinite(H[W-1])?H[W-1]+V*ve:P);break;default:break}if(t!==null){let n=e.currentTarget;_e(n)||(Ne.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),me(t,W,e),e.preventDefault()}},step:V,style:{...b,width:`100%`,height:`100%`,writingMode:K},tabIndex:ie??void 0,type:`range`,value:G??``},fe.getInputValidationProps),Qe=x(Me,fe.inputRef,te);return n(`div`,e,{state:Ce,ref:[i,Le,je],props:[{[mi.index]:W,children:(0,Z.jsxs)(X.Fragment,{children:[c,(0,Z.jsx)(`input`,{ref:Qe,...Ze,suppressHydrationWarning:!0}),A&&Ue&&z&&ze&&(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:ne,onFocus:D,onPointerDown(e){if(R.current=W,je.current!=null){let t=be===`horizontal`?`x`:`y`,n=ii(je.current);L.current=(be===`horizontal`?e.clientX:e.clientY)-n[t]}Me.current!=null&&xe.current!==Me.current&&(xe.current=Me.current)},style:Ye,suppressHydrationWarning:z||void 0},oe],stateAttributesMapping:Qr})});function yi(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 bi(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 xi=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}=ei(),h=Cn(),g=d===`vertical`,_=m.length>1,v=c?yi(g,_,s[0],s[1],f,h):bi(g,_,un(m[0],u,l),un(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:Qr})});function Si({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)(ri,{className:p(`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)(fi,{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)(pi,{"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)(xi,{"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)(vi,{"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 Ci=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],wi=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]}),Ti=(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}),Ei=e=>(e/10).toFixed(1),Di=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},Oi=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function ki({value:e,onChange:t}){let[n,r]=(0,X.useState)(Ei(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(Ei(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Si,{"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)(zt,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(Ft,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=Oi(n)??e;a(!1),r(Ei(i)),t(i)},onChange:e=>{let n=Di(e.target.value);r(n);let i=Oi(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(It,{align:`inline-end`,children:(0,Z.jsx)(Pt,{children:`%`})})]})]})}function Ai({channels:t,onOpenChange:n,onShowScope:r,open:a,releaseId:o}){let s=Ee(o),c=s.data,l=Pe(c?.bundle_id??``),u=l.data,d=u?Zt(u):null,f=U(c?.scope_key??``),p=Ae(),m=ke(),h=Te(),g=Le(),[_,v]=(0,X.useState)(null),[y,b]=(0,X.useState)(``),[x,S]=(0,X.useState)(``),[C,w]=(0,X.useState)(!1),[ee,E]=(0,X.useState)(!1),[ne,D]=(0,X.useState)(!1),[ie,ae]=(0,X.useState)(``),[oe,le]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{v(c?wi(c):null),S(``)},[c]);let k=c?wi(c):null,ue=_!==null&&k!==null&&JSON.stringify(_)!==JSON.stringify(k),de=m.isPending||p.isPending||h.isPending||g.isPending,fe=()=>{if(!de){if(ue){w(!0);return}n(!1)}},pe=()=>{if(!_)return;let e=en(y);if(!Yt(e)){S($t);return}v({..._,targetCohorts:Array.from(new Set([..._.targetCohorts,e]))}),b(``),S(``)},me=async()=>{if(!c||!_)return;let e=_.targetCohorts.map(en);if(e.some(e=>!Yt(e))){S($t);return}if(c.strategy===`APP_VERSION`&&!Br(_.targetAppVersion.trim())){S(`Enter a valid target app version range.`);return}let t={expectedRevision:c.revision,patch:Ti(c,{..._,targetCohorts:e}),releaseId:c.id};S(``);try{await m.mutateAsync(t),await p.mutateAsync(t),Gt.success(`Bundle settings saved`),n(!1)}catch(e){S(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},A=t.find(e=>e.id===c?.channel_id)?.name??c?.channel_id,he=t.filter(e=>e.id!==c?.channel_id),j=he.map(e=>({label:e.name,value:e.name})),_e=ie.trim(),M=oe===`copy`,N=_?Br(_.targetAppVersion.trim()):null,ve=()=>{ae(``),le(`move`)},F=e=>{!e&&g.isPending||(D(e),e||ve())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ce,{onOpenChange:e=>e?void 0:fe(),open:a,children:(0,Z.jsxs)(te,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(P,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(re,{children:`Bundle Detail`}),(0,Z.jsx)(ge,{className:`sr-only`,children:`Edit bundle delivery settings.`}),c?(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)(ut,{className:`size-4`,platform:c.platform}),(0,Z.jsx)(`span`,{className:`font-medium`,children:c.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)(cn,{bundleId:c.id,fullOnMobile:!0,maxLength:18}),c.bundle_id?null:(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:`Built-in bundle`})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Channel`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,translate:`no`,children:A})]}),(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:c.platform===`ios`?`iOS`:`Android`})]})]}):(0,Z.jsx)(e,{className:`h-12 w-full`})]}),(0,Z.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[s.isError?(0,Z.jsxs)(tt,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(We,{}),(0,Z.jsx)(Qe,{children:`Bundle details could not be loaded`}),(0,Z.jsx)(Ke,{children:s.error.message})]}):null,c&&_?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[A?(0,Z.jsx)(Re,{release:{platform:c.platform,channel:A,releaseId:c.id,builtIn:!c.bundle_id}}):null,(0,Z.jsxs)(`section`,{"aria-labelledby":`delivery-settings-heading`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,id:`delivery-settings-heading`,children:`Delivery settings`}),(0,Z.jsxs)(Ye,{className:`gap-6`,children:[(0,Z.jsxs)(et,{children:[(0,Z.jsx)(Ue,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(Lt,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>v({..._,message:e.target.value}),rows:3,value:_.message})]}),c.strategy===`APP_VERSION`?(0,Z.jsxs)(et,{children:[(0,Z.jsx)(Ue,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(T,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>v({..._,targetAppVersion:e.target.value}),value:_.targetAppVersion}),N?(0,Z.jsx)(Ze,{children:N}):null]}):null,(0,Z.jsx)(et,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(Ue,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(Xt,{label:`About Enabled`,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.jsx)(Wt,{"aria-label":`Enabled`,checked:_.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>v({..._,enabled:e})})]})}),(0,Z.jsx)(et,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(Ue,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(Xt,{label:`About Force update`,children:`Devices apply this bundle right away, and so do devices that skip it to update straight to a newer bundle.`})]}),(0,Z.jsx)(Wt,{"aria-label":`Force update`,checked:_.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>v({..._,shouldForceUpdate:e})})]})}),(0,Z.jsxs)(et,{children:[(0,Z.jsx)(Ue,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(ki,{onChange:e=>v({..._,rolloutCohortCount:e}),value:_.rolloutCohortCount})]}),(0,Z.jsxs)(et,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(Ue,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Z.jsx)(Kr,{releaseId:c.id,rolloutCohortCount:_.rolloutCohortCount,targetCohorts:_.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(T,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>b(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),pe())},placeholder:`e.g. qa-team…`,value:y}),(0,Z.jsx)(i,{"aria-label":`Add cohort`,disabled:!y.trim(),onClick:pe,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(Et,{})})]}),_.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:_.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:()=>v({..._,targetCohorts:_.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Z.jsx)(O,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Ze,{children:`Public names—no IDs or secrets.`})]})]}),x?(0,Z.jsx)($e,{children:x}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:!ue||de,onClick:me,size:`lg`,children:m.isPending||p.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(se,{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:!c.bundle_id||de,onClick:()=>D(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),c.bundle_id?(0,Z.jsxs)(i,{className:`w-full`,disabled:de,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(c.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),Gt.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(St,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:c.enabled||de,onClick:()=>E(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),c.bundle_id&&l.isPending?(0,Z.jsx)(e,{className:`h-40 w-full`}):null,c.bundle_id&&l.isError?(0,Z.jsxs)(tt,{variant:`destructive`,children:[(0,Z.jsx)(We,{}),(0,Z.jsx)(Qe,{children:`Build details are unavailable`}),(0,Z.jsx)(Ke,{children:`Delivery settings are unaffected.`})]}):null,!c.bundle_id||!l.isPending?(0,Z.jsx)(Wr,{bundle:u,release:c}):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:c.bundle_id??`Built-in bundle`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Revision`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:c.revision})]}),d?(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:d})]}):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:f.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:f.data?`${f.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:c.scope_key}),r?(0,Z.jsx)(i,{className:`mt-1 h-auto px-0 text-xs`,onClick:()=>r(c.scope_key),size:`sm`,variant:`link`,children:`Show bundles for this target`}):null]})]}),f.isError?(0,Z.jsx)(`p`,{className:`mt-3 text-destructive`,children:`Diagnostics are unavailable. Bundle settings are unaffected.`}):null]})]}):null]})]})}),(0,Z.jsx)(H,{onOpenChange:w,open:C,children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(V,{children:[(0,Z.jsx)(z,{children:`Discard unsaved changes?`}),(0,Z.jsx)(L,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(Ce,{children:`Keep editing`}),(0,Z.jsx)(Se,{onClick:()=>{w(!1),n(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(H,{onOpenChange:E,open:ee,children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(V,{children:[(0,Z.jsxs)(z,{children:[`Remove this Bundle from `,A??`the channel`,`?`]}),(0,Z.jsx)(L,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(Ce,{children:`Cancel`}),(0,Z.jsx)(Se,{onClick:async()=>{if(c)try{await h.mutateAsync({expectedRevision:c.revision,releaseId:c.id}),Gt.success(`Bundle removed from ${A??`the channel`}`),E(!1),n(!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)(Nt,{onOpenChange:F,open:ne,children:(0,Z.jsxs)(kt,{showCloseButton:!g.isPending,children:[(0,Z.jsxs)(Tt,{children:[(0,Z.jsx)(At,{children:`Promote to Channel`}),(0,Z.jsx)(jt,{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)(Ge,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(xt,{disabled:g.isPending,items:Ci,onValueChange:e=>le(e),value:oe,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(yt,{placeholder:`Select an action`})}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(_t,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(_t,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:M?`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)(Ge,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(xt,{disabled:g.isPending,items:j,onValueChange:e=>ae(e??``),value:ie||null,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(yt,{placeholder:`Select a channel`})}),(0,Z.jsx)(vt,{className:`max-h-64`,children:(0,Z.jsx)(bt,{children:he.map(e=>(0,Z.jsx)(_t,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(Dt,{children:[(0,Z.jsx)(i,{disabled:g.isPending,onClick:()=>F(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(i,{disabled:!_e||g.isPending,onClick:async()=>{if(c)try{await g.mutateAsync({action:oe,expectedRevision:c.revision,releaseId:c.id,targetChannel:_e}),F(!1),Gt.success(M?`Bundle copied to ${_e}`:`Bundle moved to ${_e}`)}catch(e){Gt.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:g.isPending?M?`Copying…`:`Moving…`:M?`Copy`:`Move`})]})]})})]})}function ji({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)(rt,{className:`size-3`}):(0,Z.jsx)(fn,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}function Mi({percentage:e,className:t}){let n=e<100,r=e.toFixed(1);return(0,Z.jsxs)(K,{className:p(`gap-1`,t),variant:n?`secondary`:`default`,children:[n?(0,Z.jsx)(We,{className:`h-3 w-3`}):null,r,`%`]})}var Ni=20,Pi=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],Fi=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}],Ii=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),Li=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`}),Ri=e=>t=>{t.target instanceof Element&&t.target.closest(`button, a, input, select, textarea`)||e()};function zi({channels:e,onChange:t,onClear:n,onManageChannels:r,search:a}){let o=G(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)(hn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsxs)(xt,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:a.channelId??`all`,children:[(0,Z.jsx)(pt,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(yt,{})}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(_t,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(_t,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(xt,{disabled:!s,items:Pi,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:a.platform??`ios`,children:[(0,Z.jsx)(pt,{"aria-label":`Platform`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,title:s?void 0:`Choose a channel first`,children:(0,Z.jsx)(yt,{})}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(_t,{value:`ios`,children:`iOS`}),(0,Z.jsx)(_t,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(xt,{disabled:!s&&a.scopeKey===void 0,items:Fi,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)(pt,{"aria-label":`Status`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(yt,{})}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(_t,{value:`all`,children:`Any Status`}),(0,Z.jsx)(_t,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(_t,{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)(vn,{})}),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)(O,{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)(O,{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)(O,{"data-icon":`inline-start`}),`Clear`]}):null]})}function Bi({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)(be,{}):(0,Z.jsx)(at,{})}):(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)(cn,{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)(Rt,{className:`size-3.5`}),` Built-in bundle`]})]}),a?(0,Z.jsx)(K,{className:`shrink-0 font-normal`,variant:`secondary`,children:a}):null,r.currentlyUnreachable?(0,Z.jsxs)(`span`,{"aria-label":`Unreachable: no device gets this bundle with the current delivery settings.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No device gets this bundle with the current delivery settings.`,children:[(0,Z.jsx)(fn,{className:`size-3.5`}),`Unreachable`]}):null]})}function Vi({onDetailClick:t,panelId:n,release:r}){let i=r.bundle_id??``,a=Pe(i),o=je(i);return a.isError||o.isError?(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Patch lineage could not be loaded.`}):a.isPending?(0,Z.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:n,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):a.data?(0,Z.jsx)(An,{bundle:a.data,bundles:o.data??[],loading:o.isPending,onDetailClick:t,panelId:n}):(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Bundle details are unavailable.`})}function Hi(){let t=He.useSearch(),n=He.useNavigate(),r=le(),[a,o]=(0,X.useState)(!1),[s,l]=(0,X.useState)(),u=Ne({afterReleaseId:t.afterReleaseId,beforeReleaseId:t.beforeReleaseId,filter:Be(t),limit:Ni}),d=Oe().data??[],f=u.data?.data??[],m=Ie(Array.from(new Set(f.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},h=u.data?.next,g=u.data?.previous,_=f.flatMap(e=>{let t=d.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t,builtIn:!e.bundle_id}]:[]}),v=Ve(),y=10+v.length,b=new Map(d.map(e=>[e.id,e.name]));(0,X.useEffect)(()=>{s&&!f.some(e=>e.id===s)&&l(void 0)},[s,f]);let x=(e,t=!0)=>void n({resetScroll:t,search:e,to:`/`}),S=e=>x(ze(t,e)),C=e=>{let n=f.find(t=>t.bundle_id===e.id);if(l(void 0),n){x({...t,releaseId:n.id},!1);return}S({bundleId:e.id})},w=t.afterReleaseId!==void 0||t.beforeReleaseId!==void 0,ee=g?{...t,afterReleaseId:g,beforeReleaseId:void 0,releaseId:void 0}:null,T=h?{...t,afterReleaseId:void 0,beforeReleaseId:h,releaseId:void 0}:null,E={...t,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0};return(0,Z.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,Z.jsx)(zi,{channels:d,onChange:S,onClear:()=>x({}),onManageChannels:()=>o(!0),search:t}),(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:[u.isError?(0,Z.jsxs)(tt,{variant:`destructive`,children:[(0,Z.jsx)(We,{}),(0,Z.jsx)(Qe,{children:`Bundles could not be loaded`}),(0,Z.jsx)(Ke,{children:u.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:r?(0,Z.jsx)(`div`,{className:`h-full overflow-y-auto`,children:u.isPending?(0,Z.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:Array.from({length:5},(t,n)=>(0,Z.jsx)(e,{className:`h-44 w-full`},n))}):f.length?f.map(e=>{let n=b.get(e.channel_id)??e.channel_id,r=e.bundle_id?m[e.bundle_id]:0,i=s===e.id,a=`bundle-lineage-panel-${e.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(`article`,{"aria-label":`Bundle ${e.id}`,className:p(`flex cursor-pointer touch-manipulation flex-col gap-4 border-b p-4 transition-[background-color,filter] last:border-b-0 hover:bg-muted/10 active:bg-muted/20 motion-reduce:transition-none data-[state=selected]:bg-muted/15`,e.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,i&&`border-b-0 bg-primary/5`),"data-state":t.releaseId===e.id?`selected`:void 0,onClick:Ri(()=>x({...t,releaseId:e.id},!1)),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(Bi,{expanded:i,onOpen:()=>x({...t,releaseId:e.id},!1),onToggleExpand:()=>l(i?void 0:e.id),release:e}),(0,Z.jsx)(Tn,{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)(ut,{className:`size-4`,platform:e.platform}),e.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:Ii.format(e.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)(Mi,{percentage:e.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`}`:`—`})]}),v.map(({Cell:t,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)(t,{releaseId:e.id,releases:_})})]},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)(ji,{release:e}),e.should_force_update?(0,Z.jsx)(K,{variant:`secondary`,children:`Force update`}):null]}),(0,Z.jsxs)(`div`,{className:`col-span-2 grid grid-cols-1 gap-2 rounded-md border bg-background/80 p-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Target`}),(0,Z.jsx)(`dd`,{className:`min-w-0 truncate text-right font-mono`,children:e.target_app_version??e.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:e.message||`—`})]})]})]})]}),i&&e.bundle_id?(0,Z.jsx)(Vi,{onDetailClick:C,panelId:a,release:e}):null]},e.id)}):(0,Z.jsx)(`p`,{className:`p-8 text-center text-sm text-muted-foreground`,children:w?`No more bundles on this side.`:G(t)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,Z.jsxs)(sn,{className:`min-w-max`,children:[(0,Z.jsx)(rn,{className:`bg-muted/40`,children:(0,Z.jsxs)(on,{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`}),v.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)(an,{children:[u.isPending?Array.from({length:7},(t,n)=>(0,Z.jsx)(on,{children:(0,Z.jsx)(Y,{colSpan:y,children:(0,Z.jsx)(e,{className:`h-8 w-full`})})},n)):f.map(e=>{let n=s===e.id,r=`bundle-lineage-panel-${e.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(on,{"aria-label":`Open bundle ${e.id}`,className:p(`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`,e.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,n&&`bg-primary/5`),"data-state":t.releaseId===e.id?`selected`:void 0,onClick:Ri(()=>x({...t,releaseId:e.id},!1)),onKeyDown:n=>{n.target!==n.currentTarget||n.key!==`Enter`&&n.key!==` `||(n.preventDefault(),x({...t,releaseId:e.id},!1))},tabIndex:0,children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(Bi,{expanded:n,onOpen:()=>x({...t,releaseId:e.id},!1),onToggleExpand:()=>l(n?void 0:e.id),release:e})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Tn,{channel:b.get(e.channel_id)??e.channel_id})}),(0,Z.jsx)(Y,{className:`whitespace-nowrap`,children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(ut,{className:`size-4`,platform:e.platform}),e.platform===`ios`?`iOS`:`Android`]})}),(0,Z.jsx)(Y,{children:e.bundle_id&&m[e.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):e.bundle_id&&m[e.bundle_id]>0?(0,Z.jsxs)(K,{variant:`secondary`,children:[m[e.bundle_id],` `,m[e.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:e.target_app_version?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(W,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`font-medium`,children:e.target_app_version})]}):e.fingerprint_hash?(0,Z.jsxs)(`span`,{className:`flex min-w-[160px] items-center gap-2`,children:[(0,Z.jsx)(mn,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(Ct,{maxLength:12,value:e.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)(En,{enabled:e.enabled}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.enabled?`Enabled`:`Disabled`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(En,{enabled:e.should_force_update,falseIcon:`minus`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.should_force_update?`Required`:`Optional`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Mi,{percentage:e.rollout_cohort_count/10})}),v.map(({Cell:t,feature:n})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(t,{releaseId:e.id,releases:_})},n)),(0,Z.jsx)(Y,{className:`text-sm text-muted-foreground`,title:e.message??void 0,children:e.message||`-`}),(0,Z.jsx)(Y,{className:`whitespace-nowrap text-xs text-muted-foreground`,title:Ii.format(e.created_at_ms),children:Li.format(e.created_at_ms)})]}),n&&e.bundle_id?(0,Z.jsx)(on,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:y,children:(0,Z.jsx)(Vi,{onDetailClick:C,panelId:r,release:e})})}):null]},e.id)}),!u.isPending&&f.length===0?(0,Z.jsx)(on,{children:(0,Z.jsx)(Y,{className:`h-40 text-center text-muted-foreground`,colSpan:y,children:w?`No more bundles on this side.`:G(t)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):null]})]})}),!u.isError&&!u.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:f.length}),` `,f.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)(F,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`ghost`}),search:E,to:`/`,children:`Newest`}):null,ee?(0,Z.jsxs)(F,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:ee,to:`/`,children:[(0,Z.jsx)(dn,{"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)(dn,{"data-icon":`inline-start`}),`Previous`]}),T?(0,Z.jsxs)(F,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:T,to:`/`,children:[`Next`,(0,Z.jsx)(at,{"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)(at,{"data-icon":`inline-end`})]})]})]}):null]}),(0,Z.jsx)(Ai,{channels:d,onOpenChange:e=>!e&&x({...t,releaseId:void 0},!1),onShowScope:e=>S({scopeKey:e}),open:!!t.releaseId,releaseId:t.releaseId??``}),(0,Z.jsx)(jn,{onOpenChange:o,open:a})]})}export{Hi as component};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-Bxu5_zNh.js","assets/sidebar-CQ6iq0qe.js","assets/useCompositeListItem-VmWjhZ9j.js","assets/console-features-api-BD7j--gS.js","assets/alert-dialog-BSs_5Od-.js","assets/select-BE-xONpm.js","assets/field-DNqNwq7i.js","assets/switch-DR0WP2g8.js","assets/valueToPercent-C-rPd_Or.js","assets/api-DSWk32Mz.js","assets/chevron-right-CBl7aqu_.js","assets/HashValueDisplay-DvXl147n.js","assets/dist-B7eA4Mtf.js","assets/list-BSpjGUS6.js","assets/dialog-YKZpU5St.js","assets/input-group-C9ZIjV0o.js","assets/insights-search-B-F2wop6.js","assets/insights-api-BsX1zQDf.js","assets/table-DW0243Jw.js"])))=>i.map(i=>d[i]);
2
- import{$ as e,In as t,Ln as n,Ur as r,Wr as i,ar as a,cr as o,et as s,nr as c,rr as l}from"./sidebar-CQ6iq0qe.js";import{a as u,i as d,l as f,o as p}from"./console-features-api-BD7j--gS.js";import{a as ee,c as m,s as h}from"./useCompositeListItem-VmWjhZ9j.js";import{_ as g,m as _,s as v,x as y}from"./insights-api-BsX1zQDf.js";import{_ as b,h as x,m as S,v as C,y as w}from"./field-DNqNwq7i.js";import{t as T}from"./key-round-CrqLmblG.js";import{s as te}from"./switch-DR0WP2g8.js";import{h as E,t as D}from"./insights-search-B-F2wop6.js";var O=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`}]]),k=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`}]]),A=r(),j={apiKeys:{navigation:{icon:(0,A.jsx)(T,{}),paths:[`/api-keys`],link:({onClick:e})=>(0,A.jsx)(f,{to:`/api-keys`,onClick:e})}}},M=l({method:`GET`}).middleware([c]).handler(i(`b4bf4c461903edcdc44eea52468c737b5b600a586f542138ff022dcbbe86c45c`));function N(e){let t=e.map(({releaseId:e,platform:t,channel:n})=>({releaseId:e,platform:t,channel:n})).sort((e,t)=>e.releaseId.localeCompare(t.releaseId));return o({queryKey:[`bundle-activity`,t],queryFn:()=>M({data:t}),enabled:t.length>0,staleTime:3e4})}var P=[{label:`Downloaded`,field:`downloads`,color:`text-primary/85`},{label:`Launched`,field:`launched`,color:`text-success/85`},{label:`Crashed`,field:`failedLaunches`,color:`text-warning/85`}],F=e=>{let t=e.launched+e.failedLaunches;return t===0?`—`:`${(e.failedLaunches/t*100).toFixed(2)}%`},I=e=>Math.max(0,e.downloads-e.launched-e.failedLaunches);function L(){return(0,A.jsx)(E,{label:`About release insight metrics`,children:`Downloaded: got this bundle. Launched: ran it. Crashed: crashed on it and rolled back. Once every installation restarts, Downloaded = Launched + Crashed.`})}function R({report:t,loading:r=!1,input:i,variant:a=`inline`}){if(!t)return r?(0,A.jsx)(e,{"aria-label":`Loading release insights`,className:a===`card`?`h-16 w-full`:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Release insights unavailable`,className:`text-sm text-muted-foreground`,children:`—`});let o=i?.builtIn===!0,s=o?0:I(t),c=(0,A.jsx)(`dl`,{className:n(a===`card`?`grid grid-cols-[1fr_1fr_auto] gap-4`:`flex min-w-[220px] flex-wrap items-baseline gap-x-3 gap-y-1`),children:P.map(({label:e,field:r,color:i})=>(0,A.jsxs)(`div`,{className:n(`flex`,a===`card`?`min-w-0 flex-col gap-1`:`items-baseline gap-1.5 whitespace-nowrap`),children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,A.jsxs)(`dd`,{className:n(`flex flex-wrap items-baseline gap-x-1.5 tabular-nums`,a===`card`?`text-xl font-semibold`:`text-sm font-medium`,t[r]>0&&!(r===`downloads`&&o)?i:`text-muted-foreground`),children:[r===`downloads`&&o?(0,A.jsx)(`span`,{title:`The built-in bundle is never downloaded`,children:`—`}):t[r].toLocaleString(),r===`failedLaunches`?(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,F(t),`)`]}):null]})]},r))});return(0,A.jsxs)(`div`,{className:n(`flex`,a===`card`?`flex-col gap-2`:`items-center gap-1`),children:[i?(0,A.jsx)(f,{className:`min-w-0 rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,to:`/insights`,search:{healthPlatform:i.platform,healthChannel:i.channel,releaseId:i.releaseId,bundleWindow:D(i.releaseId)},children:c}):c,a===`card`&&s>0?(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[s.toLocaleString(),` downloaded but not launched yet: waiting for a restart, or passed over for a newer bundle.`]}):null,a===`inline`?(0,A.jsx)(L,{}):null]})}function z({input:t}){let r=v({platform:t.platform,channel:t.channel,releaseId:t.releaseId}),i=r.data;return(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[i?(0,A.jsx)(`dl`,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Download failures`}),(0,A.jsxs)(`dd`,{className:n(`flex items-baseline gap-1.5 text-sm font-medium tabular-nums`,i.failedUpdates>0?`text-warning/85`:`text-muted-foreground`),children:[i.failedUpdates.toLocaleString(),(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,g(_(i)),`)`]})]})]})}):r.isPending?(0,A.jsx)(e,{"aria-label":`Loading download failures`,className:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Download failures unavailable`,className:`text-sm text-muted-foreground`,children:`—`}),(0,A.jsx)(E,{label:`About download failures`,children:`Failed downloads or installs of this bundle, at most one per installation a day. Rate = failures ÷ (failures + downloads).`})]})}function B({input:e}){let n=N([e]);return(0,A.jsxs)(S,{children:[(0,A.jsxs)(C,{className:`flex-row items-center justify-between px-4 pt-4 pb-3`,children:[(0,A.jsx)(w,{className:`text-sm font-medium`,children:`Insights`}),(0,A.jsx)(L,{})]}),(0,A.jsxs)(x,{className:`flex flex-col gap-3 px-4 pb-4`,children:[(0,A.jsx)(R,{variant:`card`,input:e,loading:n.isFetching,report:n.data?.[e.releaseId]}),(0,A.jsx)(s,{}),(0,A.jsx)(z,{input:e})]}),(0,A.jsx)(b,{className:`px-4 pb-4`,children:(0,A.jsxs)(f,{className:t({variant:`outline`,size:`sm`}),to:`/insights`,search:{healthPlatform:e.platform,healthChannel:e.channel,releaseId:e.releaseId,bundleWindow:D(e.releaseId),healthChart:`adoption`},children:[(0,A.jsx)(O,{"aria-hidden":`true`,"data-icon":`inline-start`}),`View adoption`]})})]})}function V({input:e}){return d(`insightsAnalytics`)?null:(0,A.jsxs)(S,{children:[(0,A.jsx)(C,{className:`px-4 pt-4 pb-3`,children:(0,A.jsx)(w,{className:`text-sm font-medium`,children:`Insights`})}),(0,A.jsx)(x,{className:`px-4 pb-4`,children:(0,A.jsx)(z,{input:e})})]})}function H({releaseId:e,releases:t}){let n=N(t);return(0,A.jsx)(R,{input:t.find(t=>t.releaseId===e),loading:n.isFetching,report:n.data?.[e]})}var U={Cell:H},W={insights:{navigation:{icon:(0,A.jsx)(y,{}),paths:[`/insights`,`/insights/distribution`,`/installations`],link:({features:e,onClick:t})=>e.insightsAnalytics?(0,A.jsx)(f,{to:`/insights`,onClick:t}):(0,A.jsx)(f,{to:`/installations`,onClick:t})},releaseSection:({release:e})=>(0,A.jsx)(V,{input:e})},insightsAnalytics:{releaseColumn:U,releaseSection:({release:e})=>(0,A.jsx)(B,{input:e})}},G={remoteConfig:{navigation:{icon:(0,A.jsx)(te,{}),paths:[`/remote-config`],link:({onClick:e})=>(0,A.jsx)(f,{to:`/remote-config`,onClick:e})}}},K={...W,...j,...G},q=Object.keys(p),J=()=>{let e=u().data?.features;return e===void 0?[]:q.flatMap(t=>{let n=K[t];return n!==void 0&&e[t]?[{...n,feature:t,label:p[t].label,features:e}]:[]})},Y=()=>J().flatMap(({feature:e,label:t,releaseColumn:n})=>n===void 0?[]:[{...n,feature:e,label:t}]);function X({release:e}){return J().map(({feature:t,releaseSection:n})=>n===void 0?null:(0,A.jsx)(n,{release:e},t))}var Z=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function Q(e){let t=Z(e.beforeReleaseId),n=t?void 0:Z(e.afterReleaseId),r=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0,i=Z(e.bundleId),a=i?void 0:Z(e.scopeKey),o=i||a?void 0:Z(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:Z(e.releaseId),scopeKey:a}}function $(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 ne(e){return $(e).kind!==`all`}function re(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 ie=m(`/`)({component:h(()=>ee(()=>import(`./routes-Bxu5_zNh.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])),`component`),validateSearch:Q});export{X as a,k as c,re as i,ne as n,J as o,$ as r,Y as s,ie as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-Br26jzt9.js","assets/sidebar-BqX460IW.js","assets/useCompositeListItem-B-UkrDlu.js","assets/console-features-api-DPE4C06Y.js","assets/alert-dialog-BtVg50WQ.js","assets/select-CV8nkfsf.js","assets/field-DBMkBfkD.js","assets/switch-C8ycp9AH.js","assets/valueToPercent-C4C1WZVn.js","assets/api-DoicFJfd.js","assets/chevron-right-BnvHIJdZ.js","assets/HashValueDisplay-BGkDPaYi.js","assets/dist-dDj-R6uh.js","assets/list-Dtj7TtzV.js","assets/dialog-CGKPxz3n.js","assets/input-group-B4nrqIh0.js","assets/insights-search-DAa0f7Dr.js","assets/insights-api-Dmd_LgT3.js","assets/table-DgGD67Fx.js"])))=>i.map(i=>d[i]);
2
+ import{$ as e,In as t,Ln as n,Ur as r,Wr as i,ar as a,cr as o,et as s,nr as c,rr as l}from"./sidebar-BqX460IW.js";import{a as u,i as d,l as f,o as p}from"./console-features-api-DPE4C06Y.js";import{a as ee,c as m,s as h}from"./useCompositeListItem-B-UkrDlu.js";import{_ as g,m as _,s as v,x as y}from"./insights-api-Dmd_LgT3.js";import{_ as b,h as x,m as S,v as C,y as w}from"./field-DBMkBfkD.js";import{t as T}from"./key-round-B4fI1psK.js";import{s as te}from"./switch-C8ycp9AH.js";import{h as E,t as D}from"./insights-search-DAa0f7Dr.js";var O=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`}]]),k=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`}]]),A=r(),j={apiKeys:{navigation:{icon:(0,A.jsx)(T,{}),paths:[`/api-keys`],link:({onClick:e})=>(0,A.jsx)(f,{to:`/api-keys`,onClick:e})}}},M=l({method:`GET`}).middleware([c]).handler(i(`b4bf4c461903edcdc44eea52468c737b5b600a586f542138ff022dcbbe86c45c`));function N(e){let t=e.map(({releaseId:e,platform:t,channel:n})=>({releaseId:e,platform:t,channel:n})).sort((e,t)=>e.releaseId.localeCompare(t.releaseId));return o({queryKey:[`bundle-activity`,t],queryFn:()=>M({data:t}),enabled:t.length>0,staleTime:3e4})}var P=[{label:`Downloaded`,field:`downloads`,color:`text-primary/85`},{label:`Launched`,field:`launched`,color:`text-success/85`},{label:`Crashed`,field:`failedLaunches`,color:`text-warning/85`}],F=e=>{let t=e.launched+e.failedLaunches;return t===0?`—`:`${(e.failedLaunches/t*100).toFixed(2)}%`},I=e=>Math.max(0,e.downloads-e.launched-e.failedLaunches);function L(){return(0,A.jsx)(E,{label:`About release insight metrics`,children:`Downloaded: got this bundle. Launched: ran it. Crashed: crashed on it and rolled back. Once every installation restarts, Downloaded = Launched + Crashed.`})}function R({report:t,loading:r=!1,input:i,variant:a=`inline`}){if(!t)return r?(0,A.jsx)(e,{"aria-label":`Loading release insights`,className:a===`card`?`h-16 w-full`:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Release insights unavailable`,className:`text-sm text-muted-foreground`,children:`—`});let o=i?.builtIn===!0,s=o?0:I(t),c=(0,A.jsx)(`dl`,{className:n(a===`card`?`grid grid-cols-[1fr_1fr_auto] gap-4`:`flex min-w-[220px] flex-wrap items-baseline gap-x-3 gap-y-1`),children:P.map(({label:e,field:r,color:i})=>(0,A.jsxs)(`div`,{className:n(`flex`,a===`card`?`min-w-0 flex-col gap-1`:`items-baseline gap-1.5 whitespace-nowrap`),children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,A.jsxs)(`dd`,{className:n(`flex flex-wrap items-baseline gap-x-1.5 tabular-nums`,a===`card`?`text-xl font-semibold`:`text-sm font-medium`,t[r]>0&&!(r===`downloads`&&o)?i:`text-muted-foreground`),children:[r===`downloads`&&o?(0,A.jsx)(`span`,{title:`The built-in bundle is never downloaded`,children:`—`}):t[r].toLocaleString(),r===`failedLaunches`?(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,F(t),`)`]}):null]})]},r))});return(0,A.jsxs)(`div`,{className:n(`flex`,a===`card`?`flex-col gap-2`:`items-center gap-1`),children:[i?(0,A.jsx)(f,{className:`min-w-0 rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,to:`/insights`,search:{healthPlatform:i.platform,healthChannel:i.channel,releaseId:i.releaseId,bundleWindow:D(i.releaseId)},children:c}):c,a===`card`&&s>0?(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[s.toLocaleString(),` downloaded but not launched yet: waiting for a restart, or passed over for a newer bundle.`]}):null,a===`inline`?(0,A.jsx)(L,{}):null]})}function z({input:t}){let r=v({platform:t.platform,channel:t.channel,releaseId:t.releaseId}),i=r.data;return(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[i?(0,A.jsx)(`dl`,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Download failures`}),(0,A.jsxs)(`dd`,{className:n(`flex items-baseline gap-1.5 text-sm font-medium tabular-nums`,i.failedUpdates>0?`text-warning/85`:`text-muted-foreground`),children:[i.failedUpdates.toLocaleString(),(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,g(_(i)),`)`]})]})]})}):r.isPending?(0,A.jsx)(e,{"aria-label":`Loading download failures`,className:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Download failures unavailable`,className:`text-sm text-muted-foreground`,children:`—`}),(0,A.jsx)(E,{label:`About download failures`,children:`Failed downloads or installs of this bundle, at most one per installation a day. Rate = failures ÷ (failures + downloads).`})]})}function B({input:e}){let n=N([e]);return(0,A.jsxs)(S,{children:[(0,A.jsxs)(C,{className:`flex-row items-center justify-between px-4 pt-4 pb-3`,children:[(0,A.jsx)(w,{className:`text-sm font-medium`,children:`Insights`}),(0,A.jsx)(L,{})]}),(0,A.jsxs)(x,{className:`flex flex-col gap-3 px-4 pb-4`,children:[(0,A.jsx)(R,{variant:`card`,input:e,loading:n.isFetching,report:n.data?.[e.releaseId]}),(0,A.jsx)(s,{}),(0,A.jsx)(z,{input:e})]}),(0,A.jsx)(b,{className:`px-4 pb-4`,children:(0,A.jsxs)(f,{className:t({variant:`outline`,size:`sm`}),to:`/insights`,search:{healthPlatform:e.platform,healthChannel:e.channel,releaseId:e.releaseId,bundleWindow:D(e.releaseId),healthChart:`adoption`},children:[(0,A.jsx)(O,{"aria-hidden":`true`,"data-icon":`inline-start`}),`View adoption`]})})]})}function V({input:e}){return d(`insightsAnalytics`)?null:(0,A.jsxs)(S,{children:[(0,A.jsx)(C,{className:`px-4 pt-4 pb-3`,children:(0,A.jsx)(w,{className:`text-sm font-medium`,children:`Insights`})}),(0,A.jsx)(x,{className:`px-4 pb-4`,children:(0,A.jsx)(z,{input:e})})]})}function H({releaseId:e,releases:t}){let n=N(t);return(0,A.jsx)(R,{input:t.find(t=>t.releaseId===e),loading:n.isFetching,report:n.data?.[e]})}var U={Cell:H},W={insights:{navigation:{icon:(0,A.jsx)(y,{}),paths:[`/insights`,`/insights/distribution`,`/installations`],link:({features:e,onClick:t})=>e.insightsAnalytics?(0,A.jsx)(f,{to:`/insights`,onClick:t}):(0,A.jsx)(f,{to:`/installations`,onClick:t})},releaseSection:({release:e})=>(0,A.jsx)(V,{input:e})},insightsAnalytics:{releaseColumn:U,releaseSection:({release:e})=>(0,A.jsx)(B,{input:e})}},G={remoteConfig:{navigation:{icon:(0,A.jsx)(te,{}),paths:[`/remote-config`],link:({onClick:e})=>(0,A.jsx)(f,{to:`/remote-config`,onClick:e})}}},K={...W,...j,...G},q=Object.keys(p),J=()=>{let e=u().data?.features;return e===void 0?[]:q.flatMap(t=>{let n=K[t];return n!==void 0&&e[t]?[{...n,feature:t,label:p[t].label,features:e}]:[]})},Y=()=>J().flatMap(({feature:e,label:t,releaseColumn:n})=>n===void 0?[]:[{...n,feature:e,label:t}]);function X({release:e}){return J().map(({feature:t,releaseSection:n})=>n===void 0?null:(0,A.jsx)(n,{release:e},t))}var Z=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function Q(e){let t=Z(e.beforeReleaseId),n=t?void 0:Z(e.afterReleaseId),r=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0,i=Z(e.bundleId),a=i?void 0:Z(e.scopeKey),o=i||a?void 0:Z(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:Z(e.releaseId),scopeKey:a}}function $(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 ne(e){return $(e).kind!==`all`}function re(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 ie=m(`/`)({component:h(()=>ee(()=>import(`./routes-Br26jzt9.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])),`component`),validateSearch:Q});export{X as a,k as c,re as i,ne as n,J as o,$ as r,Y as s,ie as t};
@@ -0,0 +1 @@
1
+ import{ar as e}from"./sidebar-BqX460IW.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);export{t};