@hot-updater/console 1.0.0-rc.20 → 1.0.0-rc.21

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 (180) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/{ConsoleFeatureUnavailable-B9VYGA3N.js → ConsoleFeatureUnavailable-D0LPL1Gy.js} +1 -1
  3. package/.output/public/assets/{HashValueDisplay-D880zntR.js → HashValueDisplay-BmuB4FW-.js} +1 -1
  4. package/.output/public/assets/InsightsInfo--v4SC07c.js +1 -0
  5. package/.output/public/assets/InsightsPageHeader-dU83CAQY.js +1 -0
  6. package/.output/public/assets/{NotFoundPage-Dys8C0cW.js → NotFoundPage-B5mhGG2a.js} +1 -1
  7. package/.output/public/assets/api-D-vOVlQ4.js +1 -0
  8. package/.output/public/assets/api-keys-Csh8ARKU.js +1 -0
  9. package/.output/public/assets/api-keys-OMPUoA_A.js +1 -0
  10. package/.output/public/assets/arrow-left-Bwq9X1eS.js +1 -0
  11. package/.output/public/assets/arrow-up-right-BkOVn4if.js +1 -0
  12. package/.output/public/assets/{card-DzCPSRsh.js → card-C_7d6O9a.js} +1 -1
  13. package/.output/public/assets/console-features-api-C1jRZTGw.js +1 -0
  14. package/.output/public/assets/dialog-DE8wFN_P.js +1 -0
  15. package/.output/public/assets/{dist-Clb6cQ9l.js → dist-C7ENGzpS.js} +1 -1
  16. package/.output/public/assets/empty-CVd5NlQD.js +1 -0
  17. package/.output/public/assets/{field-Bou7shoO.js → field-C06q1iC9.js} +1 -1
  18. package/.output/public/assets/index-BeWlQtO6.js +11 -0
  19. package/.output/public/assets/{input-group-DVtWFUUF.js → input-group-Bi61biIA.js} +1 -1
  20. package/.output/public/assets/insights-BjnAtC0f.js +2 -0
  21. package/.output/public/assets/insights-D86m11yH.js +42 -0
  22. package/.output/public/assets/insights-DpYstMoY.js +1 -0
  23. package/.output/public/assets/{insights-recovery-rpc-wvdyM4LD.js → insights-recovery-rpc-BIm5_ALc.js} +1 -1
  24. package/.output/public/assets/{insights-usage-rpc-qUkNtrWr.js → insights-usage-rpc-VHj8vyBt.js} +1 -1
  25. package/.output/public/assets/insights_.distribution-ADcrX48c.js +2 -0
  26. package/.output/public/assets/insights_.distribution-CuuJUN6Y.js +1 -0
  27. package/.output/public/assets/{insights_.distribution-CItZw3-8.js → insights_.distribution-DJRjuXsO.js} +1 -1
  28. package/.output/public/assets/installations-BSBBzqWs.js +2 -0
  29. package/.output/public/assets/installations-DqIE6WcO.js +1 -0
  30. package/.output/public/assets/installations-UsELbDvw.js +1 -0
  31. package/.output/public/assets/{loader-circle-Ca7C9YY1.js → loader-circle-CnCBxzHp.js} +1 -1
  32. package/.output/public/assets/mutation-Csp7xUNh.js +1 -0
  33. package/.output/public/assets/preload-helper-B-cOmpLH.js +1 -0
  34. package/.output/public/assets/{refresh-cw-CVGqvy8Z.js → refresh-cw-FF1NtzlQ.js} +1 -1
  35. package/.output/public/assets/{routes-veKtDW39.js → routes-CoN9XHP_.js} +2 -2
  36. package/.output/public/assets/routes-DT1jB0Zi.js +1 -0
  37. package/.output/public/assets/sidebar-D8mJRF15.js +3 -0
  38. package/.output/public/assets/styles-Bwt7v6U5.css +2 -0
  39. package/.output/public/assets/table-WBgfvgXg.js +1 -0
  40. package/.output/public/assets/{useCompositeListItem-CF7vsfcA.js → useCompositeListItem-CloBmDwn.js} +1 -1
  41. package/.output/public/assets/useMutation-DO8cvsTx.js +1 -0
  42. package/.output/public/assets/{useOpenInteractionType-AnAMWYIY.js → useOpenInteractionType-ReGr9GzJ.js} +1 -1
  43. package/.output/public/assets/valueToPercent-BvPAi4bP.js +1 -0
  44. package/.output/server/{__23tanstack-start-server-fn-resolver-CUQLz7hs.mjs → __23tanstack-start-server-fn-resolver-DMRD4e4f.mjs} +34 -42
  45. package/.output/server/_libs/@tanstack/react-router+[...].mjs +3756 -4022
  46. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +138 -95
  47. package/.output/server/_libs/tanstack__history.mjs +68 -41
  48. package/.output/server/_libs/tanstack__query-core.mjs +1618 -309
  49. package/.output/server/_libs/tanstack__react-query.mjs +255 -20
  50. package/.output/server/_ssr/{ConsoleFeatureUnavailable-DoxET2AT.mjs → ConsoleFeatureUnavailable-Du7jNPNS.mjs} +7 -7
  51. package/.output/server/_ssr/{HashValueDisplay-BplboHEb.mjs → HashValueDisplay-GQvFkXoi.mjs} +2 -2
  52. package/.output/server/_ssr/{InsightsInfo-o2YPd5Qc.mjs → InsightsInfo-Do7QSaFR.mjs} +2 -2
  53. package/.output/server/_ssr/{InsightsPageHeader-NExCJL1I.mjs → InsightsPageHeader-DSUWUWRc.mjs} +6 -6
  54. package/.output/server/_ssr/{NotFoundPage-Cd-A8ock.mjs → NotFoundPage-DsF4Vrhg.mjs} +2 -2
  55. package/.output/server/_ssr/{api-B1Ro0uys.mjs → api-BEiVs0H7.mjs} +9 -8
  56. package/.output/server/_ssr/{api-keys-Dvvy1sem.mjs → api-keys-BrvBWGRf.mjs} +2 -2
  57. package/.output/server/_ssr/{api-keys-CT3HG7KT.mjs → api-keys-K5v32nf7.mjs} +8 -8
  58. package/.output/server/_ssr/{api-keys-rpc-b1qTTFfG.mjs → api-keys-rpc-B96bBllm.mjs} +5 -5
  59. package/.output/server/_ssr/{api-rpc-Cbns2MGx.mjs → api-rpc-DcUe280B.mjs} +13 -55
  60. package/.output/server/_ssr/{auth-rpc-DChS7m9y.mjs → auth-rpc-C68W56DP.mjs} +6 -6
  61. package/.output/server/_ssr/{api-C0G9MTMI.mjs → auth.server-DM1J6NwR.mjs} +2815 -1308
  62. package/.output/server/_ssr/{bundleActivity-D17Pb_h5.mjs → bundleActivity-CpuY9CTP.mjs} +1 -1
  63. package/.output/server/_ssr/{card-DMbcvlPz.mjs → card-CPAEKx0w.mjs} +1 -1
  64. package/.output/server/_ssr/config-nsIcsHh8.mjs +15 -0
  65. package/.output/server/_ssr/config.server-DDCZk3Sq.mjs +36 -0
  66. package/.output/server/_ssr/{console-access-KpPv5lin.mjs → console-access-Da-2Qd7q.mjs} +3 -3
  67. package/.output/server/_ssr/{console-features-CsbyHYfK.mjs → console-features-Dzu2iUGD.mjs} +6 -6
  68. package/.output/server/_ssr/{console-features-api-B-KVuo4p.mjs → console-features-api-xAsSgFa_.mjs} +6 -6
  69. package/.output/server/_ssr/{console-features-rpc-Djyo5740.mjs → console-features-rpc-qARGpB24.mjs} +5 -5
  70. package/.output/server/_ssr/{createMiddleware-B_I3Ll4M.mjs → createMiddleware-BdBf_ezN.mjs} +41 -56
  71. package/.output/server/_ssr/{createServerRpc-DuNm5mmo.mjs → createServerRpc-B_y2lrwA.mjs} +2 -2
  72. package/.output/server/_ssr/databaseJsonValue-Bhxciy7Z.mjs +68 -0
  73. package/.output/server/_ssr/databaseRows-DwMAjaF8.mjs +74 -0
  74. package/.output/server/_ssr/{dialog-cOmLTUV2.mjs → dialog-q__BJ7mQ.mjs} +1 -1
  75. package/.output/server/_ssr/{dist-B-r4u3Lg.mjs → dist-Cxo9ghYv.mjs} +114 -3
  76. package/.output/server/_ssr/{downloadBundle-CexOFoZ4.mjs → downloadBundle-BW9I-pMQ.mjs} +6 -5
  77. package/.output/server/_ssr/{empty-BHoY_5jt.mjs → empty-DcBTAooP.mjs} +2 -2
  78. package/.output/server/_ssr/{empty-plugin-adapters-B5QvGpEl.mjs → empty-plugin-adapters-CYdinE-i.mjs} +1 -1
  79. package/.output/server/_ssr/{field-mjhcNEXD.mjs → field-QCDBVpXA.mjs} +2 -2
  80. package/.output/server/_ssr/{getBundleChildren-DbDXe9wB.mjs → getBundleChildren-DIAGCF4a.mjs} +2 -2
  81. package/.output/server/_ssr/{input-group-96H30HWC.mjs → input-group-hCk2nUoU.mjs} +1 -1
  82. package/.output/server/_ssr/{insights-DgFv1NsO.mjs → insights-BfBO0RFr.mjs} +18 -18
  83. package/.output/server/_ssr/{insights-D359GJFL.mjs → insights-DsAU3-TB.mjs} +5 -5
  84. package/.output/server/_ssr/{insights-D25VDVaz.mjs → insights-RIfg447W.mjs} +2 -2
  85. package/.output/server/_ssr/{insights-api-ChAKrbhG.mjs → insights-api-CDn-QQHU.mjs} +5 -5
  86. package/.output/server/_ssr/{insights-failures-WQ-ttjOx.mjs → insights-failures-BBGMhuUr.mjs} +2 -2
  87. package/.output/server/_ssr/{insights-failures-rpc-BFsqlltN.mjs → insights-failures-rpc-rA2dctK2.mjs} +8 -8
  88. package/.output/server/_ssr/{insights-recovery-DkL6bxMW.mjs → insights-recovery-Dpk6Mfb9.mjs} +1 -1
  89. package/.output/server/_ssr/{insights-recovery-rpc-2P5m8F62.mjs → insights-recovery-rpc-BCaF-xSd.mjs} +11 -11
  90. package/.output/server/_ssr/{insights-recovery-rpc-Tj8vNC19.mjs → insights-recovery-rpc-CcgYyUHk.mjs} +5 -5
  91. package/.output/server/_ssr/{insights-rpc-DrkVmV9o.mjs → insights-rpc-keycmwzw.mjs} +5 -5
  92. package/.output/server/_ssr/{insights-search-BsalnNw-.mjs → insights-search-BRg5VsNe.mjs} +1 -1
  93. package/.output/server/_ssr/{insights-usage-1nVTQrLy.mjs → insights-usage-cbw9n2Fq.mjs} +1 -1
  94. package/.output/server/_ssr/{insights-usage-rpc-Ct_4xHhZ.mjs → insights-usage-rpc-BKgV1QDf.mjs} +8 -8
  95. package/.output/server/_ssr/{insights-usage-rpc-DaYIRtFK.mjs → insights-usage-rpc-D-JYachy.mjs} +5 -5
  96. package/.output/server/_ssr/{insightsRecovery-CpGucWN1.mjs → insightsRecovery-B7oMc8d8.mjs} +2 -2
  97. package/.output/server/_ssr/{insightsUsage-JYpKZAF7.mjs → insightsUsage-Oa7kk5ek.mjs} +3 -3
  98. package/.output/server/_ssr/{insights_.distribution-jQZEF07J.mjs → insights_.distribution-BIqOqRW0.mjs} +13 -13
  99. package/.output/server/_ssr/{insights_.distribution-Bcu6uYs_.mjs → insights_.distribution-CuUrDa7P.mjs} +2 -2
  100. package/.output/server/_ssr/{insights_.distribution-D3Csuyjw.mjs → insights_.distribution-RT_6x_ud.mjs} +5 -5
  101. package/.output/server/_ssr/{installations-Cxikllmx.mjs → installations-BO5CjX2z.mjs} +11 -11
  102. package/.output/server/_ssr/{installations-BI5kelHv.mjs → installations-BjaHiIfh.mjs} +2 -2
  103. package/.output/server/_ssr/{installations-B8Vh54lH.mjs → installations-Dt5luA-N.mjs} +4 -4
  104. package/.output/server/_ssr/{listReleases-DqU9t1l3.mjs → listReleases-BitHzOYB.mjs} +1 -1
  105. package/.output/server/_ssr/{router-CRkm-wHD.mjs → router-DfVAixxe.mjs} +42 -39
  106. package/.output/server/_ssr/{routes-CNAi0Mmv.mjs → routes-C6LstNp8.mjs} +14 -14
  107. package/.output/server/_ssr/{routes-B3IJo_jL.mjs → routes-Q3Uhmwwz.mjs} +11 -11
  108. package/.output/server/_ssr/{runtime.server-NucbYjc7.mjs → runtime.server-fL0o6I2b.mjs} +500 -413
  109. package/.output/server/_ssr/schema-BKY9SqaY.mjs +25 -0
  110. package/.output/server/_ssr/{select-BkPAJFL7.mjs → select-CUlInmjk.mjs} +1 -1
  111. package/.output/server/_ssr/server-C43wq9ft.mjs +8330 -0
  112. package/.output/server/_ssr/{sidebar-Cw1VuC7d.mjs → sidebar-DKbx2ach.mjs} +3 -3
  113. package/.output/server/_ssr/ssr.mjs +1 -1
  114. package/.output/server/_ssr/start-BXUOv_n8.mjs +4 -0
  115. package/.output/server/_ssr/{table-q0P9wz7x.mjs → table-NGWV8B-S.mjs} +1 -1
  116. package/.output/server/_ssr/{updateFailures-DMU9f0pK.mjs → updateFailures-Jwe2Baab.mjs} +3 -3
  117. package/.output/server/_ssr/{uuidv7-BzSO-fr-.mjs → uuidv7-C8bwiZr8.mjs} +2 -2
  118. package/.output/server/_tanstack-start-manifest_v-WQ5qGn8n.mjs +124 -0
  119. package/.output/server/index.mjs +218 -218
  120. package/LICENSE +13 -14
  121. package/README.md +16 -12
  122. package/lib/index.d.mts +18 -8
  123. package/lib/vite-internal.mjs +15 -8
  124. package/lib/vite.d.mts +2 -0
  125. package/package.json +14 -14
  126. package/src/components/AppSidebar.tsx +9 -0
  127. package/src/components/ConsoleFeatureUnavailable.tsx +1 -3
  128. package/src/components/features/bundles/BundleMetadata.tsx +1 -1
  129. package/src/components/features/bundles/RolloutCohortsDialog.tsx +1 -1
  130. package/src/components/features/releases/ReleaseEditorSheet.tsx +6 -6
  131. package/src/index.ts +27 -15
  132. package/src/lib/api-rpc.ts +1 -54
  133. package/src/lib/api.ts +8 -89
  134. package/src/lib/console-features.ts +5 -5
  135. package/src/lib/scroll-restoration.ts +1 -1
  136. package/src/lib/server/config.server.ts +15 -52
  137. package/src/lib/server/console-runtime.server.ts +84 -6
  138. package/src/lib/server/downloadBundle.ts +10 -6
  139. package/src/lib/server/releaseReachability.ts +4 -4
  140. package/src/lib/server/runtime.server.ts +34 -46
  141. package/src/routeTree.gen.ts +31 -31
  142. package/src/routes/api/bundles/$bundleId/download.ts +2 -2
  143. package/src/vite-internal.ts +17 -8
  144. package/src/vite.ts +2 -0
  145. package/.output/public/assets/InsightsInfo-By_sPjTE.js +0 -1
  146. package/.output/public/assets/InsightsPageHeader-9_kx_LL7.js +0 -1
  147. package/.output/public/assets/api-CtarlV0l.js +0 -1
  148. package/.output/public/assets/api-keys-DFF_QqtN.js +0 -1
  149. package/.output/public/assets/api-keys-evfsQ4sN.js +0 -1
  150. package/.output/public/assets/arrow-left-BP9D-ta_.js +0 -1
  151. package/.output/public/assets/arrow-up-right-CDP9Tevw.js +0 -1
  152. package/.output/public/assets/console-features-api-yv7rm3DX.js +0 -1
  153. package/.output/public/assets/dialog-BDvCy_QO.js +0 -1
  154. package/.output/public/assets/empty-C5x9mn_s.js +0 -1
  155. package/.output/public/assets/index-0eg3l8aC.js +0 -10
  156. package/.output/public/assets/insights-2MbdiSNv.js +0 -1
  157. package/.output/public/assets/insights-C6tmCZHk.js +0 -2
  158. package/.output/public/assets/insights-CadS_aIA.js +0 -42
  159. package/.output/public/assets/insights_.distribution-BhBs6PNA.js +0 -1
  160. package/.output/public/assets/insights_.distribution-CJUH_wAS.js +0 -2
  161. package/.output/public/assets/installations-CH2H7JQt.js +0 -2
  162. package/.output/public/assets/installations-DMeMuwsW.js +0 -1
  163. package/.output/public/assets/installations-DnvxI9Dt.js +0 -1
  164. package/.output/public/assets/mutation-x9L28_CD.js +0 -1
  165. package/.output/public/assets/preload-helper-BN-UkjOE.js +0 -1
  166. package/.output/public/assets/routes-BhK8DuZA.js +0 -1
  167. package/.output/public/assets/sidebar-B45aMqRm.js +0 -3
  168. package/.output/public/assets/styles-Dn0pK1EX.css +0 -2
  169. package/.output/public/assets/table-CwLnN6KX.js +0 -1
  170. package/.output/public/assets/useMutation-CN1ygYEr.js +0 -1
  171. package/.output/public/assets/valueToPercent-C-t8FT0y.js +0 -1
  172. package/.output/server/_ssr/auth.server-Ccqz2iVv.mjs +0 -37
  173. package/.output/server/_ssr/config-DMEJdhoW.mjs +0 -13
  174. package/.output/server/_ssr/config.server-DyypN6cQ.mjs +0 -60
  175. package/.output/server/_ssr/databaseRows-CXxf_VIB.mjs +0 -132
  176. package/.output/server/_ssr/deleteBundle-Dcc21Lbd.mjs +0 -56
  177. package/.output/server/_ssr/server-DKJYsaCP.mjs +0 -7442
  178. package/.output/server/_ssr/start-DpViQGnt.mjs +0 -4
  179. package/.output/server/_tanstack-start-manifest_v-Bb0gKDbb.mjs +0 -124
  180. package/src/lib/server/deleteBundle.ts +0 -136
