import{template as e,RenderIf as t,isLocalEnv as s,baseAssetURL as i}from"@gem-sdk/core";import{getSettingPreloadData as l}from"../../helpers.js";import{createStateOrContext as r,createStyle as a,createClass as m,If as o}from"@gem-sdk/system";import{getArticleVimeoClasses as p,getImageVimeoClasses as c,getButtonVimeoClasses as d,getIframeVimeoClasses as g}from"../common/classes.js";import{getIframeVimeoStyle as f,getArticleVimeoStyle as n}from"../common/styles.js";import{getVimeoParams as y}from"../common/helpers.js";import $ from"../../image/components/NextImage.liquid.js";let LiteVimeoEmbed=b=>{let{title:h,id:u,lazy:v,aspectRatio:S,autoplay:j,muted:w,thumbnailLink:E,poster:x}=b,{iframeSrc:L}=y(b),k=!v,I=b.thumbnail,N=r({id:u,thumbnail:E,lazy:v,iframeSrc:L,title:h,autoplay:j,muted:w,style:b?.vimeoStyleIframe||""}),V=a({...f(S)}),A=a({...n(S,"")}),T=m({...p(I,S)}),C=m({...c(k)}),G=m({...d(k)}),M=m({...g()});return e`
    <gp-lite-vimeo-embed gp-data='${JSON.stringify(N)}'>
      <article
        aria-hidden
        class="${T}"
        data-title="${h}"
        style="${A}"
      >
      ${$({src:I,alt:x?.altText,title:x?.imageTitle,className:C,isDisableAspectStyle:!0,enableLazyLoadImage:!0,priority:x?.preload,height:x?.height,width:x?.width})}
         ${o(!k,e`
          <button type="button" class="${G}" 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>`)}
        ${o(k,e`
          <iframe
            style="${V}"
            title="${h}"
            frameborder="0"
            allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
            allowfullscreen
            src="${L}"
            class="${M}"
          ></iframe>`)}
      </article>
    </gp-lite-vimeo-embed>
    ${t(s,`<script ${l('class="gps-link" delay',"src")}="{{ 'gp-lite-vimeo-embed-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${l('class="gps-link" delay',"src")}="${i}/assets-v2/gp-lite-vimeo-embed-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
  `};export{LiteVimeoEmbed as default};
