"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var HeroBannerItem_liquid=require("./HeroBannerItem.liquid.js"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),system=require("@gem-sdk/system"),core=require("@gem-sdk/core"),helpers=require("../../helpers.js"),helpers$1=require("../common/helpers.js");const HeroBanner=e=>{let{builderAttrs:t,builderProps:s,setting:r,styles:a,style:i,children:o,advanced:l,pageContext:n}=e,{enableLazyLoadImage:c}=n??{},{enableLink:d,enableParallax:p}=r??{},g=helpers$1.getBannerLink(r),{cssClass:u}=l??{},{urlData:m}=helpers.getInsertLinkData("",g),f=system.createStateOrContext({background:helpers$1.getResponsiveSetting(a?.background||{}),uid:s?.uid,enableParallax:p&&Number(r?.speedParallax||0)>0,speedParallax:Number(r?.speedParallax)||0,hoverEffect:a?.hoverEffect,hoverEffectScale:a?.hoverEffectScale,layout:r?.layout,contentPosition1Col:a?.contentPosition1Col,contentPosition2Col:a?.contentPosition2Col,aspectRatio:r?.aspectRatio,sizeSetting:helpers$1.getResponsiveSetting(a?.sizeSetting||{}),videoObjectFit:helpers$1.getResponsiveSetting(a?.videoObjectFit||{}),target:g?.target??"_self",href:m?.href??"",linkType:g?.type??"",hoverEffectDuration:a?.hoverEffectDuration,isYoutubeVideoMigrated:r?.isYoutubeVideoMigrated}),h=!!g?.link&&d,y=system.createAttr({...attrs.getAttr({uid:s?.uid||""})}),v=system.createAttr(attrs.getAttrLink()),$=system.createStyle({...styles.getStyle(a,r,i)}),S=system.createClass({...classes.getClasses({setting:r,builderProps:s,advancedCssClass:u})}),b=system.createClass({...classes.getLinkClasses()}),C=()=>HeroBannerItem_liquid.default({setting:r,styles:a,children:o,enableLazyLoadImage:c,rawChildren:e.rawChildren,builderProps:s});return core.template`
      <gp-hero-banner
        ${{...t}}
        ${{...y}}
        class="${S}"
        style="${$}"
        gp-data='${core.dataStringify(f)}'
      >
        ${system.If(!h,C())}
        ${system.If(h,core.template`
          <div
            ${{...v}}
            aria-hidden="true"
            class="${b}"
          >
            ${C()}
          </div>`)}
      </gp-hero-banner>
       ${core.RenderIf(core.isLocalEnv,`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-hero-banner-v2-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-hero-banner-v2-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>
`)}
  `};exports.default=HeroBanner;
