"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),t=require("../../helpers.js"),s=require("@gem-sdk/system"),a=require("../common/classes.js"),l=require("../common/styles.js"),r=require("../common/helpers.js"),i=require("../../image/components/NextImage.liquid.js");exports.default=m=>{let{title:o,id:c,lazy:d,aspectRatio:g,autoplay:p,muted:n,thumbnailLink:u,poster:y,translatedVideoUrl:f}=m,{iframeSrc:$}=r.getVimeoParams(m),b=!d,v=m.thumbnail,S=s.createStateOrContext({id:c,thumbnail:u,lazy:d,iframeSrc:$,title:o,autoplay:p,muted:n,style:m?.vimeoStyleIframe||"",translatedVideoUrl:f}),h=s.createStyle({...l.getIframeVimeoStyle(g)}),C=s.createStyle({...l.getArticleVimeoStyle(g,"")}),I=s.createClass({...a.getArticleVimeoClasses(v,g)}),V=s.createClass({...a.getImageVimeoClasses(b)}),j=s.createClass({...a.getButtonVimeoClasses(b)}),q=s.createClass({...a.getIframeVimeoClasses()});return e.template`
    <gp-lite-vimeo-embed gp-data='${JSON.stringify(S)}'>
      <article
        aria-hidden
        class="${I}"
        data-title="${o}"
        style="${C}"
      >
      ${i.default({src:v,alt:y?.altText,title:y?.imageTitle,className:V,isDisableAspectStyle:!0,enableLazyLoadImage:!0,priority:y?.preload,height:y?.height,width:y?.width})}
         ${s.If(!b,e.template`
          <button type="button" class="${j}" aria-label="Play">
          <svg class="gp-w-5 gp-text-white" viewBox="0 0 24 24">
            <path
              fill="currentColor"
              d="M5 5.274c0-1.707 1.826-2.792 3.325-1.977l12.362 6.726c1.566.853 1.566 3.101 0 3.953L8.325 20.702C6.826 21.518 5 20.432 5 18.726V5.274Z"
            />
          </svg>
        </button>`)}
        ${s.If(b,e.template`
          <iframe
            style="${h}"
            title="${o}"
            frameborder="0"
            allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
            allowfullscreen
            src="${$}"
            class="${q}"
          ></iframe>`)}
      </article>
    </gp-lite-vimeo-embed>
    ${e.RenderIf(e.isLocalEnv,`<script ${t.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-lite-vimeo-embed-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${t.getSettingPreloadData('class="gps-link" delay',"src")}="${e.baseAssetURL}/assets-v2/gp-lite-vimeo-embed-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
  `};
