import{y as b,u as L,b9 as w,z as i,o as n,c as u,w as e,b as o,e as x,h as d,d as r,S as V,t as c,C,p as S,m as k,k as y,n as z,j as B,A as I,l as T,g as N,F as D,D as F,aS as P}from"./index-6dc81347.js";import{u as $}from"./customizer-b9c66778.js";import{_ as j}from"./_plugin-vue_export-helper-c27b6911.js";const K="/assets/astrbot_logo_mini-93eefda2.webp",A={class:"language-flag"},E=b({__name:"LanguageSwitcher",props:{variant:{default:"default"}},setup(m){const a=m,{t:g}=L(),{languageOptions:p,currentLanguage:M,switchLanguage:v,locale:_}=w(),f=i(()=>p.value.map(s=>({code:s.value,name:s.label,flag:s.flag}))),l=i(()=>_.value),h=async s=>{await v(s)};return(s,O)=>(n(),u(P,{offset:"12",location:"bottom center"},{activator:e(({props:t})=>[o(S,C(t,{variant:a.variant==="header"||a.variant==="chatbox"?"flat":"text",color:a.variant==="header"||a.variant==="chatbox"?"var(--v-theme-surface)":void 0,rounded:a.variant==="header"||a.variant==="chatbox"?"sm":void 0,icon:"",size:"small",class:["language-switcher",`language-switcher--${a.variant}`,a.variant==="header"||a.variant==="chatbox"?"action-btn":""]}),{default:e(()=>[o(x,{size:"18",color:a.variant==="default"?d($)().uiTheme==="PurpleTheme"?"#5e35b1":"#d7c5fa":void 0},{default:e(()=>[r(" mdi-translate ")]),_:1},8,["color"]),o(V,{activator:"parent",location:"top"},{default:e(()=>[r(c(d(g)("core.common.language")),1)]),_:1})]),_:2},1040,["variant","color","rounded","class"])]),default:e(()=>[o(F,{class:"language-dropdown",elevation:"8",rounded:"lg"},{default:e(()=>[o(k,{density:"compact",class:"pa-1"},{default:e(()=>[(n(!0),y(D,null,z(f.value,t=>(n(),u(B,{key:t.code,value:t.code,onClick:q=>h(t.code),class:I([{"v-list-item--active":l.value===t.code,"language-item-selected":l.value===t.code},"language-item"]),rounded:"md"},{prepend:e(()=>[T("span",A,c(t.flag),1)]),default:e(()=>[o(N,null,{default:e(()=>[r(c(t.name),1)]),_:2},1024)]),_:2},1032,["value","onClick","class"]))),128))]),_:1})]),_:1})]),_:1}))}});const Q=j(E,[["__scopeId","data-v-d3b63aaf"]]);export{Q as L,K as _};
