import{DEVICES as t,composeTypographyClassName as e,cls as r,getResponsiveValueByScreen as o}from"@gem-sdk/core";import{mappingVariantStyles as a}from"../../utils/mappingVariantStyles.js";import{makeStyleGapForLabel as l}from"../common.js";import{VAR_WIDTH_BY_DEVICE as i,HORIZONTAL_WIDTH as s,DEFAULT_WIDTH_LABEL as n}from"./const.js";let m=e=>{let{styles:r,setting:o}=e,{dropdownItemWidth:l}=r??{},i=a(o?.variantPresets,r),s={...o,variantPresets:i};return{...r,...s,swatchAutoWidth:(()=>{let e={};return t.forEach(t=>{e[t]=l?.[t]==="fill"}),e})()}},p=(a,m,p)=>{let{styles:d,setting:u}=a,{layout:g}=u??{},{labelGap:c}=d??{},{optionName:h,hasPreSelected:y,isChangeVariant:f,selectedOptions:T,styleOptionSelected:x}=p??{},b=e(d?.labelTypo,d?.labelTypography);return{className:r(b,"Liquid"===m?"{{showVariantClass}}":""),styles:{typo:d?.labelTypo},style:{...l(g,c)},setting:{htmlTag:"legend",text:"Liquid"===m?"{{option.name}}":`${h}${(!1!=y||f)&&"dropdown"!==x?`: ${T?.[h]}`:""}`,tagWidth:(e=>{let r=Object.fromEntries(t.map(t=>[i[t],"horizontal"===o(e,t)?s:n]));return r})(g),excludeFlex:!0}}};export{m as getDropdownGroupData,p as getTextVariantTitleData};
