"use strict";(globalThis.webpackChunkuser_registration=globalThis.webpackChunkuser_registration||[]).push([[353],{8454(e,r,t){t.r(r),t.d(r,{default:()=>n});var a=t(1609);const i="64px",l={};var n=({src:e,light:r,oEmbedUrl:t,onClickPreview:n,playIcon:o,previewTabIndex:s,previewAriaLabel:c})=>{const[d,u]=(0,a.useState)(null);(0,a.useEffect)(()=>{e&&r&&t&&p({src:e,light:r,oEmbedUrl:t})},[e,r,t]);const p=async({src:e,light:r,oEmbedUrl:t})=>{if(a.isValidElement(r))return;if("string"==typeof r)return void u(r);if(l[e])return void u(l[e]);u(null);const i=await fetch(t.replace("{url}",e)),n=await i.json();if(n.thumbnail_url){const r=n.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");u(r),l[e]=r}},h=a.isValidElement(r),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:s,onClick:e=>{null==n||n(e)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||null==n||n(e)},...c?{"aria-label":c}:{}},h?r:null,o||y)}}}]);