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]=`bbb1b98d-1646-4a0d-8195-1677b83c18de`,e._sentryDebugIdIdentifier=`sentry-dbid-bbb1b98d-1646-4a0d-8195-1677b83c18de`)}catch{}import"./rolldown-runtime-nx40z1zs.js";import{Ag as e,Qm as t,_r as n,hh as r,ng as i,uh as a}from"./entry.client-mpghtlrl.js";import{n as o,r as s}from"./xds-icons-m106f2fc.js";import{c,l,s as u,u as d}from"./LibraryPage-h9vymy6t.js";import{t as f}from"./TagDropdown-ja19iptp.js";var p=e(),m=i(),h=n(e=>{let n=(0,p.c)(31),{selectedSortBy:i,selectedSortDirection:u,handleSortBySelectionChange:h,handleSortDirectionChange:g,isNativeAvailable:_,selectedPlatformTags:v,currentTab:y}=e,b=l(),x=c(),S=d(y,_,v),{trackUserAction:C}=t(),w,T;if(n[0]!==x||n[1]!==S){let e;n[3]===x?e=n[4]:(e=e=>({id:e,label:x[e]}),n[3]=x,n[4]=e),T=S.map(e),n[0]=x,n[1]=S,n[2]=T}else T=n[2];w=T;let E=w,D,O;n[5]!==S||n[6]!==i?(O=S.includes(i)?i:S[0]??i,n[5]=S,n[6]=i,n[7]=O):O=n[7],D=O;let k=D,A,j;n[8]===k?j=n[9]:(j=[k],n[8]=k,n[9]=j),A=j;let M=A,N;n[10]!==k||n[11]!==C||n[12]!==h?(N=e=>{let t=e[0];t===void 0||t===k||(C(a.SortChanged,{sortBy:t},r.Select),h(t))},n[10]=k,n[11]=C,n[12]=h,n[13]=N):N=n[13];let P=N,F;n[14]!==u||n[15]!==C||n[16]!==k||n[17]!==g?(F=e=>{e!==u&&(C(a.SortDirectionChanged,{sortBy:k,sortDirection:e},r.Select),g(e))},n[14]=u,n[15]=C,n[16]=k,n[17]=g,n[18]=F):F=n[18];let I=F,L=x[k],R;n[19]===u?R=n[20]:(R=u===`ascending`?(0,m.jsx)(o,{}):(0,m.jsx)(s,{}),n[19]=u,n[20]=R);let z=R,B=`${b}: ${L}`,V;return n[21]!==L||n[22]!==B||n[23]!==z||n[24]!==b||n[25]!==E||n[26]!==M||n[27]!==P||n[28]!==u||n[29]!==I?(V=(0,m.jsx)(f,{triggerLabel:L,triggerAriaLabel:B,triggerLeadingIcon:z,menuLabel:b,items:E,selectedIds:M,selectionMode:`single`,isSelectionRequired:!0,commitStrategy:`immediate`,portal:!0,onSelectionChange:P,sortDirection:u,onSortDirectionChange:I}),n[21]=L,n[22]=B,n[23]=z,n[24]=b,n[25]=E,n[26]=M,n[27]=P,n[28]=u,n[29]=I,n[30]=V):V=n[30],V},u);export{h as SortByTagDropdownConnection};