@hot-updater/console 1.0.0-rc.38 → 1.0.0-rc.39

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 (81) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/EventDetails-BUTZTAVo.js +1 -0
  3. package/.output/public/assets/{InsightsInfo-D1TJXkbu.js → InsightsInfo-B8i-PPsH.js} +1 -1
  4. package/.output/public/assets/{index-Do7IxIxX.js → index-YSc3HCcR.js} +2 -2
  5. package/.output/public/assets/{insights-Kvg4qOr4.js → insights-BT0ER2ff.js} +2 -2
  6. package/.output/public/assets/{insights--zAfnUe8.js → insights-DPY9akyx.js} +2 -2
  7. package/.output/public/assets/{insights_.distribution-DvwYKSL9.js → insights_.distribution-NyB0_bbh.js} +2 -2
  8. package/.output/public/assets/{insights_.distribution-DuPsUTYt.js → insights_.distribution-jH_7sKdg.js} +1 -1
  9. package/.output/public/assets/installations-C-QP0sM1.js +1 -0
  10. package/.output/public/assets/{installations-K7RQVwM0.js → installations-yQkxp5fm.js} +2 -2
  11. package/.output/public/assets/routes-DQWmO9Ow.js +2 -0
  12. package/.output/public/assets/{routes-B91Tl8_r.js → routes-DuBSi7uM.js} +1 -1
  13. package/.output/public/assets/styles-Cm2ONGCt.css +2 -0
  14. package/.output/server/{__23tanstack-start-server-fn-resolver-D2DlC98n.mjs → __23tanstack-start-server-fn-resolver-DNbgEvfb.mjs} +36 -36
  15. package/.output/server/_ssr/{ConsoleFeatureUnavailable-BvJHPvTO.mjs → ConsoleFeatureUnavailable-BCGWklf8.mjs} +5 -5
  16. package/.output/server/_ssr/{EventDetails-BdqdvP7j.mjs → EventDetails-vtXoqSGS.mjs} +12 -12
  17. package/.output/server/_ssr/{InsightsInfo-D4SjtR7c.mjs → InsightsInfo-B0AtaDnr.mjs} +2 -3
  18. package/.output/server/_ssr/{InsightsPageHeader-Dg-Cq6Jf.mjs → InsightsPageHeader-BryzBlT8.mjs} +4 -4
  19. package/.output/server/_ssr/{NotFoundPage-DOffKluM.mjs → NotFoundPage-xK1bhpoZ.mjs} +2 -2
  20. package/.output/server/_ssr/{alert-dialog-Du8xkzuD.mjs → alert-dialog-Cc9d0p8Y.mjs} +1 -1
  21. package/.output/server/_ssr/{api-Decvp1W8.mjs → api-Bz1UGqdn.mjs} +3 -3
  22. package/.output/server/_ssr/{api-keys-BiY7F-jF.mjs → api-keys-C2jqeEZ_.mjs} +2 -2
  23. package/.output/server/_ssr/{api-keys-CrUUPwJo.mjs → api-keys-DnKkFZ3T.mjs} +8 -8
  24. package/.output/server/_ssr/{api-keys-rpc-w1DRrFJC.mjs → api-keys-rpc-BJ0MKu1e.mjs} +3 -3
  25. package/.output/server/_ssr/{api-rpc-D6WDEPQe.mjs → api-rpc-B9mAeGyS.mjs} +4 -4
  26. package/.output/server/_ssr/{auth-rpc-B9zrRwAV.mjs → auth-rpc-Bs4tYGIg.mjs} +4 -4
  27. package/.output/server/_ssr/{auth.server-9C1lwD6v.mjs → auth.server-CcTNWmd4.mjs} +2 -2
  28. package/.output/server/_ssr/{card-B1W5pz7e.mjs → card-GK-VihZc.mjs} +1 -1
  29. package/.output/server/_ssr/{config.server-BTWqL8Wu.mjs → config.server-DaeqzKiu.mjs} +3 -3
  30. package/.output/server/_ssr/{console-access-BNNn78dH.mjs → console-access-CSVqeikY.mjs} +2 -2
  31. package/.output/server/_ssr/{console-features-api-DxLlMYo-.mjs → console-features-api-CuukSjL8.mjs} +3 -3
  32. package/.output/server/_ssr/{console-features-rpc-BhpBG3ta.mjs → console-features-rpc-Dxv_D020.mjs} +3 -3
  33. package/.output/server/_ssr/{dialog-9dEOexEP.mjs → dialog-Vjm_bDw9.mjs} +1 -1
  34. package/.output/server/_ssr/{empty-DnRjzUgx.mjs → empty-DeVHKygf.mjs} +2 -2
  35. package/.output/server/_ssr/{field-DagHXRGq.mjs → field-CcbQSAiS.mjs} +2 -2
  36. package/.output/server/_ssr/{input-group-Bj2GzsE2.mjs → input-group-D7oZhqZP.mjs} +1 -1
  37. package/.output/server/_ssr/{insights-BHmN81oc.mjs → insights-C2_kuG7Z.mjs} +2 -2
  38. package/.output/server/_ssr/{insights-DB8_0FVe.mjs → insights-CdkhyQHH.mjs} +5 -5
  39. package/.output/server/_ssr/{insights-Ik6mWQuS.mjs → insights-DFBjq_u1.mjs} +145 -119
  40. package/.output/server/_ssr/{insights-api-DpEr71pS.mjs → insights-api-CBBcHIUP.mjs} +3 -3
  41. package/.output/server/_ssr/{insights-failures-rpc-Dt4sB0wL.mjs → insights-failures-rpc-CTf5QF7O.mjs} +4 -4
  42. package/.output/server/_ssr/{insights-recovery-rpc-C7t2Y320.mjs → insights-recovery-rpc-CPKwBt4V.mjs} +3 -3
  43. package/.output/server/_ssr/{insights-rpc-DR8PTO5q.mjs → insights-rpc-DjhnYd2B.mjs} +3 -3
  44. package/.output/server/_ssr/{insights-usage-rpc-BQVYKfc6.mjs → insights-usage-rpc-CLHRgGDT.mjs} +3 -3
  45. package/.output/server/_ssr/{insights-usage-rpc-COsslYcz.mjs → insights-usage-rpc-CLyldyrz.mjs} +3 -3
  46. package/.output/server/_ssr/{insights_.distribution-C10X8OIZ.mjs → insights_.distribution-Buu3dsat.mjs} +11 -11
  47. package/.output/server/_ssr/{insights_.distribution-CRnqnKSB.mjs → insights_.distribution-DXCwHGBj.mjs} +5 -5
  48. package/.output/server/_ssr/{insights_.distribution-BZx_7Fuo.mjs → insights_.distribution-WDmsXtQl.mjs} +2 -2
  49. package/.output/server/_ssr/{installations-C4ayn5mQ.mjs → installations-BiZY4zjE.mjs} +12 -12
  50. package/.output/server/_ssr/{installations-BfxRnXMz.mjs → installations-Dfe3WTAY.mjs} +2 -2
  51. package/.output/server/_ssr/{installations-DDPzSsM4.mjs → installations-sR2BlZxi.mjs} +4 -4
  52. package/.output/server/_ssr/{release-adoption-RBqFLBpk.mjs → release-adoption-NO2DVJwF.mjs} +8 -8
  53. package/.output/server/_ssr/{release-adoption-rpc-BNhI5B2O.mjs → release-adoption-rpc-DVhlhHRR.mjs} +7 -7
  54. package/.output/server/_ssr/{releaseAdoption-CzeDAkz7.mjs → releaseAdoption-CwFUzIZA.mjs} +13 -6
  55. package/.output/server/_ssr/{router-Cp0V7wgq.mjs → router-HumF5rJs.mjs} +13 -13
  56. package/.output/server/_ssr/{routes--Ok7gExb.mjs → routes-CN0fvuLB.mjs} +9 -9
  57. package/.output/server/_ssr/{routes-Bs4bcThx.mjs → routes-kDK03EWa.mjs} +11 -11
  58. package/.output/server/_ssr/{select-CPqwJtfU.mjs → select-ycdfR07Y.mjs} +1 -1
  59. package/.output/server/_ssr/{server-CPmnhW4G.mjs → server-CyAnx61_.mjs} +3 -3
  60. package/.output/server/_ssr/{sidebar-BSczcwfL.mjs → sidebar-B2SHpuig.mjs} +2 -2
  61. package/.output/server/_ssr/ssr.mjs +1 -1
  62. package/.output/server/_ssr/{table-B6Y2_B90.mjs → table-COXYXU49.mjs} +1 -1
  63. package/.output/server/{_tanstack-start-manifest_v-Do3ixTyo.mjs → _tanstack-start-manifest_v-DcB4oGQp.mjs} +24 -24
  64. package/.output/server/index.mjs +117 -117
  65. package/package.json +7 -7
  66. package/src/components/features/insights/ComparedBundlesChart.tsx +108 -61
  67. package/src/components/features/insights/EventDetails.tsx +6 -7
  68. package/src/components/features/insights/InsightsOverview.tsx +90 -71
  69. package/src/components/features/insights/InstallationHistoryCard.tsx +1 -1
  70. package/src/components/features/insights/ReleaseActivity.tsx +2 -3
  71. package/src/lib/insights-search.ts +0 -6
  72. package/src/lib/insights-view.ts +0 -7
  73. package/src/lib/release-adoption-api.ts +6 -3
  74. package/src/lib/release-adoption.ts +18 -15
  75. package/src/lib/server/releaseAdoption.ts +29 -20
  76. package/src/routes/insights.tsx +0 -9
  77. package/src/routes/installations.tsx +1 -1
  78. package/.output/public/assets/EventDetails-DxKEfM63.js +0 -1
  79. package/.output/public/assets/installations-DMKfJhu2.js +0 -1
  80. package/.output/public/assets/routes-B2VVPV8z.js +0 -2
  81. package/.output/public/assets/styles-C0s3e1IX.css +0 -2
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/insights_.distribution-WTcKITzb.js","assets/ConsoleFeatureUnavailable-BH7LLqAg.js","assets/sidebar-RBvHzq8e.js","assets/console-features-api-BhUIxeL-.js","assets/empty-DtangHOp.js","assets/NotFoundPage-CkgdpWvl.js","assets/insights_.distribution-DuPsUTYt.js","assets/preload-helper-DuV6lz46.js","assets/valueToPercent-Ci2-fmWp.js","assets/useCompositeListItem-BxJspDxS.js","assets/field-bPoDrs6K.js","assets/InsightsPageHeader-CASeYum3.js","assets/card-DKr2pZMA.js","assets/insights-usage-rpc-pz2XQBi3.js","assets/arrow-left-BPK7iqvj.js","assets/InsightsInfo-D1TJXkbu.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./console-features-api-BhUIxeL-.js";import{T as t,t as n,w as r}from"./preload-helper-DuV6lz46.js";import{i}from"./InsightsInfo-D1TJXkbu.js";var a=t(`/insights_/distribution`)({beforeLoad:({context:t})=>e(t.queryClient,`insightsAnalytics`),notFoundComponent:r(()=>n(()=>import(`./insights_.distribution-WTcKITzb.js`),__vite__mapDeps([0,1,2,3,4,5])),`notFoundComponent`),component:r(()=>n(()=>import(`./insights_.distribution-DuPsUTYt.js`),__vite__mapDeps([6,2,7,3,8,9,10,11,12,13,14,4,15])),`component`),validateSearch:i});export{a as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/insights_.distribution-WTcKITzb.js","assets/ConsoleFeatureUnavailable-BH7LLqAg.js","assets/sidebar-RBvHzq8e.js","assets/console-features-api-BhUIxeL-.js","assets/empty-DtangHOp.js","assets/NotFoundPage-CkgdpWvl.js","assets/insights_.distribution-jH_7sKdg.js","assets/preload-helper-DuV6lz46.js","assets/valueToPercent-Ci2-fmWp.js","assets/useCompositeListItem-BxJspDxS.js","assets/field-bPoDrs6K.js","assets/InsightsPageHeader-CASeYum3.js","assets/card-DKr2pZMA.js","assets/insights-usage-rpc-pz2XQBi3.js","assets/arrow-left-BPK7iqvj.js","assets/InsightsInfo-B8i-PPsH.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./console-features-api-BhUIxeL-.js";import{T as t,t as n,w as r}from"./preload-helper-DuV6lz46.js";import{i}from"./InsightsInfo-B8i-PPsH.js";var a=t(`/insights_/distribution`)({beforeLoad:({context:t})=>e(t.queryClient,`insightsAnalytics`),notFoundComponent:r(()=>n(()=>import(`./insights_.distribution-WTcKITzb.js`),__vite__mapDeps([0,1,2,3,4,5])),`notFoundComponent`),component:r(()=>n(()=>import(`./insights_.distribution-jH_7sKdg.js`),__vite__mapDeps([6,2,7,3,8,9,10,11,12,13,14,4,15])),`component`),validateSearch:i});export{a as t};
@@ -1 +1 @@
1
- import{Fn as e,Hr as t,In as n,Nn as r,cr as i}from"./sidebar-RBvHzq8e.js";import{l as a}from"./console-features-api-BhUIxeL-.js";import{d as o,s}from"./preload-helper-DuV6lz46.js";import{t as c}from"./arrow-left-BPK7iqvj.js";import{a as ee,i as te,o as l,r as u,t as d}from"./empty-DtangHOp.js";import{a as f,c as p,d as m,s as h,t as g,u as _}from"./field-bPoDrs6K.js";import{I as v,L as y,a as ne,c as re,i as b,l as x,o as S,s as C}from"./valueToPercent-Ci2-fmWp.js";import{n as w,r as T,t as E}from"./insights-usage-rpc-pz2XQBi3.js";import{a as D,i as O,n as k,o as A,t as j}from"./card-DKr2pZMA.js";import{a as M,t as N}from"./InsightsInfo-D1TJXkbu.js";import{t as P}from"./insights_.distribution-DvwYKSL9.js";import{f as ie,n as F,o as I,t as L}from"./InsightsPageHeader-CASeYum3.js";var R=t(),z=20,B=new Intl.DateTimeFormat(`en`,{month:`short`,day:`numeric`,timeZone:`UTC`}),V=e=>e.releaseId??(e.builtinBundleId?`Built-in app ${e.builtinBundleId}`:`Unknown bundle`);function H({bundleId:e}){return(0,R.jsxs)(`div`,{className:`flex min-h-11 min-w-0 flex-wrap items-center gap-2 md:min-h-9`,children:[(0,R.jsx)(F,{}),(0,R.jsx)(y,{bundleId:e,className:`text-muted-foreground`})]})}function U(){let t=P.useSearch(),y=s(),F=P.useNavigate(),U={platform:t.platform??`all`,channel:t.channel??`production`,appVersion:t.appVersion,window:t.window??`24h`},W=i({queryKey:[`insights`,`app-usage`,U],queryFn:()=>E({data:U}),staleTime:3e4}),G=W.error?void 0:W.data,K=G?`since ${B.format(G.distributionSinceMs)}, 00:00 UTC`:`in this period`,q=(G?.bundleDistribution??[]).filter(e=>!t.version||e.appVersion===t.version),J=q.reduce((e,t)=>e+t.installations,0),Y=Math.max(1,Math.ceil(q.length/z)),X=Math.min(t.page??1,Y),Z=[...new Set([...G?.versions.map(e=>e.name)??[],...t.version?[t.version]:[]])],Q=M(t),$=e=>void F({search:{...t,page:void 0,...e}});return(0,R.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,R.jsx)(L,{view:`distribution`,overviewSearch:Q}),(0,R.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 px-4 py-6 sm:p-8`,children:(0,R.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-6`,children:[(0,R.jsxs)(a,{to:`/insights`,search:Q,className:n({variant:`ghost`,className:`h-11 w-fit sm:h-9`}),children:[(0,R.jsx)(c,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Back to overview`]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[(0,R.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight`,children:`Distribution`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(I,{twelveMonths:o(y),window:U.window,onWindowChange:e=>$({window:e})}),(0,R.jsx)(e,{"aria-label":`Refresh distribution`,variant:`ghost`,size:`icon`,className:`size-11 sm:size-9`,disabled:W.isFetching,onClick:()=>void W.refetch(),children:(0,R.jsx)(T,{"aria-hidden":`true`})})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,R.jsxs)(g,{className:`w-full sm:w-64`,children:[(0,R.jsx)(f,{htmlFor:`distribution-version`,children:`App version`}),(0,R.jsxs)(b,{items:Object.fromEntries([[`all`,`All versions`],...Z.map(e=>[`version:${e}`,e])]),value:t.version?`version:${t.version}`:`all`,onValueChange:e=>{e!==null&&$({version:e===`all`?void 0:e.slice(8)})},children:[(0,R.jsx)(re,{id:`distribution-version`,className:`min-h-11 w-full sm:min-h-9`,children:(0,R.jsx)(x,{})}),(0,R.jsx)(ne,{children:(0,R.jsxs)(S,{children:[(0,R.jsx)(C,{value:`all`,children:`All versions`}),Z.map(e=>(0,R.jsx)(C,{value:`version:${e}`,children:e},e))]})})]})]}),(0,R.jsxs)(`div`,{className:`flex min-h-9 flex-wrap items-center gap-2`,"aria-label":`Distribution scope`,children:[(0,R.jsxs)(h,{variant:`outline`,className:`gap-1.5`,children:[U.platform===`all`?null:(0,R.jsx)(v,{platform:U.platform,className:`size-3.5`}),U.platform===`all`?`All platforms`:U.platform===`ios`?`iOS`:`Android`]}),(0,R.jsx)(h,{variant:`outline`,children:U.channel}),U.appVersion?(0,R.jsxs)(h,{variant:`outline`,children:[`Reports from `,U.appVersion]}):null]})]}),(0,R.jsxs)(j,{"aria-label":`Bundles by app version`,role:`region`,className:`min-w-0`,children:[(0,R.jsxs)(D,{className:`flex flex-col gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(A,{children:`Bundles by app version`}),(0,R.jsxs)(N,{label:`How bundle distribution is counted`,children:[`Each installation counts once, by its latest report`,` `,K,`. Shares are within each app version. Built-in app: the bundle the native build shipped, by its ID. Unknown bundle: no deployment and no built-in bundle ID.`]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[W.isPending?(0,R.jsx)(r,{className:`h-9 w-16`}):(0,R.jsx)(`p`,{className:`text-3xl font-semibold tabular-nums`,children:G?`${G.truncated?`≥`:``}${J.toLocaleString()}`:`—`}),(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Reporting installations`})]})]}),(0,R.jsxs)(k,{className:`flex min-w-0 flex-col gap-4`,children:[G?.truncated?(0,R.jsxs)(p,{children:[(0,R.jsx)(m,{children:`Partial history`}),(0,R.jsxs)(_,{children:[`Counts and shares reflect reports since`,` `,new Date(G.sinceMs).toLocaleString(`en`,{timeZone:`UTC`}),` `,`UTC. Choose a shorter period for a more complete view.`]})]}):null,W.isPending?(0,R.jsx)(r,{"aria-label":`Loading bundle distribution`,className:`h-64`}):W.error?(0,R.jsxs)(`div`,{className:`flex flex-col items-start gap-4`,children:[(0,R.jsx)(ie,{error:W.error,fallbackTitle:`Distribution unavailable`}),(0,R.jsx)(e,{variant:`outline`,onClick:()=>void W.refetch(),children:`Retry distribution`})]}):q.length===0?(0,R.jsxs)(d,{children:[(0,R.jsxs)(te,{children:[(0,R.jsx)(ee,{children:`No bundles reported`}),(0,R.jsx)(u,{children:`Choose another version or period, or change the filters in the overview.`})]}),(0,R.jsx)(e,{variant:`outline`,onClick:()=>$({version:void 0}),children:`Show all versions`})]}):(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsxs)(`div`,{"aria-hidden":`true`,className:`hidden grid-cols-[8rem_minmax(0,1fr)_7rem_7rem] gap-4 border-b px-3 pb-3 text-xs text-muted-foreground md:grid`,children:[(0,R.jsx)(`span`,{children:`App version`}),(0,R.jsx)(`span`,{children:`Bundle ID`}),(0,R.jsx)(`span`,{className:`text-right`,children:`Active installations`}),(0,R.jsx)(`span`,{className:`text-right`,children:`Version share`})]}),(0,R.jsx)(`ul`,{"aria-label":`Bundle distribution`,className:`divide-y`,children:q.slice((X-1)*z,X*z).map(e=>{let t=G?.versions.find(t=>t.name===e.appVersion)?.installations??0,n=t>0?e.installations/t*100:0;return(0,R.jsxs)(`li`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 gap-y-3 px-1 py-4 md:grid-cols-[8rem_minmax(0,1fr)_7rem_7rem] md:px-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`truncate text-sm font-medium`,title:e.appVersion,children:e.appVersion}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(v,{platform:e.platform,className:`size-3.5`}),e.platform===`ios`?`iOS`:`Android`]})]}),(0,R.jsxs)(`div`,{className:`col-span-2 row-start-2 min-w-0 md:col-span-1 md:row-auto`,children:[e.releaseId?(0,R.jsxs)(a,{to:`/`,search:{releaseId:e.releaseId},"aria-label":`Review bundle ${e.releaseId} for app version ${e.appVersion}`,className:`flex min-h-11 min-w-0 items-center gap-2 text-xs underline-offset-4 hover:underline md:min-h-9`,children:[(0,R.jsx)(`span`,{className:`break-all font-mono`,children:e.releaseId}),(0,R.jsx)(l,{"aria-hidden":`true`,className:`size-3.5 shrink-0`})]}):e.builtinBundleId?null:(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Unknown bundle`}),e.builtinBundleId?(0,R.jsx)(H,{bundleId:e.builtinBundleId}):null]}),(0,R.jsxs)(`div`,{className:`col-start-2 row-start-1 text-right md:col-auto md:row-auto`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:e.installations.toLocaleString()}),(0,R.jsx)(`span`,{className:`ml-1 text-xs text-muted-foreground md:sr-only`,children:`active`}),(0,R.jsxs)(`p`,{className:`mt-1 text-xs tabular-nums text-muted-foreground md:hidden`,children:[n.toFixed(1),`% of version`]})]}),(0,R.jsxs)(`div`,{className:`hidden flex-col gap-2 md:flex`,children:[(0,R.jsxs)(`span`,{className:`text-right text-sm tabular-nums`,children:[n.toFixed(1),`%`]}),(0,R.jsx)(w,{"aria-label":`${V(e)} share in ${e.appVersion} on ${e.platform}`,value:n})]})]},JSON.stringify([e.appVersion,e.platform,e.releaseId,e.builtinBundleId]))})})]})]}),G&&q.length>0?(0,R.jsxs)(O,{className:`flex flex-wrap items-center justify-between gap-3 border-t pt-4`,children:[(0,R.jsxs)(`p`,{className:`text-xs tabular-nums text-muted-foreground`,children:[(X-1)*z+1,`–`,Math.min(X*z,q.length),` of `,q.length]}),(0,R.jsxs)(`nav`,{"aria-label":`Distribution pages`,className:`flex gap-2`,children:[(0,R.jsx)(e,{variant:`outline`,className:`h-11 sm:h-9`,disabled:X<=1,onClick:()=>$({page:X-1}),children:`Previous`}),(0,R.jsx)(e,{variant:`outline`,className:`h-11 sm:h-9`,disabled:X>=Y,onClick:()=>$({page:X+1}),children:`Next`})]})]}):null]})]})})]})}export{U as component};
1
+ import{Fn as e,Hr as t,In as n,Nn as r,cr as i}from"./sidebar-RBvHzq8e.js";import{l as a}from"./console-features-api-BhUIxeL-.js";import{d as o,s}from"./preload-helper-DuV6lz46.js";import{t as c}from"./arrow-left-BPK7iqvj.js";import{a as ee,i as te,o as l,r as u,t as d}from"./empty-DtangHOp.js";import{a as f,c as p,d as m,s as h,t as g,u as _}from"./field-bPoDrs6K.js";import{I as v,L as y,a as ne,c as re,i as b,l as x,o as S,s as C}from"./valueToPercent-Ci2-fmWp.js";import{n as w,r as T,t as E}from"./insights-usage-rpc-pz2XQBi3.js";import{a as D,i as O,n as k,o as A,t as j}from"./card-DKr2pZMA.js";import{a as M,t as N}from"./InsightsInfo-B8i-PPsH.js";import{t as P}from"./insights_.distribution-NyB0_bbh.js";import{f as ie,n as F,o as I,t as L}from"./InsightsPageHeader-CASeYum3.js";var R=t(),z=20,B=new Intl.DateTimeFormat(`en`,{month:`short`,day:`numeric`,timeZone:`UTC`}),V=e=>e.releaseId??(e.builtinBundleId?`Built-in app ${e.builtinBundleId}`:`Unknown bundle`);function H({bundleId:e}){return(0,R.jsxs)(`div`,{className:`flex min-h-11 min-w-0 flex-wrap items-center gap-2 md:min-h-9`,children:[(0,R.jsx)(F,{}),(0,R.jsx)(y,{bundleId:e,className:`text-muted-foreground`})]})}function U(){let t=P.useSearch(),y=s(),F=P.useNavigate(),U={platform:t.platform??`all`,channel:t.channel??`production`,appVersion:t.appVersion,window:t.window??`24h`},W=i({queryKey:[`insights`,`app-usage`,U],queryFn:()=>E({data:U}),staleTime:3e4}),G=W.error?void 0:W.data,K=G?`since ${B.format(G.distributionSinceMs)}, 00:00 UTC`:`in this period`,q=(G?.bundleDistribution??[]).filter(e=>!t.version||e.appVersion===t.version),J=q.reduce((e,t)=>e+t.installations,0),Y=Math.max(1,Math.ceil(q.length/z)),X=Math.min(t.page??1,Y),Z=[...new Set([...G?.versions.map(e=>e.name)??[],...t.version?[t.version]:[]])],Q=M(t),$=e=>void F({search:{...t,page:void 0,...e}});return(0,R.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,R.jsx)(L,{view:`distribution`,overviewSearch:Q}),(0,R.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 px-4 py-6 sm:p-8`,children:(0,R.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-6`,children:[(0,R.jsxs)(a,{to:`/insights`,search:Q,className:n({variant:`ghost`,className:`h-11 w-fit sm:h-9`}),children:[(0,R.jsx)(c,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Back to overview`]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[(0,R.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight`,children:`Distribution`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(I,{twelveMonths:o(y),window:U.window,onWindowChange:e=>$({window:e})}),(0,R.jsx)(e,{"aria-label":`Refresh distribution`,variant:`ghost`,size:`icon`,className:`size-11 sm:size-9`,disabled:W.isFetching,onClick:()=>void W.refetch(),children:(0,R.jsx)(T,{"aria-hidden":`true`})})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,R.jsxs)(g,{className:`w-full sm:w-64`,children:[(0,R.jsx)(f,{htmlFor:`distribution-version`,children:`App version`}),(0,R.jsxs)(b,{items:Object.fromEntries([[`all`,`All versions`],...Z.map(e=>[`version:${e}`,e])]),value:t.version?`version:${t.version}`:`all`,onValueChange:e=>{e!==null&&$({version:e===`all`?void 0:e.slice(8)})},children:[(0,R.jsx)(re,{id:`distribution-version`,className:`min-h-11 w-full sm:min-h-9`,children:(0,R.jsx)(x,{})}),(0,R.jsx)(ne,{children:(0,R.jsxs)(S,{children:[(0,R.jsx)(C,{value:`all`,children:`All versions`}),Z.map(e=>(0,R.jsx)(C,{value:`version:${e}`,children:e},e))]})})]})]}),(0,R.jsxs)(`div`,{className:`flex min-h-9 flex-wrap items-center gap-2`,"aria-label":`Distribution scope`,children:[(0,R.jsxs)(h,{variant:`outline`,className:`gap-1.5`,children:[U.platform===`all`?null:(0,R.jsx)(v,{platform:U.platform,className:`size-3.5`}),U.platform===`all`?`All platforms`:U.platform===`ios`?`iOS`:`Android`]}),(0,R.jsx)(h,{variant:`outline`,children:U.channel}),U.appVersion?(0,R.jsxs)(h,{variant:`outline`,children:[`Reports from `,U.appVersion]}):null]})]}),(0,R.jsxs)(j,{"aria-label":`Bundles by app version`,role:`region`,className:`min-w-0`,children:[(0,R.jsxs)(D,{className:`flex flex-col gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(A,{children:`Bundles by app version`}),(0,R.jsxs)(N,{label:`How bundle distribution is counted`,children:[`Each installation counts once, by its latest report`,` `,K,`. Shares are within each app version. Built-in app: the bundle the native build shipped, by its ID. Unknown bundle: no deployment and no built-in bundle ID.`]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[W.isPending?(0,R.jsx)(r,{className:`h-9 w-16`}):(0,R.jsx)(`p`,{className:`text-3xl font-semibold tabular-nums`,children:G?`${G.truncated?`≥`:``}${J.toLocaleString()}`:`—`}),(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Reporting installations`})]})]}),(0,R.jsxs)(k,{className:`flex min-w-0 flex-col gap-4`,children:[G?.truncated?(0,R.jsxs)(p,{children:[(0,R.jsx)(m,{children:`Partial history`}),(0,R.jsxs)(_,{children:[`Counts and shares reflect reports since`,` `,new Date(G.sinceMs).toLocaleString(`en`,{timeZone:`UTC`}),` `,`UTC. Choose a shorter period for a more complete view.`]})]}):null,W.isPending?(0,R.jsx)(r,{"aria-label":`Loading bundle distribution`,className:`h-64`}):W.error?(0,R.jsxs)(`div`,{className:`flex flex-col items-start gap-4`,children:[(0,R.jsx)(ie,{error:W.error,fallbackTitle:`Distribution unavailable`}),(0,R.jsx)(e,{variant:`outline`,onClick:()=>void W.refetch(),children:`Retry distribution`})]}):q.length===0?(0,R.jsxs)(d,{children:[(0,R.jsxs)(te,{children:[(0,R.jsx)(ee,{children:`No bundles reported`}),(0,R.jsx)(u,{children:`Choose another version or period, or change the filters in the overview.`})]}),(0,R.jsx)(e,{variant:`outline`,onClick:()=>$({version:void 0}),children:`Show all versions`})]}):(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsxs)(`div`,{"aria-hidden":`true`,className:`hidden grid-cols-[8rem_minmax(0,1fr)_7rem_7rem] gap-4 border-b px-3 pb-3 text-xs text-muted-foreground md:grid`,children:[(0,R.jsx)(`span`,{children:`App version`}),(0,R.jsx)(`span`,{children:`Bundle ID`}),(0,R.jsx)(`span`,{className:`text-right`,children:`Active installations`}),(0,R.jsx)(`span`,{className:`text-right`,children:`Version share`})]}),(0,R.jsx)(`ul`,{"aria-label":`Bundle distribution`,className:`divide-y`,children:q.slice((X-1)*z,X*z).map(e=>{let t=G?.versions.find(t=>t.name===e.appVersion)?.installations??0,n=t>0?e.installations/t*100:0;return(0,R.jsxs)(`li`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 gap-y-3 px-1 py-4 md:grid-cols-[8rem_minmax(0,1fr)_7rem_7rem] md:px-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`truncate text-sm font-medium`,title:e.appVersion,children:e.appVersion}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(v,{platform:e.platform,className:`size-3.5`}),e.platform===`ios`?`iOS`:`Android`]})]}),(0,R.jsxs)(`div`,{className:`col-span-2 row-start-2 min-w-0 md:col-span-1 md:row-auto`,children:[e.releaseId?(0,R.jsxs)(a,{to:`/`,search:{releaseId:e.releaseId},"aria-label":`Review bundle ${e.releaseId} for app version ${e.appVersion}`,className:`flex min-h-11 min-w-0 items-center gap-2 text-xs underline-offset-4 hover:underline md:min-h-9`,children:[(0,R.jsx)(`span`,{className:`break-all font-mono`,children:e.releaseId}),(0,R.jsx)(l,{"aria-hidden":`true`,className:`size-3.5 shrink-0`})]}):e.builtinBundleId?null:(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Unknown bundle`}),e.builtinBundleId?(0,R.jsx)(H,{bundleId:e.builtinBundleId}):null]}),(0,R.jsxs)(`div`,{className:`col-start-2 row-start-1 text-right md:col-auto md:row-auto`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:e.installations.toLocaleString()}),(0,R.jsx)(`span`,{className:`ml-1 text-xs text-muted-foreground md:sr-only`,children:`active`}),(0,R.jsxs)(`p`,{className:`mt-1 text-xs tabular-nums text-muted-foreground md:hidden`,children:[n.toFixed(1),`% of version`]})]}),(0,R.jsxs)(`div`,{className:`hidden flex-col gap-2 md:flex`,children:[(0,R.jsxs)(`span`,{className:`text-right text-sm tabular-nums`,children:[n.toFixed(1),`%`]}),(0,R.jsx)(w,{"aria-label":`${V(e)} share in ${e.appVersion} on ${e.platform}`,value:n})]})]},JSON.stringify([e.appVersion,e.platform,e.releaseId,e.builtinBundleId]))})})]})]}),G&&q.length>0?(0,R.jsxs)(O,{className:`flex flex-wrap items-center justify-between gap-3 border-t pt-4`,children:[(0,R.jsxs)(`p`,{className:`text-xs tabular-nums text-muted-foreground`,children:[(X-1)*z+1,`–`,Math.min(X*z,q.length),` of `,q.length]}),(0,R.jsxs)(`nav`,{"aria-label":`Distribution pages`,className:`flex gap-2`,children:[(0,R.jsx)(e,{variant:`outline`,className:`h-11 sm:h-9`,disabled:X<=1,onClick:()=>$({page:X-1}),children:`Previous`}),(0,R.jsx)(e,{variant:`outline`,className:`h-11 sm:h-9`,disabled:X>=Y,onClick:()=>$({page:X+1}),children:`Next`})]})]}):null]})]})})]})}export{U as component};
@@ -0,0 +1 @@
1
+ import{$r as e,Fn as t,Hr as n,In as r,Ln as i,Nn as a,Pn as o,ar as s,ir as c,ni as l}from"./sidebar-RBvHzq8e.js";import{d as u,l as d,u as f}from"./console-features-api-BhUIxeL-.js";import{a as p,c as m,i as h,n as ee,o as g,r as _,s as v,t as y}from"./installations-yQkxp5fm.js";import{D as b,a as x,i as S,l as C,o as te,r as ne,s as re,u as w}from"./preload-helper-DuV6lz46.js";import{a as T,n as E,o as D,r as O,t as k}from"./EventDetails-BUTZTAVo.js";import{t as ie}from"./arrow-left-BPK7iqvj.js";import{o as A}from"./empty-DtangHOp.js";import{a as j,f as M,t as N}from"./field-bPoDrs6K.js";import{o as P}from"./useCompositeListItem-BxJspDxS.js";import{c as ae,i as oe,n as se,r as ce,s as F,t as le}from"./input-group-_PD0i7wZ.js";import{t as I}from"./refresh-cw-3fSQ1FYY.js";import{a as L,n as R,o as z,r as ue,t as B}from"./card-DKr2pZMA.js";import{a as V,i as H,n as U,o as W,r as G,t as K}from"./table-BYmouPt9.js";import{a as de,f as q,n as fe,r as pe,t as me}from"./InsightsPageHeader-CASeYum3.js";function he(){m(u(),!0)}function ge(e){return he(),v(u(),e)}function _e(e){let t=u();return f(t.stores.location,b(e,t))}var ve=s(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),J=l(e(),1),Y=n();function ye({events:e,formatter:t,renderIdentity:n}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`px-4 pb-2 text-xs text-muted-foreground sm:px-6`,children:`Time in your browser zone`}),(0,Y.jsx)(`ol`,{"aria-label":`Events`,className:`divide-y border-y`,children:e.map(e=>(0,Y.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-3 px-4 py-4 sm:px-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-1`,children:[(0,Y.jsx)(O,{event:e}),(0,Y.jsx)(`div`,{className:`text-xs tabular-nums`,children:(0,Y.jsx)(E,{value:e.receivedAtMs,formatter:t,touch:!0})})]}),n?.(e),(0,Y.jsxs)(`dl`,{className:`flex flex-wrap gap-x-2 gap-y-1 text-sm`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`sr-only`,children:`App`}),(0,Y.jsxs)(`dd`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]})]}),(0,Y.jsxs)(`div`,{className:`min-w-0 text-muted-foreground`,children:[(0,Y.jsx)(`dt`,{className:`sr-only`,children:`Channel`}),(0,Y.jsx)(`dd`,{className:`wrap-anywhere`,children:e.channel})]})]}),(0,Y.jsx)(`div`,{className:`text-xs`,"aria-label":`Bundle`,children:(0,Y.jsx)(k,{event:e,touch:!0})})]},e.id))})]})}function X({hasPrevious:e,label:n,nextCursor:r,onNext:i,onPrevious:a,pageLength:o,pageNumber:s}){return(0,Y.jsxs)(`nav`,{"aria-label":`${n} pagination`,className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,Y.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`Page `,s,` · `,o.toLocaleString(),` rows`]}),(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsx)(t,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:!e,onClick:a,size:`sm`,type:`button`,variant:`outline`,children:`Previous`}),(0,Y.jsx)(t,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:r===null,onClick:i,size:`sm`,type:`button`,variant:`outline`,children:`Next`})]})]})}var be=e=>_.filter((t,n)=>n===0||p[t].durationMs<=e*864e5);function xe({event:e,eventsLocation:t,touch:n=!1}){return(0,Y.jsxs)(`div`,{className:n?`flex min-w-0 flex-wrap items-center justify-between gap-2`:`flex min-w-0 flex-col items-start gap-2`,children:[(0,Y.jsxs)(d,{className:r({className:n?`-ml-2 h-auto min-h-11 min-w-0 flex-1 justify-start gap-2 whitespace-normal text-sm`:`-ml-2 max-w-full justify-start`,size:`sm`,variant:`ghost`}),to:`/installations`,search:{...t,query:e.installId||void 0,installId:e.installId},state:e=>({insightsPagination:{eventsBack:e.insightsPagination?.eventsBack}}),"aria-label":`View history for ${e.userId??`anonymous installation`} (${e.installId})`,children:[(0,Y.jsx)(`span`,{className:n?`min-w-0 text-left wrap-anywhere`:`truncate`,children:e.userId??`Anonymous installation`}),(0,Y.jsx)(A,{"aria-hidden":`true`,"data-icon":`inline-end`})]}),(0,Y.jsx)(F,{value:e.installId,maxLength:13,buttonClassName:n?`min-h-11 px-3`:void 0})]})}function Se({children:e,description:n,error:r,eventsLocation:i,history:o,isFetching:s,isLoading:c,onNext:l,onPrevious:u,onRangeChange:d,onRefresh:f,pageNumber:m,range:h,rawDays:ee=90,title:_=`All events`}){let v=D(),y=m>1,b=be(ee),x=h===void 0?void 0:g(h),S=x!==void 0&&b.includes(x)?x:void 0,C=S!==void 0&&d?(0,Y.jsx)(t,{className:`h-11 px-3 lg:h-8`,onClick:()=>d(S),type:`button`,variant:`outline`,children:`Show the last ${p[S].period}`}):null;return(0,Y.jsxs)(B,{className:`@container min-w-0 shadow-sm`,"aria-busy":s,children:[(0,Y.jsxs)(L,{className:`gap-4 p-4 sm:p-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsx)(z,{children:(0,Y.jsx)(`h2`,{children:_})}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[h!==void 0&&d?(0,Y.jsx)(de,{label:`Time range`,onPeriodChange:d,period:h,periods:b.map(e=>({value:e,name:`Last ${p[e].period}`}))}):null,(0,Y.jsxs)(t,{className:`h-11 lg:h-8`,disabled:s,onClick:f,size:`lg`,variant:`outline`,children:[(0,Y.jsx)(I,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]})]})]}),n?(0,Y.jsx)(ue,{children:n}):null]}),e]}),(0,Y.jsx)(R,{className:`min-w-0 p-0`,children:c?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,role:`status`,"aria-label":`Loading events`,children:[(0,Y.jsx)(a,{className:`h-12 w-full`}),(0,Y.jsx)(a,{className:`h-12 w-full`}),(0,Y.jsx)(a,{className:`h-12 w-full`})]}):r?(0,Y.jsx)(`div`,{className:`px-6 pb-6`,children:(0,Y.jsx)(q,{error:r,fallbackTitle:`Event history unavailable`})}):o?(0,Y.jsxs)(Y.Fragment,{children:[o.data.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`@[58rem]:hidden`,children:(0,Y.jsx)(ye,{events:o.data,formatter:v,renderIdentity:e=>(0,Y.jsx)(xe,{event:e,eventsLocation:i,touch:!0})})}),(0,Y.jsx)(`div`,{className:`hidden @[58rem]:block`,children:(0,Y.jsxs)(K,{className:`min-w-4xl table-fixed`,children:[(0,Y.jsx)(V,{children:(0,Y.jsxs)(W,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,Y.jsx)(H,{className:`w-64`,children:`Time`}),(0,Y.jsx)(H,{className:`w-48`,children:`Event`}),(0,Y.jsx)(H,{className:`w-48`,children:`User / installation`}),(0,Y.jsx)(H,{className:`w-32`,children:`App`}),(0,Y.jsx)(H,{className:`w-52`,children:`Bundle`})]})}),(0,Y.jsx)(U,{children:o.data.map(e=>(0,Y.jsxs)(W,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,Y.jsx)(G,{className:`whitespace-normal text-xs tabular-nums`,children:(0,Y.jsx)(E,{value:e.receivedAtMs,formatter:v})}),(0,Y.jsx)(G,{children:(0,Y.jsx)(O,{event:e})}),(0,Y.jsx)(G,{children:(0,Y.jsx)(xe,{event:e,eventsLocation:i})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsx)(k,{event:e})})]},e.id))})]})})]}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:y?`No older events in this range.`:h===void 0?_===`All events`?`No events recorded yet`:`No matching reports in this period`:`No events in the last ${p[h].period}.`}),y?null:C]}),h!==void 0&&o.nextCursor===null&&(o.data.length>0||y)?(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Start of range reached`}),C]}):null,o.data.length>0||y||o.nextCursor?(0,Y.jsx)(X,{hasPrevious:y,label:_,nextCursor:o.nextCursor,onNext:l,onPrevious:u,pageLength:o.data.length,pageNumber:m}):null]}):null})]})}var Ce=e=>e.userId??`—`,we=e=>`lastKnownBundleId`in e?e.lastKnownBundleId:e.type===`UPDATE_DOWNLOADED`||e.type===`UPDATE_FAILED`?e.fromBundleId:e.toBundleId;function Te({error:e,history:n,isLoading:r,onNext:i,onPrevious:s,onRefresh:c,pageNumber:l,retention:u=C,selectedEvent:d,selectedInstallId:f}){let p=D(),m=d?we(d):void 0,h=d&&`pendingBundleId`in d?d.pendingBundleId:d&&`type`in d&&d.type===`UPDATE_DOWNLOADED`?d.toBundleId:null;return(0,Y.jsxs)(B,{className:`@container min-h-0 min-w-0 shadow-sm`,children:[(0,Y.jsx)(L,{className:`p-4 sm:p-6`,children:(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,Y.jsx)(z,{className:`text-sm font-medium`,children:(0,Y.jsx)(`h2`,{children:f===void 0?`Select an installation`:`Installation history`})}),f===void 0?null:(0,Y.jsxs)(ue,{children:[`Bundle changes and update failures are kept for`,` `,w(u.rawDays),`; the latest report, for`,` `,w(u.dailyDays),` after the installation last reports.`]})]}),c&&f!==void 0?(0,Y.jsxs)(t,{className:`h-11 lg:h-8`,size:`lg`,variant:`outline`,onClick:c,disabled:r,children:[(0,Y.jsx)(I,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]}):null]})}),(0,Y.jsxs)(R,{className:`min-h-0 p-0`,children:[f!==void 0&&d?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`section`,{"aria-labelledby":`latest-installation-state`,className:`px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,Y.jsx)(`h3`,{className:`sr-only`,id:`latest-installation-state`,children:`Latest reported state`}),(0,Y.jsxs)(`dl`,{className:`grid grid-cols-2 gap-4 @[36rem]:grid-cols-3`,children:[(0,Y.jsxs)(`div`,{className:`col-span-2 min-w-0 @[36rem]:col-span-1`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`User ID`}),(0,Y.jsx)(`dd`,{className:`mt-1 text-sm font-medium wrap-anywhere`,children:Ce(d)})]}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Install ID`}),(0,Y.jsx)(`dd`,{className:`mt-1 font-mono text-xs`,children:(0,Y.jsx)(F,{value:f,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`})})]}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Last known bundle`}),(0,Y.jsxs)(`dd`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2 font-mono text-xs`,children:[m?(0,Y.jsx)(F,{value:m,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`}):`—`,pe(m,d.minBundleId)?(0,Y.jsx)(fe,{}):null]})]}),h?(0,Y.jsxs)(`div`,{className:`col-span-2 min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Downloaded · Not launched yet`}),(0,Y.jsx)(`dd`,{className:`mt-1 text-xs`,children:(0,Y.jsx)(F,{value:h})})]}):null]}),d.httpResponse?(0,Y.jsx)(`div`,{className:`mt-4`,children:(0,Y.jsx)(T,{event:d})}):null]}),(0,Y.jsx)(o,{})]}):null,f===void 0?null:r?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3 p-6`,role:`status`,"aria-label":`Loading installation history`,children:[(0,Y.jsx)(a,{className:`h-10 w-full`}),(0,Y.jsx)(a,{className:`h-10 w-full`}),(0,Y.jsx)(a,{className:`h-10 w-full`})]}):e?(0,Y.jsx)(`div`,{className:`p-6`,children:(0,Y.jsx)(q,{error:e instanceof Error?e:Error(),fallbackTitle:`Installation history unavailable`})}):n&&n.data.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`@[48rem]:hidden`,children:(0,Y.jsx)(ye,{events:n.data,formatter:p})}),(0,Y.jsx)(`div`,{className:`hidden @[48rem]:block`,children:(0,Y.jsxs)(K,{className:`min-w-3xl table-fixed`,children:[(0,Y.jsx)(V,{children:(0,Y.jsxs)(W,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,Y.jsx)(H,{className:`w-64`,children:`Time`}),(0,Y.jsx)(H,{className:`w-48`,children:`Event`}),(0,Y.jsx)(H,{className:`w-32`,children:`App`}),(0,Y.jsx)(H,{className:`w-52`,children:`Bundle`})]})}),(0,Y.jsx)(U,{children:n.data.map(e=>(0,Y.jsxs)(W,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,Y.jsx)(G,{className:`whitespace-normal text-xs tabular-nums`,children:(0,Y.jsx)(E,{value:e.receivedAtMs,formatter:p})}),(0,Y.jsx)(G,{children:(0,Y.jsx)(O,{event:e})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsx)(k,{event:e})})]},e.id))})]})}),(0,Y.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:n.nextCursor,onNext:i,onPrevious:s,pageLength:n.data.length,pageNumber:l})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:l>1?`No older bundle changes.`:`No bundle changes recorded yet.`}),n&&(l>1||n.nextCursor)?(0,Y.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:n.nextCursor,onNext:i,onPrevious:s,pageLength:0,pageNumber:l}):null]})]})]})}var Ee=e=>e.lastKnownBundleId,De=e=>e.userId??`—`;function Oe({error:e,onNext:n,onPrevious:a,onSelect:o,pageNumber:s,results:c,selectedInstallId:l}){let[u,d]=(0,J.useState)(!1),f=(0,J.useId)(),p=(0,J.useRef)(null),m=!e&&c&&c.data.length>0;return(0,Y.jsxs)(B,{className:`min-h-0 min-w-0 shadow-sm`,children:[(0,Y.jsx)(L,{className:`p-4 sm:px-6`,children:(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:(0,Y.jsx)(z,{className:`text-sm font-medium`,children:(0,Y.jsx)(`h2`,{children:`Matching installations`})})}),(0,Y.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:m?(0,Y.jsx)(t,{"aria-controls":f,"aria-expanded":u,"aria-label":u?`Hide matching installations`:`Show matching installations`,className:`size-11 lg:hidden`,onClick:()=>d(!u),ref:p,size:`icon-lg`,variant:`ghost`,children:(0,Y.jsx)(P,{"aria-hidden":`true`,className:i(u&&`rotate-180`)})}):null})]})}),(0,Y.jsxs)(R,{className:i(`min-h-0 p-0`,m&&!u&&`hidden lg:block`),id:f,children:[e?(0,Y.jsx)(`div`,{className:`p-6`,children:(0,Y.jsx)(q,{error:e instanceof Error?e:Error(),fallbackTitle:`Installation search unavailable`})}):c&&c.data.length>0?(0,Y.jsx)(`ul`,{"aria-label":`Matching installations`,className:`divide-y`,children:c.data.map(e=>{let t=Ee(e),n=e.installId===l;return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{"aria-label":`${De(e)}, install ID ${e.installId}`,"aria-pressed":n,className:`group flex w-full min-w-0 flex-col gap-2 border-l-2 border-transparent px-4 py-4 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/30 aria-pressed:border-primary aria-pressed:bg-muted/60 motion-reduce:transition-none sm:px-6`,onClick:()=>{o(e.installId),d(!1),p.current?.focus()},type:`button`,children:[(0,Y.jsxs)(`span`,{className:`flex w-full min-w-0 items-center justify-between gap-3`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:De(e)}),n?(0,Y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs font-medium text-primary`,children:[(0,Y.jsx)(M,{"aria-hidden":`true`,className:`size-3.5`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Selected`})]}):null]}),(0,Y.jsx)(`span`,{className:`flex flex-wrap items-center gap-2`,children:(0,Y.jsx)(`span`,{className:`font-mono text-xs`,title:e.installId,children:ae(e.installId)})}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Bundle`}),t?(0,Y.jsx)(`span`,{className:`font-mono text-xs`,title:t,children:ae(t)}):(0,Y.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`—`})]})]})},e.installId)})}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 p-4 sm:px-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No matches`}),(0,Y.jsx)(`a`,{className:r({variant:`outline`,className:`h-11 px-3 lg:h-8`}),href:`#installation-history-search`,children:`Edit search`})]}),c&&(c.data.length>0||s>1||c.nextCursor)?(0,Y.jsx)(X,{hasPrevious:s>1,label:`Installation results`,nextCursor:c.nextCursor,onNext:n,onPrevious:a,pageLength:c.data.length,pageNumber:s}):null]})]})}function ke({draftQuery:e,onDraftQueryChange:n,onSubmit:r,onClear:i}){return(0,Y.jsx)(`form`,{"aria-label":`Find installation`,onSubmit:t=>{t.preventDefault(),e.trim()&&r()},role:`search`,children:(0,Y.jsxs)(N,{className:`gap-2`,children:[(0,Y.jsx)(j,{className:`sr-only`,htmlFor:`installation-history-search`,children:`User ID or installation ID`}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Y.jsxs)(le,{className:`h-11 w-auto min-w-0 flex-1 basis-44 lg:h-8`,children:[(0,Y.jsx)(se,{children:(0,Y.jsx)(ve,{"aria-hidden":`true`})}),(0,Y.jsx)(oe,{autoComplete:`off`,className:`h-11 text-base md:text-base lg:h-8 lg:text-xs`,id:`installation-history-search`,maxLength:1024,name:`installation`,onChange:e=>n(e.target.value),placeholder:`User ID or installation ID`,spellCheck:!1,type:`search`,value:e}),e.length>0?(0,Y.jsx)(se,{align:`inline-end`,children:(0,Y.jsx)(ce,{"aria-label":`Clear installation lookup`,className:`size-11 lg:size-5`,onClick:i,size:`icon-xs`,children:(0,Y.jsx)(c,{"aria-hidden":`true`})})}):null]}),(0,Y.jsx)(t,{"aria-label":`Find installation`,className:`h-11 px-3 lg:h-8`,disabled:e.trim().length===0,size:`lg`,type:`submit`,variant:`outline`,children:`Find`})]})]})})}function Ae(){return(0,Y.jsxs)(`div`,{className:`grid items-stretch gap-6 lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`,children:[(0,Y.jsx)(a,{className:`h-64 w-full lg:h-full`}),(0,Y.jsx)(a,{className:`h-64 w-full lg:h-full`})]})}var je=20,Me=50,Z=()=>Date.now(),Q=(e,t)=>[...e,t??``],$=e=>({cursor:e?.at(-1)||void 0,stack:e.slice(0,-1)});function Ne(){let e=y.useSearch(),n=y.useNavigate(),r=re(),[i,a]=(0,J.useState)(e.query??``),[o]=(0,J.useState)(Z),[s]=(0,J.useState)(Z),c=_e({select:e=>e.state.insightsPagination}),l=c?.eventsBack??[],u=c?.searchBack??[],d=c?.historyBack??[],f=e.query?.trim()??``,p=f.length>0,m=e.installId!==void 0,g=p||m,_=e.eventsBefore??o,v=e.eventsRange??`7d`,b=e.historyBefore??s,C=(t,r=!1,i={})=>{n({to:`/installations`,search:{...e,...t},state:e=>({...e,insightsPagination:{...e.insightsPagination,...i}}),replace:r})};(0,J.useEffect)(()=>{a(e.query??``)},[e.query]),(0,J.useEffect)(()=>{e.eventsBefore===void 0&&C({eventsBefore:_},!0)},[_,e.eventsBefore]),(0,J.useEffect)(()=>{m&&e.historyBefore===void 0&&C({historyBefore:b},!0)},[m,b,e.historyBefore]);let T=ne({...h(v,_),cursor:e.eventsCursor,limit:20},!g),E=te({cursor:e.searchCursor,identity:f,limit:je},p);(0,J.useEffect)(()=>{let e=E.data?.data[0]?.installId;!p||m||e===void 0||C({historyBefore:Z(),historyCursor:void 0,installId:e},!0,{historyBack:[]})},[p,m,E.data?.data]);let D=x(e.installId??``,m),O=S({beforeReceivedAtMs:b,cursor:e.historyCursor,installId:e.installId??``,limit:Me},m),k=D.data??E.data?.data.find(({installId:t})=>t===e.installId)??O.data?.data[0],A=g?`installation-history-${e.historyCursor??`first`}`:`all-events-${e.eventsCursor??`first`}`,j=(0,J.useRef)(null),M=ge({id:A,getKey:ee});(0,J.useLayoutEffect)(()=>{!g&&!T.isLoading&&j.current&&(j.current.scrollTop=M?.scrollY??0)},[T.isLoading,g,M?.scrollY,A]);let N=()=>{a(``),C({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:void 0,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})},P=(0,Y.jsx)(ke,{draftQuery:i,onClear:N,onDraftQueryChange:a,onSubmit:()=>{let e=i.trim();if(!e){N();return}C({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:e,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})}});return(0,Y.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,Y.jsx)(me,{view:`events`}),(0,Y.jsx)(`div`,{ref:j,"data-scroll-restoration-id":A,id:`insights-events-scroll`,className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:(0,Y.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-col gap-4 sm:gap-6`,children:[g?(0,Y.jsx)(B,{className:`shadow-sm`,children:(0,Y.jsxs)(R,{className:`flex flex-col gap-3 p-4 sm:p-6`,children:[(0,Y.jsxs)(t,{className:`-ml-2 h-11 self-start lg:h-8`,onClick:N,variant:`ghost`,children:[(0,Y.jsx)(ie,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Back to all events`]}),P]})}):null,g?E.isLoading&&p?(0,Y.jsx)(Ae,{}):(0,Y.jsxs)(`div`,{className:`grid min-h-0 min-w-0 items-stretch gap-4 sm:gap-6 ${p?`lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`:`lg:grid-cols-1`}`,children:[p?(0,Y.jsx)(Oe,{error:E.error,onNext:()=>{E.data?.nextCursor&&C({installId:void 0,searchCursor:E.data.nextCursor},!0,{searchBack:Q(u,e.searchCursor)})},onPrevious:()=>{let e=$(u);C({installId:void 0,searchCursor:e.cursor},!0,{searchBack:e.stack})},onSelect:e=>{C({historyBefore:Z(),historyCursor:void 0,installId:e},!1,{historyBack:[]})},pageNumber:u.length+1,results:E.data,selectedInstallId:e.installId}):null,(0,Y.jsx)(Te,{error:O.error??D.error,history:O.data,isLoading:O.isLoading||D.isLoading,onNext:()=>{O.data?.nextCursor&&C({historyCursor:O.data.nextCursor},!0,{historyBack:Q(d,e.historyCursor)})},onPrevious:()=>{let e=$(d);C({historyCursor:e.cursor},!0,{historyBack:e.stack})},onRefresh:()=>{C({historyBefore:Z(),historyCursor:void 0},!0,{historyBack:[]})},pageNumber:d.length+1,retention:r,selectedEvent:k,selectedInstallId:e.installId})]}):(0,Y.jsx)(Se,{description:`Downloads, launches, crashes, update failures, and other changes to what an installation runs, newest first, kept for ${w(r.rawDays)}. Launches that change nothing aren't listed.`,error:T.error,eventsLocation:{eventsBefore:_,eventsCursor:e.eventsCursor,eventsRange:e.eventsRange},history:T.data,isFetching:T.isFetching,isLoading:T.isLoading,onNext:()=>{T.data?.nextCursor&&C({eventsCursor:T.data.nextCursor},!0,{eventsBack:Q(l,e.eventsCursor)})},onPrevious:()=>{let e=$(l);C({eventsCursor:e.cursor},!0,{eventsBack:e.stack})},onRangeChange:e=>{C({eventsBefore:Z(),eventsCursor:void 0,eventsRange:e},!1,{eventsBack:[]})},onRefresh:()=>{C({eventsBefore:Z(),eventsCursor:void 0},!0,{eventsBack:[]})},pageNumber:l.length+1,range:v,rawDays:r.rawDays,children:P})]})},A)]})}export{Ne as component};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/installations-CstW4tEL.js","assets/ConsoleFeatureUnavailable-BH7LLqAg.js","assets/sidebar-RBvHzq8e.js","assets/console-features-api-BhUIxeL-.js","assets/empty-DtangHOp.js","assets/NotFoundPage-CkgdpWvl.js","assets/installations-DMKfJhu2.js","assets/preload-helper-DuV6lz46.js","assets/InsightsPageHeader-CASeYum3.js","assets/useCompositeListItem-BxJspDxS.js","assets/field-bPoDrs6K.js","assets/card-DKr2pZMA.js","assets/EventDetails-DxKEfM63.js","assets/input-group-_PD0i7wZ.js","assets/dist-BzWwzt98.js","assets/arrow-left-BPK7iqvj.js","assets/refresh-cw-3fSQ1FYY.js","assets/table-BYmouPt9.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./console-features-api-BhUIxeL-.js";import{T as t,t as n,w as r}from"./preload-helper-DuV6lz46.js";function i(){try{return sessionStorage}catch{return}}var a=`tsr-scroll-restoration-v1_3`,o=i();function s(){try{return JSON.parse(o?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var c=s(),l=`data-scroll-restoration-id`,u=e=>e.state.__TSR_key||e.href;function d(e){let t=e.getAttribute(l);if(t)return`[${l}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}function f(e,t){let n=c[(t.getKey||u)(e.latestLocation)];if(!n)return;if(t.id)return n[`[${l}="${t.id}"]`];let r=t.getElement?.();if(r)return n[r===window?m:d(r)]}var p=!1,m=`window`;function h(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function g(e){let t=new Set;for(let n of e){if(n===m)continue;let e=h(n);e&&t.add(e)}return t}function _(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||u,s=new Set,l=e=>{let t=c[e]||={};for(let e of s)e===document?t[m]={scrollX,scrollY}:e.isConnected&&(t[d(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,p=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{p||s.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&l(i(e.fromLocation)),s.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,l(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{o?.setItem(a,JSON.stringify(c))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),!r.r&&(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,a=e.options.scrollToTopSelectors,o=r.n,l=r.h,u;if(s.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let d=i(t.toLocation),f=t.fromLocation&&i(t.fromLocation);if(r.e&&f&&f!==d){let e=c[f];if(e){let t=c[d];for(let n in e){if(n===m){if(o)continue}else{let e=h(n);if(!e||o&&a&&(u??=g(a),u.has(e)))continue}t||=c[d]={},t[n]??=e[n]}}}p=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,s=!1;if(o){!e&&a&&(u??=g(a));let t=e&&i&&l,o=r.e?c[d]:void 0;if(o)for(let e in o){let{scrollX:r,scrollY:i}=o[e];if(e===m){if(t)continue;scrollTo({top:i,left:r,behavior:n}),s=!0}else{let t=h(e);t&&(t.scrollLeft=r,t.scrollTop=i,u?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(s||scrollTo(e),u)for(let t of u)t.scrollTo(e)}}!s&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{p=!1}}))}var v=864e5,y={"24h":{period:`24 hours`,durationMs:v},"7d":{period:`7 days`,durationMs:7*v},"30d":{period:`30 days`,durationMs:30*v},"90d":{period:`90 days`,durationMs:90*v}},b=Object.keys(y),x=e=>b[b.indexOf(e)+1],S=(e,t)=>({beforeReceivedAtMs:t,sinceMs:Math.max(0,t-y[e].durationMs)}),C=e=>typeof e==`string`&&e.length>0?e:void 0,w=e=>typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:void 0,T=e=>b.find(t=>t===e);function E(e){let t=D(e.search);return t.query===void 0&&t.installId===void 0?`/installations?eventsBefore=${t.eventsBefore??`new`}&eventsRange=${t.eventsRange??`7d`}&eventsCursor=${t.eventsCursor??`first`}`:e.state.__TSR_key}function D(e){return{query:typeof e.query==`string`?e.query:void 0,installId:typeof e.installId==`string`?e.installId:void 0,eventsCursor:C(e.eventsCursor),eventsBefore:w(e.eventsBefore),eventsRange:T(e.eventsRange),searchCursor:C(e.searchCursor),historyCursor:C(e.historyCursor),historyBefore:w(e.historyBefore)}}var O=t(`/installations`)({beforeLoad:({context:t})=>e(t.queryClient,`insights`),notFoundComponent:r(()=>n(()=>import(`./installations-CstW4tEL.js`),__vite__mapDeps([0,1,2,3,4,5])),`notFoundComponent`),component:r(()=>n(()=>import(`./installations-DMKfJhu2.js`),__vite__mapDeps([6,2,7,3,8,9,10,11,12,4,13,14,15,16,17])),`component`),staticData:{scrollRestorationKey:E},validateSearch:D});export{y as a,_ as c,S as i,E as n,x as o,b as r,f as s,O as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/installations-CstW4tEL.js","assets/ConsoleFeatureUnavailable-BH7LLqAg.js","assets/sidebar-RBvHzq8e.js","assets/console-features-api-BhUIxeL-.js","assets/empty-DtangHOp.js","assets/NotFoundPage-CkgdpWvl.js","assets/installations-C-QP0sM1.js","assets/preload-helper-DuV6lz46.js","assets/InsightsPageHeader-CASeYum3.js","assets/useCompositeListItem-BxJspDxS.js","assets/field-bPoDrs6K.js","assets/card-DKr2pZMA.js","assets/EventDetails-BUTZTAVo.js","assets/input-group-_PD0i7wZ.js","assets/dist-BzWwzt98.js","assets/arrow-left-BPK7iqvj.js","assets/refresh-cw-3fSQ1FYY.js","assets/table-BYmouPt9.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./console-features-api-BhUIxeL-.js";import{T as t,t as n,w as r}from"./preload-helper-DuV6lz46.js";function i(){try{return sessionStorage}catch{return}}var a=`tsr-scroll-restoration-v1_3`,o=i();function s(){try{return JSON.parse(o?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var c=s(),l=`data-scroll-restoration-id`,u=e=>e.state.__TSR_key||e.href;function d(e){let t=e.getAttribute(l);if(t)return`[${l}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}function f(e,t){let n=c[(t.getKey||u)(e.latestLocation)];if(!n)return;if(t.id)return n[`[${l}="${t.id}"]`];let r=t.getElement?.();if(r)return n[r===window?m:d(r)]}var p=!1,m=`window`;function h(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function g(e){let t=new Set;for(let n of e){if(n===m)continue;let e=h(n);e&&t.add(e)}return t}function _(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||u,s=new Set,l=e=>{let t=c[e]||={};for(let e of s)e===document?t[m]={scrollX,scrollY}:e.isConnected&&(t[d(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,p=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{p||s.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&l(i(e.fromLocation)),s.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,l(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{o?.setItem(a,JSON.stringify(c))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),!r.r&&(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,a=e.options.scrollToTopSelectors,o=r.n,l=r.h,u;if(s.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let d=i(t.toLocation),f=t.fromLocation&&i(t.fromLocation);if(r.e&&f&&f!==d){let e=c[f];if(e){let t=c[d];for(let n in e){if(n===m){if(o)continue}else{let e=h(n);if(!e||o&&a&&(u??=g(a),u.has(e)))continue}t||=c[d]={},t[n]??=e[n]}}}p=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,s=!1;if(o){!e&&a&&(u??=g(a));let t=e&&i&&l,o=r.e?c[d]:void 0;if(o)for(let e in o){let{scrollX:r,scrollY:i}=o[e];if(e===m){if(t)continue;scrollTo({top:i,left:r,behavior:n}),s=!0}else{let t=h(e);t&&(t.scrollLeft=r,t.scrollTop=i,u?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(s||scrollTo(e),u)for(let t of u)t.scrollTo(e)}}!s&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{p=!1}}))}var v=864e5,y={"24h":{period:`24 hours`,durationMs:v},"7d":{period:`7 days`,durationMs:7*v},"30d":{period:`30 days`,durationMs:30*v},"90d":{period:`90 days`,durationMs:90*v}},b=Object.keys(y),x=e=>b[b.indexOf(e)+1],S=(e,t)=>({beforeReceivedAtMs:t,sinceMs:Math.max(0,t-y[e].durationMs)}),C=e=>typeof e==`string`&&e.length>0?e:void 0,w=e=>typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:void 0,T=e=>b.find(t=>t===e);function E(e){let t=D(e.search);return t.query===void 0&&t.installId===void 0?`/installations?eventsBefore=${t.eventsBefore??`new`}&eventsRange=${t.eventsRange??`7d`}&eventsCursor=${t.eventsCursor??`first`}`:e.state.__TSR_key}function D(e){return{query:typeof e.query==`string`?e.query:void 0,installId:typeof e.installId==`string`?e.installId:void 0,eventsCursor:C(e.eventsCursor),eventsBefore:w(e.eventsBefore),eventsRange:T(e.eventsRange),searchCursor:C(e.searchCursor),historyCursor:C(e.historyCursor),historyBefore:w(e.historyBefore)}}var O=t(`/installations`)({beforeLoad:({context:t})=>e(t.queryClient,`insights`),notFoundComponent:r(()=>n(()=>import(`./installations-CstW4tEL.js`),__vite__mapDeps([0,1,2,3,4,5])),`notFoundComponent`),component:r(()=>n(()=>import(`./installations-C-QP0sM1.js`),__vite__mapDeps([6,2,7,3,8,9,10,11,12,4,13,14,15,16,17])),`component`),staticData:{scrollRestorationKey:E},validateSearch:D});export{y as a,_ as c,S as i,E as n,x as o,b as r,f as s,O as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-DuBSi7uM.js","assets/sidebar-RBvHzq8e.js","assets/alert-dialog-DXxrSU0G.js","assets/mutation-B4EZNS91.js","assets/valueToPercent-Ci2-fmWp.js","assets/useCompositeListItem-BxJspDxS.js","assets/field-bPoDrs6K.js","assets/console-features-api-BhUIxeL-.js","assets/api-BiZP_i-u.js","assets/input-group-_PD0i7wZ.js","assets/dist-BzWwzt98.js","assets/loader-circle-iTGehfyV.js","assets/dialog-DxjO7ofz.js","assets/card-DKr2pZMA.js","assets/InsightsInfo-B8i-PPsH.js","assets/preload-helper-DuV6lz46.js","assets/table-BYmouPt9.js"])))=>i.map(i=>d[i]);
2
+ import{Hr as e,In as t,Ln as n,Nn as r,Pn as i,Ur as a,ar as o,cr as s,nr as c,rr as l}from"./sidebar-RBvHzq8e.js";import{a as u,i as d,l as f,o as p}from"./console-features-api-BhUIxeL-.js";import{C as m,T as h,c as g,h as _,t as v,v as y,w as b}from"./preload-helper-DuV6lz46.js";import{n as x}from"./loader-circle-iTGehfyV.js";import{a as S,i as C,n as w,o as T,t as E}from"./card-DKr2pZMA.js";import{n as D,t as O}from"./InsightsInfo-B8i-PPsH.js";var k=o(`chart-line`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`m19 9-5 5-4-4-3 3`,key:`2osh9i`}]]),A=o(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),j=e(),M={apiKeys:{navigation:{icon:(0,j.jsx)(x,{}),paths:[`/api-keys`],link:({onClick:e})=>(0,j.jsx)(f,{to:`/api-keys`,onClick:e})}}},N=l({method:`GET`}).middleware([c]).handler(a(`b4bf4c461903edcdc44eea52468c737b5b600a586f542138ff022dcbbe86c45c`));function P(e){let t=e.map(({releaseId:e,platform:t,channel:n})=>({releaseId:e,platform:t,channel:n})).sort((e,t)=>e.releaseId.localeCompare(t.releaseId));return s({queryKey:[`bundle-activity`,t],queryFn:()=>N({data:t}),enabled:t.length>0,staleTime:3e4})}var F=[{label:`Downloaded`,field:`downloads`,color:`text-primary/85`},{label:`Launched`,field:`launched`,color:`text-success/85`},{label:`Crashed`,field:`failedLaunches`,color:`text-warning/85`}],I=e=>{let t=e.launched+e.failedLaunches;return t===0?`—`:`${(e.failedLaunches/t*100).toFixed(2)}%`},L=e=>Math.max(0,e.downloads-e.launched-e.failedLaunches);function R(){return(0,j.jsx)(O,{label:`About release insight metrics`,children:`Downloaded: got this bundle. Launched: ran it. Crashed: crashed on it and rolled back. Once every installation restarts, Downloaded = Launched + Crashed.`})}function z({report:e,loading:t=!1,input:i,variant:a=`inline`}){if(!e)return t?(0,j.jsx)(r,{"aria-label":`Loading release insights`,className:a===`card`?`h-16 w-full`:`h-4 w-40`}):(0,j.jsx)(`span`,{"aria-label":`Release insights unavailable`,className:`text-sm text-muted-foreground`,children:`—`});let o=i?.builtIn===!0,s=o?0:L(e),c=(0,j.jsx)(`dl`,{className:n(a===`card`?`grid grid-cols-[1fr_1fr_auto] gap-4`:`flex min-w-[220px] flex-wrap items-baseline gap-x-3 gap-y-1`),children:F.map(({label:t,field:r,color:i})=>(0,j.jsxs)(`div`,{className:n(`flex`,a===`card`?`min-w-0 flex-col gap-1`:`items-baseline gap-1.5 whitespace-nowrap`),children:[(0,j.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:t}),(0,j.jsxs)(`dd`,{className:n(`flex flex-wrap items-baseline gap-x-1.5 tabular-nums`,a===`card`?`text-xl font-semibold`:`text-sm font-medium`,e[r]>0&&!(r===`downloads`&&o)?i:`text-muted-foreground`),children:[r===`downloads`&&o?(0,j.jsx)(`span`,{title:`The built-in bundle is never downloaded`,children:`—`}):e[r].toLocaleString(),r===`failedLaunches`?(0,j.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,I(e),`)`]}):null]})]},r))});return(0,j.jsxs)(`div`,{className:n(`flex`,a===`card`?`flex-col gap-2`:`items-center gap-1`),children:[i?(0,j.jsx)(f,{className:`min-w-0 rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,to:`/insights`,search:{healthPlatform:i.platform,healthChannel:i.channel,releaseId:i.releaseId,bundleWindow:`7d`},children:c}):c,a===`card`&&s>0?(0,j.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[s.toLocaleString(),` downloaded but not launched yet: waiting for a restart, or passed over for a newer bundle.`]}):null,a===`inline`?(0,j.jsx)(R,{}):null]})}function B({input:e}){let t=g({platform:e.platform,channel:e.channel,releaseId:e.releaseId}),i=t.data;return(0,j.jsxs)(`div`,{className:`flex items-center gap-1`,children:[i?(0,j.jsx)(`dl`,{children:(0,j.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,j.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Download failures`}),(0,j.jsxs)(`dd`,{className:n(`flex items-baseline gap-1.5 text-sm font-medium tabular-nums`,i.failedUpdates>0?`text-warning/85`:`text-muted-foreground`),children:[i.failedUpdates.toLocaleString(),(0,j.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,y(_(i)),`)`]})]})]})}):t.isPending?(0,j.jsx)(r,{"aria-label":`Loading download failures`,className:`h-4 w-40`}):(0,j.jsx)(`span`,{"aria-label":`Download failures unavailable`,className:`text-sm text-muted-foreground`,children:`—`}),(0,j.jsx)(O,{label:`About download failures`,children:`Failed downloads or installs of this bundle, at most one per installation a day. Rate = failures ÷ (failures + downloads).`})]})}function V({input:e}){let n=P([e]);return(0,j.jsxs)(E,{children:[(0,j.jsxs)(S,{className:`flex-row items-center justify-between px-4 pt-4 pb-3`,children:[(0,j.jsx)(T,{className:`text-sm font-medium`,children:`Insights`}),(0,j.jsx)(R,{})]}),(0,j.jsxs)(w,{className:`flex flex-col gap-3 px-4 pb-4`,children:[(0,j.jsx)(z,{variant:`card`,input:e,loading:n.isFetching,report:n.data?.[e.releaseId]}),(0,j.jsx)(i,{}),(0,j.jsx)(B,{input:e})]}),(0,j.jsx)(C,{className:`px-4 pb-4`,children:(0,j.jsxs)(f,{className:t({variant:`outline`,size:`sm`}),to:`/insights`,search:{healthPlatform:e.platform,healthChannel:e.channel,releaseId:e.releaseId,bundleWindow:D(e.releaseId),healthChart:`adoption`},children:[(0,j.jsx)(k,{"aria-hidden":`true`,"data-icon":`inline-start`}),`View adoption`]})})]})}function H({input:e}){return d(`insightsAnalytics`)?null:(0,j.jsxs)(E,{children:[(0,j.jsx)(S,{className:`px-4 pt-4 pb-3`,children:(0,j.jsx)(T,{className:`text-sm font-medium`,children:`Insights`})}),(0,j.jsx)(w,{className:`px-4 pb-4`,children:(0,j.jsx)(B,{input:e})})]})}function U({releaseId:e,releases:t}){let n=P(t);return(0,j.jsx)(z,{input:t.find(t=>t.releaseId===e),loading:n.isFetching,report:n.data?.[e]})}var W={Cell:U},G={insights:{navigation:{icon:(0,j.jsx)(m,{}),paths:[`/insights`,`/insights/distribution`,`/installations`],link:({features:e,onClick:t})=>e.insightsAnalytics?(0,j.jsx)(f,{to:`/insights`,onClick:t}):(0,j.jsx)(f,{to:`/installations`,onClick:t})},releaseSection:({release:e})=>(0,j.jsx)(H,{input:e})},insightsAnalytics:{releaseColumn:W,releaseSection:({release:e})=>(0,j.jsx)(V,{input:e})},...M},K=Object.keys(p),q=()=>{let e=u().data?.features;return e===void 0?[]:K.flatMap(t=>{let n=G[t];return n!==void 0&&e[t]?[{...n,feature:t,label:p[t].label,features:e}]:[]})},J=()=>q().flatMap(({feature:e,label:t,releaseColumn:n})=>n===void 0?[]:[{...n,feature:e,label:t}]);function Y({release:e}){return q().map(({feature:t,releaseSection:n})=>n===void 0?null:(0,j.jsx)(n,{release:e},t))}var X=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function Z(e){let t=X(e.beforeReleaseId),n=t?void 0:X(e.afterReleaseId),r=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0,i=X(e.bundleId),a=i?void 0:X(e.scopeKey),o=i||a?void 0:X(e.channelId),s=o===void 0?void 0:e.platform===`android`?`android`:`ios`;return{afterReleaseId:n,beforeReleaseId:t,bundleId:i,channelId:o,enabled:a||o?r:void 0,platform:s,releaseId:X(e.releaseId),scopeKey:a}}function Q(e){let t=e.enabled===void 0?{}:{enabled:e.enabled};return e.bundleId?{kind:`bundle`,bundleId:e.bundleId}:e.scopeKey?{kind:`scope`,scopeKey:e.scopeKey,...t}:e.channelId&&e.platform?{kind:`channelPlatform`,channelId:e.channelId,platform:e.platform,...t}:{kind:`all`}}function $(e){return Q(e).kind!==`all`}function ee(e,t){let n={...e,...t};return t.bundleId?Z({bundleId:n.bundleId}):t.scopeKey?Z({scopeKey:n.scopeKey,enabled:n.enabled}):`channelId`in t||`platform`in t?Z({channelId:n.channelId,enabled:n.enabled,platform:n.platform}):Z({bundleId:n.bundleId,channelId:n.channelId,enabled:n.enabled,platform:n.platform,scopeKey:n.scopeKey})}var te=h(`/`)({component:b(()=>v(()=>import(`./routes-DuBSi7uM.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])),`component`),validateSearch:Z});export{Y as a,A as c,ee as i,$ as n,q as o,Q as r,J as s,te as t};
@@ -1 +1 @@
1
- import{$n as e,$r as t,$t as n,Bn as r,F as i,Fn as a,Gn as o,Gt as s,H as c,Hn as l,Hr as u,Ht as d,I as f,In as p,Jn as m,Jt as h,Kt as g,L as _,Ln as v,M as y,Nn as b,P as x,Pn as S,R as C,U as w,Un as T,Ut as E,Vt as ee,Wn as te,Wt as ne,Xn as re,Yn as ie,Z as ae,Zn as D,_ as oe,_n as se,ar as O,b as ce,ct as k,ei as A,er as le,fn as j,g as ue,gn as de,h as M,ir as N,ni as P,p as fe,qt as F,rn as I,sn as L,sr as R,st as z,un as B,v as pe,vn as me,w as he,y as ge,yn as _e}from"./sidebar-RBvHzq8e.js";import{l as V}from"./console-features-api-BhUIxeL-.js";import{a as H,i as U,l as ve,n as ye,o as W,r as G,s as be,t as xe}from"./alert-dialog-DXxrSU0G.js";import{a as Se,c as Ce,d as we,f as Te,g as Ee,h as De,i as Oe,l as ke,m as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as K,u as Ie}from"./api-BiZP_i-u.js";import{a as Le,c as Re,i as ze,n as Be,r as Ve,s as He,t as Ue}from"./routes-B2VVPV8z.js";import{a as We,c as Ge,d as Ke,f as qe,i as Je,n as Ye,o as Xe,r as Ze,s as q,t as Qe,u as $e}from"./field-bPoDrs6K.js";import{a as et,i as tt,n as nt,o as rt,r as it}from"./useCompositeListItem-BxJspDxS.js";import{A as at,F as ot,I as st,L as ct,N as lt,O as ut,_ as dt,a as ft,c as pt,h as mt,i as ht,k as gt,l as _t,m as vt,n as yt,o as bt,s as xt,t as St,u as Ct,v as wt}from"./valueToPercent-Ci2-fmWp.js";import{a as Tt,i as Et,l as Dt,n as Ot,o as kt,s as At,t as jt,u as Mt}from"./input-group-_PD0i7wZ.js";import{t as Nt}from"./loader-circle-iTGehfyV.js";import{a as Pt,c as Ft,i as It,n as Lt,o as Rt,r as zt,s as Bt,t as Vt}from"./dialog-DxjO7ofz.js";import{a as Ht,n as Ut,o as Wt,r as Gt,s as Kt,t as qt}from"./card-DKr2pZMA.js";import{n as Jt}from"./dist-BzWwzt98.js";import{c as Yt,d as Xt,f as Zt,h as Qt,l as $t,m as en,o as tn,p as nn,s as rn,u as an}from"./InsightsInfo-D1TJXkbu.js";import{a as on,i as J,n as sn,o as cn,r as Y,t as ln}from"./table-BYmouPt9.js";var un=O(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),dn=O(`circle-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.35 2.69A10 10 0 0 1 21.3 15.65`,key:`1pfsoa`}],[`path`,{d:`M19.08 19.08A10 10 0 1 1 4.92 4.92`,key:`1ablyi`}]]),fn=O(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),pn=O(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),mn=O(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),hn=O(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),gn=O(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),_n=O(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),vn=O(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),X=P(t(),1),Z=u(),yn={production:`bg-green-500/10 text-green-700 dark:text-green-400 border-green-500/20`,dev:`bg-blue-500/10 text-blue-700 dark:text-blue-400 border-blue-500/20`,staging:`bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 border-yellow-500/20`};function bn({channel:e,className:t}){return(0,Z.jsx)(q,{variant:`outline`,className:v(yn[e.toLowerCase()]||`bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20`,t),children:e})}function xn({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(qe,{className:v(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(hn,{className:v(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Z.jsx)(N,{className:v(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}var Sn=A(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),ee=E.prototype;return w.prototype=ee,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){ee[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),Cn=A(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e||={};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],p=f.length,m=0;m<p;m+=1){var h=f[m];h.d&&(c=o?n(t).diff(a,h.d,!0):a.diff(t,h.d,!0));var g=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,g<=h.r||!h.r){g<=1&&m>0&&(h=f[m-1]);var _=d[h.l];s&&(g=s(``+g)),l=typeof _==`string`?_.replace(`%d`,g):_(g,r,h.l,u);break}}if(r)return l;var v=u?d.future:d.past;return typeof v==`function`?v(l):v.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))})),wn=P(Sn(),1),Tn=P(Cn(),1);wn.default.extend(Tn.default);function En({uuid:e,format:t=`relative`}){let n=(0,wn.default)(tn(e));return t===`relative`?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.fromNow()}):t===`absolute`?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)}):(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{className:`text-sm`,children:n.fromNow()}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)})]})}function Dn({panelId:e,bundle:t,bundles:n,loading:r,onDetailClick:i}){let o=M();return(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id:e,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Advanced artifact diagnostics`}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 text-sm sm:items-center`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`Base artifact ID`}),(0,Z.jsx)(ct,{bundleId:t.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(q,{variant:`outline`,children:[n.length,` `,n.length===1?`patch`:`patches`]})]}),r?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(b,{className:`h-10 w-full`}),(0,Z.jsx)(b,{className:`h-10 w-full`})]}):n.length>0?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),o?(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.map(e=>(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Target artifact ID`}),(0,Z.jsx)(ct,{bundleId:e.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Relation`}),(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-1 text-sm`,children:[(0,Z.jsx)(ct,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(Ee,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(ct,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Artifact`}),(0,Z.jsx)(q,{variant:`secondary`,children:`bsdiff`})]}),(0,Z.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Created`}),(0,Z.jsx)(`div`,{className:`text-xs tabular-nums text-foreground`,children:(0,Z.jsx)(En,{uuid:e.id})})]})]}),(0,Z.jsx)(a,{className:`w-full`,onClick:()=>i(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})]})},e.id))}):(0,Z.jsx)(`div`,{className:`overflow-x-auto rounded-md border bg-background`,children:(0,Z.jsxs)(ln,{className:`min-w-max`,children:[(0,Z.jsx)(on,{children:(0,Z.jsxs)(cn,{className:`hover:bg-transparent`,children:[(0,Z.jsx)(J,{children:`Target artifact ID`}),(0,Z.jsx)(J,{children:`Relation`}),(0,Z.jsx)(J,{children:`Artifact`}),(0,Z.jsx)(J,{children:`Created`}),(0,Z.jsx)(J,{className:`w-24 text-right`,children:`Detail`})]})}),(0,Z.jsx)(sn,{children:n.map(e=>(0,Z.jsxs)(cn,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(ct,{bundleId:e.id,fullOnMobile:!0,maxLength:18})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`div`,{className:`flex min-w-[280px] flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[(0,Z.jsx)(ct,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(Ee,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(ct,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(q,{variant:`secondary`,children:`bsdiff`})}),(0,Z.jsx)(Y,{className:`tabular-nums`,children:(0,Z.jsx)(En,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(a,{onClick:()=>i(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})})]},e.id))})]})})]}):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3 text-sm text-muted-foreground`,children:`No direct patch artifacts.`})]})]})})}function On({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[i,o]=(0,X.useState)(null),{data:s=[],isPending:c}=Oe(),l=Me(),u=Fe(),d=n.trim(),f=async e=>{if(e.preventDefault(),!(!d||l.isPending))try{let e=await l.mutateAsync({name:d});r(``),e.inserted?Jt.success(`Channel ${e.row.name} created`):Jt.info(`Channel ${e.row.name} already exists`)}catch(e){Jt.error(`Failed to create channel`),console.error(e)}},p=async()=>{if(!(!i||u.isPending))try{let e=await u.mutateAsync({id:i.id});e.deleted?Jt.success(`Channel ${i.name} deleted`):e.reason===`not_empty`?Jt.error(`Channel ${i.name} is still in use and cannot be deleted`):Jt.error(`Channel ${i.name} no longer exists`),o(null)}catch(e){Jt.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Vt,{open:e,onOpenChange:t,children:(0,Z.jsxs)(Lt,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsxs)(Rt,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(gn,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(zt,{children:`Create deployment channels and remove them when no bundle uses them. Empty channels remain available until you delete them.`})]}),(0,Z.jsx)(`form`,{onSubmit:f,children:(0,Z.jsx)(Je,{className:`gap-2`,children:(0,Z.jsxs)(Qe,{orientation:`horizontal`,children:[(0,Z.jsx)(We,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(ae,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:l.isPending}),(0,Z.jsxs)(a,{type:`submit`,disabled:!d||l.isPending,children:[l.isPending?(0,Z.jsx)(Nt,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(Ft,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,Z.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:c?(0,Z.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,Z.jsx)(Nt,{className:`mr-2 size-3.5 animate-spin`}),`Loading channels`]}):s.length===0?(0,Z.jsx)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:`No channels yet`}):(0,Z.jsx)(`ul`,{className:`divide-y`,children:s.map(e=>(0,Z.jsxs)(`li`,{className:`flex min-h-12 items-center gap-3 px-3 py-2`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`p`,{className:`truncate text-xs font-medium`,children:e.name}),(0,Z.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:e.id})]}),(0,Z.jsx)(a,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:u.isPending,onClick:()=>o(e),className:`text-muted-foreground hover:text-destructive`,children:(0,Z.jsx)(vn,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(xe,{open:i!==null,onOpenChange:e=>{!e&&!u.isPending&&o(null)},children:(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(be,{children:[(0,Z.jsxs)(ve,{children:[`Delete `,i?.name,`?`]}),(0,Z.jsx)(H,{children:`Only empty channels can be removed. The server checks this when you delete it, and the channel can be created again later with a new ID.`})]}),(0,Z.jsxs)(W,{children:[(0,Z.jsx)(G,{disabled:u.isPending,children:`Cancel`}),(0,Z.jsx)(ye,{variant:`destructive`,disabled:u.isPending,onClick:e=>{e.preventDefault(),p()},children:u.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var kn=`[a-zA-Z0-9-]`,An=String.raw`0|[1-9]\d*`,jn=String.raw`\d+`,Mn=String.raw`\d*[a-zA-Z-]${kn}*`,Nn=String.raw`(${An})\.(${An})\.(${An})`,Pn=String.raw`(${jn})\.(${jn})\.(${jn})`,Fn=`(?:${Mn}|${An})`,In=`(?:${Mn}|${jn})`,Ln=String.raw`(?:-(${Fn}(?:\.${Fn})*))`,Rn=String.raw`(?:-?(${In}(?:\.${In})*))`,zn=`${kn}+`,Bn=String.raw`(?:\+(${zn}(?:\.${zn})*))`,Vn=`v?${Nn}${Ln}?${Bn}?`,Hn=String.raw`[v=\s]*${Pn}${Rn}?${Bn}?`,Un=`((?:<|>)?=?)`,Wn=String.raw`${An}|x|X|\*`,Gn=String.raw`${jn}|x|X|\*`,Kn=String.raw`[v=\s]*(${Wn})(?:\.(${Wn})(?:\.(${Wn})(?:${Ln})?${Bn}?)?)?`,qn=String.raw`[v=\s]*(${Gn})(?:\.(${Gn})(?:\.(${Gn})(?:${Rn})?${Bn}?)?)?`,Jn=`(?:~>?)`,Yn=String.raw`(?:\^)`,Xn=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${Xn}(?:$|[^\d])`,String.raw`${Xn}(?:${Ln})?(?:${Bn})?(?:$|[^\d])`;function Zn(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[kn,250]];for(let[n,r]of t)e=e.split(`${n}*`).join(`${n}{0,${r}}`).split(`${n}+`).join(`${n}{1,${r}}`);return e}function Q(e,t){return new RegExp(Zn(e),t)}var Qn=Q(`^${Vn}$`),$n=Q(`^${Hn}$`),er=/^\d+$/;function tr(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function nr(e,t={}){if(typeof e!=`string`)return e;if(e.length>256)throw TypeError(`Version exceeds the maximum length of 256 characters`);let n=e.trim().match(t.loose?$n:Qn);if(!n)throw TypeError(`Invalid version syntax: ${e}`);let r=Number(n[1]),i=Number(n[2]),a=Number(n[3]);if(r>2**53-1||r<0)throw TypeError(`Invalid major version: ${n[1]}`);if(i>2**53-1||i<0)throw TypeError(`Invalid minor version: ${n[2]}`);if(a>2**53-1||a<0)throw TypeError(`Invalid patch version: ${n[3]}`);let o=n[4]?n[4].split(`.`).map(e=>{if(er.test(e)){let t=Number(e);if(t>=0&&t<2**53-1)return t}return e}):void 0;return{build:n[5]?.split(`.`),major:r,minor:i,patch:a,prerelease:o}}var rr=Q(String.raw`^${Un}\s*(${Vn})$|^$`),ir=Q(String.raw`^${Un}\s*(${Hn})$|^$`);function ar(e){return e.version?`${e.operator}${tr(e.version)}`:``}function or(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?ir:rr);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?nr(r[2],t):null;return{operator:i,options:t,value:a?`${i}${tr(a)}`:``,version:a}}function sr(e){return e.sets.map(e=>e.map(ar).join(` `)).join(`||`)}var cr=new RegExp(Bn,`g`),lr=Q(Bn),ur=Q(String.raw`^\s*(${Kn})\s+-\s+(${Kn})\s*$`),dr=Q(String.raw`^\s*(${qn})\s+-\s+(${qn})\s*$`),fr=Q(String.raw`(\s*)${Un}\s*(${Hn}|${Kn})`,`g`),pr=Q(String.raw`(\s*)${Jn}\s+`,`g`),mr=Q(String.raw`(\s*)${Yn}\s+`,`g`),hr=Q(`^${Jn}${Kn}$`),gr=Q(`^${Jn}${qn}$`),_r=Q(`^${Yn}${Kn}$`),vr=Q(`^${Yn}${qn}$`),yr=Q(String.raw`^${Un}\s*${Kn}$`),br=Q(String.raw`^${Un}\s*${qn}$`),xr=Q(String.raw`(<|>)?=?\s*\*`),Sr=/^\s*>=\s*0\.0\.0\s*$/,Cr=/^\s*>=\s*0\.0\.0-0\s*$/,wr=Q(String.raw`^${Un}\s*(${Hn})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Tr(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function Er(e,t){let n=t.loose?gr:hr,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:a?`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`)}function Dr(e,t){return e.trim().split(/\s+/).map(e=>Er(e,t)).join(` `)}function Or(e,t){let n=t.loose?vr:_r,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?t===`0`?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.0${r} <${Number(t)+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${i}-${a} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i}-${a} <${Number(t)+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${i} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${Number(t)+1}.0.0-0`)}function kr(e,t){return e.trim().split(/\s+/).map(e=>Or(e,t)).join(` `)}function Ar(e,t){let n=t.loose?br:yr;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Tr(String(c),l===void 0?void 0:String(l),u===void 0?void 0:String(u)))return e;let d=$(c),f=d||$(l),p=f||$(u);if(s===`=`&&p&&(s=``),d)return s===`>`||s===`<`?`<0.0.0-0`:`*`;let m=t.includePrerelease?`-0`:``;return s&&p?(f&&(l=0),u=0,s===`>`?(s=`>=`,f?(c=Number(c)+1,l=0):l=Number(l)+1):s===`<=`&&(s=`<`,f?c=Number(c)+1:l=Number(l)+1),s===`<`&&(m=`-0`),`${s}${c}.${l}.${u}${m}`):f?`>=${c}.0.0${m} <${Number(c)+1}.0.0-0`:p?`>=${c}.${l}.0${m} <${c}.${Number(l)+1}.0-0`:n})}function jr(e,t){return e.split(/\s+/).map(e=>Ar(e,t)).join(` `)}function Mr(e,t){let n=t.loose?dr:ur;return e.replace(n,(e,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n,m=c;return p=$(r)?``:$(i)?`>=${r}.0.0${t.includePrerelease?`-0`:``}`:$(a)?`>=${r}.${i}.0${t.includePrerelease?`-0`:``}`:o?`>=${p}`:`>=${p}${t.includePrerelease?`-0`:``}`,m=$(l)?``:$(u)?`<${Number(l)+1}.0.0-0`:$(d)?`<${l}.${Number(u)+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:t.includePrerelease?`<${l}.${u}.${Number(d)+1}-0`:`<=${m}`,`${p} ${m}`.trim()})}function Nr(e,t){return jr(Dr(kr(e.replace(lr,``),t),t),t).trim().replace(xr,``)}function Pr(e,t){let n=Mr(e.replace(cr,``),t).replace(fr,`$1$2$3`).replace(pr,`$1~`).replace(mr,`$1^`).split(` `).map(e=>Nr(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Cr:Sr,``));t.loose&&(n=n.filter(e=>wr.test(e)));let r=new Map;for(let e of n.map(e=>or(e,t))){if(e.value===`<0.0.0-0`)return[e];r.set(e.value,e)}return r.size>1&&r.delete(``),[...r.values()]}function Fr(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Pr(e.trim(),n)).filter(e=>e.length);if(!i.length)throw TypeError(`Range contains no valid comparator sets: ${r}`);if(i.length>1){let e=i[0];if(i=i.filter(e=>e[0]?.value!==`<0.0.0-0`),!i.length)i=[e];else if(i.length>1){let e=i.find(e=>e.length===1&&e[0]?.value===``);e&&(i=[e])}}return{options:n,sets:i}}function Ir(e,t={}){try{return Fr(e,t)}catch{return null}}function Lr(e,t={}){let n=Ir(e,t);return n?sr(n)||`*`:null}var Rr=e=>{let t=e.trim();if(t.startsWith(`git@`)){let e=t.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(e)return`https://${e[1]}/${e[2]}`}if(t.startsWith(`ssh://`))try{let e=new URL(t);return`https://${e.hostname}${e.pathname}`.replace(/\/+$/,``).replace(/\.git$/,``)}catch{return t.replace(/\/+$/,``).replace(/\.git$/,``)}return t.replace(/\/+$/,``).replace(/\.git$/,``)},zr=(e,t)=>{if(!e?.trim())return null;let n=Rr(e);try{let{hostname:e}=new URL(n);if(e.includes(`gitlab`))return`${n}/-/commit/${t}`;if(e.includes(`bitbucket`))return`${n}/commits/${t}`}catch{}return`${n}/commit/${t}`};function Br({label:e,value:t}){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-start sm:justify-between sm:gap-4`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,Z.jsx)(`dd`,{className:`min-w-0 text-left text-sm sm:text-right`,children:t})]})}function Vr({bundle:e,release:t}){let{data:n,isFetched:r}=Se(),i=e?Zt(e):null,a=e?Xt(e):null,o=e?.gitCommitHash&&r?zr(n?.console.gitUrl,e.gitCommitHash):null,s=t.strategy===`APP_VERSION`?t.target_app_version:t.fingerprint_hash;return s||e?.gitCommitHash||e?.manifestFileHash||a||i?(0,Z.jsxs)(qt,{children:[(0,Z.jsx)(Ht,{className:`p-4 pb-3`,children:(0,Z.jsx)(Wt,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(Ut,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(Br,{label:t.strategy===`APP_VERSION`?`Target app version`:`Fingerprint target`,value:(0,Z.jsx)(`span`,{className:`break-all font-mono text-xs`,translate:`no`,children:s??`—`})}),e?.gitCommitHash?(0,Z.jsx)(Br,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(At,{className:o?`text-primary`:void 0,maxLength:12,value:e.gitCommitHash}),o?(0,Z.jsx)(`a`,{"aria-label":`Open git commit`,className:`shrink-0 text-primary hover:underline`,href:o,rel:`noopener noreferrer`,target:`_blank`,children:(0,Z.jsx)(fn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(Br,{label:`Manifest hash`,value:(0,Z.jsx)(At,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(Br,{label:`Base hash`,value:(0,Z.jsx)(At,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(Br,{label:`Patch hash`,value:(0,Z.jsx)(At,{maxLength:16,value:i})}):null]})})]}):null}var Hr=Array.from({length:Yt},(e,t)=>t+1);function Ur({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=Qt(t),i=n??[],o=i.length>0,s=r>0&&r<1e3,c=r===Yt,l=M(),u=c?Hr:s?Hr.filter(t=>$t(e,t)<r):[],d=(r/10).toFixed(1),f=c?Yt:u.length,p=Yt-f,m=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,Z.jsx)(qt,{children:(0,Z.jsxs)(Ht,{className:`p-4`,children:[(0,Z.jsx)(Gt,{children:`Selected cohorts`}),(0,Z.jsx)(Wt,{className:`font-mono text-2xl tabular-nums`,children:f})]})}),(0,Z.jsx)(qt,{children:(0,Z.jsxs)(Ht,{className:`p-4`,children:[(0,Z.jsx)(Gt,{children:`Excluded cohorts`}),(0,Z.jsx)(Wt,{className:`font-mono text-2xl tabular-nums`,children:p})]})})]}),o?(0,Z.jsxs)(qt,{children:[(0,Z.jsxs)(Ht,{className:`p-4 pb-3`,children:[(0,Z.jsx)(Wt,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(Gt,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(Ut,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-lg border bg-muted/20 p-3`,children:i.map(e=>(0,Z.jsx)(q,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Z.jsxs)(qt,{children:[(0,Z.jsx)(Ht,{className:`p-4 pb-3`,children:(0,Z.jsx)(Wt,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(Ut,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`max-h-[50vh] overflow-y-auto overscroll-contain rounded-lg border bg-muted/20 p-3 sm:max-h-[45vh]`,children:u.length>0?(0,Z.jsx)(`div`,{"aria-label":`Included numeric cohorts`,className:`grid grid-cols-3 gap-2 sm:grid-cols-6 lg:grid-cols-8`,role:`list`,children:u.map(e=>(0,Z.jsx)(q,{className:`justify-center font-mono tabular-nums`,role:`listitem`,variant:`outline`,children:e},e))}):(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No numeric cohorts are included.`})})})]})]});return(0,Z.jsxs)(Vt,{children:[(0,Z.jsxs)(Bt,{render:(0,Z.jsx)(a,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(et,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(Lt,{className:l?`top-0 left-0 h-dvh max-w-none translate-x-0 translate-y-0 rounded-none border-0 p-0`:`sm:max-w-3xl`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,Z.jsxs)(Pt,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(Rt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(zt,{children:[d,`% includes `,f,` of`,` `,Yt,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain px-4 py-4`,children:m}),(0,Z.jsx)(It,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Rt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(zt,{children:[d,`% includes `,f,` of`,` `,Yt,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),m,(0,Z.jsx)(It,{showCloseButton:!0})]})})]})}function Wr(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Gr(e,t){return e-t}function Kr(e,t,n){let r=e.slice();return r[t]=n,r.sort(Gr)}function qr(e,t,n,r,i,a){let o=e;return o=dt(o,n,r),i&&(o=Kr(a,t,dt(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function Jr(e,t,n){if(!Array.isArray(e))return!0;let r=e.reduce((e,t,n,r)=>(n===r.length-1||e.push(Math.abs(t-r[n+1])),e),[]);return Math.min(...r)>=t*n}var Yr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...ot},Xr=X.createContext(void 0);function Zr(){let e=X.useContext(Xr);if(e===void 0)throw Error(m(62));return e}function Qr(e){return`key`in e?L:I}function $r(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?Wr(e,t):!1}var ei=X.forwardRef(function(e,t){let{"aria-labelledby":n,className:i,defaultValue:a,disabled:o=!1,id:c,format:l,largeStep:u=10,locale:d,render:f,max:p=100,min:m=0,minStepsBetweenValues:g=0,form:_,name:v,onValueChange:y,onValueCommitted:b,orientation:x=`horizontal`,step:S=1,thumbCollisionBehavior:C=`push`,thumbAlignment:w=`center`,value:T,style:ee,...te}=e,ne=k(c),ie=vt(ne),ae=D(y),oe=D(b),{clearErrors:O}=wt(),{state:ce,disabled:A,name:le,setTouched:j,setDirty:ue,validityData:de,shouldValidateOnChange:M,validation:N}=lt(),{labelId:P}=gt(),[fe,I]=X.useState(),L=n??mt(P,fe),R=A||o,z=le??v,[B,pe]=tt({controlled:T,default:a??m,name:`Slider`}),ge=X.useRef(null),_e=X.useRef(null),V=X.useRef([]),H=X.useRef(null),U=X.useRef(null),ve=X.useRef(-1),ye=X.useRef(null),W=X.useRef(null),G=X.useRef(`none`),be=s(l),[xe,Se]=X.useState(-1),[Ce,we]=X.useState(-1),[Te,Ee]=X.useState(!1),[De,Oe]=X.useState(()=>new Map),[ke,Ae]=X.useState([void 0,void 0]),je=D(e=>{Se(e),e!==-1&&we(e)});at(_e,ne,B),he(B,()=>{O(z),M()?N.commit(B):N.commit(B,!0);let e=de.initialValue,t;t=Array.isArray(B)&&Array.isArray(e)?!Wr(B,e):B!==e,ue(t)});let Me=D(e=>{e&&(_e.current=e)}),Ne=Array.isArray(B),Pe=X.useMemo(()=>Ne?B.slice().sort(Gr):[dt(B,m,p)],[p,m,Ne,B]),Fe=D((e,t)=>{if(Number.isNaN(e)||$r(e,B))return;let n=t??F(`none`,void 0,void 0,{activeThumbIndex:-1});G.current=n.reason;let r=n.event,i=new(r.constructor??Event)(r.type,r);Object.defineProperty(i,`target`,{writable:!0,value:{value:e,name:z}}),n.event=i,W.current=e,ae(e,n),!n.isCanceled&&pe(e)}),K=D((e,t,n)=>{let r=qr(e,t,m,p,Ne,Pe);if(Jr(r,S,g)){let e=Qr(n);Fe(r,F(e,n.nativeEvent,void 0,{activeThumbIndex:t})),j(!0),oe(W.current??r,h(e,n.nativeEvent))}});re(()=>{let e=se(E(ge.current));R&&me(ge.current,e)&&e.blur()},[R]),R&&xe!==-1&&je(-1);let Ie=X.useMemo(()=>({...ce,activeThumbIndex:xe,disabled:R,dragging:Te,orientation:x,max:p,min:m,minStepsBetweenValues:g,step:S,values:Pe}),[ce,xe,R,Te,p,m,g,x,S,Pe]),Le=X.useMemo(()=>({active:xe,controlRef:_e,disabled:R,dragging:Te,validation:N,formatOptionsRef:be,handleInputChange:K,indicatorPosition:ke,inset:w!==`center`,labelId:L,rootLabelId:ie,largeStep:u,lastUsedThumbIndex:Ce,lastChangedValueRef:W,lastChangeReasonRef:G,form:_,locale:d,max:p,min:m,minStepsBetweenValues:g,name:z,onValueCommitted:oe,orientation:x,pressedInputRef:H,pressedThumbCenterOffsetRef:U,pressedThumbIndexRef:ve,pressedValuesRef:ye,registerFieldControlRef:Me,renderBeforeHydration:w===`edge`,setActive:je,setDragging:Ee,setIndicatorPosition:Ae,setLabelId:I,setValue:Fe,state:Ie,step:S,thumbCollisionBehavior:C,thumbMap:De,thumbRefs:V,values:Pe}),[xe,_e,L,ie,R,Te,N,be,K,ke,u,Ce,W,G,_,d,p,m,g,z,oe,x,H,U,ve,ye,Me,je,Ee,Ae,I,Fe,Ie,S,C,w,De,V,Pe]),Re=r(`div`,e,{state:Ie,ref:[t,ge],props:[{"aria-labelledby":L,id:ne,role:`group`},N.getValidationProps,te],stateAttributesMapping:Yr});return(0,Z.jsx)(Xr.Provider,{value:Le,children:(0,Z.jsx)(it,{elementsRef:V,onMapChange:Oe,children:Re})})});function ti(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function ni(e){if(e===0)return 0;if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function ri(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(ni(t),ni(n))))}function ii({values:e,index:t,nextValue:n,min:r,max:i,step:a,minStepsBetweenValues:o,initialValues:s}){if(e.length===0)return[];let c=e.slice(),l=a*o,u=c.length-1,d=s??e;c[t]=dt(n,r+t*l,i-(u-t)*l);for(let e=t+1;e<=u;e+=1){let t=c[e-1]+l,n=i-(u-e)*l,r=d[e]??c[e],a=Math.max(c[e],t);r<a&&(a=Math.max(r,t)),c[e]=dt(a,t,n)}for(let e=t-1;e>=0;--e){let t=c[e+1]-l,n=r+e*l,i=d[e]??c[e],a=Math.min(c[e],t);i>a&&(a=Math.min(i,t)),c[e]=dt(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function ai({behavior:e,values:t,currentValues:n,initialValues:r,pressedIndex:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}){let u=n??t,d=r??t;if(!(u.length>1))return{value:a,thumbIndex:0,didSwap:!1};let f=c*l;switch(e){case`swap`:{let e=u[i],t=1e-7,n=u.slice(),r=n[i-1],p=n[i+1],m=dt(a,r==null?o:r+f,p==null?s:p-f),h=Number(m.toFixed(12));n[i]=h;let g=a>e,_=a<e,v=g&&p!=null&&a>=p-t,y=_&&r!=null&&a<=r+t;if(!v&&!y)return{value:n,thumbIndex:i,didSwap:!1};let b=v?i+1:i-1,x=n.map((e,t)=>t===i?h:d[t]??u[t]),S=a;S=v?Math.max(a,n[b]):Math.min(a,n[b]);let C=ii({values:n,index:b,nextValue:S,min:o,max:s,step:c,minStepsBetweenValues:l,initialValues:x}),w=v?b-1:b+1;if(w>=0&&w<C.length){let e=C[w-1],t=C[w+1],n=e==null?o:e+f;n=Math.max(n,o+w*f);let r=t==null?s:t-f;r=Math.min(r,s-(C.length-1-w)*f);let i=dt(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:ii({values:u,index:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}),thumbIndex:i,didSwap:!1};default:{let e=u.slice(),t=e[i-1],n=e[i+1],r=dt(a,t==null?o:t+f,n==null?s:n-f);return e[i]=Number(r.toFixed(12)),{value:e,thumbIndex:i,didSwap:!1}}}}var oi=2;function si(e,t){if(!e)return{start:0,end:0};function n(e){let t=e==null?0:parseFloat(e);return Number.isNaN(t)?0:t}let r=t?`Top`:`InlineStart`,i=t?`Bottom`:`InlineEnd`;return{start:n(e[`border${r}Width`])+n(e[`padding${r}`]),end:n(e[`border${i}Width`])+n(e[`padding${i}`])}}function ci(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return null}return{x:e.clientX,y:e.clientY}}var li=X.forwardRef(function(t,i){let{render:a,className:o,style:c,...l}=t,{disabled:u,dragging:d,inset:f,lastChangedValueRef:p,lastChangeReasonRef:m,max:_,min:v,minStepsBetweenValues:y,onValueCommitted:b,orientation:x,pressedInputRef:S,pressedThumbCenterOffsetRef:C,pressedThumbIndexRef:w,pressedValuesRef:T,registerFieldControlRef:ee,renderBeforeHydration:te,setActive:re,setDragging:ie,setValue:ae,state:oe,step:O,thumbCollisionBehavior:ce,thumbRefs:k,values:A}=Zr(),ue=z(),de=A.length>1,M=x===`vertical`,N=X.useRef(null),P=X.useRef(null),fe=D(t=>{t&&P.current==null&&(P.current=e(t).getComputedStyle(t))}),I=X.useRef(null),L=X.useRef(0),R=X.useRef(0),B=s(A);function pe(e){w.current!==e&&(w.current=e);let t=k.current[e];if(!t){C.current=null,S.current=null;return}S.current=t.querySelector(`input[type="range"]`)}function he(e){let t=N.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=si(P.current,M),c=R.current,l=(M?r:n)-s.start-s.end-c*2,u=C.current??0,d=e.x-u,f=e.y-u,p=dt(((M?i-f-s.end:(ue===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(_-v)*p+v;if(m=ri(m,O,v),m=dt(m,v,_),!de)return{value:m,thumbIndex:0,didSwap:!1};let h=w.current;if(h<0)return null;let g=ai({behavior:ce,values:A,currentValues:B.current??A,initialValues:T.current,pressedIndex:h,nextValue:m,min:v,max:_,step:O,minStepsBetweenValues:y});return ce===`swap`&&g.didSwap?pe(g.thumbIndex):w.current=g.thumbIndex,g}function ge(e){T.current=de?A.slice():null,B.current=A;let t=w.current,n=t;if(t>-1&&t<A.length){if(A[t]===_){let e=t;for(;e>0&&A[e-1]===_;)--e;n=e}}else{let t=M?`y`:`x`,r;n=-1;for(let i=0;i<k.current.length;i+=1){let a=k.current[i];if(le(a)){let o=ti(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&pe(n),f){let e=k.current[n];le(e)&&(R.current=e.getBoundingClientRect()[M?`height`:`width`]/2)}}function V(e){let t=k.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let H=D(e=>{let t=ci(e,I);if(t==null)return;if(L.current+=1,e.type===`pointermove`&&e.buttons===0){U(e);return}let r=he(t);r!=null&&Jr(r.value,O,y)&&(!d&&L.current>oi&&ie(!0),ae(r.value,F(n,e,void 0,{activeThumbIndex:r.thumbIndex})),B.current=Array.isArray(r.value)?r.value:[r.value],r.didSwap&&V(r.thumbIndex))});function U(e){re(-1),ie(!1),S.current=null,C.current=null;let t=ci(e,I),n=t==null?null:he(t);if(n!=null){let t=m.current;b(p.current??n.value,h(t,e))}`pointerType`in e&&N.current?.hasPointerCapture(e.pointerId)&&N.current?.releasePointerCapture(e.pointerId),w.current=-1,I.current=null,T.current=null,ye()}let ve=D(e=>{if(u)return;let t=e.changedTouches[0];t!=null&&(I.current=t.identifier);let n=ci(e,I);if(n!=null){ge(n);let t=he(n);if(t==null)return;V(t.thumbIndex),ae(t.value,F(j,e,void 0,{activeThumbIndex:t.thumbIndex})),B.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&V(t.thumbIndex)}L.current=0;let r=E(N.current);r.addEventListener(`touchmove`,H,{passive:!0}),r.addEventListener(`touchend`,U,{passive:!0})}),ye=D(()=>{let e=E(N.current);e.removeEventListener(`pointermove`,H),e.removeEventListener(`pointerup`,U),e.removeEventListener(`touchmove`,H),e.removeEventListener(`touchend`,U),T.current=null}),W=ne();return X.useEffect(()=>{let e=N.current;if(!e)return()=>ye();let t=g(e,`touchstart`,ve,{passive:!0});return()=>{t(),W.cancel(),ye()}},[ye,ve,N,W]),X.useEffect(()=>{u&&ye()},[u,ye]),r(`div`,t,{state:oe,ref:[i,ee,N,fe],props:[{"data-base-ui-slider-control":te?``:void 0,onPointerDown(e){let t=N.current,n=_e(e.nativeEvent);if(!t||u||e.defaultPrevented||!le(n)||e.button!==0)return;let r=ci(e,I);if(r!=null){ge(r);let n=he(r);if(n==null)return;me(k.current[n.thumbIndex],se(E(t)))?e.preventDefault():W.request(()=>{V(n.thumbIndex)}),ie(!0),C.current??(ae(n.value,F(j,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),B.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&V(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),L.current=0;let i=E(N.current);i.addEventListener(`pointermove`,H,{passive:!0}),i.addEventListener(`pointerup`,U,{once:!0})}},l],stateAttributesMapping:Yr})}),ui=X.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,{state:s}=Zr();return r(`div`,e,{state:s,ref:t,props:[{style:{position:`relative`}},o],stateAttributesMapping:Yr})}),di=R();function fi(){return T}function pi(){return!1}function mi(){return!0}function hi(){return(0,di.useSyncExternalStore)(fi,pi,mi)}var gi=function(e){return e.index=`data-index`,e.dragging=`data-dragging`,e.orientation=`data-orientation`,e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.focused=`data-focused`,e}({}),_i=new Set([..._,w,c]);function vi(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${yt(e[t],r,n)} start range`:`${yt(e[t],r,n)} end range`:n?yt(e[t],r,n):void 0}function yi(e,t,n,r,i){let a=n===1?e+t:e-t;return dt(Number(a.toFixed(Math.max(ni(e),ni(t),ni(r)))),r,i)}var bi=X.forwardRef(function(t,n){let{render:a,children:o,className:s,"aria-describedby":l,"aria-label":u,"aria-labelledby":d,disabled:p=!1,getAriaLabel:m,getAriaValueText:h,id:g,index:v,inputRef:b,onBlur:S,onFocus:T,onKeyDown:E,tabIndex:ne,style:ae,...oe}=t,{nonce:se}=Ct(),O=k(g),{active:ce,lastUsedThumbIndex:A,controlRef:le,disabled:j,validation:ue,formatOptionsRef:M,handleInputChange:N,inset:P,labelId:fe,largeStep:F,locale:I,max:L,min:R,minStepsBetweenValues:B,form:pe,name:me,orientation:he,pressedInputRef:ge,pressedThumbCenterOffsetRef:_e,pressedThumbIndexRef:V,renderBeforeHydration:H,setActive:U,setIndicatorPosition:ve,state:ye,step:W,values:G}=Zr(),be=z(),xe=p||j,Se=G.length>1,Ce=he===`vertical`,we=be===`rtl`,{setTouched:Te,setFocused:Ee,validationMode:De}=lt(),Oe=X.useRef(null),ke=X.useRef(null),Ae=X.useRef(!1),je=k(),Me=ut(),Ne=Se?je:Me,{ref:Pe,index:Fe}=nt({metadata:X.useMemo(()=>({inputId:Ne}),[Ne])}),K=Se?v??Fe:0,Ie=K===G.length-1,Le=G[K],Re=St(Le,R,L),[ze,Be]=X.useState(),Ve=hi(),He=A>=0&&A<G.length?A:-1,Ue=D(()=>{let e=le.current,t=Oe.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Ce?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Re/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Be(s),K===0?ve(e=>[s,e[1]]):Ie&&ve(e=>[e[0],s])});re(()=>{P&&queueMicrotask(Ue)},[Ue,P]),re(()=>{P&&Ue()},[Ue,P,Re]),re(()=>{if(!P)return;let t=le.current,n=Oe.current;if(!t||!n)return;let r=e(t).ResizeObserver;if(typeof r!=`function`)return;let i=new r(Ue);return i.observe(t),i.observe(n),()=>{i.disconnect()}},[le,Ue,P]);let We=Ce?`bottom`:`insetInlineStart`,Ge=Ce?`left`:`top`,Ke;Se?ce===K?Ke=2:He===K&&(Ke=1):ce===K&&(Ke=1);let qe;qe=P?{"--position":`${ze??0}%`,visibility:H&&Ve||ze===void 0?`hidden`:void 0,position:`absolute`,[We]:`var(--position)`,[Ge]:`50%`,translate:`${(Ce||!we?-1:1)*50}% ${(Ce?1:-1)*50}%`,zIndex:Ke}:Number.isFinite(Re)?{position:`absolute`,[We]:`${Re}%`,[Ge]:`50%`,translate:`${(Ce||!we?-1:1)*50}% ${(Ce?1:-1)*50}%`,zIndex:Ke}:ee;let Je;he===`vertical`&&(Je=we?`vertical-rl`:`vertical-lr`);let Ye=typeof m==`function`?m(K):u,Xe=ie({"aria-label":Ye,"aria-labelledby":d??(Ye==null?fe:void 0),"aria-describedby":l,"aria-orientation":he,"aria-valuenow":Le,"aria-valuetext":typeof h==`function`?h(yt(Le,I,M.current??void 0),Le,K):vi(G,K,M.current??void 0,I),disabled:xe,form:pe,id:Ne,max:L,min:R,name:me,onChange(e){N(e.currentTarget.valueAsNumber,K,e)},onFocus(e){let t=Ae.current;Ae.current=!1,U(K),Ee(!0),t&&e.stopPropagation()},onBlur(e){if(Ae.current){e.stopPropagation();return}Oe.current&&(U(-1),Te(!0),Ee(!1),De===`onBlur`&&ue.commit(qr(Le,K,R,L,Se,G)))},onKeyDown(e){if(!_i.has(e.key))return;_.has(e.key)&&e.stopPropagation();let t=null,n=ri(Le,W,R);switch(e.key){case f:t=yi(n,e.shiftKey?F:W,1,R,L);break;case i:t=yi(n,e.shiftKey?F:W,we?-1:1,R,L);break;case y:t=yi(n,e.shiftKey?F:W,-1,R,L);break;case x:t=yi(n,e.shiftKey?F:W,we?1:-1,R,L);break;case w:t=yi(n,F,1,R,L);break;case c:t=yi(n,F,-1,R,L);break;case`End`:t=L,Se&&(t=Number.isFinite(G[K+1])?G[K+1]-W*B:L);break;case C:t=R,Se&&(t=Number.isFinite(G[K-1])?G[K-1]+W*B:R);break;default:break}if(t!==null){let n=e.currentTarget;de(n)||(Ae.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),N(t,K,e),e.preventDefault()}},step:W,style:{...ee,width:`100%`,height:`100%`,writingMode:Je},tabIndex:ne??void 0,type:`range`,value:Le??``},ue.getInputValidationProps),Ze=te(ke,ue.inputRef,b);return r(`div`,t,{state:ye,ref:[n,Pe,Oe],props:[{[gi.index]:K,children:(0,Z.jsxs)(X.Fragment,{children:[o,(0,Z.jsx)(`input`,{ref:Ze,...Xe,suppressHydrationWarning:!0}),P&&Ve&&H&&Ie&&(0,Z.jsx)(`script`,{nonce:se,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();'},suppressHydrationWarning:!0})]}),id:O,onBlur:S,onFocus:T,onPointerDown(e){if(V.current=K,Oe.current!=null){let t=he===`horizontal`?`x`:`y`,n=ti(Oe.current);_e.current=(he===`horizontal`?e.clientX:e.clientY)-n[t]}ke.current!=null&&ge.current!==ke.current&&(ge.current=ke.current)},style:qe,suppressHydrationWarning:H||void 0},oe],stateAttributesMapping:Yr})});function xi(e,t,n,r,i,a){let o=n===void 0||t&&r===void 0?`hidden`:void 0,s=e?`bottom`:`insetInlineStart`,c=e?`height`:`width`,l={visibility:i&&a?`hidden`:o,position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};return l[`--start-position`]=`${n??0}%`,t?(l[`--relative-size`]=`${(r??0)-(n??0)}%`,l[s]=`var(--start-position)`,l[c]=`var(--relative-size)`,l):(l[s]=0,l[c]=`var(--start-position)`,l)}function Si(e,t,n,r){let i=e?`bottom`:`insetInlineStart`,a=e?`height`:`width`,o={position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};if(!t)return o[i]=0,o[a]=`${n}%`,o;let s=r-n;return o[i]=`${n}%`,o[a]=`${s}%`,o}var Ci=X.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,{indicatorPosition:s,inset:c,max:l,min:u,orientation:d,renderBeforeHydration:f,state:p,values:m}=Zr(),h=hi(),g=d===`vertical`,_=m.length>1,v=c?xi(g,_,s[0],s[1],f,h):Si(g,_,St(m[0],u,l),St(m[m.length-1],u,l));return r(`div`,e,{state:p,ref:t,props:[{"data-base-ui-slider-indicator":f?``:void 0,style:v,suppressHydrationWarning:f||void 0},o],stateAttributesMapping:Yr})});function wi({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...a}){let o=Array.isArray(n)?n:n===void 0?Array.isArray(t)?t:t===void 0?[r]:[t]:[n];return(0,Z.jsx)(ei,{className:v(`data-horizontal:w-full data-vertical:h-full`,e),"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,thumbAlignment:`edge`,...a,children:(0,Z.jsxs)(li,{className:`relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col`,children:[(0,Z.jsx)(ui,{"data-slot":`slider-track`,className:`relative grow overflow-hidden rounded-full bg-primary/20 select-none data-horizontal:h-1.5 data-horizontal:w-full data-vertical:h-full data-vertical:w-1.5`,children:(0,Z.jsx)(Ci,{"data-slot":`slider-range`,className:`bg-primary select-none data-horizontal:h-full data-vertical:w-full`})}),Array.from({length:o.length},(e,t)=>(0,Z.jsx)(bi,{"data-slot":`slider-thumb`,className:`relative block size-4 shrink-0 rounded-full border border-primary/50 bg-background shadow transition-colors select-none after:absolute after:-inset-2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-disabled:pointer-events-none data-disabled:opacity-50`},t))]})})}var Ti=X.createContext(void 0);function Ei(){let e=X.useContext(Ti);if(e===void 0)throw Error(m(63));return e}var Di=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),Oi={...ot,checked(e){return e?{[Di.checked]:``}:{[Di.unchecked]:``}}};function ki(e,t,n,r=!0,i){let[a,o]=X.useState(),s=k(i?`${i}-label`:void 0),c=e??t??a;return re(()=>{let i=e||t||!r?void 0:Ai(n.current,s);a!==i&&o(i)}),c}function Ai(e,t){let n=ji(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function ji(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var Mi=X.forwardRef(function(t,n){let{checked:i,className:a,defaultChecked:s,"aria-labelledby":c,form:u,id:f,inputRef:p,name:m,nativeButton:h=!1,onCheckedChange:g,readOnly:_=!1,required:v=!1,disabled:y=!1,render:b,uncheckedValue:x,value:S,style:C,...w}=t,{clearErrors:T}=wt(),{state:E,setTouched:ne,setDirty:ae,validityData:D,setFilled:oe,setFocused:se,shouldValidateOnChange:O,validationMode:ce,disabled:A,name:le,validation:j}=lt(),{labelId:ue}=gt(),de=A||y,M=le??m,N=X.useRef(null),P=te(N,p,j.inputRef),fe=X.useRef(null),I=k(),L=ut({id:f,implicit:!1,controlRef:fe}),R=h?void 0:L,[z,pe]=tt({controlled:i,default:!!s,name:`Switch`,state:`checked`});at(fe,I,z),re(()=>{N.current&&oe(N.current.checked)},[N,oe]),he(z,()=>{T(M),ae(z!==D.initialValue),oe(z),O()?j.commit(z):j.commit(z,!0)});let{getButtonProps:me,buttonRef:ge}=o({disabled:de,native:h}),_e=ki(c,ue,N,!h,R),V={id:h?L:I,role:`switch`,"aria-checked":z,"aria-readonly":_||void 0,"aria-required":v||void 0,"aria-labelledby":_e,onFocus(){de||se(!0)},onBlur(){let e=N.current;!e||de||(ne(!0),se(!1),ce===`onBlur`&&j.commit(e.checked))},onClick(t){if(_||de)return;t.preventDefault();let n=N.current;n&&n.dispatchEvent(new(e(n)).PointerEvent(`click`,{bubbles:!0,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}},H=ie({checked:z,disabled:de,form:u,id:R,name:M,required:v,style:M?d:ee,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:P,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(_){e.preventDefault();return}let t=e.currentTarget.checked,n=F(B,e.nativeEvent);g?.(t,n),!n.isCanceled&&pe(t)},onFocus(){fe.current?.focus()}},j.getInputValidationProps,S===void 0?l:{value:S}),U=X.useMemo(()=>({...E,checked:z,disabled:de,readOnly:_,required:v}),[E,z,de,_,v]),ve=r(`span`,t,{state:U,ref:[n,fe,ge],props:[V,j.getValidationProps,w,me],stateAttributesMapping:Oi});return(0,Z.jsxs)(Ti.Provider,{value:U,children:[ve,!z&&M&&x!==void 0&&(0,Z.jsx)(`input`,{type:`hidden`,form:u,name:M,value:x}),(0,Z.jsx)(`input`,{...H,suppressHydrationWarning:!0})]})}),Ni=X.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e;return r(`span`,e,{state:Ei(),ref:t,stateAttributesMapping:Oi,props:o})});function Pi({className:e,...t}){return(0,Z.jsx)(Mi,{"data-slot":`switch`,className:v(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...t,children:(0,Z.jsx)(Ni,{"data-slot":`switch-thumb`,className:`pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-checked:translate-x-4 data-unchecked:translate-x-0`})})}var Fi=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],Ii=e=>({enabled:e.enabled,message:e.message??``,rolloutCohortCount:e.rollout_cohort_count,shouldForceUpdate:e.should_force_update,targetAppVersion:e.target_app_version??``,targetCohorts:[...e.target_cohorts]}),Li=(e,t)=>({enabled:t.enabled,message:t.message.trim()||null,rolloutCohortCount:t.rolloutCohortCount,shouldForceUpdate:t.shouldForceUpdate,...e.strategy===`APP_VERSION`?{targetAppVersion:t.targetAppVersion.trim()}:{},targetCohorts:t.targetCohorts}),Ri=e=>(e/10).toFixed(1),zi=e=>{let t=e.replace(`,`,`.`),[n=``,...r]=t.split(`.`),i=n.replace(/\D/g,``).slice(0,3),a=r.join(``).replace(/\D/g,``).slice(0,1);return t.includes(`.`)?`${i}.${a}`:i},Bi=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function Vi({value:e,onChange:t}){let[n,r]=(0,X.useState)(Ri(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(Ri(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(wi,{"aria-label":`Rollout percentage`,max:1e3,min:0,onValueChange:n=>t(Array.isArray(n)?n[0]??e:n),step:1,value:e}),(0,Z.jsxs)(jt,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(Et,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=Bi(n)??e;a(!1),r(Ri(i)),t(i)},onChange:e=>{let n=zi(e.target.value);r(n);let i=Bi(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(Ot,{align:`inline-end`,children:(0,Z.jsx)(Tt,{children:`%`})})]})]})}function Hi({channels:e,onOpenChange:t,onShowScope:n,open:r,releaseId:i}){let o=Te(i),s=o.data,c=Pe(s?.bundle_id??``),l=c.data,u=l?an(l):null,d=we(s?.scope_key??``),f=Ae(),p=ke(),m=Ce(),h=Ie(),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(``),[x,C]=(0,X.useState)(``),[w,T]=(0,X.useState)(!1),[E,ee]=(0,X.useState)(!1),[te,ne]=(0,X.useState)(!1),[re,ie]=(0,X.useState)(``),[D,se]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{_(s?Ii(s):null),C(``)},[s]);let O=s?Ii(s):null,k=g!==null&&O!==null&&JSON.stringify(g)!==JSON.stringify(O),A=p.isPending||f.isPending||m.isPending||h.isPending,le=()=>{if(!A){if(k){T(!0);return}t(!1)}},j=()=>{if(!g)return;let e=en(v);if(!nn(e)){C(rn);return}_({...g,targetCohorts:Array.from(new Set([...g.targetCohorts,e]))}),y(``),C(``)},de=async()=>{if(!s||!g)return;let e=g.targetCohorts.map(en);if(e.some(e=>!nn(e))){C(rn);return}if(s.strategy===`APP_VERSION`&&!Lr(g.targetAppVersion.trim())){C(`Enter a valid target app version range.`);return}let n={expectedRevision:s.revision,patch:Li(s,{...g,targetCohorts:e}),releaseId:s.id};C(``);try{await p.mutateAsync(n),await f.mutateAsync(n),Jt.success(`Bundle settings saved`),t(!1)}catch(e){C(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},M=e.find(e=>e.id===s?.channel_id)?.name??s?.channel_id,P=e.filter(e=>e.id!==s?.channel_id),fe=P.map(e=>({label:e.name,value:e.name})),F=re.trim(),I=D===`copy`,L=g?Lr(g.targetAppVersion.trim()):null,R=()=>{ie(``),se(`move`)},z=e=>{!e&&h.isPending||(ne(e),e||R())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ue,{onOpenChange:e=>e?void 0:le(),open:r,children:(0,Z.jsxs)(oe,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(ge,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(ce,{children:`Bundle Detail`}),(0,Z.jsx)(pe,{className:`sr-only`,children:`Edit bundle delivery settings.`}),s?(0,Z.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-col gap-3 text-sm`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(st,{className:`size-4`,platform:s.platform}),(0,Z.jsx)(`span`,{className:`font-medium`,children:s.platform===`ios`?`iOS`:`Android`})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`ID`}),(0,Z.jsxs)(`span`,{className:`min-w-0 basis-full sm:basis-auto`,children:[(0,Z.jsx)(ct,{bundleId:s.id,fullOnMobile:!0,maxLength:18}),s.bundle_id?null:(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:`Built-in app`})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Channel`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,translate:`no`,children:M})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Platform`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:s.platform===`ios`?`iOS`:`Android`})]})]}):(0,Z.jsx)(b,{className:`h-12 w-full`})]}),(0,Z.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[o.isError?(0,Z.jsxs)(Ge,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(Ke,{children:`Bundle details could not be loaded`}),(0,Z.jsx)($e,{children:o.error.message})]}):null,s&&g?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[M?(0,Z.jsx)(Le,{release:{platform:s.platform,channel:M,releaseId:s.id,builtIn:!s.bundle_id}}):null,(0,Z.jsxs)(`section`,{"aria-labelledby":`delivery-settings-heading`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,id:`delivery-settings-heading`,children:`Delivery settings`}),(0,Z.jsxs)(Je,{className:`gap-6`,children:[(0,Z.jsxs)(Qe,{children:[(0,Z.jsx)(We,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(kt,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>_({...g,message:e.target.value}),rows:3,value:g.message})]}),s.strategy===`APP_VERSION`?(0,Z.jsxs)(Qe,{children:[(0,Z.jsx)(We,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(ae,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>_({...g,targetAppVersion:e.target.value}),value:g.targetAppVersion}),L?(0,Z.jsx)(Ye,{children:L}):null]}):null,(0,Z.jsxs)(Qe,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsx)(We,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(Pi,{"aria-label":`Enabled`,checked:g.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>_({...g,enabled:e})})]}),(0,Z.jsx)(Ye,{children:`Disabling rolls devices back to the previous enabled bundle on their next check, or to the built-in app when none remains.`})]}),(0,Z.jsxs)(Qe,{orientation:`horizontal`,children:[(0,Z.jsx)(We,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(Pi,{"aria-label":`Force update`,checked:g.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>_({...g,shouldForceUpdate:e})})]}),(0,Z.jsxs)(Qe,{children:[(0,Z.jsx)(We,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(Vi,{onChange:e=>_({...g,rolloutCohortCount:e}),value:g.rolloutCohortCount})]}),(0,Z.jsxs)(Qe,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(We,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Z.jsx)(Ur,{releaseId:s.id,rolloutCohortCount:g.rolloutCohortCount,targetCohorts:g.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(ae,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>y(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),j())},placeholder:`e.g. qa-team…`,value:v}),(0,Z.jsx)(a,{"aria-label":`Add cohort`,disabled:!v.trim(),onClick:j,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(Ft,{})})]}),g.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:g.targetCohorts.map(e=>(0,Z.jsxs)(q,{className:`gap-1 font-mono`,variant:`secondary`,children:[e,(0,Z.jsx)(`button`,{"aria-label":`Remove cohort ${e}`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>_({...g,targetCohorts:g.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Z.jsx)(N,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Ye,{children:`Public names—no IDs or secrets.`})]})]}),x?(0,Z.jsx)(Ze,{children:x}):null,(0,Z.jsx)(a,{className:`w-full`,disabled:!k||A,onClick:de,size:`lg`,children:p.isPending||f.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(S,{className:`my-2`}),(0,Z.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Actions`}),(0,Z.jsx)(a,{className:`w-full`,disabled:s.kind!==`BUNDLE`||A,onClick:()=>ne(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),s.bundle_id?(0,Z.jsxs)(a,{className:`w-full`,disabled:A,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(s.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),Jt.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(Mt,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(a,{className:`w-full`,disabled:s.enabled||A,onClick:()=>ee(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),s.bundle_id&&c.isPending?(0,Z.jsx)(b,{className:`h-40 w-full`}):null,s.bundle_id&&c.isError?(0,Z.jsxs)(Ge,{variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(Ke,{children:`Build details are unavailable`}),(0,Z.jsx)($e,{children:`Delivery settings are unaffected.`})]}):null,!s.bundle_id||!c.isPending?(0,Z.jsx)(Vr,{bundle:l,release:s}):null,(0,Z.jsxs)(`details`,{className:`rounded-lg border bg-muted/10 p-4 text-xs`,children:[(0,Z.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:`Advanced diagnostics`}),(0,Z.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-muted-foreground sm:grid-cols-2`,children:[(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:s.bundle_id??`Built-in app`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Revision`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:s.revision})]}),u?(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Patch base artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:u})]}):null,(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog generation`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:d.data?.generation??`—`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog size`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:d.data?`${d.data.byte_size} bytes`:`—`})]}),(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Scope key`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:s.scope_key}),n?(0,Z.jsx)(a,{className:`mt-1 h-auto px-0 text-xs`,onClick:()=>n(s.scope_key),size:`sm`,variant:`link`,children:`Show bundles for this target`}):null]})]}),d.isError?(0,Z.jsx)(`p`,{className:`mt-3 text-destructive`,children:`Diagnostics are unavailable. Bundle settings are unaffected.`}):null]})]}):null]})]})}),(0,Z.jsx)(xe,{onOpenChange:T,open:w,children:(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(be,{children:[(0,Z.jsx)(ve,{children:`Discard unsaved changes?`}),(0,Z.jsx)(H,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(W,{children:[(0,Z.jsx)(G,{children:`Keep editing`}),(0,Z.jsx)(ye,{onClick:()=>{T(!1),t(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(xe,{onOpenChange:ee,open:E,children:(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(be,{children:[(0,Z.jsxs)(ve,{children:[`Remove this Bundle from `,M??`the channel`,`?`]}),(0,Z.jsx)(H,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(W,{children:[(0,Z.jsx)(G,{children:`Cancel`}),(0,Z.jsx)(ye,{onClick:async()=>{if(s)try{await m.mutateAsync({expectedRevision:s.revision,releaseId:s.id}),Jt.success(`Bundle removed from ${M??`the channel`}`),ee(!1),t(!1)}catch(e){C(e instanceof Error?e.message:`Bundle could not be removed from the channel.`)}},variant:`destructive`,children:`Remove from channel`})]})]})}),(0,Z.jsx)(Vt,{onOpenChange:z,open:te,children:(0,Z.jsxs)(Lt,{showCloseButton:!h.isPending,children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Rt,{children:`Promote to Channel`}),(0,Z.jsx)(zt,{children:`Choose how to promote this Bundle, then select the target channel.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-4 py-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Xe,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(ht,{disabled:h.isPending,items:Fi,onValueChange:e=>se(e),value:D,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(_t,{placeholder:`Select an action`})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(xt,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:I?`Make this Bundle available in the target channel and keep it in the current channel.`:`Move this Bundle to the target channel. Devices in the current channel may fall back to an earlier Bundle.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Xe,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(ht,{disabled:h.isPending,items:fe,onValueChange:e=>ie(e??``),value:re||null,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(_t,{placeholder:`Select a channel`})}),(0,Z.jsx)(ft,{className:`max-h-64`,children:(0,Z.jsx)(bt,{children:P.map(e=>(0,Z.jsx)(xt,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(It,{children:[(0,Z.jsx)(a,{disabled:h.isPending,onClick:()=>z(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(a,{disabled:!F||h.isPending,onClick:async()=>{if(s)try{await h.mutateAsync({action:D,expectedRevision:s.revision,releaseId:s.id,targetChannel:F}),z(!1),Jt.success(I?`Bundle copied to ${F}`:`Bundle moved to ${F}`)}catch(e){Jt.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:h.isPending?I?`Copying…`:`Moving…`:I?`Copy`:`Move`})]})]})})]})}function Ui({release:e}){return(0,Z.jsxs)(q,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(qe,{className:`size-3`}):(0,Z.jsx)(dn,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}function Wi({percentage:e,className:t}){let n=e<100,r=e.toFixed(1);return(0,Z.jsxs)(q,{className:v(`gap-1`,t),variant:n?`secondary`:`default`,children:[n?(0,Z.jsx)(Kt,{className:`h-3 w-3`}):null,r,`%`]})}var Gi=20,Ki=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],qi=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}],Ji=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),Yi=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`});function Xi({channels:e,onChange:t,onClear:n,onManageChannels:r,search:i}){let o=Be(i),s=i.channelId!==void 0,c=[{label:`All Channels`,value:`all`},...e.map(e=>({label:e.name,value:e.id}))];return(0,Z.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-2 border-b bg-background px-3 py-3 sm:h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:py-0 sm:backdrop-blur-sm`,children:[(0,Z.jsx)(fe,{className:`-ml-1`}),(0,Z.jsx)(`h1`,{className:`sr-only`,children:`Bundles`}),(0,Z.jsxs)(`div`,{className:`ml-1 flex items-center gap-1.5 text-muted-foreground sm:ml-2`,children:[(0,Z.jsx)(mn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsxs)(ht,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:i.channelId??`all`,children:[(0,Z.jsx)(pt,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(_t,{})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(xt,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(ht,{disabled:!s,items:Ki,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:i.platform??`ios`,children:[(0,Z.jsx)(pt,{"aria-label":`Platform`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,title:s?void 0:`Choose a channel first`,children:(0,Z.jsx)(_t,{})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`ios`,children:`iOS`}),(0,Z.jsx)(xt,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(ht,{disabled:!s&&i.scopeKey===void 0,items:qi,onValueChange:e=>t({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:i.enabled===void 0?`all`:i.enabled?`enabled`:`disabled`,children:[(0,Z.jsx)(pt,{"aria-label":`Status`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(_t,{})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`all`,children:`Any Status`}),(0,Z.jsx)(xt,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(xt,{value:`disabled`,children:`Disabled`})]})})]}),(0,Z.jsx)(a,{"aria-label":`Manage channels`,onClick:r,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Z.jsx)(_n,{})}),i.bundleId?(0,Z.jsxs)(q,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Artifact filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear artifact filter`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>t({bundleId:void 0}),type:`button`,children:(0,Z.jsx)(N,{className:`size-3`})})]}):null,i.scopeKey?(0,Z.jsxs)(q,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Target filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear target filter`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>t({scopeKey:void 0}),type:`button`,children:(0,Z.jsx)(N,{className:`size-3`})})]}):null,o?(0,Z.jsxs)(a,{className:`h-8 px-2 text-xs text-muted-foreground hover:text-foreground sm:ml-auto`,onClick:n,size:`sm`,variant:`ghost`,children:[(0,Z.jsx)(N,{"data-icon":`inline-start`}),`Clear`]}):null]})}function Zi({expanded:e,onOpen:t,onToggleExpand:n,release:r}){let i=r.operation===`PROMOTE`?`Promoted`:r.operation===`ROLLBACK`?`Rollback`:null;return(0,Z.jsxs)(`div`,{className:`flex min-w-[240px] items-center gap-3`,children:[r.bundle_id?(0,Z.jsx)(a,{"aria-controls":`bundle-lineage-panel-${r.id}`,"aria-expanded":e,"aria-label":e?`Hide advanced artifact diagnostics`:`Show advanced artifact diagnostics`,title:`Advanced artifact diagnostics`,className:`size-8 shrink-0 touch-manipulation`,onClick:n,size:`icon`,type:`button`,variant:`ghost`,children:e?(0,Z.jsx)(rt,{}):(0,Z.jsx)(De,{})}):(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-8 shrink-0`}),(0,Z.jsxs)(`button`,{"aria-label":`Open details for ID ${r.id}`,className:`min-w-0 rounded-sm text-left text-foreground transition-colors underline-offset-4 hover:text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:t,title:r.id,type:`button`,children:[(0,Z.jsx)(ct,{bundleId:r.id,fullOnMobile:!0}),r.bundle_id?null:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,Z.jsx)(Dt,{className:`size-3.5`}),` Built-in app`]})]}),i?(0,Z.jsx)(q,{className:`shrink-0 font-normal`,variant:`secondary`,children:i}):null,r.currentlyUnreachable?(0,Z.jsxs)(`span`,{"aria-label":`Unreachable: no device gets this bundle with the current delivery settings.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No device gets this bundle with the current delivery settings.`,children:[(0,Z.jsx)(dn,{className:`size-3.5`}),`Unreachable`]}):null]})}function Qi({onDetailClick:e,panelId:t,release:n}){let r=n.bundle_id??``,i=Pe(r),a=je(r);return i.isError||a.isError?(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:t,children:`Patch lineage could not be loaded.`}):i.isPending?(0,Z.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:t,children:[(0,Z.jsx)(b,{className:`h-10 w-full`}),(0,Z.jsx)(b,{className:`h-10 w-full`})]}):i.data?(0,Z.jsx)(Dn,{bundle:i.data,bundles:a.data??[],loading:a.isPending,onDetailClick:e,panelId:t}):(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:t,children:`Bundle details are unavailable.`})}function $i(){let e=Ue.useSearch(),t=Ue.useNavigate(),n=M(),[r,i]=(0,X.useState)(!1),[o,s]=(0,X.useState)(),c=Ne({afterReleaseId:e.afterReleaseId,beforeReleaseId:e.beforeReleaseId,filter:Ve(e),limit:Gi}),l=Oe().data??[],u=c.data?.data??[],d=K(Array.from(new Set(u.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},f=c.data?.next,m=c.data?.previous,h=u.flatMap(e=>{let t=l.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t,builtIn:!e.bundle_id}]:[]}),g=He(),_=10+g.length,y=new Map(l.map(e=>[e.id,e.name]));(0,X.useEffect)(()=>{o&&!u.some(e=>e.id===o)&&s(void 0)},[o,u]);let x=(e,n=!0)=>void t({resetScroll:n,search:e,to:`/`}),S=t=>x(ze(e,t)),C=t=>{let n=u.find(e=>e.bundle_id===t.id);if(s(void 0),n){x({...e,releaseId:n.id},!1);return}S({bundleId:t.id})},w=e.afterReleaseId!==void 0||e.beforeReleaseId!==void 0,T=m?{...e,afterReleaseId:m,beforeReleaseId:void 0,releaseId:void 0}:null,E=f?{...e,afterReleaseId:void 0,beforeReleaseId:f,releaseId:void 0}:null,ee={...e,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0};return(0,Z.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,Z.jsx)(Xi,{channels:l,onChange:S,onClear:()=>x({}),onManageChannels:()=>i(!0),search:e}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-6 bg-muted/5 p-3 sm:p-6`,children:[c.isError?(0,Z.jsxs)(Ge,{variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(Ke,{children:`Bundles could not be loaded`}),(0,Z.jsx)($e,{children:c.error.message})]}):(0,Z.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden rounded-lg border bg-card text-card-foreground shadow-sm [&_[data-slot=table-container]]:h-full [&_[data-slot=table-container]]:overflow-auto`,children:n?(0,Z.jsx)(`div`,{className:`h-full overflow-y-auto`,children:c.isPending?(0,Z.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:Array.from({length:5},(e,t)=>(0,Z.jsx)(b,{className:`h-44 w-full`},t))}):u.length?u.map(t=>{let n=y.get(t.channel_id)??t.channel_id,r=t.bundle_id?d[t.bundle_id]:0,i=o===t.id,a=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(`article`,{className:v(`flex flex-col gap-4 border-b p-4 last:border-b-0`,t.currentlyUnreachable&&`bg-muted/35 saturate-50 transition-[background-color,filter] focus-within:saturate-100 motion-reduce:transition-none`,i&&`border-b-0 bg-primary/5`),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(Zi,{expanded:i,onOpen:()=>x({...e,releaseId:t.id},!1),onToggleExpand:()=>s(i?void 0:t.id),release:t}),(0,Z.jsx)(bn,{channel:n,className:`shrink-0`})]}),(0,Z.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 text-xs`,children:[(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Platform`}),(0,Z.jsxs)(`dd`,{className:`mt-1 flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(st,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created`}),(0,Z.jsx)(`dd`,{className:`mt-1 tabular-nums`,children:Ji.format(t.created_at_ms)})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Rollout`}),(0,Z.jsx)(`dd`,{className:`mt-1`,children:(0,Z.jsx)(Wi,{percentage:t.rollout_cohort_count/10})})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Patches`}),(0,Z.jsx)(`dd`,{className:`mt-1`,children:r===void 0?`Checking`:r>0?`${r} ${r===1?`patch`:`patches`}`:`—`})]}),g.map(({Cell:e,feature:n,label:r})=>(0,Z.jsxs)(`div`,{className:`col-span-2 rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`mb-2 text-muted-foreground`,children:r}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(e,{releaseId:t.id,releases:h})})]},n)),(0,Z.jsxs)(`div`,{className:`col-span-2 flex flex-wrap items-center gap-2 rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(Ui,{release:t}),t.should_force_update?(0,Z.jsx)(q,{variant:`secondary`,children:`Force update`}):null]}),(0,Z.jsxs)(`div`,{className:`col-span-2 grid grid-cols-1 gap-2 rounded-md border bg-background/80 p-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Target`}),(0,Z.jsx)(`dd`,{className:`min-w-0 truncate text-right font-mono`,children:t.target_app_version??t.fingerprint_hash??`—`})]}),(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Message`}),(0,Z.jsx)(`dd`,{className:`min-w-0 text-right text-foreground`,children:t.message||`—`})]})]})]})]}),i&&t.bundle_id?(0,Z.jsx)(Qi,{onDetailClick:C,panelId:a,release:t}):null]},t.id)}):(0,Z.jsx)(`p`,{className:`p-8 text-center text-sm text-muted-foreground`,children:w?`No more bundles on this side.`:Be(e)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,Z.jsxs)(ln,{className:`min-w-max`,children:[(0,Z.jsx)(on,{className:`bg-muted/40`,children:(0,Z.jsxs)(cn,{className:`border-b border-border/60 hover:bg-transparent [&>th]:h-10 [&>th]:text-xs [&>th]:font-semibold [&>th]:uppercase [&>th]:text-muted-foreground/70`,children:[(0,Z.jsx)(J,{children:`ID`}),(0,Z.jsx)(J,{children:`Channel`}),(0,Z.jsx)(J,{children:`Platform`}),(0,Z.jsx)(J,{children:`Patches`}),(0,Z.jsx)(J,{children:`Target`}),(0,Z.jsx)(J,{children:`Enabled`}),(0,Z.jsx)(J,{children:`Force update`}),(0,Z.jsx)(J,{children:`Rollout`}),g.map(({feature:e,label:t})=>(0,Z.jsx)(J,{children:t},e)),(0,Z.jsx)(J,{children:`Message`}),(0,Z.jsx)(J,{children:`Created`})]})}),(0,Z.jsxs)(sn,{children:[c.isPending?Array.from({length:7},(e,t)=>(0,Z.jsx)(cn,{children:(0,Z.jsx)(Y,{colSpan:_,children:(0,Z.jsx)(b,{className:`h-8 w-full`})})},t)):u.map(t=>{let n=o===t.id,r=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(cn,{"aria-label":`Open bundle ${t.id}`,className:v(`cursor-pointer transition-[background-color,filter] hover:bg-muted/10 focus-within:bg-muted/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring motion-reduce:transition-none data-[state=selected]:bg-muted/15 [&>td]:py-3`,t.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,n&&`bg-primary/5`),"data-state":e.releaseId===t.id?`selected`:void 0,onClick:n=>{n.target instanceof Element&&n.target.closest(`button, a, input, select, textarea`)||x({...e,releaseId:t.id},!1)},onKeyDown:n=>{n.target!==n.currentTarget||n.key!==`Enter`&&n.key!==` `||(n.preventDefault(),x({...e,releaseId:t.id},!1))},tabIndex:0,children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(Zi,{expanded:n,onOpen:()=>x({...e,releaseId:t.id},!1),onToggleExpand:()=>s(n?void 0:t.id),release:t})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(bn,{channel:y.get(t.channel_id)??t.channel_id})}),(0,Z.jsx)(Y,{className:`whitespace-nowrap`,children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(st,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]})}),(0,Z.jsx)(Y,{children:t.bundle_id&&d[t.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):t.bundle_id&&d[t.bundle_id]>0?(0,Z.jsxs)(q,{variant:`secondary`,children:[d[t.bundle_id],` `,d[t.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:t.target_app_version?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Re,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`font-medium`,children:t.target_app_version})]}):t.fingerprint_hash?(0,Z.jsxs)(`span`,{className:`flex min-w-[160px] items-center gap-2`,children:[(0,Z.jsx)(pn,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(At,{maxLength:12,value:t.fingerprint_hash})]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(xn,{enabled:t.enabled}),(0,Z.jsx)(`span`,{className:`sr-only`,children:t.enabled?`Enabled`:`Disabled`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(xn,{enabled:t.should_force_update,falseIcon:`minus`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:t.should_force_update?`Required`:`Optional`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Wi,{percentage:t.rollout_cohort_count/10})}),g.map(({Cell:e,feature:n})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(e,{releaseId:t.id,releases:h})},n)),(0,Z.jsx)(Y,{className:`text-sm text-muted-foreground`,title:t.message??void 0,children:t.message||`-`}),(0,Z.jsx)(Y,{className:`whitespace-nowrap text-xs text-muted-foreground`,title:Ji.format(t.created_at_ms),children:Yi.format(t.created_at_ms)})]}),n&&t.bundle_id?(0,Z.jsx)(cn,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:_,children:(0,Z.jsx)(Qi,{onDetailClick:C,panelId:r,release:t})})}):null]},t.id)}),!c.isPending&&u.length===0?(0,Z.jsx)(cn,{children:(0,Z.jsx)(Y,{className:`h-40 text-center text-muted-foreground`,colSpan:_,children:w?`No more bundles on this side.`:Be(e)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):null]})]})}),!c.isError&&!c.isPending?(0,Z.jsxs)(`nav`,{"aria-label":`Bundle pagination`,className:`flex flex-col gap-3 px-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Z.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:[(0,Z.jsx)(`span`,{className:`text-foreground`,children:u.length}),` `,u.length===1?`entry`:`entries`,`, newest first`]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 sm:justify-end`,children:[w?(0,Z.jsx)(V,{className:p({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`ghost`}),search:ee,to:`/`,children:`Newest`}):null,T?(0,Z.jsxs)(V,{className:p({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:T,to:`/`,children:[(0,Z.jsx)(un,{"data-icon":`inline-start`}),`Previous`]}):(0,Z.jsxs)(a,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[(0,Z.jsx)(un,{"data-icon":`inline-start`}),`Previous`]}),E?(0,Z.jsxs)(V,{className:p({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:E,to:`/`,children:[`Next`,(0,Z.jsx)(De,{"data-icon":`inline-end`})]}):(0,Z.jsxs)(a,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[`Next`,(0,Z.jsx)(De,{"data-icon":`inline-end`})]})]})]}):null]}),(0,Z.jsx)(Hi,{channels:l,onOpenChange:t=>!t&&x({...e,releaseId:void 0},!1),onShowScope:e=>S({scopeKey:e}),open:!!e.releaseId,releaseId:e.releaseId??``}),(0,Z.jsx)(On,{onOpenChange:i,open:r})]})}export{$i as component};
1
+ import{$n as e,$r as t,$t as n,Bn as r,F as i,Fn as a,Gn as o,Gt as s,H as c,Hn as l,Hr as u,Ht as d,I as f,In as p,Jn as m,Jt as h,Kt as g,L as _,Ln as v,M as y,Nn as b,P as x,Pn as S,R as C,U as w,Un as T,Ut as E,Vt as ee,Wn as te,Wt as ne,Xn as re,Yn as ie,Z as ae,Zn as D,_ as oe,_n as se,ar as O,b as ce,ct as k,ei as A,er as le,fn as j,g as ue,gn as de,h as M,ir as N,ni as P,p as fe,qt as F,rn as I,sn as L,sr as R,st as z,un as B,v as pe,vn as me,w as he,y as ge,yn as _e}from"./sidebar-RBvHzq8e.js";import{l as V}from"./console-features-api-BhUIxeL-.js";import{a as H,i as U,l as ve,n as ye,o as W,r as G,s as be,t as xe}from"./alert-dialog-DXxrSU0G.js";import{a as Se,c as Ce,d as we,f as Te,g as Ee,h as De,i as Oe,l as ke,m as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as K,u as Ie}from"./api-BiZP_i-u.js";import{a as Le,c as Re,i as ze,n as Be,r as Ve,s as He,t as Ue}from"./routes-DQWmO9Ow.js";import{a as We,c as Ge,d as Ke,f as qe,i as Je,n as Ye,o as Xe,r as Ze,s as q,t as Qe,u as $e}from"./field-bPoDrs6K.js";import{a as et,i as tt,n as nt,o as rt,r as it}from"./useCompositeListItem-BxJspDxS.js";import{A as at,F as ot,I as st,L as ct,N as lt,O as ut,_ as dt,a as ft,c as pt,h as mt,i as ht,k as gt,l as _t,m as vt,n as yt,o as bt,s as xt,t as St,u as Ct,v as wt}from"./valueToPercent-Ci2-fmWp.js";import{a as Tt,i as Et,l as Dt,n as Ot,o as kt,s as At,t as jt,u as Mt}from"./input-group-_PD0i7wZ.js";import{t as Nt}from"./loader-circle-iTGehfyV.js";import{a as Pt,c as Ft,i as It,n as Lt,o as Rt,r as zt,s as Bt,t as Vt}from"./dialog-DxjO7ofz.js";import{a as Ht,n as Ut,o as Wt,r as Gt,s as Kt,t as qt}from"./card-DKr2pZMA.js";import{n as Jt}from"./dist-BzWwzt98.js";import{c as Yt,d as Xt,f as Zt,h as Qt,l as $t,m as en,o as tn,p as nn,s as rn,u as an}from"./InsightsInfo-B8i-PPsH.js";import{a as on,i as J,n as sn,o as cn,r as Y,t as ln}from"./table-BYmouPt9.js";var un=O(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),dn=O(`circle-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.35 2.69A10 10 0 0 1 21.3 15.65`,key:`1pfsoa`}],[`path`,{d:`M19.08 19.08A10 10 0 1 1 4.92 4.92`,key:`1ablyi`}]]),fn=O(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),pn=O(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),mn=O(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),hn=O(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),gn=O(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),_n=O(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),vn=O(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),X=P(t(),1),Z=u(),yn={production:`bg-green-500/10 text-green-700 dark:text-green-400 border-green-500/20`,dev:`bg-blue-500/10 text-blue-700 dark:text-blue-400 border-blue-500/20`,staging:`bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 border-yellow-500/20`};function bn({channel:e,className:t}){return(0,Z.jsx)(q,{variant:`outline`,className:v(yn[e.toLowerCase()]||`bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20`,t),children:e})}function xn({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(qe,{className:v(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(hn,{className:v(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Z.jsx)(N,{className:v(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}var Sn=A(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),ee=E.prototype;return w.prototype=ee,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){ee[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),Cn=A(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e||={};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],p=f.length,m=0;m<p;m+=1){var h=f[m];h.d&&(c=o?n(t).diff(a,h.d,!0):a.diff(t,h.d,!0));var g=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,g<=h.r||!h.r){g<=1&&m>0&&(h=f[m-1]);var _=d[h.l];s&&(g=s(``+g)),l=typeof _==`string`?_.replace(`%d`,g):_(g,r,h.l,u);break}}if(r)return l;var v=u?d.future:d.past;return typeof v==`function`?v(l):v.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))})),wn=P(Sn(),1),Tn=P(Cn(),1);wn.default.extend(Tn.default);function En({uuid:e,format:t=`relative`}){let n=(0,wn.default)(tn(e));return t===`relative`?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.fromNow()}):t===`absolute`?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)}):(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{className:`text-sm`,children:n.fromNow()}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)})]})}function Dn({panelId:e,bundle:t,bundles:n,loading:r,onDetailClick:i}){let o=M();return(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id:e,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Advanced artifact diagnostics`}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 text-sm sm:items-center`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`Base artifact ID`}),(0,Z.jsx)(ct,{bundleId:t.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(q,{variant:`outline`,children:[n.length,` `,n.length===1?`patch`:`patches`]})]}),r?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(b,{className:`h-10 w-full`}),(0,Z.jsx)(b,{className:`h-10 w-full`})]}):n.length>0?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),o?(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.map(e=>(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Target artifact ID`}),(0,Z.jsx)(ct,{bundleId:e.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Relation`}),(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-1 text-sm`,children:[(0,Z.jsx)(ct,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(Ee,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(ct,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Artifact`}),(0,Z.jsx)(q,{variant:`secondary`,children:`bsdiff`})]}),(0,Z.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Created`}),(0,Z.jsx)(`div`,{className:`text-xs tabular-nums text-foreground`,children:(0,Z.jsx)(En,{uuid:e.id})})]})]}),(0,Z.jsx)(a,{className:`w-full`,onClick:()=>i(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})]})},e.id))}):(0,Z.jsx)(`div`,{className:`overflow-x-auto rounded-md border bg-background`,children:(0,Z.jsxs)(ln,{className:`min-w-max`,children:[(0,Z.jsx)(on,{children:(0,Z.jsxs)(cn,{className:`hover:bg-transparent`,children:[(0,Z.jsx)(J,{children:`Target artifact ID`}),(0,Z.jsx)(J,{children:`Relation`}),(0,Z.jsx)(J,{children:`Artifact`}),(0,Z.jsx)(J,{children:`Created`}),(0,Z.jsx)(J,{className:`w-24 text-right`,children:`Detail`})]})}),(0,Z.jsx)(sn,{children:n.map(e=>(0,Z.jsxs)(cn,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(ct,{bundleId:e.id,fullOnMobile:!0,maxLength:18})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`div`,{className:`flex min-w-[280px] flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[(0,Z.jsx)(ct,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(Ee,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(ct,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(q,{variant:`secondary`,children:`bsdiff`})}),(0,Z.jsx)(Y,{className:`tabular-nums`,children:(0,Z.jsx)(En,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(a,{onClick:()=>i(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})})]},e.id))})]})})]}):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3 text-sm text-muted-foreground`,children:`No direct patch artifacts.`})]})]})})}function On({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[i,o]=(0,X.useState)(null),{data:s=[],isPending:c}=Oe(),l=Me(),u=Fe(),d=n.trim(),f=async e=>{if(e.preventDefault(),!(!d||l.isPending))try{let e=await l.mutateAsync({name:d});r(``),e.inserted?Jt.success(`Channel ${e.row.name} created`):Jt.info(`Channel ${e.row.name} already exists`)}catch(e){Jt.error(`Failed to create channel`),console.error(e)}},p=async()=>{if(!(!i||u.isPending))try{let e=await u.mutateAsync({id:i.id});e.deleted?Jt.success(`Channel ${i.name} deleted`):e.reason===`not_empty`?Jt.error(`Channel ${i.name} is still in use and cannot be deleted`):Jt.error(`Channel ${i.name} no longer exists`),o(null)}catch(e){Jt.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Vt,{open:e,onOpenChange:t,children:(0,Z.jsxs)(Lt,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsxs)(Rt,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(gn,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(zt,{children:`Create deployment channels and remove them when no bundle uses them. Empty channels remain available until you delete them.`})]}),(0,Z.jsx)(`form`,{onSubmit:f,children:(0,Z.jsx)(Je,{className:`gap-2`,children:(0,Z.jsxs)(Qe,{orientation:`horizontal`,children:[(0,Z.jsx)(We,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(ae,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:l.isPending}),(0,Z.jsxs)(a,{type:`submit`,disabled:!d||l.isPending,children:[l.isPending?(0,Z.jsx)(Nt,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(Ft,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,Z.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:c?(0,Z.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,Z.jsx)(Nt,{className:`mr-2 size-3.5 animate-spin`}),`Loading channels`]}):s.length===0?(0,Z.jsx)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:`No channels yet`}):(0,Z.jsx)(`ul`,{className:`divide-y`,children:s.map(e=>(0,Z.jsxs)(`li`,{className:`flex min-h-12 items-center gap-3 px-3 py-2`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`p`,{className:`truncate text-xs font-medium`,children:e.name}),(0,Z.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:e.id})]}),(0,Z.jsx)(a,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:u.isPending,onClick:()=>o(e),className:`text-muted-foreground hover:text-destructive`,children:(0,Z.jsx)(vn,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(xe,{open:i!==null,onOpenChange:e=>{!e&&!u.isPending&&o(null)},children:(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(be,{children:[(0,Z.jsxs)(ve,{children:[`Delete `,i?.name,`?`]}),(0,Z.jsx)(H,{children:`Only empty channels can be removed. The server checks this when you delete it, and the channel can be created again later with a new ID.`})]}),(0,Z.jsxs)(W,{children:[(0,Z.jsx)(G,{disabled:u.isPending,children:`Cancel`}),(0,Z.jsx)(ye,{variant:`destructive`,disabled:u.isPending,onClick:e=>{e.preventDefault(),p()},children:u.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var kn=`[a-zA-Z0-9-]`,An=String.raw`0|[1-9]\d*`,jn=String.raw`\d+`,Mn=String.raw`\d*[a-zA-Z-]${kn}*`,Nn=String.raw`(${An})\.(${An})\.(${An})`,Pn=String.raw`(${jn})\.(${jn})\.(${jn})`,Fn=`(?:${Mn}|${An})`,In=`(?:${Mn}|${jn})`,Ln=String.raw`(?:-(${Fn}(?:\.${Fn})*))`,Rn=String.raw`(?:-?(${In}(?:\.${In})*))`,zn=`${kn}+`,Bn=String.raw`(?:\+(${zn}(?:\.${zn})*))`,Vn=`v?${Nn}${Ln}?${Bn}?`,Hn=String.raw`[v=\s]*${Pn}${Rn}?${Bn}?`,Un=`((?:<|>)?=?)`,Wn=String.raw`${An}|x|X|\*`,Gn=String.raw`${jn}|x|X|\*`,Kn=String.raw`[v=\s]*(${Wn})(?:\.(${Wn})(?:\.(${Wn})(?:${Ln})?${Bn}?)?)?`,qn=String.raw`[v=\s]*(${Gn})(?:\.(${Gn})(?:\.(${Gn})(?:${Rn})?${Bn}?)?)?`,Jn=`(?:~>?)`,Yn=String.raw`(?:\^)`,Xn=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${Xn}(?:$|[^\d])`,String.raw`${Xn}(?:${Ln})?(?:${Bn})?(?:$|[^\d])`;function Zn(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[kn,250]];for(let[n,r]of t)e=e.split(`${n}*`).join(`${n}{0,${r}}`).split(`${n}+`).join(`${n}{1,${r}}`);return e}function Q(e,t){return new RegExp(Zn(e),t)}var Qn=Q(`^${Vn}$`),$n=Q(`^${Hn}$`),er=/^\d+$/;function tr(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function nr(e,t={}){if(typeof e!=`string`)return e;if(e.length>256)throw TypeError(`Version exceeds the maximum length of 256 characters`);let n=e.trim().match(t.loose?$n:Qn);if(!n)throw TypeError(`Invalid version syntax: ${e}`);let r=Number(n[1]),i=Number(n[2]),a=Number(n[3]);if(r>2**53-1||r<0)throw TypeError(`Invalid major version: ${n[1]}`);if(i>2**53-1||i<0)throw TypeError(`Invalid minor version: ${n[2]}`);if(a>2**53-1||a<0)throw TypeError(`Invalid patch version: ${n[3]}`);let o=n[4]?n[4].split(`.`).map(e=>{if(er.test(e)){let t=Number(e);if(t>=0&&t<2**53-1)return t}return e}):void 0;return{build:n[5]?.split(`.`),major:r,minor:i,patch:a,prerelease:o}}var rr=Q(String.raw`^${Un}\s*(${Vn})$|^$`),ir=Q(String.raw`^${Un}\s*(${Hn})$|^$`);function ar(e){return e.version?`${e.operator}${tr(e.version)}`:``}function or(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?ir:rr);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?nr(r[2],t):null;return{operator:i,options:t,value:a?`${i}${tr(a)}`:``,version:a}}function sr(e){return e.sets.map(e=>e.map(ar).join(` `)).join(`||`)}var cr=new RegExp(Bn,`g`),lr=Q(Bn),ur=Q(String.raw`^\s*(${Kn})\s+-\s+(${Kn})\s*$`),dr=Q(String.raw`^\s*(${qn})\s+-\s+(${qn})\s*$`),fr=Q(String.raw`(\s*)${Un}\s*(${Hn}|${Kn})`,`g`),pr=Q(String.raw`(\s*)${Jn}\s+`,`g`),mr=Q(String.raw`(\s*)${Yn}\s+`,`g`),hr=Q(`^${Jn}${Kn}$`),gr=Q(`^${Jn}${qn}$`),_r=Q(`^${Yn}${Kn}$`),vr=Q(`^${Yn}${qn}$`),yr=Q(String.raw`^${Un}\s*${Kn}$`),br=Q(String.raw`^${Un}\s*${qn}$`),xr=Q(String.raw`(<|>)?=?\s*\*`),Sr=/^\s*>=\s*0\.0\.0\s*$/,Cr=/^\s*>=\s*0\.0\.0-0\s*$/,wr=Q(String.raw`^${Un}\s*(${Hn})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Tr(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function Er(e,t){let n=t.loose?gr:hr,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:a?`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`)}function Dr(e,t){return e.trim().split(/\s+/).map(e=>Er(e,t)).join(` `)}function Or(e,t){let n=t.loose?vr:_r,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?t===`0`?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.0${r} <${Number(t)+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${i}-${a} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i}-${a} <${Number(t)+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${i} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${Number(t)+1}.0.0-0`)}function kr(e,t){return e.trim().split(/\s+/).map(e=>Or(e,t)).join(` `)}function Ar(e,t){let n=t.loose?br:yr;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Tr(String(c),l===void 0?void 0:String(l),u===void 0?void 0:String(u)))return e;let d=$(c),f=d||$(l),p=f||$(u);if(s===`=`&&p&&(s=``),d)return s===`>`||s===`<`?`<0.0.0-0`:`*`;let m=t.includePrerelease?`-0`:``;return s&&p?(f&&(l=0),u=0,s===`>`?(s=`>=`,f?(c=Number(c)+1,l=0):l=Number(l)+1):s===`<=`&&(s=`<`,f?c=Number(c)+1:l=Number(l)+1),s===`<`&&(m=`-0`),`${s}${c}.${l}.${u}${m}`):f?`>=${c}.0.0${m} <${Number(c)+1}.0.0-0`:p?`>=${c}.${l}.0${m} <${c}.${Number(l)+1}.0-0`:n})}function jr(e,t){return e.split(/\s+/).map(e=>Ar(e,t)).join(` `)}function Mr(e,t){let n=t.loose?dr:ur;return e.replace(n,(e,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n,m=c;return p=$(r)?``:$(i)?`>=${r}.0.0${t.includePrerelease?`-0`:``}`:$(a)?`>=${r}.${i}.0${t.includePrerelease?`-0`:``}`:o?`>=${p}`:`>=${p}${t.includePrerelease?`-0`:``}`,m=$(l)?``:$(u)?`<${Number(l)+1}.0.0-0`:$(d)?`<${l}.${Number(u)+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:t.includePrerelease?`<${l}.${u}.${Number(d)+1}-0`:`<=${m}`,`${p} ${m}`.trim()})}function Nr(e,t){return jr(Dr(kr(e.replace(lr,``),t),t),t).trim().replace(xr,``)}function Pr(e,t){let n=Mr(e.replace(cr,``),t).replace(fr,`$1$2$3`).replace(pr,`$1~`).replace(mr,`$1^`).split(` `).map(e=>Nr(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Cr:Sr,``));t.loose&&(n=n.filter(e=>wr.test(e)));let r=new Map;for(let e of n.map(e=>or(e,t))){if(e.value===`<0.0.0-0`)return[e];r.set(e.value,e)}return r.size>1&&r.delete(``),[...r.values()]}function Fr(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Pr(e.trim(),n)).filter(e=>e.length);if(!i.length)throw TypeError(`Range contains no valid comparator sets: ${r}`);if(i.length>1){let e=i[0];if(i=i.filter(e=>e[0]?.value!==`<0.0.0-0`),!i.length)i=[e];else if(i.length>1){let e=i.find(e=>e.length===1&&e[0]?.value===``);e&&(i=[e])}}return{options:n,sets:i}}function Ir(e,t={}){try{return Fr(e,t)}catch{return null}}function Lr(e,t={}){let n=Ir(e,t);return n?sr(n)||`*`:null}var Rr=e=>{let t=e.trim();if(t.startsWith(`git@`)){let e=t.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(e)return`https://${e[1]}/${e[2]}`}if(t.startsWith(`ssh://`))try{let e=new URL(t);return`https://${e.hostname}${e.pathname}`.replace(/\/+$/,``).replace(/\.git$/,``)}catch{return t.replace(/\/+$/,``).replace(/\.git$/,``)}return t.replace(/\/+$/,``).replace(/\.git$/,``)},zr=(e,t)=>{if(!e?.trim())return null;let n=Rr(e);try{let{hostname:e}=new URL(n);if(e.includes(`gitlab`))return`${n}/-/commit/${t}`;if(e.includes(`bitbucket`))return`${n}/commits/${t}`}catch{}return`${n}/commit/${t}`};function Br({label:e,value:t}){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-start sm:justify-between sm:gap-4`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,Z.jsx)(`dd`,{className:`min-w-0 text-left text-sm sm:text-right`,children:t})]})}function Vr({bundle:e,release:t}){let{data:n,isFetched:r}=Se(),i=e?Zt(e):null,a=e?Xt(e):null,o=e?.gitCommitHash&&r?zr(n?.console.gitUrl,e.gitCommitHash):null,s=t.strategy===`APP_VERSION`?t.target_app_version:t.fingerprint_hash;return s||e?.gitCommitHash||e?.manifestFileHash||a||i?(0,Z.jsxs)(qt,{children:[(0,Z.jsx)(Ht,{className:`p-4 pb-3`,children:(0,Z.jsx)(Wt,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(Ut,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(Br,{label:t.strategy===`APP_VERSION`?`Target app version`:`Fingerprint target`,value:(0,Z.jsx)(`span`,{className:`break-all font-mono text-xs`,translate:`no`,children:s??`—`})}),e?.gitCommitHash?(0,Z.jsx)(Br,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(At,{className:o?`text-primary`:void 0,maxLength:12,value:e.gitCommitHash}),o?(0,Z.jsx)(`a`,{"aria-label":`Open git commit`,className:`shrink-0 text-primary hover:underline`,href:o,rel:`noopener noreferrer`,target:`_blank`,children:(0,Z.jsx)(fn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(Br,{label:`Manifest hash`,value:(0,Z.jsx)(At,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(Br,{label:`Base hash`,value:(0,Z.jsx)(At,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(Br,{label:`Patch hash`,value:(0,Z.jsx)(At,{maxLength:16,value:i})}):null]})})]}):null}var Hr=Array.from({length:Yt},(e,t)=>t+1);function Ur({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=Qt(t),i=n??[],o=i.length>0,s=r>0&&r<1e3,c=r===Yt,l=M(),u=c?Hr:s?Hr.filter(t=>$t(e,t)<r):[],d=(r/10).toFixed(1),f=c?Yt:u.length,p=Yt-f,m=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,Z.jsx)(qt,{children:(0,Z.jsxs)(Ht,{className:`p-4`,children:[(0,Z.jsx)(Gt,{children:`Selected cohorts`}),(0,Z.jsx)(Wt,{className:`font-mono text-2xl tabular-nums`,children:f})]})}),(0,Z.jsx)(qt,{children:(0,Z.jsxs)(Ht,{className:`p-4`,children:[(0,Z.jsx)(Gt,{children:`Excluded cohorts`}),(0,Z.jsx)(Wt,{className:`font-mono text-2xl tabular-nums`,children:p})]})})]}),o?(0,Z.jsxs)(qt,{children:[(0,Z.jsxs)(Ht,{className:`p-4 pb-3`,children:[(0,Z.jsx)(Wt,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(Gt,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(Ut,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-lg border bg-muted/20 p-3`,children:i.map(e=>(0,Z.jsx)(q,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Z.jsxs)(qt,{children:[(0,Z.jsx)(Ht,{className:`p-4 pb-3`,children:(0,Z.jsx)(Wt,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(Ut,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`max-h-[50vh] overflow-y-auto overscroll-contain rounded-lg border bg-muted/20 p-3 sm:max-h-[45vh]`,children:u.length>0?(0,Z.jsx)(`div`,{"aria-label":`Included numeric cohorts`,className:`grid grid-cols-3 gap-2 sm:grid-cols-6 lg:grid-cols-8`,role:`list`,children:u.map(e=>(0,Z.jsx)(q,{className:`justify-center font-mono tabular-nums`,role:`listitem`,variant:`outline`,children:e},e))}):(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No numeric cohorts are included.`})})})]})]});return(0,Z.jsxs)(Vt,{children:[(0,Z.jsxs)(Bt,{render:(0,Z.jsx)(a,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(et,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(Lt,{className:l?`top-0 left-0 h-dvh max-w-none translate-x-0 translate-y-0 rounded-none border-0 p-0`:`sm:max-w-3xl`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,Z.jsxs)(Pt,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(Rt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(zt,{children:[d,`% includes `,f,` of`,` `,Yt,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain px-4 py-4`,children:m}),(0,Z.jsx)(It,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Rt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(zt,{children:[d,`% includes `,f,` of`,` `,Yt,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),m,(0,Z.jsx)(It,{showCloseButton:!0})]})})]})}function Wr(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Gr(e,t){return e-t}function Kr(e,t,n){let r=e.slice();return r[t]=n,r.sort(Gr)}function qr(e,t,n,r,i,a){let o=e;return o=dt(o,n,r),i&&(o=Kr(a,t,dt(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function Jr(e,t,n){if(!Array.isArray(e))return!0;let r=e.reduce((e,t,n,r)=>(n===r.length-1||e.push(Math.abs(t-r[n+1])),e),[]);return Math.min(...r)>=t*n}var Yr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...ot},Xr=X.createContext(void 0);function Zr(){let e=X.useContext(Xr);if(e===void 0)throw Error(m(62));return e}function Qr(e){return`key`in e?L:I}function $r(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?Wr(e,t):!1}var ei=X.forwardRef(function(e,t){let{"aria-labelledby":n,className:i,defaultValue:a,disabled:o=!1,id:c,format:l,largeStep:u=10,locale:d,render:f,max:p=100,min:m=0,minStepsBetweenValues:g=0,form:_,name:v,onValueChange:y,onValueCommitted:b,orientation:x=`horizontal`,step:S=1,thumbCollisionBehavior:C=`push`,thumbAlignment:w=`center`,value:T,style:ee,...te}=e,ne=k(c),ie=vt(ne),ae=D(y),oe=D(b),{clearErrors:O}=wt(),{state:ce,disabled:A,name:le,setTouched:j,setDirty:ue,validityData:de,shouldValidateOnChange:M,validation:N}=lt(),{labelId:P}=gt(),[fe,I]=X.useState(),L=n??mt(P,fe),R=A||o,z=le??v,[B,pe]=tt({controlled:T,default:a??m,name:`Slider`}),ge=X.useRef(null),_e=X.useRef(null),V=X.useRef([]),H=X.useRef(null),U=X.useRef(null),ve=X.useRef(-1),ye=X.useRef(null),W=X.useRef(null),G=X.useRef(`none`),be=s(l),[xe,Se]=X.useState(-1),[Ce,we]=X.useState(-1),[Te,Ee]=X.useState(!1),[De,Oe]=X.useState(()=>new Map),[ke,Ae]=X.useState([void 0,void 0]),je=D(e=>{Se(e),e!==-1&&we(e)});at(_e,ne,B),he(B,()=>{O(z),M()?N.commit(B):N.commit(B,!0);let e=de.initialValue,t;t=Array.isArray(B)&&Array.isArray(e)?!Wr(B,e):B!==e,ue(t)});let Me=D(e=>{e&&(_e.current=e)}),Ne=Array.isArray(B),Pe=X.useMemo(()=>Ne?B.slice().sort(Gr):[dt(B,m,p)],[p,m,Ne,B]),Fe=D((e,t)=>{if(Number.isNaN(e)||$r(e,B))return;let n=t??F(`none`,void 0,void 0,{activeThumbIndex:-1});G.current=n.reason;let r=n.event,i=new(r.constructor??Event)(r.type,r);Object.defineProperty(i,`target`,{writable:!0,value:{value:e,name:z}}),n.event=i,W.current=e,ae(e,n),!n.isCanceled&&pe(e)}),K=D((e,t,n)=>{let r=qr(e,t,m,p,Ne,Pe);if(Jr(r,S,g)){let e=Qr(n);Fe(r,F(e,n.nativeEvent,void 0,{activeThumbIndex:t})),j(!0),oe(W.current??r,h(e,n.nativeEvent))}});re(()=>{let e=se(E(ge.current));R&&me(ge.current,e)&&e.blur()},[R]),R&&xe!==-1&&je(-1);let Ie=X.useMemo(()=>({...ce,activeThumbIndex:xe,disabled:R,dragging:Te,orientation:x,max:p,min:m,minStepsBetweenValues:g,step:S,values:Pe}),[ce,xe,R,Te,p,m,g,x,S,Pe]),Le=X.useMemo(()=>({active:xe,controlRef:_e,disabled:R,dragging:Te,validation:N,formatOptionsRef:be,handleInputChange:K,indicatorPosition:ke,inset:w!==`center`,labelId:L,rootLabelId:ie,largeStep:u,lastUsedThumbIndex:Ce,lastChangedValueRef:W,lastChangeReasonRef:G,form:_,locale:d,max:p,min:m,minStepsBetweenValues:g,name:z,onValueCommitted:oe,orientation:x,pressedInputRef:H,pressedThumbCenterOffsetRef:U,pressedThumbIndexRef:ve,pressedValuesRef:ye,registerFieldControlRef:Me,renderBeforeHydration:w===`edge`,setActive:je,setDragging:Ee,setIndicatorPosition:Ae,setLabelId:I,setValue:Fe,state:Ie,step:S,thumbCollisionBehavior:C,thumbMap:De,thumbRefs:V,values:Pe}),[xe,_e,L,ie,R,Te,N,be,K,ke,u,Ce,W,G,_,d,p,m,g,z,oe,x,H,U,ve,ye,Me,je,Ee,Ae,I,Fe,Ie,S,C,w,De,V,Pe]),Re=r(`div`,e,{state:Ie,ref:[t,ge],props:[{"aria-labelledby":L,id:ne,role:`group`},N.getValidationProps,te],stateAttributesMapping:Yr});return(0,Z.jsx)(Xr.Provider,{value:Le,children:(0,Z.jsx)(it,{elementsRef:V,onMapChange:Oe,children:Re})})});function ti(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function ni(e){if(e===0)return 0;if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function ri(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(ni(t),ni(n))))}function ii({values:e,index:t,nextValue:n,min:r,max:i,step:a,minStepsBetweenValues:o,initialValues:s}){if(e.length===0)return[];let c=e.slice(),l=a*o,u=c.length-1,d=s??e;c[t]=dt(n,r+t*l,i-(u-t)*l);for(let e=t+1;e<=u;e+=1){let t=c[e-1]+l,n=i-(u-e)*l,r=d[e]??c[e],a=Math.max(c[e],t);r<a&&(a=Math.max(r,t)),c[e]=dt(a,t,n)}for(let e=t-1;e>=0;--e){let t=c[e+1]-l,n=r+e*l,i=d[e]??c[e],a=Math.min(c[e],t);i>a&&(a=Math.min(i,t)),c[e]=dt(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function ai({behavior:e,values:t,currentValues:n,initialValues:r,pressedIndex:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}){let u=n??t,d=r??t;if(!(u.length>1))return{value:a,thumbIndex:0,didSwap:!1};let f=c*l;switch(e){case`swap`:{let e=u[i],t=1e-7,n=u.slice(),r=n[i-1],p=n[i+1],m=dt(a,r==null?o:r+f,p==null?s:p-f),h=Number(m.toFixed(12));n[i]=h;let g=a>e,_=a<e,v=g&&p!=null&&a>=p-t,y=_&&r!=null&&a<=r+t;if(!v&&!y)return{value:n,thumbIndex:i,didSwap:!1};let b=v?i+1:i-1,x=n.map((e,t)=>t===i?h:d[t]??u[t]),S=a;S=v?Math.max(a,n[b]):Math.min(a,n[b]);let C=ii({values:n,index:b,nextValue:S,min:o,max:s,step:c,minStepsBetweenValues:l,initialValues:x}),w=v?b-1:b+1;if(w>=0&&w<C.length){let e=C[w-1],t=C[w+1],n=e==null?o:e+f;n=Math.max(n,o+w*f);let r=t==null?s:t-f;r=Math.min(r,s-(C.length-1-w)*f);let i=dt(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:ii({values:u,index:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}),thumbIndex:i,didSwap:!1};default:{let e=u.slice(),t=e[i-1],n=e[i+1],r=dt(a,t==null?o:t+f,n==null?s:n-f);return e[i]=Number(r.toFixed(12)),{value:e,thumbIndex:i,didSwap:!1}}}}var oi=2;function si(e,t){if(!e)return{start:0,end:0};function n(e){let t=e==null?0:parseFloat(e);return Number.isNaN(t)?0:t}let r=t?`Top`:`InlineStart`,i=t?`Bottom`:`InlineEnd`;return{start:n(e[`border${r}Width`])+n(e[`padding${r}`]),end:n(e[`border${i}Width`])+n(e[`padding${i}`])}}function ci(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return null}return{x:e.clientX,y:e.clientY}}var li=X.forwardRef(function(t,i){let{render:a,className:o,style:c,...l}=t,{disabled:u,dragging:d,inset:f,lastChangedValueRef:p,lastChangeReasonRef:m,max:_,min:v,minStepsBetweenValues:y,onValueCommitted:b,orientation:x,pressedInputRef:S,pressedThumbCenterOffsetRef:C,pressedThumbIndexRef:w,pressedValuesRef:T,registerFieldControlRef:ee,renderBeforeHydration:te,setActive:re,setDragging:ie,setValue:ae,state:oe,step:O,thumbCollisionBehavior:ce,thumbRefs:k,values:A}=Zr(),ue=z(),de=A.length>1,M=x===`vertical`,N=X.useRef(null),P=X.useRef(null),fe=D(t=>{t&&P.current==null&&(P.current=e(t).getComputedStyle(t))}),I=X.useRef(null),L=X.useRef(0),R=X.useRef(0),B=s(A);function pe(e){w.current!==e&&(w.current=e);let t=k.current[e];if(!t){C.current=null,S.current=null;return}S.current=t.querySelector(`input[type="range"]`)}function he(e){let t=N.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=si(P.current,M),c=R.current,l=(M?r:n)-s.start-s.end-c*2,u=C.current??0,d=e.x-u,f=e.y-u,p=dt(((M?i-f-s.end:(ue===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(_-v)*p+v;if(m=ri(m,O,v),m=dt(m,v,_),!de)return{value:m,thumbIndex:0,didSwap:!1};let h=w.current;if(h<0)return null;let g=ai({behavior:ce,values:A,currentValues:B.current??A,initialValues:T.current,pressedIndex:h,nextValue:m,min:v,max:_,step:O,minStepsBetweenValues:y});return ce===`swap`&&g.didSwap?pe(g.thumbIndex):w.current=g.thumbIndex,g}function ge(e){T.current=de?A.slice():null,B.current=A;let t=w.current,n=t;if(t>-1&&t<A.length){if(A[t]===_){let e=t;for(;e>0&&A[e-1]===_;)--e;n=e}}else{let t=M?`y`:`x`,r;n=-1;for(let i=0;i<k.current.length;i+=1){let a=k.current[i];if(le(a)){let o=ti(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&pe(n),f){let e=k.current[n];le(e)&&(R.current=e.getBoundingClientRect()[M?`height`:`width`]/2)}}function V(e){let t=k.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let H=D(e=>{let t=ci(e,I);if(t==null)return;if(L.current+=1,e.type===`pointermove`&&e.buttons===0){U(e);return}let r=he(t);r!=null&&Jr(r.value,O,y)&&(!d&&L.current>oi&&ie(!0),ae(r.value,F(n,e,void 0,{activeThumbIndex:r.thumbIndex})),B.current=Array.isArray(r.value)?r.value:[r.value],r.didSwap&&V(r.thumbIndex))});function U(e){re(-1),ie(!1),S.current=null,C.current=null;let t=ci(e,I),n=t==null?null:he(t);if(n!=null){let t=m.current;b(p.current??n.value,h(t,e))}`pointerType`in e&&N.current?.hasPointerCapture(e.pointerId)&&N.current?.releasePointerCapture(e.pointerId),w.current=-1,I.current=null,T.current=null,ye()}let ve=D(e=>{if(u)return;let t=e.changedTouches[0];t!=null&&(I.current=t.identifier);let n=ci(e,I);if(n!=null){ge(n);let t=he(n);if(t==null)return;V(t.thumbIndex),ae(t.value,F(j,e,void 0,{activeThumbIndex:t.thumbIndex})),B.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&V(t.thumbIndex)}L.current=0;let r=E(N.current);r.addEventListener(`touchmove`,H,{passive:!0}),r.addEventListener(`touchend`,U,{passive:!0})}),ye=D(()=>{let e=E(N.current);e.removeEventListener(`pointermove`,H),e.removeEventListener(`pointerup`,U),e.removeEventListener(`touchmove`,H),e.removeEventListener(`touchend`,U),T.current=null}),W=ne();return X.useEffect(()=>{let e=N.current;if(!e)return()=>ye();let t=g(e,`touchstart`,ve,{passive:!0});return()=>{t(),W.cancel(),ye()}},[ye,ve,N,W]),X.useEffect(()=>{u&&ye()},[u,ye]),r(`div`,t,{state:oe,ref:[i,ee,N,fe],props:[{"data-base-ui-slider-control":te?``:void 0,onPointerDown(e){let t=N.current,n=_e(e.nativeEvent);if(!t||u||e.defaultPrevented||!le(n)||e.button!==0)return;let r=ci(e,I);if(r!=null){ge(r);let n=he(r);if(n==null)return;me(k.current[n.thumbIndex],se(E(t)))?e.preventDefault():W.request(()=>{V(n.thumbIndex)}),ie(!0),C.current??(ae(n.value,F(j,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),B.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&V(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),L.current=0;let i=E(N.current);i.addEventListener(`pointermove`,H,{passive:!0}),i.addEventListener(`pointerup`,U,{once:!0})}},l],stateAttributesMapping:Yr})}),ui=X.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,{state:s}=Zr();return r(`div`,e,{state:s,ref:t,props:[{style:{position:`relative`}},o],stateAttributesMapping:Yr})}),di=R();function fi(){return T}function pi(){return!1}function mi(){return!0}function hi(){return(0,di.useSyncExternalStore)(fi,pi,mi)}var gi=function(e){return e.index=`data-index`,e.dragging=`data-dragging`,e.orientation=`data-orientation`,e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.focused=`data-focused`,e}({}),_i=new Set([..._,w,c]);function vi(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${yt(e[t],r,n)} start range`:`${yt(e[t],r,n)} end range`:n?yt(e[t],r,n):void 0}function yi(e,t,n,r,i){let a=n===1?e+t:e-t;return dt(Number(a.toFixed(Math.max(ni(e),ni(t),ni(r)))),r,i)}var bi=X.forwardRef(function(t,n){let{render:a,children:o,className:s,"aria-describedby":l,"aria-label":u,"aria-labelledby":d,disabled:p=!1,getAriaLabel:m,getAriaValueText:h,id:g,index:v,inputRef:b,onBlur:S,onFocus:T,onKeyDown:E,tabIndex:ne,style:ae,...oe}=t,{nonce:se}=Ct(),O=k(g),{active:ce,lastUsedThumbIndex:A,controlRef:le,disabled:j,validation:ue,formatOptionsRef:M,handleInputChange:N,inset:P,labelId:fe,largeStep:F,locale:I,max:L,min:R,minStepsBetweenValues:B,form:pe,name:me,orientation:he,pressedInputRef:ge,pressedThumbCenterOffsetRef:_e,pressedThumbIndexRef:V,renderBeforeHydration:H,setActive:U,setIndicatorPosition:ve,state:ye,step:W,values:G}=Zr(),be=z(),xe=p||j,Se=G.length>1,Ce=he===`vertical`,we=be===`rtl`,{setTouched:Te,setFocused:Ee,validationMode:De}=lt(),Oe=X.useRef(null),ke=X.useRef(null),Ae=X.useRef(!1),je=k(),Me=ut(),Ne=Se?je:Me,{ref:Pe,index:Fe}=nt({metadata:X.useMemo(()=>({inputId:Ne}),[Ne])}),K=Se?v??Fe:0,Ie=K===G.length-1,Le=G[K],Re=St(Le,R,L),[ze,Be]=X.useState(),Ve=hi(),He=A>=0&&A<G.length?A:-1,Ue=D(()=>{let e=le.current,t=Oe.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Ce?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Re/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Be(s),K===0?ve(e=>[s,e[1]]):Ie&&ve(e=>[e[0],s])});re(()=>{P&&queueMicrotask(Ue)},[Ue,P]),re(()=>{P&&Ue()},[Ue,P,Re]),re(()=>{if(!P)return;let t=le.current,n=Oe.current;if(!t||!n)return;let r=e(t).ResizeObserver;if(typeof r!=`function`)return;let i=new r(Ue);return i.observe(t),i.observe(n),()=>{i.disconnect()}},[le,Ue,P]);let We=Ce?`bottom`:`insetInlineStart`,Ge=Ce?`left`:`top`,Ke;Se?ce===K?Ke=2:He===K&&(Ke=1):ce===K&&(Ke=1);let qe;qe=P?{"--position":`${ze??0}%`,visibility:H&&Ve||ze===void 0?`hidden`:void 0,position:`absolute`,[We]:`var(--position)`,[Ge]:`50%`,translate:`${(Ce||!we?-1:1)*50}% ${(Ce?1:-1)*50}%`,zIndex:Ke}:Number.isFinite(Re)?{position:`absolute`,[We]:`${Re}%`,[Ge]:`50%`,translate:`${(Ce||!we?-1:1)*50}% ${(Ce?1:-1)*50}%`,zIndex:Ke}:ee;let Je;he===`vertical`&&(Je=we?`vertical-rl`:`vertical-lr`);let Ye=typeof m==`function`?m(K):u,Xe=ie({"aria-label":Ye,"aria-labelledby":d??(Ye==null?fe:void 0),"aria-describedby":l,"aria-orientation":he,"aria-valuenow":Le,"aria-valuetext":typeof h==`function`?h(yt(Le,I,M.current??void 0),Le,K):vi(G,K,M.current??void 0,I),disabled:xe,form:pe,id:Ne,max:L,min:R,name:me,onChange(e){N(e.currentTarget.valueAsNumber,K,e)},onFocus(e){let t=Ae.current;Ae.current=!1,U(K),Ee(!0),t&&e.stopPropagation()},onBlur(e){if(Ae.current){e.stopPropagation();return}Oe.current&&(U(-1),Te(!0),Ee(!1),De===`onBlur`&&ue.commit(qr(Le,K,R,L,Se,G)))},onKeyDown(e){if(!_i.has(e.key))return;_.has(e.key)&&e.stopPropagation();let t=null,n=ri(Le,W,R);switch(e.key){case f:t=yi(n,e.shiftKey?F:W,1,R,L);break;case i:t=yi(n,e.shiftKey?F:W,we?-1:1,R,L);break;case y:t=yi(n,e.shiftKey?F:W,-1,R,L);break;case x:t=yi(n,e.shiftKey?F:W,we?1:-1,R,L);break;case w:t=yi(n,F,1,R,L);break;case c:t=yi(n,F,-1,R,L);break;case`End`:t=L,Se&&(t=Number.isFinite(G[K+1])?G[K+1]-W*B:L);break;case C:t=R,Se&&(t=Number.isFinite(G[K-1])?G[K-1]+W*B:R);break;default:break}if(t!==null){let n=e.currentTarget;de(n)||(Ae.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),N(t,K,e),e.preventDefault()}},step:W,style:{...ee,width:`100%`,height:`100%`,writingMode:Je},tabIndex:ne??void 0,type:`range`,value:Le??``},ue.getInputValidationProps),Ze=te(ke,ue.inputRef,b);return r(`div`,t,{state:ye,ref:[n,Pe,Oe],props:[{[gi.index]:K,children:(0,Z.jsxs)(X.Fragment,{children:[o,(0,Z.jsx)(`input`,{ref:Ze,...Xe,suppressHydrationWarning:!0}),P&&Ve&&H&&Ie&&(0,Z.jsx)(`script`,{nonce:se,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();'},suppressHydrationWarning:!0})]}),id:O,onBlur:S,onFocus:T,onPointerDown(e){if(V.current=K,Oe.current!=null){let t=he===`horizontal`?`x`:`y`,n=ti(Oe.current);_e.current=(he===`horizontal`?e.clientX:e.clientY)-n[t]}ke.current!=null&&ge.current!==ke.current&&(ge.current=ke.current)},style:qe,suppressHydrationWarning:H||void 0},oe],stateAttributesMapping:Yr})});function xi(e,t,n,r,i,a){let o=n===void 0||t&&r===void 0?`hidden`:void 0,s=e?`bottom`:`insetInlineStart`,c=e?`height`:`width`,l={visibility:i&&a?`hidden`:o,position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};return l[`--start-position`]=`${n??0}%`,t?(l[`--relative-size`]=`${(r??0)-(n??0)}%`,l[s]=`var(--start-position)`,l[c]=`var(--relative-size)`,l):(l[s]=0,l[c]=`var(--start-position)`,l)}function Si(e,t,n,r){let i=e?`bottom`:`insetInlineStart`,a=e?`height`:`width`,o={position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};if(!t)return o[i]=0,o[a]=`${n}%`,o;let s=r-n;return o[i]=`${n}%`,o[a]=`${s}%`,o}var Ci=X.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,{indicatorPosition:s,inset:c,max:l,min:u,orientation:d,renderBeforeHydration:f,state:p,values:m}=Zr(),h=hi(),g=d===`vertical`,_=m.length>1,v=c?xi(g,_,s[0],s[1],f,h):Si(g,_,St(m[0],u,l),St(m[m.length-1],u,l));return r(`div`,e,{state:p,ref:t,props:[{"data-base-ui-slider-indicator":f?``:void 0,style:v,suppressHydrationWarning:f||void 0},o],stateAttributesMapping:Yr})});function wi({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...a}){let o=Array.isArray(n)?n:n===void 0?Array.isArray(t)?t:t===void 0?[r]:[t]:[n];return(0,Z.jsx)(ei,{className:v(`data-horizontal:w-full data-vertical:h-full`,e),"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,thumbAlignment:`edge`,...a,children:(0,Z.jsxs)(li,{className:`relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col`,children:[(0,Z.jsx)(ui,{"data-slot":`slider-track`,className:`relative grow overflow-hidden rounded-full bg-primary/20 select-none data-horizontal:h-1.5 data-horizontal:w-full data-vertical:h-full data-vertical:w-1.5`,children:(0,Z.jsx)(Ci,{"data-slot":`slider-range`,className:`bg-primary select-none data-horizontal:h-full data-vertical:w-full`})}),Array.from({length:o.length},(e,t)=>(0,Z.jsx)(bi,{"data-slot":`slider-thumb`,className:`relative block size-4 shrink-0 rounded-full border border-primary/50 bg-background shadow transition-colors select-none after:absolute after:-inset-2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-disabled:pointer-events-none data-disabled:opacity-50`},t))]})})}var Ti=X.createContext(void 0);function Ei(){let e=X.useContext(Ti);if(e===void 0)throw Error(m(63));return e}var Di=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),Oi={...ot,checked(e){return e?{[Di.checked]:``}:{[Di.unchecked]:``}}};function ki(e,t,n,r=!0,i){let[a,o]=X.useState(),s=k(i?`${i}-label`:void 0),c=e??t??a;return re(()=>{let i=e||t||!r?void 0:Ai(n.current,s);a!==i&&o(i)}),c}function Ai(e,t){let n=ji(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function ji(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var Mi=X.forwardRef(function(t,n){let{checked:i,className:a,defaultChecked:s,"aria-labelledby":c,form:u,id:f,inputRef:p,name:m,nativeButton:h=!1,onCheckedChange:g,readOnly:_=!1,required:v=!1,disabled:y=!1,render:b,uncheckedValue:x,value:S,style:C,...w}=t,{clearErrors:T}=wt(),{state:E,setTouched:ne,setDirty:ae,validityData:D,setFilled:oe,setFocused:se,shouldValidateOnChange:O,validationMode:ce,disabled:A,name:le,validation:j}=lt(),{labelId:ue}=gt(),de=A||y,M=le??m,N=X.useRef(null),P=te(N,p,j.inputRef),fe=X.useRef(null),I=k(),L=ut({id:f,implicit:!1,controlRef:fe}),R=h?void 0:L,[z,pe]=tt({controlled:i,default:!!s,name:`Switch`,state:`checked`});at(fe,I,z),re(()=>{N.current&&oe(N.current.checked)},[N,oe]),he(z,()=>{T(M),ae(z!==D.initialValue),oe(z),O()?j.commit(z):j.commit(z,!0)});let{getButtonProps:me,buttonRef:ge}=o({disabled:de,native:h}),_e=ki(c,ue,N,!h,R),V={id:h?L:I,role:`switch`,"aria-checked":z,"aria-readonly":_||void 0,"aria-required":v||void 0,"aria-labelledby":_e,onFocus(){de||se(!0)},onBlur(){let e=N.current;!e||de||(ne(!0),se(!1),ce===`onBlur`&&j.commit(e.checked))},onClick(t){if(_||de)return;t.preventDefault();let n=N.current;n&&n.dispatchEvent(new(e(n)).PointerEvent(`click`,{bubbles:!0,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}},H=ie({checked:z,disabled:de,form:u,id:R,name:M,required:v,style:M?d:ee,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:P,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(_){e.preventDefault();return}let t=e.currentTarget.checked,n=F(B,e.nativeEvent);g?.(t,n),!n.isCanceled&&pe(t)},onFocus(){fe.current?.focus()}},j.getInputValidationProps,S===void 0?l:{value:S}),U=X.useMemo(()=>({...E,checked:z,disabled:de,readOnly:_,required:v}),[E,z,de,_,v]),ve=r(`span`,t,{state:U,ref:[n,fe,ge],props:[V,j.getValidationProps,w,me],stateAttributesMapping:Oi});return(0,Z.jsxs)(Ti.Provider,{value:U,children:[ve,!z&&M&&x!==void 0&&(0,Z.jsx)(`input`,{type:`hidden`,form:u,name:M,value:x}),(0,Z.jsx)(`input`,{...H,suppressHydrationWarning:!0})]})}),Ni=X.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e;return r(`span`,e,{state:Ei(),ref:t,stateAttributesMapping:Oi,props:o})});function Pi({className:e,...t}){return(0,Z.jsx)(Mi,{"data-slot":`switch`,className:v(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...t,children:(0,Z.jsx)(Ni,{"data-slot":`switch-thumb`,className:`pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-checked:translate-x-4 data-unchecked:translate-x-0`})})}var Fi=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],Ii=e=>({enabled:e.enabled,message:e.message??``,rolloutCohortCount:e.rollout_cohort_count,shouldForceUpdate:e.should_force_update,targetAppVersion:e.target_app_version??``,targetCohorts:[...e.target_cohorts]}),Li=(e,t)=>({enabled:t.enabled,message:t.message.trim()||null,rolloutCohortCount:t.rolloutCohortCount,shouldForceUpdate:t.shouldForceUpdate,...e.strategy===`APP_VERSION`?{targetAppVersion:t.targetAppVersion.trim()}:{},targetCohorts:t.targetCohorts}),Ri=e=>(e/10).toFixed(1),zi=e=>{let t=e.replace(`,`,`.`),[n=``,...r]=t.split(`.`),i=n.replace(/\D/g,``).slice(0,3),a=r.join(``).replace(/\D/g,``).slice(0,1);return t.includes(`.`)?`${i}.${a}`:i},Bi=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function Vi({value:e,onChange:t}){let[n,r]=(0,X.useState)(Ri(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(Ri(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(wi,{"aria-label":`Rollout percentage`,max:1e3,min:0,onValueChange:n=>t(Array.isArray(n)?n[0]??e:n),step:1,value:e}),(0,Z.jsxs)(jt,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(Et,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=Bi(n)??e;a(!1),r(Ri(i)),t(i)},onChange:e=>{let n=zi(e.target.value);r(n);let i=Bi(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(Ot,{align:`inline-end`,children:(0,Z.jsx)(Tt,{children:`%`})})]})]})}function Hi({channels:e,onOpenChange:t,onShowScope:n,open:r,releaseId:i}){let o=Te(i),s=o.data,c=Pe(s?.bundle_id??``),l=c.data,u=l?an(l):null,d=we(s?.scope_key??``),f=Ae(),p=ke(),m=Ce(),h=Ie(),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(``),[x,C]=(0,X.useState)(``),[w,T]=(0,X.useState)(!1),[E,ee]=(0,X.useState)(!1),[te,ne]=(0,X.useState)(!1),[re,ie]=(0,X.useState)(``),[D,se]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{_(s?Ii(s):null),C(``)},[s]);let O=s?Ii(s):null,k=g!==null&&O!==null&&JSON.stringify(g)!==JSON.stringify(O),A=p.isPending||f.isPending||m.isPending||h.isPending,le=()=>{if(!A){if(k){T(!0);return}t(!1)}},j=()=>{if(!g)return;let e=en(v);if(!nn(e)){C(rn);return}_({...g,targetCohorts:Array.from(new Set([...g.targetCohorts,e]))}),y(``),C(``)},de=async()=>{if(!s||!g)return;let e=g.targetCohorts.map(en);if(e.some(e=>!nn(e))){C(rn);return}if(s.strategy===`APP_VERSION`&&!Lr(g.targetAppVersion.trim())){C(`Enter a valid target app version range.`);return}let n={expectedRevision:s.revision,patch:Li(s,{...g,targetCohorts:e}),releaseId:s.id};C(``);try{await p.mutateAsync(n),await f.mutateAsync(n),Jt.success(`Bundle settings saved`),t(!1)}catch(e){C(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},M=e.find(e=>e.id===s?.channel_id)?.name??s?.channel_id,P=e.filter(e=>e.id!==s?.channel_id),fe=P.map(e=>({label:e.name,value:e.name})),F=re.trim(),I=D===`copy`,L=g?Lr(g.targetAppVersion.trim()):null,R=()=>{ie(``),se(`move`)},z=e=>{!e&&h.isPending||(ne(e),e||R())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ue,{onOpenChange:e=>e?void 0:le(),open:r,children:(0,Z.jsxs)(oe,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(ge,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(ce,{children:`Bundle Detail`}),(0,Z.jsx)(pe,{className:`sr-only`,children:`Edit bundle delivery settings.`}),s?(0,Z.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-col gap-3 text-sm`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(st,{className:`size-4`,platform:s.platform}),(0,Z.jsx)(`span`,{className:`font-medium`,children:s.platform===`ios`?`iOS`:`Android`})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`ID`}),(0,Z.jsxs)(`span`,{className:`min-w-0 basis-full sm:basis-auto`,children:[(0,Z.jsx)(ct,{bundleId:s.id,fullOnMobile:!0,maxLength:18}),s.bundle_id?null:(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:`Built-in app`})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Channel`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,translate:`no`,children:M})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Platform`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:s.platform===`ios`?`iOS`:`Android`})]})]}):(0,Z.jsx)(b,{className:`h-12 w-full`})]}),(0,Z.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[o.isError?(0,Z.jsxs)(Ge,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(Ke,{children:`Bundle details could not be loaded`}),(0,Z.jsx)($e,{children:o.error.message})]}):null,s&&g?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[M?(0,Z.jsx)(Le,{release:{platform:s.platform,channel:M,releaseId:s.id,builtIn:!s.bundle_id}}):null,(0,Z.jsxs)(`section`,{"aria-labelledby":`delivery-settings-heading`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,id:`delivery-settings-heading`,children:`Delivery settings`}),(0,Z.jsxs)(Je,{className:`gap-6`,children:[(0,Z.jsxs)(Qe,{children:[(0,Z.jsx)(We,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(kt,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>_({...g,message:e.target.value}),rows:3,value:g.message})]}),s.strategy===`APP_VERSION`?(0,Z.jsxs)(Qe,{children:[(0,Z.jsx)(We,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(ae,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>_({...g,targetAppVersion:e.target.value}),value:g.targetAppVersion}),L?(0,Z.jsx)(Ye,{children:L}):null]}):null,(0,Z.jsxs)(Qe,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsx)(We,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(Pi,{"aria-label":`Enabled`,checked:g.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>_({...g,enabled:e})})]}),(0,Z.jsx)(Ye,{children:`Disabling rolls devices back to the previous enabled bundle on their next check, or to the built-in app when none remains.`})]}),(0,Z.jsxs)(Qe,{orientation:`horizontal`,children:[(0,Z.jsx)(We,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(Pi,{"aria-label":`Force update`,checked:g.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>_({...g,shouldForceUpdate:e})})]}),(0,Z.jsxs)(Qe,{children:[(0,Z.jsx)(We,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(Vi,{onChange:e=>_({...g,rolloutCohortCount:e}),value:g.rolloutCohortCount})]}),(0,Z.jsxs)(Qe,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(We,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Z.jsx)(Ur,{releaseId:s.id,rolloutCohortCount:g.rolloutCohortCount,targetCohorts:g.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(ae,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>y(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),j())},placeholder:`e.g. qa-team…`,value:v}),(0,Z.jsx)(a,{"aria-label":`Add cohort`,disabled:!v.trim(),onClick:j,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(Ft,{})})]}),g.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:g.targetCohorts.map(e=>(0,Z.jsxs)(q,{className:`gap-1 font-mono`,variant:`secondary`,children:[e,(0,Z.jsx)(`button`,{"aria-label":`Remove cohort ${e}`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>_({...g,targetCohorts:g.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Z.jsx)(N,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Ye,{children:`Public names—no IDs or secrets.`})]})]}),x?(0,Z.jsx)(Ze,{children:x}):null,(0,Z.jsx)(a,{className:`w-full`,disabled:!k||A,onClick:de,size:`lg`,children:p.isPending||f.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(S,{className:`my-2`}),(0,Z.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Actions`}),(0,Z.jsx)(a,{className:`w-full`,disabled:s.kind!==`BUNDLE`||A,onClick:()=>ne(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),s.bundle_id?(0,Z.jsxs)(a,{className:`w-full`,disabled:A,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(s.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),Jt.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(Mt,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(a,{className:`w-full`,disabled:s.enabled||A,onClick:()=>ee(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),s.bundle_id&&c.isPending?(0,Z.jsx)(b,{className:`h-40 w-full`}):null,s.bundle_id&&c.isError?(0,Z.jsxs)(Ge,{variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(Ke,{children:`Build details are unavailable`}),(0,Z.jsx)($e,{children:`Delivery settings are unaffected.`})]}):null,!s.bundle_id||!c.isPending?(0,Z.jsx)(Vr,{bundle:l,release:s}):null,(0,Z.jsxs)(`details`,{className:`rounded-lg border bg-muted/10 p-4 text-xs`,children:[(0,Z.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:`Advanced diagnostics`}),(0,Z.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-muted-foreground sm:grid-cols-2`,children:[(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:s.bundle_id??`Built-in app`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Revision`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:s.revision})]}),u?(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Patch base artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:u})]}):null,(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog generation`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:d.data?.generation??`—`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog size`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:d.data?`${d.data.byte_size} bytes`:`—`})]}),(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Scope key`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:s.scope_key}),n?(0,Z.jsx)(a,{className:`mt-1 h-auto px-0 text-xs`,onClick:()=>n(s.scope_key),size:`sm`,variant:`link`,children:`Show bundles for this target`}):null]})]}),d.isError?(0,Z.jsx)(`p`,{className:`mt-3 text-destructive`,children:`Diagnostics are unavailable. Bundle settings are unaffected.`}):null]})]}):null]})]})}),(0,Z.jsx)(xe,{onOpenChange:T,open:w,children:(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(be,{children:[(0,Z.jsx)(ve,{children:`Discard unsaved changes?`}),(0,Z.jsx)(H,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(W,{children:[(0,Z.jsx)(G,{children:`Keep editing`}),(0,Z.jsx)(ye,{onClick:()=>{T(!1),t(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(xe,{onOpenChange:ee,open:E,children:(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(be,{children:[(0,Z.jsxs)(ve,{children:[`Remove this Bundle from `,M??`the channel`,`?`]}),(0,Z.jsx)(H,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(W,{children:[(0,Z.jsx)(G,{children:`Cancel`}),(0,Z.jsx)(ye,{onClick:async()=>{if(s)try{await m.mutateAsync({expectedRevision:s.revision,releaseId:s.id}),Jt.success(`Bundle removed from ${M??`the channel`}`),ee(!1),t(!1)}catch(e){C(e instanceof Error?e.message:`Bundle could not be removed from the channel.`)}},variant:`destructive`,children:`Remove from channel`})]})]})}),(0,Z.jsx)(Vt,{onOpenChange:z,open:te,children:(0,Z.jsxs)(Lt,{showCloseButton:!h.isPending,children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Rt,{children:`Promote to Channel`}),(0,Z.jsx)(zt,{children:`Choose how to promote this Bundle, then select the target channel.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-4 py-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Xe,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(ht,{disabled:h.isPending,items:Fi,onValueChange:e=>se(e),value:D,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(_t,{placeholder:`Select an action`})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(xt,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:I?`Make this Bundle available in the target channel and keep it in the current channel.`:`Move this Bundle to the target channel. Devices in the current channel may fall back to an earlier Bundle.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Xe,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(ht,{disabled:h.isPending,items:fe,onValueChange:e=>ie(e??``),value:re||null,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(_t,{placeholder:`Select a channel`})}),(0,Z.jsx)(ft,{className:`max-h-64`,children:(0,Z.jsx)(bt,{children:P.map(e=>(0,Z.jsx)(xt,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(It,{children:[(0,Z.jsx)(a,{disabled:h.isPending,onClick:()=>z(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(a,{disabled:!F||h.isPending,onClick:async()=>{if(s)try{await h.mutateAsync({action:D,expectedRevision:s.revision,releaseId:s.id,targetChannel:F}),z(!1),Jt.success(I?`Bundle copied to ${F}`:`Bundle moved to ${F}`)}catch(e){Jt.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:h.isPending?I?`Copying…`:`Moving…`:I?`Copy`:`Move`})]})]})})]})}function Ui({release:e}){return(0,Z.jsxs)(q,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(qe,{className:`size-3`}):(0,Z.jsx)(dn,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}function Wi({percentage:e,className:t}){let n=e<100,r=e.toFixed(1);return(0,Z.jsxs)(q,{className:v(`gap-1`,t),variant:n?`secondary`:`default`,children:[n?(0,Z.jsx)(Kt,{className:`h-3 w-3`}):null,r,`%`]})}var Gi=20,Ki=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],qi=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}],Ji=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),Yi=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`});function Xi({channels:e,onChange:t,onClear:n,onManageChannels:r,search:i}){let o=Be(i),s=i.channelId!==void 0,c=[{label:`All Channels`,value:`all`},...e.map(e=>({label:e.name,value:e.id}))];return(0,Z.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-2 border-b bg-background px-3 py-3 sm:h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:py-0 sm:backdrop-blur-sm`,children:[(0,Z.jsx)(fe,{className:`-ml-1`}),(0,Z.jsx)(`h1`,{className:`sr-only`,children:`Bundles`}),(0,Z.jsxs)(`div`,{className:`ml-1 flex items-center gap-1.5 text-muted-foreground sm:ml-2`,children:[(0,Z.jsx)(mn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsxs)(ht,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:i.channelId??`all`,children:[(0,Z.jsx)(pt,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(_t,{})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(xt,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(ht,{disabled:!s,items:Ki,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:i.platform??`ios`,children:[(0,Z.jsx)(pt,{"aria-label":`Platform`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,title:s?void 0:`Choose a channel first`,children:(0,Z.jsx)(_t,{})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`ios`,children:`iOS`}),(0,Z.jsx)(xt,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(ht,{disabled:!s&&i.scopeKey===void 0,items:qi,onValueChange:e=>t({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:i.enabled===void 0?`all`:i.enabled?`enabled`:`disabled`,children:[(0,Z.jsx)(pt,{"aria-label":`Status`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(_t,{})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`all`,children:`Any Status`}),(0,Z.jsx)(xt,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(xt,{value:`disabled`,children:`Disabled`})]})})]}),(0,Z.jsx)(a,{"aria-label":`Manage channels`,onClick:r,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Z.jsx)(_n,{})}),i.bundleId?(0,Z.jsxs)(q,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Artifact filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear artifact filter`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>t({bundleId:void 0}),type:`button`,children:(0,Z.jsx)(N,{className:`size-3`})})]}):null,i.scopeKey?(0,Z.jsxs)(q,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Target filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear target filter`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>t({scopeKey:void 0}),type:`button`,children:(0,Z.jsx)(N,{className:`size-3`})})]}):null,o?(0,Z.jsxs)(a,{className:`h-8 px-2 text-xs text-muted-foreground hover:text-foreground sm:ml-auto`,onClick:n,size:`sm`,variant:`ghost`,children:[(0,Z.jsx)(N,{"data-icon":`inline-start`}),`Clear`]}):null]})}function Zi({expanded:e,onOpen:t,onToggleExpand:n,release:r}){let i=r.operation===`PROMOTE`?`Promoted`:r.operation===`ROLLBACK`?`Rollback`:null;return(0,Z.jsxs)(`div`,{className:`flex min-w-[240px] items-center gap-3`,children:[r.bundle_id?(0,Z.jsx)(a,{"aria-controls":`bundle-lineage-panel-${r.id}`,"aria-expanded":e,"aria-label":e?`Hide advanced artifact diagnostics`:`Show advanced artifact diagnostics`,title:`Advanced artifact diagnostics`,className:`size-8 shrink-0 touch-manipulation`,onClick:n,size:`icon`,type:`button`,variant:`ghost`,children:e?(0,Z.jsx)(rt,{}):(0,Z.jsx)(De,{})}):(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-8 shrink-0`}),(0,Z.jsxs)(`button`,{"aria-label":`Open details for ID ${r.id}`,className:`min-w-0 rounded-sm text-left text-foreground transition-colors underline-offset-4 hover:text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:t,title:r.id,type:`button`,children:[(0,Z.jsx)(ct,{bundleId:r.id,fullOnMobile:!0}),r.bundle_id?null:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,Z.jsx)(Dt,{className:`size-3.5`}),` Built-in app`]})]}),i?(0,Z.jsx)(q,{className:`shrink-0 font-normal`,variant:`secondary`,children:i}):null,r.currentlyUnreachable?(0,Z.jsxs)(`span`,{"aria-label":`Unreachable: no device gets this bundle with the current delivery settings.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No device gets this bundle with the current delivery settings.`,children:[(0,Z.jsx)(dn,{className:`size-3.5`}),`Unreachable`]}):null]})}function Qi({onDetailClick:e,panelId:t,release:n}){let r=n.bundle_id??``,i=Pe(r),a=je(r);return i.isError||a.isError?(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:t,children:`Patch lineage could not be loaded.`}):i.isPending?(0,Z.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:t,children:[(0,Z.jsx)(b,{className:`h-10 w-full`}),(0,Z.jsx)(b,{className:`h-10 w-full`})]}):i.data?(0,Z.jsx)(Dn,{bundle:i.data,bundles:a.data??[],loading:a.isPending,onDetailClick:e,panelId:t}):(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:t,children:`Bundle details are unavailable.`})}function $i(){let e=Ue.useSearch(),t=Ue.useNavigate(),n=M(),[r,i]=(0,X.useState)(!1),[o,s]=(0,X.useState)(),c=Ne({afterReleaseId:e.afterReleaseId,beforeReleaseId:e.beforeReleaseId,filter:Ve(e),limit:Gi}),l=Oe().data??[],u=c.data?.data??[],d=K(Array.from(new Set(u.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},f=c.data?.next,m=c.data?.previous,h=u.flatMap(e=>{let t=l.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t,builtIn:!e.bundle_id}]:[]}),g=He(),_=10+g.length,y=new Map(l.map(e=>[e.id,e.name]));(0,X.useEffect)(()=>{o&&!u.some(e=>e.id===o)&&s(void 0)},[o,u]);let x=(e,n=!0)=>void t({resetScroll:n,search:e,to:`/`}),S=t=>x(ze(e,t)),C=t=>{let n=u.find(e=>e.bundle_id===t.id);if(s(void 0),n){x({...e,releaseId:n.id},!1);return}S({bundleId:t.id})},w=e.afterReleaseId!==void 0||e.beforeReleaseId!==void 0,T=m?{...e,afterReleaseId:m,beforeReleaseId:void 0,releaseId:void 0}:null,E=f?{...e,afterReleaseId:void 0,beforeReleaseId:f,releaseId:void 0}:null,ee={...e,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0};return(0,Z.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,Z.jsx)(Xi,{channels:l,onChange:S,onClear:()=>x({}),onManageChannels:()=>i(!0),search:e}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-6 bg-muted/5 p-3 sm:p-6`,children:[c.isError?(0,Z.jsxs)(Ge,{variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(Ke,{children:`Bundles could not be loaded`}),(0,Z.jsx)($e,{children:c.error.message})]}):(0,Z.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden rounded-lg border bg-card text-card-foreground shadow-sm [&_[data-slot=table-container]]:h-full [&_[data-slot=table-container]]:overflow-auto`,children:n?(0,Z.jsx)(`div`,{className:`h-full overflow-y-auto`,children:c.isPending?(0,Z.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:Array.from({length:5},(e,t)=>(0,Z.jsx)(b,{className:`h-44 w-full`},t))}):u.length?u.map(t=>{let n=y.get(t.channel_id)??t.channel_id,r=t.bundle_id?d[t.bundle_id]:0,i=o===t.id,a=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(`article`,{className:v(`flex flex-col gap-4 border-b p-4 last:border-b-0`,t.currentlyUnreachable&&`bg-muted/35 saturate-50 transition-[background-color,filter] focus-within:saturate-100 motion-reduce:transition-none`,i&&`border-b-0 bg-primary/5`),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(Zi,{expanded:i,onOpen:()=>x({...e,releaseId:t.id},!1),onToggleExpand:()=>s(i?void 0:t.id),release:t}),(0,Z.jsx)(bn,{channel:n,className:`shrink-0`})]}),(0,Z.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 text-xs`,children:[(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Platform`}),(0,Z.jsxs)(`dd`,{className:`mt-1 flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(st,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created`}),(0,Z.jsx)(`dd`,{className:`mt-1 tabular-nums`,children:Ji.format(t.created_at_ms)})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Rollout`}),(0,Z.jsx)(`dd`,{className:`mt-1`,children:(0,Z.jsx)(Wi,{percentage:t.rollout_cohort_count/10})})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Patches`}),(0,Z.jsx)(`dd`,{className:`mt-1`,children:r===void 0?`Checking`:r>0?`${r} ${r===1?`patch`:`patches`}`:`—`})]}),g.map(({Cell:e,feature:n,label:r})=>(0,Z.jsxs)(`div`,{className:`col-span-2 rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`mb-2 text-muted-foreground`,children:r}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(e,{releaseId:t.id,releases:h})})]},n)),(0,Z.jsxs)(`div`,{className:`col-span-2 flex flex-wrap items-center gap-2 rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(Ui,{release:t}),t.should_force_update?(0,Z.jsx)(q,{variant:`secondary`,children:`Force update`}):null]}),(0,Z.jsxs)(`div`,{className:`col-span-2 grid grid-cols-1 gap-2 rounded-md border bg-background/80 p-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Target`}),(0,Z.jsx)(`dd`,{className:`min-w-0 truncate text-right font-mono`,children:t.target_app_version??t.fingerprint_hash??`—`})]}),(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Message`}),(0,Z.jsx)(`dd`,{className:`min-w-0 text-right text-foreground`,children:t.message||`—`})]})]})]})]}),i&&t.bundle_id?(0,Z.jsx)(Qi,{onDetailClick:C,panelId:a,release:t}):null]},t.id)}):(0,Z.jsx)(`p`,{className:`p-8 text-center text-sm text-muted-foreground`,children:w?`No more bundles on this side.`:Be(e)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,Z.jsxs)(ln,{className:`min-w-max`,children:[(0,Z.jsx)(on,{className:`bg-muted/40`,children:(0,Z.jsxs)(cn,{className:`border-b border-border/60 hover:bg-transparent [&>th]:h-10 [&>th]:text-xs [&>th]:font-semibold [&>th]:uppercase [&>th]:text-muted-foreground/70`,children:[(0,Z.jsx)(J,{children:`ID`}),(0,Z.jsx)(J,{children:`Channel`}),(0,Z.jsx)(J,{children:`Platform`}),(0,Z.jsx)(J,{children:`Patches`}),(0,Z.jsx)(J,{children:`Target`}),(0,Z.jsx)(J,{children:`Enabled`}),(0,Z.jsx)(J,{children:`Force update`}),(0,Z.jsx)(J,{children:`Rollout`}),g.map(({feature:e,label:t})=>(0,Z.jsx)(J,{children:t},e)),(0,Z.jsx)(J,{children:`Message`}),(0,Z.jsx)(J,{children:`Created`})]})}),(0,Z.jsxs)(sn,{children:[c.isPending?Array.from({length:7},(e,t)=>(0,Z.jsx)(cn,{children:(0,Z.jsx)(Y,{colSpan:_,children:(0,Z.jsx)(b,{className:`h-8 w-full`})})},t)):u.map(t=>{let n=o===t.id,r=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(cn,{"aria-label":`Open bundle ${t.id}`,className:v(`cursor-pointer transition-[background-color,filter] hover:bg-muted/10 focus-within:bg-muted/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring motion-reduce:transition-none data-[state=selected]:bg-muted/15 [&>td]:py-3`,t.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,n&&`bg-primary/5`),"data-state":e.releaseId===t.id?`selected`:void 0,onClick:n=>{n.target instanceof Element&&n.target.closest(`button, a, input, select, textarea`)||x({...e,releaseId:t.id},!1)},onKeyDown:n=>{n.target!==n.currentTarget||n.key!==`Enter`&&n.key!==` `||(n.preventDefault(),x({...e,releaseId:t.id},!1))},tabIndex:0,children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(Zi,{expanded:n,onOpen:()=>x({...e,releaseId:t.id},!1),onToggleExpand:()=>s(n?void 0:t.id),release:t})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(bn,{channel:y.get(t.channel_id)??t.channel_id})}),(0,Z.jsx)(Y,{className:`whitespace-nowrap`,children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(st,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]})}),(0,Z.jsx)(Y,{children:t.bundle_id&&d[t.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):t.bundle_id&&d[t.bundle_id]>0?(0,Z.jsxs)(q,{variant:`secondary`,children:[d[t.bundle_id],` `,d[t.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:t.target_app_version?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Re,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`font-medium`,children:t.target_app_version})]}):t.fingerprint_hash?(0,Z.jsxs)(`span`,{className:`flex min-w-[160px] items-center gap-2`,children:[(0,Z.jsx)(pn,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(At,{maxLength:12,value:t.fingerprint_hash})]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(xn,{enabled:t.enabled}),(0,Z.jsx)(`span`,{className:`sr-only`,children:t.enabled?`Enabled`:`Disabled`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(xn,{enabled:t.should_force_update,falseIcon:`minus`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:t.should_force_update?`Required`:`Optional`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Wi,{percentage:t.rollout_cohort_count/10})}),g.map(({Cell:e,feature:n})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(e,{releaseId:t.id,releases:h})},n)),(0,Z.jsx)(Y,{className:`text-sm text-muted-foreground`,title:t.message??void 0,children:t.message||`-`}),(0,Z.jsx)(Y,{className:`whitespace-nowrap text-xs text-muted-foreground`,title:Ji.format(t.created_at_ms),children:Yi.format(t.created_at_ms)})]}),n&&t.bundle_id?(0,Z.jsx)(cn,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:_,children:(0,Z.jsx)(Qi,{onDetailClick:C,panelId:r,release:t})})}):null]},t.id)}),!c.isPending&&u.length===0?(0,Z.jsx)(cn,{children:(0,Z.jsx)(Y,{className:`h-40 text-center text-muted-foreground`,colSpan:_,children:w?`No more bundles on this side.`:Be(e)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):null]})]})}),!c.isError&&!c.isPending?(0,Z.jsxs)(`nav`,{"aria-label":`Bundle pagination`,className:`flex flex-col gap-3 px-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Z.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:[(0,Z.jsx)(`span`,{className:`text-foreground`,children:u.length}),` `,u.length===1?`entry`:`entries`,`, newest first`]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 sm:justify-end`,children:[w?(0,Z.jsx)(V,{className:p({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`ghost`}),search:ee,to:`/`,children:`Newest`}):null,T?(0,Z.jsxs)(V,{className:p({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:T,to:`/`,children:[(0,Z.jsx)(un,{"data-icon":`inline-start`}),`Previous`]}):(0,Z.jsxs)(a,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[(0,Z.jsx)(un,{"data-icon":`inline-start`}),`Previous`]}),E?(0,Z.jsxs)(V,{className:p({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:E,to:`/`,children:[`Next`,(0,Z.jsx)(De,{"data-icon":`inline-end`})]}):(0,Z.jsxs)(a,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[`Next`,(0,Z.jsx)(De,{"data-icon":`inline-end`})]})]})]}):null]}),(0,Z.jsx)(Hi,{channels:l,onOpenChange:t=>!t&&x({...e,releaseId:void 0},!1),onShowScope:e=>S({scopeKey:e}),open:!!e.releaseId,releaseId:e.releaseId??``}),(0,Z.jsx)(On,{onOpenChange:i,open:r})]})}export{$i as component};