1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9481],{89481:function(t,e,a){a.r(e),a.d(e,{getCastContext:function(){return d},getCastErrorMessage:function(){return p},getCastSession:function(){return h},getCastSessionMedia:function(){return g},hasActiveCastSession:function(){return v},listenCastContextEvent:function(){return f},loader:function(){return N}});var n=a(53359),o=a(10851),r=a(70262),i=a(27938),s=a(12226),c=a(83993),l=a(92694);function u(){return d().getCastState()===cast.framework.CastState.CONNECTED}function d(){return window.cast.framework.CastContext.getInstance()}function h(){return d().getCurrentSession()}function g(){var t;return null===(t=h())||void 0===t?void 0:t.getSessionObj().media[0]}function v(t){var e;return(null===(e=g())||void 0===e?void 0:e.media.contentId)===(null==t?void 0:t.src)}function p(t){return"Google Cast Error Code: ".concat(t)}function f(t,e){return(0,l.listenEvent)(d(),t,e)}var w=new WeakMap,_=new WeakSet,C=new WeakSet,m=new WeakSet,y=new WeakSet,E=new WeakSet;class k{get cast(){return d()}mediaType(){return"video"}canPlay(t){return c.G9&&!c.cj&&(0,c.Ew)(t)}async prompt(t){var e,a;let o,s,c;try{o=await (0,i._)(this,_,S).call(this,t),(0,n._)(this,w)||((0,r._)(this,w,new cast.framework.RemotePlayer),new cast.framework.RemotePlayerController((0,n._)(this,w))),s=t.player.createEvent("google-cast-prompt-open",{trigger:o}),t.player.dispatchEvent(s),(0,i._)(this,y,P).call(this,t,"connecting",s),await (0,i._)(this,C,b).call(this,(0,l.peek)(t.$props.googleCast)),t.$state.remotePlaybackInfo.set({deviceName:null===(e=h())||void 0===e?void 0:e.getCastDevice().friendlyName}),u()&&(0,i._)(this,y,P).call(this,t,"connected",s)}catch(a){let e=a instanceof Error?a:(0,i._)(this,E,I).call(this,(a+"").toUpperCase(),"Prompt failed.");throw c=t.player.createEvent("google-cast-prompt-error",{detail:e,trigger:null!=s?s:o,cancelable:!0}),t.player.dispatch(c),(0,i._)(this,y,P).call(this,t,u()?"connected":"disconnected",c),e}finally{t.player.dispatch("google-cast-prompt-close",{trigger:null!==(a=null!=c?c:s)&&void 0!==a?a:o})}}async load(t){if(c.W6)throw Error("[vidstack] can not load google cast provider server-side");if(!(0,n._)(this,w))throw Error("[vidstack] google cast player was not initialized");return new(await a.e(9559).then(a.bind(a,59559))).GoogleCastProvider((0,n._)(this,w),t)}constructor(){(0,s._)(this,_),(0,s._)(this,C),(0,s._)(this,m),(0,s._)(this,y),(0,s._)(this,E),(0,o._)(this,w,{writable:!0,value:void 0}),this.name="google-cast"}}async function S(t){var e,a,n;if(null===(e=window.cast)||void 0===e?void 0:e.framework)return;let o=t.player.createEvent("google-cast-load-start");t.player.dispatch(o),await (0,c.ve)("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"),await customElements.whenDefined("google-cast-launcher");let r=t.player.createEvent("google-cast-loaded",{trigger:o});if(t.player.dispatch(r),!(null===(n=window.chrome)||void 0===n?void 0:null===(a=n.cast)||void 0===a?void 0:a.isAvailable))throw(0,i._)(this,E,I).call(this,"CAST_NOT_AVAILABLE","Google Cast not available on this platform.");return r}async function b(t){(0,i._)(this,m,A).call(this,t);let e=await this.cast.requestSession();if(e)throw(0,i._)(this,E,I).call(this,e.toUpperCase(),p(e))}function A(t){var e;null===(e=this.cast)||void 0===e||e.setOptions({language:"en-US",autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,receiverApplicationId:chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,resumeSavedSession:!0,androidReceiverCompatible:!0,...t})}function P(t,e,a){t.notify("remote-playback-change",{type:"google-cast",state:e},a)}function I(t,e){let a=Error(e);return a.code=t,a}var N=Object.freeze({__proto__:null,GoogleCastLoader:k})}}]);
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.