import{_ as N}from"./wYUnCxqX.js";import{_ as S}from"./CuzaDH-7.js";import{_ as V}from"./CmvULbz4.js";import{d as $,u as F,r as P,o as t,c as a,w as h,a as o,n as j,b as n,e as s,t as c,f as r,F as g,g as b,i as D,h as L}from"./BvNnk7SS.js";const W=["onClick"],z={key:0,flex:"~ 1 gap2 items-center","of-hidden":"",truncate:""},A=["src","alt"],E={truncate:"",style:{direction:"rtl"},"leading-none":""},I={flex:"~ items-center gap2 justify-between",class:"n-badge"},O={key:2,"font-mono":""},R={flex:"~ 1 col","of-auto":""},U={truncate:""},q={key:0,flex:"~ items-center gap-2"},G=["src","alt"],H={"text-xs":"","font-light":"","font-mono":""},J={flex:"~ gap1","pt-2":"","mx--1":""},K=["n","onClick"],M={"font-mono":""},te=$({__name:"SourceSelector",props:{buttonClass:{}},setup(Q){const{currentBase:v,currentSource:i,setCurrentSource:k,sources:x}=L(),{currentProvider:u,providers:y}=F();function m(l){return y.value[l]}const _=P(!1);function C(l,f){k(l,f),_.value=!1}return(l,f)=>{const w=N,p=S,B=V;return t(),a(B,{modelValue:n(_),"onUpdate:modelValue":f[0]||(f[0]=e=>D(_)?_.value=e:null)},{trigger:h(({click:e})=>[o("button",{title:"Filter",flex:"~ gap2",border:"~ base rounded","w-full":"","items-center":"",py1:"","px2.5":"",class:j(l.buttonClass),onClick:d=>e()},[n(i)?(t(),s("div",z,[n(u)?.user?(t(),s("img",{key:0,src:n(u).user.avatar_url,alt:n(u).user.username,class:"of-h h-4 w-4 rounded-full"},null,8,A)):(t(),a(w,{key:1,name:n(u).logo,h4:"",w4:""},null,8,["name"])),o("div",E,c(n(i).displayName),1),o("div",I,[n(i).driver.startsWith("git")?(t(),a(p,{key:0,icon:"i-mdi-source-branch",class:"mb--0.5"})):r("",!0),n(i).driver==="opfs"?(t(),a(p,{key:1,icon:"i-mdi-folder-text",class:"mb--0.5"})):r("",!0),n(v)?(t(),s("div",O,c(n(v).name),1)):r("",!0)])])):r("",!0)],10,W)]),default:h(()=>[o("div",R,[(t(!0),s(g,null,b(n(x),e=>(t(),s("div",{key:e.name,flex:"~ 1 col","of-hidden":"","border-base":"",p2:"","border-b":"",mx2:"","last:border-none":""},[o("div",U,c(e.displayName),1),m(e.provider).user?(t(),s("div",q,[o("img",{src:m(e.provider).user.avatar_url,alt:m(e.provider).user.username,class:"of-h h-4 w-4 rounded-full"},null,8,G),o("div",H," @"+c(m(e.provider).user.username),1)])):r("",!0),o("div",J,[(t(!0),s(g,null,b(e.bases,d=>(t(),s("button",{key:d.name,flex:"~ items-center gap2 justify-between",class:"n-badge",n:e.name===n(i)?.name&&d.name===n(v)?.name?"green-500 hover:green-600":"hover:text-active",onClick:T=>C(e.name,d.name)},[e.driver.startsWith("git")?(t(),a(p,{key:0,icon:"i-mdi-source-branch"})):r("",!0),e.driver==="opfs"?(t(),a(p,{key:1,icon:"i-mdi-folder-text",class:"mb--0.5"})):r("",!0),o("div",M,c(d.name),1)],8,K))),128))])]))),128))])]),_:1},8,["modelValue"])}}});export{te as _};
