import{filterTruthy as e}from"../../../common/helpers.js";import{composeAdvanceStyle as t,makeStyleResponsive as o,makeGlobalSize as r,composeSize as p,getStyleBackgroundByDevice as s,composeTypographyStyle as n}from"@gem-sdk/core";let composeStyles=t=>e(t),composeContainerStyles=(e,r)=>{let{pos:p,d:s,op:n,right:i,top:g,left:l,bottom:c,z:a,padding:m,margin:y}=e??{},d=e?.["spacing-setting"],h=t({pos:p,d:s,op:n,right:i,top:g,left:l,bottom:c,z:a,margin:y,padding:m,"spacing-setting":d});return composeStyles({...h,...o("ta",r?.align)})},composeFormDropdownStyles=(e,o,n)=>{let{border:i,rounded:g,hasBoxShadow:l,boxShadow:c}=e??{},{background:a,size:m}=o??{},{globalSize:y,backgroundColorV2Active:d}=n??{},h=t({border:i,rounded:g,hasBoxShadow:l,boxShadow:c}),u=r(y);return composeStyles({...u?.width?.["--w"]?u.width:{"--w":"100%"},...u?.height?.["--h"]?u.height:{"--h":"auto"},...u.padding,...h,...m?.type?{}:p(m?.custom),appearance:"none",...s(a,{ignoreBackgroundImageProperties:!0}),"--bgi":getBgImageUrl(a?.desktop?.color),"background-repeat":"no-repeat","background-position":"right 10px center, 0 0","--focus-bgi":getBgImageUrl(d?.active)})},getBgImageUrl=e=>`url(https://cdn.shopify.com/s/files/1/1827/4239/t/1/assets/ico-select.svg?v=155563818344741998551488860031) ${e?.includes("linear-gradient")?","+e:""}`,getAppendTypoStyleFirstTime=e=>{let t=n(e?.typo,e?.typography);return composeStyles({...t,...!Number(e?.defaultOption)&&{"--c":e?.placeholderColor}})},getStyleOption=e=>{let{typography:t,typo:o}=e??{},r=n(o,t);return composeStyles({...r})};export{composeContainerStyles,composeFormDropdownStyles,getAppendTypoStyleFirstTime,getStyleOption};
