import{makeStyleResponsive as e,getGlobalColorStateStyle as t,makeStyleState as o,getStyleBackgroundByDevice as a}from"@gem-sdk/core";let getDimension=({setting:t,style:o})=>{let{fixedMode:a,height:l,background:c}=t??{},i=a?{"--aspect":composeAspect(c?.desktop?.image),"--aspect-tablet":composeAspect(c?.tablet?.image),"--aspect-mobile":composeAspect(c?.mobile?.image)}:e("h",l);return{...i,"--d":o?.["--d"]||"block","--d-mobile":o?.["--d-mobile"]||"block","--d-tablet":o?.["--d-tablet"]||"block"}},getStyleOverlay=({setting:e})=>{let{overlayOpacity:a,overlayColor:l}=e??{};return{...t("bgc",l),...o("op",a)}},getStyleContainerBackgoundImage=({setting:t,hasCollectionImage:o})=>{let{hoverDuration:l,background:c,hoverScale:i}=t??{};return{...a(c),"--duration":`${l??0}s`,"--scale":`${i??100}%`,...o?{...e("bgi",makeBackgroundImage("url({{ collection.image.src | image_url}})"))}:{}}},makeBackgroundImage=e=>({desktop:e,tablet:e,mobile:e}),composeAspect=e=>{if(e&&e.width&&e.height&&e.src)return`${e.width}/${e.height}`};export{getDimension,getStyleContainerBackgoundImage,getStyleOverlay};
