tokentracker-cli 0.33.0 → 0.34.0
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/dashboard/dist/assets/{ActivityHeatmap-C5lQst9A.js → ActivityHeatmap-B4zB8pSl.js} +1 -1
- package/dashboard/dist/assets/{Card-CTEL3aXx.js → Card-aIQklHHp.js} +1 -1
- package/dashboard/dist/assets/DashboardPage-Cgy94Hkz.js +19 -0
- package/dashboard/dist/assets/{DevicePage-D4bkFEEt.js → DevicePage-CuqXAWeG.js} +1 -1
- package/dashboard/dist/assets/DialogTitle-CNeoqAUd.js +12 -0
- package/dashboard/dist/assets/{FadeIn-BXVxQ51G.js → FadeIn-DLCqO2k7.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-BxYJXuVn.js → HeaderGithubStar-syBp0TMv.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-B3Se3vu3.js → IpCheckPage-DSp8Gu3p.js} +4 -4
- package/dashboard/dist/assets/{LandingPage-B-AM1mgc.js → LandingPage-CdUYfJX9.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardAvatar-BNpzqU-s.js → LeaderboardAvatar-3zGkgsNt.js} +1 -1
- package/dashboard/dist/assets/LeaderboardPage-QWHc3NdM.js +6 -0
- package/dashboard/dist/assets/{LeaderboardProfileModal-BXUUSlGG.js → LeaderboardProfileModal-D0ylKDm1.js} +1 -1
- package/dashboard/dist/assets/LeaderboardProfilePage-CIRXEzq9.js +1 -0
- package/dashboard/dist/assets/LimitsPage-BI6OZJ6Z.js +2 -0
- package/dashboard/dist/assets/{LocalOnlyNotice-ilp-Q8oP.js → LocalOnlyNotice-mpL0e0Yx.js} +1 -1
- package/dashboard/dist/assets/LoginPage-DKq55UDn.js +1 -0
- package/dashboard/dist/assets/{PopoverPopup-BvUHJ3fH.js → PopoverPopup-hv91V5bk.js} +1 -1
- package/dashboard/dist/assets/SettingsPage-SW_MynVy.js +1 -0
- package/dashboard/dist/assets/SkillsPage-DteFqehH.js +1 -0
- package/dashboard/dist/assets/{WidgetsPage-DEsp4TVs.js → WidgetsPage-Bdz7-e2F.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-3kImp9sV.js → WrappedPage-BuSh90dQ.js} +1 -1
- package/dashboard/dist/assets/{agent-logos-4uqTG-g5.js → agent-logos-gEURrAhk.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-C6REzMq8.js → arrow-up-right-DnzcfcLH.js} +1 -1
- package/dashboard/dist/assets/check-CGdPUCWD.js +1 -0
- package/dashboard/dist/assets/{chevron-down-p9KAHQhU.js → chevron-down-A-Yd61uD.js} +1 -1
- package/dashboard/dist/assets/{download-CvJjPKnF.js → download-LO8eYKuM.js} +1 -1
- package/dashboard/dist/assets/{info-R9MgHQlV.js → info-C4MiVPvD.js} +1 -1
- package/dashboard/dist/assets/main-CmNjwZqb.js +964 -0
- package/dashboard/dist/assets/{use-limits-display-prefs-CbobmO9m.js → use-limits-display-prefs-DWRnMoYm.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-DtFQtjxR.js → use-native-settings-6QINkSUb.js} +1 -1
- package/dashboard/dist/assets/use-usage-limits-DRceo1gm.js +1 -0
- package/dashboard/dist/assets/{useCurrency-D8PqG8hW.js → useCurrency-OWcFD7bX.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/dashboard/dist/share.html +1 -1
- package/package.json +1 -1
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/dashboard/dist/assets/DashboardPage-D7Zl3qdP.js +0 -19
- package/dashboard/dist/assets/DialogTitle-DD717-IL.js +0 -12
- package/dashboard/dist/assets/LeaderboardPage-BwlrqFjQ.js +0 -6
- package/dashboard/dist/assets/LeaderboardProfilePage-CBXZv4R_.js +0 -1
- package/dashboard/dist/assets/LimitsPage-Cnk3Do9Y.js +0 -2
- package/dashboard/dist/assets/LoginPage-69LMUSLd.js +0 -1
- package/dashboard/dist/assets/SettingsPage-B5XGzOcZ.js +0 -1
- package/dashboard/dist/assets/SkillsPage-tCvpIDbZ.js +0 -1
- package/dashboard/dist/assets/check-DF1-jcTm.js +0 -1
- package/dashboard/dist/assets/main-DdKVCJWa.js +0 -964
- package/dashboard/dist/assets/use-usage-limits-BwMwzl_A.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as kt,aM as tr,aN as wt,aO as et,aP as tt,aQ as _r,aR as ne,aS as vn,r as n,aT as Ce,aU as gr,aV as jn,aW as xt,x as Ue,aX as Ft,aY as mr,aZ as Nn,a_ as Or,a$ as at,b0 as qt,b1 as ot,b2 as We,b3 as Mt,b4 as Sn,u as t,M as Ar,b5 as Gt,b6 as At,b7 as rr,b8 as nr,b9 as Lr,ba as Vr,bb as Lt,bc as Cn,v as ar,w as qe,bd as Yt,be as Rn,bf as In,bg as Mn,bh as En,bi as Tn,bj as hr,bk as Pn,bl as _n,bm as sr,bn as Bt,F as He,N as Ye,X as vt,s as m,J as On,z as An,A as pr,a5 as Ln,C as Vn,P as st,bo as Dn,bp as Un,bq as Fn,br as Bn,bs as $n,bt as Hn,i as zn,aL as Kn,bu as xr,R as Wn,bv as qn,bw as yr,bx as ct,by as br,bz as kr,bA as Gn,bB as wr,bC as vr,bD as Yn,bE as Xn}from"./main-DdKVCJWa.js";import{L as Qn}from"./LocalOnlyNotice-ilp-Q8oP.js";import{C as Jn}from"./Card-CTEL3aXx.js";import{s as Le,f as Qe,g as Zn,h as ea,i as ta,j as ra,k as na,l as Et,m as de,n as or,o as aa,p as W,q as sa,r as oa,S as ia,t as la,v as ca,w as da,I as ua,x as Dr,F as fa,C as ga,u as ma,D as ha,a as pa,b as xa,c as ya,d as ba,e as ka}from"./DialogTitle-DD717-IL.js";import{I as Ur}from"./info-R9MgHQlV.js";import{u as wa}from"./useCurrency-D8PqG8hW.js";import{f as jr,u as va,e as ja,g as Na,h as Sa,i as Ca,L as Xe,P as Fr,a as Br,b as $r,c as Hr,d as zr,C as Ra}from"./PopoverPopup-BvUHJ3fH.js";import{C as ut}from"./check-DF1-jcTm.js";import{C as ir}from"./chevron-down-p9KAHQhU.js";import{D as Kr}from"./download-CvJjPKnF.js";import"./arrow-up-right-C6REzMq8.js";const Ia=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],Wr=kt("circle-arrow-up",Ia);const Ma=[["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"}]],Xt=kt("external-link",Ma);const Ea=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]],Ta=kt("flame",Ea);const Pa=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],qr=kt("plus",Pa);const _a=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],lr=kt("trash-2",_a);function Nt(e,r,a){return Math.floor(e/r)!==a}function yt(e,r){return r<0||r>=e.current.length}function $t(e,r){return Ae(e,{disabledIndices:r})}function Nr(e,r){return Ae(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:r})}function Ae(e,{startingIndex:r=-1,decrement:a=!1,disabledIndices:o,amount:d=1}={}){let i=r;do i+=a?-d:d;while(i>=0&&i<=e.current.length-1&&bt(e,i,o));return i}function Oa(e,{event:r,orientation:a,loopFocus:o,rtl:d,cols:i,disabledIndices:c,minIndex:l,maxIndex:x,prevIndex:k,stopEvent:u=!1}){let g=k;const y=[],v={};let S=!1;{let f=null,R=-1;e.current.forEach((b,j)=>{if(b==null)return;const A=b.closest('[role="row"]');A&&(S=!0),(A!==f||R===-1)&&(f=A,R+=1,y[R]=[]),y[R].push(j),v[j]=R})}const w=S&&y.length>0&&y.some(f=>f.length!==i);function C(f){if(!w||k===-1)return;const R=v[k];if(R==null)return;const b=y[R].indexOf(k);let j=f==="up"?R-1:R+1;o&&(j<0?j=y.length-1:j>=y.length&&(j=0));const A=new Set;for(;j>=0&&j<y.length&&!A.has(j);){A.add(j);const O=y[j];if(O.length===0){j=f==="up"?j-1:j+1;continue}const $=Math.min(b,O.length-1);for(let _=$;_>=0;_-=1){const q=O[_];if(!bt(e,q,c))return q}j=f==="up"?j-1:j+1,o&&(j<0?j=y.length-1:j>=y.length&&(j=0))}}if(r.key===tr){const f=C("up");if(f!==void 0)u&&Le(r),g=f;else{if(u&&Le(r),k===-1)g=x;else if(g=Ae(e,{startingIndex:g,amount:i,decrement:!0,disabledIndices:c}),o&&(k-i<l||g<0)){const R=k%i,b=x%i,j=x-(b-R);b===R?g=x:g=b>R?j:j-i}yt(e,g)&&(g=k)}}if(r.key===wt){const f=C("down");f!==void 0?(u&&Le(r),g=f):(u&&Le(r),k===-1?g=l:(g=Ae(e,{startingIndex:k,amount:i,disabledIndices:c}),o&&k+i>x&&(g=Ae(e,{startingIndex:k%i-i,amount:i,disabledIndices:c}))),yt(e,g)&&(g=k))}if(a==="both"){const f=jr(k/i);r.key===(d?et:tt)&&(u&&Le(r),k%i!==i-1?(g=Ae(e,{startingIndex:k,disabledIndices:c}),o&&Nt(g,i,f)&&(g=Ae(e,{startingIndex:k-k%i-1,disabledIndices:c}))):o&&(g=Ae(e,{startingIndex:k-k%i-1,disabledIndices:c})),Nt(g,i,f)&&(g=k)),r.key===(d?tt:et)&&(u&&Le(r),k%i!==0?(g=Ae(e,{startingIndex:k,decrement:!0,disabledIndices:c}),o&&Nt(g,i,f)&&(g=Ae(e,{startingIndex:k+(i-k%i),decrement:!0,disabledIndices:c}))):o&&(g=Ae(e,{startingIndex:k+(i-k%i),decrement:!0,disabledIndices:c})),Nt(g,i,f)&&(g=k));const R=jr(x/i)===f;yt(e,g)&&(o&&R?g=r.key===(d?tt:et)?x:Ae(e,{startingIndex:k-k%i-1,disabledIndices:c}):g=k)}return g}function Aa(e,r,a){const o=[];let d=0;return e.forEach(({width:i,height:c},l)=>{let x=!1;for(a&&(d=0);!x;){const k=[];for(let u=0;u<i;u+=1)for(let g=0;g<c;g+=1)k.push(d+u+g*r);d%r+i<=r&&k.every(u=>o[u]==null)?(k.forEach(u=>{o[u]=l}),x=!0):d+=1}}),[...o]}function La(e,r,a,o,d){if(e===-1)return-1;const i=a.indexOf(e),c=r[e];switch(d){case"tl":return i;case"tr":return c?i+c.width-1:i;case"bl":return c?i+(c.height-1)*o:i;case"br":return a.lastIndexOf(e);default:return-1}}function Va(e,r){return r.flatMap((a,o)=>e.includes(a)?[o]:[])}function bt(e,r,a){if(typeof a=="function")return a(r);if(a)return a.includes(r);const o=e.current[r];return o?o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true":!1}const Da="Escape";function Vt(e,r,a){switch(e){case"vertical":return r;case"horizontal":return a;default:return r||a}}function St(e,r){return Vt(r,e===tr||e===wt,e===et||e===tt)}function Ht(e,r,a){return Vt(r,e===wt,a?e===et:e===tt)||e==="Enter"||e===" "||e===""}function Ua(e,r,a){return Vt(r,a?e===et:e===tt,e===wt)}function Fa(e,r,a,o){const d=a?e===tt:e===et,i=e===tr;return r==="both"||r==="horizontal"&&o&&o>1?e===Da:Vt(r,d,i)}function Ba(e,r){const a="rootStore"in e?e.rootStore:e,o=a.useState("open"),d=a.useState("floatingElement"),i=a.useState("domReferenceElement"),c=a.context.dataRef,{listRef:l,activeIndex:x,onNavigate:k=()=>{},enabled:u=!0,selectedIndex:g=null,allowEscape:y=!1,loopFocus:v=!1,nested:S=!1,rtl:w=!1,virtual:C=!1,focusItemOnOpen:f="auto",focusItemOnHover:R=!0,openOnArrowKeyDown:b=!0,disabledIndices:j=void 0,orientation:A="vertical",parentOrientation:O,cols:$=1,scrollItemIntoView:_=!0,itemSizes:q,dense:pe=!1,id:J,resetOnPointerLeave:ae=!0,externalTree:X}=r,ue=_r(d),Y=Qe(ue),U=Zn(),se=ea(X);ne(()=>{c.current.orientation=A},[c,A]);const P=vn(i),H=n.useRef(f),I=n.useRef(g??-1),N=n.useRef(null),fe=n.useRef(!0),L=Ce(h=>{k(I.current===-1?null:I.current,h)}),le=n.useRef(L),Q=n.useRef(!!d),T=n.useRef(o),z=n.useRef(!1),xe=n.useRef(!1),ke=Qe(j),V=Qe(o),ye=Qe(_),Z=Qe(g),ge=Qe(ae),we=Ce(()=>{function h(re){C?se?.events.emit("virtualfocus",re):ta(re,{sync:z.current,preventScroll:!0})}const D=l.current[I.current],M=xe.current;D&&h(D),(z.current?re=>re():requestAnimationFrame)(()=>{const re=l.current[I.current]||D;if(!re)return;D||h(re);const me=ye.current;me&&K&&(M||!fe.current)&&re.scrollIntoView?.(typeof me=="boolean"?{block:"nearest",inline:"nearest"}:me)})});ne(()=>{u&&(o&&d?(I.current=g??-1,H.current&&g!=null&&(xe.current=!0,L())):Q.current&&(I.current=-1,le.current()))},[u,o,d,g,L]),ne(()=>{if(u){if(!o){z.current=!1;return}if(d)if(x==null){if(z.current=!1,Z.current!=null)return;if(Q.current&&(I.current=-1,we()),(!T.current||!Q.current)&&H.current&&(N.current!=null||H.current===!0&&N.current==null)){let h=0;const D=()=>{l.current[0]==null?(h<2&&(h?requestAnimationFrame:queueMicrotask)(D),h+=1):(I.current=N.current==null||Ht(N.current,A,w)||S?$t(l):Nr(l),N.current=null,L())};D()}}else yt(l,x)||(I.current=x,we(),xe.current=!1)}},[u,o,d,x,Z,S,l,A,w,L,we,ke]),ne(()=>{if(!u||d||!se||C||!Q.current)return;const h=se.nodesRef.current,D=h.find(re=>re.id===U)?.context?.elements.floating,M=gr(jn(d)),te=h.some(re=>re.context&&xt(re.context.elements.floating,M));D&&!te&&fe.current&&D.focus({preventScroll:!0})},[u,d,se,U,C]),ne(()=>{le.current=L,T.current=o,Q.current=!!d}),ne(()=>{o||(N.current=null,H.current=f)},[o,f]);const be=x!=null,K=n.useMemo(()=>{function h(M){if(!V.current)return;const te=l.current.indexOf(M.currentTarget);te!==-1&&I.current!==te&&(I.current=te,L(M))}return{onFocus(M){z.current=!0,h(M)},onClick:({currentTarget:M})=>M.focus({preventScroll:!0}),onMouseMove(M){z.current=!0,xe.current=!1,R&&h(M)},onPointerLeave(M){if(!V.current||!fe.current||M.pointerType==="touch")return;z.current=!0;const te=M.relatedTarget;!R||l.current.includes(te)||ge.current&&(I.current=-1,L(M),C||Y.current?.focus({preventScroll:!0}))}}},[V,Y,R,l,L,ge,C]),ee=n.useCallback(()=>O??se?.nodesRef.current.find(h=>h.id===U)?.context?.dataRef?.current.orientation,[U,se,O]),ve=Ce(h=>{if(fe.current=!1,z.current=!0,h.which===229||!V.current&&h.currentTarget===Y.current)return;if(S&&Fa(h.key,A,w,$)){St(h.key,ee())||Le(h),a.setOpen(!1,Ue(Ft,h.nativeEvent)),mr(i)&&(C?se?.events.emit("virtualfocus",i):i.focus());return}const D=I.current,M=$t(l,j),te=Nr(l,j);if(P||(h.key==="Home"&&(Le(h),I.current=M,L(h)),h.key==="End"&&(Le(h),I.current=te,L(h))),$>1){const re=q||Array.from({length:l.current.length},()=>({width:1,height:1})),me=Aa(re,$,pe),Ne=me.findIndex(Re=>Re!=null&&!bt(l,Re,j)),Se=me.reduce((Re,je,Ee)=>je!=null&&!bt(l,je,j)?Ee:Re,-1),Fe=me[Oa({current:me.map(Re=>Re!=null?l.current[Re]:null)},{event:h,orientation:A,loopFocus:v,rtl:w,cols:$,disabledIndices:Va([...(typeof j!="function"?j:null)||l.current.map((Re,je)=>bt(l,je,j)?je:void 0),void 0],me),minIndex:Ne,maxIndex:Se,prevIndex:La(I.current>te?M:I.current,re,me,$,h.key===wt?"bl":h.key===(w?et:tt)?"tr":"tl"),stopEvent:!0})];if(Fe!=null&&(I.current=Fe,L(h)),A==="both")return}if(St(h.key,A)){if(Le(h),o&&!C&&gr(h.currentTarget.ownerDocument)===h.currentTarget){I.current=Ht(h.key,A,w)?M:te,L(h);return}Ht(h.key,A,w)?v?D>=te?y&&D!==l.current.length?I.current=-1:(z.current=!1,I.current=M):I.current=Ae(l,{startingIndex:D,disabledIndices:j}):I.current=Math.min(te,Ae(l,{startingIndex:D,disabledIndices:j})):v?D<=M?y&&D!==-1?I.current=l.current.length:(z.current=!1,I.current=te):I.current=Ae(l,{startingIndex:D,decrement:!0,disabledIndices:j}):I.current=Math.max(M,Ae(l,{startingIndex:D,decrement:!0,disabledIndices:j})),yt(l,I.current)&&(I.current=-1),L(h)}}),oe=n.useMemo(()=>C&&o&&be&&{"aria-activedescendant":`${J}-${x}`},[C,o,be,J,x]),ie=n.useMemo(()=>({"aria-orientation":A==="both"?void 0:A,...P?{}:oe,onKeyDown(h){if(h.key==="Tab"&&h.shiftKey&&o&&!C){const D=Nn(h.nativeEvent);if(D&&!xt(Y.current,D))return;Le(h),a.setOpen(!1,Ue(Or,h.nativeEvent)),mr(i)&&i.focus();return}ve(h)},onPointerMove(){fe.current=!0}}),[oe,ve,Y,A,P,a,o,C,i]),Me=n.useMemo(()=>{function h(M){f==="auto"&&ra(M.nativeEvent)&&(H.current=!C)}function D(M){H.current=f,f==="auto"&&na(M.nativeEvent)&&(H.current=!0)}return{onKeyDown(M){const te=a.select("open");fe.current=!1;const re=M.key.startsWith("Arrow"),me=Ua(M.key,ee(),w),Ne=St(M.key,A),Se=(S?me:Ne)||M.key==="Enter"||M.key.trim()==="";if(C&&te)return ve(M);if(!(!te&&!b&&re)){if(Se){const Fe=St(M.key,ee());N.current=S&&Fe?null:M.key}if(S){me&&(Le(M),te?(I.current=$t(l,ke.current),L(M)):a.setOpen(!0,Ue(Ft,M.nativeEvent,M.currentTarget)));return}Ne&&(Z.current!=null&&(I.current=Z.current),Le(M),!te&&b?a.setOpen(!0,Ue(Ft,M.nativeEvent,M.currentTarget)):ve(M),te&&L(M))}},onFocus(M){a.select("open")&&!C&&(I.current=-1,L(M))},onPointerDown:D,onPointerEnter:D,onMouseDown:h,onClick:h}},[ve,ke,f,l,S,L,a,b,A,ee,w,Z,C]),ce=n.useMemo(()=>({...oe,...Me}),[oe,Me]);return n.useMemo(()=>u?{reference:ce,floating:ie,item:K,trigger:Me}:{},[u,ce,ie,Me,K])}function $a(e,r){const a="rootStore"in e?e.rootStore:e,o=a.useState("open"),d=a.context.dataRef,{listRef:i,activeIndex:c,onMatch:l,onTypingChange:x,enabled:k=!0,findMatch:u=null,resetMs:g=750,ignoreKeys:y=qt,selectedIndex:v=null}=r,S=at(),w=n.useRef(""),C=n.useRef(v??c??-1),f=n.useRef(null);ne(()=>{o&&(S.clear(),f.current=null,w.current="")},[o,S]),ne(()=>{o&&w.current===""&&(C.current=v??c??-1)},[o,v,c]);const R=Ce(O=>{O?d.current.typing||(d.current.typing=O,x?.(O)):d.current.typing&&(d.current.typing=O,x?.(O))}),b=Ce(O=>{function $(ae,X,ue){const Y=u?u(X,ue):X.find(U=>U?.toLocaleLowerCase().indexOf(ue.toLocaleLowerCase())===0);return Y?ae.indexOf(Y):-1}const _=i.current;if(w.current.length>0&&w.current[0]!==" "&&($(_,_,w.current)===-1?R(!1):O.key===" "&&Le(O)),_==null||y.includes(O.key)||O.key.length!==1||O.ctrlKey||O.metaKey||O.altKey)return;o&&O.key!==" "&&(Le(O),R(!0)),_.every(ae=>ae?ae[0]?.toLocaleLowerCase()!==ae[1]?.toLocaleLowerCase():!0)&&w.current===O.key&&(w.current="",C.current=f.current),w.current+=O.key,S.start(g,()=>{w.current="",C.current=f.current,R(!1)});const pe=C.current,J=$(_,[..._.slice((pe||0)+1),..._.slice(0,(pe||0)+1)],w.current);J!==-1?(l?.(J),f.current=J):O.key!==" "&&(w.current="",R(!1))}),j=n.useMemo(()=>({onKeyDown:b}),[b]),A=n.useMemo(()=>({onKeyDown:b,onKeyUp(O){O.key===" "&&R(!1)}}),[b,R]);return n.useMemo(()=>k?{reference:j,floating:A}:{},[k,j,A])}function Ha(e){const r=n.useRef(!0);r.current&&(r.current=!1,e())}function Qt({controlled:e,default:r,name:a,state:o="value"}){const{current:d}=n.useRef(e!==void 0),[i,c]=n.useState(r),l=d?e:i,x=n.useCallback(k=>{d||c(k)},[]);return[l,x]}const Gr=n.createContext(null),Yr=n.createContext(null);function rt(){const e=n.useContext(Gr);if(e===null)throw new Error(ot(60));return e}function Xr(){const e=n.useContext(Yr);if(e===null)throw new Error(ot(61));return e}let Sr=(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})({});const za={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},cr={valid(e){return e===null?null:e?{[Sr.valid]:""}:{[Sr.invalid]:""}}},Ka=n.createContext({invalid:void 0,name:void 0,validityData:{state:za,errors:[],error:"",value:"",initialValue:null},setValidityData:We,disabled:void 0,touched:!1,setTouched:We,dirty:!1,setDirty:We,filled:!1,setFilled:We,focused:!1,setFocused:We,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Mt)=>e,getInputValidationProps:(e=Mt)=>e,inputRef:{current:null},commit:async()=>{}}});function Dt(e=!0){const r=n.useContext(Ka);if(r.setValidityData===We&&!e)throw new Error(ot(28));return r}const Wa=n.createContext({controlId:void 0,setControlId:We,labelId:void 0,setLabelId:We,messageIds:[],setMessageIds:We,getDescriptionProps:e=>e});function dr(){return n.useContext(Wa)}function Qr(e={}){const{id:r,implicit:a=!1,controlRef:o}=e,{controlId:d,setControlId:i}=dr(),c=Et(r);return ne(()=>{if(!(!a&&!r||i===We)){if(a){const l=o?.current;Sn(l)&&l.closest("label")!=null?i(r??null):i(d??c)}else r&&i(r);return()=>{r&&i(void 0)}}},[r,o,d,i,a,c]),d??c}const qa=(e,r)=>Object.is(e,r);function ft(e,r,a){return e==null||r==null?Object.is(e,r):a(e,r)}function zt(e,r,a){return!e||e.length===0?!1:e.some(o=>o===void 0?!1:ft(o,r,a))}function Jt(e,r,a){return!e||e.length===0?-1:e.findIndex(o=>o===void 0?!1:ft(o,r,a))}function Ga(e,r,a){return e.filter(o=>!ft(o,r,a))}function Zt(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Jr(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function Ya(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(Jr(e)){for(const r of e)for(const a of r.items)if(a&&a.value==null&&a.label!=null)return!0;return!1}for(const r of e)if(r&&r.value==null&&r.label!=null)return!0;return!1}function Xa(e,r){if(r&&e!=null)return r(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 Zt(e)}function dt(e,r){return r&&e!=null?r(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Zt(e.value):Zt(e)}function Zr(e,r,a){function o(){return Xa(e,a)}if(a&&e!=null)return a(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(r&&!Array.isArray(r))return r[e]??o();if(Array.isArray(r)){const d=Jr(r)?r.flatMap(i=>i.items):r;if(e==null||typeof e!="object"){const i=d.find(c=>c.value===e);return i&&i.label!=null?i.label:o()}if("value"in e){const i=d.find(c=>c&&c.value===e.value);if(i&&i.label!=null)return i.label}}return o()}function Qa(e,r,a){return e.reduce((o,d,i)=>(i>0&&o.push(", "),o.push(t.jsx(n.Fragment,{children:Zr(d,r,a)},i)),o),[])}const B={id:de(e=>e.id),modal:de(e=>e.modal),multiple:de(e=>e.multiple),items:de(e=>e.items),itemToStringLabel:de(e=>e.itemToStringLabel),itemToStringValue:de(e=>e.itemToStringValue),isItemEqualToValue:de(e=>e.isItemEqualToValue),value:de(e=>e.value),hasSelectedValue:de(e=>{const{value:r,multiple:a,itemToStringValue:o}=e;return r==null?!1:a&&Array.isArray(r)?r.length>0:dt(r,o)!==""}),hasNullItemLabel:de((e,r)=>r?Ya(e.items):!1),open:de(e=>e.open),mounted:de(e=>e.mounted),forceMount:de(e=>e.forceMount),transitionStatus:de(e=>e.transitionStatus),openMethod:de(e=>e.openMethod),activeIndex:de(e=>e.activeIndex),selectedIndex:de(e=>e.selectedIndex),isActive:de((e,r)=>e.activeIndex===r),isSelected:de((e,r,a)=>{const o=e.isItemEqualToValue,d=e.value;return e.multiple?Array.isArray(d)&&d.some(i=>ft(i,a,o)):e.selectedIndex===r&&e.selectedIndex!==null?!0:ft(d,a,o)}),isSelectedByFocus:de((e,r)=>e.selectedIndex===r),popupProps:de(e=>e.popupProps),triggerProps:de(e=>e.triggerProps),triggerElement:de(e=>e.triggerElement),positionerElement:de(e=>e.positionerElement),listElement:de(e=>e.listElement),scrollUpArrowVisible:de(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:de(e=>e.scrollDownArrowVisible),hasScrollArrows:de(e=>e.hasScrollArrows)},Ja=n.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:We,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function ur(){return n.useContext(Ja)}function Za(e,r){return{...e,state:{...e.state,valid:!r&&e.state.valid}}}function en(e){const{enabled:r=!0,value:a,id:o,name:d,controlRef:i,commit:c}=e,{formRef:l}=ur(),{invalid:x,markedDirtyRef:k,validityData:u,setValidityData:g}=Dt(),y=Ce(e.getValue);ne(()=>{if(!r)return;let v=a;v===void 0&&(v=y()),u.initialValue===null&&v!==null&&g(S=>({...S,initialValue:v}))},[r,g,a,u.initialValue,y]),ne(()=>{!r||!o||l.current.fields.set(o,{getValue:y,name:d,controlRef:i,validityData:Za(u,x),validate(v=!0){let S=a;S===void 0&&(S=y()),k.current=!0,v?Ar.flushSync(()=>c(S)):c(S)}})},[c,i,r,l,y,o,x,k,d,u,a]),ne(()=>{const v=l.current.fields;return()=>{o&&v.delete(o)}},[l,o])}function tn(e,r){const a=n.useRef(e),o=Ce(r);ne(()=>{a.current!==e&&o(a.current)},[e,o]),ne(()=>{a.current=e},[e])}function rn(e){const{id:r,value:a,defaultValue:o=null,onValueChange:d,open:i,defaultOpen:c=!1,onOpenChange:l,name:x,disabled:k=!1,readOnly:u=!1,required:g=!1,modal:y=!0,actionsRef:v,inputRef:S,onOpenChangeComplete:w,items:C,multiple:f=!1,itemToStringLabel:R,itemToStringValue:b,isItemEqualToValue:j=qa,highlightItemOnHover:A=!0,children:O}=e,{clearErrors:$}=ur(),{setDirty:_,setTouched:q,setFocused:pe,shouldValidateOnChange:J,validityData:ae,setFilled:X,name:ue,disabled:Y,validation:U,validationMode:se}=Dt(),P=Qr({id:r}),H=Y||k,I=ue??x,[N,fe]=Qt({controlled:a,default:f?o??qt:o,name:"Select",state:"value"}),[L,le]=Qt({controlled:i,default:c,name:"Select",state:"open"}),Q=n.useRef([]),T=n.useRef([]),z=n.useRef(null),xe=n.useRef(null),ke=n.useRef(0),V=n.useRef(null),ye=n.useRef([]),Z=n.useRef(!1),ge=n.useRef(!1),we=n.useRef(null),be=n.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),K=n.useRef(!1),{mounted:ee,setMounted:ve,transitionStatus:oe}=or(L),{openMethod:ie,triggerProps:Me,reset:ce}=aa(L),h=Gt(()=>new ia({id:P,modal:y,multiple:f,itemToStringLabel:R,itemToStringValue:b,isItemEqualToValue:j,value:N,open:L,mounted:ee,transitionStatus:oe,items:C,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,D=W(h,B.activeIndex),M=W(h,B.selectedIndex),te=W(h,B.triggerElement),re=W(h,B.positionerElement),me=n.useMemo(()=>f&&Array.isArray(N)&&N.length===0?"":dt(N,b),[f,N,b]),Ne=n.useMemo(()=>f&&Array.isArray(N)?N.map(F=>dt(F,b)):dt(N,b),[f,N,b]),Se=Qe(h.state.triggerElement);en({id:P,commit:U.commit,value:N,controlRef:Se,name:I,getValue:()=>Ne});const Fe=n.useRef(N);ne(()=>{N!==Fe.current&&h.set("forceMount",!0)},[h,N]),ne(()=>{X(f?Array.isArray(N)&&N.length>0:N!=null)},[f,N,X]),ne(function(){if(L)return;const he=ye.current;if(f){const p=Array.isArray(N)?N:[];if(p.length===0){h.set("selectedIndex",null);return}const E=p[p.length-1],G=Jt(he,E,j);h.set("selectedIndex",G===-1?null:G);return}const s=Jt(he,N,j);h.set("selectedIndex",s===-1?null:s)},[f,L,N,ye,j,h]),tn(N,()=>{$(I),_(N!==ae.initialValue),J()?U.commit(N):U.commit(N,!0)});const Re=Ce((F,he)=>{if(l?.(F,he),!he.isCanceled&&(le(F),!F&&(he.reason===Or||he.reason===Cn)&&(q(!0),pe(!1),se==="onBlur"&&U.commit(N)),!F&&h.state.activeIndex!==null)){const s=Q.current[h.state.activeIndex];queueMicrotask(()=>{s?.setAttribute("tabindex","-1")})}}),je=Ce(()=>{ve(!1),h.set("activeIndex",null),ce(),w?.(!1)});At({enabled:!v,open:L,ref:z,onComplete(){L||je()}}),n.useImperativeHandle(v,()=>({unmount:je}),[je]);const Ee=Ce((F,he)=>{d?.(F,he),!he.isCanceled&&fe(F)}),Te=Ce(()=>{const F=h.state.listElement||z.current;if(!F)return;const he=F.scrollTop,s=F.scrollTop+F.clientHeight,p=he>1,E=s<F.scrollHeight-1;h.state.scrollUpArrowVisible!==p&&h.set("scrollUpArrowVisible",p),h.state.scrollDownArrowVisible!==E&&h.set("scrollDownArrowVisible",E)}),Ve=va({open:L,onOpenChange:Re,elements:{reference:te,floating:re}}),_e=ja(Ve,{enabled:!u&&!H,event:"mousedown"}),Be=sa(Ve,{bubbles:!1}),ze=Ba(Ve,{enabled:!u&&!H,listRef:Q,activeIndex:D,selectedIndex:M,disabledIndices:qt,onNavigate(F){F===null&&!L||h.set("activeIndex",F)},focusItemOnHover:!1}),gt=$a(Ve,{enabled:!u&&!H&&(L||!f),listRef:T,activeIndex:D,selectedIndex:M,onMatch(F){L?h.set("activeIndex",F):Ee(ye.current[F],Ue("none"))},onTypingChange(F){Z.current=F}}),{getReferenceProps:Pe,getFloatingProps:Je,getItemProps:it}=oa([_e,Be,ze,gt]),nt=n.useMemo(()=>rr(Pe(),Me,P?{id:P}:Mt),[Pe,Me,P]);Ha(()=>{h.update({popupProps:Je(),triggerProps:nt})}),ne(()=>{h.update({id:P,modal:y,multiple:f,value:N,open:L,mounted:ee,transitionStatus:oe,popupProps:Je(),triggerProps:nt,items:C,itemToStringLabel:R,itemToStringValue:b,isItemEqualToValue:j,openMethod:ie})},[h,P,y,f,N,L,ee,oe,Je,nt,C,R,b,j,ie]);const lt=n.useMemo(()=>({store:h,name:I,required:g,disabled:H,readOnly:u,multiple:f,itemToStringLabel:R,itemToStringValue:b,highlightItemOnHover:A,setValue:Ee,setOpen:Re,listRef:Q,popupRef:z,scrollHandlerRef:xe,handleScrollArrowVisibility:Te,scrollArrowsMountedCountRef:ke,getItemProps:it,events:Ve.context.events,valueRef:V,valuesRef:ye,labelsRef:T,typingRef:Z,selectionRef:be,selectedItemTextRef:we,validation:U,onOpenChangeComplete:w,keyboardActiveRef:ge,alignItemWithTriggerActiveRef:K,initialValueRef:Fe}),[h,I,g,H,u,f,R,b,A,Ee,Re,it,Ve.context.events,U,w,Te]),Ge=nr(S,U.inputRef),mt=f&&Array.isArray(N)&&N.length>0,ht=n.useMemo(()=>!f||!Array.isArray(N)||!I?null:N.map(F=>{const he=dt(F,b);return t.jsx("input",{type:"hidden",name:I,value:he},he)}),[f,N,I,b]);return t.jsx(Gr.Provider,{value:lt,children:t.jsxs(Yr.Provider,{value:Ve,children:[O,t.jsx("input",{...U.getInputValidationProps({onFocus(){h.state.triggerElement?.focus({focusVisible:!0})},onChange(F){if(F.nativeEvent.defaultPrevented)return;const he=F.target.value,s=Ue(Lt,F.nativeEvent);function p(){if(f)return;const E=ye.current.find(G=>dt(G,b).toLowerCase()===he.toLowerCase());E!=null&&(_(E!==ae.initialValue),Ee(E,s),J()&&U.commit(E))}h.set("forceMount",!0),queueMicrotask(p)}}),name:f?void 0:I,value:me,disabled:H,required:g&&!mt,readOnly:u,ref:Ge,style:I?Lr:Vr,tabIndex:-1,"aria-hidden":!0}),ht]})})}function es(e){const r=e.getBoundingClientRect(),a=window.getComputedStyle(e,"::before"),o=window.getComputedStyle(e,"::after");if(!(a.content!=="none"||o.content!=="none"))return r;const i=parseFloat(a.width)||0,c=parseFloat(a.height)||0,l=parseFloat(o.width)||0,x=parseFloat(o.height)||0,k=Math.max(r.width,i,l),u=Math.max(r.height,c,x),g=k-r.width,y=u-r.height;return{left:r.left-g/2,right:r.right+g/2,top:r.top-y/2,bottom:r.bottom+y/2}}const Ct=2,ts=400,Cr=200,rs={...la,...cr,value:()=>null},nn=n.forwardRef(function(r,a){const{render:o,className:d,id:i,disabled:c=!1,nativeButton:l=!0,...x}=r,{setTouched:k,setFocused:u,validationMode:g,state:y,disabled:v}=Dt(),{labelId:S}=dr(),{store:w,setOpen:C,selectionRef:f,validation:R,readOnly:b,required:j,alignItemWithTriggerActiveRef:A,disabled:O,keyboardActiveRef:$}=rt(),_=v||O||c,q=W(w,B.open),pe=W(w,B.value),J=W(w,B.triggerProps),ae=W(w,B.positionerElement),X=W(w,B.listElement),ue=W(w,B.id),Y=W(w,B.hasSelectedValue),U=!Y&&q,se=W(w,B.hasNullItemLabel,U),P=i??ue;Qr({id:P});const H=Qe(ae),I=n.useRef(null),{getButtonProps:N,buttonRef:fe}=ar({disabled:_,native:l}),L=Ce(Z=>{w.set("triggerElement",Z)}),le=nr(a,I,fe,L),Q=at(),T=at(),z=at(),xe=at();n.useEffect(()=>{if(q)return!(Y||se)?z.start(ts,()=>{f.current.allowUnselectedMouseUp=!0,f.current.allowSelectedMouseUp=!0}):xe.start(Cr,()=>{f.current.allowUnselectedMouseUp=!0,z.start(Cr,()=>{f.current.allowSelectedMouseUp=!0})}),()=>{z.clear(),xe.clear()};f.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},T.clear()},[q,Y,se,f,T,z,xe]);const ke=n.useMemo(()=>X?.id??_r(ae)?.id,[X,ae]),V=rr(J,{id:P,role:"combobox","aria-expanded":q?"true":"false","aria-haspopup":"listbox","aria-controls":q?ke:void 0,"aria-labelledby":S,"aria-readonly":b||void 0,"aria-required":j||void 0,tabIndex:_?-1:0,ref:le,onFocus(Z){u(!0),q&&A.current&&C(!1,Ue(Lt,Z.nativeEvent)),Q.start(0,()=>{w.set("forceMount",!0)})},onBlur(Z){xt(ae,Z.relatedTarget)||(k(!0),u(!1),g==="onBlur"&&R.commit(pe))},onPointerMove(){$.current=!1},onKeyDown(){$.current=!0},onMouseDown(Z){if(q)return;const ge=Yt(Z.currentTarget);function we(be){if(!I.current)return;const K=be.target;if(xt(I.current,K)||xt(H.current,K)||K===I.current)return;const ee=es(I.current);be.clientX>=ee.left-Ct&&be.clientX<=ee.right+Ct&&be.clientY>=ee.top-Ct&&be.clientY<=ee.bottom+Ct||C(!1,Ue(Rn,be))}T.start(0,()=>{ge.addEventListener("mouseup",we,{once:!0})})}},R.getValidationProps,x,N);V.role="combobox";const ye=n.useMemo(()=>({...y,open:q,disabled:_,value:pe,readOnly:b,placeholder:!Y}),[y,q,_,pe,b,Y]);return qe("button",r,{ref:[a,I],state:ye,stateAttributesMapping:rs,props:V})}),ns={value:()=>null},an=n.forwardRef(function(r,a){const{className:o,render:d,children:i,placeholder:c,...l}=r,{store:x,valueRef:k}=rt(),u=W(x,B.value),g=W(x,B.items),y=W(x,B.itemToStringLabel),v=W(x,B.hasSelectedValue),S=!v&&c!=null&&i==null,w=W(x,B.hasNullItemLabel,S),C=n.useMemo(()=>({value:u,placeholder:!v}),[u,v]);let f=null;return typeof i=="function"?f=i(u):i!=null?f=i:!v&&c!=null&&!w?f=c:Array.isArray(u)?f=Qa(u,g,y):f=Zr(u,g,y),qe("span",r,{state:C,ref:[a,k],props:[{children:f},l],stateAttributesMapping:ns})}),sn=n.forwardRef(function(r,a){const{className:o,render:d,...i}=r,{store:c}=rt(),l=W(c,B.open),x=n.useMemo(()=>({open:l}),[l]);return qe("span",r,{state:x,ref:a,props:[{"aria-hidden":!0,children:"▼"},i],stateAttributesMapping:ca})}),as=n.createContext(void 0),on=n.forwardRef(function(r,a){const{store:o}=rt(),d=W(o,B.mounted),i=W(o,B.forceMount);return d||i?t.jsx(as.Provider,{value:!0,children:t.jsx(In,{ref:a,...r})}):null}),ln=n.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function ss(){return n.useContext(ln)}function os(e){const{children:r,elementsRef:a,labelsRef:o,onMapChange:d}=e,i=Ce(d),c=n.useRef(0),l=Gt(ls).current,x=Gt(is).current,[k,u]=n.useState(0),g=n.useRef(k),y=Ce((f,R)=>{x.set(f,R??null),g.current+=1,u(g.current)}),v=Ce(f=>{x.delete(f),g.current+=1,u(g.current)}),S=n.useMemo(()=>{const f=new Map;return Array.from(x.keys()).filter(b=>b.isConnected).sort(cs).forEach((b,j)=>{const A=x.get(b)??{};f.set(b,{...A,index:j})}),f},[x,k]);ne(()=>{if(typeof MutationObserver!="function"||S.size===0)return;const f=new MutationObserver(R=>{const b=new Set,j=A=>b.has(A)?b.delete(A):b.add(A);R.forEach(A=>{A.removedNodes.forEach(j),A.addedNodes.forEach(j)}),b.size===0&&(g.current+=1,u(g.current))});return S.forEach((R,b)=>{b.parentElement&&f.observe(b.parentElement,{childList:!0})}),()=>{f.disconnect()}},[S]),ne(()=>{g.current===k&&(a.current.length!==S.size&&(a.current.length=S.size),o&&o.current.length!==S.size&&(o.current.length=S.size),c.current=S.size),i(S)},[i,S,a,o,k]),ne(()=>()=>{a.current=[]},[a]),ne(()=>()=>{o&&(o.current=[])},[o]);const w=Ce(f=>(l.add(f),()=>{l.delete(f)}));ne(()=>{l.forEach(f=>f(S))},[l,S]);const C=n.useMemo(()=>({register:y,unregister:v,subscribeMapChange:w,elementsRef:a,labelsRef:o,nextIndexRef:c}),[y,v,w,a,o,c]);return t.jsx(ln.Provider,{value:C,children:r})}function is(){return new Map}function ls(){return new Set}function cs(e,r){const a=e.compareDocumentPosition(r);return a&Node.DOCUMENT_POSITION_FOLLOWING||a&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:a&Node.DOCUMENT_POSITION_PRECEDING||a&Node.DOCUMENT_POSITION_CONTAINS?1:0}const cn=n.createContext(void 0);function ds(){const e=n.useContext(cn);if(!e)throw new Error(ot(59));return e}function Tt(e,r){e&&Object.assign(e.style,r)}const us={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},fs={position:"fixed"},dn=n.forwardRef(function(r,a){const{anchor:o,positionMethod:d="absolute",className:i,render:c,side:l="bottom",align:x="center",sideOffset:k=0,alignOffset:u=0,collisionBoundary:g="clipping-ancestors",collisionPadding:y,arrowPadding:v=5,sticky:S=!1,disableAnchorTracking:w,alignItemWithTrigger:C=!0,collisionAvoidance:f=Mn,...R}=r,{store:b,listRef:j,labelsRef:A,alignItemWithTriggerActiveRef:O,selectedItemTextRef:$,valuesRef:_,initialValueRef:q,popupRef:pe,setValue:J}=rt(),ae=Xr(),X=W(b,B.open),ue=W(b,B.mounted),Y=W(b,B.modal),U=W(b,B.value),se=W(b,B.openMethod),P=W(b,B.positionerElement),H=W(b,B.triggerElement),I=W(b,B.isItemEqualToValue),N=n.useRef(null),fe=n.useRef(null),[L,le]=n.useState(C),Q=ue&&L&&se!=="touch";!ue&&L!==C&&le(C),ne(()=>{ue||(B.scrollUpArrowVisible(b.state)&&b.set("scrollUpArrowVisible",!1),B.scrollDownArrowVisible(b.state)&&b.set("scrollDownArrowVisible",!1))},[b,ue]),n.useImperativeHandle(O,()=>Q),da((Q||Y)&&X&&se!=="touch",H);const T=Na({anchor:o,floatingRootContext:ae,positionMethod:d,mounted:ue,side:l,sideOffset:k,align:x,alignOffset:u,arrowPadding:v,collisionBoundary:g,collisionPadding:y,sticky:S,disableAnchorTracking:w??Q,collisionAvoidance:f,keepMounted:!0}),z=Q?"none":T.side,xe=Q?fs:T.positionerStyles,ke=n.useMemo(()=>{const K={};return X||(K.pointerEvents="none"),{role:"presentation",hidden:!ue,style:{...xe,...K}}},[X,ue,xe]),V=n.useMemo(()=>({open:X,side:z,align:T.align,anchorHidden:T.anchorHidden}),[X,z,T.align,T.anchorHidden]),ye=Ce(K=>{b.set("positionerElement",K)}),Z=qe("div",r,{ref:[a,ye],state:V,stateAttributesMapping:Dr,props:[ke,R]}),ge=n.useRef(0),we=Ce(K=>{if(K.size===0&&ge.current===0||_.current.length===0)return;const ee=ge.current;if(ge.current=K.size,K.size===ee)return;const ve=Ue(Lt);if(ee!==0&&!b.state.multiple&&U!==null&&Jt(_.current,U,I)===-1){const ie=q.current,ce=ie!=null&&zt(_.current,ie,I)?ie:null;J(ce,ve),ce===null&&(b.set("selectedIndex",null),$.current=null)}if(ee!==0&&b.state.multiple&&Array.isArray(U)){const oe=U.filter(ie=>zt(_.current,ie,I));(oe.length!==U.length||oe.some(ie=>!zt(U,ie,I)))&&(J(oe,ve),oe.length===0&&(b.set("selectedIndex",null),$.current=null))}if(X&&Q){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const oe={height:""};Tt(P,oe),Tt(pe.current,oe)}}),be=n.useMemo(()=>({...T,side:z,alignItemWithTriggerActive:Q,setControlledAlignItemWithTrigger:le,scrollUpArrowRef:N,scrollDownArrowRef:fe}),[T,z,Q,le]);return t.jsx(os,{elementsRef:j,labelsRef:A,onMapChange:we,children:t.jsxs(cn.Provider,{value:be,children:[ue&&Y&&t.jsx(ua,{inert:En(!X),cutout:H}),Z]})})});function un(e){const r=e.currentTarget.getBoundingClientRect();return r.top+1<=e.clientY&&e.clientY<=r.bottom-1&&r.left+1<=e.clientX&&e.clientX<=r.right-1}const Rt="base-ui-disable-scrollbar",Rr={className:Rt,getElement(e){return t.jsx("style",{nonce:e,href:Rt,precedence:"base-ui:low",children:`.${Rt}{scrollbar-width:none}.${Rt}::-webkit-scrollbar{display:none}`})}};function gs(e,r=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER){return Math.max(r,Math.min(e,a))}const ms=n.createContext(void 0),hs={disableStyleElements:!1};function ps(){return n.useContext(ms)??hs}const xs={...Dr,...sr},fn=n.forwardRef(function(r,a){const{render:o,className:d,...i}=r,{store:c,popupRef:l,onOpenChangeComplete:x,setOpen:k,valueRef:u,selectedItemTextRef:g,keyboardActiveRef:y,multiple:v,handleScrollArrowVisibility:S,scrollHandlerRef:w,highlightItemOnHover:C}=rt(),{side:f,align:R,alignItemWithTriggerActive:b,setControlledAlignItemWithTrigger:j,scrollDownArrowRef:A,scrollUpArrowRef:O}=ds(),$=Sa()!=null,_=Xr(),{nonce:q,disableStyleElements:pe}=ps(),J=at(),ae=W(c,B.id),X=W(c,B.open),ue=W(c,B.mounted),Y=W(c,B.popupProps),U=W(c,B.transitionStatus),se=W(c,B.triggerElement),P=W(c,B.positionerElement),H=W(c,B.listElement),I=n.useRef(0),N=n.useRef(!1),fe=n.useRef(0),L=n.useRef(!1),le=n.useRef({}),Q=Tn(),T=Ce(V=>{if(!P||!l.current||!L.current)return;if(N.current||!b){S();return}const ye=P.style.top==="0px",Z=P.style.bottom==="0px",ge=P.getBoundingClientRect().height,we=Yt(P),be=getComputedStyle(P),K=parseFloat(be.marginTop),ee=parseFloat(be.marginBottom),ve=Ir(getComputedStyle(l.current)),oe=we.documentElement.clientHeight-K-ee,ie=V.scrollTop,Me=V.scrollHeight,ce=V.clientHeight,h=Me-ce;let D=0,M=null,te=!1;if(ye){const re=h-ie,me=ge+re,Ne=Math.min(me,oe);D=Ne,Ne!==oe?M=h:te=!0}else if(Z){const re=ie-0,me=ge+re,Ne=Math.min(me,oe),Se=me-oe;D=Ne,Ne!==oe?M=0:(te=!0,ie<h&&(M=ie-(re-Se)))}D!==0&&(P.style.height=`${D}px`),M!=null&&(V.scrollTop=M),(te||D>=ve)&&(N.current=!0),S()});n.useImperativeHandle(w,()=>T,[T]),At({open:X,ref:l,onComplete(){X&&x?.(!0)}});const z=n.useMemo(()=>({open:X,transitionStatus:U,side:f,align:R}),[X,U,f,R]);ne(()=>{!P||!l.current||Object.keys(le.current).length||(le.current={top:P.style.top||"0",left:P.style.left||"0",right:P.style.right,height:P.style.height,bottom:P.style.bottom,minHeight:P.style.minHeight,maxHeight:P.style.maxHeight,marginTop:P.style.marginTop,marginBottom:P.style.marginBottom})},[l,P]),ne(()=>{X||b||(L.current=!1,N.current=!1,I.current=0,fe.current=0,Tt(P,le.current))},[X,b,P,l]),ne(()=>{const V=l.current;if(!(!X||!se||!P||!V||c.state.transitionStatus==="ending")){if(!b){L.current=!0,Q.request(S),V.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const ye=bs(V);V.style.removeProperty("--transform-origin");try{const Z=getComputedStyle(P),ge=getComputedStyle(V),we=Yt(se),be=hr(P),K=se.getBoundingClientRect(),ee=P.getBoundingClientRect(),ve=K.left,oe=K.height,ie=H||V,Me=ie.scrollHeight,ce=parseFloat(ge.borderBottomWidth),h=parseFloat(Z.marginTop)||10,D=parseFloat(Z.marginBottom)||10,M=parseFloat(Z.minHeight)||100,te=Ir(ge),re=5,me=5,Ne=20,Se=we.documentElement.clientHeight-h-D,Fe=we.documentElement.clientWidth,Re=Se-K.bottom+oe,je=g.current,Ee=u.current;let Te,Ve=0,_e=0;if(je&&Ee){const F=Ee.getBoundingClientRect();Te=je.getBoundingClientRect();const he=F.left-ve,s=Te.left-ee.left,p=F.top-K.top+F.height/2,E=Te.top-ee.top+Te.height/2;Ve=he-s,_e=E-p}const Be=Re+_e+D+ce;let ze=Math.min(Se,Be);const gt=Se-h-D,Pe=Be-ze,Je=Math.max(re,ve+Ve),it=Fe-me,nt=Math.max(0,Je+ee.width-it);P.style.left=`${Je-nt}px`,P.style.height=`${ze}px`,P.style.maxHeight="auto",P.style.marginTop=`${h}px`,P.style.marginBottom=`${D}px`,V.style.height="100%";const lt=ie.scrollHeight-ie.clientHeight,Ge=Pe>=lt;Ge&&(ze=Math.min(Se,ee.height)-(Pe-lt));const mt=K.top<Ne||K.bottom>Se-Ne||ze<Math.min(Me,M),ht=(be.visualViewport?.scale??1)!==1&&Pn;if(mt||ht){L.current=!0,Tt(P,le.current),Ar.flushSync(()=>j(!1));return}if(Ge){const F=Math.max(0,Se-Be);P.style.top=ee.height>=gt?"0":`${F}px`,P.style.height=`${ze}px`,ie.scrollTop=ie.scrollHeight-ie.clientHeight,I.current=Math.max(M,ze)}else P.style.bottom="0",I.current=Math.max(M,ze),ie.scrollTop=Pe;if(Te){const F=ee.top,he=ee.height,s=Te.top+Te.height/2,p=he>0?(s-F)/he*100:50,E=gs(p,0,100);V.style.setProperty("--transform-origin",`50% ${E}%`)}(I.current===Se||ze>=te)&&(N.current=!0),S(),setTimeout(()=>{L.current=!0})}finally{ye()}})}},[c,X,P,se,u,g,l,S,b,j,Q,A,O,H]),n.useEffect(()=>{if(!b||!P||!X)return;const V=hr(P);function ye(Z){k(!1,Ue(_n,Z))}return V.addEventListener("resize",ye),()=>{V.removeEventListener("resize",ye)}},[k,b,P,X]);const xe={...H?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":v||void 0,id:`${ae}-list`},onKeyDown(V){y.current=!0,$&&ga.has(V.key)&&V.stopPropagation()},onMouseMove(){y.current=!1},onPointerLeave(V){if(!C||un(V)||V.pointerType==="touch")return;const ye=V.currentTarget;J.start(0,()=>{c.set("activeIndex",null),ye.focus({preventScroll:!0})})},onScroll(V){H||w.current?.(V.currentTarget)},...b&&{style:H?{height:"100%"}:us}},ke=qe("div",r,{ref:[a,l],state:z,stateAttributesMapping:xs,props:[Y,xe,Ca(U),{className:!H&&b?Rr.className:void 0},i]});return t.jsxs(n.Fragment,{children:[!pe&&Rr.getElement(q),t.jsx(fa,{context:_,modal:!1,disabled:!ue,restoreFocus:!0,children:ke})]})});function Ir(e){const r=e.maxHeight||"";return r.endsWith("px")&&parseFloat(r)||1/0}const Mr={transform:"none",scale:"1",translate:"0 0"};function ys(e,r,a){a?e.setProperty(r,a):e.removeProperty(r)}function bs(e){const{style:r}=e,a={},o=Object.keys(Mr);for(const d of o)a[d]=r.getPropertyValue(d),r.setProperty(d,Mr[d]);return()=>{for(const d of o)ys(r,d,a[d])}}let gn=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function ks(e={}){const{label:r,metadata:a,textRef:o,indexGuessBehavior:d,index:i}=e,{register:c,unregister:l,subscribeMapChange:x,elementsRef:k,labelsRef:u,nextIndexRef:g}=ss(),y=n.useRef(-1),[v,S]=n.useState(i??(d===gn.GuessFromOrder?()=>{if(y.current===-1){const f=g.current;g.current+=1,y.current=f}return y.current}:-1)),w=n.useRef(null),C=n.useCallback(f=>{if(w.current=f,v!==-1&&f!==null&&(k.current[v]=f,u)){const R=r!==void 0;u.current[v]=R?r:o?.current?.textContent??f.textContent}},[v,k,u,r,o]);return ne(()=>{if(i!=null)return;const f=w.current;if(f)return c(f,a),()=>{l(f)}},[i,c,l,a]),ne(()=>{if(i==null)return x(f=>{const R=w.current?f.get(w.current)?.index:null;R!=null&&S(R)})},[i,x,S]),n.useMemo(()=>({ref:C,index:v}),[v,C])}const mn=n.createContext(void 0);function fr(){const e=n.useContext(mn);if(!e)throw new Error(ot(57));return e}const Pt=n.memo(n.forwardRef(function(r,a){const{render:o,className:d,value:i=null,label:c,disabled:l=!1,nativeButton:x=!1,...k}=r,u=n.useRef(null),g=ks({label:c,textRef:u,indexGuessBehavior:gn.GuessFromOrder}),{store:y,getItemProps:v,setOpen:S,setValue:w,selectionRef:C,typingRef:f,valuesRef:R,keyboardActiveRef:b,multiple:j,highlightItemOnHover:A}=rt(),O=at(),$=W(y,B.isActive,g.index),_=W(y,B.isSelected,g.index,i),q=W(y,B.isSelectedByFocus,g.index),pe=W(y,B.isItemEqualToValue),J=g.index,ae=J!==-1,X=n.useRef(null),ue=Qe(J);ne(()=>{if(!ae)return;const T=R.current;return T[J]=i,()=>{delete T[J]}},[ae,J,i,R]),ne(()=>{if(!ae)return;const T=y.state.value;let z=T;j&&Array.isArray(T)&&T.length>0&&(z=T[T.length-1]),z!==void 0&&ft(z,i,pe)&&y.set("selectedIndex",J)},[ae,J,j,pe,y,i]);const Y=n.useMemo(()=>({disabled:l,selected:_,highlighted:$}),[l,_,$]),U=v({active:$,selected:_});U.onFocus=void 0,U.id=void 0;const se=n.useRef(null),P=n.useRef("mouse"),H=n.useRef(!1),{getButtonProps:I,buttonRef:N}=ar({disabled:l,focusableWhenDisabled:!0,native:x});function fe(T){const z=y.state.value;if(j){const xe=Array.isArray(z)?z:[],ke=_?Ga(xe,i,pe):[...xe,i];w(ke,Ue(Bt,T))}else w(i,Ue(Bt,T)),S(!1,Ue(Bt,T))}const L={role:"option","aria-selected":_,tabIndex:$?0:-1,onFocus(){y.set("activeIndex",J)},onMouseEnter(){!b.current&&y.state.selectedIndex===null&&y.set("activeIndex",J)},onMouseMove(){A&&y.set("activeIndex",J)},onMouseLeave(T){!A||b.current||un(T)||O.start(0,()=>{y.state.activeIndex===J&&y.set("activeIndex",null)})},onTouchStart(){C.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(T){se.current=T.key,y.set("activeIndex",J)},onClick(T){H.current=!1,!(T.type==="keydown"&&se.current===null)&&(l||se.current===" "&&f.current||P.current!=="touch"&&!$||(se.current=null,fe(T.nativeEvent)))},onPointerEnter(T){P.current=T.pointerType},onPointerDown(T){P.current=T.pointerType,H.current=!0},onMouseUp(T){if(l)return;if(H.current){H.current=!1;return}const z=!C.current.allowSelectedMouseUp&&_,xe=!C.current.allowUnselectedMouseUp&&!_;z||xe||P.current!=="touch"&&!$||fe(T.nativeEvent)}},le=qe("div",r,{ref:[N,a,g.ref,X],state:Y,props:[U,L,k,I]}),Q=n.useMemo(()=>({selected:_,indexRef:ue,textRef:u,selectedByFocus:q,hasRegistered:ae}),[_,ue,u,q,ae]);return t.jsx(mn.Provider,{value:Q,children:le})})),_t=n.forwardRef(function(r,a){const o=r.keepMounted??!1,{selected:d}=fr();return o||d?t.jsx(ws,{...r,ref:a}):null}),ws=n.memo(n.forwardRef((e,r)=>{const{render:a,className:o,keepMounted:d,...i}=e,{selected:c}=fr(),l=n.useRef(null),{transitionStatus:x,setMounted:k}=or(c),u=n.useMemo(()=>({selected:c,transitionStatus:x}),[c,x]),g=qe("span",e,{ref:[r,l],state:u,props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:sr});return At({open:c,ref:l,onComplete(){c||k(!1)}}),g})),Ot=n.memo(n.forwardRef(function(r,a){const{indexRef:o,textRef:d,selectedByFocus:i,hasRegistered:c}=fr(),{selectedItemTextRef:l}=rt(),{className:x,render:k,...u}=r,g=n.useCallback(v=>{if(!v||!c)return;const S=l.current===null||!l.current.isConnected;(i||S&&o.current===0)&&(l.current=v)},[l,o,i,c]);return qe("div",r,{ref:[g,a,d],props:u})})),vs=n.forwardRef(function(r,a){const{render:o,className:d,id:i,...c}=r,{store:l}=ma(),x=Et(i);return l.useSyncedValueWithCleanup("descriptionElementId",x),qe("p",r,{ref:a,props:[{id:x},c]})});function Er({open:e,title:r,description:a,confirmLabel:o,cancelLabel:d,destructive:i=!1,busy:c=!1,onConfirm:l,onCancel:x}){return t.jsx(ha,{open:e,onOpenChange:k=>{!k&&!c&&x?.()},children:t.jsxs(pa,{children:[t.jsx(xa,{className:"fixed inset-0 z-[100] bg-black/40 backdrop-blur-[2px] transition-opacity duration-200 ease-out data-[ending-style]:opacity-0 data-[starting-style]:opacity-0"}),t.jsx(ya,{className:"fixed inset-0 z-[101] flex items-center justify-center p-4",children:t.jsxs(ba,{className:"relative w-full max-w-md rounded-2xl bg-white p-6 shadow-[0_20px_60px_-20px_rgba(0,0,0,0.25)] ring-1 ring-oai-gray-200 transition-[opacity,transform] duration-[220ms] ease-[cubic-bezier(0.16,1,0.3,1)] data-[ending-style]:translate-y-2 data-[ending-style]:scale-[0.96] data-[ending-style]:opacity-0 data-[starting-style]:translate-y-2 data-[starting-style]:scale-[0.96] data-[starting-style]:opacity-0 dark:bg-oai-gray-950 dark:shadow-[0_20px_60px_-10px_rgba(0,0,0,0.65)] dark:ring-oai-gray-800",children:[t.jsx(ka,{className:"text-base font-semibold text-oai-black dark:text-white",children:r}),a?t.jsx(vs,{className:"mt-2 text-sm leading-6 text-oai-gray-600 dark:text-oai-gray-300",children:a}):null,t.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[t.jsx(He,{type:"button",variant:"secondary",size:"sm",disabled:c,onClick:()=>x?.(),children:d}),t.jsx(He,{type:"button",size:"sm",disabled:c,onClick:()=>l?.(),className:Ye(i&&"!bg-red-600 hover:!bg-red-700 focus-visible:!outline-red-600 dark:!bg-red-600 dark:hover:!bg-red-500"),children:o})]})]})})]})})}function hn({id:e,value:r,onChange:a,placeholder:o,disabled:d=!1,type:i="text",label:c,error:l,className:x="",...k}){const u=n.useId(),g=e||u,y=l?`${g}-error`:void 0,C=`w-full bg-oai-white dark:bg-oai-gray-900 border border-oai-gray-300 dark:border-oai-gray-700 rounded-md text-oai-black dark:text-oai-white placeholder-oai-gray-400 dark:placeholder-oai-gray-500 transition-all duration-200 focus:outline-none focus:border-oai-brand dark:focus:border-oai-brand focus:ring-1 focus:ring-oai-brand/30 ${d?"bg-oai-gray-50 dark:bg-oai-gray-800 text-oai-gray-400 dark:text-oai-gray-400 cursor-not-allowed":""} ${l?"border-oai-error focus:border-oai-error focus:ring-oai-error/30":""} h-10 px-3 text-sm ${x}`;return t.jsxs("div",{className:"w-full",children:[c&&t.jsx("label",{htmlFor:g,className:"block text-sm font-medium text-oai-gray-700 dark:text-oai-gray-300 mb-1.5 transition-colors duration-200",children:c}),t.jsx("input",{id:g,type:i,value:r,onChange:a,placeholder:o,disabled:d,"aria-invalid":l?!0:void 0,"aria-describedby":y,className:C,...k}),l&&t.jsx("p",{id:y,className:"mt-1.5 text-sm text-oai-error",children:l})]})}const js="tt:hint:dismissed:";function pn(e){return js+e}function Ns(e){if(typeof window>"u")return!1;try{return window.localStorage.getItem(pn(e))==="1"}catch{return!1}}function Ss({id:e,children:r,className:a,ariaLabel:o}){const[d,i]=n.useState(()=>Ns(e)),c=n.useCallback(()=>{if(typeof window<"u")try{window.localStorage.setItem(pn(e),"1")}catch{}i(!0)},[e]);return d?null:t.jsxs("div",{role:"note","aria-label":o||m("hint.dismissible_aria"),className:Ye("relative rounded-lg border border-oai-gray-200 bg-oai-gray-50 px-4 py-3 text-sm text-oai-gray-700","dark:border-oai-gray-800 dark:bg-oai-gray-900/40 dark:text-oai-gray-300",a),children:[t.jsx("button",{type:"button",onClick:c,"aria-label":m("hint.dismiss"),className:"absolute top-2 right-2 inline-flex h-7 w-7 items-center justify-center rounded-md text-oai-gray-500 transition-colors hover:bg-oai-gray-200/70 hover:text-oai-gray-700 focus:outline-none focus:ring-2 focus:ring-oai-blue/30 dark:text-oai-gray-400 dark:hover:bg-oai-gray-800/70 dark:hover:text-oai-gray-200",children:t.jsx(vt,{className:"h-4 w-4","aria-hidden":"true"})}),t.jsxs("div",{className:"flex items-start gap-2 pr-8",children:[t.jsx(Ur,{className:"mt-0.5 h-4 w-4 shrink-0 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":"true"}),t.jsx("div",{className:"min-w-0 flex-1",children:r})]})]})}let Tr=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.indeterminate="data-indeterminate",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});function xn(e){return n.useMemo(()=>({checked(r){return e.indeterminate?{}:r?{[Tr.checked]:""}:{[Tr.unchecked]:""}},...cr}),[e.indeterminate])}const Cs=n.createContext({disabled:!1});function Rs(){return n.useContext(Cs)}const Is=n.createContext(void 0);function Ms(e=!0){const r=n.useContext(Is);if(r===void 0&&!e)throw new Error(ot(3));return r}const yn=n.createContext(void 0);function Es(){const e=n.useContext(yn);if(e===void 0)throw new Error(ot(14));return e}const Ts="data-parent",Ps=n.forwardRef(function(r,a){const{checked:o,className:d,defaultChecked:i=!1,disabled:c=!1,id:l,indeterminate:x=!1,inputRef:k,name:u,onCheckedChange:g,parent:y=!1,readOnly:v=!1,render:S,required:w=!1,uncheckedValue:C,value:f,nativeButton:R=!1,...b}=r,{clearErrors:j}=ur(),{disabled:A,name:O,setDirty:$,setFilled:_,setFocused:q,setTouched:pe,state:J,validationMode:ae,validityData:X,shouldValidateOnChange:ue,validation:Y}=Dt(),U=Rs(),{labelId:se,controlId:P,setControlId:H,getDescriptionProps:I}=dr(),N=Ms(),fe=N?.parent,L=fe&&N.allValues,le=A||U.disabled||N?.disabled||c,Q=O??u,T=f??Q,z=Et(),xe=Et();let ke=P;L?ke=y?xe:`${fe.id}-${T}`:l&&(ke=l);let V={};L&&(y?V=N.parent.getParentProps():T&&(V=N.parent.getChildProps(T)));const ye=Ce(g),{checked:Z=o,indeterminate:ge=x,onCheckedChange:we,...be}=V,K=N?.value,ee=N?.setValue,ve=N?.defaultValue,oe=n.useRef(null),{getButtonProps:ie,buttonRef:Me}=ar({disabled:le,native:R}),ce=N?.validation??Y,[h,D]=Qt({controlled:T&&K&&!y?K.includes(T):Z,default:T&&ve&&!y?ve.includes(T):i,name:"Checkbox",state:"checked"});ne(()=>{if(H!==We)return H(ke),()=>{H(void 0)}},[ke,N,H,y]),en({enabled:!N,id:z,commit:ce.commit,value:h,controlRef:oe,name:Q,getValue:()=>h});const M=n.useRef(null),te=nr(k,M,ce.inputRef);ne(()=>{M.current&&(M.current.indeterminate=ge,h&&_(!0))},[h,ge,_]),tn(h,()=>{N&&!y||(j(Q),_(h),$(h!==X.initialValue),ue()?ce.commit(h):ce.commit(h,!0))});const re=rr({checked:h,disabled:le,name:y?void 0:Q,id:R?void 0:ke??void 0,required:w,ref:te,style:Q?Lr:Vr,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(je){if(je.nativeEvent.defaultPrevented)return;const Ee=je.target.checked,Te=Ue(Lt,je.nativeEvent);if(we?.(Ee,Te),ye(Ee,Te),!Te.isCanceled&&(D(Ee),T&&K&&ee&&!y)){const Ve=Ee?[...K,T]:K.filter(_e=>_e!==T);ee(Ve,Te)}},onFocus(){oe.current?.focus()}},f!==void 0?{value:(N?h&&f:f)||""}:Mt,I,N?ce.getValidationProps:ce.getInputValidationProps),me=L?!!Z:h,Ne=L&&ge||x;n.useEffect(()=>{fe&&T&&fe.disabledStatesRef.current.set(T,le)},[fe,le,T]);const Se=n.useMemo(()=>({...J,checked:me,disabled:le,readOnly:v,required:w,indeterminate:Ne}),[J,me,le,v,w,Ne]),Fe=xn(Se),Re=qe("span",r,{state:Se,ref:[Me,oe,a,N?.registerControlRef],props:[{id:R?ke??void 0:z,role:"checkbox","aria-checked":ge?"mixed":h,"aria-readonly":v||void 0,"aria-required":w||void 0,"aria-labelledby":se,[Ts]:y?"":void 0,onFocus(){q(!0)},onBlur(){const je=M.current;je&&(pe(!0),q(!1),ae==="onBlur"&&ce.commit(N?K:je.checked))},onClick(je){v||le||(je.preventDefault(),M.current?.click())}},I,ce.getValidationProps,b,be,ie],stateAttributesMapping:Fe});return t.jsxs(yn.Provider,{value:Se,children:[Re,!h&&!N&&Q&&!y&&C!==void 0&&t.jsx("input",{type:"hidden",name:Q,value:C}),t.jsx("input",{...re})]})}),_s=n.forwardRef(function(r,a){const{render:o,className:d,keepMounted:i=!1,...c}=r,l=Es(),x=l.checked||l.indeterminate,{transitionStatus:k,setMounted:u}=or(x),g=n.useRef(null),y=n.useMemo(()=>({...l,transitionStatus:k}),[l,k]);At({open:x,ref:g,onComplete(){x||u(!1)}});const v=xn(l),S=n.useMemo(()=>({...v,...sr,...cr}),[v]),w=i||x,C=qe("span",r,{enabled:w,ref:[a,g],state:y,stateAttributesMapping:S,props:c});return w?C:null});function Os(e,r){return`target:${e}:${r}`}function As(e){return`remove:${e.id||e.directory}`}function bn(e){if(!e)return null;const r=new Date(e).getTime();return Number.isFinite(r)?Math.floor((Date.now()-r)/864e5):null}function Ls(e){const r=bn(e);if(r==null)return null;if(r<=0)return m("skills.usage.today");if(r<30)return m("skills.usage.days_ago",{days:r});const a=Math.max(1,Math.floor(r/30));return m("skills.usage.months_ago",{months:a})}function Vs(e){const r=bn(e);return r==null?"bg-oai-gray-300 dark:bg-oai-gray-600":r<=7?"bg-emerald-500":r<=30?"bg-amber-500":"bg-oai-gray-300 dark:bg-oai-gray-600"}function Kt({label:e,children:r}){return t.jsxs("div",{className:"flex items-center justify-between gap-3 py-2 text-sm",children:[t.jsx("dt",{className:"flex items-center gap-1 text-oai-gray-500 dark:text-oai-gray-400",children:e}),t.jsx("dd",{className:"text-right font-medium tabular-nums text-oai-black dark:text-white",children:r})]})}function Ds({skill:e,targets:r,busyKey:a,usage:o,hasUpdate:d,updating:i,onUpdate:c,onClose:l,onToggleTarget:x,onRemove:k}){return t.jsx(On,{children:e?t.jsx(Us,{skill:e,targets:r,busyKey:a,usage:o,hasUpdate:d,updating:i,onUpdate:c,onClose:l,onToggleTarget:x,onRemove:k},e.id||e.directory):null})}function Us({skill:e,targets:r,busyKey:a,usage:o,hasUpdate:d,updating:i,onUpdate:c,onClose:l,onToggleTarget:x,onRemove:k}){const u=An(),{currency:g,rate:y}=wa(),v=n.useRef(null);n.useEffect(()=>{const O=_=>{_.key==="Escape"&&(_.stopPropagation(),l?.())},$=_=>{const q=_.target;q instanceof Element&&(v.current?.contains(q)||q.closest('[data-skill-row="1"]')||l?.())};return document.addEventListener("keydown",O),document.addEventListener("mousedown",$),()=>{document.removeEventListener("keydown",O),document.removeEventListener("mousedown",$)}},[l]);const S=e.name||e.directory,w=!!(e.repoOwner&&e.repoName),C=w?`https://github.com/${e.repoOwner}/${e.repoName}`:null,f=new Set(e.targets||[]),R=a===As(e),b=Ls(o?.lastUsedAt),j=!!(o&&o.invocations>0),A=u?{duration:0}:{type:"spring",stiffness:320,damping:30,mass:.7};return t.jsxs(t.Fragment,{children:[t.jsx(pr.div,{className:"fixed inset-0 z-20 bg-oai-black/30 backdrop-blur-[2px] lg:hidden",initial:u?!1:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:u?0:.15},onClick:l,"aria-hidden":!0}),t.jsxs(pr.aside,{ref:v,role:"complementary","aria-label":S,initial:u?!1:{opacity:0,x:24,scale:.98},animate:{opacity:1,x:0,scale:1},exit:u?{opacity:0}:{opacity:0,x:24,scale:.98},transition:A,className:"fixed inset-x-3 bottom-3 top-20 z-30 flex flex-col overflow-hidden rounded-2xl border border-white/40 bg-white/75 shadow-[0_24px_60px_-20px_rgba(15,23,42,0.25)] backdrop-blur-xl backdrop-saturate-150 supports-[backdrop-filter]:bg-white/65 dark:border-white/10 dark:bg-oai-gray-950/70 dark:shadow-[0_24px_60px_-20px_rgba(0,0,0,0.7)] dark:supports-[backdrop-filter]:bg-oai-gray-950/55 lg:inset-auto lg:right-6 lg:top-24 lg:bottom-6 lg:w-[22rem] lg:max-h-[calc(100vh-7.5rem)]",children:[t.jsxs("header",{className:"flex items-center gap-3 border-b border-white/40 bg-gradient-to-b from-white/30 to-transparent px-5 pb-4 pt-5 dark:border-white/10 dark:from-white/[0.04]",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("h2",{className:"truncate text-base font-semibold text-oai-black dark:text-white",title:S,children:S}),w?t.jsxs("a",{href:C,target:"_blank",rel:"noreferrer noopener",className:"mt-1 inline-flex max-w-full items-center gap-1 truncate text-xs text-oai-gray-500 transition-colors hover:text-oai-black hover:underline dark:text-oai-gray-400 dark:hover:text-white",title:C,children:[t.jsxs("span",{className:"truncate",children:[e.repoOwner,"/",e.repoName]}),t.jsx(Xt,{className:"h-3 w-3 shrink-0","aria-hidden":!0})]}):e.directory&&e.directory!==S?t.jsx("div",{className:"mt-1 truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",title:e.directory,children:e.directory}):null]}),t.jsx("button",{type:"button",onClick:l,"aria-label":m("skills.detail.close"),className:"-mr-1 inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-oai-gray-500 transition hover:bg-oai-gray-100 hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:text-oai-gray-400 dark:hover:bg-oai-gray-800 dark:hover:text-white",children:t.jsx(vt,{className:"h-4 w-4","aria-hidden":!0})})]}),t.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 py-5",children:[d?t.jsxs("div",{className:"mb-4 flex items-center gap-3 rounded-xl bg-sky-50/80 px-3 py-2.5 ring-1 ring-sky-200 dark:bg-sky-950/30 dark:ring-sky-800/60",children:[t.jsx(Wr,{className:"h-4 w-4 shrink-0 text-sky-600 dark:text-sky-300","aria-hidden":!0}),t.jsx("span",{className:"min-w-0 flex-1 text-xs text-sky-800 dark:text-sky-200",children:m("skills.update.available")}),t.jsxs("button",{type:"button",onClick:()=>c?.(e),disabled:i,className:"inline-flex h-7 shrink-0 items-center gap-1 rounded-md bg-sky-600 px-2.5 text-xs font-semibold text-white transition hover:bg-sky-700 focus:outline-none focus:ring-2 focus:ring-sky-400/40 disabled:cursor-not-allowed disabled:opacity-60 dark:bg-sky-500 dark:hover:bg-sky-400",children:[i?t.jsx(Xe,{className:"h-3 w-3 animate-spin","aria-hidden":!0}):null,m("skills.update.action")]})]}):null,e.description?t.jsx("p",{className:"text-sm leading-6 text-oai-gray-600 dark:text-oai-gray-300",children:e.description}):null,t.jsxs("section",{className:"mt-6",children:[t.jsx("h3",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-400",children:m("skills.usage.section_title")}),t.jsxs("dl",{className:"divide-y divide-oai-gray-200/60 dark:divide-white/[0.06]",children:[t.jsx(Kt,{label:m("skills.usage.invocations"),children:Ln(o?.invocations||0)}),t.jsx(Kt,{label:m("skills.usage.last_used"),children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsx("span",{className:Ye("h-1.5 w-1.5 rounded-full",Vs(o?.lastUsedAt)),"aria-hidden":!0}),j?b||m("skills.usage.unknown"):m("skills.usage.never")]})}),t.jsx(Kt,{label:t.jsxs(t.Fragment,{children:[m("skills.usage.cost"),t.jsx("span",{title:m("skills.usage.disclaimer"),className:"inline-flex cursor-help text-oai-gray-400 dark:text-oai-gray-500",children:t.jsx(Ur,{className:"h-3 w-3","aria-label":m("skills.usage.disclaimer")})})]}),children:Vn(o?.cost||0,{currency:g,rate:y})})]}),j?null:t.jsx("p",{className:"mt-2 text-[11px] leading-4 text-oai-gray-400 dark:text-oai-gray-500",children:m("skills.usage.unused")})]}),t.jsxs("section",{className:"mt-6",children:[t.jsx("h3",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-400",children:m("skills.detail.sync_section_title")}),t.jsx("div",{children:(r||[]).map(O=>{const $=f.has(O.id),_=a===Os(e.id,O.id),q=`skill-detail-sync-${e.id||e.directory}-${O.id}`;return t.jsxs("label",{htmlFor:q,className:"-mx-2 flex cursor-pointer items-center gap-3 rounded-md px-2 py-2 text-sm text-oai-black transition-colors hover:bg-oai-gray-100/70 dark:text-white dark:hover:bg-white/[0.05]",children:[t.jsx(Ps,{id:q,checked:$,disabled:_,onCheckedChange:pe=>x?.(e,O.id,!!pe),className:"peer flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border border-oai-gray-300/80 bg-white/80 shadow-sm transition-colors hover:border-oai-gray-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-gray-400/40 focus-visible:ring-offset-1 focus-visible:ring-offset-transparent disabled:cursor-not-allowed disabled:opacity-50 data-[checked]:border-oai-black data-[checked]:bg-oai-black dark:border-oai-gray-500/60 dark:bg-oai-gray-900/60 dark:hover:border-oai-gray-400 dark:data-[checked]:border-white dark:data-[checked]:bg-white",children:t.jsx(_s,{className:"flex items-center justify-center text-white dark:text-oai-black",children:t.jsx(ut,{className:"h-3 w-3",strokeWidth:3.5,"aria-hidden":!0})})}),t.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center","aria-hidden":!0,children:t.jsx(st,{provider:O.id,size:16})}),t.jsx("span",{className:"flex-1",children:O.label}),_?t.jsx(Xe,{className:"h-3.5 w-3.5 animate-spin text-oai-gray-400","aria-hidden":!0}):null]},O.id)})})]})]}),t.jsxs("footer",{className:"border-t border-white/40 bg-white/30 px-5 py-4 dark:border-white/10 dark:bg-white/[0.02]",children:[t.jsxs("button",{type:"button",onClick:()=>k?.(e),disabled:R,className:"inline-flex w-full items-center justify-center gap-2 rounded-lg border border-red-200/70 bg-white px-3 py-2 text-sm font-medium text-red-600 transition hover:border-red-300 hover:bg-red-50 focus:outline-none focus:ring-2 focus:ring-red-400/30 disabled:cursor-not-allowed disabled:opacity-60 dark:border-red-900/60 dark:bg-oai-gray-950 dark:text-red-300 dark:hover:border-red-800 dark:hover:bg-red-950/30",children:[R?t.jsx(Xe,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":!0}):t.jsx(lr,{className:"h-3.5 w-3.5","aria-hidden":!0}),m("skills.detail.remove_button")]}),t.jsx("p",{className:"mt-2 text-center text-[11px] text-oai-gray-500 dark:text-oai-gray-400",children:m("skills.detail.remove_confirm_hint")})]})]})]})}const Fs=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),Wt=["claude","codex"],$e="popular",Bs={claude:"text-orange-500 dark:text-orange-300",codex:"text-emerald-600 dark:text-emerald-300",grok:"text-zinc-700 dark:text-zinc-200",antigravity:"text-violet-600 dark:text-violet-300",gemini:"text-sky-600 dark:text-sky-300",opencode:"text-amber-600 dark:text-amber-300",hermes:"text-indigo-500 dark:text-indigo-300"},Ze="all",De="skillssh";function er(e){return`${e.repoOwner||"local"}/${e.repoName||"local"}:${e.directory}`}function It(e){return`install:${er(e)}`}function Pr(e){return`remove:${e.id||e.directory}`}function kn(e,r){return`target:${e}:${r}`}function $s({target:e,state:r,busy:a,onToggle:o}){const d=r==="synced",i=r==="orphan",c=i?m("skills.dot.orphan_aria",{agent:e.label}):d?m("skills.dot.synced_aria",{agent:e.label}):m("skills.dot.off_aria",{agent:e.label});return t.jsxs("button",{type:"button",title:c,"aria-label":c,"aria-pressed":d,disabled:a,onClick:l=>{l.stopPropagation(),o?.(e.id,!d)},className:"relative flex h-7 w-7 items-center justify-center rounded-md transition-colors hover:bg-oai-gray-100 focus:outline-none focus:ring-2 focus:ring-oai-gray-400/40 disabled:cursor-not-allowed dark:hover:bg-oai-gray-800/60",children:[a?t.jsx(Xe,{className:"h-4 w-4 animate-spin text-oai-gray-400","aria-hidden":!0}):t.jsx("span",{className:Ye("flex h-[18px] w-[18px] items-center justify-center transition",d&&Bs[e.id],!d&&!i&&"opacity-35 grayscale"),"aria-hidden":!0,children:t.jsx(st,{provider:e.id,size:18})}),i&&!a?t.jsx("span",{className:"absolute -bottom-px -right-px h-2 w-2 rounded-full bg-amber-500 ring-2 ring-oai-white dark:ring-oai-gray-900","aria-hidden":!0}):null]})}function Hs({skill:e,targets:r,onToggleTarget:a,busyKey:o}){return t.jsx("div",{className:"flex items-center gap-1",onClick:d=>d.stopPropagation(),children:r.map(d=>t.jsx($s,{target:d,state:e.targetStates?.[d.id]||"off",busy:o===kn(e.id,d.id),onToggle:(i,c)=>a?.(e,i,c)},d.id))})}function zs({skill:e,targets:r,selected:a,onSelect:o,selectable:d,checked:i,onToggleSelect:c,onToggleTarget:l,hasUpdate:x,busyKey:k}){const u=e.repoOwner&&e.repoName?`${e.repoOwner}/${e.repoName}`:null,g=u?`${e.directory} · ${u}`:e.directory,y=v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),o?.(e))};return t.jsxs("div",{"data-skill-row":"1",role:"button",tabIndex:0,"aria-pressed":a,"aria-label":m("skills.row.open_details",{name:e.name||e.directory}),onClick:()=>o?.(e),onKeyDown:y,className:Ye("cursor-pointer rounded-md py-3 pr-2 transition focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30",a?"bg-oai-gray-100 ring-1 ring-oai-gray-200 dark:bg-oai-gray-800/60 dark:ring-oai-gray-800":i?"bg-oai-gray-50 dark:bg-oai-gray-900/40":"hover:bg-oai-gray-50 dark:hover:bg-oai-gray-900/40"),children:[t.jsxs("div",{className:"flex items-center gap-3",children:[d?t.jsx("label",{className:"flex shrink-0 items-center",onClick:v=>v.stopPropagation(),children:t.jsx("input",{type:"checkbox",checked:i,onChange:v=>c?.(e,v.target.checked),"aria-label":m("skills.select.row_aria",{name:e.name||e.directory}),className:"h-4 w-4 rounded border-oai-gray-300 text-oai-black focus:ring-oai-gray-400 dark:border-oai-gray-600 dark:bg-oai-gray-900 dark:text-white"})}):null,t.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-oai-black dark:text-white",title:g,children:e.name||e.directory}),x?t.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-sky-50 px-1.5 py-0.5 text-[10px] font-semibold text-sky-700 ring-1 ring-sky-200 dark:bg-sky-950/40 dark:text-sky-300 dark:ring-sky-800/60",children:[t.jsx(Wr,{className:"h-2.5 w-2.5","aria-hidden":!0}),m("skills.update.badge")]}):null,t.jsx(Hs,{skill:e,targets:r,onToggleTarget:l,busyKey:k}),t.jsx(Ra,{className:Ye("hidden h-4 w-4 shrink-0 text-oai-gray-300 transition-colors dark:text-oai-gray-600 lg:block",a&&"text-oai-gray-500 dark:text-oai-gray-300"),"aria-hidden":!0})]}),e.description?t.jsx("p",{className:Ye("mt-1 line-clamp-2 text-xs text-oai-gray-500 dark:text-oai-gray-400",d&&"pl-7"),children:e.description}):null]})}function Ks({agentFilter:e,agentOptions:r,onAgentFilter:a,filteredCount:o,totalCount:d,anyFilter:i,onClearFilters:c}){return t.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2 pt-1 text-xs text-oai-gray-600 dark:text-oai-gray-300",children:[t.jsxs(rn,{value:e,onValueChange:a,children:[t.jsxs(nn,{"aria-label":m("skills.filter.agent_label"),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 bg-oai-white px-2.5 text-xs font-medium text-oai-gray-700 transition hover:border-oai-gray-300 focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 data-[popup-open]:border-oai-gray-300 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-oai-gray-200 dark:hover:border-oai-gray-700",children:[t.jsxs("span",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:[m("skills.filter.agent_label"),":"]}),t.jsx(an,{children:l=>l==="all"?m("skills.filter.agent_all"):r.find(x=>x.id===l)?.label||l}),t.jsx(sn,{className:"text-oai-gray-400",children:t.jsx(ir,{className:"h-3.5 w-3.5","aria-hidden":!0})})]}),t.jsx(on,{children:t.jsx(dn,{sideOffset:4,alignItemWithTrigger:!1,className:"z-[60]",children:t.jsxs(fn,{className:"min-w-[var(--anchor-width)] overflow-hidden rounded-md border border-oai-gray-200 bg-white p-1 shadow-[0_12px_32px_-12px_rgba(0,0,0,0.18)] outline-none dark:border-oai-gray-800 dark:bg-oai-gray-950 dark:shadow-[0_12px_32px_-12px_rgba(0,0,0,0.6)]",children:[t.jsxs(Pt,{value:"all",className:"flex cursor-default select-none items-center justify-between gap-2 rounded px-3 py-1.5 text-sm text-oai-black outline-none data-[highlighted]:bg-oai-gray-100 dark:text-white dark:data-[highlighted]:bg-oai-gray-800",children:[t.jsx(Ot,{children:m("skills.filter.agent_all")}),t.jsx(_t,{children:t.jsx(ut,{className:"h-3.5 w-3.5","aria-hidden":!0})})]}),r.map(l=>t.jsxs(Pt,{value:l.id,className:"flex cursor-default select-none items-center justify-between gap-2 rounded px-3 py-1.5 text-sm text-oai-black outline-none data-[highlighted]:bg-oai-gray-100 dark:text-white dark:data-[highlighted]:bg-oai-gray-800",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(st,{provider:l.id,size:14}),t.jsx(Ot,{children:l.label})]}),t.jsx(_t,{children:t.jsx(ut,{className:"h-3.5 w-3.5","aria-hidden":!0})})]},l.id))]})})})]}),t.jsx("span",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:m("skills.filter.result_count",{filtered:o,total:d})}),i?t.jsxs("button",{type:"button",onClick:c,className:"ml-auto inline-flex h-7 items-center gap-1 rounded-full bg-oai-gray-100 px-2.5 text-[11px] font-medium text-oai-gray-700 transition hover:bg-oai-gray-200 focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:bg-oai-gray-800/70 dark:text-oai-gray-200 dark:hover:bg-oai-gray-700",children:[t.jsx(vt,{className:"h-3 w-3","aria-hidden":!0}),m("skills.filter.clear")]}):null]})}function Ws({count:e,targets:r,busy:a,onBulkSync:o,onBulkRemove:d,onClear:i}){return t.jsxs("div",{role:"toolbar","aria-label":m("skills.select.toolbar_aria"),className:"mb-2 flex flex-wrap items-center gap-2 rounded-lg border border-oai-gray-200 bg-oai-gray-50 px-3 py-2 dark:border-oai-gray-800 dark:bg-oai-gray-900/50",children:[t.jsx("span",{className:"text-xs font-medium text-oai-gray-700 dark:text-oai-gray-200","aria-live":"polite",children:m("skills.select.count",{count:e})}),t.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[t.jsxs(Fr,{children:[t.jsxs(Br,{disabled:a,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 bg-oai-white px-2.5 text-xs font-medium text-oai-gray-700 transition hover:border-oai-gray-300 focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 disabled:opacity-60 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-oai-gray-200",children:[t.jsx(Kr,{className:"h-3.5 w-3.5","aria-hidden":!0}),m("skills.select.bulk_sync"),t.jsx(ir,{className:"h-3 w-3","aria-hidden":!0})]}),t.jsx($r,{children:t.jsx(Hr,{sideOffset:6,side:"bottom",align:"end",className:"!z-[80]",children:t.jsxs(zr,{className:"min-w-[200px] rounded-lg bg-white p-1.5 shadow-lg ring-1 ring-oai-gray-200 dark:bg-oai-gray-950 dark:ring-oai-gray-800",children:[t.jsx("div",{className:"px-2 pb-1 pt-0.5 text-[11px] font-medium uppercase tracking-wide text-oai-gray-500 dark:text-oai-gray-400",children:m("skills.select.bulk_sync_hint")}),r.map(c=>t.jsxs("button",{type:"button",onClick:()=>o(c.id),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-oai-black hover:bg-oai-gray-100 dark:text-white dark:hover:bg-oai-gray-800",children:[t.jsx(st,{provider:c.id,size:16}),t.jsx("span",{className:"flex-1",children:c.label})]},c.id))]})})})]}),t.jsxs(He,{type:"button",variant:"ghost",size:"sm",disabled:a,onClick:d,children:[t.jsx(lr,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),m("skills.select.bulk_remove")]}),t.jsxs("button",{type:"button",onClick:i,className:"inline-flex h-7 items-center gap-1 rounded-full px-2 text-[11px] font-medium text-oai-gray-500 transition hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:text-oai-gray-400 dark:hover:text-white",children:[t.jsx(vt,{className:"h-3 w-3","aria-hidden":!0}),m("skills.select.clear")]})]})]})}function qs({items:e,totalCount:r,targets:a,agentOptions:o,agentFilter:d,onAgentFilter:i,anyFilter:c,onClearFilters:l,selectedId:x,onSelect:k,onToggleTarget:u,busyKey:g,updates:y,selectedIds:v,onToggleSelect:S,onClearSelection:w,onBulkSync:C,onBulkRemove:f}){const R=v.size;return t.jsxs("div",{children:[R>0?t.jsx(Ws,{count:R,targets:a,busy:g==="batch",onBulkSync:C,onBulkRemove:f,onClear:w}):t.jsx(Ks,{agentFilter:d,agentOptions:o,onAgentFilter:i,filteredCount:e.length,totalCount:r,anyFilter:c,onClearFilters:l}),e.length===0?t.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-lg border border-dashed border-oai-gray-200 px-4 py-10 text-center text-sm text-oai-gray-500 dark:border-oai-gray-800 dark:text-oai-gray-400",children:[t.jsx("p",{children:m("skills.empty.no_match")}),t.jsx(He,{type:"button",variant:"secondary",size:"sm",onClick:l,children:m("skills.filter.clear")})]}):t.jsx("div",{className:"divide-y divide-oai-gray-200/70 dark:divide-oai-gray-800/70",children:e.map(b=>t.jsx(zs,{skill:b,targets:a,selected:x===(b.id||b.directory),onSelect:k,selectable:!0,checked:v.has(b.id),onToggleSelect:S,onToggleTarget:u,hasUpdate:!!(b.id&&y?.[b.id]),busyKey:g},b.id||b.key))})]})}const Gs={contentVisibility:"auto",containIntrinsicSize:"0 240px"},Ys=Wn.memo(function({skill:r,installed:a,installing:o,allTargets:d,defaultTargets:i,onInstall:c,onManage:l}){const[x,k]=n.useState(()=>(i||[]).filter(w=>d.some(C=>C.id===w))),u=w=>{k(C=>C.includes(w)?C.filter(f=>f!==w):[...C,w])},g=r.repoOwner&&r.repoName?`${r.repoOwner}/${r.repoName}`:null,y=g?`https://github.com/${r.repoOwner}/${r.repoName}`:null,v=r.installs!=null?m("skills.card.installs",{count:Number(r.installs||0).toLocaleString()}):null,S=x.length?x.map(w=>d.find(C=>C.id===w)?.label||w).join(", "):m("skills.action.choose_targets");return t.jsxs(Jn,{className:"h-full rounded-lg",bodyClassName:"flex h-full flex-col",children:[t.jsx("div",{className:"flex items-start justify-between gap-3",children:t.jsxs("div",{className:"min-w-0",children:[r.readmeUrl?t.jsxs("a",{href:r.readmeUrl,target:"_blank",rel:"noopener noreferrer",className:"group inline-flex max-w-full items-center gap-1 truncate text-base font-semibold text-oai-black hover:underline dark:text-white",title:r.readmeUrl,children:[t.jsx("span",{className:"truncate",children:r.name||r.directory}),t.jsx(Xt,{className:"h-3.5 w-3.5 shrink-0 text-oai-gray-400 opacity-0 transition-opacity group-hover:opacity-100","aria-hidden":!0})]}):t.jsx("h2",{className:"truncate text-base font-semibold text-oai-black dark:text-white",children:r.name||r.directory}),g||v?t.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-1.5 truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:[y?t.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",onClick:w=>w.stopPropagation(),className:"inline-flex items-center gap-1 truncate rounded text-oai-gray-500 hover:text-oai-black hover:underline focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:text-oai-gray-400 dark:hover:text-white",title:y,children:[t.jsx("span",{className:"truncate",children:g}),t.jsx(Xt,{className:"h-2.5 w-2.5 shrink-0","aria-hidden":!0})]}):null,g&&v?t.jsx("span",{"aria-hidden":!0,children:"·"}):null,v?t.jsx("span",{className:"truncate",children:v}):null]}):null]})}),r.description?t.jsx("p",{className:"mt-3 line-clamp-3 text-sm leading-6 text-oai-gray-600 dark:text-oai-gray-300",children:r.description}):null,t.jsx("div",{className:"mt-auto pt-5",children:a?t.jsxs(He,{type:"button",variant:"secondary",size:"sm",onClick:()=>l?.(r),className:"w-full",children:[t.jsx(ut,{className:"mr-1.5 h-3.5 w-3.5 text-emerald-500 dark:text-emerald-400","aria-hidden":!0}),m("skills.card.manage")]}):t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1 text-xs text-oai-gray-600 dark:text-oai-gray-300",children:[t.jsx("span",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:m("skills.card.targets_prefix")}),t.jsx("span",{className:"min-w-0 truncate font-medium text-oai-black dark:text-white",children:x.length?S:m("skills.target.none")}),t.jsxs(Fr,{children:[t.jsx(Br,{disabled:o,"aria-label":m("skills.action.choose_targets"),className:"rounded text-xs font-medium text-oai-gray-500 underline decoration-oai-gray-300 decoration-dotted underline-offset-2 transition hover:text-oai-black hover:decoration-oai-gray-500 focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 disabled:cursor-not-allowed disabled:opacity-60 dark:text-oai-gray-400 dark:decoration-oai-gray-600 dark:hover:text-white dark:hover:decoration-oai-gray-400",children:m("skills.card.targets_change")}),t.jsx($r,{children:t.jsx(Hr,{sideOffset:6,side:"bottom",align:"end",className:"!z-[80]",children:t.jsxs(zr,{className:"min-w-[220px] rounded-lg bg-white p-1.5 shadow-lg ring-1 ring-oai-gray-200 dark:bg-oai-gray-950 dark:ring-oai-gray-800",children:[t.jsx("div",{className:"px-2 pb-1 pt-0.5 text-[11px] font-medium uppercase tracking-wide text-oai-gray-500 dark:text-oai-gray-400",children:m("skills.target.menu_label")}),d.map(w=>{const C=x.includes(w.id);return t.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm text-oai-black hover:bg-oai-gray-100 dark:text-white dark:hover:bg-oai-gray-800",children:[t.jsx("input",{type:"checkbox",className:"h-4 w-4 shrink-0 rounded border-oai-gray-300 text-oai-black focus:ring-oai-gray-400 dark:border-oai-gray-600 dark:bg-oai-gray-900 dark:text-white",checked:C,onChange:()=>u(w.id)}),t.jsx(st,{provider:w.id,size:16}),t.jsx("span",{className:"flex-1 text-left",children:w.label})]},w.id)})]})})})]})]}),t.jsxs(He,{type:"button",size:"sm",onClick:()=>c(r,x),disabled:o||x.length===0,className:"w-full",children:[o?t.jsx(Xe,{className:"mr-1.5 h-3.5 w-3.5 animate-spin","aria-hidden":!0}):t.jsx(Kr,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),m("skills.action.install")]})]})})]})});function Xs({repos:e,repoInput:r,onRepoInput:a,busyKey:o,onAdd:d,onRemove:i}){return t.jsxs("div",{className:"rounded-lg border border-oai-gray-200 bg-white p-4 dark:border-oai-gray-800 dark:bg-oai-gray-950",children:[t.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[t.jsx(hn,{value:r,onChange:c=>a(c.target.value),placeholder:m("skills.repo.placeholder"),className:"min-w-0 flex-1"}),t.jsxs(He,{type:"button",variant:"secondary",size:"md",onClick:d,disabled:o==="repo:add",className:"shrink-0 whitespace-nowrap",children:[o==="repo:add"?t.jsx(Xe,{className:"mr-1.5 h-4 w-4 animate-spin","aria-hidden":!0}):t.jsx(qr,{className:"mr-1.5 h-4 w-4","aria-hidden":!0}),m("skills.repo.add")]})]}),e.length?t.jsx("div",{className:"mt-3 divide-y divide-oai-gray-200/70 dark:divide-oai-gray-800/70",children:e.map(c=>{const l=o===`repo:${c.owner}/${c.name}`;return t.jsxs("div",{className:"flex items-center justify-between gap-3 py-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"truncate text-sm font-medium text-oai-black dark:text-white",children:[c.owner,"/",c.name]}),t.jsx("div",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400",children:c.branch})]}),t.jsxs(He,{type:"button",variant:"ghost",size:"sm",disabled:l,onClick:()=>i(c),className:"shrink-0",children:[l?t.jsx(Xe,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":!0}):t.jsx(lr,{className:"h-3.5 w-3.5","aria-hidden":!0}),t.jsx("span",{className:"sr-only",children:m("skills.repo.remove")})]})]},`${c.owner}/${c.name}`)})}):null]})}function Qs(){return typeof window>"u"?"my":new URLSearchParams(window.location.search).get("tab")==="browse"?"browse":"my"}function co(){const[e,r]=n.useState(Qs),[a,o]=n.useState({skills:[],targets:[]}),[d,i]=n.useState([]),[c,l]=n.useState([]),[x,k]=n.useState([]),[u,g]=n.useState(Ze),[y,v]=n.useState(""),[S,w]=n.useState(""),[C,f]=n.useState(""),[R,b]=n.useState(!1),[j,A]=n.useState("all"),[O,$]=n.useState(null),[_,q]=n.useState(""),[pe,J]=n.useState(!0),[ae,X]=n.useState(!1),[ue,Y]=n.useState(""),[U,se]=n.useState(null),[P,H]=n.useState(null),[I,N]=n.useState(()=>new Set),[fe,L]=n.useState({}),[le,Q]=n.useState({}),[T,z]=n.useState([]),[xe,ke]=n.useState(!1),V=n.useRef(!1),ye=n.useMemo(()=>{const s=new Set;for(const p of a.skills||[]){s.add(er(p).toLowerCase()),p.repoOwner&&p.repoName&&s.add(`${p.repoOwner}/${p.repoName}:${p.sourceDirectory||p.directory}`.toLowerCase());const E=String(p.directory||"").split(/[\\/]/).pop().toLowerCase();E&&s.add(`dir:${E}`)}return s},[a.skills]),Z=n.useCallback(async()=>{const s=await Dn();o({skills:s.skills||[],targets:s.targets||[]})},[]),ge=n.useCallback(async()=>{const s=await Un();k(s.repos||[])},[]),we=n.useCallback(async({force:s=!1}={})=>{X(!0);try{const p=await Fn({force:s});i(p.skills||[])}finally{X(!1)}},[]),be=n.useCallback(async({force:s=!1}={})=>{ke(!0);try{const p=await Bn({force:s});z(p.skills||[])}finally{ke(!1)}},[]),K=n.useCallback(async()=>{try{const s=await $n();L(s?.updates||{})}catch{L({})}},[]),ee=n.useCallback(async()=>{try{const s=await Hn(),p={};for(const E of s?.skills||[])E.installed&&(E.directory&&(p[String(E.directory).toLowerCase()]=E),p[String(E.skill).toLowerCase()]=E);Q(p)}catch{Q({})}},[]),ve=n.useCallback(async()=>{J(!0),Y("");try{await Promise.all([Z(),ge()])}catch(s){Y(s?.message||m("skills.error.generic"))}finally{J(!1)}},[Z,ge]),oe=n.useCallback(async()=>{await ve();const s=p=>Y(p?.message||m("skills.error.generic"));e==="my"?(K(),ee()):u===$e?be({force:!0}).catch(s):u!==De&&we({force:!0}).catch(s)},[we,ve,be,K,ee,u,e]);n.useEffect(()=>{ve()},[ve]),n.useEffect(()=>{if(V.current||typeof window>"u")return;const s=new URLSearchParams(window.location.search),p=s.get("skill");if(!p){V.current=!0;return}const E=a.skills||[];if(!E.length)return;const G=E.find(Ie=>Ie.directory===p||Ie.id===p);G&&(r("my"),$(G.id||G.directory)),V.current=!0,s.delete("skill");const Oe=s.toString();window.history.replaceState({},"",`${window.location.pathname}${Oe?`?${Oe}`:""}${window.location.hash}`)},[a.skills]),n.useEffect(()=>{e==="browse"&&(u===De||u===$e||d.length===0&&we().catch(s=>Y(s?.message||m("skills.error.generic"))))},[d.length,we,u,e]),n.useEffect(()=>{e!=="browse"||u!==$e||T.length===0&&be().catch(s=>Y(s?.message||m("skills.error.generic")))},[be,T.length,u,e]);const ie=Object.keys(fe).length>0,Me=Object.keys(le).length>0;if(n.useEffect(()=>{e==="my"&&(ie||K(),Me||ee())},[e,ie,Me,K,ee]),n.useEffect(()=>{const s=setTimeout(()=>w(y),200);return()=>clearTimeout(s)},[y]),n.useEffect(()=>{if(typeof window>"u")return;const s=new URLSearchParams(window.location.search),p=s.get("tab");if(e==="my"){if(!p)return;s.delete("tab")}else{if(p===e)return;s.set("tab",e)}const E=s.toString(),G=`${window.location.pathname}${E?`?${E}`:""}${window.location.hash}`;window.history.replaceState({},"",G)},[e]),!Fs&&!zn())return t.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:t.jsx(Qn,{})});const ce=async(s,p)=>{q(s),Y("");try{await p(),await Z()}catch(E){Y(E?.message||m("skills.error.generic"))}finally{q("")}},h=(s,p)=>{const E=(p&&p.length?p:Wt).filter(G=>(a.targets||[]).some(Oe=>Oe.id===G));ce(It(s),async()=>{await yr(s,E);const G=E.map(Oe=>(a.targets||[]).find(Ie=>Ie.id===Oe)?.label||Oe).join(", ");ct({title:m("skills.toast.installed",{name:s.name||s.directory,targets:G||m("skills.target.none")}),timeout:4e3})})},D=s=>{se(s)},M=()=>{const s=U;s&&(se(null),ce(Pr(s),async()=>{let p=null;s.managed?p=await br(s.id):await kr(s.directory,s.targets||[]);const E=!!(p?.trashed&&s.managed&&s.id);ct({title:m("skills.toast.removed",{name:s.name||s.directory}),timeout:6e3,data:E?{onUndo:async()=>{try{await Gn(s.id),await Z()}catch(G){Y(G?.message||m("skills.error.generic"))}}}:void 0})}))},te=(s,p,E)=>ce(kn(s.id,p),async()=>{const G=new Set(s.targets||[]);E?G.add(p):G.delete(p),s.managed?await wr(s.id,Array.from(G)):await vr(s.directory,Array.from(G));const Oe={name:s.name||s.directory,agent:Ne(p)};ct({title:E?m("skills.toast.synced_one",Oe):m("skills.toast.unsynced_one",Oe),timeout:3e3})}),re=n.useCallback(()=>N(new Set),[]),me=n.useCallback((s,p)=>{N(E=>{const G=new Set(E);return p?G.add(s.id):G.delete(s.id),G})},[]),Ne=s=>(a.targets||[]).find(p=>p.id===s)?.label||s,Se=s=>{const p=(a.skills||[]).filter(E=>I.has(E.id));p.length&&ce("batch",async()=>{for(const E of p){const G=new Set(E.targets||[]);G.add(s),E.managed?await wr(E.id,Array.from(G)):await vr(E.directory,Array.from(G))}re(),ct({title:m("skills.toast.bulk_synced",{count:p.length,agent:Ne(s)}),timeout:4e3})})},Fe=()=>{const s=(a.skills||[]).filter(p=>I.has(p.id));s.length&&H(s)},Re=()=>{const s=P;s&&(H(null),ce("batch",async()=>{for(const p of s)p.managed?await br(p.id):await kr(p.directory,p.targets||[]);re(),ct({title:m("skills.toast.bulk_removed",{count:s.length}),timeout:4e3})}))},je=s=>{!s?.repoOwner||!s?.repoName||ce(It(s),async()=>{await yr({key:s.key,name:s.name,description:s.description,directory:s.sourceDirectory||s.directory,repoOwner:s.repoOwner,repoName:s.repoName,repoBranch:s.repoBranch,readmeUrl:s.readmeUrl},s.targets&&s.targets.length?s.targets:Wt),await K(),ct({title:m("skills.toast.updated",{name:s.name||s.directory}),timeout:4e3})})},Ee=async()=>{const s=y.trim();if(!(s.length<2)){q("search"),Y("");try{const p=await qn(s);l(p.skills||[])}catch(p){Y(p?.message||m("skills.error.generic"))}finally{q("")}}},Te=async()=>{const s=C.trim().replace(/^https:\/\/github\.com\//,"").replace(/\.git$/,""),[p,E]=s.split("/");if(!p||!E){Y(m("skills.repo.invalid"));return}await ce("repo:add",async()=>{await Xn({owner:p,name:E,branch:"main",enabled:!0}),f(""),await ge(),await we()})},Ve=async s=>{await ce(`repo:${s.owner}/${s.name}`,async()=>{await Yn(s.owner,s.name),await ge(),await we()})},_e=a.targets||[],Be=a.skills||[],ze=n.useMemo(()=>j==="all"?Be:Be.filter(s=>(s.targets||[]).includes(j)),[Be,j]),gt=j!=="all",Pe=n.useMemo(()=>O&&Be.find(s=>(s.id||s.directory)===O)||null,[Be,O]),Je=n.useCallback(()=>{A("all")},[]),it=n.useCallback(s=>{$(p=>{const E=s?.id||s?.directory||null;return p===E?null:E})},[]),nt=n.useCallback(()=>$(null),[]),lt=n.useCallback(s=>{const p=String(s.directory||"").split(/[\\/]/).pop().toLowerCase(),E=(a.skills||[]).find(G=>String(G.directory||"").toLowerCase()===p);E&&$(E.id||E.directory)},[a.skills]);n.useEffect(()=>{e!=="my"&&I.size&&N(new Set)},[e,I.size]),n.useEffect(()=>{O&&!Pe&&$(null)},[Pe,O]);const Ge=n.useMemo(()=>{const s=u===De?c:u===$e?T:d,E=u===De||u===$e||u===Ze?s:s.filter(Ie=>`${Ie.repoOwner}/${Ie.repoName}`===u),G=S.trim().toLowerCase();return(u===De||!G?E:E.filter(Ie=>(Ie.name||"").toLowerCase().includes(G)||(Ie.directory||"").toLowerCase().includes(G)||(Ie.description||"").toLowerCase().includes(G))).map(Ie=>{const Ut=er(Ie).toLowerCase(),Ke=String(Ie.directory||"").split(/[\\/]/).pop().toLowerCase(),jt=Ke?`dir:${Ke}`:"";return{...Ie,installed:ye.has(Ut)||jt&&ye.has(jt)}})},[S,d,ye,T,c,u]),mt=t.jsx("div",{className:"flex h-64 items-center justify-center",children:t.jsx(Xe,{className:"h-8 w-8 animate-spin text-oai-gray-400","aria-hidden":!0})}),ht=t.jsxs("div",{className:"flex h-64 flex-col items-center justify-center gap-3 px-6 text-center",children:[t.jsx(Xe,{className:"h-8 w-8 animate-spin text-oai-gray-400","aria-hidden":!0}),t.jsx("p",{className:"max-w-md text-xs text-oai-gray-500 dark:text-oai-gray-400",children:m("skills.browse.loading_hint")})]}),F=(s,p=null)=>t.jsxs("div",{className:"flex flex-col items-center gap-4 rounded-lg border border-dashed border-oai-gray-200 px-4 py-10 text-center text-sm text-oai-gray-500 dark:border-oai-gray-800 dark:text-oai-gray-400",children:[t.jsx("p",{children:m(s)}),p]});let he;if(pe)he=mt;else if(e==="my")he=Be.length?t.jsx(qs,{items:ze,totalCount:Be.length,targets:_e,agentOptions:_e,agentFilter:j,onAgentFilter:A,anyFilter:gt,onClearFilters:Je,selectedId:O,onSelect:it,onToggleTarget:te,busyKey:_,updates:fe,selectedIds:I,onToggleSelect:me,onClearSelection:re,onBulkSync:Se,onBulkRemove:Fe}):t.jsxs("div",{className:"flex flex-col items-center gap-4 rounded-lg border border-dashed border-oai-gray-200 px-4 py-10 text-center dark:border-oai-gray-800",children:[_e.length>0?t.jsxs("div",{className:"relative h-11 w-80 overflow-hidden","aria-hidden":!0,children:[t.jsx("div",{className:"pointer-events-none absolute inset-0",style:{maskImage:"linear-gradient(to right, transparent 8%, black 20%, black 32%, transparent 44%, transparent 56%, black 68%, black 80%, transparent 92%)",WebkitMaskImage:"linear-gradient(to right, transparent 8%, black 20%, black 32%, transparent 44%, transparent 56%, black 68%, black 80%, transparent 92%)"},children:t.jsx("div",{className:"absolute inset-y-0 left-0 flex w-max items-center animate-marquee-x",style:{filter:"blur(2.5px)"},children:[..._e,..._e].map((s,p)=>t.jsx("span",{className:"shrink-0 px-3",children:t.jsx(st,{provider:s.id,size:30})},`b-${p}`))})}),t.jsx("div",{className:"pointer-events-none absolute inset-0",style:{maskImage:"linear-gradient(to right, transparent 28%, black 42%, black 58%, transparent 72%)",WebkitMaskImage:"linear-gradient(to right, transparent 28%, black 42%, black 58%, transparent 72%)"},children:t.jsx("div",{className:"absolute inset-y-0 left-0 flex w-max items-center animate-marquee-x",children:[..._e,..._e].map((s,p)=>t.jsx("span",{className:"shrink-0 px-3",children:t.jsx(st,{provider:s.id,size:30})},`c-${p}`))})}),t.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 w-20 bg-gradient-to-r from-oai-white to-transparent dark:from-oai-gray-900"}),t.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 w-20 bg-gradient-to-l from-oai-white to-transparent dark:from-oai-gray-900"})]}):null,t.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:m("skills.empty.my")}),t.jsx(He,{type:"button",size:"sm",onClick:()=>r("browse"),children:m("skills.empty.my_cta")})]});else{const s=u===De,p=u===$e,E=x.length===0&&!s&&!p,G=ae&&!s&&!p||p&&xe,Oe=!s&&!p&&(S.trim()!==""||u!==Ze),Ie=()=>{v(""),g(Ze)},Ut=!E&&!G&&(Ge.length>0||Oe)?t.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2 px-1 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:[t.jsx("span",{children:m("skills.filter.result_count_browse",{count:Ge.length})}),Oe?t.jsxs("button",{type:"button",onClick:Ie,className:"ml-auto inline-flex h-7 items-center gap-1 rounded-full bg-oai-gray-100 px-2.5 text-[11px] font-medium text-oai-gray-700 transition hover:bg-oai-gray-200 focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:bg-oai-gray-800/70 dark:text-oai-gray-200 dark:hover:bg-oai-gray-700",children:[t.jsx(vt,{className:"h-3 w-3","aria-hidden":!0}),m("skills.filter.clear")]}):null]}):null;let Ke;E?Ke=t.jsx("div",{className:"rounded-lg border border-dashed border-oai-gray-200 p-6 text-center dark:border-oai-gray-800",children:t.jsx("p",{className:"text-sm text-oai-gray-600 dark:text-oai-gray-300",children:m("skills.browse.empty_sources")})}):G?Ke=ht:s&&y.trim().length<2?Ke=t.jsx("div",{className:"rounded-lg border border-dashed border-oai-gray-200 px-4 py-6 text-center text-sm text-oai-gray-500 dark:border-oai-gray-800 dark:text-oai-gray-400",children:m("skills.browse.hint_skillssh")}):Ge.length?Ke=t.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",children:Ge.map(pt=>t.jsx("div",{style:Gs,children:t.jsx(Ys,{skill:pt,installed:!!pt.installed,installing:_===It(pt),allTargets:_e,defaultTargets:Wt,onInstall:h,onManage:lt})},pt.id||pt.key))}):Oe?Ke=F("skills.empty.no_match",t.jsx(He,{type:"button",variant:"secondary",size:"sm",onClick:Ie,children:m("skills.filter.clear")})):s?Ke=F("skills.empty.search"):p?Ke=F("skills.empty.popular"):Ke=F("skills.empty.browse");const jt=E||R?t.jsx("div",{className:"mb-5",children:t.jsx(Xs,{repos:x,repoInput:C,onRepoInput:f,busyKey:_,onAdd:Te,onRemove:Ve})}):null,wn=!R&&!s&&!p&&x.length<=1&&Ge.length>0?t.jsx(Ss,{id:"skills-browse-intro",className:"mt-6",children:t.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[t.jsx("span",{children:m("skills.browse.add_repo_hint")}),t.jsx("button",{type:"button",onClick:()=>b(!0),className:"rounded font-medium text-oai-gray-700 underline decoration-dotted underline-offset-2 transition hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:text-oai-gray-200 dark:hover:text-white",children:m("skills.browse.manage_sources")})]})}):null;he=t.jsxs(t.Fragment,{children:[jt,Ut,Ke,wn]})}return t.jsxs("div",{className:"flex flex-1 flex-col font-oai text-oai-black antialiased dark:text-oai-white",children:[t.jsx("main",{className:"flex-1 pb-12 pt-8 sm:pb-16 sm:pt-10",children:t.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[t.jsxs("div",{className:"mb-6 flex items-end justify-between gap-4",children:[t.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:m("skills.page.title")}),t.jsxs(He,{type:"button",variant:"secondary",size:"sm",onClick:oe,disabled:pe||ae||xe,children:[t.jsx(Kn,{className:Ye("mr-1.5 h-3.5 w-3.5",(pe||ae||xe)&&"animate-spin"),"aria-hidden":!0}),m("skills.action.refresh")]})]}),t.jsx("div",{className:"mb-5 flex gap-6 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[["my",m("skills.tab.my")],["browse",m("skills.tab.browse")]].map(([s,p])=>t.jsx("button",{type:"button","aria-pressed":e===s,onClick:()=>r(s),className:Ye("-mb-px border-b-2 pb-2 text-sm font-medium transition-colors",e===s?"border-oai-black text-oai-black dark:border-white dark:text-white":"border-transparent text-oai-gray-500 hover:text-oai-black dark:text-oai-gray-400 dark:hover:text-white"),children:p},s))}),ue?t.jsx("div",{className:"mb-4 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-200",children:ue}):null,e==="browse"?t.jsxs("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-center",children:[t.jsx("div",{role:"tablist","aria-label":m("skills.source.label"),className:"inline-flex h-10 shrink-0 items-center rounded-md border border-oai-gray-200 bg-oai-white p-1 dark:border-oai-gray-800 dark:bg-oai-gray-900",children:[["repo",m("skills.mode.repo"),u!==De&&u!==$e],["popular",m("skills.mode.popular"),u===$e],["skillssh",m("skills.mode.skillssh"),u===De]].map(([s,p,E])=>t.jsxs("button",{type:"button",role:"tab","aria-selected":E,onClick:()=>{s==="skillssh"?g(De):s==="popular"?g($e):(u===De||u===$e)&&g(Ze)},className:Ye("inline-flex items-center gap-1.5 rounded px-3 py-1 text-sm font-medium transition-colors",E?"bg-oai-gray-100 text-oai-black dark:bg-oai-gray-700 dark:text-white":"text-oai-gray-500 hover:text-oai-gray-800 dark:text-oai-gray-400 dark:hover:text-oai-gray-200"),children:[s==="popular"?t.jsx(Ta,{className:"h-3.5 w-3.5","aria-hidden":!0}):null,p]},s))}),u!==De&&u!==$e?t.jsxs(rn,{value:u,onValueChange:g,children:[t.jsxs(nn,{"aria-label":m("skills.source.label"),className:"inline-flex h-10 w-44 shrink-0 items-center justify-between gap-2 rounded-md border border-oai-gray-200 bg-oai-white px-3 text-sm text-oai-black focus:outline-none data-[popup-open]:border-oai-gray-300 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-white dark:data-[popup-open]:border-oai-gray-700",children:[t.jsx(an,{children:s=>s===Ze?m("skills.source.all"):s}),t.jsx(sn,{className:"text-oai-gray-400",children:t.jsx(ir,{className:"h-4 w-4","aria-hidden":!0})})]}),t.jsx(on,{children:t.jsx(dn,{sideOffset:4,alignItemWithTrigger:!1,className:"z-[60]",children:t.jsxs(fn,{className:"min-w-[var(--anchor-width)] overflow-hidden rounded-md border border-oai-gray-200 bg-white p-1 shadow-[0_12px_32px_-12px_rgba(0,0,0,0.18)] outline-none transition-[opacity,transform] duration-150 ease-out data-[ending-style]:scale-[0.97] data-[ending-style]:opacity-0 data-[starting-style]:scale-[0.97] data-[starting-style]:opacity-0 dark:border-oai-gray-800 dark:bg-oai-gray-950 dark:shadow-[0_12px_32px_-12px_rgba(0,0,0,0.6)]",children:[t.jsxs(Pt,{value:Ze,className:"flex cursor-default select-none items-center justify-between gap-2 rounded px-3 py-1.5 text-sm text-oai-black outline-none data-[highlighted]:bg-oai-gray-100 dark:text-white dark:data-[highlighted]:bg-oai-gray-800",children:[t.jsx(Ot,{children:m("skills.source.all")}),t.jsx(_t,{children:t.jsx(ut,{className:"h-3.5 w-3.5","aria-hidden":!0})})]}),x.map(s=>{const p=`${s.owner}/${s.name}`;return t.jsxs(Pt,{value:p,className:"flex cursor-default select-none items-center justify-between gap-2 rounded px-3 py-1.5 text-sm text-oai-black outline-none data-[highlighted]:bg-oai-gray-100 dark:text-white dark:data-[highlighted]:bg-oai-gray-800",children:[t.jsx(Ot,{children:p}),t.jsx(_t,{children:t.jsx(ut,{className:"h-3.5 w-3.5","aria-hidden":!0})})]},p)})]})})})]}):null,t.jsxs("div",{className:"relative flex-1",children:[t.jsx(xr,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-oai-gray-400","aria-hidden":!0}),t.jsx(hn,{type:"search",value:y,onChange:s=>v(s.target.value),onKeyDown:s=>{s.key==="Enter"&&u===De&&Ee()},"aria-label":m("skills.action.search_aria"),placeholder:u===De?m("skills.browse.placeholder_skillssh"):u===$e?m("skills.browse.placeholder_popular"):u===Ze?m("skills.browse.placeholder_all"):m("skills.browse.placeholder_repo",{repo:u}),className:"pl-9 !border-oai-gray-200 dark:!border-oai-gray-800 focus:!border-oai-gray-400 focus:!ring-oai-gray-400/20 dark:focus:!border-oai-gray-500 dark:focus:!ring-oai-gray-500/20"})]}),u===De?t.jsxs(He,{type:"button",onClick:Ee,disabled:y.trim().length<2||_==="search",className:"focus:!ring-oai-gray-400/30",children:[_==="search"?t.jsx(Xe,{className:"mr-1.5 h-4 w-4 animate-spin","aria-hidden":!0}):t.jsx(xr,{className:"mr-1.5 h-4 w-4","aria-hidden":!0}),m("skills.action.search")]}):u===$e?null:t.jsxs(He,{type:"button",variant:"secondary",size:"sm",onClick:()=>b(s=>!s),"aria-expanded":R,className:"!h-10 shrink-0 whitespace-nowrap !border-oai-gray-200 dark:!border-oai-gray-800 hover:!border-oai-gray-300 dark:hover:!border-oai-gray-700 hover:!text-oai-black dark:hover:!text-white focus:!ring-oai-gray-400/30",children:[t.jsx(qr,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),m("skills.browse.manage_sources"),t.jsx("span",{className:"ml-1.5 rounded bg-oai-gray-100 px-1.5 py-0.5 text-xs font-medium text-oai-gray-600 dark:bg-oai-gray-800 dark:text-oai-gray-300",children:x.length})]})]}):null,he,t.jsx(Ds,{skill:Pe,targets:_e,busyKey:_,usage:Pe&&(le[String(Pe.directory||"").toLowerCase()]||le[String(Pe.name||"").toLowerCase()])||null,hasUpdate:!!(Pe?.id&&fe?.[Pe.id]),updating:Pe?_===It(Pe):!1,onUpdate:je,onClose:nt,onToggleTarget:te,onRemove:D})]})}),t.jsx(Er,{open:!!U,title:m("skills.confirm.remove_title",{name:U?.name||U?.directory||""}),description:U?U.managed?m("skills.confirm.remove_managed"):m("skills.confirm.remove_local"):"",confirmLabel:m("skills.action.remove"),cancelLabel:m("shared.action.cancel"),destructive:!0,busy:_===Pr(U||{}),onCancel:()=>se(null),onConfirm:M}),t.jsx(Er,{open:!!P,title:m("skills.confirm.bulk_remove_title",{count:P?.length||0}),description:m("skills.confirm.bulk_remove_desc"),confirmLabel:m("skills.action.remove"),cancelLabel:m("shared.action.cancel"),destructive:!0,busy:_==="batch",onCancel:()=>H(null),onConfirm:Re})]})}export{co as SkillsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c}from"./main-DdKVCJWa.js";const e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t=c("check",e);export{t as C};
|