"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=c=>{let{title:m,id:o,lazy:p,aspectRatio:d,autoplay:g,muted:n,thumbnailLink:u,poster:y,translatedVideoUrl:f,pageContext:$}=c,{iframeSrc:v}=r.getVimeoParams(c),S=!p,b=c.thumbnail,h=s.createStateOrContext({id:o,thumbnail:u,lazy:p,iframeSrc:v,title:m,autoplay:g,muted:n,style:c?.vimeoStyleIframe||"",translatedVideoUrl:f}),C=s.createStyle({...l.getIframeVimeoStyle(d)}),I=s.createStyle({...l.getArticleVimeoStyle(d,"")}),V=s.createClass({...a.getArticleVimeoClasses(b,d)}),j=s.createClass({...a.getImageVimeoClasses(S)}),q=s.createClass({...a.getButtonVimeoClasses(S)}),w=s.createClass({...a.getIframeVimeoClasses()});return e.template`
    <gp-lite-vimeo-embed gp-data='${JSON.stringify(h)}'>
      <article
        aria-hidden
        class="${V}"
        data-title="${m}"
        style="${I}"
      >
      ${i.default({src:b,alt:y?.altText,title:y?.imageTitle,className:j,isDisableAspectStyle:!0,pageContext:$,priority:y?.preload,height:y?.height,width:y?.width})}
         ${s.If(!S,e.template`
          <button type="button" class="${q}" 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(S,e.template`
          <iframe
            style="${C}"
            title="${m}"
            frameborder="0"
            allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
            allowfullscreen
            src="${v}"
            class="${w}"
          ></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>`)}
  `};
