import{y as b,u as L,b2 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,R 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,as as P}from"./index-09e73aa7.js";import{u as $}from"./customizer-0abe5961.js";import{_ as j}from"./_plugin-vue_export-helper-c27b6911.js";const J="/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(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:R=>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 K=j(E,[["__scopeId","data-v-d3b63aaf"]]);export{K as L,J as _};
