import{_ as h,r as L,G as _,f as c,o as d,g as l,F as k,v as y,I as E,k as x,t as b}from"./index-5k_MqT6o.js";const C={class:"language-selector"},V={class:"language-options"},D=["onClick"],X={__name:"index",props:{languages:{type:Array,default:()=>[{code:"zh",name:"中文简体"},{code:"en",name:"英语"},{code:"zh-tw",name:"繁体"},{code:"pt",name:"葡萄牙语"},{code:"ja",name:"日语"},{code:"ko",name:"韩语"},{code:"th",name:"泰语"},{code:"id",name:"印度尼西亚语"},{code:"vi",name:"越南语"},{code:"pt-br",name:"巴西葡萄牙语"},{code:"hi",name:"印地语"},{code:"en-ph",name:"菲律宾英语"},{code:"en-in",name:"印度英语"},{code:"tl",name:"他加禄语"}]},modelValue:{type:String,default:"zh"},itemGap:{type:Number,default:24}},emits:["update:modelValue","language-change"],setup(r,{emit:p}){const i=p,v=e=>{i("update:modelValue",e.code),i("language-change",e)},u=L(null);return _(()=>{const e=u.value;if(!e)return;let n=!1,t,o;const m=a=>{n=!0,e.classList.add("dragging"),t=a.type.includes("mouse")?a.pageX:a.touches[0].pageX,o=e.scrollLeft},g=a=>{if(!n)return;a.preventDefault();const f=((a.type.includes("mouse")?a.pageX:a.touches[0].pageX)-t)*1.5;e.scrollLeft=o-f},s=()=>{n=!1,e.classList.remove("dragging")};e.addEventListener("mousedown",m),e.addEventListener("touchstart",m),e.addEventListener("mousemove",g),e.addEventListener("touchmove",g),e.addEventListener("mouseleave",s),e.addEventListener("mouseup",s),e.addEventListener("touchend",s)}),(e,n)=>(d(),c("div",C,[l("div",{class:"language-scroll-container",ref_key:"scrollContainer",ref:u},[l("div",V,[(d(!0),c(k,null,y(r.languages,t=>(d(),c("button",{key:t.code,class:E(["language-btn",{active:t.code===r.modelValue}]),onClick:o=>v(t)},[x(b(t.name)+" ",1),n[0]||(n[0]=l("span",{class:"active-indicator"},null,-1))],10,D))),128))])],512)]))}},B=h(X,[["__scopeId","data-v-9bd8db53"]]);export{B as L};
