import{jsxs as n,jsx as r,Fragment as m}from"react/jsx-runtime";import{U as u,V as h,B as g,W as f,X as s,j as w}from"./ui-components-B24mpb8o.js";import{usePage as N,router as a}from"@inertiajs/react";import{Globe as x,Check as j}from"lucide-react";const M=()=>{const{props:t}=N(),{system:c,direction:o,langs:i,locale:l}=t,d=()=>{a.post(route("change.direction"),{direction:o==="ltr"?"rtl":"ltr"})},p=e=>{a.post(route("change.lang"),{locale:e})};return n(u,{children:[r(h,{className:"cursor-pointer outline-none",children:r(g,{variant:"secondary",size:"icon",className:"relative h-9 w-9 rounded-full p-0",children:r(x,{className:"!h-5 !w-5"})})}),n(f,{align:"end",className:"w-[160px]",children:[c.fields.direction==="none"&&n(m,{children:[r(s,{className:"cursor-pointer justify-center px-3 uppercase",onClick:d,children:o==="ltr"?"RTL":"LTR"}),r(w,{className:"my-1"})]}),i.filter(e=>e.is_active).map(e=>n(s,{className:"cursor-pointer px-3",onClick:()=>p(e.code),children:[r("span",{children:e.name})," ",e.code===l&&r(j,{})]},e.id))]})]})};export{M as L};
