import{filterTruthy as e}from"../../../common/helpers.js";import{composeAdvanceStyle as t,makeStyleResponsive as o,composeTypographyStyle as r,makeGlobalSize as s,composeSize as a,getBorderStyle as l,getBorderRadiusStyle as c,getStyleShadow as i,getStyleBackgroundByDevice as n,getGradientBgrStyleByDevice as h,getSingleColorVariable as p,getCustomRadius as d}from"@gem-sdk/core";let composeStyles=t=>e(t),composeContainerStyles=(e,r)=>{let{align:s}=e??{},{pos:a,d:l,op:c,right:i,top:n,left:h,bottom:p,z:d,margin:g,padding:u}=r??{},v=r?.["spacing-setting"],y=t({pos:a,d:l,op:c,right:i,top:n,left:h,bottom:p,z:d,margin:g,padding:u,"spacing-setting":v});return composeStyles({...y,...o("ta",s)})},composeInnerStyles=(e,o,p)=>{let{border:d,rounded:g,hasBoxShadow:u,boxShadow:v}=o??{},{wrapperBorder:y,borderRadius:S,globalSize:m,boxShadowEmailHover:b,boxShadowEmailActive:w,roundedEmailHover:f,textColorActive:$,roundedEmailActive:x,textColorHover:T,borderEmailHover:k,borderEmailActive:A,backgroundColorV2Active:E,backgroundColorV2Hover:F}=p??{},{typography:C,size:I,background:j}=e??{},q=t({border:d,rounded:g,hasBoxShadow:u,boxShadow:v}),z=r(e?.typo,C),B=s(m);return composeStyles({...B?.width?.["--w"]?B.width:{"--w":"auto"},...B?.height?.["--h"]?B.height:{"--h":"auto"},...B.padding,...z,...I?.type?{}:a(I?.custom),...l(y),...c(S),...q,...i({value:v,styleAppliedFor:"box-shadow",isEnableShadow:u}),...n(j),...h(j),...i({value:w?.active,state:"focus",styleAppliedFor:"box-shadow",isEnableShadow:!0}),...i({value:b?.hover,state:"hover",styleAppliedFor:"box-shadow",isEnableShadow:!0}),"--hvr-c":T?.hover??"","--focus-c":$?.active??"",...generateStylesTarget({state:"hover",borderStyle:k?.hover,background:F?.hover,radius:f?.hover}),...generateStylesTarget({state:"focus",borderStyle:A?.active,background:E?.active,radius:x?.active})})},generateStylesTarget=({state:e,borderStyle:t,background:o,radius:r})=>{let{border:s,width:a,color:l}=t??{},c={hover:"hvr",focus:"focus"}[e];return{...a&&{[`--${c}-bw`]:`${a}`},...s&&{[`--${c}-b`]:`${s} ${p(l)}`},...o&&{[`--${c}-bgc`]:`${p(o)}`},...d(e,r)}};export{composeContainerStyles,composeInnerStyles,generateStylesTarget};
