"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7664],{54093:function(e,t,r){r.r(t),r.d(t,{default:function(){return i}});var a=r(2265);let l="64px",n={};var i=({src:e,light:t,oEmbedUrl:r,onClickPreview:i,playIcon:s,previewTabIndex:o,previewAriaLabel:c})=>{let[u,d]=(0,a.useState)(null);(0,a.useEffect)(()=>{e&&t&&r&&p({src:e,light:t,oEmbedUrl:r})},[e,t,r]);let p=async({src:e,light:t,oEmbedUrl:r})=>{if(a.isValidElement(t))return;if("string"==typeof t){d(t);return}if(n[e]){d(n[e]);return}d(null);let l=await fetch(r.replace("{url}",e)),i=await l.json();if(i.thumbnail_url){let t=i.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");d(t),n[e]=t}},h=a.isValidElement(t),b={display:"flex",alignItems:"center",justifyContent:"center"},y={preview:{width:"100%",height:"100%",backgroundImage:u&&!h?`url(${u})`: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:l,width:l,height:l,position:h?"absolute":void 0,...b},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},f=a.createElement("div",{style:y.shadow,className:"react-player__shadow"},a.createElement("div",{style:y.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:y.preview,className:"react-player__preview",tabIndex:o,onClick:e=>{null==i||i(e)},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(null==i||i(e))},...c?{"aria-label":c}:{}},h?t:null,s||f)}}}]);