import{y as b,u as L,b5 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 k,m as y,k as S,n as z,j as B,A as I,l as T,g as N,F as D,D as F,aq as P}from"./index-525d7e2b.js";import{u as $}from"./customizer-48bbb76f.js";import{_ as j}from"./_plugin-vue_export-helper-c27b6911.js";const K="/assets/astrbot_logo_mini-93eefda2.webp",q={class:"language-flag"},A=b({__name:"LanguageSwitcher",props:{variant:{default:"default"}},setup(m){const a=m,{t:g}=L(),{languageOptions:p,currentLanguage:E,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,M)=>(n(),u(P,{offset:"12",location:"bottom center"},{activator:e(({props:t})=>[o(k,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(y,{density:"compact",class:"pa-1"},{default:e(()=>[(n(!0),S(D,null,z(f.value,t=>(n(),u(B,{key:t.code,value:t.code,onClick:O=>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",q,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(A,[["__scopeId","data-v-d3b63aaf"]]);export{Q as L,K as _};
