@hot-updater/console 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{ConsoleFeatureUnavailable-jB4Loglh.js → ConsoleFeatureUnavailable-Bf8tgug-.js} +1 -1
- package/.output/public/assets/{EventDetails-B6yUsyNA.js → EventDetails-CgtEWl-Y.js} +1 -1
- package/.output/public/assets/HashValueDisplay-DvXl147n.js +1 -0
- package/.output/public/assets/{InsightsPageHeader-B892oVml.js → InsightsPageHeader-eViliItR.js} +1 -1
- package/.output/public/assets/{NotFoundPage-DIqCpWa3.js → NotFoundPage-HomiHjdL.js} +1 -1
- package/.output/public/assets/{alert-dialog-Bbk_4-WJ.js → alert-dialog-BSs_5Od-.js} +1 -1
- package/.output/public/assets/{api-DCM0wr6O.js → api-DSWk32Mz.js} +1 -1
- package/.output/public/assets/api-keys-CHA2X9W0.js +1 -0
- package/.output/public/assets/api-keys-D0yD891K.js +1 -0
- package/.output/public/assets/arrow-left-vK2qGQsd.js +1 -0
- package/.output/public/assets/arrow-up-right-Dz8o-Kab.js +1 -0
- package/.output/public/assets/chevron-right-CBl7aqu_.js +1 -0
- package/.output/public/assets/{clipboard-DS9ucUQL.js → clipboard-BYT_TJ0K.js} +1 -1
- package/.output/public/assets/{console-features-api-BH5m_PtQ.js → console-features-api-BD7j--gS.js} +1 -1
- package/.output/public/assets/{dialog-Bqbb7B0N.js → dialog-YKZpU5St.js} +1 -1
- package/.output/public/assets/{dist-LxKJB-Vu.js → dist-B7eA4Mtf.js} +1 -1
- package/.output/public/assets/{empty-CuT2UhFp.js → empty-L3UcNk_l.js} +1 -1
- package/.output/public/assets/{field-BBDpjIqu.js → field-DNqNwq7i.js} +1 -1
- package/.output/public/assets/{index-6o51GkFe.js → index-C-dDMnWK.js} +4 -4
- package/.output/public/assets/{input-group-ja_30qaF.js → input-group-C9ZIjV0o.js} +1 -1
- package/.output/public/assets/insights-C54__dPi.js +1 -0
- package/.output/public/assets/insights-DM0CTj58.js +2 -0
- package/.output/public/assets/insights-SVMoazdd.js +42 -0
- package/.output/public/assets/{insights-api-BigAU9sZ.js → insights-api-BsX1zQDf.js} +1 -1
- package/.output/public/assets/insights-search-B-F2wop6.js +1 -0
- package/.output/public/assets/insights-usage-rpc-CSAoKS_b.js +1 -0
- package/.output/public/assets/insights_.distribution-BAaD6rZK.js +1 -0
- package/.output/public/assets/insights_.distribution-C6tGV7qU.js +2 -0
- package/.output/public/assets/insights_.distribution-oxPmgcHr.js +1 -0
- package/.output/public/assets/installations-1jALHnM3.js +1 -0
- package/.output/public/assets/installations-DUidui9Z.js +1 -0
- package/.output/public/assets/{installations-BazSJXE0.js → installations-RfpwK-ld.js} +2 -2
- package/.output/public/assets/{key-round-wS_SIZ6b.js → key-round-CrqLmblG.js} +1 -1
- package/.output/public/assets/{list-CgrYiadM.js → list-BSpjGUS6.js} +1 -1
- package/.output/public/assets/{refresh-cw-BYgoNCco.js → refresh-cw-BMlpOsfM.js} +1 -1
- package/.output/public/assets/remote-config-BcoOZ9fs.js +1 -0
- package/.output/public/assets/remote-config-BtStN5bt.js +1 -0
- package/.output/public/assets/{remote-config-Br56BODb.js → remote-config-Cwwsatrr.js} +4 -4
- package/.output/public/assets/routes-Bc3J564t.js +2 -0
- package/.output/public/assets/routes-Bxu5_zNh.js +1 -0
- package/.output/public/assets/search-B_o3avCI.js +1 -0
- package/.output/public/assets/select-BE-xONpm.js +1 -0
- package/.output/public/assets/{sidebar-DNVyJPfX.js → sidebar-CQ6iq0qe.js} +1 -1
- package/.output/public/assets/smartphone--CTny1h9.js +1 -0
- package/.output/public/assets/{switch-DZ1TPwx-.js → switch-DR0WP2g8.js} +1 -1
- package/.output/public/assets/{table-Gm4qRWwE.js → table-DW0243Jw.js} +1 -1
- package/.output/public/assets/tabs-B4Ffq4fD.js +1 -0
- package/.output/public/assets/{undo-2-CmrHjwFc.js → undo-2-Dcq6sgUo.js} +1 -1
- package/.output/public/assets/{useCompositeListItem-9E4pj_CH.js → useCompositeListItem-VmWjhZ9j.js} +1 -1
- package/.output/public/assets/{valueToPercent-CH8GCHaL.js → valueToPercent-C-rPd_Or.js} +1 -1
- package/.output/server/{__23tanstack-start-server-fn-resolver-BpRlos5Q.mjs → __23tanstack-start-server-fn-resolver-CludPNXL.mjs} +40 -40
- package/.output/server/_libs/@base-ui/react+[...].mjs +20 -20
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +1 -1
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
- package/.output/server/_libs/recharts+[...].mjs +1 -1
- package/.output/server/_libs/sonner.mjs +1 -1
- package/.output/server/_ssr/{BundleIdDisplay-x94o9rlU.mjs → BundleIdDisplay-CAIibMnZ.mjs} +2 -2
- package/.output/server/_ssr/{ConsoleFeatureUnavailable-ldW8v8-q.mjs → ConsoleFeatureUnavailable-CTbvhAts.mjs} +6 -6
- package/.output/server/_ssr/{EventDetails-Q8kfj9Nr.mjs → EventDetails-Dz5O2hup.mjs} +6 -6
- package/.output/server/_ssr/{HashValueDisplay-n1GholGS.mjs → HashValueDisplay-BBUzwDu0.mjs} +2 -2
- package/.output/server/_ssr/{InsightsPageHeader-BSUX3Ye9.mjs → InsightsPageHeader-BisxLsg_.mjs} +6 -6
- package/.output/server/_ssr/{NotFoundPage-DZzOOzS3.mjs → NotFoundPage-oKeLJAKO.mjs} +2 -2
- package/.output/server/_ssr/{alert-dialog-C43Doa0I.mjs → alert-dialog-D9gKu-6B.mjs} +1 -1
- package/.output/server/_ssr/{api-oZjRn9tP.mjs → api-Ctf4ONl0.mjs} +3 -3
- package/.output/server/_ssr/{api-keys-CEnM9fqG.mjs → api-keys-BYVLgcvB.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-B4sYm8dM.mjs → api-keys-CBdMIgQH.mjs} +7 -7
- package/.output/server/_ssr/{api-keys-rpc-BIFuUgMt.mjs → api-keys-rpc-D_MGDGrN.mjs} +3 -3
- package/.output/server/_ssr/{api-rpc-BNiFRRK8.mjs → api-rpc-BOn0fmSj.mjs} +3 -3
- package/.output/server/_ssr/{auth-rpc-DnZqYxyq.mjs → auth-rpc-MuU8dCi_.mjs} +4 -4
- package/.output/server/_ssr/{auth.server-DFpyxRDd.mjs → auth.server-QA_53YPj.mjs} +2 -2
- package/.output/server/_ssr/{config.server-DskXCAyI.mjs → config.server-fNcSQwfX.mjs} +3 -3
- package/.output/server/_ssr/{console-access-BJfAXknd.mjs → console-access-C6aSaMHp.mjs} +2 -2
- package/.output/server/_ssr/{console-features-api-C9kiKvaV.mjs → console-features-api-nN-3jUli.mjs} +5 -5
- package/.output/server/_ssr/{console-features-rpc-P0GL7Z-R.mjs → console-features-rpc-By6Aak_o.mjs} +3 -3
- package/.output/server/_ssr/{dialog-BbYDMjdC.mjs → dialog-IVRlM1J9.mjs} +1 -1
- package/.output/server/_ssr/{empty-CVLGfxuu.mjs → empty-CXw7UkQ9.mjs} +2 -2
- package/.output/server/_ssr/{field-asw83X0v.mjs → field-D5rycmNU.mjs} +2 -2
- package/.output/server/_ssr/{input-group-CuYJHosb.mjs → input-group-CcwGtPaf.mjs} +1 -1
- package/.output/server/_ssr/{insights-B55FG5fm.mjs → insights-BO3tHc8m.mjs} +5 -5
- package/.output/server/_ssr/{insights-CWnHIFUV.mjs → insights-BfjtzxAt.mjs} +2 -2
- package/.output/server/_ssr/{insights-CpLpedFZ.mjs → insights-CKC8xDHf.mjs} +24 -24
- package/.output/server/_ssr/{insights-api-sjws23WF.mjs → insights-api-CxvjRcJY.mjs} +3 -3
- package/.output/server/_ssr/{insights-failures-rpc-BvbWvqNf.mjs → insights-failures-rpc-3LR3gf5_.mjs} +4 -4
- package/.output/server/_ssr/{insights-recovery-rpc-GiYXdkaY.mjs → insights-recovery-rpc-KZuPFtPi.mjs} +3 -3
- package/.output/server/_ssr/{insights-rpc-DP_8Rmz4.mjs → insights-rpc-B5DF87z1.mjs} +3 -3
- package/.output/server/_ssr/{InsightsInfo-DuJFatQO.mjs → insights-search--Biw1Q83.mjs} +31 -31
- package/.output/server/_ssr/{insights-usage-rpc-BiolgB8e.mjs → insights-usage-rpc-BjyoZrsk.mjs} +3 -3
- package/.output/server/_ssr/{insights-usage-rpc-KStL0zOx.mjs → insights-usage-rpc-Dvt-RmGH.mjs} +3 -3
- package/.output/server/_ssr/{insights_.distribution-CVrnbP3R.mjs → insights_.distribution-C9WdD2pp.mjs} +2 -2
- package/.output/server/_ssr/{insights_.distribution-DN9pR422.mjs → insights_.distribution-Czd0R3x1.mjs} +13 -13
- package/.output/server/_ssr/{insights_.distribution-D2HaNTAA.mjs → insights_.distribution-DMcff9C5.mjs} +5 -5
- package/.output/server/_ssr/{installations-DD1g__Nc.mjs → installations-BZg4I7rk.mjs} +4 -4
- package/.output/server/_ssr/{installations-BSCmFq8Q.mjs → installations-CETpe6aH.mjs} +10 -10
- package/.output/server/_ssr/{installations-BHmbbnH8.mjs → installations-CbX4TTtL.mjs} +2 -2
- package/.output/server/_ssr/{release-adoption-rpc-BsstqxUp.mjs → release-adoption-rpc-CEY0I6O4.mjs} +5 -5
- package/.output/server/_ssr/{remote-config-Dv1ccMo-.mjs → remote-config-BZoufETF.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-C2Ee8lXO.mjs → remote-config-CORErMXh.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-of0lGQH8.mjs → remote-config-D2VfWi8m.mjs} +16 -16
- package/.output/server/_ssr/{remote-config-rpc-BzX31mUS.mjs → remote-config-rpc-DKcBdTyh.mjs} +3 -3
- package/.output/server/_ssr/{router-D8NuoJ_I.mjs → router-CRDbJodQ.mjs} +14 -14
- package/.output/server/_ssr/{routes-V8sDybGf.mjs → routes-Bpmxf-r8.mjs} +12 -12
- package/.output/server/_ssr/{routes-DgvnFqDy.mjs → routes-DC3sK0ON.mjs} +38 -25
- package/.output/server/_ssr/{select-t3iXRwc9.mjs → select-CzanJCWl.mjs} +1 -1
- package/.output/server/_ssr/{server-h4VxnExB.mjs → server-C4JCTB-q.mjs} +3 -3
- package/.output/server/_ssr/{sidebar-DJcErBMo.mjs → sidebar-DcFhy0Zq.mjs} +18 -18
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/{switch-E-btwMGt.mjs → switch-DAHDLynM.mjs} +2 -2
- package/.output/server/_ssr/{table-37Dd23TN.mjs → table-DNcXrt9t.mjs} +1 -1
- package/.output/server/_ssr/{tabs-DEFnTm95.mjs → tabs-BlbEfZeV.mjs} +2 -2
- package/.output/server/_tanstack-start-manifest_v-DaM-WBL0.mjs +139 -0
- package/.output/server/index.mjs +265 -265
- package/package.json +7 -7
- package/src/components/{features/insights/InsightsInfo.tsx → InfoTooltip.tsx} +1 -1
- package/src/components/features/insights/AppUsage.tsx +3 -3
- package/src/components/features/insights/InsightsOverview.tsx +5 -5
- package/src/components/features/insights/ReleaseActivity.tsx +5 -5
- package/src/components/features/insights/ReportingDevicesSummary.tsx +3 -3
- package/src/components/features/insights/UpdateFailures.tsx +2 -4
- package/src/components/features/releases/ReleaseEditorSheet.tsx +33 -21
- package/src/routes/insights_.distribution.tsx +3 -3
- package/.output/public/assets/HashValueDisplay-BFX_kY3-.js +0 -1
- package/.output/public/assets/InsightsInfo-BNO0WznZ.js +0 -1
- package/.output/public/assets/api-keys-CIO9L_wu.js +0 -1
- package/.output/public/assets/api-keys-DVTL_--f.js +0 -1
- package/.output/public/assets/arrow-left-CnMYpqB7.js +0 -1
- package/.output/public/assets/arrow-up-right-BtffZA6e.js +0 -1
- package/.output/public/assets/chevron-right-BqD5wtFb.js +0 -1
- package/.output/public/assets/insights-CmraDzQh.js +0 -1
- package/.output/public/assets/insights-CxZ2GCYV.js +0 -2
- package/.output/public/assets/insights-usage-rpc-DYEhsCKT.js +0 -1
- package/.output/public/assets/insights-vNRCrfnS.js +0 -42
- package/.output/public/assets/insights_.distribution-ChOerfJt.js +0 -1
- package/.output/public/assets/insights_.distribution-D-e4iga8.js +0 -1
- package/.output/public/assets/insights_.distribution-DZtkibX1.js +0 -2
- package/.output/public/assets/installations-ClHTqdAO.js +0 -1
- package/.output/public/assets/installations-DpKsBuHi.js +0 -1
- package/.output/public/assets/remote-config-BWwHOkCK.js +0 -1
- package/.output/public/assets/remote-config-CXOi0LRu.js +0 -1
- package/.output/public/assets/routes-B88Erkpk.js +0 -2
- package/.output/public/assets/routes-CfzsAleC.js +0 -1
- package/.output/public/assets/search-DaTDPW25.js +0 -1
- package/.output/public/assets/select-BZZBXMkr.js +0 -1
- package/.output/public/assets/smartphone-DpTFgtKf.js +0 -1
- package/.output/public/assets/tabs-C7FOEjFC.js +0 -1
- package/.output/server/_tanstack-start-manifest_v-55AGsehh.mjs +0 -139
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,$n as t,Bn as n,F as r,Fn as i,Gt as a,H as o,I as s,In as c,Jn as l,Jt as u,Kt as d,L as f,Ln as p,M as m,P as h,R as g,U as _,Un as v,Ur as y,Ut as b,Wn as x,Xn as S,Xt as C,Yn as w,Yt as ee,Z as T,Zn as E,_ as te,an as ne,ar as D,b as re,bn as ie,ei as ae,er as oe,et as se,g as ce,h as le,ir as O,ln as k,lt as ue,mn as de,p as fe,qt as pe,ri as me,sr as A,tn as he,ut as j,v as ge,vn as _e,w as M,xn as N,y as P,yn as ve}from"./sidebar-CQ6iq0qe.js";import{l as F}from"./console-features-api-BD7j--gS.js";import{i as ye,n as I,o as be,r as xe}from"./useCompositeListItem-VmWjhZ9j.js";import{a as L,i as R,l as z,n as Se,o as B,r as Ce,s as V,t as H}from"./alert-dialog-BSs_5Od-.js";import{a as we,c as Te,d as U,f as Ee,h as De,i as Oe,l as ke,m as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as Ie,u as Le}from"./api-DSWk32Mz.js";import{a as Re,c as W,i as ze,n as G,r as Be,s as Ve,t as He}from"./routes-Bc3J564t.js";import{a as Ue,b as We,c as Ge,f as Ke,g as qe,h as Je,i as Ye,l as K,m as Xe,n as Ze,p as Qe,r as $e,t as et,u as tt,v as nt,x as rt,y as it}from"./field-DNqNwq7i.js";import{t as at}from"./chevron-right-CBl7aqu_.js";import{A as ot,D as st,E as ct,M as lt,N as ut,P as dt,T as ft,a as pt,d as mt,f as ht,h as gt,i as _t,m as q,n as vt,o as yt,r as bt,t as xt}from"./select-BE-xONpm.js";import{r as St,t as Ct}from"./HashValueDisplay-DvXl147n.js";import{t as wt}from"./list-BSpjGUS6.js";import{a as Tt,c as Et,i as Dt,l as Ot,n as kt,o as At,r as jt,s as Mt,t as Nt}from"./dialog-YKZpU5St.js";import{a as Pt,i as Ft,n as It,o as Lt,s as Rt,t as zt}from"./input-group-C9ZIjV0o.js";import{a as Bt,i as Vt,n as Ht,o as Ut,t as Wt}from"./switch-DR0WP2g8.js";import{n as Gt}from"./dist-B7eA4Mtf.js";import{a as Kt,c as qt,d as Jt,f as Yt,h as Xt,l as Zt,m as Qt,o as $t,p as en,s as tn,u as nn}from"./insights-search-B-F2wop6.js";import{a as rn,i as J,n as an,o as on,r as Y,t as sn}from"./table-DW0243Jw.js";import{i as cn,n as ln,t as un}from"./valueToPercent-C-rPd_Or.js";var dn=D(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),fn=D(`circle-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.35 2.69A10 10 0 0 1 21.3 15.65`,key:`1pfsoa`}],[`path`,{d:`M19.08 19.08A10 10 0 1 1 4.92 4.92`,key:`1ablyi`}]]),pn=D(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),mn=D(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),hn=D(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),gn=D(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),_n=D(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),vn=D(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),yn=A();function bn(){return v}function xn(){return!1}function Sn(){return!0}function Cn(){return(0,yn.useSyncExternalStore)(bn,xn,Sn)}var X=me(ae(),1),Z=y(),wn={production:`bg-green-500/10 text-green-700 dark:text-green-400 border-green-500/20`,dev:`bg-blue-500/10 text-blue-700 dark:text-blue-400 border-blue-500/20`,staging:`bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 border-yellow-500/20`};function Tn({channel:e,className:t}){return(0,Z.jsx)(K,{variant:`outline`,className:p(wn[e.toLowerCase()]||`bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20`,t),children:e})}function En({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(rt,{className:p(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(gn,{className:p(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Z.jsx)(O,{className:p(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}var Dn=me(Bt(),1),On=me(Vt(),1);Dn.default.extend(On.default);function kn({uuid:e,format:t=`relative`}){let n=(0,Dn.default)(Kt(e));return t===`relative`?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.fromNow()}):t===`absolute`?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)}):(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{className:`text-sm`,children:n.fromNow()}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)})]})}function An({panelId:t,bundle:n,bundles:r,loading:a,onDetailClick:o}){let s=le();return(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id:t,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Advanced artifact diagnostics`}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 text-sm sm:items-center`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`Base artifact ID`}),(0,Z.jsx)(cn,{bundleId:n.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(K,{variant:`outline`,children:[r.length,` `,r.length===1?`patch`:`patches`]})]}),a?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):r.length>0?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),s?(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.map(e=>(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Target artifact ID`}),(0,Z.jsx)(cn,{bundleId:e.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Relation`}),(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-1 text-sm`,children:[(0,Z.jsx)(cn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(De,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(cn,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Artifact`}),(0,Z.jsx)(K,{variant:`secondary`,children:`bsdiff`})]}),(0,Z.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Created`}),(0,Z.jsx)(`div`,{className:`text-xs tabular-nums text-foreground`,children:(0,Z.jsx)(kn,{uuid:e.id})})]})]}),(0,Z.jsx)(i,{className:`w-full`,onClick:()=>o(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})]})},e.id))}):(0,Z.jsx)(`div`,{className:`overflow-x-auto rounded-md border bg-background`,children:(0,Z.jsxs)(sn,{className:`min-w-max`,children:[(0,Z.jsx)(rn,{children:(0,Z.jsxs)(on,{className:`hover:bg-transparent`,children:[(0,Z.jsx)(J,{children:`Target artifact ID`}),(0,Z.jsx)(J,{children:`Relation`}),(0,Z.jsx)(J,{children:`Artifact`}),(0,Z.jsx)(J,{children:`Created`}),(0,Z.jsx)(J,{className:`w-24 text-right`,children:`Detail`})]})}),(0,Z.jsx)(an,{children:r.map(e=>(0,Z.jsxs)(on,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(cn,{bundleId:e.id,fullOnMobile:!0,maxLength:18})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`div`,{className:`flex min-w-[280px] flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[(0,Z.jsx)(cn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(De,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(cn,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(K,{variant:`secondary`,children:`bsdiff`})}),(0,Z.jsx)(Y,{className:`tabular-nums`,children:(0,Z.jsx)(kn,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(i,{onClick:()=>o(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})})]},e.id))})]})})]}):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3 text-sm text-muted-foreground`,children:`No direct patch artifacts.`})]})]})})}function jn({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[a,o]=(0,X.useState)(null),s=Ht(a),{data:c=[],isPending:l}=Oe(),u=Me(),d=Fe(),f=n.trim(),p=async e=>{if(e.preventDefault(),!(!f||u.isPending))try{let e=await u.mutateAsync({name:f});r(``),e.inserted?Gt.success(`Channel ${e.row.name} created`):Gt.info(`Channel ${e.row.name} already exists`)}catch(e){Gt.error(`Failed to create channel`),console.error(e)}},m=async()=>{if(!(!a||d.isPending))try{let e=await d.mutateAsync({id:a.id});e.deleted?Gt.success(`Channel ${a.name} deleted`):e.reason===`not_empty`?Gt.error(`Channel ${a.name} is still in use and cannot be deleted`):Gt.error(`Channel ${a.name} no longer exists`),o(null)}catch(e){Gt.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Nt,{open:e,onOpenChange:t,children:(0,Z.jsxs)(kt,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(Tt,{children:[(0,Z.jsxs)(At,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(_n,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(jt,{children:`Create deployment channels and remove them when no bundle uses them. Empty channels remain available until you delete them.`})]}),(0,Z.jsx)(`form`,{onSubmit:p,children:(0,Z.jsx)(Ye,{className:`gap-2`,children:(0,Z.jsxs)(et,{orientation:`horizontal`,children:[(0,Z.jsx)(Ue,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(T,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:u.isPending}),(0,Z.jsxs)(i,{type:`submit`,disabled:!f||u.isPending,children:[u.isPending?(0,Z.jsx)(Ot,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(Et,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,Z.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,Z.jsx)(Ot,{className:`mr-2 size-3.5 animate-spin`}),`Loading channels`]}):c.length===0?(0,Z.jsx)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:`No channels yet`}):(0,Z.jsx)(`ul`,{className:`divide-y`,children:c.map(e=>(0,Z.jsxs)(`li`,{className:`flex min-h-12 items-center gap-3 px-3 py-2`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`p`,{className:`truncate text-xs font-medium`,children:e.name}),(0,Z.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:e.id})]}),(0,Z.jsx)(i,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:d.isPending,onClick:()=>o(e),className:`text-muted-foreground hover:text-destructive`,children:(0,Z.jsx)(Ut,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(H,{open:a!==null,onOpenChange:e=>{!e&&!d.isPending&&o(null)},children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(V,{children:[(0,Z.jsxs)(z,{children:[`Delete `,s?.name,`?`]}),(0,Z.jsx)(L,{children:`Only empty channels can be removed. The server checks this when you delete it, and the channel can be created again later with a new ID.`})]}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(Ce,{disabled:d.isPending,children:`Cancel`}),(0,Z.jsx)(Se,{variant:`destructive`,disabled:d.isPending,onClick:e=>{e.preventDefault(),m()},children:d.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var Mn=`[a-zA-Z0-9-]`,Nn=String.raw`0|[1-9]\d*`,Pn=String.raw`\d+`,Fn=String.raw`\d*[a-zA-Z-]${Mn}*`,In=String.raw`(${Nn})\.(${Nn})\.(${Nn})`,Ln=String.raw`(${Pn})\.(${Pn})\.(${Pn})`,Rn=`(?:${Fn}|${Nn})`,zn=`(?:${Fn}|${Pn})`,Bn=String.raw`(?:-(${Rn}(?:\.${Rn})*))`,Vn=String.raw`(?:-?(${zn}(?:\.${zn})*))`,Hn=`${Mn}+`,Un=String.raw`(?:\+(${Hn}(?:\.${Hn})*))`,Wn=`v?${In}${Bn}?${Un}?`,Gn=String.raw`[v=\s]*${Ln}${Vn}?${Un}?`,Kn=`((?:<|>)?=?)`,qn=String.raw`${Nn}|x|X|\*`,Jn=String.raw`${Pn}|x|X|\*`,Yn=String.raw`[v=\s]*(${qn})(?:\.(${qn})(?:\.(${qn})(?:${Bn})?${Un}?)?)?`,Xn=String.raw`[v=\s]*(${Jn})(?:\.(${Jn})(?:\.(${Jn})(?:${Vn})?${Un}?)?)?`,Zn=`(?:~>?)`,Qn=String.raw`(?:\^)`,$n=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${$n}(?:$|[^\d])`,String.raw`${$n}(?:${Bn})?(?:${Un})?(?:$|[^\d])`;function er(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[Mn,250]];for(let[n,r]of t)e=e.split(`${n}*`).join(`${n}{0,${r}}`).split(`${n}+`).join(`${n}{1,${r}}`);return e}function Q(e,t){return new RegExp(er(e),t)}var tr=Q(`^${Wn}$`),nr=Q(`^${Gn}$`),rr=/^\d+$/;function ir(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function ar(e,t={}){if(typeof e!=`string`)return e;if(e.length>256)throw TypeError(`Version exceeds the maximum length of 256 characters`);let n=e.trim().match(t.loose?nr:tr);if(!n)throw TypeError(`Invalid version syntax: ${e}`);let r=Number(n[1]),i=Number(n[2]),a=Number(n[3]);if(r>2**53-1||r<0)throw TypeError(`Invalid major version: ${n[1]}`);if(i>2**53-1||i<0)throw TypeError(`Invalid minor version: ${n[2]}`);if(a>2**53-1||a<0)throw TypeError(`Invalid patch version: ${n[3]}`);let o=n[4]?n[4].split(`.`).map(e=>{if(rr.test(e)){let t=Number(e);if(t>=0&&t<2**53-1)return t}return e}):void 0;return{build:n[5]?.split(`.`),major:r,minor:i,patch:a,prerelease:o}}var or=Q(String.raw`^${Kn}\s*(${Wn})$|^$`),sr=Q(String.raw`^${Kn}\s*(${Gn})$|^$`);function cr(e){return e.version?`${e.operator}${ir(e.version)}`:``}function lr(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?sr:or);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?ar(r[2],t):null;return{operator:i,options:t,value:a?`${i}${ir(a)}`:``,version:a}}function ur(e){return e.sets.map(e=>e.map(cr).join(` `)).join(`||`)}var dr=new RegExp(Un,`g`),fr=Q(Un),pr=Q(String.raw`^\s*(${Yn})\s+-\s+(${Yn})\s*$`),mr=Q(String.raw`^\s*(${Xn})\s+-\s+(${Xn})\s*$`),hr=Q(String.raw`(\s*)${Kn}\s*(${Gn}|${Yn})`,`g`),gr=Q(String.raw`(\s*)${Zn}\s+`,`g`),_r=Q(String.raw`(\s*)${Qn}\s+`,`g`),vr=Q(`^${Zn}${Yn}$`),yr=Q(`^${Zn}${Xn}$`),br=Q(`^${Qn}${Yn}$`),xr=Q(`^${Qn}${Xn}$`),Sr=Q(String.raw`^${Kn}\s*${Yn}$`),Cr=Q(String.raw`^${Kn}\s*${Xn}$`),wr=Q(String.raw`(<|>)?=?\s*\*`),Tr=/^\s*>=\s*0\.0\.0\s*$/,Er=/^\s*>=\s*0\.0\.0-0\s*$/,Dr=Q(String.raw`^${Kn}\s*(${Gn})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Or(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function kr(e,t){let n=t.loose?yr:vr,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:a?`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`)}function Ar(e,t){return e.trim().split(/\s+/).map(e=>kr(e,t)).join(` `)}function jr(e,t){let n=t.loose?xr:br,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?t===`0`?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.0${r} <${Number(t)+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${i}-${a} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i}-${a} <${Number(t)+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${i} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${Number(t)+1}.0.0-0`)}function Mr(e,t){return e.trim().split(/\s+/).map(e=>jr(e,t)).join(` `)}function Nr(e,t){let n=t.loose?Cr:Sr;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Or(String(c),l===void 0?void 0:String(l),u===void 0?void 0:String(u)))return e;let d=$(c),f=d||$(l),p=f||$(u);if(s===`=`&&p&&(s=``),d)return s===`>`||s===`<`?`<0.0.0-0`:`*`;let m=t.includePrerelease?`-0`:``;return s&&p?(f&&(l=0),u=0,s===`>`?(s=`>=`,f?(c=Number(c)+1,l=0):l=Number(l)+1):s===`<=`&&(s=`<`,f?c=Number(c)+1:l=Number(l)+1),s===`<`&&(m=`-0`),`${s}${c}.${l}.${u}${m}`):f?`>=${c}.0.0${m} <${Number(c)+1}.0.0-0`:p?`>=${c}.${l}.0${m} <${c}.${Number(l)+1}.0-0`:n})}function Pr(e,t){return e.split(/\s+/).map(e=>Nr(e,t)).join(` `)}function Fr(e,t){let n=t.loose?mr:pr;return e.replace(n,(e,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n,m=c;return p=$(r)?``:$(i)?`>=${r}.0.0${t.includePrerelease?`-0`:``}`:$(a)?`>=${r}.${i}.0${t.includePrerelease?`-0`:``}`:o?`>=${p}`:`>=${p}${t.includePrerelease?`-0`:``}`,m=$(l)?``:$(u)?`<${Number(l)+1}.0.0-0`:$(d)?`<${l}.${Number(u)+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:t.includePrerelease?`<${l}.${u}.${Number(d)+1}-0`:`<=${m}`,`${p} ${m}`.trim()})}function Ir(e,t){return Pr(Ar(Mr(e.replace(fr,``),t),t),t).trim().replace(wr,``)}function Lr(e,t){let n=Fr(e.replace(dr,``),t).replace(hr,`$1$2$3`).replace(gr,`$1~`).replace(_r,`$1^`).split(` `).map(e=>Ir(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Er:Tr,``));t.loose&&(n=n.filter(e=>Dr.test(e)));let r=new Map;for(let e of n.map(e=>lr(e,t))){if(e.value===`<0.0.0-0`)return[e];r.set(e.value,e)}return r.size>1&&r.delete(``),[...r.values()]}function Rr(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Lr(e.trim(),n)).filter(e=>e.length);if(!i.length)throw TypeError(`Range contains no valid comparator sets: ${r}`);if(i.length>1){let e=i[0];if(i=i.filter(e=>e[0]?.value!==`<0.0.0-0`),!i.length)i=[e];else if(i.length>1){let e=i.find(e=>e.length===1&&e[0]?.value===``);e&&(i=[e])}}return{options:n,sets:i}}function zr(e,t={}){try{return Rr(e,t)}catch{return null}}function Br(e,t={}){let n=zr(e,t);return n?ur(n)||`*`:null}var Vr=e=>{let t=e.trim();if(t.startsWith(`git@`)){let e=t.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(e)return`https://${e[1]}/${e[2]}`}if(t.startsWith(`ssh://`))try{let e=new URL(t);return`https://${e.hostname}${e.pathname}`.replace(/\/+$/,``).replace(/\.git$/,``)}catch{return t.replace(/\/+$/,``).replace(/\.git$/,``)}return t.replace(/\/+$/,``).replace(/\.git$/,``)},Hr=(e,t)=>{if(!e?.trim())return null;let n=Vr(e);try{let{hostname:e}=new URL(n);if(e.includes(`gitlab`))return`${n}/-/commit/${t}`;if(e.includes(`bitbucket`))return`${n}/commits/${t}`}catch{}return`${n}/commit/${t}`};function Ur({label:e,value:t}){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-start sm:justify-between sm:gap-4`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,Z.jsx)(`dd`,{className:`min-w-0 text-left text-sm sm:text-right`,children:t})]})}function Wr({bundle:e,release:t}){let{data:n,isFetched:r}=we(),i=e?Jt(e):null,a=e?nn(e):null,o=e?.gitCommitHash&&r?Hr(n?.console.gitUrl,e.gitCommitHash):null,s=t.strategy===`APP_VERSION`?t.target_app_version:t.fingerprint_hash;return s||e?.gitCommitHash||e?.manifestFileHash||a||i?(0,Z.jsxs)(Xe,{children:[(0,Z.jsx)(nt,{className:`p-4 pb-3`,children:(0,Z.jsx)(it,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(Je,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(Ur,{label:t.strategy===`APP_VERSION`?`Target app version`:`Fingerprint target`,value:(0,Z.jsx)(`span`,{className:`break-all font-mono text-xs`,translate:`no`,children:s??`—`})}),e?.gitCommitHash?(0,Z.jsx)(Ur,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(Ct,{className:o?`text-primary`:void 0,maxLength:12,value:e.gitCommitHash}),o?(0,Z.jsx)(`a`,{"aria-label":`Open git commit`,className:`shrink-0 text-primary hover:underline`,href:o,rel:`noopener noreferrer`,target:`_blank`,children:(0,Z.jsx)(pn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(Ur,{label:`Manifest hash`,value:(0,Z.jsx)(Ct,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(Ur,{label:`Base hash`,value:(0,Z.jsx)(Ct,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(Ur,{label:`Patch hash`,value:(0,Z.jsx)(Ct,{maxLength:16,value:i})}):null]})})]}):null}var Gr=Array.from({length:tn},(e,t)=>t+1);function Kr({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=Qt(t),a=n??[],o=a.length>0,s=r>0&&r<1e3,c=r===tn,l=le(),u=c?Gr:s?Gr.filter(t=>qt(e,t)<r):[],d=(r/10).toFixed(1),f=c?tn:u.length,p=tn-f,m=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,Z.jsx)(Xe,{children:(0,Z.jsxs)(nt,{className:`p-4`,children:[(0,Z.jsx)(qe,{children:`Selected cohorts`}),(0,Z.jsx)(it,{className:`font-mono text-2xl tabular-nums`,children:f})]})}),(0,Z.jsx)(Xe,{children:(0,Z.jsxs)(nt,{className:`p-4`,children:[(0,Z.jsx)(qe,{children:`Excluded cohorts`}),(0,Z.jsx)(it,{className:`font-mono text-2xl tabular-nums`,children:p})]})})]}),o?(0,Z.jsxs)(Xe,{children:[(0,Z.jsxs)(nt,{className:`p-4 pb-3`,children:[(0,Z.jsx)(it,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(qe,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(Je,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-lg border bg-muted/20 p-3`,children:a.map(e=>(0,Z.jsx)(K,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Z.jsxs)(Xe,{children:[(0,Z.jsx)(nt,{className:`p-4 pb-3`,children:(0,Z.jsx)(it,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(Je,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`max-h-[50vh] overflow-y-auto overscroll-contain rounded-lg border bg-muted/20 p-3 sm:max-h-[45vh]`,children:u.length>0?(0,Z.jsx)(`div`,{"aria-label":`Included numeric cohorts`,className:`grid grid-cols-3 gap-2 sm:grid-cols-6 lg:grid-cols-8`,role:`list`,children:u.map(e=>(0,Z.jsx)(K,{className:`justify-center font-mono tabular-nums`,role:`listitem`,variant:`outline`,children:e},e))}):(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No numeric cohorts are included.`})})})]})]});return(0,Z.jsxs)(Nt,{children:[(0,Z.jsxs)(Mt,{render:(0,Z.jsx)(i,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(wt,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(kt,{className:l?`top-0 left-0 h-dvh max-w-none translate-x-0 translate-y-0 rounded-none border-0 p-0`:`sm:max-w-3xl`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,Z.jsxs)(Tt,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(At,{children:`Rolled out cohorts`}),(0,Z.jsxs)(jt,{children:[d,`% includes `,f,` of`,` `,tn,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain px-4 py-4`,children:m}),(0,Z.jsx)(Dt,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Tt,{children:[(0,Z.jsx)(At,{children:`Rolled out cohorts`}),(0,Z.jsxs)(jt,{children:[d,`% includes `,f,` of`,` `,tn,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),m,(0,Z.jsx)(Dt,{showCloseButton:!0})]})})]})}function qr(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Jr(e,t){return e-t}function Yr(e,t,n){let r=e.slice();return r[t]=n,r.sort(Jr)}function Xr(e,t,n,r,i,a){let o=e;return o=q(o,n,r),i&&(o=Yr(a,t,q(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function Zr(e,t,n){if(!Array.isArray(e))return!0;let r=e.reduce((e,t,n,r)=>(n===r.length-1||e.push(Math.abs(t-r[n+1])),e),[]);return Math.min(...r)>=t*n}var Qr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...lt},$r=X.createContext(void 0);function ei(){let e=X.useContext($r);if(e===void 0)throw Error(l(62));return e}function ti(e){return`key`in e?k:ne}function ni(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?qr(e,t):!1}var ri=X.forwardRef(function(e,t){let{"aria-labelledby":r,className:i,defaultValue:o,disabled:s=!1,id:c,format:l,largeStep:u=10,locale:d,render:f,max:p=100,min:m=0,minStepsBetweenValues:h=0,form:g,name:_,onValueChange:v,onValueCommitted:y,orientation:b=`horizontal`,step:x=1,thumbCollisionBehavior:w=`push`,thumbAlignment:T=`center`,value:te,style:ne,...D}=e,re=j(c),ae=mt(re),oe=E(v),se=E(y),{clearErrors:ce}=gt(),{state:le,disabled:O,name:k,setTouched:ue,setDirty:de,validityData:fe,shouldValidateOnChange:me,validation:A}=ot(),{labelId:he}=ct(),[ge,_e]=X.useState(),N=r??ht(he,ge),P=O||s,F=k??_,[I,be]=ye({controlled:te,default:o??m,name:`Slider`}),L=X.useRef(null),R=X.useRef(null),z=X.useRef([]),Se=X.useRef(null),B=X.useRef(null),Ce=X.useRef(-1),V=X.useRef(null),H=X.useRef(null),we=X.useRef(`none`),Te=pe(l),[U,Ee]=X.useState(-1),[De,Oe]=X.useState(-1),[ke,Ae]=X.useState(!1),[je,Me]=X.useState(()=>new Map),[Ne,Pe]=X.useState([void 0,void 0]),Fe=E(e=>{Ee(e),e!==-1&&Oe(e)});st(R,re,I),M(I,()=>{ce(F),me()?A.commit(I):A.commit(I,!0);let e=fe.initialValue,t;t=Array.isArray(I)&&Array.isArray(e)?!qr(I,e):I!==e,de(t)});let Ie=E(e=>{e&&(R.current=e)}),Le=Array.isArray(I),Re=X.useMemo(()=>Le?I.slice().sort(Jr):[q(I,m,p)],[p,m,Le,I]),W=E((e,t)=>{if(Number.isNaN(e)||ni(e,I))return;let n=t??ee(`none`,void 0,void 0,{activeThumbIndex:-1});we.current=n.reason;let r=n.event,i=new(r.constructor??Event)(r.type,r);Object.defineProperty(i,`target`,{writable:!0,value:{value:e,name:F}}),n.event=i,H.current=e,oe(e,n),!n.isCanceled&&be(e)}),ze=E((e,t,n)=>{let r=Xr(e,t,m,p,Le,Re);if(Zr(r,x,h)){let e=ti(n);W(r,ee(e,n.nativeEvent,void 0,{activeThumbIndex:t})),ue(!0),se(H.current??r,C(e,n.nativeEvent))}});S(()=>{let e=ve(a(L.current));P&&ie(L.current,e)&&e.blur()},[P]),P&&U!==-1&&Fe(-1);let G=X.useMemo(()=>({...le,activeThumbIndex:U,disabled:P,dragging:ke,orientation:b,max:p,min:m,minStepsBetweenValues:h,step:x,values:Re}),[le,U,P,ke,p,m,h,b,x,Re]),Be=X.useMemo(()=>({active:U,controlRef:R,disabled:P,dragging:ke,validation:A,formatOptionsRef:Te,handleInputChange:ze,indicatorPosition:Ne,inset:T!==`center`,labelId:N,rootLabelId:ae,largeStep:u,lastUsedThumbIndex:De,lastChangedValueRef:H,lastChangeReasonRef:we,form:g,locale:d,max:p,min:m,minStepsBetweenValues:h,name:F,onValueCommitted:se,orientation:b,pressedInputRef:Se,pressedThumbCenterOffsetRef:B,pressedThumbIndexRef:Ce,pressedValuesRef:V,registerFieldControlRef:Ie,renderBeforeHydration:T===`edge`,setActive:Fe,setDragging:Ae,setIndicatorPosition:Pe,setLabelId:_e,setValue:W,state:G,step:x,thumbCollisionBehavior:w,thumbMap:je,thumbRefs:z,values:Re}),[U,R,N,ae,P,ke,A,Te,ze,Ne,u,De,H,we,g,d,p,m,h,F,se,b,Se,B,Ce,V,Ie,Fe,Ae,Pe,_e,W,G,x,w,T,je,z,Re]),Ve=n(`div`,e,{state:G,ref:[t,L],props:[{"aria-labelledby":N,id:re,role:`group`},A.getValidationProps,D],stateAttributesMapping:Qr});return(0,Z.jsx)($r.Provider,{value:Be,children:(0,Z.jsx)(xe,{elementsRef:z,onMapChange:Me,children:Ve})})});function ii(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function ai(e){if(e===0)return 0;if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function oi(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(ai(t),ai(n))))}function si({values:e,index:t,nextValue:n,min:r,max:i,step:a,minStepsBetweenValues:o,initialValues:s}){if(e.length===0)return[];let c=e.slice(),l=a*o,u=c.length-1,d=s??e;c[t]=q(n,r+t*l,i-(u-t)*l);for(let e=t+1;e<=u;e+=1){let t=c[e-1]+l,n=i-(u-e)*l,r=d[e]??c[e],a=Math.max(c[e],t);r<a&&(a=Math.max(r,t)),c[e]=q(a,t,n)}for(let e=t-1;e>=0;--e){let t=c[e+1]-l,n=r+e*l,i=d[e]??c[e],a=Math.min(c[e],t);i>a&&(a=Math.min(i,t)),c[e]=q(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function ci({behavior:e,values:t,currentValues:n,initialValues:r,pressedIndex:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}){let u=n??t,d=r??t;if(!(u.length>1))return{value:a,thumbIndex:0,didSwap:!1};let f=c*l;switch(e){case`swap`:{let e=u[i],t=1e-7,n=u.slice(),r=n[i-1],p=n[i+1],m=q(a,r==null?o:r+f,p==null?s:p-f),h=Number(m.toFixed(12));n[i]=h;let g=a>e,_=a<e,v=g&&p!=null&&a>=p-t,y=_&&r!=null&&a<=r+t;if(!v&&!y)return{value:n,thumbIndex:i,didSwap:!1};let b=v?i+1:i-1,x=n.map((e,t)=>t===i?h:d[t]??u[t]),S=a;S=v?Math.max(a,n[b]):Math.min(a,n[b]);let C=si({values:n,index:b,nextValue:S,min:o,max:s,step:c,minStepsBetweenValues:l,initialValues:x}),w=v?b-1:b+1;if(w>=0&&w<C.length){let e=C[w-1],t=C[w+1],n=e==null?o:e+f;n=Math.max(n,o+w*f);let r=t==null?s:t-f;r=Math.min(r,s-(C.length-1-w)*f);let i=q(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:si({values:u,index:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}),thumbIndex:i,didSwap:!1};default:{let e=u.slice(),t=e[i-1],n=e[i+1],r=q(a,t==null?o:t+f,n==null?s:n-f);return e[i]=Number(r.toFixed(12)),{value:e,thumbIndex:i,didSwap:!1}}}}var li=2;function ui(e,t){if(!e)return{start:0,end:0};function n(e){let t=e==null?0:parseFloat(e);return Number.isNaN(t)?0:t}let r=t?`Top`:`InlineStart`,i=t?`Bottom`:`InlineEnd`;return{start:n(e[`border${r}Width`])+n(e[`padding${r}`]),end:n(e[`border${i}Width`])+n(e[`padding${i}`])}}function di(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return null}return{x:e.clientX,y:e.clientY}}var fi=X.forwardRef(function(e,r){let{render:i,className:o,style:s,...c}=e,{disabled:l,dragging:f,inset:p,lastChangedValueRef:m,lastChangeReasonRef:h,max:g,min:_,minStepsBetweenValues:v,onValueCommitted:y,orientation:b,pressedInputRef:x,pressedThumbCenterOffsetRef:S,pressedThumbIndexRef:w,pressedValuesRef:T,registerFieldControlRef:te,renderBeforeHydration:ne,setActive:D,setDragging:re,setValue:ae,state:se,step:ce,thumbCollisionBehavior:le,thumbRefs:O,values:k}=ei(),fe=ue(),me=k.length>1,A=b===`vertical`,j=X.useRef(null),ge=X.useRef(null),_e=E(e=>{e&&ge.current==null&&(ge.current=t(e).getComputedStyle(e))}),M=X.useRef(null),P=X.useRef(0),F=X.useRef(0),ye=pe(k);function I(e){w.current!==e&&(w.current=e);let t=O.current[e];if(!t){S.current=null,x.current=null;return}x.current=t.querySelector(`input[type="range"]`)}function be(e){let t=j.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=ui(ge.current,A),c=F.current,l=(A?r:n)-s.start-s.end-c*2,u=S.current??0,d=e.x-u,f=e.y-u,p=q(((A?i-f-s.end:(fe===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(g-_)*p+_;if(m=oi(m,ce,_),m=q(m,_,g),!me)return{value:m,thumbIndex:0,didSwap:!1};let h=w.current;if(h<0)return null;let y=ci({behavior:le,values:k,currentValues:ye.current??k,initialValues:T.current,pressedIndex:h,nextValue:m,min:_,max:g,step:ce,minStepsBetweenValues:v});return le===`swap`&&y.didSwap?I(y.thumbIndex):w.current=y.thumbIndex,y}function xe(e){T.current=me?k.slice():null,ye.current=k;let t=w.current,n=t;if(t>-1&&t<k.length){if(k[t]===g){let e=t;for(;e>0&&k[e-1]===g;)--e;n=e}}else{let t=A?`y`:`x`,r;n=-1;for(let i=0;i<O.current.length;i+=1){let a=O.current[i];if(oe(a)){let o=ii(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&I(n),p){let e=O.current[n];oe(e)&&(F.current=e.getBoundingClientRect()[A?`height`:`width`]/2)}}function L(e){let t=O.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let R=E(e=>{let t=di(e,M);if(t==null)return;if(P.current+=1,e.type===`pointermove`&&e.buttons===0){z(e);return}let n=be(t);n!=null&&Zr(n.value,ce,v)&&(!f&&P.current>li&&re(!0),ae(n.value,ee(he,e,void 0,{activeThumbIndex:n.thumbIndex})),ye.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&L(n.thumbIndex))});function z(e){D(-1),re(!1),x.current=null,S.current=null;let t=di(e,M),n=t==null?null:be(t);if(n!=null){let t=h.current;y(m.current??n.value,C(t,e))}`pointerType`in e&&j.current?.hasPointerCapture(e.pointerId)&&j.current?.releasePointerCapture(e.pointerId),w.current=-1,M.current=null,T.current=null,B()}let Se=E(e=>{if(l)return;let t=e.changedTouches[0];t!=null&&(M.current=t.identifier);let n=di(e,M);if(n!=null){xe(n);let t=be(n);if(t==null)return;L(t.thumbIndex),ae(t.value,ee(de,e,void 0,{activeThumbIndex:t.thumbIndex})),ye.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&L(t.thumbIndex)}P.current=0;let r=a(j.current);r.addEventListener(`touchmove`,R,{passive:!0}),r.addEventListener(`touchend`,z,{passive:!0})}),B=E(()=>{let e=a(j.current);e.removeEventListener(`pointermove`,R),e.removeEventListener(`pointerup`,z),e.removeEventListener(`touchmove`,R),e.removeEventListener(`touchend`,z),T.current=null}),Ce=d();return X.useEffect(()=>{let e=j.current;if(!e)return()=>B();let t=u(e,`touchstart`,Se,{passive:!0});return()=>{t(),Ce.cancel(),B()}},[B,Se,j,Ce]),X.useEffect(()=>{l&&B()},[l,B]),n(`div`,e,{state:se,ref:[r,te,j,_e],props:[{"data-base-ui-slider-control":ne?``:void 0,onPointerDown(e){let t=j.current,n=N(e.nativeEvent);if(!t||l||e.defaultPrevented||!oe(n)||e.button!==0)return;let r=di(e,M);if(r!=null){xe(r);let n=be(r);if(n==null)return;ie(O.current[n.thumbIndex],ve(a(t)))?e.preventDefault():Ce.request(()=>{L(n.thumbIndex)}),re(!0),S.current??(ae(n.value,ee(de,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),ye.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&L(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),P.current=0;let i=a(j.current);i.addEventListener(`pointermove`,R,{passive:!0}),i.addEventListener(`pointerup`,z,{once:!0})}},c],stateAttributesMapping:Qr})}),pi=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{state:s}=ei();return n(`div`,e,{state:s,ref:t,props:[{style:{position:`relative`}},o],stateAttributesMapping:Qr})}),mi=function(e){return e.index=`data-index`,e.dragging=`data-dragging`,e.orientation=`data-orientation`,e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.focused=`data-focused`,e}({}),hi=new Set([...f,_,o]);function gi(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${ln(e[t],r,n)} start range`:`${ln(e[t],r,n)} end range`:n?ln(e[t],r,n):void 0}function _i(e,t,n,r,i){let a=n===1?e+t:e-t;return q(Number(a.toFixed(Math.max(ai(e),ai(t),ai(r)))),r,i)}var vi=X.forwardRef(function(e,i){let{render:a,children:c,className:l,"aria-describedby":u,"aria-label":d,"aria-labelledby":p,disabled:v=!1,getAriaLabel:y,getAriaValueText:C,id:ee,index:T,inputRef:te,onBlur:ne,onFocus:D,onKeyDown:re,tabIndex:ie,style:ae,...oe}=e,{nonce:se}=dt(),ce=j(ee),{active:le,lastUsedThumbIndex:O,controlRef:k,disabled:de,validation:fe,formatOptionsRef:pe,handleInputChange:me,inset:A,labelId:he,largeStep:ge,locale:M,max:N,min:P,minStepsBetweenValues:ve,form:F,name:ye,orientation:be,pressedInputRef:xe,pressedThumbCenterOffsetRef:L,pressedThumbIndexRef:R,renderBeforeHydration:z,setActive:Se,setIndicatorPosition:B,state:Ce,step:V,values:H}=ei(),we=ue(),Te=v||de,U=H.length>1,Ee=be===`vertical`,De=we===`rtl`,{setTouched:Oe,setFocused:ke,validationMode:Ae}=ot(),je=X.useRef(null),Me=X.useRef(null),Ne=X.useRef(!1),Pe=j(),Fe=ft(),Ie=U?Pe:Fe,{ref:Le,index:Re}=I({metadata:X.useMemo(()=>({inputId:Ie}),[Ie])}),W=U?T??Re:0,ze=W===H.length-1,G=H[W],Be=un(G,P,N),[Ve,He]=X.useState(),Ue=Cn(),We=O>=0&&O<H.length?O:-1,Ge=E(()=>{let e=k.current,t=je.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Ee?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Be/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;He(s),W===0?B(e=>[s,e[1]]):ze&&B(e=>[e[0],s])});S(()=>{A&&queueMicrotask(Ge)},[Ge,A]),S(()=>{A&&Ge()},[Ge,A,Be]),S(()=>{if(!A)return;let e=k.current,n=je.current;if(!e||!n)return;let r=t(e).ResizeObserver;if(typeof r!=`function`)return;let i=new r(Ge);return i.observe(e),i.observe(n),()=>{i.disconnect()}},[k,Ge,A]);let Ke=Ee?`bottom`:`insetInlineStart`,qe=Ee?`left`:`top`,Je;U?le===W?Je=2:We===W&&(Je=1):le===W&&(Je=1);let Ye;Ye=A?{"--position":`${Ve??0}%`,visibility:z&&Ue||Ve===void 0?`hidden`:void 0,position:`absolute`,[Ke]:`var(--position)`,[qe]:`50%`,translate:`${(Ee||!De?-1:1)*50}% ${(Ee?1:-1)*50}%`,zIndex:Je}:Number.isFinite(Be)?{position:`absolute`,[Ke]:`${Be}%`,[qe]:`50%`,translate:`${(Ee||!De?-1:1)*50}% ${(Ee?1:-1)*50}%`,zIndex:Je}:b;let K;be===`vertical`&&(K=De?`vertical-rl`:`vertical-lr`);let Xe=typeof y==`function`?y(W):d,Ze=w({"aria-label":Xe,"aria-labelledby":p??(Xe==null?he:void 0),"aria-describedby":u,"aria-orientation":be,"aria-valuenow":G,"aria-valuetext":typeof C==`function`?C(ln(G,M,pe.current??void 0),G,W):gi(H,W,pe.current??void 0,M),disabled:Te,form:F,id:Ie,max:N,min:P,name:ye,onChange(e){me(e.currentTarget.valueAsNumber,W,e)},onFocus(e){let t=Ne.current;Ne.current=!1,Se(W),ke(!0),t&&e.stopPropagation()},onBlur(e){if(Ne.current){e.stopPropagation();return}je.current&&(Se(-1),Oe(!0),ke(!1),Ae===`onBlur`&&fe.commit(Xr(G,W,P,N,U,H)))},onKeyDown(e){if(!hi.has(e.key))return;f.has(e.key)&&e.stopPropagation();let t=null,n=oi(G,V,P);switch(e.key){case s:t=_i(n,e.shiftKey?ge:V,1,P,N);break;case r:t=_i(n,e.shiftKey?ge:V,De?-1:1,P,N);break;case m:t=_i(n,e.shiftKey?ge:V,-1,P,N);break;case h:t=_i(n,e.shiftKey?ge:V,De?1:-1,P,N);break;case _:t=_i(n,ge,1,P,N);break;case o:t=_i(n,ge,-1,P,N);break;case`End`:t=N,U&&(t=Number.isFinite(H[W+1])?H[W+1]-V*ve:N);break;case g:t=P,U&&(t=Number.isFinite(H[W-1])?H[W-1]+V*ve:P);break;default:break}if(t!==null){let n=e.currentTarget;_e(n)||(Ne.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),me(t,W,e),e.preventDefault()}},step:V,style:{...b,width:`100%`,height:`100%`,writingMode:K},tabIndex:ie??void 0,type:`range`,value:G??``},fe.getInputValidationProps),Qe=x(Me,fe.inputRef,te);return n(`div`,e,{state:Ce,ref:[i,Le,je],props:[{[mi.index]:W,children:(0,Z.jsxs)(X.Fragment,{children:[c,(0,Z.jsx)(`input`,{ref:Qe,...Ze,suppressHydrationWarning:!0}),A&&Ue&&z&&ze&&(0,Z.jsx)(`script`,{nonce:se,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();'},suppressHydrationWarning:!0})]}),id:ce,onBlur:ne,onFocus:D,onPointerDown(e){if(R.current=W,je.current!=null){let t=be===`horizontal`?`x`:`y`,n=ii(je.current);L.current=(be===`horizontal`?e.clientX:e.clientY)-n[t]}Me.current!=null&&xe.current!==Me.current&&(xe.current=Me.current)},style:Ye,suppressHydrationWarning:z||void 0},oe],stateAttributesMapping:Qr})});function yi(e,t,n,r,i,a){let o=n===void 0||t&&r===void 0?`hidden`:void 0,s=e?`bottom`:`insetInlineStart`,c=e?`height`:`width`,l={visibility:i&&a?`hidden`:o,position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};return l[`--start-position`]=`${n??0}%`,t?(l[`--relative-size`]=`${(r??0)-(n??0)}%`,l[s]=`var(--start-position)`,l[c]=`var(--relative-size)`,l):(l[s]=0,l[c]=`var(--start-position)`,l)}function bi(e,t,n,r){let i=e?`bottom`:`insetInlineStart`,a=e?`height`:`width`,o={position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};if(!t)return o[i]=0,o[a]=`${n}%`,o;let s=r-n;return o[i]=`${n}%`,o[a]=`${s}%`,o}var xi=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{indicatorPosition:s,inset:c,max:l,min:u,orientation:d,renderBeforeHydration:f,state:p,values:m}=ei(),h=Cn(),g=d===`vertical`,_=m.length>1,v=c?yi(g,_,s[0],s[1],f,h):bi(g,_,un(m[0],u,l),un(m[m.length-1],u,l));return n(`div`,e,{state:p,ref:t,props:[{"data-base-ui-slider-indicator":f?``:void 0,style:v,suppressHydrationWarning:f||void 0},o],stateAttributesMapping:Qr})});function Si({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...a}){let o=Array.isArray(n)?n:n===void 0?Array.isArray(t)?t:t===void 0?[r]:[t]:[n];return(0,Z.jsx)(ri,{className:p(`data-horizontal:w-full data-vertical:h-full`,e),"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,thumbAlignment:`edge`,...a,children:(0,Z.jsxs)(fi,{className:`relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col`,children:[(0,Z.jsx)(pi,{"data-slot":`slider-track`,className:`relative grow overflow-hidden rounded-full bg-primary/20 select-none data-horizontal:h-1.5 data-horizontal:w-full data-vertical:h-full data-vertical:w-1.5`,children:(0,Z.jsx)(xi,{"data-slot":`slider-range`,className:`bg-primary select-none data-horizontal:h-full data-vertical:w-full`})}),Array.from({length:o.length},(e,t)=>(0,Z.jsx)(vi,{"data-slot":`slider-thumb`,className:`relative block size-4 shrink-0 rounded-full border border-primary/50 bg-background shadow transition-colors select-none after:absolute after:-inset-2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-disabled:pointer-events-none data-disabled:opacity-50`},t))]})})}var Ci=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],wi=e=>({enabled:e.enabled,message:e.message??``,rolloutCohortCount:e.rollout_cohort_count,shouldForceUpdate:e.should_force_update,targetAppVersion:e.target_app_version??``,targetCohorts:[...e.target_cohorts]}),Ti=(e,t)=>({enabled:t.enabled,message:t.message.trim()||null,rolloutCohortCount:t.rolloutCohortCount,shouldForceUpdate:t.shouldForceUpdate,...e.strategy===`APP_VERSION`?{targetAppVersion:t.targetAppVersion.trim()}:{},targetCohorts:t.targetCohorts}),Ei=e=>(e/10).toFixed(1),Di=e=>{let t=e.replace(`,`,`.`),[n=``,...r]=t.split(`.`),i=n.replace(/\D/g,``).slice(0,3),a=r.join(``).replace(/\D/g,``).slice(0,1);return t.includes(`.`)?`${i}.${a}`:i},Oi=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function ki({value:e,onChange:t}){let[n,r]=(0,X.useState)(Ei(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(Ei(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Si,{"aria-label":`Rollout percentage`,max:1e3,min:0,onValueChange:n=>t(Array.isArray(n)?n[0]??e:n),step:1,value:e}),(0,Z.jsxs)(zt,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(Ft,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=Oi(n)??e;a(!1),r(Ei(i)),t(i)},onChange:e=>{let n=Di(e.target.value);r(n);let i=Oi(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(It,{align:`inline-end`,children:(0,Z.jsx)(Pt,{children:`%`})})]})]})}function Ai({channels:t,onOpenChange:n,onShowScope:r,open:a,releaseId:o}){let s=Ee(o),c=s.data,l=Pe(c?.bundle_id??``),u=l.data,d=u?Zt(u):null,f=U(c?.scope_key??``),p=Ae(),m=ke(),h=Te(),g=Le(),[_,v]=(0,X.useState)(null),[y,b]=(0,X.useState)(``),[x,S]=(0,X.useState)(``),[C,w]=(0,X.useState)(!1),[ee,E]=(0,X.useState)(!1),[ne,D]=(0,X.useState)(!1),[ie,ae]=(0,X.useState)(``),[oe,le]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{v(c?wi(c):null),S(``)},[c]);let k=c?wi(c):null,ue=_!==null&&k!==null&&JSON.stringify(_)!==JSON.stringify(k),de=m.isPending||p.isPending||h.isPending||g.isPending,fe=()=>{if(!de){if(ue){w(!0);return}n(!1)}},pe=()=>{if(!_)return;let e=en(y);if(!Yt(e)){S($t);return}v({..._,targetCohorts:Array.from(new Set([..._.targetCohorts,e]))}),b(``),S(``)},me=async()=>{if(!c||!_)return;let e=_.targetCohorts.map(en);if(e.some(e=>!Yt(e))){S($t);return}if(c.strategy===`APP_VERSION`&&!Br(_.targetAppVersion.trim())){S(`Enter a valid target app version range.`);return}let t={expectedRevision:c.revision,patch:Ti(c,{..._,targetCohorts:e}),releaseId:c.id};S(``);try{await m.mutateAsync(t),await p.mutateAsync(t),Gt.success(`Bundle settings saved`),n(!1)}catch(e){S(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},A=t.find(e=>e.id===c?.channel_id)?.name??c?.channel_id,he=t.filter(e=>e.id!==c?.channel_id),j=he.map(e=>({label:e.name,value:e.name})),_e=ie.trim(),M=oe===`copy`,N=_?Br(_.targetAppVersion.trim()):null,ve=()=>{ae(``),le(`move`)},F=e=>{!e&&g.isPending||(D(e),e||ve())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ce,{onOpenChange:e=>e?void 0:fe(),open:a,children:(0,Z.jsxs)(te,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(P,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(re,{children:`Bundle Detail`}),(0,Z.jsx)(ge,{className:`sr-only`,children:`Edit bundle delivery settings.`}),c?(0,Z.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-col gap-3 text-sm`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(ut,{className:`size-4`,platform:c.platform}),(0,Z.jsx)(`span`,{className:`font-medium`,children:c.platform===`ios`?`iOS`:`Android`})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`ID`}),(0,Z.jsxs)(`span`,{className:`min-w-0 basis-full sm:basis-auto`,children:[(0,Z.jsx)(cn,{bundleId:c.id,fullOnMobile:!0,maxLength:18}),c.bundle_id?null:(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:`Built-in bundle`})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Channel`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,translate:`no`,children:A})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Platform`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:c.platform===`ios`?`iOS`:`Android`})]})]}):(0,Z.jsx)(e,{className:`h-12 w-full`})]}),(0,Z.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[s.isError?(0,Z.jsxs)(tt,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(We,{}),(0,Z.jsx)(Qe,{children:`Bundle details could not be loaded`}),(0,Z.jsx)(Ke,{children:s.error.message})]}):null,c&&_?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[A?(0,Z.jsx)(Re,{release:{platform:c.platform,channel:A,releaseId:c.id,builtIn:!c.bundle_id}}):null,(0,Z.jsxs)(`section`,{"aria-labelledby":`delivery-settings-heading`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,id:`delivery-settings-heading`,children:`Delivery settings`}),(0,Z.jsxs)(Ye,{className:`gap-6`,children:[(0,Z.jsxs)(et,{children:[(0,Z.jsx)(Ue,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(Lt,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>v({..._,message:e.target.value}),rows:3,value:_.message})]}),c.strategy===`APP_VERSION`?(0,Z.jsxs)(et,{children:[(0,Z.jsx)(Ue,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(T,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>v({..._,targetAppVersion:e.target.value}),value:_.targetAppVersion}),N?(0,Z.jsx)(Ze,{children:N}):null]}):null,(0,Z.jsx)(et,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(Ue,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(Xt,{label:`About Enabled`,children:`Disabling rolls devices back to the previous enabled bundle on their next check, or to the built-in app when none remains.`})]}),(0,Z.jsx)(Wt,{"aria-label":`Enabled`,checked:_.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>v({..._,enabled:e})})]})}),(0,Z.jsx)(et,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(Ue,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(Xt,{label:`About Force update`,children:`Devices apply this bundle right away, and so do devices that skip it to update straight to a newer bundle.`})]}),(0,Z.jsx)(Wt,{"aria-label":`Force update`,checked:_.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>v({..._,shouldForceUpdate:e})})]})}),(0,Z.jsxs)(et,{children:[(0,Z.jsx)(Ue,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(ki,{onChange:e=>v({..._,rolloutCohortCount:e}),value:_.rolloutCohortCount})]}),(0,Z.jsxs)(et,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(Ue,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Z.jsx)(Kr,{releaseId:c.id,rolloutCohortCount:_.rolloutCohortCount,targetCohorts:_.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(T,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>b(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),pe())},placeholder:`e.g. qa-team…`,value:y}),(0,Z.jsx)(i,{"aria-label":`Add cohort`,disabled:!y.trim(),onClick:pe,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(Et,{})})]}),_.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:_.targetCohorts.map(e=>(0,Z.jsxs)(K,{className:`gap-1 font-mono`,variant:`secondary`,children:[e,(0,Z.jsx)(`button`,{"aria-label":`Remove cohort ${e}`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>v({..._,targetCohorts:_.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Z.jsx)(O,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Ze,{children:`Public names—no IDs or secrets.`})]})]}),x?(0,Z.jsx)($e,{children:x}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:!ue||de,onClick:me,size:`lg`,children:m.isPending||p.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(se,{className:`my-2`}),(0,Z.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Actions`}),(0,Z.jsx)(i,{className:`w-full`,disabled:!c.bundle_id||de,onClick:()=>D(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),c.bundle_id?(0,Z.jsxs)(i,{className:`w-full`,disabled:de,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(c.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),Gt.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(St,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:c.enabled||de,onClick:()=>E(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),c.bundle_id&&l.isPending?(0,Z.jsx)(e,{className:`h-40 w-full`}):null,c.bundle_id&&l.isError?(0,Z.jsxs)(tt,{variant:`destructive`,children:[(0,Z.jsx)(We,{}),(0,Z.jsx)(Qe,{children:`Build details are unavailable`}),(0,Z.jsx)(Ke,{children:`Delivery settings are unaffected.`})]}):null,!c.bundle_id||!l.isPending?(0,Z.jsx)(Wr,{bundle:u,release:c}):null,(0,Z.jsxs)(`details`,{className:`rounded-lg border bg-muted/10 p-4 text-xs`,children:[(0,Z.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:`Advanced diagnostics`}),(0,Z.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-muted-foreground sm:grid-cols-2`,children:[(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:c.bundle_id??`Built-in bundle`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Revision`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:c.revision})]}),d?(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Patch base artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:d})]}):null,(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog generation`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:f.data?.generation??`—`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog size`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:f.data?`${f.data.byte_size} bytes`:`—`})]}),(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Scope key`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:c.scope_key}),r?(0,Z.jsx)(i,{className:`mt-1 h-auto px-0 text-xs`,onClick:()=>r(c.scope_key),size:`sm`,variant:`link`,children:`Show bundles for this target`}):null]})]}),f.isError?(0,Z.jsx)(`p`,{className:`mt-3 text-destructive`,children:`Diagnostics are unavailable. Bundle settings are unaffected.`}):null]})]}):null]})]})}),(0,Z.jsx)(H,{onOpenChange:w,open:C,children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(V,{children:[(0,Z.jsx)(z,{children:`Discard unsaved changes?`}),(0,Z.jsx)(L,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(Ce,{children:`Keep editing`}),(0,Z.jsx)(Se,{onClick:()=>{w(!1),n(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(H,{onOpenChange:E,open:ee,children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(V,{children:[(0,Z.jsxs)(z,{children:[`Remove this Bundle from `,A??`the channel`,`?`]}),(0,Z.jsx)(L,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(Ce,{children:`Cancel`}),(0,Z.jsx)(Se,{onClick:async()=>{if(c)try{await h.mutateAsync({expectedRevision:c.revision,releaseId:c.id}),Gt.success(`Bundle removed from ${A??`the channel`}`),E(!1),n(!1)}catch(e){S(e instanceof Error?e.message:`Bundle could not be removed from the channel.`)}},variant:`destructive`,children:`Remove from channel`})]})]})}),(0,Z.jsx)(Nt,{onOpenChange:F,open:ne,children:(0,Z.jsxs)(kt,{showCloseButton:!g.isPending,children:[(0,Z.jsxs)(Tt,{children:[(0,Z.jsx)(At,{children:`Promote to Channel`}),(0,Z.jsx)(jt,{children:`Choose how to promote this Bundle, then select the target channel.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-4 py-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Ge,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(xt,{disabled:g.isPending,items:Ci,onValueChange:e=>le(e),value:oe,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(yt,{placeholder:`Select an action`})}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(_t,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(_t,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:M?`Make this Bundle available in the target channel and keep it in the current channel.`:`Move this Bundle to the target channel. Devices in the current channel may fall back to an earlier Bundle.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Ge,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(xt,{disabled:g.isPending,items:j,onValueChange:e=>ae(e??``),value:ie||null,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(yt,{placeholder:`Select a channel`})}),(0,Z.jsx)(vt,{className:`max-h-64`,children:(0,Z.jsx)(bt,{children:he.map(e=>(0,Z.jsx)(_t,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(Dt,{children:[(0,Z.jsx)(i,{disabled:g.isPending,onClick:()=>F(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(i,{disabled:!_e||g.isPending,onClick:async()=>{if(c)try{await g.mutateAsync({action:oe,expectedRevision:c.revision,releaseId:c.id,targetChannel:_e}),F(!1),Gt.success(M?`Bundle copied to ${_e}`:`Bundle moved to ${_e}`)}catch(e){Gt.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:g.isPending?M?`Copying…`:`Moving…`:M?`Copy`:`Move`})]})]})})]})}function ji({release:e}){return(0,Z.jsxs)(K,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(rt,{className:`size-3`}):(0,Z.jsx)(fn,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}function Mi({percentage:e,className:t}){let n=e<100,r=e.toFixed(1);return(0,Z.jsxs)(K,{className:p(`gap-1`,t),variant:n?`secondary`:`default`,children:[n?(0,Z.jsx)(We,{className:`h-3 w-3`}):null,r,`%`]})}var Ni=20,Pi=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],Fi=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}],Ii=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),Li=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`}),Ri=e=>t=>{t.target instanceof Element&&t.target.closest(`button, a, input, select, textarea`)||e()};function zi({channels:e,onChange:t,onClear:n,onManageChannels:r,search:a}){let o=G(a),s=a.channelId!==void 0,c=[{label:`All Channels`,value:`all`},...e.map(e=>({label:e.name,value:e.id}))];return(0,Z.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-2 border-b bg-background px-3 py-3 sm:h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:py-0 sm:backdrop-blur-sm`,children:[(0,Z.jsx)(fe,{className:`-ml-1`}),(0,Z.jsx)(`h1`,{className:`sr-only`,children:`Bundles`}),(0,Z.jsxs)(`div`,{className:`ml-1 flex items-center gap-1.5 text-muted-foreground sm:ml-2`,children:[(0,Z.jsx)(hn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsxs)(xt,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:a.channelId??`all`,children:[(0,Z.jsx)(pt,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(yt,{})}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(_t,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(_t,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(xt,{disabled:!s,items:Pi,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:a.platform??`ios`,children:[(0,Z.jsx)(pt,{"aria-label":`Platform`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,title:s?void 0:`Choose a channel first`,children:(0,Z.jsx)(yt,{})}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(_t,{value:`ios`,children:`iOS`}),(0,Z.jsx)(_t,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(xt,{disabled:!s&&a.scopeKey===void 0,items:Fi,onValueChange:e=>t({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:a.enabled===void 0?`all`:a.enabled?`enabled`:`disabled`,children:[(0,Z.jsx)(pt,{"aria-label":`Status`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(yt,{})}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(_t,{value:`all`,children:`Any Status`}),(0,Z.jsx)(_t,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(_t,{value:`disabled`,children:`Disabled`})]})})]}),(0,Z.jsx)(i,{"aria-label":`Manage channels`,onClick:r,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Z.jsx)(vn,{})}),a.bundleId?(0,Z.jsxs)(K,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Artifact filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear artifact filter`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>t({bundleId:void 0}),type:`button`,children:(0,Z.jsx)(O,{className:`size-3`})})]}):null,a.scopeKey?(0,Z.jsxs)(K,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Target filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear target filter`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>t({scopeKey:void 0}),type:`button`,children:(0,Z.jsx)(O,{className:`size-3`})})]}):null,o?(0,Z.jsxs)(i,{className:`h-8 px-2 text-xs text-muted-foreground hover:text-foreground sm:ml-auto`,onClick:n,size:`sm`,variant:`ghost`,children:[(0,Z.jsx)(O,{"data-icon":`inline-start`}),`Clear`]}):null]})}function Bi({expanded:e,onOpen:t,onToggleExpand:n,release:r}){let a=r.operation===`PROMOTE`?`Promoted`:r.operation===`ROLLBACK`?`Rollback`:null;return(0,Z.jsxs)(`div`,{className:`flex min-w-[240px] items-center gap-3`,children:[r.bundle_id?(0,Z.jsx)(i,{"aria-controls":`bundle-lineage-panel-${r.id}`,"aria-expanded":e,"aria-label":e?`Hide advanced artifact diagnostics`:`Show advanced artifact diagnostics`,title:`Advanced artifact diagnostics`,className:`size-8 shrink-0 touch-manipulation`,onClick:n,size:`icon`,type:`button`,variant:`ghost`,children:e?(0,Z.jsx)(be,{}):(0,Z.jsx)(at,{})}):(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-8 shrink-0`}),(0,Z.jsxs)(`button`,{"aria-label":`Open details for ID ${r.id}`,className:`min-w-0 rounded-sm text-left text-foreground transition-colors underline-offset-4 hover:text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:t,title:r.id,type:`button`,children:[(0,Z.jsx)(cn,{bundleId:r.id,fullOnMobile:!0}),r.bundle_id?null:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,Z.jsx)(Rt,{className:`size-3.5`}),` Built-in bundle`]})]}),a?(0,Z.jsx)(K,{className:`shrink-0 font-normal`,variant:`secondary`,children:a}):null,r.currentlyUnreachable?(0,Z.jsxs)(`span`,{"aria-label":`Unreachable: no device gets this bundle with the current delivery settings.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No device gets this bundle with the current delivery settings.`,children:[(0,Z.jsx)(fn,{className:`size-3.5`}),`Unreachable`]}):null]})}function Vi({onDetailClick:t,panelId:n,release:r}){let i=r.bundle_id??``,a=Pe(i),o=je(i);return a.isError||o.isError?(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Patch lineage could not be loaded.`}):a.isPending?(0,Z.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:n,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):a.data?(0,Z.jsx)(An,{bundle:a.data,bundles:o.data??[],loading:o.isPending,onDetailClick:t,panelId:n}):(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Bundle details are unavailable.`})}function Hi(){let t=He.useSearch(),n=He.useNavigate(),r=le(),[a,o]=(0,X.useState)(!1),[s,l]=(0,X.useState)(),u=Ne({afterReleaseId:t.afterReleaseId,beforeReleaseId:t.beforeReleaseId,filter:Be(t),limit:Ni}),d=Oe().data??[],f=u.data?.data??[],m=Ie(Array.from(new Set(f.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},h=u.data?.next,g=u.data?.previous,_=f.flatMap(e=>{let t=d.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t,builtIn:!e.bundle_id}]:[]}),v=Ve(),y=10+v.length,b=new Map(d.map(e=>[e.id,e.name]));(0,X.useEffect)(()=>{s&&!f.some(e=>e.id===s)&&l(void 0)},[s,f]);let x=(e,t=!0)=>void n({resetScroll:t,search:e,to:`/`}),S=e=>x(ze(t,e)),C=e=>{let n=f.find(t=>t.bundle_id===e.id);if(l(void 0),n){x({...t,releaseId:n.id},!1);return}S({bundleId:e.id})},w=t.afterReleaseId!==void 0||t.beforeReleaseId!==void 0,ee=g?{...t,afterReleaseId:g,beforeReleaseId:void 0,releaseId:void 0}:null,T=h?{...t,afterReleaseId:void 0,beforeReleaseId:h,releaseId:void 0}:null,E={...t,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0};return(0,Z.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,Z.jsx)(zi,{channels:d,onChange:S,onClear:()=>x({}),onManageChannels:()=>o(!0),search:t}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-6 bg-muted/5 p-3 sm:p-6`,children:[u.isError?(0,Z.jsxs)(tt,{variant:`destructive`,children:[(0,Z.jsx)(We,{}),(0,Z.jsx)(Qe,{children:`Bundles could not be loaded`}),(0,Z.jsx)(Ke,{children:u.error.message})]}):(0,Z.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden rounded-lg border bg-card text-card-foreground shadow-sm [&_[data-slot=table-container]]:h-full [&_[data-slot=table-container]]:overflow-auto`,children:r?(0,Z.jsx)(`div`,{className:`h-full overflow-y-auto`,children:u.isPending?(0,Z.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:Array.from({length:5},(t,n)=>(0,Z.jsx)(e,{className:`h-44 w-full`},n))}):f.length?f.map(e=>{let n=b.get(e.channel_id)??e.channel_id,r=e.bundle_id?m[e.bundle_id]:0,i=s===e.id,a=`bundle-lineage-panel-${e.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(`article`,{"aria-label":`Bundle ${e.id}`,className:p(`flex cursor-pointer touch-manipulation flex-col gap-4 border-b p-4 transition-[background-color,filter] last:border-b-0 hover:bg-muted/10 active:bg-muted/20 motion-reduce:transition-none data-[state=selected]:bg-muted/15`,e.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,i&&`border-b-0 bg-primary/5`),"data-state":t.releaseId===e.id?`selected`:void 0,onClick:Ri(()=>x({...t,releaseId:e.id},!1)),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(Bi,{expanded:i,onOpen:()=>x({...t,releaseId:e.id},!1),onToggleExpand:()=>l(i?void 0:e.id),release:e}),(0,Z.jsx)(Tn,{channel:n,className:`shrink-0`})]}),(0,Z.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 text-xs`,children:[(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Platform`}),(0,Z.jsxs)(`dd`,{className:`mt-1 flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(ut,{className:`size-4`,platform:e.platform}),e.platform===`ios`?`iOS`:`Android`]})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created`}),(0,Z.jsx)(`dd`,{className:`mt-1 tabular-nums`,children:Ii.format(e.created_at_ms)})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Rollout`}),(0,Z.jsx)(`dd`,{className:`mt-1`,children:(0,Z.jsx)(Mi,{percentage:e.rollout_cohort_count/10})})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Patches`}),(0,Z.jsx)(`dd`,{className:`mt-1`,children:r===void 0?`Checking`:r>0?`${r} ${r===1?`patch`:`patches`}`:`—`})]}),v.map(({Cell:t,feature:n,label:r})=>(0,Z.jsxs)(`div`,{className:`col-span-2 rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`mb-2 text-muted-foreground`,children:r}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(t,{releaseId:e.id,releases:_})})]},n)),(0,Z.jsxs)(`div`,{className:`col-span-2 flex flex-wrap items-center gap-2 rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(ji,{release:e}),e.should_force_update?(0,Z.jsx)(K,{variant:`secondary`,children:`Force update`}):null]}),(0,Z.jsxs)(`div`,{className:`col-span-2 grid grid-cols-1 gap-2 rounded-md border bg-background/80 p-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Target`}),(0,Z.jsx)(`dd`,{className:`min-w-0 truncate text-right font-mono`,children:e.target_app_version??e.fingerprint_hash??`—`})]}),(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Message`}),(0,Z.jsx)(`dd`,{className:`min-w-0 text-right text-foreground`,children:e.message||`—`})]})]})]})]}),i&&e.bundle_id?(0,Z.jsx)(Vi,{onDetailClick:C,panelId:a,release:e}):null]},e.id)}):(0,Z.jsx)(`p`,{className:`p-8 text-center text-sm text-muted-foreground`,children:w?`No more bundles on this side.`:G(t)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,Z.jsxs)(sn,{className:`min-w-max`,children:[(0,Z.jsx)(rn,{className:`bg-muted/40`,children:(0,Z.jsxs)(on,{className:`border-b border-border/60 hover:bg-transparent [&>th]:h-10 [&>th]:text-xs [&>th]:font-semibold [&>th]:uppercase [&>th]:text-muted-foreground/70`,children:[(0,Z.jsx)(J,{children:`ID`}),(0,Z.jsx)(J,{children:`Channel`}),(0,Z.jsx)(J,{children:`Platform`}),(0,Z.jsx)(J,{children:`Patches`}),(0,Z.jsx)(J,{children:`Target`}),(0,Z.jsx)(J,{children:`Enabled`}),(0,Z.jsx)(J,{children:`Force update`}),(0,Z.jsx)(J,{children:`Rollout`}),v.map(({feature:e,label:t})=>(0,Z.jsx)(J,{children:t},e)),(0,Z.jsx)(J,{children:`Message`}),(0,Z.jsx)(J,{children:`Created`})]})}),(0,Z.jsxs)(an,{children:[u.isPending?Array.from({length:7},(t,n)=>(0,Z.jsx)(on,{children:(0,Z.jsx)(Y,{colSpan:y,children:(0,Z.jsx)(e,{className:`h-8 w-full`})})},n)):f.map(e=>{let n=s===e.id,r=`bundle-lineage-panel-${e.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(on,{"aria-label":`Open bundle ${e.id}`,className:p(`cursor-pointer transition-[background-color,filter] hover:bg-muted/10 focus-within:bg-muted/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring motion-reduce:transition-none data-[state=selected]:bg-muted/15 [&>td]:py-3`,e.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,n&&`bg-primary/5`),"data-state":t.releaseId===e.id?`selected`:void 0,onClick:Ri(()=>x({...t,releaseId:e.id},!1)),onKeyDown:n=>{n.target!==n.currentTarget||n.key!==`Enter`&&n.key!==` `||(n.preventDefault(),x({...t,releaseId:e.id},!1))},tabIndex:0,children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(Bi,{expanded:n,onOpen:()=>x({...t,releaseId:e.id},!1),onToggleExpand:()=>l(n?void 0:e.id),release:e})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Tn,{channel:b.get(e.channel_id)??e.channel_id})}),(0,Z.jsx)(Y,{className:`whitespace-nowrap`,children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(ut,{className:`size-4`,platform:e.platform}),e.platform===`ios`?`iOS`:`Android`]})}),(0,Z.jsx)(Y,{children:e.bundle_id&&m[e.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):e.bundle_id&&m[e.bundle_id]>0?(0,Z.jsxs)(K,{variant:`secondary`,children:[m[e.bundle_id],` `,m[e.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:e.target_app_version?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(W,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`font-medium`,children:e.target_app_version})]}):e.fingerprint_hash?(0,Z.jsxs)(`span`,{className:`flex min-w-[160px] items-center gap-2`,children:[(0,Z.jsx)(mn,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(Ct,{maxLength:12,value:e.fingerprint_hash})]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(En,{enabled:e.enabled}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.enabled?`Enabled`:`Disabled`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(En,{enabled:e.should_force_update,falseIcon:`minus`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.should_force_update?`Required`:`Optional`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Mi,{percentage:e.rollout_cohort_count/10})}),v.map(({Cell:t,feature:n})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(t,{releaseId:e.id,releases:_})},n)),(0,Z.jsx)(Y,{className:`text-sm text-muted-foreground`,title:e.message??void 0,children:e.message||`-`}),(0,Z.jsx)(Y,{className:`whitespace-nowrap text-xs text-muted-foreground`,title:Ii.format(e.created_at_ms),children:Li.format(e.created_at_ms)})]}),n&&e.bundle_id?(0,Z.jsx)(on,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:y,children:(0,Z.jsx)(Vi,{onDetailClick:C,panelId:r,release:e})})}):null]},e.id)}),!u.isPending&&f.length===0?(0,Z.jsx)(on,{children:(0,Z.jsx)(Y,{className:`h-40 text-center text-muted-foreground`,colSpan:y,children:w?`No more bundles on this side.`:G(t)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):null]})]})}),!u.isError&&!u.isPending?(0,Z.jsxs)(`nav`,{"aria-label":`Bundle pagination`,className:`flex flex-col gap-3 px-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Z.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:[(0,Z.jsx)(`span`,{className:`text-foreground`,children:f.length}),` `,f.length===1?`entry`:`entries`,`, newest first`]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 sm:justify-end`,children:[w?(0,Z.jsx)(F,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`ghost`}),search:E,to:`/`,children:`Newest`}):null,ee?(0,Z.jsxs)(F,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:ee,to:`/`,children:[(0,Z.jsx)(dn,{"data-icon":`inline-start`}),`Previous`]}):(0,Z.jsxs)(i,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[(0,Z.jsx)(dn,{"data-icon":`inline-start`}),`Previous`]}),T?(0,Z.jsxs)(F,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:T,to:`/`,children:[`Next`,(0,Z.jsx)(at,{"data-icon":`inline-end`})]}):(0,Z.jsxs)(i,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[`Next`,(0,Z.jsx)(at,{"data-icon":`inline-end`})]})]})]}):null]}),(0,Z.jsx)(Ai,{channels:d,onOpenChange:e=>!e&&x({...t,releaseId:void 0},!1),onShowScope:e=>S({scopeKey:e}),open:!!t.releaseId,releaseId:t.releaseId??``}),(0,Z.jsx)(jn,{onOpenChange:o,open:a})]})}export{Hi as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ar as e}from"./sidebar-CQ6iq0qe.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$n as e,A as t,At as n,Bn as r,Bt as i,C as a,Cn as o,Ct as s,Dn as c,Dt as l,En as u,Et as d,Ft as f,Gn as p,Gt as m,Hn as h,Ht as g,It as _,Jn as v,Jt as y,Kt as b,L as x,Ln as S,Lt as C,Mn as w,Mt as T,Nn as E,Nt as ee,O as D,On as O,Ot as k,Pn as A,Pt as j,Qn as M,Rt as te,Sn as ne,St as N,Tn as P,Tt as F,Un as I,Ur as re,Ut as L,Vn as ie,Vt as R,Wn as z,Wt as B,Xn as V,Yn as H,Yt as ae,Zn as U,Zt as W,_n as oe,ar as G,at as K,bn as q,bt as se,cn as ce,ct as J,dt as le,ei as ue,er as de,fn as fe,ft as pe,gn as me,gt as he,hn as ge,ht as _e,jt as ve,kt as ye,lt as be,mt as xe,ot as Se,pt as Ce,qt as we,ri as Te,rn as Ee,st as De,tr as Oe,un as ke,ut as Ae,vt as Y,w as je,wn as Me,wt as Ne,xn as Pe,xt as X,yn as Fe,yt as Ie,zt as Le}from"./sidebar-CQ6iq0qe.js";import{i as Re,n as ze,o as Be,r as Ve,t as He}from"./useCompositeListItem-VmWjhZ9j.js";import{x as Ue}from"./field-DNqNwq7i.js";var We=G(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Z=Te(ue()),Ge=`Escape`;function Ke(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function qe(e,t){return Ke(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Je(e,t,n){return Ke(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Ye(e,t,n){return Ke(t,n?e===o:e===Me,e===ne)}function Xe(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===Ge:Ke(t,n?e===Me:e===o,e===P)}function Ze(e,t){let{listRef:n,activeIndex:r,onNavigate:a=()=>{},enabled:o=!0,selectedIndex:s=null,allowEscape:d=!1,loopFocus:p=!1,nested:h=!1,rtl:g=!1,virtual:v=!1,focusItemOnOpen:y=`auto`,focusItemOnHover:x=!0,openOnArrowKeyDown:S=!0,disabledIndices:w=void 0,orientation:E=`vertical`,parentOrientation:D,cols:A=1,id:M,resetOnPointerLeave:ne=!0,externalTree:N}=t,P=`rootStore`in e?e.rootStore:e,F=P.useState(`open`),I=P.useState(`floatingElement`),re=P.useState(`domReferenceElement`),L=P.context.dataRef,ie=me(I),z=oe(re),B=we(ie),H=l(),W=k(N),G=Z.useRef(y),K=Z.useRef(s??-1),se=Z.useRef(null),ce=Z.useRef(!0),J=U(e=>{a(K.current===-1?null:K.current,e)}),le=Z.useRef(J),ue=Z.useRef(!!I),de=Z.useRef(F),fe=Z.useRef(!1),pe=Z.useRef(!1),he=Z.useRef(null),ge=we(w),_e=we(F),ye=we(s),be=we(ne),xe=b(),Se=b(),Ce=U(()=>{function e(e){v?W?.events.emit(`virtualfocus`,e):he.current=ve(e,{sync:fe.current,preventScroll:!0})}let t=n.current[K.current],r=pe.current;t&&e(t),(fe.current?e=>e():e=>xe.request(e))(()=>{let i=n.current[K.current]||t;i&&(t||e(i),Me&&(r||!ce.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});V(()=>{L.current.orientation=E},[L,E]),V(()=>{o&&(F&&I?(K.current=s??-1,G.current&&s!=null&&(pe.current=!0,J())):ue.current&&(K.current=-1,le.current()))},[o,F,I,s,J]),V(()=>{if(o){if(!F){fe.current=!1;return}if(I)if(r==null){if(fe.current=!1,ye.current!=null)return;if(ue.current&&(K.current=-1,Ce()),(!de.current||!ue.current)&&G.current&&(se.current!=null||G.current===!0&&se.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>Se.request(e):queueMicrotask)(t),e+=1):(K.current=se.current==null||Je(se.current,E,g)||h?te(n):C(n),se.current=null,J())};t()}}else i(n.current,r)||(K.current=r,Ce(),pe.current=!1)}},[o,F,I,r,ye,h,n,E,g,J,Ce,Se]),V(()=>{if(!o||I||!W||v||!ue.current)return;let e=W.nodesRef.current,t=e.find(e=>e.id===H)?.context?.elements.floating,n=Fe(m(I)),r=e.some(e=>e.context&&q(e.context.elements.floating,n));t&&!r&&ce.current&&t.focus({preventScroll:!0})},[o,I,W,H,v]),V(()=>{le.current=J,de.current=F,ue.current=!!I}),V(()=>{F||(se.current=null,G.current=y)},[F,y]);let Te=r!=null,De=U(e=>{if(!_e.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(K.current!==t||r!==t)&&(K.current=t,J(e))}),Ae=U(()=>D??W?.nodesRef.current.find(e=>e.id===H)?.context?.dataRef?.current.orientation),Y=U(()=>te(n,ge.current)),je=U(e=>{if(ce.current=!1,fe.current=!0,e.which===229||!_e.current&&e.currentTarget===B.current)return;if(h&&Xe(e.key,E,g,A)){qe(e.key,Ae())||O(e),P.setOpen(!1,ae(ke,e.nativeEvent)),Oe(re)&&(v?W?.events.emit(`virtualfocus`,re):re.focus());return}let t=K.current,r=te(n,w),a=C(n,w);if(z||(e.key===`Home`&&(O(e),K.current=r,J(e)),e.key===`End`&&(O(e),K.current=a,J(e))),A>1){let t=Array.from({length:n.current.length},()=>({width:1,height:1})),i=T(t,A,!1),o=i.findIndex(e=>e!=null&&!R(n.current,e,w)),s=i.reduce((e,t,r)=>t!=null&&!R(n.current,t,w)?r:e,-1),c=i[_(i.map(e=>e==null?null:n.current[e]),{event:e,orientation:E,loopFocus:p,rtl:g,cols:A,disabledIndices:f([...(typeof w==`function`?null:w)||n.current.map((e,t)=>R(n.current,t,w)?t:void 0),void 0],i),minIndex:o,maxIndex:s,prevIndex:j(K.current>a?r:K.current,t,i,A,e.key===`ArrowDown`?`bl`:e.key===(g?`ArrowLeft`:`ArrowRight`)?`tr`:`tl`),stopEvent:!0})];if(c!=null&&(K.current=c,J(e)),E===`both`)return}if(qe(e.key,E)){if(O(e),F&&!v&&Fe(e.currentTarget.ownerDocument)===e.currentTarget){K.current=Je(e.key,E,g)?r:a,J(e);return}Je(e.key,E,g)?p?t>=a?d&&t!==n.current.length?K.current=-1:(fe.current=!1,K.current=r):K.current=ee(n.current,{startingIndex:t,disabledIndices:w}):K.current=Math.min(a,ee(n.current,{startingIndex:t,disabledIndices:w})):p?t<=r?d&&t!==-1?K.current=n.current.length:(fe.current=!1,K.current=a):K.current=ee(n.current,{startingIndex:t,decrement:!0,disabledIndices:w}):K.current=Math.max(r,ee(n.current,{startingIndex:t,decrement:!0,disabledIndices:w})),i(n.current,K.current)&&(K.current=-1),J(e)}}),Me=Z.useMemo(()=>({onFocus(e){fe.current=!0,De(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){fe.current=!0,pe.current=!1,x&&De(e)},onPointerLeave(e){if(!_e.current||!ce.current||e.pointerType===`touch`)return;fe.current=!0;let t=e.relatedTarget;if(!(!x||n.current.includes(t))&&be.current&&(he.current?.(),he.current=null,K.current=-1,J(e),!v)){let e=B.current,t=Fe(m(e));e&&q(e,t)&&e.focus({preventScroll:!0})}}}),[De,_e,B,x,n,J,be,v]),Ne=Z.useMemo(()=>v&&F&&Te&&{"aria-activedescendant":`${M}-${r}`},[v,F,Te,M,r]),X=Z.useMemo(()=>({"aria-orientation":E===`both`?void 0:E,...z?{}:Ne,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&F&&!v){let t=Pe(e.nativeEvent);if(t&&!q(B.current,t))return;O(e),P.setOpen(!1,ae(Ee,e.nativeEvent)),Oe(re)&&re.focus();return}je(e)},onPointerMove(){ce.current=!0}}),[Ne,je,B,E,z,P,F,v,re]),Ie=Z.useMemo(()=>{function e(e){P.setOpen(!0,ae(ke,e.nativeEvent,e.currentTarget))}function t(e){y===`auto`&&u(e.nativeEvent)&&(G.current=!v)}function n(e){G.current=y,y===`auto`&&c(e.nativeEvent)&&(G.current=!0)}return{onKeyDown(t){let n=P.select(`open`);ce.current=!1;let r=t.key.startsWith(`Arrow`),i=Ye(t.key,Ae(),g),a=qe(t.key,E),o=(h?i:a)||t.key===`Enter`||t.key.trim()===``;if(v&&n)return je(t);if(!(!n&&!S&&r)){if(o){let e=qe(t.key,Ae());se.current=h&&e?null:t.key}if(h){i&&(O(t),n?(K.current=Y(),J(t)):e(t));return}a&&(ye.current!=null&&(K.current=ye.current),O(t),!n&&S?e(t):je(t),n&&J(t))}},onFocus(e){P.select(`open`)&&!v&&(K.current=-1,J(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[je,y,Y,h,J,P,S,E,Ae,g,ye,v]),Le=Z.useMemo(()=>({...Ne,...Ie}),[Ne,Ie]);return Z.useMemo(()=>o?{reference:Le,floating:X,item:Me,trigger:Ie}:{},[o,Le,X,Ie,Me])}function Qe(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,onTyping:o,enabled:s=!0,resetMs:c=750,selectedIndex:l=null}=t,u=`rootStore`in e?e.rootStore:e,d=u.useState(`open`),f=E(),p=Z.useRef(``),m=Z.useRef(l??i??-1),h=Z.useRef(null),g=U(e=>{function t(e){let t=r?.current[e];return!t||Le(t)}function s(e,n,r=0){if(e.length===0)return-1;let i=(r%e.length+e.length)%e.length,a=n.toLocaleLowerCase();for(let n=0;n<e.length;n+=1){let r=(i+n)%e.length;if(!(!e[r]?.toLocaleLowerCase().startsWith(a)||!t(r)))return r}return-1}let u=n.current;if(p.current.length>0&&e.key===` `&&(O(e),o?.(!0)),p.current.length>0&&p.current[0]!==` `&&s(u,p.current)===-1&&e.key!==` `&&o?.(!1),u==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;d&&e.key!==` `&&(O(e),o?.(!0));let g=p.current===``;g&&(m.current=l??i??-1),u.every(e=>e?e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase():!0)&&p.current===e.key&&(p.current=``,m.current=h.current),p.current+=e.key,f.start(c,()=>{p.current=``,m.current=h.current,o?.(!1)});let _=((g?l??i??-1:m.current)??0)+1,v=s(u,p.current,_);v===-1?e.key!==` `&&(p.current=``,o?.(!1)):(a?.(v),h.current=v)}),_=U(e=>{let t=e.relatedTarget,n=u.select(`domReferenceElement`),r=u.select(`floatingElement`);q(n,t)||q(r,t)||(f.clear(),p.current=``,m.current=h.current,o?.(!1))});V(()=>{!d&&l!==null||(f.clear(),h.current=null,p.current!==``&&(p.current=``))},[d,l,f]),V(()=>{d&&p.current===``&&(m.current=l??i??-1)},[d,l,i]);let v=Z.useMemo(()=>({onKeyDown:g,onBlur:_}),[g,_]);return Z.useMemo(()=>s?{reference:v,floating:v}:{},[s,v])}var Q=re();function $e(e){let[t,n]=Z.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}var et=Z.createContext(void 0),tt={disableStyleElements:!1};function nt(){return Z.useContext(et)??tt}function rt({className:e}){return(0,Q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,className:e,fill:`currentColor`,children:(0,Q.jsx)(`path`,{d:`M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701`})})}function it({className:e}){return(0,Q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,className:e,fill:`currentColor`,children:(0,Q.jsx)(`path`,{d:`M18.4395 5.5586c-.675 1.1664-1.352 2.3318-2.0274 3.498-.0366-.0155-.0742-.0286-.1113-.043-1.8249-.6957-3.484-.8-4.42-.787-1.8551.0185-3.3544.4643-4.2597.8203-.084-.1494-1.7526-3.021-2.0215-3.4864a1.1451 1.1451 0 0 0-.1406-.1914c-.3312-.364-.9054-.4859-1.379-.203-.475.282-.7136.9361-.3886 1.5019 1.9466 3.3696-.0966-.2158 1.9473 3.3593.0172.031-.4946.2642-1.3926 1.0177C2.8987 12.176.452 14.772 0 18.9902h24c-.119-1.1108-.3686-2.099-.7461-3.0683-.7438-1.9118-1.8435-3.2928-2.7402-4.1836a12.1048 12.1048 0 0 0-2.1309-1.6875c.6594-1.122 1.312-2.2559 1.9649-3.3848.2077-.3615.1886-.7956-.0079-1.1191a1.1001 1.1001 0 0 0-.8515-.5332c-.5225-.0536-.9392.3128-1.0488.5449zm-.0391 8.461c.3944.5926.324 1.3306-.1563 1.6503-.4799.3197-1.188.0985-1.582-.4941-.3944-.5927-.324-1.3307.1563-1.6504.4727-.315 1.1812-.1086 1.582.4941zM7.207 13.5273c.4803.3197.5506 1.0577.1563 1.6504-.394.5926-1.1038.8138-1.584.4941-.48-.3197-.5503-1.0577-.1563-1.6504.4008-.6021 1.1087-.8106 1.584-.4941z`})})}function at({platform:e,className:t}){return e===`ios`?(0,Q.jsx)(rt,{className:t}):(0,Q.jsx)(it,{className:t})}var ot=Z.createContext(null),st=Z.createContext(null);function ct(){let e=Z.useContext(ot);if(e===null)throw Error(v(60));return e}function lt(){let e=Z.useContext(st);if(e===null)throw Error(v(61));return e}var ut=function(e){return e.disabled=`data-disabled`,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}({}),dt={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},ft={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},pt={disabled:!1,...ft},mt={valid(e){return e===null?null:e?{[ut.valid]:``}:{[ut.invalid]:``}}},ht={invalid:void 0,name:void 0,validityData:{state:dt,errors:[],error:``,value:``,initialValue:null},setValidityData:I,disabled:void 0,touched:ft.touched,setTouched:I,dirty:ft.dirty,setDirty:I,filled:ft.filled,setFilled:I,focused:ft.focused,setFocused:I,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:pt,markedDirtyRef:{current:!1},registerFieldControl:I,validation:{getValidationProps:(e=h)=>e,getInputValidationProps:(e=h)=>e,inputRef:{current:null},commit:async()=>{}}},gt=Z.createContext(ht);function _t(e=!0){let t=Z.useContext(gt);if(t.setValidityData===I&&!e)throw Error(v(28));return t}function vt(e,t,n,r,i=!0){let{registerFieldControl:a}=_t(),o=Z.useRef(null);o.current||=Symbol(),V(()=>{let s=o.current;if(!(!s||!i))return a(s,{controlRef:e,getValue:r,id:t,value:n}),()=>{a(s,void 0)}},[e,i,r,t,a,n])}var yt=Z.createContext({controlId:void 0,registerControlId:I,labelId:void 0,setLabelId:I,messageIds:[],setMessageIds:I,getDescriptionProps:e=>e});function bt(){return Z.useContext(yt)}function xt(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=bt(),o=Ae(t),s=n?i:void 0,c=M(()=>Symbol(`labelable-control`)),l=Z.useRef(!1),u=Z.useRef(t!=null),d=U(()=>{!l.current||a===I||(l.current=!1,a(c.current,void 0))});return V(()=>{if(a===I)return;let e;if(n){let n=r?.current;e=de(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),Z.useEffect(()=>d,[d]),i??o}var St=(e,t)=>Object.is(e,t);function Ct(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function wt(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:Ct(t,e,n))}function Tt(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:Ct(e,t,n))}function Et(e,t,n){return e.filter(e=>!Ct(t,e,n))}function Dt(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Ot(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function kt(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Ot(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function At(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return Dt(e)}function jt(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Dt(e.value):Dt(e)}function Mt(e,t,n){function r(){return At(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=t,i=Ot(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Nt(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,Q.jsx)(Z.Fragment,{children:Mt(r,t,n)},i)),e),[])}var $={id:N(e=>e.id),labelId:N(e=>e.labelId),modal:N(e=>e.modal),multiple:N(e=>e.multiple),items:N(e=>e.items),itemToStringLabel:N(e=>e.itemToStringLabel),itemToStringValue:N(e=>e.itemToStringValue),isItemEqualToValue:N(e=>e.isItemEqualToValue),value:N(e=>e.value),hasSelectedValue:N(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:jt(t,r)!==``}),hasNullItemLabel:N((e,t)=>t?kt(e.items):!1),open:N(e=>e.open),mounted:N(e=>e.mounted),forceMount:N(e=>e.forceMount),transitionStatus:N(e=>e.transitionStatus),openMethod:N(e=>e.openMethod),activeIndex:N(e=>e.activeIndex),selectedIndex:N(e=>e.selectedIndex),isActive:N((e,t)=>e.activeIndex===t),isSelected:N((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>Ct(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Ct(n,i,r)}),isSelectedByFocus:N((e,t)=>e.selectedIndex===t),popupProps:N(e=>e.popupProps),triggerProps:N(e=>e.triggerProps),triggerElement:N(e=>e.triggerElement),positionerElement:N(e=>e.positionerElement),listElement:N(e=>e.listElement),popupSide:N(e=>e.popupSide),scrollUpArrowVisible:N(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:N(e=>e.scrollDownArrowVisible),hasScrollArrows:N(e=>e.hasScrollArrows)},Pt=Z.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:I,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function Ft(){return Z.useContext(Pt)}function It(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Lt(e,t){return Math.max(0,e-t)}function Rt(e,t){if(t<=0)return 0;let n=It(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function zt(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:o,defaultOpen:s=!1,onOpenChange:c,name:l,form:u,autoComplete:d,disabled:f=!1,readOnly:p=!1,required:m=!1,modal:g=!0,actionsRef:_,inputRef:v,onOpenChangeComplete:y,items:b,multiple:x=!1,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w=St,highlightItemOnHover:T=!0,children:E}=e,{clearErrors:ee}=Ft(),{setDirty:D,setTouched:O,setFocused:k,shouldValidateOnChange:j,validityData:te,setFilled:ne,name:N,disabled:P,validation:I,validationMode:re}=_t(),R=xt({id:t}),W=P||f,oe=N??l,[G,K]=Re({controlled:n,default:x?r??ie:r,name:`Select`,state:`value`}),[q,ce]=Re({controlled:o,default:s,name:`Select`,state:`open`}),J=Z.useRef([]),le=Z.useRef([]),ue=Z.useRef(null),de=Z.useRef(null),pe=Z.useRef(0),me=Z.useRef(null),ge=Z.useRef([]),ve=Z.useRef(!1),ye=Z.useRef(!1),be=Z.useRef(null),Se=Z.useRef(null),Ce=Z.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Te=Z.useRef(!1),{mounted:Ee,setMounted:De,transitionStatus:Oe}=Ie(q),{openMethod:ke,triggerProps:Ae}=a(q),Y=M(()=>new se({id:R,labelId:void 0,modal:g,multiple:x,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w,value:G,open:q,mounted:Ee,transitionStatus:Oe,items:b,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Me=X(Y,$.activeIndex),Pe=X(Y,$.selectedIndex),Fe=X(Y,$.triggerElement),Le=X(Y,$.positionerElement),ze=$e(ke),Be=ke??ze,Ve=Z.useMemo(()=>x&&Array.isArray(G)&&G.length===0?``:jt(G,C),[x,G,C]),He=Z.useMemo(()=>x&&Array.isArray(G)?G.map(e=>jt(e,C)):jt(G,C),[x,G,C]);vt(we(Y.state.triggerElement),R,G,U(()=>He));let Ue=Z.useRef(G),We=x?Array.isArray(G)&&G.length>0:G!=null;V(()=>{G!==Ue.current&&Y.set(`forceMount`,!0)},[Y,G]),V(()=>{ne(We)},[We,ne]),V(function(){let e=ge.current,t;if(x){let n=Array.isArray(G)?G:[];if(n.length===0)t=null;else{let r=n[n.length-1],i=Tt(e,r,w);t=i===-1?null:i}}else{let n=Tt(e,G,w);t=n===-1?null:n}t===null&&(Se.current=null),!q&&Y.set(`selectedIndex`,t)},[We,x,q,G,ge,w,Y,Se]),je(G,()=>{ee(oe),D(G!==te.initialValue),j()?I.commit(G):I.commit(G,!0)});let Ge=U((e,t)=>{if(c?.(e,t),!t.isCanceled&&(ce(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(O(!0),k(!1),re===`onBlur`&&I.commit(G)),!e&&Y.state.activeIndex!==null)){let e=J.current[Y.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),Ke=U(()=>{De(!1),Y.update({activeIndex:null,openMethod:null}),y?.(!1)});he({enabled:!_,open:q,ref:ue,onComplete(){q||Ke()}}),Z.useImperativeHandle(_,()=>({unmount:Ke}),[Ke]);let qe=U((e,t)=>{i?.(e,t),!t.isCanceled&&K(e)}),Je=U(()=>{let e=Y.state.listElement||ue.current;if(!e)return;let t=Lt(e.scrollHeight,e.clientHeight),n=Rt(e.scrollTop,t),r=n>0,i=n<t;Y.state.scrollUpArrowVisible!==r&&Y.set(`scrollUpArrowVisible`,r),Y.state.scrollDownArrowVisible!==i&&Y.set(`scrollDownArrowVisible`,i)}),Ye=xe({open:q,onOpenChange:Ge,elements:{reference:Fe,floating:Le}}),Xe=F(Ye,{enabled:!p&&!W,event:`mousedown`}),et=Ne(Ye),tt=Ze(Ye,{enabled:!p&&!W,listRef:J,activeIndex:Me,selectedIndex:Pe,disabledIndices:ie,onNavigate(e){e===null&&!q||Y.set(`activeIndex`,e)},focusItemOnHover:T}),nt=Qe(Ye,{enabled:!p&&!W&&(q||!x),listRef:le,activeIndex:Me,selectedIndex:Pe,onMatch(e){q?Y.set(`activeIndex`,e):qe(ge.current[e],ae(`none`))},onTyping(e){ve.current=e}}),rt=Z.useMemo(()=>{let e=H(nt.reference,tt.reference,et.reference,Xe.reference,Ae);return R&&(e.id=R),e},[Xe.reference,nt.reference,tt.reference,et.reference,Ae,R]),it=Z.useMemo(()=>H(_e,nt.floating,tt.floating,et.floating),[nt.floating,tt.floating,et.floating]),at=tt.item??h;A(()=>{Y.update({popupProps:it,triggerProps:rt})}),V(()=>{Y.update({id:R,modal:g,multiple:x,value:G,open:q,mounted:Ee,transitionStatus:Oe,popupProps:it,triggerProps:rt,items:b,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w,openMethod:Be})},[Y,R,g,x,G,q,Ee,Oe,it,rt,b,S,C,w,Be]);let ct=Z.useMemo(()=>({store:Y,name:oe,required:m,disabled:W,readOnly:p,multiple:x,highlightItemOnHover:T,setValue:qe,setOpen:Ge,listRef:J,popupRef:ue,scrollHandlerRef:de,handleScrollArrowVisibility:Je,scrollArrowsMountedCountRef:pe,itemProps:at,events:Ye.context.events,valueRef:me,valuesRef:ge,labelsRef:le,typingRef:ve,selectionRef:Ce,firstItemTextRef:be,selectedItemTextRef:Se,validation:I,onOpenChangeComplete:y,keyboardActiveRef:ye,alignItemWithTriggerActiveRef:Te,initialValueRef:Ue}),[Y,oe,m,W,p,x,T,qe,Ge,at,Ye.context.events,I,y,Je]),lt=z(v,I.inputRef),ut=x&&Array.isArray(G)&&G.length>0,dt=x?void 0:oe,ft=Z.useMemo(()=>!x||!Array.isArray(G)||!oe?null:G.map(e=>{let t=jt(e,C);return(0,Q.jsx)(`input`,{type:`hidden`,form:u,name:oe,value:t},t)}),[x,G,u,oe,C]);return(0,Q.jsx)(ot.Provider,{value:ct,children:(0,Q.jsxs)(st.Provider,{value:Ye,children:[E,(0,Q.jsx)(`input`,{...I.getInputValidationProps({onFocus(){Y.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||W||p){e.preventBaseUIHandler?.();return}let t=e.currentTarget.value,n=ae(fe,e.nativeEvent);function r(){if(x)return;let e=ge.current.find(e=>jt(e,C).toLowerCase()===t.toLowerCase()||At(e,S).toLowerCase()===t.toLowerCase());e!=null&&(D(e!==te.initialValue),qe(e,n),j()&&I.commit(e))}Y.set(`forceMount`,!0),queueMicrotask(r)}}),id:R&&dt==null?`${R}-hidden-input`:void 0,form:u,name:dt,autoComplete:d,value:Ve,disabled:W,required:m&&!ut,readOnly:p,ref:lt,style:oe?B:L,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),ft]})})}function Bt(e){return e==null?void 0:`${e}-label`}function Vt(e,t){return e??t}function Ht(t){let n=t.getBoundingClientRect(),r=e(t),i=r.getComputedStyle(t,`::before`),a=r.getComputedStyle(t,`::after`);if(!(i.content!==`none`||a.content!==`none`))return n;let o=parseFloat(i.width)||0,s=parseFloat(i.height)||0,c=parseFloat(a.width)||0,l=parseFloat(a.height)||0,u=Math.max(n.width,o,c),d=Math.max(n.height,s,l),f=u-n.width,p=d-n.height;return{left:n.left-f/2,right:n.right+f/2,top:n.top-p/2,bottom:n.bottom+p/2}}var Ut=2,Wt=400,Gt={...pe,...mt,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},Kt=Z.forwardRef(function(e,t){let{render:n,className:i,id:a,disabled:o=!1,nativeButton:s=!0,style:c,...l}=e,{setTouched:u,setFocused:d,validationMode:f,state:h,disabled:g}=_t(),{labelId:_}=bt(),{store:v,setOpen:y,selectionRef:b,validation:x,readOnly:S,required:C,alignItemWithTriggerActiveRef:w,disabled:T,keyboardActiveRef:ee}=ct(),D=g||T||o,O=X(v,$.open),k=X(v,$.mounted),A=X(v,$.value),j=X(v,$.triggerProps),M=X(v,$.positionerElement),te=X(v,$.listElement),ne=X(v,$.popupSide),N=X(v,$.id),P=X(v,$.labelId),F=X(v,$.hasSelectedValue),I=k&&M?ne:null,re=a??N,L=Vt(_,P);xt({id:re});let ie=we(M),R=Z.useRef(null),{getButtonProps:B,buttonRef:V}=p({disabled:D,native:s}),oe=z(t,R,V,U(e=>{v.set(`triggerElement`,e)})),G=E(),K=E(),se=E();Z.useEffect(()=>{if(O)return se.start(Wt,()=>{b.current.allowUnselectedMouseUp=!0,b.current.allowSelectedMouseUp=!0}),()=>{se.clear()};b.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},K.clear()},[O,b,K,se]);let ce=H(j,{id:re,role:`combobox`,"aria-expanded":O?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":O?te?.id??me(M)?.id:void 0,"aria-labelledby":L,"aria-readonly":S||void 0,"aria-required":C||void 0,tabIndex:D?-1:0,ref:oe,onFocus(e){d(!0),O&&w.current&&y(!1,ae(fe,e.nativeEvent)),G.start(0,()=>{v.set(`forceMount`,!0)})},onBlur(e){q(M,e.relatedTarget)||(u(!0),d(!1),f===`onBlur`&&x.commit(A))},onPointerMove(){ee.current=!1},onKeyDown(){ee.current=!0},onMouseDown(e){if(O)return;let t=m(e.currentTarget);function n(e){if(!R.current)return;let t=e.target;if(q(R.current,t)||q(ie.current,t)||t===R.current)return;let n=Ht(R.current);e.clientX>=n.left-Ut&&e.clientX<=n.right+Ut&&e.clientY>=n.top-Ut&&e.clientY<=n.bottom+Ut||y(!1,ae(W,e))}K.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},x.getValidationProps,l,B);ce.role=`combobox`;let J={...h,open:O,disabled:D,value:A,readOnly:S,popupSide:I,placeholder:!F};return r(`button`,e,{ref:[t,R],state:J,stateAttributesMapping:Gt,props:ce})}),qt={value:()=>null},Jt=Z.forwardRef(function(e,t){let{className:n,render:i,children:a,placeholder:o,style:s,...c}=e,{store:l,valueRef:u}=ct(),d=X(l,$.value),f=X(l,$.items),p=X(l,$.itemToStringLabel),m=X(l,$.hasSelectedValue),h=!m&&o!=null&&a==null,g=X(l,$.hasNullItemLabel,h),_={value:d,placeholder:!m},v=null;return v=typeof a==`function`?a(d):a??(!m&&o!=null&&!g?o:Array.isArray(d)?Nt(d,f,p):Mt(d,f,p)),r(`span`,e,{state:_,ref:[t,u],props:[{children:v},c],stateAttributesMapping:qt})}),Yt=Z.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,{store:s}=ct();return r(`span`,e,{state:{open:X(s,$.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},o],stateAttributesMapping:Ce})}),Xt=Z.createContext(void 0),Zt=Z.forwardRef(function(e,t){let{store:n}=ct(),r=X(n,$.mounted),i=X(n,$.forceMount);return r||i?(0,Q.jsx)(Xt.Provider,{value:!0,children:(0,Q.jsx)(ye,{ref:t,...e})}):null}),Qt=Z.createContext(void 0);function $t(){let e=Z.useContext(Qt);if(!e)throw Error(v(59));return e}function en(e,t){e&&Object.assign(e.style,t)}var tn={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},nn=20;function rn(e,t,n,r){let[i,a]=Z.useState(!1);V(()=>{if(!e||!t||n==null){a(!1);return}let r=m(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-nn)},[e,t,n]),D(e&&(!t||i),r)}var an={position:`fixed`},on=Z.forwardRef(function(e,r){let{anchor:i,positionMethod:a=`absolute`,className:o,render:s,side:c=`bottom`,align:l=`center`,sideOffset:u=0,alignOffset:d=0,collisionBoundary:f=`clipping-ancestors`,collisionPadding:p,arrowPadding:m=5,sticky:h=!1,disableAnchorTracking:g,alignItemWithTrigger:_=!0,collisionAvoidance:v=n,style:y,...b}=e,{store:x,listRef:S,labelsRef:C,alignItemWithTriggerActiveRef:w,selectedItemTextRef:T,valuesRef:E,initialValueRef:ee,popupRef:D,setValue:O}=ct(),k=lt(),A=X(x,$.open),j=X(x,$.mounted),M=X(x,$.modal),te=X(x,$.value),ne=X(x,$.openMethod),N=X(x,$.positionerElement),P=X(x,$.triggerElement),F=X(x,$.isItemEqualToValue),I=X(x,$.transitionStatus),re=Z.useRef(null),L=Z.useRef(null),[ie,R]=Z.useState(_),z=j&&ie&&ne!==`touch`;!j&&ie!==_&&R(_),V(()=>{j||($.scrollUpArrowVisible(x.state)&&x.set(`scrollUpArrowVisible`,!1),$.scrollDownArrowVisible(x.state)&&x.set(`scrollDownArrowVisible`,!1))},[x,j]),Z.useImperativeHandle(w,()=>z),rn((z||M)&&A,ne===`touch`,N,P);let B=J({anchor:i,floatingRootContext:k,positionMethod:a,mounted:j,side:c,sideOffset:u,align:l,alignOffset:d,arrowPadding:m,collisionBoundary:f,collisionPadding:p,sticky:h,disableAnchorTracking:g??z,collisionAvoidance:v,keepMounted:!0}),H=z?`none`:B.side,W=z?an:B.positionerStyles,oe={open:A,side:H,align:B.align,anchorHidden:B.anchorHidden};V(()=>{x.set(`popupSide`,B.side)},[x,B.side]);let G=Se(e,oe,{styles:W,transitionStatus:I,props:b,refs:[r,U(e=>{x.set(`positionerElement`,e)})],hidden:!j,inert:!A}),q=Z.useRef(0),se=U(e=>{if(e.size===0&&q.current===0||E.current.length===0)return;let t=q.current;if(q.current=e.size,e.size===t)return;let n=ae(fe);if(t!==0&&!x.state.multiple&&te!==null&&Tt(E.current,te,F)===-1){let e=ee.current,t=e!=null&&Tt(E.current,e,F)!==-1?e:null;O(t,n),t===null&&(x.set(`selectedIndex`,null),T.current=null)}if(t!==0&&x.state.multiple&&Array.isArray(te)){let e=e=>Tt(E.current,e,F)!==-1,t=te.filter(t=>e(t));(t.length!==te.length||t.some(e=>!wt(te,e,F)))&&(O(t,n),t.length===0&&(x.set(`selectedIndex`,null),T.current=null))}if(A&&z){x.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};en(N,e),en(D.current,e)}}),ce=Z.useMemo(()=>({...B,side:H,alignItemWithTriggerActive:z,setControlledAlignItemWithTrigger:R,scrollUpArrowRef:re,scrollDownArrowRef:L}),[B,H,z,R]);return(0,Q.jsx)(Ve,{elementsRef:S,labelsRef:C,onMapChange:se,children:(0,Q.jsxs)(Qt.Provider,{value:ce,children:[j&&M&&(0,Q.jsx)(t,{inert:K(!A),cutout:P}),G]})})}),sn=`base-ui-disable-scrollbar`,cn={className:sn,getElement(e){return(0,Q.jsx)(`style`,{nonce:e,href:sn,precedence:`base-ui:low`,children:`.${sn}{scrollbar-width:none}.${sn}::-webkit-scrollbar{display:none}`})}},ln=Z.createContext(void 0);function un(e){let t=Z.useContext(ln);if(t===void 0&&!e)throw Error(v(69));return t}var dn={...le,...Y},fn=Z.forwardRef(function(t,n){let{render:i,className:a,style:o,finalFocus:s,...c}=t,{store:l,popupRef:u,onOpenChangeComplete:f,setOpen:p,valueRef:h,firstItemTextRef:g,selectedItemTextRef:_,keyboardActiveRef:v,multiple:S,handleScrollArrowVisibility:C,scrollHandlerRef:T,listRef:E,highlightItemOnHover:ee}=ct(),{side:D,align:O,alignItemWithTriggerActive:k,isPositioned:A,setControlledAlignItemWithTrigger:j,scrollDownArrowRef:M,scrollUpArrowRef:te}=$t(),ne=un(!0)!=null,N=lt(),P=be(),{nonce:F,disableStyleElements:I}=nt(),re=X(l,$.id),L=X(l,$.open),ie=X(l,$.mounted),R=X(l,$.popupProps),z=X(l,$.transitionStatus),B=X(l,$.triggerElement),H=X(l,$.positionerElement),W=X(l,$.listElement),oe=Z.useRef(!1),G=Z.useRef(!1),K=Z.useRef({}),q=b(),se=U(e=>{if(!H||!u.current||!G.current)return;if(oe.current||!k){C();return}let t=H.style.top===`0px`,n=H.style.bottom===`0px`;if(!t&&!n){C();return}let r=hn(H),i=gn(H.getBoundingClientRect().height,`y`,r),a=m(H),o=getComputedStyle(H),s=parseFloat(o.marginTop),c=parseFloat(o.marginBottom),l=pn(getComputedStyle(u.current)),d=Math.min(a.documentElement.clientHeight-s-c,l),f=e.scrollTop,p=mn(e),h=0,g=null,_=!1,v=!1,y=e=>{H.style.height=`${e}px`},b=(t,n)=>{let r=It(t,0,d-i);r>0&&y(i+r),e.scrollTop=n,d-(i+r)<=1&&(oe.current=!0),C()},x=t?p-f:f,S=Math.min(i+x,d);if(h=S,x<=1){b(x,t?p:0);return}if(d-S>1?t?v=!0:g=0:(_=!0,n&&f<p&&(g=f-(x-(i+x-d)))),h=Math.ceil(h),h!==0&&y(h),v||g!=null){let t=mn(e),n=v?t:It(g,0,t);Math.abs(e.scrollTop-n)>1&&(e.scrollTop=n)}(_||h>=d-1)&&(oe.current=!0),C()});Z.useImperativeHandle(T,()=>se,[se]),he({open:L,ref:u,onComplete(){L&&f?.(!0)}});let ce={open:L,transitionStatus:z,side:D,align:O};V(()=>{!H||!u.current||Object.keys(K.current).length||(K.current={top:H.style.top||`0`,left:H.style.left||`0`,right:H.style.right,height:H.style.height,bottom:H.style.bottom,minHeight:H.style.minHeight,maxHeight:H.style.maxHeight,marginTop:H.style.marginTop,marginBottom:H.style.marginBottom})},[u,H]),V(()=>{L||k||(G.current=!1,oe.current=!1,en(H,K.current))},[L,k,H,u]),V(()=>{let t=u.current;if(!L||!B||!H||!t||k&&!A||l.state.transitionStatus===`ending`)return;if(!k){G.current=!0,q.request(C),t.style.removeProperty(`--transform-origin`);return}let n=yn(t);t.style.removeProperty(`--transform-origin`);try{let n=_.current;n?.isConnected||(n=!$.hasSelectedValue(l.state)&&g.current?.isConnected?g.current:null);let r=h.current,i=getComputedStyle(H),a=getComputedStyle(t),o=m(B),s=e(H),c=hn(B),u=_n(B.getBoundingClientRect(),c),d=_n(H.getBoundingClientRect(),c),f=u.height,p=W||t,v=p.scrollHeight,y=parseFloat(a.borderBottomWidth),b=parseFloat(i.marginTop)||10,x=parseFloat(i.marginBottom)||10,S=parseFloat(i.minHeight)||100,T=pn(a),D=o.documentElement.clientHeight-b-x,O=o.documentElement.clientWidth,k=D-u.bottom+f,A,M=P===`rtl`?u.right-d.width:u.left,te=0;if(n&&r){let e=_n(r.getBoundingClientRect(),c);A=_n(n.getBoundingClientRect(),c),M=d.left+(P===`rtl`?e.right-A.right:e.left-A.left);let t=e.top-u.top+e.height/2;te=A.top-d.top+A.height/2-t}let ne=k+te+x+y,N=Math.min(D,ne),F=D-b-x,I=ne-N,re=O-5;H.style.left=`${It(M,5,re-d.width)}px`,H.style.height=`${N}px`,H.style.maxHeight=`auto`,H.style.marginTop=`${b}px`,H.style.marginBottom=`${x}px`,t.style.height=`100%`;let L=mn(p),ie=I>=L-1;ie&&(N=Math.min(D,d.height)-(I-L));let R=u.top<20||u.bottom>D-20||Math.ceil(N)+1<Math.min(v,S),z=(s.visualViewport?.scale??1)!==1&&w;if(R||z){G.current=!0,en(H,K.current),j(!1);return}let V=Math.max(S,N);if(ie){let e=Math.max(0,D-ne);H.style.top=d.height>=F?`0`:`${e}px`,H.style.height=`${N}px`,p.scrollTop=mn(p)}else H.style.bottom=`0`,p.scrollTop=I;if(A){let e=d.top,n=d.height,r=A.top+A.height/2,i=It(n>0?(r-e)/n*100:50,0,100);t.style.setProperty(`--transform-origin`,`50% ${i}%`)}(V===D||N>=T)&&(oe.current=!0),C(),ee&&l.state.selectedIndex===null&&l.state.activeIndex===null&&E.current[0]!=null&&l.set(`activeIndex`,0),G.current=!0}finally{n()}},[l,L,H,B,h,g,_,u,C,k,j,q,M,te,W,E,ee,P,A]),Z.useEffect(()=>{if(!k||!H||!L)return;let t=e(H);function n(e){p(!1,ae(ge,e))}return y(t,`resize`,n)},[p,k,H,L]);let J={...W?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":S||void 0,id:`${re}-list`},onKeyDown(e){v.current=!0,ne&&x.has(e.key)&&e.stopPropagation()},onMouseMove(){v.current=!1},onScroll(e){W||se(e.currentTarget)},...k&&{style:W?{height:`100%`}:tn}},le=r(`div`,t,{ref:[n,u],state:ce,stateAttributesMapping:dn,props:[R,J,De(z),{className:!W&&k?cn.className:void 0},c]});return(0,Q.jsxs)(Z.Fragment,{children:[!I&&cn.getElement(F),(0,Q.jsx)(d,{context:N,modal:!1,disabled:!ie,returnFocus:s,restoreFocus:!0,children:le})]})});function pn(e){let t=e.maxHeight||``;return t.endsWith(`px`)&&parseFloat(t)||1/0}function mn(e){return Lt(e.scrollHeight,e.clientHeight)}function hn(e){return s.getScale(e)}function gn(e,t,n){return e/n[t]}function _n(e,t){return g({x:gn(e.x,`x`,t),y:gn(e.y,`y`,t),width:gn(e.width,`x`,t),height:gn(e.height,`y`,t)})}var vn=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function yn(e){let{style:t}=e,n={};for(let[e,r]of vn)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of vn){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var bn=Z.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,{store:s,scrollHandlerRef:c}=ct(),{alignItemWithTriggerActive:l}=$t(),u=X(s,$.hasScrollArrows),d=X(s,$.openMethod),f=X(s,$.multiple),p={id:`${X(s,$.id)}-list`,role:`listbox`,"aria-multiselectable":f||void 0,onScroll(e){c.current?.(e.currentTarget)},...l&&{style:tn},className:u&&d!==`touch`?cn.className:void 0};return r(`div`,e,{ref:[t,U(e=>{s.set(`listElement`,e)})],props:[p,o]})}),xn=Z.createContext(void 0);function Sn(){let e=Z.useContext(xn);if(!e)throw Error(v(57));return e}var Cn=Z.memo(Z.forwardRef(function(e,t){let{render:n,className:i,style:a,value:o=null,label:s,disabled:c=!1,nativeButton:l=!1,...d}=e,f=Z.useRef(null),m=ze({label:s,textRef:f,indexGuessBehavior:He.GuessFromOrder}),{store:h,itemProps:g,setOpen:_,setValue:v,selectionRef:y,typingRef:b,valuesRef:x,multiple:S,selectedItemTextRef:C}=ct(),w=X(h,$.isActive,m.index),T=X(h,$.isSelected,m.index,o),E=X(h,$.isSelectedByFocus,m.index),ee=X(h,$.isItemEqualToValue),D=m.index,O=D!==-1,k=Z.useRef(null);V(()=>{if(!O)return;let e=x.current;return e[D]=o,()=>{delete e[D]}},[O,D,o,x]),V(()=>{if(!O)return;let e=h.state.value,t=e;S&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&Ct(o,t,ee)&&(h.set(`selectedIndex`,D),f.current&&(C.current=f.current))},[O,D,S,ee,h,o,C]);let A=Z.useRef(null),j=Z.useRef(`mouse`),M=Z.useRef(!1),{getButtonProps:te,buttonRef:ne}=p({disabled:c,focusableWhenDisabled:!0,native:l,composite:!0}),N={disabled:c,selected:T,highlighted:w};function P(e){let t=h.state.value;if(S){let n=Array.isArray(t)?t:[];v(T?Et(n,o,ee):[...n,o],ae(ce,e))}else v(o,ae(ce,e)),_(!1,ae(ce,e))}function F(){y.current.dragY=0}let I={role:`option`,"aria-selected":T,tabIndex:w?0:-1,onKeyDown(e){A.current=e.key,h.set(`activeIndex`,D),e.key===` `&&b.current&&e.preventDefault()},onClick(e){let t=e.type===`click`&&j.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&u(e.nativeEvent)&&(n!==void 0||w),i=t&&!r&&!M.current;M.current=!1,!(e.type===`keydown`&&A.current===null)&&(c||e.type===`keydown`&&A.current===` `&&b.current||i||(A.current=null,P(e.nativeEvent)))},onPointerEnter(e){j.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=y.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){j.current=e.pointerType,M.current=!0,F()},onMouseUp(){if(F(),c||j.current===`touch`||M.current)return;let e=!y.current.allowSelectedMouseUp&&T,t=!y.current.allowUnselectedMouseUp&&!T;e||t||(M.current=!0,k.current?.click(),M.current=!1)}},re=r(`div`,e,{ref:[ne,t,m.ref,k],state:N,props:[g,I,d,te]}),L=Z.useMemo(()=>({selected:T,index:D,textRef:f,selectedByFocus:E,hasRegistered:O}),[T,D,f,E,O]);return(0,Q.jsx)(xn.Provider,{value:L,children:re})})),wn=Z.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=Sn();return n||r?(0,Q.jsx)(Tn,{...e,ref:t}):null}),Tn=Z.memo(Z.forwardRef((e,t)=>{let{render:n,className:i,style:a,keepMounted:o,...s}=e,{selected:c}=Sn(),l=Z.useRef(null),{transitionStatus:u,setMounted:d}=Ie(c),f=r(`span`,e,{ref:[t,l],state:{selected:c,transitionStatus:u},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:Y});return he({open:c,ref:l,onComplete(){c||d(!1)}}),f})),En=Z.memo(Z.forwardRef(function(e,t){let{index:n,textRef:i,selectedByFocus:a,hasRegistered:o}=Sn(),{firstItemTextRef:s,selectedItemTextRef:c}=ct(),{render:l,className:u,style:d,...f}=e;return r(`div`,e,{ref:[Z.useCallback(e=>{e&&(o&&n===0&&(s.current=e),o&&a&&(c.current=e))},[s,c,n,a,o]),t,i],props:f})})),Dn=Z.forwardRef(function(e,t){let{render:n,className:i,style:a,direction:o,keepMounted:s=!1,...c}=e,l=o===`up`,{store:u,popupRef:d,listRef:f,handleScrollArrowVisibility:p,scrollArrowsMountedCountRef:m}=ct(),{side:h,scrollDownArrowRef:g,scrollUpArrowRef:_}=$t(),v=X(u,l?$.scrollUpArrowVisible:$.scrollDownArrowVisible),y=X(u,$.openMethod),b=v&&y!==`touch`,x=E(),S=l?_:g,{transitionStatus:C,setMounted:w}=Ie(b);V(()=>(m.current+=1,u.state.hasScrollArrows||u.set(`hasScrollArrows`,!0),()=>{m.current=Math.max(0,m.current-1),m.current===0&&u.state.hasScrollArrows&&u.set(`hasScrollArrows`,!1)}),[u,m]),he({open:b,ref:S,onComplete(){b||w(!1)}});let T=r(`div`,e,{ref:[t,S],state:{direction:o,visible:b,side:h,transitionStatus:C},props:[{"aria-hidden":!0,children:l?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||x.isStarted())return;u.set(`activeIndex`,null);function t(){let e=u.state.listElement??d.current;if(!e)return;u.set(`activeIndex`,null),p();let n=Lt(e.scrollHeight,e.clientHeight),r=Rt(e.scrollTop,n),i=r===(l?0:n),a=f.current;if(r!==e.scrollTop&&(e.scrollTop=r),a.length===0&&u.set(l?`scrollUpArrowVisible`:`scrollDownArrowVisible`,!i),i){x.clear();return}if(a.length>0){let t=S.current?.offsetHeight||0;e.scrollTop=On(a,l,r,e.clientHeight,t,n)}x.start(40,t)}x.start(40,t)},onMouseLeave(){x.clear()}},c]});return b||s?T:null});function On(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?Rt(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?Rt(l.offsetTop+l.offsetHeight-r+i,a):a}var kn=Z.forwardRef(function(e,t){return(0,Q.jsx)(Dn,{...e,ref:t,direction:`down`})}),An=Z.forwardRef(function(e,t){return(0,Q.jsx)(Dn,{...e,ref:t,direction:`up`})}),jn=Z.createContext(void 0),Mn=Z.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,[s,c]=Z.useState(),l=Z.useMemo(()=>({labelId:s,setLabelId:c}),[s,c]),u=r(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":s},o]});return(0,Q.jsx)(jn.Provider,{value:l,children:u})}),Nn=zt;function Pn({className:e,...t}){return(0,Q.jsx)(Mn,{"data-slot":`select-group`,className:S(`scroll-my-1 p-1`,e),...t})}function Fn({className:e,...t}){return(0,Q.jsx)(Jt,{"data-slot":`select-value`,className:S(`flex flex-1 text-left`,e),...t})}function In({className:e,size:t=`default`,children:n,...r}){return(0,Q.jsxs)(Kt,{"data-slot":`select-trigger`,"data-size":t,className:S(`flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-input/20 px-2 py-1.5 text-xs/relaxed whitespace-nowrap transition-colors outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,e),...r,children:[n,(0,Q.jsx)(Yt,{render:(0,Q.jsx)(Be,{className:`pointer-events-none size-3.5 text-muted-foreground`})})]})}function Ln({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,Q.jsx)(Zt,{children:(0,Q.jsx)(on,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,Q.jsxs)(fn,{"data-slot":`select-content`,"data-align-trigger":o,className:S(`dark relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[(0,Q.jsx)(zn,{}),(0,Q.jsx)(bn,{children:t}),(0,Q.jsx)(Bn,{})]})})})}function Rn({className:e,children:t,...n}){return(0,Q.jsxs)(Cn,{"data-slot":`select-item`,className:S(`relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,Q.jsx)(En,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,Q.jsx)(wn,{render:(0,Q.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`}),children:(0,Q.jsx)(Ue,{className:`pointer-events-none`})})]})}function zn({className:e,...t}){return(0,Q.jsx)(An,{"data-slot":`select-scroll-up-button`,className:S(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5`,e),...t,children:(0,Q.jsx)(We,{})})}function Bn({className:e,...t}){return(0,Q.jsx)(kn,{"data-slot":`select-scroll-down-button`,className:S(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5`,e),...t,children:(0,Q.jsx)(Be,{})})}export{_t as A,Et as C,vt as D,bt as E,Qe as F,Ze as I,mt as M,at as N,ht as O,nt as P,Tt as S,xt as T,Ot as _,In as a,Ct as b,cn as c,Bt as d,Vt as f,kt as g,Ft as h,Rn as i,ft as j,gt as k,rn as l,It as m,Ln as n,Fn as o,Rt as p,Pn as r,un as s,Nn as t,Ht as u,At as v,wt as w,St as x,jt as y};
|