try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`7bd1582a-91e8-45d4-988d-d0d7919daa91`,e._sentryDebugIdIdentifier=`sentry-dbid-7bd1582a-91e8-45d4-988d-d0d7919daa91`)}catch{}import{o as e}from"./rolldown-runtime-eb2nym32.js";import{_ as t}from"./xds-react-components-lks62tbl.js";import{Ag as n,Eg as r,Fg as i,Wn as a,Xh as o,ch as s,dn as c,lh as l,or as u,sh as d,th as f,wg as p}from"./entry.client-dr7r6s9a.js";import{at as m}from"./xds-icons-d7khcnpi.js";import{t as h}from"./labels-k6t3mk4x.js";import{t as g}from"./languageTranslations-lqc1v57n.js";import{n as _}from"./classNames-ikl45qo7.js";import{t as v}from"./Section-kt29ebn0.js";import{t as y}from"./TabContentLayout-ltqqpnab.js";var b=i(),x=e(u(),1),S=n(),C=c(e=>{let n=(0,b.c)(21),{onLocaleSelect:r}=e,{t:i}=l(`SettingLanguagesTab`),a;n[0]===i?a=n[1]:(a=i(`All languages`,{shortKey:`all_languages_section_label`}),n[0]=i,n[1]=a);let s=a,c,u,d,f,p,m;if(n[2]!==s||n[3]!==i||n[4]!==r){let e=[...o].sort(w),a=e.length;p=v,m=s,c=`listbox`,u=s,n[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,x.default)(`text-noninteractive-content-primary-content`,_),n[11]=d):d=n[11],f=e.map((e,n)=>{let o=g(e,i);return(0,S.jsx)(t,{as:`button`,background:`invisible`,label1:h(e),label2:o,"aria-label":o,role:`option`,"aria-posinset":n+1,"aria-setsize":a,onPress:()=>r(e)},e)}),n[2]=s,n[3]=i,n[4]=r,n[5]=c,n[6]=u,n[7]=d,n[8]=f,n[9]=p,n[10]=m}else c=n[5],u=n[6],d=n[7],f=n[8],p=n[9],m=n[10];let y;n[12]!==c||n[13]!==u||n[14]!==d||n[15]!==f?(y=(0,S.jsx)(`div`,{role:c,"aria-label":u,className:d,children:f}),n[12]=c,n[13]=u,n[14]=d,n[15]=f,n[16]=y):y=n[16];let C;return n[17]!==p||n[18]!==m||n[19]!==y?(C=(0,S.jsx)(p,{label:m,children:y}),n[17]=p,n[18]=m,n[19]=y,n[20]=C):C=n[20],C},()=>{let{systems:{internationalization:{queries:{locale:e},mutations:{setLocale:t}}}}=f(),{data:n}=r(e.getOptions()),{trackUserAction:i}=s(),{mutate:a}=p(t.getOptions());return{onLocaleSelect:e=>{i(`LanguageList`,{oldValue:n,newValue:e},`Change`),a(e)}}});function w(e,t){return h(e).localeCompare(h(t))}var T=c(e=>{let t=(0,b.c)(25),{currentLocale:n}=e,{t:r}=l(`SettingLanguagesTab`),i;t[0]===r?i=t[1]:(i=r(`Your Language`,{shortKey:`your_language_section_label`}),t[0]=r,t[1]=i);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,x.default)(`flex justify-between px-component-item-list-container-padding-right-and-left py-component-item-list-container-padding-top-and-bottom text-noninteractive-content-primary-content`,_),t[2]=o):o=t[2];let s;t[3]===n?s=t[4]:(s=h(n),t[3]=n,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,S.jsx)(`span`,{"aria-hidden":`true`,className:`text-noninteractive-content-primary-content type-subtitle2`,children:s}),t[5]=s,t[6]=c);let u;t[7]!==n||t[8]!==r?(u=g(n,r),t[7]=n,t[8]=r,t[9]=u):u=t[9];let d;t[10]===u?d=t[11]:(d=(0,S.jsx)(`span`,{className:`text-noninteractive-content-secondary-content type-caption`,children:u}),t[10]=u,t[11]=d);let f;t[12]!==c||t[13]!==d?(f=(0,S.jsxs)(`div`,{className:`flex flex-col`,children:[c,d]}),t[12]=c,t[13]=d,t[14]=f):f=t[14];let p;t[15]===r?p=t[16]:(p=r(`Selected language`,{shortKey:`selected_language_indicator`}),t[15]=r,t[16]=p);let y;t[17]===p?y=t[18]:(y=(0,S.jsx)(a,{icon:(0,S.jsx)(m,{"aria-label":p,role:`img`}),size:`subtitle2`}),t[17]=p,t[18]=y);let C;t[19]!==f||t[20]!==y?(C=(0,S.jsxs)(`div`,{className:o,children:[f,y]}),t[19]=f,t[20]=y,t[21]=C):C=t[21];let w;return t[22]!==i||t[23]!==C?(w=(0,S.jsx)(v,{label:i,children:C}),t[22]=i,t[23]=C,t[24]=w):w=t[24],w},()=>{let{internationalization:{queries:{locale:e}}}=d(),{data:t}=r(e.getOptions());return{currentLocale:t}}),E=()=>{let e=(0,b.c)(7),t=T.useComponent(),n=C.useComponent(),r;e[0]===t?r=e[1]:(r=(0,S.jsx)(t,{}),e[0]=t,e[1]=r);let i;e[2]===n?i=e[3]:(i=(0,S.jsx)(n,{}),e[2]=n,e[3]=i);let a;return e[4]!==r||e[5]!==i?(a=(0,S.jsxs)(y,{telemetryLocation:`LanguagesTab`,children:[r,i]}),e[4]=r,e[5]=i,e[6]=a):a=e[6],a};export{E as LanguagesTab};