"use strict";(globalThis.webpackChunksimplystatic_settings=globalThis.webpackChunksimplystatic_settings||[]).push([[353],{924(e,t,r){r.r(t),r.d(t,{default:()=>n});var a=r(609);const i="64px",l={};var n=({src:e,light:t,oEmbedUrl:r,onClickPreview:n,playIcon:s,previewTabIndex:o,previewAriaLabel:c})=>{const[d,p]=(0,a.useState)(null);(0,a.useEffect)(()=>{e&&t&&r&&u({src:e,light:t,oEmbedUrl:r})},[e,t,r]);const u=async({src:e,light:t,oEmbedUrl:r})=>{if(a.isValidElement(t))return;if("string"==typeof t)return void p(t);if(l[e])return void p(l[e]);p(null);const i=await fetch(r.replace("{url}",e)),n=await i.json();if(n.thumbnail_url){const t=n.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");p(t),l[e]=t}},h=a.isValidElement(t),b={display:"flex",alignItems:"center",justifyContent:"center"},g={preview:{width:"100%",height:"100%",backgroundImage:d&&!h?`url(${d})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...b},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:i,width:i,height:i,position:h?"absolute":void 0,...b},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},y=a.createElement("div",{style:g.shadow,className:"react-player__shadow"},a.createElement("div",{style:g.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:g.preview,className:"react-player__preview",tabIndex:o,onClick:e=>{null==n||n(e)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||null==n||n(e)},...c?{"aria-label":c}:{}},h?t:null,s||y)}}}]);