1import{Q as e,et as t,j as n,k as r,t as i}from"./jsx-runtime-9cNSj3Zb.js";import{_ as a,a as o,i as s,l as c,m as l,t as u}from"./createLucideIcon-BPrEZ9f6.js";var d={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};d.node;var f=u(d),p={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};p.node;var m=u(p),h=t(e(),1),g=i(),_=({src:e,alt:t,size:n})=>(0,g.jsx)(`img`,{src:e,alt:t,width:n,height:n,className:`shrink-0 rounded-full object-cover outline outline-1 -outline-offset-1 outline-white/10`}),v=({className:e,compact:t=!1})=>{let{locale:i,setLocale:u,messages:d}=s(),p=r(),v=n(),[y,b]=(0,h.useState)(!1),x=(0,h.useRef)(null),S=(0,h.useRef)(null),C=(0,h.useRef)(null),w=(0,h.useRef)([]),T=a.find(({code:e})=>e===i);(0,h.useEffect)(()=>{if(!y)return;let e=a.findIndex(({code:e})=>e===i),t=window.requestAnimationFrame(()=>{w.current[e]?.focus()}),n=e=>{x.current?.contains(e.target)||b(!1)},r=e=>{e.key===`Escape`&&(b(!1),S.current?.focus())},o=C.current,s=e=>{if(!o)return;let t=o.scrollTop<=0,n=Math.ceil(o.scrollTop+o.clientHeight)>=o.scrollHeight;(e.deltaY<0&&t||e.deltaY>0&&n)&&e.preventDefault(),e.stopPropagation()};return document.addEventListener(`pointerdown`,n),document.addEventListener(`keydown`,r),o?.addEventListener(`wheel`,s,{passive:!1}),()=>{window.cancelAnimationFrame(t),document.removeEventListener(`pointerdown`,n),document.removeEventListener(`keydown`,r),o?.removeEventListener(`wheel`,s)}},[y,i]);let E=e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),b(!0))},D=e=>{let t=w.current.indexOf(document.activeElement),n=null;e.key===`ArrowDown`?n=(t+1)%a.length:e.key===`ArrowUp`?n=(t-1+a.length)%a.length:e.key===`Home`?n=0:e.key===`End`&&(n=a.length-1),n!==null&&(e.preventDefault(),w.current[n]?.focus())},O=e=>{u(e);
1let t=o(p.pathname),n=c(t||e===`en`?p.pathname:`/`,e);v({pathname:n,search:t?p.search:``,hash:t?p.hash:``}),b(!1),window.requestAnimationFrame(()=>S.current?.focus())};return(0,g.jsxs)(`div`,{ref:x,className:l(`relative`,t?`inline-flex`:`w-full`,e),children:[(0,g.jsxs)(`button`,{ref:S,type:`button`,onClick:()=>b(e=>!e),onKeyDown:E,"aria-label":`${d.common.language}: ${T.nativeLabel}`,"aria-haspopup":`listbox`,"aria-expanded":y,title:d.common.language,className:l(`flex h-10 items-center text-[#d0d6e0] shadow-[inset_0_0_0_1px_rgba(255,255,255,0.09),0_6px_18px_rgba(0,0,0,0.16)] outline-none transition-[background-color,box-shadow,scale] hover:bg-white/[0.07] focus-visible:ring-2 focus-visible:ring-[#9da2ff] focus-visible:ring-offset-2 focus-visible:ring-offset-[#08090a] active:scale-[0.96]`,t?`gap-1.5 rounded-full bg-white/[0.045] px-2`:`w-full gap-3 rounded-lg bg-[#17181b] px-3 text-sm font-semibold`),children:[(0,g.jsx)(_,{src:T.flagSrc,alt:T.nativeLabel,size:t?24:26}),t?null:(0,g.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:T.nativeLabel}),(0,g.jsx)(m,{className:l(`h-3.5 w-3.5 shrink-0 text-[#8a8f98] transition-transform duration-200`,y?`rotate-180`:`rotate-0`),"aria-hidden":`true`})]}),y?(0,g.jsx)(`div`,{ref:C,role:`listbox`,"aria-label":d.common.language,onKeyDown:D,className:`absolute right-0 top-[calc(100%+0.5rem)] z-70 max-h-80 w-[min(18rem,calc(100vw-2rem))] touch-pan-y overflow-y-auto overscroll-y-contain rounded-lg bg-[#191a1b] p-1.5 text-[#d0d6e0] shadow-[inset_0_0_0_1px_rgba(255,255,255,0.11),0_24px_70px_rgba(0,0,0,0.52)] [-webkit-overflow-scrolling:touch] animate-in fade-in zoom-in-95 duration-150`,children:a.map(({code:e,nativeLabel:t,flagSrc:n},r)=>{let a=d.common.localeLabels[e],o=e===i;return(0,g.jsxs)(`button`,{ref:e=>{w.current[r]=e},type:`button`,role:`option`,"aria-selected":o,"aria-label":a,onClick:()=>O(e),className:l(`flex min-h-12 w-full items-center gap-3 rounded-md px-3 py-2 text-left outline-none transition-[background-color,color,scale] hover:bg-white/[0.06] focus-visible:bg-white/[0.08] focus-visible:text-white active:scale-[0.96]`,o?`bg-[#7170ff]/12 text-white`:`text-[#d0d6e0]`),children:[(0,g.jsx)(_,{src:n,alt:t,size:28}),(0,g.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,g.jsx)(`span`,{className:`block truncate text-sm font-semibold`,children:t}),a===t?null:(0,g.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-[#8a8f98]`,children:a})]}),(0,g.jsx)(f,{className:l(`h-4 w-4 shrink-0 text-[#9da2ff] transition-[opacity,scale,filter] duration-200`,o?`scale-100 opacity-100 blur-0`:`scale-25 opacity-0 blur-[4px]`),"aria-hidden":`true`})]},e)})}):null]})};export{m as n,f as r,v as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.