import{template as e,getAspectRatioGlobalSize as t,DEVICES as o,getResponsiveValueByScreen as s,hasTranslatedLiquid as i}from"@gem-sdk/core";import l from"../../grid/components/row/Row.liquid.js";import{createStyle as a,createClass as r,If as m}from"@gem-sdk/system";import d from"../../image/components/AdaptiveImage.liquid.js";import n from"../../video/components/HTML5Embed.liquid.js";import{getContainerStyle as p,getOverlayStyle as u,getRowStyle as c,getAdaptiveStyle as f,getBackgroundStyle as v,getContainBackgroundStyle as y,getYoutubeIframeStyle as g,getHtml5VideoStyle as j}from"../common/styles.js";import{getContainerClasses as $,getOverlayClasses as b,getRowClasses as h,getAdaptivePictureClasses as C,getAdaptiveClasses as w,getBackgroundClasses as I,getContainBackgroundClasses as T,getHtml5VideoClasses as k,getWrapperYoutubeClasses as x,getIframeYoutubeClasses as N,getLazyBackgroundClasses as q}from"../common/classes.js";import{getAspectRatio as H,getYoutubeAspectRatio as z,getBackgroundImageHeroBanner as A,getWidth as L,horizontalAlign as V,getEnableBgImageByDevice as B,getBgImage as E,showVideoType as R,getResponsiveSetting as S,fallbackImg as D}from"../common/helpers.js";import{getImageSrc as M}from"../../image/common/helpers.js";import O from"../../image/components/NextImage.liquid.js";import U from"../../video/components/LiteYouTubeEmbed.liquid.js";import{getYoutubeVideoId as W,youtubeVideoRegex as Y}from"../../video/common/helpers.js";import{isRenderHtmlVideo as F}from"../../grid/components/row/common/helpers.js";import{PRIORITY_LOAD_ATTRS as G}from"../../image/constants.js";import{getSeoTranslated as J}from"../../helpers.js";let K=K=>{let{enableLazyLoadImage:P=!0,translatedBackground:Q,setting:X,styles:Z,children:_,builderProps:ee,rawChildren:et,pageContext:eo}=K,{layout:es,verticalAlign:ei,enableParallax:el,alt:ea,title:er,preload:em,isYoutubeVideoMigrated:ed}=X??{},{background:en,overlayColor:ep,verticalGutter:eu,sizeSetting:ec,contentWidth:ef,hoverEffect:ev,contentPosition1Col:ey,contentPosition2Col:eg,videoObjectFit:ej}=Z??{},e$=!em&&P,eb=H(ec,en),eh=z(en,ej,eb),eC=S(Q||{}),ew=eC.desktop,eI=a({...p(Z)}),eT=r({...$(X,Z)}),ek=a({...u(Z)}),ex=r({...b(Z)}),eN=a({...c(Z)}),eq=r({...h(Z,X)}),eH=a({...f(Z)}),ez=r({...C()}),eA=r({...w()}),eL=r({...I(ev,e$)}),eV=a({...A(Q,e$,!1),...v(Z,el,"")}),eB=r({...T()}),eE=a({...y(Z)}),eR=r({...k(!1)}),eS=a({...g(eh,ej)}),eD=r({...x(ed)}),eM=a({...j(eb,ej,en)}),eO=r({...N()}),eU=e=>r({...q(e)});return e`
  <div class="${eT}" style="${eI}">
      <div
        class="${eB}"
        style="${eE}"
      >
        <div class="${eL}" style="${eV}">
          ${(()=>{if(!em)return o.map(e=>m(B(e,Q),O({src:M(s(E(Q),e),e),alt:J({valueTranslate:ea,uid:ee?.uid,settingId:"alt",pageContext:eo??{}}),title:J({valueTranslate:er,uid:ee?.uid,settingId:"title",pageContext:eo??{}}),className:eU(e),isDisableAspectStyle:!0,enableLazyLoadImage:P}))).join("")})()}
          ${(()=>{if(!R(en))return;if(F(en))return n({uid:ee?.uid,muted:!0,loop:ew?.loop,controls:!1,autoplay:!0,src:ew?.videoHtml5||"",title:"Video",style:eM,className:eR});let e=ew?.video??"",t=W(e),o=`&loop=false&playlist=${t}&showinfo=0&rel=0&fs=0&enablejsapi=1`,s=i(e);if(ew?.type==="video"&&ew?.videoType==="youtube"&&t&&Y.test(e)||s)return U({uid:ee?.uid,id:t??"",translatedVideoUrl:s?e:"",isHeroBanner:!0,autoplay:!0,title:"Video",controls:!1,params:o,adNetwork:!1,noCookie:!0,muted:!0,lazy:ew?.lazyLoad??!0,style:eS,wrapperClass:eD,iframeClass:eO})})()}
        </div>
        ${m(!!ep,e`<div aria-label="Overlay" class="${ex}" style="${ek}"> </div>`)}
      </div>
      ${l({className:eq,style:eN,setting:{layout:es,horizontalAlign:V(es,ey,eg),verticalAlign:ei},styles:{verticalGutter:eu,width:L(ef),fullWidth:{desktop:!1,tablet:!1,mobile:!1}},children:_,rawChildren:et})}
        ${d({pictureClass:ez,srcSet:E(Q),className:eA,...em&&G,aspectRatio:t(ec),style:eH,alt:J({valueTranslate:ea,uid:ee?.uid,settingId:"alt",pageContext:eo??{}}),title:J({valueTranslate:er,uid:ee?.uid,settingId:"title",pageContext:eo??{}}),enableLazyLoadImage:P,fallbackImg:D})}
  </div>
`};export{K as default};
