(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4439],{60356:function(e,t,a){var l,i,s=Object.create,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,p=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,__defNormalProp=(e,t,a)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__copyProps=(e,t,a,l)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of n(t))u.call(e,i)||i===a||r(e,i,{get:()=>t[i],enumerable:!(l=o(t,i))||l.enumerable});return e},__publicField=(e,t,a)=>(__defNormalProp(e,"symbol"!=typeof t?t+"":t,a),a),c={};((e,t)=>{for(var a in t)r(e,a,{get:t[a],enumerable:!0})})(c,{default:()=>YouTube}),e.exports=__copyProps(r({},"__esModule",{value:!0}),c);var y=(i=null!=(l=a(67294))?s(p(l)):{},__copyProps(l&&l.__esModule?i:r(i,"default",{value:l,enumerable:!0}),l)),h=a(38045),d=a(71776);let b=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,P=/user\/([a-zA-Z0-9_-]+)\/?/,_=/youtube-nocookie\.com/;let YouTube=class YouTube extends y.Component{constructor(){super(...arguments),__publicField(this,"callPlayer",h.callPlayer),__publicField(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(b.test(e)){let[,t]=e.match(b);return{listType:"playlist",list:t.replace(/^UC/,"UU")}}if(P.test(e)){let[,t]=e.match(P);return{listType:"user_uploads",list:t}}return{}}),__publicField(this,"onStateChange",e=>{let{data:t}=e,{onPlay:a,onPause:l,onBuffer:i,onBufferEnd:s,onEnded:r,onReady:o,loop:n,config:{playerVars:p,onUnstarted:u}}=this.props,{UNSTARTED:c,PLAYING:y,PAUSED:h,BUFFERING:d,ENDED:b,CUED:P}=window.YT.PlayerState;if(t===c&&u(),t===y&&(a(),s()),t===h&&l(),t===d&&i(),t===b){let e=!!this.callPlayer("getPlaylist");n&&!e&&(p.start?this.seekTo(p.start):this.play()),r()}t===P&&o()}),__publicField(this,"mute",()=>{this.callPlayer("mute")}),__publicField(this,"unmute",()=>{this.callPlayer("unMute")}),__publicField(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||b.test(e)?null:e.match(d.MATCH_URL_YOUTUBE)[1]}load(e,t){let{playing:a,muted:l,playsinline:i,controls:s,loop:r,config:o,onError:n}=this.props,{playerVars:p,embedOptions:u}=o,c=this.getID(e);if(t){if(b.test(e)||P.test(e)||e instanceof Array){this.player.loadPlaylist(this.parsePlaylist(e));return}this.player.cueVideoById({videoId:c,startSeconds:(0,h.parseStartTime)(e)||p.start,endSeconds:(0,h.parseEndTime)(e)||p.end});return}(0,h.getSDK)("https://www.youtube.com/iframe_api","YT","onYouTubeIframeAPIReady",e=>e.loaded).then(t=>{this.container&&(this.player=new t.Player(this.container,{width:"100%",height:"100%",videoId:c,playerVars:{autoplay:a?1:0,mute:l?1:0,controls:s?1:0,start:(0,h.parseStartTime)(e),end:(0,h.parseEndTime)(e),origin:window.location.origin,playsinline:i?1:0,...this.parsePlaylist(e),...p},events:{onReady:()=>{r&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:e=>this.props.onPlaybackRateChange(e.data),onPlaybackQualityChange:e=>this.props.onPlaybackQualityChange(e),onStateChange:this.onStateChange,onError:e=>n(e.data)},host:_.test(e)?"https://www.youtube-nocookie.com":void 0,...u}))},n),u.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause")}play(){this.callPlayer("playVideo")}pause(){this.callPlayer("pauseVideo")}stop(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}seekTo(e,t=!1){this.callPlayer("seekTo",e),t||this.props.playing||this.pause()}setVolume(e){this.callPlayer("setVolume",100*e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}render(){let{display:e}=this.props;return y.default.createElement("div",{style:{width:"100%",height:"100%",display:e}},y.default.createElement("div",{ref:this.ref}))}};__publicField(YouTube,"displayName","YouTube"),__publicField(YouTube,"canPlay",d.canPlay.youtube)}}]);