"use strict";var e=require("@gem-sdk/core"),t=require("./helpers.js");function l(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>void 0!==e||""===e))}const o=t=>{if(t)return{desktop:e.getValueByDevice(t,"desktop"),tablet:e.getValueByDevice(t,"tablet"),mobile:e.getValueByDevice(t,"mobile")}},r=t=>{if(!t)return;let l={};return e.DEVICES.forEach(o=>{let r=e.getResponsiveValueByScreen(t,o),a=r?.videoAlign;l[o]=a||"top"}),Object.keys(l).length>0?l:void 0};exports.getAdaptiveStyle=o=>{let{sizeSetting:r,background:a}=o??{},i={...t.getDisplayStyleByFitContent(r,a),...e.makeStyleResponsive("h",e.getHeightByShapeGlobalSize(r)),...e.makeStyleWithDefault("w",e.getWidthByShapeGlobalSize(r,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"})};return l(i)},exports.getBackgroundStyle=(o,r,a)=>{let{hoverEffectScale:i,background:n,hoverEffectDuration:s}=o??{},g=`${parseFloat(`${s}`)??.5}s`,p={...t.getStyleHeroBannerBg(t.getResponsiveSetting(n||{}),r),...e.getStyleBackgroundByDevice(n,{ignoreBgAttachment:!0,ignoreBackgroundImage:!0}),"--duration":g,"--scale":t.formatHoverScale(i),...e.makeStyleResponsive("pos",t.getAttachmentDevice(n)),transform:a,transition:`transform ${g} cubic-bezier(0,0,0,1)`};return l(p)},exports.getContainBackgroundStyle=e=>{let{borderBg:o,cornerBg:r}=e??{},a={"clip-path":t.getClipPath(o?.width,r)};return l(a)},exports.getContainerStyle=o=>{let{sizeSetting:r,background:a,borderBg:i,cornerBg:n,shadowBg:s,hasActiveShadow:g}=o??{},p={...e.makeStyleResponsive("h",e.getHeightByShapeGlobalSize(r)),...t.getStyleAspectRatioHeroBannerCustom(a,r),...e.makeStyle({bs:i?.border??i?.border,bw:i?.width??i?.width,bc:e.getSingleColorVariable(i?.color)}),...e.getRadiusStyleActiveState({...n,active:{...n||{},radiusType:"custom"}}),...a?{...e.getStyleBgColor(a)}:{},...e.getStyleShadow({value:s,styleAppliedFor:"box-shadow",isEnableShadow:g})};return l(p)},exports.getHtml5VideoStyle=(t,a,i)=>{let n=o(a),s=r(i),g={...e.makeStyleResponsive("aspect",t),...n?e.makeStyleResponsive("objf",n):{},...s?e.makeStyleResponsive("objp",s):{}};return l(g)},exports.getOverlayStyle=o=>{let{overlayColor:r,overlayOpacity:a,hoverEffect:i}=o??{},{disableOpacity:n}=t.opacityEnabledData(o),s="number"!=typeof a?.normal||isNaN(a?.normal)?"string"==typeof a?.normal?`${parseInt(a?.normal)}%`:"0%":`${a?.normal}%`,g=e.makeStyleState("op",{normal:s,hover:t.getOpacityHover(o)}),p=e.getGlobalColorStateStyle("bgc",{...r,hover:r?.hover||r?.normal});n&&(delete p?.["--bgc"],delete g?.["--op"]),i||(delete p?.["--hvr-bgc"],delete g?.["--hvr-op"]);let y={...p,...g,"--top":"0","--left":"0"};return l(y)},exports.getRowStyle=t=>{let{contentPadding:o}=t??{},r={...e.getResponsiveStylePadding(o)};return l(r)},exports.getStyle=(o,r,a)=>{let{sizeSetting:i}=o??{},n={...a,...t.getVisibilityStyle(a),...e.makeStyleWithDefault("w",e.getWidthByShapeGlobalSize(i,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...e.makeStyleResponsive("h",e.getHeightByShapeGlobalSize(i))};return l(n)},exports.getYoutubeIframeStyle=(t,r)=>{let a=o(r),i={...e.makeStyleResponsive("aspect",t),...a?e.makeStyleResponsive("objf",a):{},"pointer-events":"none"};return l(i)};
