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