"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),r=require("../../../helpers.js"),s=require("../../../video/components/HTML5Embed.liquid.js"),t=require("@gem-sdk/system"),a=require("../../../video/common/helpers.js"),i=require("../../../video/components/LiteYouTubeEmbed.liquid.js"),o=require("./common/attrs.js"),l=require("../../settings/configs/row/translate.js"),d=require("./common/classes.js"),n=require("./common/styles.js"),p=require("./common/helpers.js"),u=require("../../../hero-banner/common/helpers.js");exports.default=c=>{let{styles:g,setting:m,rawChildren:$,builderProps:f}=c,{isSection:y}=m??{},{background:k}=g??{},v=y?"section":"div",q=r.getBackgroundTranslated({background:k,uid:f?.uid,enableTranslate:!!l.Row?.background?.id,pageContext:c.pageContext??{}}),{stateData:b}=p.getData(c,q),{rowStyle:j,backgroundBoxStyle:h,embedVideoStyle:R,sectionStyle:w}=n.getRowStyle({rowProps:c,type:"Liquid",translatedBackground:q}),{rowAttr:I}=o.getAttr(c),{rowClass:C,backgroundBoxClass:S,backgroundBoxInnerClass:V,sectionClass:P,wrapperYoutubeClasses:E,iframeYoutubeClasses:L}=d.getClass(c),T=t.createClass({[C]:!0}),A=()=>{if(!p.checkHasBackgroundVideo(k))return;let r=u.getResponsiveSetting(k||{});if(p.isRenderHtmlVideo(k))return s.default({uid:f?.uid,muted:!0,loop:r.desktop?.loop,controls:!1,autoplay:!0,src:"",title:"Video",className:"gp-relative",style:R});if(p.isRenderYoutubeVideo(k)){let s=r?.desktop?.video??"",t=a.getYoutubeVideoId(s)||"",o=e.hasTranslatedLiquid(s),l=`&loop=false&playlist=${t}&showinfo=0&rel=0&fs=0&enablejsapi=1`;return i.default({uid:f?.uid,id:t,autoplay:!0,title:"Video",translatedVideoUrl:o?s:"",controls:!1,params:l,adNetwork:!1,noCookie:!0,muted:!0,lazy:r?.desktop?.lazyLoad??!0,style:R,wrapperClass:E,iframeClass:L})}},_=e.template`
    <gp-row gp-data='${b}' ${{...I}} class="${T}" style="${j()}">
      ${t.If(!!A(),e.template`
          <div class="${S}" style="${h}">
            <div class="${V}">${A()}</div>
          </div>
        `)}

      ${e.WrapRenderChildren({uid:f?.uid||"",customProps:$?.[0].customProps},$?.map(r=>{if(r)return e.RenderChildren({...r,order:m?.order,layout:m?.layout,justifyContent:m?.verticalAlign})}))}

      ${(()=>{if(p.checkHasBackgroundVideo(k))return e.template`
      ${e.RenderIf(e.isLocalEnv,`<script ${r.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-row-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${r.getSettingPreloadData('class="gps-link" delay',"src")}="${e.baseAssetURL}/assets-v2/gp-row-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
    `})()}
    </gp-row>
  `;return e.template`
    ${e.RenderIf(!!g?.preloadBgImage,`${e.RenderIf(!!k?.desktop?.image?.src,`<link rel="preload" href="${k?.desktop?.image?.src}" as="image" />`)}${e.RenderIf(!!k?.tablet?.image?.src,`<link rel="preload" href="${k?.tablet?.image?.src}" as="image" />`)}${e.RenderIf(!!k?.mobile?.image?.src,`<link rel="preload" href="${k?.mobile?.image?.src}" as="image" />`)}`)}

    ${e.RenderIf(!!y,"{% assign locationOrigin = request.origin | append: routes.root_url | split: '/' | join: '/' %}")}

    ${t.If(y,e.template`
        <${v}
          class="${P} ${y?r.getSettingPreloadData("gps-lazy"):""}"
          style="${w}"
        >
          ${_}
        </${v}>
      `,e.template`${_}`)}
  `};