@@ -1 +0,0 @@
1
- import{t as e}from"./ConsoleFeatureUnavailable-B9VYGA3N.js";var t=e;export{t as notFoundComponent};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/insights_.distribution-BhBs6PNA.js","assets/ConsoleFeatureUnavailable-B9VYGA3N.js","assets/sidebar-B45aMqRm.js","assets/console-features-api-yv7rm3DX.js","assets/arrow-up-right-CDP9Tevw.js","assets/NotFoundPage-Dys8C0cW.js","assets/empty-C5x9mn_s.js","assets/insights_.distribution-CItZw3-8.js","assets/preload-helper-BN-UkjOE.js","assets/valueToPercent-C-t8FT0y.js","assets/useOpenInteractionType-AnAMWYIY.js","assets/useCompositeListItem-CF7vsfcA.js","assets/field-Bou7shoO.js","assets/InsightsPageHeader-9_kx_LL7.js","assets/card-DzCPSRsh.js","assets/insights-usage-rpc-qUkNtrWr.js","assets/arrow-left-BP9D-ta_.js","assets/InsightsInfo-By_sPjTE.js","assets/insights-search-KIF7mRtB.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./console-features-api-yv7rm3DX.js";import{S as t,t as n,x as r}from"./preload-helper-BN-UkjOE.js";import{t as i}from"./insights-search-KIF7mRtB.js";var a=t(`/insights_/distribution`)({beforeLoad:({context:t})=>e(t.queryClient,`insightsAnalytics`),notFoundComponent:r(()=>n(()=>import(`./insights_.distribution-BhBs6PNA.js`),__vite__mapDeps([0,1,2,3,4,5,6])),`notFoundComponent`),component:r(()=>n(()=>import(`./insights_.distribution-CItZw3-8.js`),__vite__mapDeps([7,2,8,3,9,10,11,12,13,14,15,16,4,17,6,18])),`component`),validateSearch:i});export{a as t};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/installations-DnvxI9Dt.js","assets/ConsoleFeatureUnavailable-B9VYGA3N.js","assets/sidebar-B45aMqRm.js","assets/console-features-api-yv7rm3DX.js","assets/arrow-up-right-CDP9Tevw.js","assets/NotFoundPage-Dys8C0cW.js","assets/empty-C5x9mn_s.js","assets/installations-DMeMuwsW.js","assets/preload-helper-BN-UkjOE.js","assets/InsightsPageHeader-9_kx_LL7.js","assets/useCompositeListItem-CF7vsfcA.js","assets/field-Bou7shoO.js","assets/card-DzCPSRsh.js","assets/arrow-left-BP9D-ta_.js","assets/HashValueDisplay-D880zntR.js","assets/dist-Clb6cQ9l.js","assets/refresh-cw-CVGqvy8Z.js","assets/input-group-DVtWFUUF.js","assets/table-CwLnN6KX.js"])))=>i.map(i=>d[i]);
2
- import{Fr as e,Ir as t,Lr as n,Nr as r,zr as i}from"./sidebar-B45aMqRm.js";import{A as a,B as o,C as s,D as c,E as l,F as u,G as d,H as f,I as p,K as m,L as h,M as g,N as _,O as v,P as y,R as b,S as x,T as S,V as C,W as w,b as T,j as E,k as D,q as O,r as k,v as A,x as j,y as ee}from"./console-features-api-yv7rm3DX.js";import{S as te,T as ne,t as re,x as ie}from"./preload-helper-BN-UkjOE.js";var ae=se(JSON.parse),oe=ce(JSON.stringify,JSON.parse);function se(t){return n=>{n[0]===`?`&&(n=n.substring(1));let r=e(n);for(let e in r){let n=r[e];if(typeof n==`string`)try{r[e]=t(n)}catch{}}return r}}function ce(e,n){let r=typeof n==`function`;function i(t){if(typeof t==`object`&&t)try{return e(t)}catch{}else if(r&&typeof t==`string`)try{return n(t),e(t)}catch{}return t}return e=>{let n=t(e,i);return n?`?${n}`:``}}var M=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},le=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),N=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),P=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},ue=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},F=(e,t,i)=>{if(!(!r(i)&&!n(i)))throw r(i)&&i.redirectHandled&&!i.options.reloadDocument?i:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=i,e.updateMatch(t.id,a=>({...a,status:r(i)?`redirected`:n(i)?`notFound`:a.status===`pending`?`success`:a.status,context:P(e,t.index),isFetching:!1,error:i})),n(i)&&!i.routeId&&(i.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),r(i)&&(e.rendered=!0,i.options._fromLocation=e.location,i.redirectHandled=!0,i=e.router.resolveRedirect(i)),i)},de=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},fe=(e,t,n)=>{let r=P(e,n);e.updateMatch(t,e=>({...e,context:r}))},I=(e,t,i)=>{let{id:a,routeId:o}=e.matches[t],s=e.router.looseRoutesById[o];if(i instanceof Promise)throw i;e.firstBadMatchIndex??=t,F(e,e.router.getMatch(a),i);try{s.options.onError?.(i)}catch(t){i=t,F(e,e.router.getMatch(a),i)}e.updateMatch(a,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:i,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!r(i)&&!n(i)&&(e.serialError??=i)},pe=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!N(e,t)&&(n.options.loader||n.options.beforeLoad||Ce(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{M(e)},i);r._nonReactive.pendingTimeout=t}},me=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;pe(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&F(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},he=(e,t,i,a)=>{let o=e.router.getMatch(t),s=o._nonReactive.loadPromise;o._nonReactive.loadPromise=u(()=>{s?.resolve(),s=void 0});let{paramsError:c,searchError:l}=o;c&&I(e,i,c),l&&I(e,i,l),pe(e,t,a,o);let d=new AbortController,f=!1,p=()=>{f||(f=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:d})))},m=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!a.options.beforeLoad){e.router.batch(()=>{p(),m()});return}o._nonReactive.beforeLoadPromise=u();let h={...P(e,i,!1),...o.__routeContext},{search:g,params:_,cause:v}=o,y=N(e,t),b={search:g,abortController:d,params:_,preload:y,context:h,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:y?`preload`:v,matches:e.matches,routeId:a.id,...e.router.options.additionalContext},x=a=>{if(a===void 0){e.router.batch(()=>{p(),m()});return}(r(a)||n(a))&&(p(),I(e,i,a)),e.router.batch(()=>{p(),e.updateMatch(t,e=>({...e,__beforeLoadContext:a})),m()})},S;try{if(S=a.options.beforeLoad(b),w(S))return p(),S.catch(t=>{I(e,i,t)}).then(x)}catch(t){p(),I(e,i,t)}x(S)},ge=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>he(e,n,t,i),s=()=>{if(de(e,n))return;let t=me(e,n,i);return w(t)?t.then(o):o()};return a()},_e=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},ve=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=P(e,r),d=N(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},ye=async(e,t,i,a,o)=>{try{let s=e.router.getMatch(i);try{L(o);let n=o.options.loader,r=typeof n==`function`?n:n?.handler,c=r?.(ve(e,t,i,a,o)),l=!!r&&w(c);if((l||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(i,e=>({...e,isFetching:`loader`})),r){let t=l?await c:c;F(e,e.router.getMatch(i),t),t!==void 0&&e.updateMatch(i,e=>({...e,loaderData:t}))}o._lazyPromise&&await o._lazyPromise;let u=s._nonReactive.minPendingPromise;u&&await u,o._componentsPromise&&await o._componentsPromise,e.updateMatch(i,t=>({...t,error:void 0,context:P(e,a),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let c=t;if(c?.name===`AbortError`){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}e.updateMatch(i,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:P(e,a)}));return}let l=s._nonReactive.minPendingPromise;l&&await l,n(t)&&await o.options.notFoundComponent?.preload?.(),F(e,e.router.getMatch(i),t);try{o.options.onError?.(t)}catch(t){c=t,F(e,e.router.getMatch(i),t)}!r(c)&&!n(c)&&await L(o,[`errorComponent`]),e.updateMatch(i,t=>({...t,error:c,context:P(e,a),status:`error`,isFetching:!1}))}}catch(t){let n=e.router.getMatch(i);n&&(n._nonReactive.loaderPromise=void 0),F(e,n,t)}},be=async(e,t,n)=>{async function i(i,o,l,u,d){let p=Date.now()-o.updatedAt,m=i?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,h=d.options.shouldReload,g=typeof h==`function`?h(ve(e,t,a,n,d)):h,{status:_,invalid:v}=u,y=p>=m&&(!!e.forceStaleReload||u.cause===`enter`||l!==void 0&&l!==u.id);s=_===`success`&&(v||(g??y)),i&&d.options.preload===!1||(s&&!e.sync&&f?(c=!0,(async()=>{try{await ye(e,t,a,n,d);let r=e.router.getMatch(a);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){r(t)&&await e.router.navigate(t.options)}})()):_!==`success`||s?await ye(e,t,a,n,d):fe(e,a,n))}let{id:a,routeId:o}=e.matches[n],s=!1,c=!1,l=e.router.looseRoutesById[o],d=l.options.loader,f=((typeof d==`function`?void 0:d?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(de(e,a)){if(!e.router.getMatch(a))return e.matches[n];fe(e,a,n)}else{let t=e.router.getMatch(a),r=e.router.stores.matchesId.get()[n],s=(r&&e.router.stores.matchStores.get(r)||null)?.routeId===o?r:e.router.stores.matches.get().find(e=>e.routeId===o)?.id,c=N(e,a);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&f)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(a),r=n._nonReactive.error||n.error;r&&F(e,n,r),n.status===`pending`&&await i(c,t,s,n,l)}else{let n=c&&!e.router.stores.matchStores.has(a),r=e.router.getMatch(a);r._nonReactive.loaderPromise=u(),n!==r.preload&&e.updateMatch(a,e=>({...e,preload:n})),await i(c,t,s,r,l)}}let p=e.router.getMatch(a);c||(p._nonReactive.loaderPromise?.resolve(),p._nonReactive.loadPromise?.resolve(),p._nonReactive.loadPromise=void 0),clearTimeout(p._nonReactive.pendingTimeout),p._nonReactive.pendingTimeout=void 0,c||(p._nonReactive.loaderPromise=void 0),p._nonReactive.dehydrated=void 0;let m=c?p.isFetching:!1;return m!==p.isFetching||p.invalid!==!1?(e.updateMatch(a,e=>({...e,isFetching:m,invalid:!1})),e.router.getMatch(a)):p};async function xe(e){let t=e,a=[];le(t.router)&&M(t);let o;for(let e=0;e<t.matches.length;e++){try{let n=ge(t,e);w(n)&&await n}catch(e){if(r(e))throw e;if(n(e))o=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let s=t.firstBadMatchIndex??t.matches.length,c=o&&!t.preload?ue(t,o):void 0,l=o&&t.preload?0:c===void 0?s:Math.min(c+1,s),u,d;for(let e=0;e<l;e++)a.push(be(t,a,e));try{await Promise.all(a)}catch{let e=await Promise.allSettled(a);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(r(e))throw e;n(e)?u??=e:d??=e}if(d!==void 0)throw d}let f=u??(o&&!t.preload?o:void 0),p=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!f&&o&&t.preload)return t.matches;if(f){let e=ue(t,f);e===void 0&&i();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],a=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&a&&(r.options.notFoundComponent=a),f.routeId=n.routeId;let o=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...o?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:f},isFetching:!1})),p=e,await L(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await L(e,[`errorComponent`])}for(let e=0;e<=p;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=_e(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let m=M(t);if(w(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Se(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function L(e,t=R){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===R?(()=>{if(e._componentsPromise===void 0){let t=Se(e,R);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Se(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Ce(e){for(let t of R)if(e.options[t]?.preload)return!0;return!1}var R=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function we(e){return{input:({url:t})=>{for(let n of e)t=z(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Ee(e[n],t);return t}}}function Te(e){let t=s(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=j([`/`,t,e.pathname]),e)}}function z(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Ee(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function De(e){let t=e;return{get(){return t},set(e){t=o(e,t)}}}function Oe(e){return{get(){return e()}}}function ke(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),_=n(e.redirect),v=n([]),y=n([]),b=n([]),x=r(()=>B(o,v.get())),S=r(()=>B(s,y.get())),C=r(()=>B(c,b.get())),w=r(()=>v.get()[0]),T=r(()=>v.get().some(e=>o.get(e)?.get().status===`pending`)),E=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),D=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:x.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:_.get()})),O=g(64);function k(e){let t=O.get(e);return t||(t=r(()=>{let t=v.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),O.set(e,t)),t}let A={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:_,matchesId:v,pendingIds:y,cachedIds:b,matches:x,pendingMatches:S,cachedMatches:C,firstId:w,hasPending:T,matchRouteDeps:E,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:D,getRouteMatchStore:k,setMatches:j,setPending:ee,setCached:te};j(e.matches),a?.(A);function j(e){V(e,o,v,n,i)}function ee(e){V(e,s,y,n,i)}function te(e){V(e,c,b,n,i)}return A}function B(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function V(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}y(n.get(),a)||n.set(a)})}var H=`__TSR_index`,Ae=`popstate`,je=`beforeunload`;function Me(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=U(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[H];i=Ne(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[H];i=Ne(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[H]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Ne(e,t){t||={};let n=W();return{...t,key:n,__TSR_key:n,[H]:e}}function Pe(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>U(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=W();t.history.replaceState({[H]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=U(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[H]-l.state[H],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=Me({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(je,S,{capture:!0}),t.removeEventListener(Ae,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(je,S,{capture:!0}),t.addEventListener(Ae,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function Fe(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function U(e,t){let n=Fe(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=W();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[H]:0,key:a,__TSR_key:a}}}function W(){return(Math.random()+1).toString(36).substring(7)}function Ie(e){return e instanceof Error?{name:e.name,message:e.message}:{data:e}}function G(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Le=new WeakMap,Re=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=ee(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Pe()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=g(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=ke(Be(this.latestLocation),e),rt(this)}let a=!1,o=this.options.basepath??`/`,c=this.options.rewrite;if(r||n!==o||i!==c){this.basepath=o;let e=[],t=s(o);t&&t!==`/`&&e.push(Te({basepath:o})),c&&e.push(c),this.rewrite=e.length===0?void 0:e.length===1?e[0]:we(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=E(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&a(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:p(e).path,external:!1,searchStr:o,search:m(t?.search,i),hash:p(r.slice(1)).path,state:O(t?.state,a)}}let o=new URL(i,this.origin),s=z(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:p(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:m(t?.search,c),hash:p(s.hash.slice(1)).path,state:O(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>x({base:e,to:t.includes(`//`)?A(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Ve({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,s=r.search,c=Object.assign(Object.create(null),r.params),l=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),u=a?this.resolvePathWithBase(l,a):l,d=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?c:Object.assign(c,o(t.params,c)),f=this.routesByPath[S(u)],h;if(f)h=this.getRouteBranch(f);else if(u.includes(`$`))h=[];else{let e=this.getMatchedRoutes(u);h=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(h=[...h,this.options.notFoundRoute])}if(h.length&&C(d))for(let e of h){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(d,t(d))}catch{}}let g=e.leaveParams?u:p(T({path:u,params:d,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,_=s;if(e._includeValidateSearch&&this.options.search?.strict){let e={};h.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,q(t.options.validateSearch,{...e,..._}))}catch{}}),_=e}_=He({search:_,dest:t,destRoutes:h,_includeValidateSearch:e._includeValidateSearch}),_=m(s,_);let v=this.options.stringifySearch(_),y=t.hash===!0?n.hash:t.hash?o(t.hash,n.hash):void 0,x=y?`#${y}`:``,w=t.state===!0?n.state:t.state?o(t.state,n.state):{};w=O(n.state,w);let E=`${g}${v}${x}`,D,k,A=!1;if(this.rewrite){let e=new URL(E,this.origin),t=Ee(this.rewrite,e);D=e.href.replace(e.origin,``),t.origin===this.origin?k=t.pathname+t.search+t.hash:(k=t.href,A=!0)}else D=b(E),k=D;return{publicHref:k,href:D,pathname:g,search:_,searchStr:v,state:w,hash:y??``,external:A,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let s=c(i.pathname,this.processedTree);if(s){Object.assign(n,s.rawParams);let{from:i,params:c,...l}=s.route,u=c===!1||c===null?Object.create(null):(c??!0)===!0?n:Object.assign(n,o(c,n));r={from:e.from,...l,params:u},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=h(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=S(this.latestLocation.href)===S(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=u(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=U(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=z(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(f(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,i,a,o,s=this.stores.resolvedLocation.get()??this.stores.location.get();for(o=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad(),t?Le.set(this.latestLocation,t):Le.delete(this.latestLocation);let n=this.latestLocation,r=G(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await xe({router:this,sync:e?.sync,forceStaleReload:s.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){r(e)?(i=e,this.navigate({...i.options,replace:!0,ignoreBlocker:!0})):n(e)&&(a=e);let t=i?i.status:a?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(i)})}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),c()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let c;this.hasNotFoundMatch()?c=404:this.stores.matches.get().some(e=>e.status===`error`)&&(c=500),c!==void 0&&this.stores.statusCode.set(c)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(G(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&f(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=L,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),i=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),a=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),o=new Set([...a,...this.stores.cachedIds.get()]),s=i.filter(e=>!o.has(e.id));if(s.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...s])}try{return i=await xe({router:this,matches:i,location:t,preload:!0,updateMatch:(e,t)=>{a.has(e)?i=i.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),i}catch(e){if(r(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});n(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=D(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!h(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?h(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??oe,parseSearch:e.parseSearch??ae,protocolAllowlist:e.protocolAllowlist??_}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=l(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let i=this.getMatchedRoutes(e.pathname),{foundRoute:a,routeParams:o}=i,{matchedRoutes:s}=i,c=!1;(a?a.path!==`/`&&o[`**`]:S(e.pathname))&&(this.options.notFoundRoute?s=[...s,this.options.notFoundRoute]:c=!0);let l=c?We(this.options.notFoundMode,s):void 0,d=Array(s.length),f=new Map;for(let e of this.stores.matchStores.values())e.routeId&&f.set(e.routeId,e.get());for(let i=0;i<s.length;i++){let a=s[i],c=d[i-1],p,h,g;{let n=c?.search??e.search,r=c?._strictSearch??void 0;try{let e=q(a.options.validateSearch,{...n})??void 0;p={...n,...e},h={...r,...e},g=void 0}catch(e){let r=e;if(e instanceof K||(r=new K(e.message,{cause:e})),t?.throwOnError)throw r;p=n,h={},g=r}}let _=a.options.loaderDeps?.({search:p})??``,v=_?JSON.stringify(_):``,{interpolatedPath:y,usedParams:b}=T({path:a.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),x=a.id+y+v,S=this.getMatch(x),C=f.get(a.id),w=S?._strictParams??b,E;if(!S)try{Ge(a,w)}catch(e){if(E=n(e)||r(e)?e:new ze(e.message,{cause:e}),t?.throwOnError)throw E}Object.assign(o,w);let D=C?`stay`:`enter`,k;if(S)k={...S,cause:D,params:C?.params??o,_strictParams:w,search:m(C?C.search:S.search,p),_strictSearch:h};else{let e=a.options.loader||a.options.beforeLoad||a.lazyFn||Ce(a)?`pending`:`success`;k={id:x,ssr:a.options.ssr,index:i,routeId:a.id,params:C?.params??o,_strictParams:w,pathname:y,updatedAt:Date.now(),search:C?m(C.search,p):p,_strictSearch:h,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:E,__routeContext:void 0,_nonReactive:{loadPromise:u()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:D,loaderDeps:C?O(C.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:a.options.staticData||{},fullPath:a.fullPath}}t?.preload||(k.globalNotFound=l===a.id),k.searchError=g;let A=this.getParentContext(c);k.context={...A,...k.__routeContext,...k.__beforeLoadContext},d[i]=k}for(let t=0;t<d.length;t++){let n=d[t],r=this.looseRoutesById[n.routeId],i=this.getMatch(n.id),a=f.get(n.routeId);if(n.params=a?m(a.params,o):o,!i){let i=d[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:d,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return d}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=d(t),i={...e.search};for(let e of t)try{Object.assign(i,q(e.options.validateSearch,i))}catch{}let a=d(this.stores.matchesId.get()),o=a&&this.stores.matchStores.get(a)?.get(),s=o&&o.routeId===r.id&&o.pathname===e.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let n of t)try{Ge(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},K=class extends Error{},ze=class extends Error{};function Be(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function q(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new K(`Async validation not supported`);if(n.issues)throw new K(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Ve({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=S(e),a,o=v(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function He({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Ue(n)(e,t,r??!1)}function Ue(e){let t,n,r=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&r.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&r.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>t(e),r):r});let i=e.validateSearch;i&&r.push(({search:e,next:t,meta:r})=>{let a=t(e);if(n)try{let e=q(i,a);if(r&&e)for(let t in e)t in a||(r.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let i=(e,n,a)=>{if(e>=r.length){if(!t.search)return{};if(t.search===!0)return n;let e=o(t.search,n);return a&&(a.explicit=e),e}return r[e]({search:n,next:(t,n)=>{if(n){let n=a||{};return{search:i(e+1,t,n),meta:n}}return i(e+1,t,a)},meta:a})};return function(e,r,a){return t=r,n=a,i(0,e)}}function We(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return ne}function Ge(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}function Ke(){try{return sessionStorage}catch{return}}var qe=`tsr-scroll-restoration-v1_3`,Je=Ke();function Ye(){try{return JSON.parse(Je?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Xe(){try{Je?.setItem(qe,JSON.stringify(J))}catch{}}var J=Ye(),Ze=`data-scroll-restoration-id`,Qe=e=>e.state.__TSR_key||e.href;function $e(e){let t=e.getAttribute(Ze);if(t)return`[${Ze}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}function et(e,t){let n=J[(t.getKey||Qe)(e.latestLocation)];if(!n)return;if(t.id)return n[`[${Ze}="${t.id}"]`];let r=t.getElement?.();if(r)return n[r===window?X:$e(r)]}var Y=!1,X=`window`;function tt(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function nt(e){let t=[];for(let n of e){if(n===X)continue;let e=tt(n);e&&t.push(e)}return t}function rt(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Qe,a=new Map,o=(e,t,n)=>{let r=a.get(e)||{};r.scrollX=t,r.scrollY=n,a.set(e,r)},s=e=>{if(!(Y||!r.restoring))if(e.target===document)o(X,scrollX,scrollY);else{let t=e.target;o(t,t.scrollLeft,t.scrollTop)}},c=e=>{if(!r.restoring)return;let t=J[e]||={};for(let[e,n]of a)e===X?t[X]=n:e.isConnected&&(t[$e(e)]=n)};n&&!r.restoration&&(r.restoration=!0,Y=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,s,!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&c(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{c(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Xe()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c;if(a.clear(),s||(r.next=!0),typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let l=i(t.toLocation),u=t.fromLocation&&i(t.fromLocation);if(r.restoring&&u&&u!==l){let e=J[u];if(e){let t=J[l];for(let n in e){if(n===X){if(s)continue}else{let e=tt(n);if(!e||s&&o&&(c??=nt(o),c.includes(e)))continue}t||=J[l]={},t[n]??=e[n]}}}Y=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){let s=Le.get(t.toLocation),u=e&&i&&(s===`PUSH`||s===`REPLACE`),d=r.restoring?J[l]:void 0;if(d)for(let e in d){let{scrollX:t,scrollY:r}=d[e];if(e===X){if(u)continue;scrollTo({top:r,left:t,behavior:n}),a=!0}else{let n=tt(e);n&&(n.scrollLeft=t,n.scrollTop=r)}}if(!a&&!e){let e={top:0,left:0,behavior:n};if(scrollTo(e),o){c??=nt(o);for(let t of c)t.scrollTo(e)}}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Y=!1}}))}var Z=864e5,it={"24h":{period:`24 hours`,durationMs:Z},"7d":{period:`7 days`,durationMs:7*Z},"30d":{period:`30 days`,durationMs:30*Z},"90d":{period:`90 days`,durationMs:90*Z}},Q=Object.keys(it),at=e=>Q[Q.indexOf(e)+1],ot=(e,t)=>({beforeReceivedAtMs:t,sinceMs:Math.max(0,t-it[e].durationMs)}),$=e=>typeof e==`string`&&e.length>0?e:void 0,st=e=>typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:void 0,ct=e=>Q.find(t=>t===e);function lt(e){let t=ut(e.search);return t.query===void 0&&t.installId===void 0?`/installations?eventsBefore=${t.eventsBefore??`new`}&eventsRange=${t.eventsRange??`7d`}&eventsCursor=${t.eventsCursor??`first`}`:e.state.__TSR_key}function ut(e){return{query:typeof e.query==`string`?e.query:void 0,installId:typeof e.installId==`string`?e.installId:void 0,eventsCursor:$(e.eventsCursor),eventsBefore:st(e.eventsBefore),eventsRange:ct(e.eventsRange),searchCursor:$(e.searchCursor),historyCursor:$(e.historyCursor),historyBefore:st(e.historyBefore)}}var dt=te(`/installations`)({beforeLoad:({context:e})=>k(e.queryClient,`insights`),notFoundComponent:ie(()=>re(()=>import(`./installations-DnvxI9Dt.js`),__vite__mapDeps([0,1,2,3,4,5,6])),`notFoundComponent`),component:ie(()=>re(()=>import(`./installations-DMeMuwsW.js`),__vite__mapDeps([7,2,8,3,9,10,11,12,13,4,14,15,16,17,18])),`component`),staticData:{scrollRestorationKey:lt},validateSearch:ut});export{it as a,rt as c,G as d,De as f,ot as i,Re as l,lt as n,at as o,Oe as p,Q as r,et as s,dt as t,Ie as u};
@@ -1 +0,0 @@
1
- import{$n as e,Fn as t,Gr as n,Hr as r,J as i,Pn as a,ar as o,dr as s,er as c,ir as l}from"./sidebar-B45aMqRm.js";import{d as u,l as d,q as f,u as p}from"./console-features-api-yv7rm3DX.js";import{a as m,c as h,i as ee,n as g,o as _,r as v,s as y,t as b}from"./installations-CH2H7JQt.js";import{a as x,c as S,f as C,i as te,l as w,n as ne,o as re,r as ie}from"./preload-helper-BN-UkjOE.js";import{t as ae}from"./arrow-left-BP9D-ta_.js";import{t as T}from"./arrow-up-right-CDP9Tevw.js";import{a as E,f as D,s as O,t as k}from"./field-Bou7shoO.js";import{o as A}from"./useCompositeListItem-CF7vsfcA.js";import{i as j,n as M,r as N,t as P}from"./HashValueDisplay-D880zntR.js";import{t as F}from"./refresh-cw-CVGqvy8Z.js";import{a as I,n as L,o as R,r as z,t as B}from"./card-DzCPSRsh.js";import{a as oe,i as V,n as se,o as H,r as U,t as ce}from"./table-CwLnN6KX.js";import{i as le,n as ue,r as de,t as fe}from"./input-group-DVtWFUUF.js";import{o as W,r as pe,t as me}from"./InsightsPageHeader-9_kx_LL7.js";function he(){h(u(),!0)}function ge(e){return he(),y(u(),e)}var G=n(r(),1);function _e(e){let t=u(),n=(0,G.useRef)(void 0);return p(t.stores.location,r=>{let i=e?.select?e.select(r):r;if(e?.structuralSharing??t.options.defaultStructuralSharing){let e=f(n.current,i);return n.current=e,e}return i})}var ve=o(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),ye=o(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),be=o(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),K=s(),xe={UPDATE_DOWNLOADED:{label:`Downloaded`,description:`Download complete. Waiting for the app to restart and apply it.`,variant:`default`,icon:j},UPDATE_APPLIED:{label:`Update applied`,description:`The app started using the downloaded update.`,variant:`success`,icon:D},RECOVERED:{label:`Recovered`,description:`Recovered from a crashed bundle.`,variant:`warning`,icon:N},UPDATE_FAILED:{label:`Update failed`,description:`An update check, download, or install failed.`,variant:`destructive`,icon:ye},UNCHANGED:{label:`No change`,description:`No download or apply was reported at this point.`,variant:`secondary`,icon:ve}};function Se(){let[e,t]=(0,G.useState)(`UTC`);return(0,G.useEffect)(()=>{t(Intl.DateTimeFormat().resolvedOptions().timeZone)},[]),new Intl.DateTimeFormat(`en`,{timeZone:e,timeZoneName:`shortOffset`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`})}function Ce(e,t){let n=Object.fromEntries(t.formatToParts(new Date(e)).map(({type:e,value:t})=>[e,t])),r=n.timeZoneName===`GMT`?`GMT+0`:n.timeZoneName;return`${n.year}/${n.month}/${n.day} ${n.hour}:${n.minute}:${n.second} ${r}`}function q({value:e,formatter:t,touch:n=!1}){let r=new Date(e),i=Ce(e,t);return(0,K.jsxs)(`details`,{className:`group/time`,children:[(0,K.jsx)(`summary`,{className:`cursor-pointer list-none rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/30 [&::-webkit-details-marker]:hidden ${n?`flex min-h-11 items-center`:``}`,children:(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(`time`,{dateTime:r.toISOString(),className:`whitespace-nowrap`,children:i}),(0,K.jsx)(A,{"aria-hidden":`true`,className:`size-3 text-muted-foreground group-open/time:rotate-180`})]})}),(0,K.jsx)(`p`,{className:`mt-2 text-muted-foreground`,children:r.toISOString().replace(`T`,` `).replace(`Z`,` UTC`)})]})}var we={patch:`A patch delivered it.`,manifest:`Only the changed files were downloaded.`,archive:`The full archive was downloaded.`},Te=e=>{if(e.type===`UPDATE_FAILED`&&e.failure)return C(e.failure);if(e.type===`UPDATE_DOWNLOADED`&&e.delivery){let t=we[e.delivery]??null;return e.patchFallback?`The patch failed. ${t??``}`.trim():t}return e.type===`RECOVERED`&&e.previousProcessExit?`The crashed process exited with ${e.previousProcessExit}.`:null};function J({event:e}){let t=xe[e.type],n=t.icon,r=Te(e);return(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col items-start gap-2`,children:[(0,K.jsxs)(O,{variant:t.variant,className:`gap-1 whitespace-nowrap [&_svg]:size-3`,children:[(0,K.jsx)(n,{"aria-hidden":`true`}),t.label]}),(0,K.jsx)(`p`,{className:`max-w-56 whitespace-normal text-xs text-muted-foreground`,children:e.type===`UPDATE_FAILED`&&r?r:t.description}),e.type!==`UPDATE_FAILED`&&r?(0,K.jsx)(`p`,{className:`max-w-56 whitespace-normal text-xs text-muted-foreground`,children:r}):null]})}function Y({event:e,touch:t=!1}){let n=e.type===`UPDATE_DOWNLOADED`,r=e.type===`UPDATE_FAILED`,i=!r||e.failure?.stage!==`check`,a=n||r||e.type===`UPDATE_APPLIED`||e.type===`RECOVERED`;return(0,K.jsxs)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] items-center gap-x-2 gap-y-2`,children:[e.fromBundleId&&a?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`dt`,{className:`text-muted-foreground`,children:n||r?`Running`:`From`}),(0,K.jsx)(`dd`,{children:(0,K.jsx)(P,{value:e.fromBundleId,buttonClassName:t?`min-h-11 px-3`:void 0})})]}):null,i?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`dt`,{className:`text-muted-foreground`,children:n?`Pending`:r?`Target`:a?`To`:`Current`}),(0,K.jsx)(`dd`,{children:(0,K.jsx)(P,{value:e.toBundleId,buttonClassName:t?`min-h-11 px-3`:void 0})})]}):null]})}function Ee({events:e,formatter:t,renderIdentity:n}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`p`,{className:`px-4 pb-2 text-xs text-muted-foreground sm:px-6`,children:`Time in your browser zone`}),(0,K.jsx)(`ol`,{"aria-label":`Events`,className:`divide-y border-y`,children:e.map(e=>(0,K.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-3 px-4 py-4 sm:px-6`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-1`,children:[(0,K.jsx)(J,{event:e}),(0,K.jsx)(`div`,{className:`text-xs tabular-nums`,children:(0,K.jsx)(q,{value:e.receivedAtMs,formatter:t,touch:!0})})]}),n?.(e),(0,K.jsxs)(`dl`,{className:`flex flex-wrap gap-x-2 gap-y-1 text-sm`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{className:`sr-only`,children:`App`}),(0,K.jsxs)(`dd`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]})]}),(0,K.jsxs)(`div`,{className:`min-w-0 text-muted-foreground`,children:[(0,K.jsx)(`dt`,{className:`sr-only`,children:`Channel`}),(0,K.jsx)(`dd`,{className:`wrap-anywhere`,children:e.channel})]})]}),(0,K.jsx)(`div`,{className:`text-xs`,"aria-label":`Bundle`,children:(0,K.jsx)(Y,{event:e,touch:!0})})]},e.id))})]})}function X({hasPrevious:e,label:t,nextCursor:n,onNext:r,onPrevious:i,pageLength:o,pageNumber:s}){return(0,K.jsxs)(`nav`,{"aria-label":`${t} pagination`,className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,K.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`Page `,s,` · `,o.toLocaleString(),` rows`]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(a,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:!e,onClick:i,size:`sm`,type:`button`,variant:`outline`,children:`Previous`}),(0,K.jsx)(a,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:n===null,onClick:r,size:`sm`,type:`button`,variant:`outline`,children:`Next`})]})]})}var De=e=>v.filter((t,n)=>n===0||m[t].durationMs<=e*864e5);function Oe({event:e,eventsLocation:n,touch:r=!1}){return(0,K.jsxs)(`div`,{className:r?`flex min-w-0 flex-wrap items-center justify-between gap-2`:`flex min-w-0 flex-col items-start gap-2`,children:[(0,K.jsxs)(d,{className:t({className:r?`-ml-2 h-auto min-h-11 min-w-0 flex-1 justify-start gap-2 whitespace-normal text-sm`:`-ml-2 max-w-full justify-start`,size:`sm`,variant:`ghost`}),to:`/installations`,search:{...n,query:e.installId||void 0,installId:e.installId},state:e=>({insightsPagination:{eventsBack:e.insightsPagination?.eventsBack}}),"aria-label":`View history for ${e.userId??`anonymous installation`} (${e.installId})`,children:[(0,K.jsx)(`span`,{className:r?`min-w-0 text-left wrap-anywhere`:`truncate`,children:e.userId??`Anonymous installation`}),(0,K.jsx)(T,{"aria-hidden":`true`,"data-icon":`inline-end`})]}),(0,K.jsx)(P,{value:e.installId,maxLength:13,buttonClassName:r?`min-h-11 px-3`:void 0})]})}function ke({children:t,description:n,error:r,eventsLocation:i,history:o,isFetching:s,isLoading:c,onNext:l,onPrevious:u,onRangeChange:d,onRefresh:f,pageNumber:p,range:h,rawDays:ee=90,title:g=`All events`}){let v=Se(),y=p>1,b=De(ee),x=h===void 0?void 0:_(h),S=x!==void 0&&b.includes(x)?x:void 0,C=S!==void 0&&d?(0,K.jsx)(a,{className:`h-11 px-3 lg:h-8`,onClick:()=>d(S),type:`button`,variant:`outline`,children:`Show the last ${m[S].period}`}):null;return(0,K.jsxs)(B,{className:`@container min-w-0 shadow-sm`,"aria-busy":s,children:[(0,K.jsxs)(I,{className:`gap-4 p-4 sm:p-6`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsx)(R,{children:(0,K.jsx)(`h2`,{children:g})}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[h!==void 0&&d?(0,K.jsx)(pe,{label:`Time range`,onPeriodChange:d,period:h,periods:b.map(e=>({value:e,name:`Last ${m[e].period}`}))}):null,(0,K.jsxs)(a,{className:`h-11 lg:h-8`,disabled:s,onClick:f,size:`lg`,variant:`outline`,children:[(0,K.jsx)(F,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]})]})]}),n?(0,K.jsx)(z,{children:n}):null]}),t]}),(0,K.jsx)(L,{className:`min-w-0 p-0`,children:c?(0,K.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,role:`status`,"aria-label":`Loading events`,children:[(0,K.jsx)(e,{className:`h-12 w-full`}),(0,K.jsx)(e,{className:`h-12 w-full`}),(0,K.jsx)(e,{className:`h-12 w-full`})]}):r?(0,K.jsx)(`div`,{className:`px-6 pb-6`,children:(0,K.jsx)(W,{error:r,fallbackTitle:`Event history unavailable`})}):o?(0,K.jsxs)(K.Fragment,{children:[o.data.length>0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`@[58rem]:hidden`,children:(0,K.jsx)(Ee,{events:o.data,formatter:v,renderIdentity:e=>(0,K.jsx)(Oe,{event:e,eventsLocation:i,touch:!0})})}),(0,K.jsx)(`div`,{className:`hidden @[58rem]:block`,children:(0,K.jsxs)(ce,{className:`min-w-4xl table-fixed`,children:[(0,K.jsx)(oe,{children:(0,K.jsxs)(H,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,K.jsx)(V,{className:`w-64`,children:`Time`}),(0,K.jsx)(V,{className:`w-48`,children:`Event`}),(0,K.jsx)(V,{className:`w-48`,children:`User / installation`}),(0,K.jsx)(V,{className:`w-32`,children:`App`}),(0,K.jsx)(V,{className:`w-52`,children:`Bundle`})]})}),(0,K.jsx)(se,{children:o.data.map(e=>(0,K.jsxs)(H,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,K.jsx)(U,{className:`whitespace-normal text-xs tabular-nums`,children:(0,K.jsx)(q,{value:e.receivedAtMs,formatter:v})}),(0,K.jsx)(U,{children:(0,K.jsx)(J,{event:e})}),(0,K.jsx)(U,{children:(0,K.jsx)(Oe,{event:e,eventsLocation:i})}),(0,K.jsx)(U,{className:`whitespace-normal text-xs`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,K.jsx)(U,{className:`whitespace-normal text-xs`,children:(0,K.jsx)(Y,{event:e})})]},e.id))})]})})]}):(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:y?`No older events in this range.`:h===void 0?g===`All events`?`No events recorded yet`:`No matching reports in this period`:`No events in the last ${m[h].period}.`}),y?null:C]}),h!==void 0&&o.nextCursor===null&&(o.data.length>0||y)?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Start of range reached`}),C]}):null,o.data.length>0||y||o.nextCursor?(0,K.jsx)(X,{hasPrevious:y,label:g,nextCursor:o.nextCursor,onNext:l,onPrevious:u,pageLength:o.data.length,pageNumber:p}):null]}):null})]})}var Ae=e=>e.userId??`—`,je=e=>`lastKnownBundleId`in e?e.lastKnownBundleId:e.type===`UPDATE_DOWNLOADED`||e.type===`UPDATE_FAILED`?e.fromBundleId:e.toBundleId;function Me({error:t,history:n,isLoading:r,onNext:o,onPrevious:s,onRefresh:c,pageNumber:l,retention:u=S,selectedEvent:d,selectedInstallId:f}){let p=Se(),m=d?je(d):void 0,h=d&&`pendingBundleId`in d?d.pendingBundleId:d&&`type`in d&&d.type===`UPDATE_DOWNLOADED`?d.toBundleId:null;return(0,K.jsxs)(B,{className:`@container min-h-0 min-w-0 shadow-sm`,children:[(0,K.jsx)(I,{className:`p-4 sm:p-6`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,K.jsx)(R,{className:`text-sm font-medium`,children:(0,K.jsx)(`h2`,{children:f===void 0?`Select an installation`:`Installation history`})}),f===void 0?null:(0,K.jsxs)(z,{children:[`Bundle changes and update failures are kept for`,` `,w(u.rawDays),`; the latest report, for`,` `,w(u.dailyDays),` after the installation last reports.`]})]}),c&&f!==void 0?(0,K.jsxs)(a,{className:`h-11 lg:h-8`,size:`lg`,variant:`outline`,onClick:c,disabled:r,children:[(0,K.jsx)(F,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]}):null]})}),(0,K.jsxs)(L,{className:`min-h-0 p-0`,children:[f!==void 0&&d?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`section`,{"aria-labelledby":`latest-installation-state`,className:`px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,K.jsx)(`h3`,{className:`sr-only`,id:`latest-installation-state`,children:`Latest reported state`}),(0,K.jsxs)(`dl`,{className:`grid grid-cols-2 gap-4 @[36rem]:grid-cols-3`,children:[(0,K.jsxs)(`div`,{className:`col-span-2 min-w-0 @[36rem]:col-span-1`,children:[(0,K.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`User ID`}),(0,K.jsx)(`dd`,{className:`mt-1 text-sm font-medium wrap-anywhere`,children:Ae(d)})]}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Install ID`}),(0,K.jsx)(`dd`,{className:`mt-1 font-mono text-xs`,children:(0,K.jsx)(P,{value:f,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`})})]}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Last known bundle`}),(0,K.jsx)(`dd`,{className:`mt-1 font-mono text-xs`,children:m?(0,K.jsx)(P,{value:m,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`}):`—`})]}),h?(0,K.jsxs)(`div`,{className:`col-span-2 min-w-0`,children:[(0,K.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Downloaded · Pending apply`}),(0,K.jsx)(`dd`,{className:`mt-1 text-xs`,children:(0,K.jsx)(P,{value:h})})]}):null]})]}),(0,K.jsx)(i,{})]}):null,f===void 0?null:r?(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 p-6`,role:`status`,"aria-label":`Loading installation history`,children:[(0,K.jsx)(e,{className:`h-10 w-full`}),(0,K.jsx)(e,{className:`h-10 w-full`}),(0,K.jsx)(e,{className:`h-10 w-full`})]}):t?(0,K.jsx)(`div`,{className:`p-6`,children:(0,K.jsx)(W,{error:t instanceof Error?t:Error(),fallbackTitle:`Installation history unavailable`})}):n&&n.data.length>0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`@[48rem]:hidden`,children:(0,K.jsx)(Ee,{events:n.data,formatter:p})}),(0,K.jsx)(`div`,{className:`hidden @[48rem]:block`,children:(0,K.jsxs)(ce,{className:`min-w-3xl table-fixed`,children:[(0,K.jsx)(oe,{children:(0,K.jsxs)(H,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,K.jsx)(V,{className:`w-64`,children:`Time`}),(0,K.jsx)(V,{className:`w-48`,children:`Event`}),(0,K.jsx)(V,{className:`w-32`,children:`App`}),(0,K.jsx)(V,{className:`w-52`,children:`Bundle`})]})}),(0,K.jsx)(se,{children:n.data.map(e=>(0,K.jsxs)(H,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,K.jsx)(U,{className:`whitespace-normal text-xs tabular-nums`,children:(0,K.jsx)(q,{value:e.receivedAtMs,formatter:p})}),(0,K.jsx)(U,{children:(0,K.jsx)(J,{event:e})}),(0,K.jsx)(U,{className:`whitespace-normal text-xs`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,K.jsx)(U,{className:`whitespace-normal text-xs`,children:(0,K.jsx)(Y,{event:e})})]},e.id))})]})}),(0,K.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:n.nextCursor,onNext:o,onPrevious:s,pageLength:n.data.length,pageNumber:l})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:l>1?`No older bundle changes.`:`No bundle changes recorded yet.`}),n&&(l>1||n.nextCursor)?(0,K.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:n.nextCursor,onNext:o,onPrevious:s,pageLength:0,pageNumber:l}):null]})]})]})}var Ne=e=>e.lastKnownBundleId,Pe=e=>e.userId??`—`;function Fe({error:e,onNext:n,onPrevious:r,onSelect:i,pageNumber:o,results:s,selectedInstallId:l}){let[u,d]=(0,G.useState)(!1),f=(0,G.useId)(),p=(0,G.useRef)(null),m=!e&&s&&s.data.length>0;return(0,K.jsxs)(B,{className:`min-h-0 min-w-0 shadow-sm`,children:[(0,K.jsx)(I,{className:`p-4 sm:px-6`,children:(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:(0,K.jsx)(R,{className:`text-sm font-medium`,children:(0,K.jsx)(`h2`,{children:`Matching installations`})})}),(0,K.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:m?(0,K.jsx)(a,{"aria-controls":f,"aria-expanded":u,"aria-label":u?`Hide matching installations`:`Show matching installations`,className:`size-11 lg:hidden`,onClick:()=>d(!u),ref:p,size:`icon-lg`,variant:`ghost`,children:(0,K.jsx)(A,{"aria-hidden":`true`,className:c(u&&`rotate-180`)})}):null})]})}),(0,K.jsxs)(L,{className:c(`min-h-0 p-0`,m&&!u&&`hidden lg:block`),id:f,children:[e?(0,K.jsx)(`div`,{className:`p-6`,children:(0,K.jsx)(W,{error:e instanceof Error?e:Error(),fallbackTitle:`Installation search unavailable`})}):s&&s.data.length>0?(0,K.jsx)(`ul`,{"aria-label":`Matching installations`,className:`divide-y`,children:s.data.map(e=>{let t=Ne(e),n=e.installId===l;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{"aria-label":`${Pe(e)}, install ID ${e.installId}`,"aria-pressed":n,className:`group flex w-full min-w-0 flex-col gap-2 border-l-2 border-transparent px-4 py-4 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/30 aria-pressed:border-primary aria-pressed:bg-muted/60 motion-reduce:transition-none sm:px-6`,onClick:()=>{i(e.installId),d(!1),p.current?.focus()},type:`button`,children:[(0,K.jsxs)(`span`,{className:`flex w-full min-w-0 items-center justify-between gap-3`,children:[(0,K.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:Pe(e)}),n?(0,K.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs font-medium text-primary`,children:[(0,K.jsx)(D,{"aria-hidden":`true`,className:`size-3.5`}),(0,K.jsx)(`span`,{className:`sr-only`,children:`Selected`})]}):null]}),(0,K.jsx)(`span`,{className:`flex flex-wrap items-center gap-2`,children:(0,K.jsx)(`span`,{className:`font-mono text-xs`,title:e.installId,children:M(e.installId)})}),(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Bundle`}),t?(0,K.jsx)(`span`,{className:`font-mono text-xs`,title:t,children:M(t)}):(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`—`})]})]})},e.installId)})}):(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 p-4 sm:px-6`,children:[(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No matches`}),(0,K.jsx)(`a`,{className:t({variant:`outline`,className:`h-11 px-3 lg:h-8`}),href:`#installation-history-search`,children:`Edit search`})]}),s&&(s.data.length>0||o>1||s.nextCursor)?(0,K.jsx)(X,{hasPrevious:o>1,label:`Installation results`,nextCursor:s.nextCursor,onNext:n,onPrevious:r,pageLength:s.data.length,pageNumber:o}):null]})]})}function Ie({draftQuery:e,onDraftQueryChange:t,onSubmit:n,onClear:r}){return(0,K.jsx)(`form`,{"aria-label":`Find installation`,onSubmit:t=>{t.preventDefault(),e.trim()&&n()},role:`search`,children:(0,K.jsxs)(k,{className:`gap-2`,children:[(0,K.jsx)(E,{className:`sr-only`,htmlFor:`installation-history-search`,children:`User ID or installation ID`}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(fe,{className:`h-11 w-auto min-w-0 flex-1 basis-44 lg:h-8`,children:[(0,K.jsx)(ue,{children:(0,K.jsx)(be,{"aria-hidden":`true`})}),(0,K.jsx)(le,{autoComplete:`off`,className:`h-11 text-base md:text-base lg:h-8 lg:text-xs`,id:`installation-history-search`,maxLength:1024,name:`installation`,onChange:e=>t(e.target.value),placeholder:`User ID or installation ID`,spellCheck:!1,type:`search`,value:e}),e.length>0?(0,K.jsx)(ue,{align:`inline-end`,children:(0,K.jsx)(de,{"aria-label":`Clear installation lookup`,className:`size-11 lg:size-5`,onClick:r,size:`icon-xs`,children:(0,K.jsx)(l,{"aria-hidden":`true`})})}):null]}),(0,K.jsx)(a,{"aria-label":`Find installation`,className:`h-11 px-3 lg:h-8`,disabled:e.trim().length===0,size:`lg`,type:`submit`,variant:`outline`,children:`Find`})]})]})})}function Le(){return(0,K.jsxs)(`div`,{className:`grid items-stretch gap-6 lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`,children:[(0,K.jsx)(e,{className:`h-64 w-full lg:h-full`}),(0,K.jsx)(e,{className:`h-64 w-full lg:h-full`})]})}var Re=20,ze=50,Z=()=>Date.now(),Q=(e,t)=>[...e,t??``],$=e=>({cursor:e?.at(-1)||void 0,stack:e.slice(0,-1)});function Be(){let e=b.useSearch(),t=b.useNavigate(),n=re(),[r,i]=(0,G.useState)(e.query??``),[o]=(0,G.useState)(Z),[s]=(0,G.useState)(Z),c=_e({select:e=>e.state.insightsPagination}),l=c?.eventsBack??[],u=c?.searchBack??[],d=c?.historyBack??[],f=e.query?.trim()??``,p=f.length>0,m=e.installId!==void 0,h=p||m,_=e.eventsBefore??o,v=e.eventsRange??`7d`,y=e.historyBefore??s,S=(n,r=!1,i={})=>{t({to:`/installations`,search:{...e,...n},state:e=>({...e,insightsPagination:{...e.insightsPagination,...i}}),replace:r})};(0,G.useEffect)(()=>{i(e.query??``)},[e.query]),(0,G.useEffect)(()=>{e.eventsBefore===void 0&&S({eventsBefore:_},!0)},[_,e.eventsBefore]),(0,G.useEffect)(()=>{m&&e.historyBefore===void 0&&S({historyBefore:y},!0)},[m,y,e.historyBefore]);let C=ne({...ee(v,_),cursor:e.eventsCursor,limit:20},!h),T=x({cursor:e.searchCursor,identity:f,limit:Re},p);(0,G.useEffect)(()=>{let e=T.data?.data[0]?.installId;!p||m||e===void 0||S({historyBefore:Z(),historyCursor:void 0,installId:e},!0,{historyBack:[]})},[p,m,T.data?.data]);let E=te(e.installId??``,m),D=ie({beforeReceivedAtMs:y,cursor:e.historyCursor,installId:e.installId??``,limit:ze},m),O=E.data??T.data?.data.find(({installId:t})=>t===e.installId)??D.data?.data[0],k=h?`installation-history-${e.historyCursor??`first`}`:`all-events-${e.eventsCursor??`first`}`,A=(0,G.useRef)(null),j=ge({id:k,getKey:g});(0,G.useLayoutEffect)(()=>{!h&&!C.isLoading&&A.current&&(A.current.scrollTop=j?.scrollY??0)},[C.isLoading,h,j?.scrollY,k]);let M=()=>{i(``),S({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:void 0,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})},N=(0,K.jsx)(Ie,{draftQuery:r,onClear:M,onDraftQueryChange:i,onSubmit:()=>{let e=r.trim();if(!e){M();return}S({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:e,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})}});return(0,K.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,K.jsx)(me,{view:`events`}),(0,K.jsx)(`div`,{ref:A,"data-scroll-restoration-id":k,id:`insights-events-scroll`,className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-col gap-4 sm:gap-6`,children:[h?(0,K.jsx)(B,{className:`shadow-sm`,children:(0,K.jsxs)(L,{className:`flex flex-col gap-3 p-4 sm:p-6`,children:[(0,K.jsxs)(a,{className:`-ml-2 h-11 self-start lg:h-8`,onClick:M,variant:`ghost`,children:[(0,K.jsx)(ae,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Back to all events`]}),N]})}):null,h?T.isLoading&&p?(0,K.jsx)(Le,{}):(0,K.jsxs)(`div`,{className:`grid min-h-0 min-w-0 items-stretch gap-4 sm:gap-6 ${p?`lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`:`lg:grid-cols-1`}`,children:[p?(0,K.jsx)(Fe,{error:T.error,onNext:()=>{T.data?.nextCursor&&S({installId:void 0,searchCursor:T.data.nextCursor},!0,{searchBack:Q(u,e.searchCursor)})},onPrevious:()=>{let e=$(u);S({installId:void 0,searchCursor:e.cursor},!0,{searchBack:e.stack})},onSelect:e=>{S({historyBefore:Z(),historyCursor:void 0,installId:e},!1,{historyBack:[]})},pageNumber:u.length+1,results:T.data,selectedInstallId:e.installId}):null,(0,K.jsx)(Me,{error:D.error??E.error,history:D.data,isLoading:D.isLoading||E.isLoading,onNext:()=>{D.data?.nextCursor&&S({historyCursor:D.data.nextCursor},!0,{historyBack:Q(d,e.historyCursor)})},onPrevious:()=>{let e=$(d);S({historyCursor:e.cursor},!0,{historyBack:e.stack})},onRefresh:()=>{S({historyBefore:Z(),historyCursor:void 0},!0,{historyBack:[]})},pageNumber:d.length+1,retention:n,selectedEvent:O,selectedInstallId:e.installId})]}):(0,K.jsx)(ke,{description:`Downloads, applies, recoveries, and update failures, newest first, kept for ${w(n.rawDays)}. A launch without an update counts in App usage and in its installation's latest report.`,error:C.error,eventsLocation:{eventsBefore:_,eventsCursor:e.eventsCursor,eventsRange:e.eventsRange},history:C.data,isFetching:C.isFetching,isLoading:C.isLoading,onNext:()=>{C.data?.nextCursor&&S({eventsCursor:C.data.nextCursor},!0,{eventsBack:Q(l,e.eventsCursor)})},onPrevious:()=>{let e=$(l);S({eventsCursor:e.cursor},!0,{eventsBack:e.stack})},onRangeChange:e=>{S({eventsBefore:Z(),eventsCursor:void 0,eventsRange:e},!1,{eventsBack:[]})},onRefresh:()=>{S({eventsBefore:Z(),eventsCursor:void 0},!0,{eventsBack:[]})},pageNumber:l.length+1,range:v,rawDays:n.rawDays,children:N})]})},k)]})}export{Be as component};
@@ -1 +0,0 @@
1
- import{t as e}from"./ConsoleFeatureUnavailable-B9VYGA3N.js";var t=e;export{t as notFoundComponent};
@@ -1 +0,0 @@
1
- import{gr as e,mr as t,pr as n}from"./sidebar-B45aMqRm.js";var r=class extends n{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||i(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let n=()=>{this.#i({type:`continue`})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=t({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let i=this.state.status===`pending`,a=!this.#r.canStart();try{if(i)n();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let t=await this.#r.start();return await this.#n.config.onSuccess?.(t,e,this.state.context,this,r),await this.options.onSuccess?.(t,e,this.state.context,r),await this.#n.config.onSettled?.(t,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(t,null,e,this.state.context,r),this.#i({type:`success`,data:t}),t}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(t){this.state=(e=>{switch(t.type){case`failed`:return{...e,failureCount:t.failureCount,failureReason:t.error};case`pause`:return{...e,isPaused:!0};case`continue`:return{...e,isPaused:!1};case`pending`:return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:`pending`,variables:t.variables,submittedAt:Date.now()};case`success`:return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:`error`}}})(this.state),e.batch(()=>{this.#t.forEach(e=>{e.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:`updated`,action:t})})}};function i(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}export{i as n,r as t};
@@ -1 +0,0 @@
1
- import{Gr as e,Hr as t,Pr as n,ar as r,cr as i,dr as a,jr as o,nr as s,rr as c,zr as l}from"./sidebar-B45aMqRm.js";import{T as u,U as d,d as f,h as p,l as m,q as ee,u as te,w as ne,x as h}from"./console-features-api-yv7rm3DX.js";var g=`__root__`,_=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=g:this.parentRoute||l();let r=n?g:t?.path;r&&r!==`/`&&(r=ne(r));let i=t?.id||r,a=n?g:h([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=h([`/`,a]));let o=a===`__root__`?`/`:h([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=u(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>n({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},re=class extends _{constructor(e){super(e)}},v=e(t(),1),y=v.createContext(void 0),ie=v.createContext(void 0),ae={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function b(e){let t=f(),n=v.useContext(e.from?ie:y),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=v.useRef(void 0);return te(i??ae,n=>{if((e.shouldThrow??!0)&&!n&&l(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=ee(a.current,r);return a.current=e,e}return r})}function x(e){return b({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function S(e){let{select:t,...n}=e;return b({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function C(e){return b({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function w(e){return b({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function T(e){let t=f();return v.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function E(e){return b({...e,select:t=>e.select?e.select(t.context):t.context})}var D=a(),O=class extends _{constructor(e){super(e),this.useMatch=e=>b({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>E({...e,from:this.id}),this.useSearch=e=>w({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>C({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>S({...e,from:this.id}),this.useLoaderData=e=>x({...e,from:this.id}),this.useNavigate=()=>T({from:this.fullPath}),this.Link=v.forwardRef((e,t)=>(0,D.jsx)(m,{ref:t,from:this.fullPath,...e}))}};function k(e){return new O(e)}function A(){return e=>M(e)}var j=class extends re{constructor(e){super(e),this.useMatch=e=>b({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>E({...e,from:this.id}),this.useSearch=e=>w({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>C({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>S({...e,from:this.id}),this.useLoaderData=e=>x({...e,from:this.id}),this.useNavigate=()=>T({from:this.fullPath}),this.Link=v.forwardRef((e,t)=>(0,D.jsx)(m,{ref:t,from:this.fullPath,...e}))}};function M(e){return new j(e)}function N(e){return new P(e,{silent:!0}).createRoute}var P=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=k(e);return t.isRoot=!1,t},this.silent=t?.silent}};function F(e,t){let n,r,i,a,o=()=>(n||=e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{if(i=e,d(i)&&i instanceof Error&&typeof window<`u`&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(e)||(sessionStorage.setItem(e,`1`),a=!0)}}),n),s=function(e){if(a)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)if(p)p(o());else throw o();return v.createElement(r,e)};return s.preload=o,s}var I=r(`chart-no-axes-combined`,[[`path`,{d:`M12 16v5`,key:`zza2cw`}],[`path`,{d:`M16 14v7`,key:`1g90b9`}],[`path`,{d:`M20 10v11`,key:`1iqoj0`}],[`path`,{d:`m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15`,key:`1fw8x9`}],[`path`,{d:`M4 18v3`,key:`1yp0dc`}],[`path`,{d:`M8 14v7`,key:`n3cwzv`}]]),L=r(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),R={"24h":{durationMs:864e5,intervalMs:36e5},"7d":{durationMs:7*864e5,intervalMs:6*36e5},"30d":{durationMs:30*864e5,intervalMs:864e5}};function z(e){if(!e||e.platform!==`ios`&&e.platform!==`android`||typeof e.channel!=`string`||!e.channel.trim()||e.channel.length>1024||e.releaseId!==void 0&&(typeof e.releaseId!=`string`||!e.releaseId.trim()||e.releaseId.length>36)||(e.window===void 0?e.releaseId===void 0:!Object.hasOwn(R,e.window)))throw Error(`Choose a platform, channel, and time window.`);return e}var B=({failedUpdates:e,downloads:t})=>e+t===0?null:e/(e+t),V=({patchDownloads:e,patchFallbacks:t})=>e+t===0?null:t/(e+t),H=({failedInstallations:e,activeInstallations:t})=>t===0?null:Math.min(1,e/t),U=e=>e===null?`—`:`${(e*100).toFixed(2)}%`,W={check:`Update check`,download:`Download`,install:`Install`},G={network:`Network`,http:`HTTP error`,invalid_response:`Invalid response`,hash_mismatch:`Hash mismatch`,signature:`Signature`,patch:`Patch`,extract:`Extract`,storage:`Storage`},K=e=>W[e]??`Unknown stage`,q=e=>G[e]??`Unknown reason`,J=e=>[...e.httpStatus==null?[]:[`HTTP ${e.httpStatus}`],...e.originCode==null?[]:[e.originCode],...e.transport==null?[]:[e.transport],...e.resource==null?[]:[e.resource]],oe=e=>[`${K(e.stage)} failed: ${q(e.reason)}`,...J(e)].join(` · `),se=c({method:`GET`}).middleware([s]).handler(o(`0d1dacdd1e5ee6b100e5c142fb9af03602b6f2c6fe6af79312b36c223d7f8f97`)),Y={rawDays:90,dailyDays:400},ce=e=>`${e.toLocaleString(`en`)} ${e===1?`day`:`days`}`,le=({dailyDays:e})=>e>=364;c({method:`GET`}).middleware([s]).handler(o(`ff00311d412c8cdfa8ad5b0ba1eb6aa7471d0cc12170e6cc645deb91603d42dd`));var ue=c({method:`GET`}).middleware([s]).handler(o(`d4c50f40701055145f24873dc90f3c55a5494457a6a03a743339b2ac4545eb19`)),de=c({method:`GET`}).middleware([s]).handler(o(`3c04bc6624be6dfdd80cf96819f9c6d0455e59a7bb4c0374b6afb0162ffd15b0`)),fe=c({method:`GET`}).middleware([s]).handler(o(`6726f1ed9eda1f0cb4c1f1ad1023faee435ddcfd0b7c55ef08ca7f2f7f577370`)),pe=c({method:`GET`}).middleware([s]).handler(o(`c6f18db42ac40385dbff247095197ee9f3fd3a97dc914efd368ce0ded1f098c6`)),me=c({method:`GET`}).middleware([s]).handler(o(`735c501f6d5ea81a445ff2b6b2ea6a1b589e3c6f63a465a881822c80ae71e7d1`)),X=3e4,Z={reportingInstallations:e=>[`insights`,`reporting-installations`,e],events:e=>[`insights`,`events`,e],installations:e=>[`insights`,`installations`,e],installation:e=>[`insights`,`installation`,e],installationEvents:e=>[`insights`,`installation-events`,e]},Q=(e,t)=>i({queryKey:Z.events(e),queryFn:()=>ue({data:e}),enabled:t,refetchOnWindowFocus:!0,staleTime:X}),he=(e,t)=>i({queryKey:Z.installations(e),queryFn:()=>me({data:e}),enabled:t&&e.identity.length>0,staleTime:X}),ge=(e,t)=>i({queryKey:Z.installation(e),queryFn:()=>fe({data:{installId:e}}),enabled:t&&e.length>0,staleTime:X}),_e=(e,t)=>i({queryKey:Z.installationEvents(e),queryFn:()=>de({data:e}),enabled:t&&e.installId.length>0,refetchOnWindowFocus:!0,staleTime:X}),ve=(e,t=!0)=>i({queryKey:[`insights`,`update-failures`,e],queryFn:()=>se({data:z(e)}),enabled:t,refetchOnWindowFocus:!0,staleTime:X}),ye=()=>i({queryKey:[`insights`,`retention`],queryFn:()=>pe(),staleTime:1/0}).data??Y,be=`modulepreload`,xe=function(e){return`/`+e},$={},Se=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=xe(t,n),t in $)return;$[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:be,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{A as C,N as S,g as T,U as _,he as a,I as b,Y as c,H as d,oe as f,K as g,q as h,ge as i,ce as l,B as m,Q as n,ye as o,J as p,_e as r,ve as s,Se as t,le as u,V as v,y as w,F as x,L as y};
@@ -1 +0,0 @@
1
- import{$n as e,A as t,Bn as n,Bt as r,Fn as i,Gn as a,Gr as o,Gt as s,Hn as c,Hr as l,Ht as u,J as d,Jn as f,Kn as p,Kt as m,Ln as h,M as g,N as _,O as v,P as y,Pn as b,R as x,Ur as S,Ut as C,Vn as w,Vt as T,Wt as ee,Xn as te,Y as ne,Zn as re,Zt as ie,_ as ae,_n as oe,an as se,ar as E,at as ce,b as le,cn as ue,dr as de,er as D,g as fe,gn as O,h as k,ir as A,j as pe,ot as j,p as M,qn as me,sr as he,tn as N,un as P,v as F,vn as ge,y as _e,yn as I,z as ve,zn as ye,zt as be}from"./sidebar-B45aMqRm.js";import{l as xe}from"./console-features-api-yv7rm3DX.js";import{a as Se,c as L,d as Ce,f as we,g as R,h as z,i as B,l as Te,m as Ee,n as De,o as Oe,p as ke,r as Ae,s as je,t as Me,u as Ne}from"./api-CtarlV0l.js";import{a as V,c as Pe,d as Fe,f as Ie,i as Le,n as Re,o as ze,r as H,s as U,t as W,u as Be}from"./field-Bou7shoO.js";import{a as Ve,i as He,n as Ue,o as We,r as Ge}from"./useCompositeListItem-CF7vsfcA.js";import{A as Ke,F as qe,I as Je,N as Ye,O as Xe,_ as G,a as Ze,c as Qe,h as $e,i as et,k as tt,l as nt,m as rt,n as it,o as at,s as ot,t as st,u as ct,v as lt}from"./valueToPercent-C-t8FT0y.js";import{i as ut,r as dt,t as ft}from"./HashValueDisplay-D880zntR.js";import{t as pt}from"./loader-circle-Ca7C9YY1.js";import{a as mt,c as ht,i as gt,n as _t,r as vt,s as yt,t as bt}from"./routes-veKtDW39.js";import{a as xt,c as St,d as Ct,f as wt,g as Tt,i as Et,l as Dt,m as Ot,n as kt,o as At,p as jt,r as Mt,s as Nt,t as Pt,u as Ft,v as It}from"./dialog-BDvCy_QO.js";import{a as Lt,n as Rt,o as zt,r as Bt,s as Vt,t as Ht}from"./card-DzCPSRsh.js";import{n as K}from"./dist-Clb6cQ9l.js";import{r as Ut}from"./useOpenInteractionType-AnAMWYIY.js";import{a as Wt,i as q,n as Gt,o as Kt,r as J,t as qt}from"./table-CwLnN6KX.js";import{a as Jt,i as Yt,n as Xt,o as Zt,t as Qt}from"./input-group-DVtWFUUF.js";var $t=E(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),en=E(`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`}]]),tn=E(`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`}]]),nn=E(`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`}]]),rn=E(`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`}]]),an=E(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),on=E(`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`}]]),sn=E(`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`}]]),cn=E(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Y=o(l(),1),X=de();function ln({bundleId:e,className:t}){return(0,X.jsx)(`span`,{translate:`no`,className:D(`break-all font-mono text-xs tabular-nums`,t),children:e})}var un={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 dn({channel:e,className:t}){return(0,X.jsx)(U,{variant:`outline`,className:D(un[e.toLowerCase()]||`bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20`,t),children:e})}function fn({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,X.jsx)(Ie,{className:D(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,X.jsx)(an,{className:D(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,X.jsx)(A,{className:D(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}var pn=e=>{if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return typeof t.baseBundleId==`string`&&typeof t.baseFileHash==`string`&&typeof t.patchFileHash==`string`&&typeof t.patchStorageUri==`string`},mn=e=>Array.isArray(e)?e.filter(pn):[],hn=e=>{let t=mn(e.patches),n=new Set;return t.filter(e=>n.has(e.baseBundleId)?!1:(n.add(e.baseBundleId),!0))},gn=e=>hn(e)[0]??null,_n=e=>gn(e)?.baseBundleId??null,vn=e=>gn(e)?.baseFileHash??null,yn=e=>gn(e)?.patchFileHash??null,Z=1e3,bn=Z,xn=`Invalid cohort. Use 1-1000 or a lowercase slug without spaces, up to 64 characters.`,Sn=/^[a-z0-9-]+$/;function Cn(e){if(!/^\d+$/.test(e))return null;let t=Number.parseInt(e,10);return Number.isNaN(t)||t<1||t>1e3?null:t}function wn(e,t){return(e%t+t)%t}function Tn(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}function En(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let e=n%r;n=r,r=e}return n}function Dn(e,t){let n=0,r=1,i=t,a=wn(e,t);for(;a!==0;){let e=Math.floor(i/a);[n,r]=[r,n-e*r],[i,a]=[a,i-e*a]}if(i>1)throw Error(`No modular inverse for ${e} mod ${t}`);return wn(n,t)}function On(e){let t=wn(Tn(`${e}:multiplier`),997);for(t===0&&(t=1);En(t,Z)!==1;)t=wn(t+1,Z),t===0&&(t=1);let n=wn(Tn(`${e}:offset`),Z);return{multiplier:t,offset:n,inverseMultiplier:Dn(t,Z)}}function kn(e){return e==null?bn:e<=0?0:e>=1e3?Z:Math.floor(e)}function An(e){let t=e.trim().toLowerCase(),n=Cn(t);return n===null?t:String(n)}function jn(e){return Cn(An(e))}function Mn(e){return jn(e)!==null}function Nn(e){let t=An(e);return t.length>0&&t.length<=64&&!/^\d+$/.test(t)&&Sn.test(t)}function Pn(e){let t=An(e);return Mn(t)||Nn(t)}function Fn(e,t){if(t<1||t>1e3)throw Error(`Invalid numeric cohort: ${t}`);let{offset:n,inverseMultiplier:r}=On(e);return wn(r*(t-1-n),Z)}var In=/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,Ln=e=>typeof e==`string`&&In.test(e),Rn=e=>{if(!Ln(e))throw TypeError(`Expected a canonical lowercase UUIDv7`);let t=e.split(`-`).join(``).slice(0,12);return Number.parseInt(t,16)},zn=S(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof ee||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new ee(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var ee=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),te=ee.prototype;return w.prototype=te,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){te[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,ee,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),Bn=S(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e||={};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],p=f.length,m=0;m<p;m+=1){var h=f[m];h.d&&(c=o?n(t).diff(a,h.d,!0):a.diff(t,h.d,!0));var g=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,g<=h.r||!h.r){g<=1&&m>0&&(h=f[m-1]);var _=d[h.l];s&&(g=s(``+g)),l=typeof _==`string`?_.replace(`%d`,g):_(g,r,h.l,u);break}}if(r)return l;var v=u?d.future:d.past;return typeof v==`function`?v(l):v.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))})),Vn=o(zn(),1),Hn=o(Bn(),1);Vn.default.extend(Hn.default);function Un({uuid:e,format:t=`relative`}){let n=(0,Vn.default)(Rn(e));return t===`relative`?(0,X.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.fromNow()}):t===`absolute`?(0,X.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)}):(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(`span`,{className:`text-sm`,children:n.fromNow()}),(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)})]})}function Wn({panelId:t,bundle:n,bundles:r,loading:i,onDetailClick:a}){let o=k();return(0,X.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id:t,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:`Advanced artifact diagnostics`}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 text-sm sm:items-center`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Base artifact ID`}),(0,X.jsx)(ln,{bundleId:n.id,fullOnMobile:!0,maxLength:18})]}),(0,X.jsxs)(U,{variant:`outline`,children:[r.length,` `,r.length===1?`patch`:`patches`]})]}),i?(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(e,{className:`h-10 w-full`}),(0,X.jsx)(e,{className:`h-10 w-full`})]}):r.length>0?(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),o?(0,X.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.map(e=>(0,X.jsx)(`div`,{className:`rounded-md border bg-background p-3`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Target artifact ID`}),(0,X.jsx)(ln,{bundleId:e.id,fullOnMobile:!0,maxLength:18})]}),(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Relation`}),(0,X.jsxs)(`div`,{className:`flex flex-col items-start gap-1 text-sm`,children:[(0,X.jsx)(ln,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,X.jsx)(R,{className:`size-4 rotate-90 text-muted-foreground`}),(0,X.jsx)(ln,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})]}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Artifact`}),(0,X.jsx)(U,{variant:`secondary`,children:`bsdiff`})]}),(0,X.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,X.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Created`}),(0,X.jsx)(`div`,{className:`text-xs tabular-nums text-foreground`,children:(0,X.jsx)(Un,{uuid:e.id})})]})]}),(0,X.jsx)(b,{className:`w-full`,onClick:()=>a(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})]})},e.id))}):(0,X.jsx)(`div`,{className:`overflow-x-auto rounded-md border bg-background`,children:(0,X.jsxs)(qt,{className:`min-w-max`,children:[(0,X.jsx)(Wt,{children:(0,X.jsxs)(Kt,{className:`hover:bg-transparent`,children:[(0,X.jsx)(q,{children:`Target artifact ID`}),(0,X.jsx)(q,{children:`Relation`}),(0,X.jsx)(q,{children:`Artifact`}),(0,X.jsx)(q,{children:`Created`}),(0,X.jsx)(q,{className:`w-24 text-right`,children:`Detail`})]})}),(0,X.jsx)(Gt,{children:r.map(e=>(0,X.jsxs)(Kt,{children:[(0,X.jsx)(J,{children:(0,X.jsx)(ln,{bundleId:e.id,fullOnMobile:!0,maxLength:18})}),(0,X.jsx)(J,{children:(0,X.jsxs)(`div`,{className:`flex min-w-[280px] flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[(0,X.jsx)(ln,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,X.jsx)(R,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,X.jsx)(ln,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,X.jsx)(J,{children:(0,X.jsx)(U,{variant:`secondary`,children:`bsdiff`})}),(0,X.jsx)(J,{className:`tabular-nums`,children:(0,X.jsx)(Un,{uuid:e.id})}),(0,X.jsx)(J,{className:`text-right`,children:(0,X.jsx)(b,{onClick:()=>a(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})})]},e.id))})]})})]}):(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),(0,X.jsx)(`div`,{className:`rounded-md border bg-background p-3 text-sm text-muted-foreground`,children:`No direct patch artifacts.`})]})]})})}function Gn({open:e,onOpenChange:t}){let[n,r]=(0,Y.useState)(``),[i,a]=(0,Y.useState)(null),{data:o=[],isPending:s}=B(),c=Oe(),l=je(),u=n.trim(),d=async e=>{if(e.preventDefault(),!(!u||c.isPending))try{let e=await c.mutateAsync({name:u});r(``),e.inserted?K.success(`Channel ${e.row.name} created`):K.info(`Channel ${e.row.name} already exists`)}catch(e){K.error(`Failed to create channel`),console.error(e)}},f=async()=>{if(!(!i||l.isPending))try{let e=await l.mutateAsync({id:i.id});e.deleted?K.success(`Channel ${i.name} deleted`):e.reason===`not_empty`?K.error(`Channel ${i.name} is still in use and cannot be deleted`):K.error(`Channel ${i.name} no longer exists`),a(null)}catch(e){K.error(`Failed to delete channel`),console.error(e)}};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Pt,{open:e,onOpenChange:t,children:(0,X.jsxs)(kt,{className:`sm:max-w-lg`,children:[(0,X.jsxs)(xt,{children:[(0,X.jsxs)(At,{className:`flex items-center gap-2`,children:[(0,X.jsx)(on,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,X.jsx)(Mt,{children:`Create deployment channels and remove them when no bundle uses them. Empty channels remain available until you delete them.`})]}),(0,X.jsx)(`form`,{onSubmit:d,children:(0,X.jsx)(Le,{className:`gap-2`,children:(0,X.jsxs)(W,{orientation:`horizontal`,children:[(0,X.jsx)(V,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,X.jsx)(ne,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:c.isPending}),(0,X.jsxs)(b,{type:`submit`,disabled:!u||c.isPending,children:[c.isPending?(0,X.jsx)(pt,{"data-icon":`inline-start`,className:`animate-spin`}):(0,X.jsx)(It,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,X.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:s?(0,X.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,X.jsx)(pt,{className:`mr-2 size-3.5 animate-spin`}),`Loading channels`]}):o.length===0?(0,X.jsx)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:`No channels yet`}):(0,X.jsx)(`ul`,{className:`divide-y`,children:o.map(e=>(0,X.jsxs)(`li`,{className:`flex min-h-12 items-center gap-3 px-3 py-2`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`p`,{className:`truncate text-xs font-medium`,children:e.name}),(0,X.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:e.id})]}),(0,X.jsx)(b,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:l.isPending,onClick:()=>a(e),className:`text-muted-foreground hover:text-destructive`,children:(0,X.jsx)(cn,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,X.jsx)(St,{open:i!==null,onOpenChange:e=>{!e&&!l.isPending&&a(null)},children:(0,X.jsxs)(Ct,{children:[(0,X.jsxs)(Ot,{children:[(0,X.jsxs)(Tt,{children:[`Delete `,i?.name,`?`]}),(0,X.jsx)(wt,{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,X.jsxs)(jt,{children:[(0,X.jsx)(Ft,{disabled:l.isPending,children:`Cancel`}),(0,X.jsx)(Dt,{variant:`destructive`,disabled:l.isPending,onClick:e=>{e.preventDefault(),f()},children:l.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var Kn=`[a-zA-Z0-9-]`,qn=String.raw`0|[1-9]\d*`,Jn=String.raw`\d+`,Yn=String.raw`\d*[a-zA-Z-]${Kn}*`,Xn=String.raw`(${qn})\.(${qn})\.(${qn})`,Zn=String.raw`(${Jn})\.(${Jn})\.(${Jn})`,Qn=`(?:${Yn}|${qn})`,$n=`(?:${Yn}|${Jn})`,er=String.raw`(?:-(${Qn}(?:\.${Qn})*))`,tr=String.raw`(?:-?(${$n}(?:\.${$n})*))`,nr=`${Kn}+`,rr=String.raw`(?:\+(${nr}(?:\.${nr})*))`,ir=`v?${Xn}${er}?${rr}?`,ar=String.raw`[v=\s]*${Zn}${tr}?${rr}?`,or=`((?:<|>)?=?)`,sr=String.raw`${qn}|x|X|\*`,cr=String.raw`${Jn}|x|X|\*`,lr=String.raw`[v=\s]*(${sr})(?:\.(${sr})(?:\.(${sr})(?:${er})?${rr}?)?)?`,ur=String.raw`[v=\s]*(${cr})(?:\.(${cr})(?:\.(${cr})(?:${tr})?${rr}?)?)?`,dr=`(?:~>?)`,fr=String.raw`(?:\^)`,pr=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${pr}(?:$|[^\d])`,String.raw`${pr}(?:${er})?(?:${rr})?(?:$|[^\d])`;function mr(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[Kn,250]];for(let[n,r]of t)e=e.split(`${n}*`).join(`${n}{0,${r}}`).split(`${n}+`).join(`${n}{1,${r}}`);return e}function Q(e,t){return new RegExp(mr(e),t)}var hr=Q(`^${ir}$`),gr=Q(`^${ar}$`),_r=/^\d+$/;function vr(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function yr(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?gr:hr);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(_r.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 br=Q(String.raw`^${or}\s*(${ir})$|^$`),xr=Q(String.raw`^${or}\s*(${ar})$|^$`);function Sr(e){return e.version?`${e.operator}${vr(e.version)}`:``}function Cr(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?xr:br);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?yr(r[2],t):null;return{operator:i,options:t,value:a?`${i}${vr(a)}`:``,version:a}}function wr(e){return e.sets.map(e=>e.map(Sr).join(` `)).join(`||`)}var Tr=new RegExp(rr,`g`),Er=Q(rr),Dr=Q(String.raw`^\s*(${lr})\s+-\s+(${lr})\s*$`),Or=Q(String.raw`^\s*(${ur})\s+-\s+(${ur})\s*$`),kr=Q(String.raw`(\s*)${or}\s*(${ar}|${lr})`,`g`),Ar=Q(String.raw`(\s*)${dr}\s+`,`g`),jr=Q(String.raw`(\s*)${fr}\s+`,`g`),Mr=Q(`^${dr}${lr}$`),Nr=Q(`^${dr}${ur}$`),Pr=Q(`^${fr}${lr}$`),Fr=Q(`^${fr}${ur}$`),Ir=Q(String.raw`^${or}\s*${lr}$`),Lr=Q(String.raw`^${or}\s*${ur}$`),Rr=Q(String.raw`(<|>)?=?\s*\*`),zr=/^\s*>=\s*0\.0\.0\s*$/,Br=/^\s*>=\s*0\.0\.0-0\s*$/,Vr=Q(String.raw`^${or}\s*(${ar})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Hr(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function Ur(e,t){let n=t.loose?Nr:Mr,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 Wr(e,t){return e.trim().split(/\s+/).map(e=>Ur(e,t)).join(` `)}function Gr(e,t){let n=t.loose?Fr:Pr,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?t===`0`?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.0${r} <${Number(t)+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${i}-${a} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i}-${a} <${Number(t)+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${i} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${Number(t)+1}.0.0-0`)}function Kr(e,t){return e.trim().split(/\s+/).map(e=>Gr(e,t)).join(` `)}function qr(e,t){let n=t.loose?Lr:Ir;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Hr(String(c),l===void 0?void 0:String(l),u===void 0?void 0:String(u)))return e;let d=$(c),f=d||$(l),p=f||$(u);if(s===`=`&&p&&(s=``),d)return s===`>`||s===`<`?`<0.0.0-0`:`*`;let m=t.includePrerelease?`-0`:``;return s&&p?(f&&(l=0),u=0,s===`>`?(s=`>=`,f?(c=Number(c)+1,l=0):l=Number(l)+1):s===`<=`&&(s=`<`,f?c=Number(c)+1:l=Number(l)+1),s===`<`&&(m=`-0`),`${s}${c}.${l}.${u}${m}`):f?`>=${c}.0.0${m} <${Number(c)+1}.0.0-0`:p?`>=${c}.${l}.0${m} <${c}.${Number(l)+1}.0-0`:n})}function Jr(e,t){return e.split(/\s+/).map(e=>qr(e,t)).join(` `)}function Yr(e,t){let n=t.loose?Or:Dr;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 Xr(e,t){return Jr(Wr(Kr(e.replace(Er,``),t),t),t).trim().replace(Rr,``)}function Zr(e,t){let n=Yr(e.replace(Tr,``),t).replace(kr,`$1$2$3`).replace(Ar,`$1~`).replace(jr,`$1^`).split(` `).map(e=>Xr(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Br:zr,``));t.loose&&(n=n.filter(e=>Vr.test(e)));let r=new Map;for(let e of n.map(e=>Cr(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 Qr(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Zr(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 $r(e,t={}){try{return Qr(e,t)}catch{return null}}function ei(e,t={}){let n=$r(e,t);return n?wr(n)||`*`:null}var ti=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$/,``)},ni=(e,t)=>{if(!e?.trim())return null;let n=ti(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 ri({label:e,value:t}){return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-start sm:justify-between sm:gap-4`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,X.jsx)(`dd`,{className:`min-w-0 text-left text-sm sm:text-right`,children:t})]})}function ii({bundle:e,release:t}){let{data:n,isFetched:r}=Se(),i=e?yn(e):null,a=e?vn(e):null,o=e?.gitCommitHash&&r?ni(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,X.jsxs)(Ht,{children:[(0,X.jsx)(Lt,{className:`p-4 pb-3`,children:(0,X.jsx)(zt,{className:`text-sm font-medium`,children:`Metadata`})}),(0,X.jsx)(Rt,{className:`px-4 pb-4`,children:(0,X.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,X.jsx)(ri,{label:t.strategy===`APP_VERSION`?`Target app version`:`Fingerprint target`,value:(0,X.jsx)(`span`,{className:`break-all font-mono text-xs`,translate:`no`,children:s??`—`})}),e?.gitCommitHash?(0,X.jsx)(ri,{label:`Git commit`,value:(0,X.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,X.jsx)(ft,{className:o?`text-primary`:void 0,maxLength:12,value:e.gitCommitHash}),o?(0,X.jsx)(`a`,{"aria-label":`Open git commit`,className:`shrink-0 text-primary hover:underline`,href:o,rel:`noopener noreferrer`,target:`_blank`,children:(0,X.jsx)(tn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,X.jsx)(ri,{label:`Manifest hash`,value:(0,X.jsx)(ft,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,X.jsx)(ri,{label:`Base hash`,value:(0,X.jsx)(ft,{maxLength:16,value:a})}):null,i?(0,X.jsx)(ri,{label:`Patch hash`,value:(0,X.jsx)(ft,{maxLength:16,value:i})}):null]})})]}):null}var ai=Array.from({length:Z},(e,t)=>t+1);function oi({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=kn(t),i=n??[],a=i.length>0,o=r>0&&r<1e3,s=r===Z,c=k(),l=s?ai:o?ai.filter(t=>Fn(e,t)<r):[],u=(r/10).toFixed(1),d=s?Z:l.length,f=Z-d,p=(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,X.jsx)(Ht,{children:(0,X.jsxs)(Lt,{className:`p-4`,children:[(0,X.jsx)(Bt,{children:`Selected cohorts`}),(0,X.jsx)(zt,{className:`font-mono text-2xl tabular-nums`,children:d})]})}),(0,X.jsx)(Ht,{children:(0,X.jsxs)(Lt,{className:`p-4`,children:[(0,X.jsx)(Bt,{children:`Excluded cohorts`}),(0,X.jsx)(zt,{className:`font-mono text-2xl tabular-nums`,children:f})]})})]}),a?(0,X.jsxs)(Ht,{children:[(0,X.jsxs)(Lt,{className:`p-4 pb-3`,children:[(0,X.jsx)(zt,{className:`text-sm`,children:`Additional cohorts`}),(0,X.jsx)(Bt,{children:`Always included in addition to the percentage rollout.`})]}),(0,X.jsx)(Rt,{className:`p-4 pt-0`,children:(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-lg border bg-muted/20 p-3`,children:i.map(e=>(0,X.jsx)(U,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,X.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,X.jsxs)(Ht,{children:[(0,X.jsx)(Lt,{className:`p-4 pb-3`,children:(0,X.jsx)(zt,{className:`text-sm`,children:`Numeric cohorts`})}),(0,X.jsx)(Rt,{className:`p-4 pt-0`,children:(0,X.jsx)(`div`,{className:`max-h-[50vh] overflow-y-auto overscroll-contain rounded-lg border bg-muted/20 p-3 sm:max-h-[45vh]`,children:l.length>0?(0,X.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:l.map(e=>(0,X.jsx)(U,{className:`justify-center font-mono tabular-nums`,role:`listitem`,variant:`outline`,children:e},e))}):(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No numeric cohorts are included.`})})})]})]});return(0,X.jsxs)(Pt,{children:[(0,X.jsxs)(Nt,{render:(0,X.jsx)(b,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,X.jsx)(Ve,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,X.jsx)(kt,{className:c?`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:c?(0,X.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,X.jsxs)(xt,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,X.jsx)(At,{children:`Rolled out cohorts`}),(0,X.jsxs)(Mt,{children:[u,`% includes `,d,` of`,` `,Z,` numeric cohorts.`,a?` Additional cohorts are always included.`:``]})]}),(0,X.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain px-4 py-4`,children:p}),(0,X.jsx)(Et,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(xt,{children:[(0,X.jsx)(At,{children:`Rolled out cohorts`}),(0,X.jsxs)(Mt,{children:[u,`% includes `,d,` of`,` `,Z,` numeric cohorts.`,a?` Additional cohorts are always included.`:``]})]}),p,(0,X.jsx)(Et,{showCloseButton:!0})]})})]})}function si(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function ci(e,t){return e-t}function li(e,t,n){let r=e.slice();return r[t]=n,r.sort(ci)}function ui(e,t,n,r,i,a){let o=e;return o=G(o,n,r),i&&(o=li(a,t,G(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function di(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 fi={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...qe},pi=Y.createContext(void 0);function mi(){let e=Y.useContext(pi);if(e===void 0)throw Error(a(62));return e}function hi(e){return`key`in e?se:N}function gi(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?si(e,t):!1}var _i=Y.forwardRef(function(e,t){let{"aria-labelledby":n,className:r,defaultValue:i,disabled:a=!1,id:o,format:c,largeStep:l=10,locale:u,render:d,max:p=100,min:g=0,minStepsBetweenValues:_=0,form:v,name:y,onValueChange:b,onValueCommitted:x,orientation:S=`horizontal`,step:w=1,thumbCollisionBehavior:ee=`push`,thumbAlignment:te=`center`,value:ne,style:re,...ie}=e,ae=j(o),se=rt(ae),E=f(b),ce=f(x),{clearErrors:le}=lt(),{state:ue,disabled:de,name:D,setTouched:fe,setDirty:O,validityData:k,shouldValidateOnChange:A,validation:pe}=Ye(),{labelId:M}=tt(),[he,N]=Y.useState(),P=n??$e(M,he),F=de||a,_e=D??y,[I,ve]=He({controlled:ne,default:i??g,name:`Slider`}),ye=Y.useRef(null),be=Y.useRef(null),xe=Y.useRef([]),Se=Y.useRef(null),L=Y.useRef(null),Ce=Y.useRef(-1),we=Y.useRef(null),R=Y.useRef(null),z=Y.useRef(`none`),B=C(c),[Te,Ee]=Y.useState(-1),[De,Oe]=Y.useState(-1),[ke,Ae]=Y.useState(!1),[je,Me]=Y.useState(()=>new Map),[Ne,V]=Y.useState([void 0,void 0]),Pe=f(e=>{Ee(e),e!==-1&&Oe(e)});Ke(be,ae,I),Ut(I,()=>{le(_e),A()?pe.commit(I):pe.commit(I,!0);let e=k.initialValue,t;t=Array.isArray(I)&&Array.isArray(e)?!si(I,e):I!==e,O(t)});let Fe=f(e=>{e&&(be.current=e)}),Ie=Array.isArray(I),Le=Y.useMemo(()=>Ie?I.slice().sort(ci):[G(I,g,p)],[p,g,Ie,I]),Re=f((e,t)=>{if(Number.isNaN(e)||gi(e,I))return;let n=t??s(`none`,void 0,void 0,{activeThumbIndex:-1});z.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:_e}}),n.event=i,R.current=e,E(e,n),!n.isCanceled&&ve(e)}),ze=f((e,t,n)=>{let r=ui(e,t,g,p,Ie,Le);if(di(r,w,_)){let e=hi(n);Re(r,s(e,n.nativeEvent,void 0,{activeThumbIndex:t})),fe(!0),ce(R.current??r,m(e,n.nativeEvent))}});me(()=>{let e=oe(T(ye.current));F&&ge(ye.current,e)&&e.blur()},[F]),F&&Te!==-1&&Pe(-1);let H=Y.useMemo(()=>({...ue,activeThumbIndex:Te,disabled:F,dragging:ke,orientation:S,max:p,min:g,minStepsBetweenValues:_,step:w,values:Le}),[ue,Te,F,ke,p,g,_,S,w,Le]),U=Y.useMemo(()=>({active:Te,controlRef:be,disabled:F,dragging:ke,validation:pe,formatOptionsRef:B,handleInputChange:ze,indicatorPosition:Ne,inset:te!==`center`,labelId:P,rootLabelId:se,largeStep:l,lastUsedThumbIndex:De,lastChangedValueRef:R,lastChangeReasonRef:z,form:v,locale:u,max:p,min:g,minStepsBetweenValues:_,name:_e,onValueCommitted:ce,orientation:S,pressedInputRef:Se,pressedThumbCenterOffsetRef:L,pressedThumbIndexRef:Ce,pressedValuesRef:we,registerFieldControlRef:Fe,renderBeforeHydration:te===`edge`,setActive:Pe,setDragging:Ae,setIndicatorPosition:V,setLabelId:N,setValue:Re,state:H,step:w,thumbCollisionBehavior:ee,thumbMap:je,thumbRefs:xe,values:Le}),[Te,be,P,se,F,ke,pe,B,ze,Ne,l,De,R,z,v,u,p,g,_,_e,ce,S,Se,L,Ce,we,Fe,Pe,Ae,V,N,Re,H,w,ee,te,je,xe,Le]),W=h(`div`,e,{state:H,ref:[t,ye],props:[{"aria-labelledby":P,id:ae,role:`group`},pe.getValidationProps,ie],stateAttributesMapping:fi});return(0,X.jsx)(pi.Provider,{value:U,children:(0,X.jsx)(Ge,{elementsRef:xe,onMapChange:Me,children:W})})});function vi(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function yi(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 bi(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(yi(t),yi(n))))}function xi({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]=G(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]=G(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]=G(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function Si({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=G(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=xi({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=G(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:xi({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=G(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 Ci=2;function wi(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 Ti(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 Ei=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{disabled:o,dragging:c,inset:l,lastChangedValueRef:d,lastChangeReasonRef:p,max:g,min:_,minStepsBetweenValues:v,onValueCommitted:y,orientation:b,pressedInputRef:x,pressedThumbCenterOffsetRef:S,pressedThumbIndexRef:w,pressedValuesRef:ne,registerFieldControlRef:ae,renderBeforeHydration:se,setActive:E,setDragging:le,setValue:ue,state:de,step:D,thumbCollisionBehavior:fe,thumbRefs:O,values:k}=mi(),A=ce(),pe=k.length>1,j=b===`vertical`,M=Y.useRef(null),me=Y.useRef(null),he=f(e=>{e&&me.current==null&&(me.current=te(e).getComputedStyle(e))}),N=Y.useRef(null),F=Y.useRef(0),_e=Y.useRef(0),ve=C(k);function ye(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=M.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=wi(me.current,j),c=_e.current,l=(j?r:n)-s.start-s.end-c*2,u=S.current??0,d=e.x-u,f=e.y-u,p=G(((j?i-f-s.end:(A===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(g-_)*p+_;if(m=bi(m,D,_),m=G(m,_,g),!pe)return{value:m,thumbIndex:0,didSwap:!1};let h=w.current;if(h<0)return null;let y=Si({behavior:fe,values:k,currentValues:ve.current??k,initialValues:ne.current,pressedIndex:h,nextValue:m,min:_,max:g,step:D,minStepsBetweenValues:v});return fe===`swap`&&y.didSwap?ye(y.thumbIndex):w.current=y.thumbIndex,y}function xe(e){ne.current=pe?k.slice():null,ve.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=j?`y`:`x`,r;n=-1;for(let i=0;i<O.current.length;i+=1){let a=O.current[i];if(re(a)){let o=vi(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&ye(n),l){let e=O.current[n];re(e)&&(_e.current=e.getBoundingClientRect()[j?`height`:`width`]/2)}}function Se(e){let t=O.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let L=f(e=>{let t=Ti(e,N);if(t==null)return;if(F.current+=1,e.type===`pointermove`&&e.buttons===0){Ce(e);return}let n=be(t);n!=null&&di(n.value,D,v)&&(!c&&F.current>Ci&&le(!0),ue(n.value,s(ie,e,void 0,{activeThumbIndex:n.thumbIndex})),ve.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&Se(n.thumbIndex))});function Ce(e){E(-1),le(!1),x.current=null,S.current=null;let t=Ti(e,N),n=t==null?null:be(t);if(n!=null){let t=p.current;y(d.current??n.value,m(t,e))}`pointerType`in e&&M.current?.hasPointerCapture(e.pointerId)&&M.current?.releasePointerCapture(e.pointerId),w.current=-1,N.current=null,ne.current=null,R()}let we=f(e=>{if(o)return;let t=e.changedTouches[0];t!=null&&(N.current=t.identifier);let n=Ti(e,N);if(n!=null){xe(n);let t=be(n);if(t==null)return;Se(t.thumbIndex),ue(t.value,s(P,e,void 0,{activeThumbIndex:t.thumbIndex})),ve.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&Se(t.thumbIndex)}F.current=0;let r=T(M.current);r.addEventListener(`touchmove`,L,{passive:!0}),r.addEventListener(`touchend`,Ce,{passive:!0})}),R=f(()=>{let e=T(M.current);e.removeEventListener(`pointermove`,L),e.removeEventListener(`pointerup`,Ce),e.removeEventListener(`touchmove`,L),e.removeEventListener(`touchend`,Ce),ne.current=null}),z=u();return Y.useEffect(()=>{let e=M.current;if(!e)return()=>R();let t=ee(e,`touchstart`,we,{passive:!0});return()=>{t(),z.cancel(),R()}},[R,we,M,z]),Y.useEffect(()=>{o&&R()},[o,R]),h(`div`,e,{state:de,ref:[t,ae,M,he],props:[{"data-base-ui-slider-control":se?``:void 0,onPointerDown(e){let t=M.current,n=I(e.nativeEvent);if(!t||o||e.defaultPrevented||!re(n)||e.button!==0)return;let r=Ti(e,N);if(r!=null){xe(r);let n=be(r);if(n==null)return;ge(O.current[n.thumbIndex],oe(T(t)))?e.preventDefault():z.request(()=>{Se(n.thumbIndex)}),le(!0),S.current??(ue(n.value,s(P,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),ve.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&Se(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),F.current=0;let i=T(M.current);i.addEventListener(`pointermove`,L,{passive:!0}),i.addEventListener(`pointerup`,Ce,{once:!0})}},a],stateAttributesMapping:fi})}),Di=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=mi();return h(`div`,e,{state:o,ref:t,props:[{style:{position:`relative`}},a],stateAttributesMapping:fi})}),Oi=he();function ki(){return n}function Ai(){return!1}function ji(){return!0}function Mi(){return(0,Oi.useSyncExternalStore)(ki,Ai,ji)}var Ni=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}({}),Pi=new Set([..._,ve,x]);function Fi(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${it(e[t],r,n)} start range`:`${it(e[t],r,n)} end range`:n?it(e[t],r,n):void 0}function Ii(e,t,n,r,i){let a=n===1?e+t:e-t;return G(Number(a.toFixed(Math.max(yi(e),yi(t),yi(r)))),r,i)}var Li=Y.forwardRef(function(e,n){let{render:r,children:i,className:a,"aria-describedby":o,"aria-label":s,"aria-labelledby":c,disabled:l=!1,getAriaLabel:u,getAriaValueText:d,id:m,index:b,inputRef:S,onBlur:C,onFocus:T,onKeyDown:ee,tabIndex:ne,style:re,...ie}=e,{nonce:ae}=ct(),oe=j(m),{active:se,lastUsedThumbIndex:E,controlRef:le,disabled:ue,validation:de,formatOptionsRef:D,handleInputChange:fe,inset:k,labelId:A,largeStep:M,locale:he,max:N,min:P,minStepsBetweenValues:F,form:ge,name:_e,orientation:I,pressedInputRef:ye,pressedThumbCenterOffsetRef:xe,pressedThumbIndexRef:Se,renderBeforeHydration:L,setActive:Ce,setIndicatorPosition:we,state:R,step:z,values:B}=mi(),Te=ce(),Ee=l||ue,De=B.length>1,Oe=I===`vertical`,ke=Te===`rtl`,{setTouched:Ae,setFocused:je,validationMode:Me}=Ye(),Ne=Y.useRef(null),V=Y.useRef(null),Pe=Y.useRef(!1),Fe=j(),Ie=Xe(),Le=De?Fe:Ie,{ref:Re,index:ze}=Ue({metadata:Y.useMemo(()=>({inputId:Le}),[Le])}),H=De?b??ze:0,U=H===B.length-1,W=B[H],Be=st(W,P,N),[Ve,He]=Y.useState(),We=Mi(),Ge=E>=0&&E<B.length?E:-1,Ke=f(()=>{let e=le.current,t=Ne.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Oe?`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),H===0?we(e=>[s,e[1]]):U&&we(e=>[e[0],s])});me(()=>{k&&queueMicrotask(Ke)},[Ke,k]),me(()=>{k&&Ke()},[Ke,k,Be]),me(()=>{if(!k)return;let e=le.current,t=Ne.current;if(!e||!t)return;let n=te(e).ResizeObserver;if(typeof n!=`function`)return;let r=new n(Ke);return r.observe(e),r.observe(t),()=>{r.disconnect()}},[le,Ke,k]);let qe=Oe?`bottom`:`insetInlineStart`,Je=Oe?`left`:`top`,G;De?se===H?G=2:Ge===H&&(G=1):se===H&&(G=1);let Ze;Ze=k?{"--position":`${Ve??0}%`,visibility:L&&We||Ve===void 0?`hidden`:void 0,position:`absolute`,[qe]:`var(--position)`,[Je]:`50%`,translate:`${(Oe||!ke?-1:1)*50}% ${(Oe?1:-1)*50}%`,zIndex:G}:Number.isFinite(Be)?{position:`absolute`,[qe]:`${Be}%`,[Je]:`50%`,translate:`${(Oe||!ke?-1:1)*50}% ${(Oe?1:-1)*50}%`,zIndex:G}:be;let Qe;I===`vertical`&&(Qe=ke?`vertical-rl`:`vertical-lr`);let $e=typeof u==`function`?u(H):s,et=p({"aria-label":$e,"aria-labelledby":c??($e==null?A:void 0),"aria-describedby":o,"aria-orientation":I,"aria-valuenow":W,"aria-valuetext":typeof d==`function`?d(it(W,he,D.current??void 0),W,H):Fi(B,H,D.current??void 0,he),disabled:Ee,form:ge,id:Le,max:N,min:P,name:_e,onChange(e){fe(e.currentTarget.valueAsNumber,H,e)},onFocus(e){let t=Pe.current;Pe.current=!1,Ce(H),je(!0),t&&e.stopPropagation()},onBlur(e){if(Pe.current){e.stopPropagation();return}Ne.current&&(Ce(-1),Ae(!0),je(!1),Me===`onBlur`&&de.commit(ui(W,H,P,N,De,B)))},onKeyDown(e){if(!Pi.has(e.key))return;_.has(e.key)&&e.stopPropagation();let n=null,r=bi(W,z,P);switch(e.key){case g:n=Ii(r,e.shiftKey?M:z,1,P,N);break;case pe:n=Ii(r,e.shiftKey?M:z,ke?-1:1,P,N);break;case v:n=Ii(r,e.shiftKey?M:z,-1,P,N);break;case t:n=Ii(r,e.shiftKey?M:z,ke?1:-1,P,N);break;case ve:n=Ii(r,M,1,P,N);break;case x:n=Ii(r,M,-1,P,N);break;case`End`:n=N,De&&(n=Number.isFinite(B[H+1])?B[H+1]-z*F:N);break;case y:n=P,De&&(n=Number.isFinite(B[H-1])?B[H-1]+z*F:P);break;default:break}if(n!==null){let t=e.currentTarget;O(t)||(Pe.current=!0,t.blur(),t.focus({preventScroll:!0,focusVisible:!0})),fe(n,H,e),e.preventDefault()}},step:z,style:{...be,width:`100%`,height:`100%`,writingMode:Qe},tabIndex:ne??void 0,type:`range`,value:W??``},de.getInputValidationProps),tt=w(V,de.inputRef,S);return h(`div`,e,{state:R,ref:[n,Re,Ne],props:[{[Ni.index]:H,children:(0,X.jsxs)(Y.Fragment,{children:[i,(0,X.jsx)(`input`,{ref:tt,...et,suppressHydrationWarning:!0}),k&&We&&L&&U&&(0,X.jsx)(`script`,{nonce:ae,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:oe,onBlur:C,onFocus:T,onPointerDown(e){if(Se.current=H,Ne.current!=null){let t=I===`horizontal`?`x`:`y`,n=vi(Ne.current);xe.current=(I===`horizontal`?e.clientX:e.clientY)-n[t]}V.current!=null&&ye.current!==V.current&&(ye.current=V.current)},style:Ze,suppressHydrationWarning:L||void 0},ie],stateAttributesMapping:fi})});function Ri(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 zi(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 Bi=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{indicatorPosition:o,inset:s,max:c,min:l,orientation:u,renderBeforeHydration:d,state:f,values:p}=mi(),m=Mi(),g=u===`vertical`,_=p.length>1,v=s?Ri(g,_,o[0],o[1],d,m):zi(g,_,st(p[0],l,c),st(p[p.length-1],l,c));return h(`div`,e,{state:f,ref:t,props:[{"data-base-ui-slider-indicator":d?``:void 0,style:v,suppressHydrationWarning:d||void 0},a],stateAttributesMapping:fi})});function Vi({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,X.jsx)(_i,{className:D(`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,X.jsxs)(Ei,{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,X.jsx)(Di,{"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,X.jsx)(Bi,{"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,X.jsx)(Li,{"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 Hi=Y.createContext(void 0);function Ui(){let e=Y.useContext(Hi);if(e===void 0)throw Error(a(63));return e}var Wi=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),Gi={...qe,checked(e){return e?{[Wi.checked]:``}:{[Wi.unchecked]:``}}};function Ki(e,t,n,r=!0,i){let[a,o]=Y.useState(),s=j(i?`${i}-label`:void 0),c=e??t??a;return me(()=>{let i=e||t||!r?void 0:qi(n.current,s);a!==i&&o(i)}),c}function qi(e,t){let n=Ji(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function Ji(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var Yi=Y.forwardRef(function(e,t){let{checked:n,className:i,defaultChecked:a,"aria-labelledby":o,form:l,id:u,inputRef:d,name:f,nativeButton:m=!1,onCheckedChange:g,readOnly:_=!1,required:v=!1,disabled:y=!1,render:b,uncheckedValue:x,value:S,style:C,...T}=e,{clearErrors:ee}=lt(),{state:ne,setTouched:re,setDirty:ie,validityData:ae,setFilled:oe,setFocused:se,shouldValidateOnChange:E,validationMode:ce,disabled:le,name:de,validation:D}=Ye(),{labelId:fe}=tt(),O=le||y,k=de??f,A=Y.useRef(null),pe=w(A,d,D.inputRef),M=Y.useRef(null),he=j(),N=Xe({id:u,implicit:!1,controlRef:M}),P=m?void 0:N,[F,ge]=He({controlled:n,default:!!a,name:`Switch`,state:`checked`});Ke(M,he,F),me(()=>{A.current&&oe(A.current.checked)},[A,oe]),Ut(F,()=>{ee(k),ie(F!==ae.initialValue),oe(F),E()?D.commit(F):D.commit(F,!0)});let{getButtonProps:_e,buttonRef:I}=c({disabled:O,native:m}),ve=Ki(o,fe,A,!m,P),xe={id:m?N:he,role:`switch`,"aria-checked":F,"aria-readonly":_||void 0,"aria-required":v||void 0,"aria-labelledby":ve,onFocus(){O||se(!0)},onBlur(){let e=A.current;!e||O||(re(!0),se(!1),ce===`onBlur`&&D.commit(e.checked))},onClick(e){if(_||O)return;e.preventDefault();let t=A.current;t&&t.dispatchEvent(new(te(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},Se=p({checked:F,disabled:O,form:l,id:P,name:k,required:v,style:k?r:be,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:pe,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(_){e.preventDefault();return}let t=e.currentTarget.checked,n=s(ue,e.nativeEvent);g?.(t,n),!n.isCanceled&&ge(t)},onFocus(){M.current?.focus()}},D.getInputValidationProps,S===void 0?ye:{value:S}),L=Y.useMemo(()=>({...ne,checked:F,disabled:O,readOnly:_,required:v}),[ne,F,O,_,v]),Ce=h(`span`,e,{state:L,ref:[t,M,I],props:[xe,D.getValidationProps,T,_e],stateAttributesMapping:Gi});return(0,X.jsxs)(Hi.Provider,{value:L,children:[Ce,!F&&k&&x!==void 0&&(0,X.jsx)(`input`,{type:`hidden`,form:l,name:k,value:x}),(0,X.jsx)(`input`,{...Se,suppressHydrationWarning:!0})]})}),Xi=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return h(`span`,e,{state:Ui(),ref:t,stateAttributesMapping:Gi,props:a})});function Zi({className:e,...t}){return(0,X.jsx)(Yi,{"data-slot":`switch`,className:D(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...t,children:(0,X.jsx)(Xi,{"data-slot":`switch-thumb`,className:`pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-checked:translate-x-4 data-unchecked:translate-x-0`})})}var Qi=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],$i=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]}),ea=(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}),ta=e=>(e/10).toFixed(1),na=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},ra=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function ia({value:e,onChange:t}){let[n,r]=(0,Y.useState)(ta(e)),[i,a]=(0,Y.useState)(!1);return(0,Y.useEffect)(()=>{i||r(ta(e))},[i,e]),(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(Vi,{"aria-label":`Rollout percentage`,max:1e3,min:0,onValueChange:n=>t(Array.isArray(n)?n[0]??e:n),step:1,value:e}),(0,X.jsxs)(Qt,{className:`w-24 shrink-0`,children:[(0,X.jsx)(Yt,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=ra(n)??e;a(!1),r(ta(i)),t(i)},onChange:e=>{let n=na(e.target.value);r(n);let i=ra(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,X.jsx)(Xt,{align:`inline-end`,children:(0,X.jsx)(Jt,{children:`%`})})]})]})}function aa({channels:t,onOpenChange:n,onShowScope:r,open:i,releaseId:a}){let o=we(a),s=o.data,c=Ae(s?.bundle_id??``),l=c.data,u=l?_n(l):null,f=Ce(s?.scope_key??``),p=Ee(),m=Te(),h=L(),g=Ne(),[_,v]=(0,Y.useState)(null),[y,x]=(0,Y.useState)(``),[S,C]=(0,Y.useState)(``),[w,T]=(0,Y.useState)(!1),[ee,te]=(0,Y.useState)(!1),[re,ie]=(0,Y.useState)(!1),[oe,se]=(0,Y.useState)(``),[E,ce]=(0,Y.useState)(`move`);(0,Y.useEffect)(()=>{v(s?$i(s):null),C(``)},[s]);let ue=s?$i(s):null,de=_!==null&&ue!==null&&JSON.stringify(_)!==JSON.stringify(ue),D=m.isPending||p.isPending||h.isPending||g.isPending,O=()=>{if(!D){if(de){T(!0);return}n(!1)}},k=()=>{if(!_)return;let e=An(y);if(!Pn(e)){C(xn);return}v({..._,targetCohorts:Array.from(new Set([..._.targetCohorts,e]))}),x(``),C(``)},pe=async()=>{if(!s||!_)return;let e=_.targetCohorts.map(An);if(e.some(e=>!Pn(e))){C(xn);return}if(s.strategy===`APP_VERSION`&&!ei(_.targetAppVersion.trim())){C(`Enter a valid target app version range.`);return}let t={expectedRevision:s.revision,patch:ea(s,{..._,targetCohorts:e}),releaseId:s.id};C(``);try{await m.mutateAsync(t),await p.mutateAsync(t),K.success(`Bundle settings saved`),n(!1)}catch(e){C(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},j=t.find(e=>e.id===s?.channel_id)?.name??s?.channel_id,M=t.filter(e=>e.id!==s?.channel_id),me=M.map(e=>({label:e.name,value:e.name})),he=oe.trim(),N=E===`copy`,P=_?ei(_.targetAppVersion.trim()):null,ge=()=>{se(``),ce(`move`)},I=e=>{!e&&g.isPending||(ie(e),e||ge())};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(fe,{onOpenChange:e=>e?void 0:O(),open:i,children:(0,X.jsxs)(ae,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,X.jsxs)(_e,{className:`shrink-0 pr-12`,children:[(0,X.jsx)(le,{children:`Bundle Detail`}),(0,X.jsx)(F,{className:`sr-only`,children:`Edit bundle delivery settings.`}),s?(0,X.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-col gap-3 text-sm`,children:[(0,X.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Je,{className:`size-4`,platform:s.platform}),(0,X.jsx)(`span`,{className:`font-medium`,children:s.platform===`ios`?`iOS`:`Android`})]})}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,X.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`ID`}),(0,X.jsxs)(`span`,{className:`min-w-0 basis-full sm:basis-auto`,children:[(0,X.jsx)(ln,{bundleId:s.id,fullOnMobile:!0,maxLength:18}),s.bundle_id?null:(0,X.jsx)(`span`,{className:`text-xs text-foreground`,children:`Built-in app`})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Channel`}),(0,X.jsx)(`span`,{className:`text-xs text-foreground`,translate:`no`,children:j})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Platform`}),(0,X.jsx)(`span`,{className:`text-xs text-foreground`,children:s.platform===`ios`?`iOS`:`Android`})]})]}):(0,X.jsx)(e,{className:`h-12 w-full`})]}),(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[o.isError?(0,X.jsxs)(Pe,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,X.jsx)(Vt,{}),(0,X.jsx)(Fe,{children:`Bundle details could not be loaded`}),(0,X.jsx)(Be,{children:o.error.message})]}):null,s&&_?(0,X.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[j?(0,X.jsx)(mt,{release:{platform:s.platform,channel:j,releaseId:s.id}}):null,(0,X.jsxs)(`section`,{"aria-labelledby":`delivery-settings-heading`,className:`flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,id:`delivery-settings-heading`,children:`Delivery settings`}),(0,X.jsxs)(Le,{className:`gap-6`,children:[(0,X.jsxs)(W,{children:[(0,X.jsx)(V,{htmlFor:`release-message`,children:`Message`}),(0,X.jsx)(Zt,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>v({..._,message:e.target.value}),rows:3,value:_.message})]}),s.strategy===`APP_VERSION`?(0,X.jsxs)(W,{children:[(0,X.jsx)(V,{htmlFor:`release-target`,children:`Target app version`}),(0,X.jsx)(ne,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>v({..._,targetAppVersion:e.target.value}),value:_.targetAppVersion}),P?(0,X.jsx)(Re,{children:P}):null]}):null,(0,X.jsxs)(W,{children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,X.jsx)(V,{htmlFor:`release-enabled`,children:`Enabled`}),(0,X.jsx)(Zi,{"aria-label":`Enabled`,checked:_.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>v({..._,enabled:e})})]}),(0,X.jsx)(Re,{children:`Disabling rolls devices back to the previous enabled bundle on their next check, or to the built-in app when none remains.`})]}),(0,X.jsxs)(W,{orientation:`horizontal`,children:[(0,X.jsx)(V,{htmlFor:`release-force-update`,children:`Force update`}),(0,X.jsx)(Zi,{"aria-label":`Force update`,checked:_.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>v({..._,shouldForceUpdate:e})})]}),(0,X.jsxs)(W,{children:[(0,X.jsx)(V,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,X.jsx)(ia,{onChange:e=>v({..._,rolloutCohortCount:e}),value:_.rolloutCohortCount})]}),(0,X.jsxs)(W,{children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,X.jsx)(V,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,X.jsx)(oi,{releaseId:s.id,rolloutCohortCount:_.rolloutCohortCount,targetCohorts:_.targetCohorts})]}),(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsx)(ne,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>x(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),k())},placeholder:`e.g. qa-team…`,value:y}),(0,X.jsx)(b,{"aria-label":`Add cohort`,disabled:!y.trim(),onClick:k,size:`icon`,type:`button`,variant:`outline`,children:(0,X.jsx)(It,{})})]}),_.targetCohorts.length?(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:_.targetCohorts.map(e=>(0,X.jsxs)(U,{className:`gap-1 font-mono`,variant:`secondary`,children:[e,(0,X.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,X.jsx)(A,{className:`size-3`})})]},e))}):null,(0,X.jsx)(Re,{children:`Public names—no IDs or secrets.`})]})]}),S?(0,X.jsx)(H,{children:S}):null,(0,X.jsx)(b,{className:`w-full`,disabled:!de||D,onClick:pe,size:`lg`,children:m.isPending||p.isPending?`Saving…`:`Save changes`})]}),(0,X.jsx)(d,{className:`my-2`}),(0,X.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:`Actions`}),(0,X.jsx)(b,{className:`w-full`,disabled:s.kind!==`BUNDLE`||D,onClick:()=>ie(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),s.bundle_id?(0,X.jsxs)(b,{className:`w-full`,disabled:D,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(s.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),K.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,X.jsx)(ut,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,X.jsx)(b,{className:`w-full`,disabled:s.enabled||D,onClick:()=>te(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),s.bundle_id&&c.isPending?(0,X.jsx)(e,{className:`h-40 w-full`}):null,s.bundle_id&&c.isError?(0,X.jsxs)(Pe,{variant:`destructive`,children:[(0,X.jsx)(Vt,{}),(0,X.jsx)(Fe,{children:`Build details are unavailable`}),(0,X.jsx)(Be,{children:`Delivery settings are unaffected.`})]}):null,!s.bundle_id||!c.isPending?(0,X.jsx)(ii,{bundle:l,release:s}):null,(0,X.jsxs)(`details`,{className:`rounded-lg border bg-muted/10 p-4 text-xs`,children:[(0,X.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:`Advanced diagnostics`}),(0,X.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-muted-foreground sm:grid-cols-2`,children:[(0,X.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,X.jsx)(`dt`,{children:`Artifact ID`}),(0,X.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:s.bundle_id??`Built-in app`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Revision`}),(0,X.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:s.revision})]}),u?(0,X.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,X.jsx)(`dt`,{children:`Patch base artifact ID`}),(0,X.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:u})]}):null,(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Catalog generation`}),(0,X.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:f.data?.generation??`—`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Catalog size`}),(0,X.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:f.data?`${f.data.byte_size} bytes`:`—`})]}),(0,X.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,X.jsx)(`dt`,{children:`Scope key`}),(0,X.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:s.scope_key}),r?(0,X.jsx)(b,{className:`mt-1 h-auto px-0 text-xs`,onClick:()=>r(s.scope_key),size:`sm`,variant:`link`,children:`Show bundles for this target`}):null]})]}),f.isError?(0,X.jsx)(`p`,{className:`mt-3 text-destructive`,children:`Diagnostics are unavailable. Bundle settings are unaffected.`}):null]})]}):null]})]})}),(0,X.jsx)(St,{onOpenChange:T,open:w,children:(0,X.jsxs)(Ct,{children:[(0,X.jsxs)(Ot,{children:[(0,X.jsx)(Tt,{children:`Discard unsaved changes?`}),(0,X.jsx)(wt,{children:`Your Bundle changes will be lost.`})]}),(0,X.jsxs)(jt,{children:[(0,X.jsx)(Ft,{children:`Keep editing`}),(0,X.jsx)(Dt,{onClick:()=>{T(!1),n(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,X.jsx)(St,{onOpenChange:te,open:ee,children:(0,X.jsxs)(Ct,{children:[(0,X.jsxs)(Ot,{children:[(0,X.jsxs)(Tt,{children:[`Remove this Bundle from `,j??`the channel`,`?`]}),(0,X.jsx)(wt,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,X.jsxs)(jt,{children:[(0,X.jsx)(Ft,{children:`Cancel`}),(0,X.jsx)(Dt,{onClick:async()=>{if(s)try{await h.mutateAsync({expectedRevision:s.revision,releaseId:s.id}),K.success(`Bundle removed from ${j??`the channel`}`),te(!1),n(!1)}catch(e){C(e instanceof Error?e.message:`Bundle could not be removed from the channel.`)}},variant:`destructive`,children:`Remove from channel`})]})]})}),(0,X.jsx)(Pt,{onOpenChange:I,open:re,children:(0,X.jsxs)(kt,{showCloseButton:!g.isPending,children:[(0,X.jsxs)(xt,{children:[(0,X.jsx)(At,{children:`Promote to Channel`}),(0,X.jsx)(Mt,{children:`Choose how to promote this Bundle, then select the target channel.`})]}),(0,X.jsxs)(`div`,{className:`space-y-4 py-4`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(ze,{htmlFor:`promote-action`,children:`Action`}),(0,X.jsxs)(et,{disabled:g.isPending,items:Qi,onValueChange:e=>ce(e),value:E,children:[(0,X.jsx)(Qe,{className:`w-full`,id:`promote-action`,children:(0,X.jsx)(nt,{placeholder:`Select an action`})}),(0,X.jsx)(Ze,{children:(0,X.jsxs)(at,{children:[(0,X.jsx)(ot,{value:`move`,children:`Move bundle`}),(0,X.jsx)(ot,{value:`copy`,children:`Copy bundle`})]})})]}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:N?`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,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(ze,{htmlFor:`target-channel`,children:`Target Channel`}),(0,X.jsxs)(et,{disabled:g.isPending,items:me,onValueChange:e=>se(e??``),value:oe||null,children:[(0,X.jsx)(Qe,{className:`w-full`,id:`target-channel`,children:(0,X.jsx)(nt,{placeholder:`Select a channel`})}),(0,X.jsx)(Ze,{className:`max-h-64`,children:(0,X.jsx)(at,{children:M.map(e=>(0,X.jsx)(ot,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,X.jsxs)(Et,{children:[(0,X.jsx)(b,{disabled:g.isPending,onClick:()=>I(!1),variant:`outline`,children:`Cancel`}),(0,X.jsx)(b,{disabled:!he||g.isPending,onClick:async()=>{if(s)try{await g.mutateAsync({action:E,expectedRevision:s.revision,releaseId:s.id,targetChannel:he}),I(!1),K.success(N?`Bundle copied to ${he}`:`Bundle moved to ${he}`)}catch(e){K.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:g.isPending?N?`Copying…`:`Moving…`:N?`Copy`:`Move`})]})]})})]})}function oa({release:e}){return(0,X.jsxs)(U,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,X.jsx)(Ie,{className:`size-3`}):(0,X.jsx)(en,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}function sa({percentage:e,className:t}){let n=e<100,r=e.toFixed(1);return(0,X.jsxs)(U,{className:D(`gap-1`,t),variant:n?`secondary`:`default`,children:[n?(0,X.jsx)(Vt,{className:`h-3 w-3`}):null,r,`%`]})}var ca=20,la=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],ua=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}],da=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),fa=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`});function pa({channels:e,onChange:t,onClear:n,onManageChannels:r,search:i}){let a=_t(i),o=i.channelId!==void 0,s=[{label:`All Channels`,value:`all`},...e.map(e=>({label:e.name,value:e.id}))];return(0,X.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,X.jsx)(M,{className:`-ml-1`}),(0,X.jsx)(`h1`,{className:`sr-only`,children:`Bundles`}),(0,X.jsxs)(`div`,{className:`ml-1 flex items-center gap-1.5 text-muted-foreground sm:ml-2`,children:[(0,X.jsx)(rn,{className:`size-3.5`}),(0,X.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,X.jsxs)(et,{items:s,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:i.channelId??`all`,children:[(0,X.jsx)(Qe,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,X.jsx)(nt,{})}),(0,X.jsx)(Ze,{children:(0,X.jsxs)(at,{children:[(0,X.jsx)(ot,{value:`all`,children:`All Channels`}),e.map(e=>(0,X.jsx)(ot,{value:e.id,children:e.name},e.id))]})})]}),(0,X.jsxs)(et,{disabled:!o,items:la,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:i.platform??`ios`,children:[(0,X.jsx)(Qe,{"aria-label":`Platform`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,title:o?void 0:`Choose a channel first`,children:(0,X.jsx)(nt,{})}),(0,X.jsx)(Ze,{children:(0,X.jsxs)(at,{children:[(0,X.jsx)(ot,{value:`ios`,children:`iOS`}),(0,X.jsx)(ot,{value:`android`,children:`Android`})]})})]}),(0,X.jsxs)(et,{disabled:!o&&i.scopeKey===void 0,items:ua,onValueChange:e=>t({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:i.enabled===void 0?`all`:i.enabled?`enabled`:`disabled`,children:[(0,X.jsx)(Qe,{"aria-label":`Status`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,X.jsx)(nt,{})}),(0,X.jsx)(Ze,{children:(0,X.jsxs)(at,{children:[(0,X.jsx)(ot,{value:`all`,children:`Any Status`}),(0,X.jsx)(ot,{value:`enabled`,children:`Enabled`}),(0,X.jsx)(ot,{value:`disabled`,children:`Disabled`})]})})]}),(0,X.jsx)(b,{"aria-label":`Manage channels`,onClick:r,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,X.jsx)(sn,{})}),i.bundleId?(0,X.jsxs)(U,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Artifact filter`,(0,X.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,X.jsx)(A,{className:`size-3`})})]}):null,i.scopeKey?(0,X.jsxs)(U,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Target filter`,(0,X.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,X.jsx)(A,{className:`size-3`})})]}):null,a?(0,X.jsxs)(b,{className:`h-8 px-2 text-xs text-muted-foreground hover:text-foreground sm:ml-auto`,onClick:n,size:`sm`,variant:`ghost`,children:[(0,X.jsx)(A,{"data-icon":`inline-start`}),`Clear`]}):null]})}function ma({expanded:e,onOpen:t,onToggleExpand:n,release:r}){let i=r.operation===`PROMOTE`?`Promoted`:r.operation===`ROLLBACK`?`Rollback`:null;return(0,X.jsxs)(`div`,{className:`flex min-w-[240px] items-center gap-3`,children:[r.bundle_id?(0,X.jsx)(b,{"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,X.jsx)(We,{}):(0,X.jsx)(z,{})}):(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`size-8 shrink-0`}),(0,X.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,X.jsx)(ln,{bundleId:r.id,fullOnMobile:!0}),r.bundle_id?null:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,X.jsx)(dt,{className:`size-3.5`}),` Built-in app`]})]}),i?(0,X.jsx)(U,{className:`shrink-0 font-normal`,variant:`secondary`,children:i}):null,r.currentlyUnreachable?(0,X.jsxs)(`span`,{"aria-label":`Currently unreachable. No catalog segment or cohort selects this bundle first.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No catalog segment or cohort selects this bundle first with the current delivery settings.`,children:[(0,X.jsx)(en,{className:`size-3.5`}),`Unreachable`]}):null]})}function ha({onDetailClick:t,panelId:n,release:r}){let i=r.bundle_id??``,a=Ae(i),o=De(i);return a.isError||o.isError?(0,X.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,X.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:n,children:[(0,X.jsx)(e,{className:`h-10 w-full`}),(0,X.jsx)(e,{className:`h-10 w-full`})]}):a.data?(0,X.jsx)(Wn,{bundle:a.data,bundles:o.data??[],loading:o.isPending,onDetailClick:t,panelId:n}):(0,X.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 ga(){let t=bt.useSearch(),n=bt.useNavigate(),r=k(),[a,o]=(0,Y.useState)(!1),[s,c]=(0,Y.useState)(),l=ke({afterReleaseId:t.afterReleaseId,beforeReleaseId:t.beforeReleaseId,filter:vt(t),limit:ca}),u=B().data??[],d=l.data?.data??[],f=Me(Array.from(new Set(d.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},p=l.data?.next,m=l.data?.previous,h=d.flatMap(e=>{let t=u.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t}]:[]}),g=yt(),_=10+g.length,v=new Map(u.map(e=>[e.id,e.name]));(0,Y.useEffect)(()=>{s&&!d.some(e=>e.id===s)&&c(void 0)},[s,d]);let y=(e,t=!0)=>void n({resetScroll:t,search:e,to:`/`}),x=e=>y(gt(t,e)),S=e=>{let n=d.find(t=>t.bundle_id===e.id);if(c(void 0),n){y({...t,releaseId:n.id},!1);return}x({bundleId:e.id})},C=t.afterReleaseId!==void 0||t.beforeReleaseId!==void 0,w=m?{...t,afterReleaseId:m,beforeReleaseId:void 0,releaseId:void 0}:null,T=p?{...t,afterReleaseId:void 0,beforeReleaseId:p,releaseId:void 0}:null,ee={...t,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0};return(0,X.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,X.jsx)(pa,{channels:u,onChange:x,onClear:()=>y({}),onManageChannels:()=>o(!0),search:t}),(0,X.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:[l.isError?(0,X.jsxs)(Pe,{variant:`destructive`,children:[(0,X.jsx)(Vt,{}),(0,X.jsx)(Fe,{children:`Bundles could not be loaded`}),(0,X.jsx)(Be,{children:l.error.message})]}):(0,X.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,X.jsx)(`div`,{className:`h-full overflow-y-auto`,children:l.isPending?(0,X.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:Array.from({length:5},(t,n)=>(0,X.jsx)(e,{className:`h-44 w-full`},n))}):d.length?d.map(e=>{let n=v.get(e.channel_id)??e.channel_id,r=e.bundle_id?f[e.bundle_id]:0,i=s===e.id,a=`bundle-lineage-panel-${e.id}`;return(0,X.jsxs)(Y.Fragment,{children:[(0,X.jsxs)(`article`,{className:D(`flex flex-col gap-4 border-b p-4 last:border-b-0`,e.currentlyUnreachable&&`bg-muted/35 saturate-50 transition-[background-color,filter] focus-within:saturate-100 motion-reduce:transition-none`,i&&`border-b-0 bg-primary/5`),children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,X.jsx)(ma,{expanded:i,onOpen:()=>y({...t,releaseId:e.id},!1),onToggleExpand:()=>c(i?void 0:e.id),release:e}),(0,X.jsx)(dn,{channel:n,className:`shrink-0`})]}),(0,X.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 text-xs`,children:[(0,X.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Platform`}),(0,X.jsxs)(`dd`,{className:`mt-1 flex items-center gap-2 font-medium`,children:[(0,X.jsx)(Je,{className:`size-4`,platform:e.platform}),e.platform===`ios`?`iOS`:`Android`]})]}),(0,X.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created`}),(0,X.jsx)(`dd`,{className:`mt-1 tabular-nums`,children:da.format(e.created_at_ms)})]}),(0,X.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Rollout`}),(0,X.jsx)(`dd`,{className:`mt-1`,children:(0,X.jsx)(sa,{percentage:e.rollout_cohort_count/10})})]}),(0,X.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Patches`}),(0,X.jsx)(`dd`,{className:`mt-1`,children:r===void 0?`Checking`:r>0?`${r} ${r===1?`patch`:`patches`}`:`—`})]}),g.map(({Cell:t,feature:n,label:r})=>(0,X.jsxs)(`div`,{className:`col-span-2 rounded-md bg-muted/40 p-3`,children:[(0,X.jsx)(`dt`,{className:`mb-2 text-muted-foreground`,children:r}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(t,{releaseId:e.id,releases:h})})]},n)),(0,X.jsxs)(`div`,{className:`col-span-2 flex flex-wrap items-center gap-2 rounded-md bg-muted/40 p-3`,children:[(0,X.jsx)(oa,{release:e}),e.should_force_update?(0,X.jsx)(U,{variant:`secondary`,children:`Force update`}):null]}),(0,X.jsxs)(`div`,{className:`col-span-2 grid gap-2 rounded-md border bg-background/80 p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Target`}),(0,X.jsx)(`dd`,{className:`min-w-0 truncate text-right font-mono`,children:e.target_app_version??e.fingerprint_hash??`—`})]}),(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Message`}),(0,X.jsx)(`dd`,{className:`min-w-0 text-right text-foreground`,children:e.message||`—`})]})]})]})]}),i&&e.bundle_id?(0,X.jsx)(ha,{onDetailClick:S,panelId:a,release:e}):null]},e.id)}):(0,X.jsx)(`p`,{className:`p-8 text-center text-sm text-muted-foreground`,children:C?`No more bundles on this side.`:_t(t)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,X.jsxs)(qt,{className:`min-w-max`,children:[(0,X.jsx)(Wt,{className:`bg-muted/40`,children:(0,X.jsxs)(Kt,{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,X.jsx)(q,{children:`ID`}),(0,X.jsx)(q,{children:`Channel`}),(0,X.jsx)(q,{children:`Platform`}),(0,X.jsx)(q,{children:`Patches`}),(0,X.jsx)(q,{children:`Target`}),(0,X.jsx)(q,{children:`Enabled`}),(0,X.jsx)(q,{children:`Force update`}),(0,X.jsx)(q,{children:`Rollout`}),g.map(({feature:e,label:t})=>(0,X.jsx)(q,{children:t},e)),(0,X.jsx)(q,{children:`Message`}),(0,X.jsx)(q,{children:`Created`})]})}),(0,X.jsxs)(Gt,{children:[l.isPending?Array.from({length:7},(t,n)=>(0,X.jsx)(Kt,{children:(0,X.jsx)(J,{colSpan:_,children:(0,X.jsx)(e,{className:`h-8 w-full`})})},n)):d.map(e=>{let n=s===e.id,r=`bundle-lineage-panel-${e.id}`;return(0,X.jsxs)(Y.Fragment,{children:[(0,X.jsxs)(Kt,{"aria-label":`Open bundle ${e.id}`,className:D(`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:n=>{n.target instanceof Element&&n.target.closest(`button, a, input, select, textarea`)||y({...t,releaseId:e.id},!1)},onKeyDown:n=>{n.target!==n.currentTarget||n.key!==`Enter`&&n.key!==` `||(n.preventDefault(),y({...t,releaseId:e.id},!1))},tabIndex:0,children:[(0,X.jsx)(J,{children:(0,X.jsx)(ma,{expanded:n,onOpen:()=>y({...t,releaseId:e.id},!1),onToggleExpand:()=>c(n?void 0:e.id),release:e})}),(0,X.jsx)(J,{children:(0,X.jsx)(dn,{channel:v.get(e.channel_id)??e.channel_id})}),(0,X.jsx)(J,{className:`whitespace-nowrap`,children:(0,X.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Je,{className:`size-4`,platform:e.platform}),e.platform===`ios`?`iOS`:`Android`]})}),(0,X.jsx)(J,{children:e.bundle_id&&f[e.bundle_id]===void 0?(0,X.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):e.bundle_id&&f[e.bundle_id]>0?(0,X.jsxs)(U,{variant:`secondary`,children:[f[e.bundle_id],` `,f[e.bundle_id]===1?`patch`:`patches`]}):(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,X.jsx)(J,{children:e.target_app_version?(0,X.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(ht,{className:`size-4 shrink-0 text-muted-foreground`}),(0,X.jsx)(`span`,{className:`font-medium`,children:e.target_app_version})]}):e.fingerprint_hash?(0,X.jsxs)(`span`,{className:`flex min-w-[160px] items-center gap-2`,children:[(0,X.jsx)(nn,{className:`size-4 shrink-0 text-muted-foreground`}),(0,X.jsx)(ft,{maxLength:12,value:e.fingerprint_hash})]}):(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,X.jsx)(J,{children:(0,X.jsxs)(`span`,{className:`flex items-center`,children:[(0,X.jsx)(fn,{enabled:e.enabled}),(0,X.jsx)(`span`,{className:`sr-only`,children:e.enabled?`Enabled`:`Disabled`})]})}),(0,X.jsx)(J,{children:(0,X.jsxs)(`span`,{className:`flex items-center`,children:[(0,X.jsx)(fn,{enabled:e.should_force_update,falseIcon:`minus`}),(0,X.jsx)(`span`,{className:`sr-only`,children:e.should_force_update?`Required`:`Optional`})]})}),(0,X.jsx)(J,{children:(0,X.jsx)(sa,{percentage:e.rollout_cohort_count/10})}),g.map(({Cell:t,feature:n})=>(0,X.jsx)(J,{children:(0,X.jsx)(t,{releaseId:e.id,releases:h})},n)),(0,X.jsx)(J,{className:`text-sm text-muted-foreground`,title:e.message??void 0,children:e.message||`-`}),(0,X.jsx)(J,{className:`whitespace-nowrap text-xs text-muted-foreground`,title:da.format(e.created_at_ms),children:fa.format(e.created_at_ms)})]}),n&&e.bundle_id?(0,X.jsx)(Kt,{className:`hover:bg-transparent`,children:(0,X.jsx)(J,{className:`border-t-0 p-0`,colSpan:_,children:(0,X.jsx)(ha,{onDetailClick:S,panelId:r,release:e})})}):null]},e.id)}),!l.isPending&&d.length===0?(0,X.jsx)(Kt,{children:(0,X.jsx)(J,{className:`h-40 text-center text-muted-foreground`,colSpan:_,children:C?`No more bundles on this side.`:_t(t)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):null]})]})}),!l.isError&&!l.isPending?(0,X.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,X.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:[(0,X.jsx)(`span`,{className:`text-foreground`,children:d.length}),` `,d.length===1?`entry`:`entries`,`, newest first`]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 sm:justify-end`,children:[C?(0,X.jsx)(xe,{className:i({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`ghost`}),search:ee,to:`/`,children:`Newest`}):null,w?(0,X.jsxs)(xe,{className:i({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:w,to:`/`,children:[(0,X.jsx)($t,{"data-icon":`inline-start`}),`Previous`]}):(0,X.jsxs)(b,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[(0,X.jsx)($t,{"data-icon":`inline-start`}),`Previous`]}),T?(0,X.jsxs)(xe,{className:i({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:T,to:`/`,children:[`Next`,(0,X.jsx)(z,{"data-icon":`inline-end`})]}):(0,X.jsxs)(b,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[`Next`,(0,X.jsx)(z,{"data-icon":`inline-end`})]})]})]}):null]}),(0,X.jsx)(aa,{channels:u,onOpenChange:e=>!e&&y({...t,releaseId:void 0},!1),onShowScope:e=>x({scopeKey:e}),open:!!t.releaseId,releaseId:t.releaseId??``}),(0,X.jsx)(Gn,{onOpenChange:o,open:a})]})}export{ga as component};