import{getGradientImageBgrStyleByDevice as t,getStyleBackgroundByDevice as e,makeStyle as l}from"@gem-sdk/core";import"react/jsx-runtime";import"react";import{ELEMENT_Z_INDEX as o}from"../../common/const.js";import{getBackgroundTranslated as p}from"../../helpers.js";import{Sticky as a}from"../settings/configs/translate.js";let r=t=>"top"==t?"sticky":"fixed",b=(t,e,l)=>{let o={[`--top${t}`]:"auto",[`--${l+t}`]:"0",[`--pos${t}`]:r(l)};switch(e){case"after-first-cart-button":o[`--d${t}`]="none";break;case"always":o[`--d${t}`]="block"}return o},i=(t,e)=>({...b("",t?.desktop,e?.desktop),...b("-tablet",t?.tablet??t?.desktop,e?.tablet??e?.desktop),...b("-mobile",t?.mobile??t?.tablet??t?.desktop,e?.mobile??e?.tablet??e?.desktop)}),s=(t,e)=>({[`--left${e}`]:"top"==t?"0":"50%",[`--t${e}`]:"top"==t?"unset":"translateX(-50%)"}),m=t=>({...s(t?.desktop,""),...s(t?.tablet??t?.desktop,"-tablet"),...s(t?.mobile??t?.tablet??t?.desktop,"-mobile")}),n=t=>{let{position:e,display:l}=t;return{margin:"0 auto",...m(e),...i(l,e),"z-index":o.STICKY}},d=({setting:o,style:r,uid:b,pageContext:i,type:s="React"})=>{let{background:m}=o||{},n="Liquid"===s?p({background:m,uid:b,enableTranslate:!!a?.background?.id,pageContext:i,isTranslateVideo:!1}):m;return{...l({m:"0 auto"}),...c(r),...k(r),...e(n||m),...t(n||m)}},c=t=>{let e={};return["--pt","--pb","--pr","--pl","--pt-mobile","--pb-mobile","--pr-mobile","--pl-mobile","--pt-tablet","--pb-tablet","--pr-tablet","--pl-tablet"].forEach(l=>{t?.[l]&&(e[l]=t[l])}),e},k=t=>{let e={...t};return["--pt","--pb","--pr","--pl","--pt-mobile","--pb-mobile","--pr-mobile","--pl-mobile","--pt-tablet","--pb-tablet","--pr-tablet","--pl-tablet"].forEach(t=>{delete e?.[t]}),e};export{i as displayConditionStyle,k as filterStyles,n as getContainerStyles,d as getContentStyles,b as getDisplayStyle,c as getStylePadding};
