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