1import{b as I,c as L}from"./chunk-J3HX2BMR.js";import{b as Y}from"./chunk-QB6LUGHX.js";import{b as U}from"./chunk-IA3LRG24.js";import"./chunk-HALDJ3CA.js";import"./chunk-6S7XKKFT.js";import"./chunk-ONOOT4BC.js";var D,M;function N(){if(M)return D;M=1;var y=Object.create,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,f=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty,V=(r,e,t)=>e in r?i(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,k=(r,e)=>{for(var t in e)i(r,t,{get:e[t],enumerable:!0})},S=(r,e,t,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of n(e))!q.call(r,a)&&a!==t&&i(r,a,{get:()=>e[a],enumerable:!(p=o(e,a))||p.enumerable});return r},x=(r,e,t)=>(t=r!=null?y(f(r)):{},S(!r||!r.__esModule?i(t,"default",{value:r,enumerable:!0}):t,r)),B=r=>S(i({},"__esModule",{value:!0}),r),s=(r,e,t)=>(V(r,typeof e!="symbol"?e+"":e,t),t),A={};k(A,{default:()=>T}),D=B(A);var b=x(U),u=I(),C=L();let K="https://www.youtube.com/iframe_api",R="YT",F="onYouTubeIframeAPIReady",d=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,g=/user\/([a-zA-Z0-9_-]+)\/?/,H=/youtube-nocookie\.com/,G="https://www.youtube-nocookie.com";class T extends b.Component{constructor(){super(...arguments),s(this,"callPlayer",u.callPlayer),s(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(d.test(e)){let[,t]=e.match(d);return{listType:"playlist",list:t.replace(/^UC/,"UU")}}if(g.test(e)){let[,t]=e.match(g);return{listType:"user_uploads",list:t}}return{}}),s(this,"onStateChange",e=>{let{data:t}=e,{onPlay:p,onPause:a,onBuffer:O,onBufferEnd:v,onEnded:E,onReady:w,loop:_,config:{playerVars:c,onUnstarted:P}}=this.props,{UNSTARTED:m,PLAYING:h,PAUSED:l,BUFFERING:z,ENDED:$,CUED:Q}=window[R].PlayerState;if(t===m&&P(),t===h&&(p(),v()),t===l&&a(),t===z&&O(),t===$){let Z=!!this.callPlayer("getPlaylist");_&&!Z&&(c.start?this.seekTo(c.start):this.play()),E()}t===Q&&w()}),s(this,"mute",()=>{this.callPlayer("mute")}),s(this,"unmute",()=>{this.callPlayer("unMute")}),s(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||d.test(e)?null:e.match(C.MATCH_URL_YOUTUBE)[1]}load(e,t){let{playing:p,muted:a,playsinline:O,controls:v,loop:E,config:w,onError:_}=this.props,{playerVars:c,embedOptions:P}=w,m=this.getID(e);if(t){if(d.test(e)||g.test(e)||e instanceof Array){this.player.loadPlaylist(this.parsePlaylist(e));return}this.player.cueVideoById({videoId:m,startSeconds:(0,u.parseStartTime)(e)||c.start,endSeconds:(0,u.parseEndTime)(e)||c.end});return}(0,u.getSDK)(K,R,F,h=>h.loaded).then(h=>{this.container&&(this.player=new h.Player(this.container,{width:"100%",height:"100%",videoId:m,playerVars:{autoplay:p?1:0,mute:a?1:0,controls:v?1:0,start:(0,u.parseStartTime)(e),end:(0,u.parseEndTime)(e),origin:window.location.origin,playsinline:O?1:0,...this.parsePlaylist(e),...c},events:{onReady:()=>{E&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:l=>this.props.onPlaybackRateChange(l.data),onPlaybackQualityChange:l=>this.props.onPlaybackQualityChange(l),onStateChange:this.onStateChange,onError:l=>_(l.data)},host:H.test(e)?G:void 0,...P}))},_),P.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer\u2019s 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",e*100)}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,t={width:"100%",height:"100%",display:e};return b.default.createElement("div",{style:t},b.default.createElement("div",{ref:this.ref}))}}return s(T,"displayName","YouTube"),s(T,"canPlay",C.canPlay.youtube),D}
1function J(y,i){return i.forEach(function(o){o&&typeof o!="string"&&!Array.isArray(o)&&Object.keys(o).forEach(function(n){if(n!=="default"&&!(n in y)){var f=Object.getOwnPropertyDescriptor(o,n);Object.defineProperty(y,n,f.get?f:{enumerable:!0,get:function(){return o[n]}})}})}),Object.freeze(y)}var j=N(),W=Y(j),se=J({__proto__:null,default:W},[j]);export{se as Y,W as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.