"use strict";var core=require("@gem-sdk/core");const getDimension=({setting:e,style:t})=>{let{fixedMode:o,height:a,background:l}=e??{},r=o?{"--aspect":composeAspect(l?.desktop?.image),"--aspect-tablet":composeAspect(l?.tablet?.image),"--aspect-mobile":composeAspect(l?.mobile?.image)}:core.makeStyleResponsive("h",a);return{...r,"--d":t?.["--d"]||"block","--d-mobile":t?.["--d-mobile"]||"block","--d-tablet":t?.["--d-tablet"]||"block"}},getStyleOverlay=({setting:e})=>{let{overlayOpacity:t,overlayColor:o}=e??{};return{...core.getGlobalColorStateStyle("bgc",o),...core.makeStyleState("op",t)}},getStyleContainerBackgoundImage=({setting:e,hasCollectionImage:t})=>{let{hoverDuration:o,background:a,hoverScale:l}=e??{};return{...core.getStyleBackgroundByDevice(a),"--duration":`${o??0}s`,"--scale":`${l??100}%`,...t?{...core.makeStyleResponsive("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}`};exports.getDimension=getDimension,exports.getStyleContainerBackgoundImage=getStyleContainerBackgoundImage,exports.getStyleOverlay=getStyleOverlay;
