Files
pgsql-jellyfin/publish_test2/wwwroot/htmlVideoPlayer-plugin.067cf3e86d5294617bd6.chunk.js
T

2 lines
41 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*! For license information please see htmlVideoPlayer-plugin.067cf3e86d5294617bd6.chunk.js.LICENSE.txt */
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[71318],{57379:function(e,t,n){n.r(t),n.d(t,{HtmlVideoPlayer:function(){return Se},default:function(){return Ae}}),n(29305),n(32733),n(84701),n(81678),n(2623),n(24776),n(14382),n(69892),n(76281),n(44962),n(86584),n(89336),n(4754),n(10849),n(70389),n(94),n(36947),n(26437),n(83810),n(52697),n(78557),n(67593),n(96054),n(90076),n(95021),n(73687),n(99425),n(83994),n(53819),n(93062),n(84518),n(90580),n(23630),n(82367);var r=n(31234),i=n.n(r),a=n(23125),o=n(35222),s=n(34789);function u(e){switch(e.getSubtitleAppearanceSettings().subtitleStyling){case"Native":return!1;case"Custom":return!0;default:return!!(s.A.ps4||s.A.tizenVersion&&s.A.tizenVersion>=5||s.A.web0s||s.A.edge||s.A.firefox||s.A.safari)}}var l=n(64763),c=n(97339),d=n(67430),f=n(82885),h=n(80262),v=n(90381),p=n(22622),m=n(8566),y=n(36300),k=n(39738),g=n(70267),b=n(58180),S=n(23648),w=n(5898),A=n(57634),P=n(51876),T=n(89166),E=n(38783),C=n(44797),x=n(53089);function M(e){var t,n;return"HLS"===(null===(t=null==e?void 0:e.TranscodingSubProtocol)||void 0===t?void 0:t.toUpperCase())||"HLS"===(null===(n=null==e?void 0:e.Container)||void 0===n?void 0:n.toUpperCase())}function O(e){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O(e)}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],u=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||F(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=F(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function F(e,t){if(e){if("string"==typeof e)return R(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(e,t):void 0}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function V(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function a(n,r,i,a){var u=r&&r.prototype instanceof s?r:s,l=Object.create(u.prototype);return W(l,"_invoke",function(n,r,i){var a,s,u,l=0,c=i||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return a=t,s=0,u=e,f.n=n,o}};function h(n,r){for(s=n,u=r,t=0;!d&&l&&!i&&t<c.length;t++){var i,a=c[t],h=f.p,v=a[2];n>3?(i=v===r)&&(u=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=h&&((i=n<2&&h<a[1])?(s=0,f.v=r,f.n=a[1]):h<v&&(i=n<3||a[0]>r||r>v)&&(a[4]=n,a[5]=r,f.n=v,s=0))}if(i||n>1)return o;throw d=!0,r}return function(i,c,v){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&h(c,v),s=c,u=v;(t=s<2?e:u)||!d;){a||(s?s<3?(s>1&&(f.n=-1),h(s,u)):f.n=u:f.v=u);try{if(l=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(d=f.n<0)?u:n.call(r,f))!==o)break}catch(t){a=e,s=1,u=t}finally{l=1}}return{value:t,done:d}}}(n,i,a),!0),l}var o={};function s(){}function u(){}function l(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(W(t={},r,(function(){return this})),t),d=l.prototype=s.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,W(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return u.prototype=l,W(d,"constructor",l),W(l,"constructor",u),u.displayName="GeneratorFunction",W(l,i,"GeneratorFunction"),W(d),W(d,i,"Generator"),W(d,r,(function(){return this})),W(d,"toString",(function(){return"[object Generator]"})),(V=function(){return{w:a,m:f}})()}function W(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}W=function(e,t,n,r){if(t)i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{var a=function(t,n){W(e,t,(function(e){return this._invoke(t,n,e)}))};a("next",0),a("throw",1),a("return",2)}},W(e,t,n,r)}function U(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function _(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){U(a,r,i,o,s,"next",e)}function s(e){U(a,r,i,o,s,"throw",e)}o(void 0)}))}}function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,B(r.key),r)}}function j(e,t,n){N(e,t),t.set(e,n)}function N(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function H(e,t,n){return(t=B(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B(e){var t=function(e){if("object"!=O(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==O(t)?t:t+""}function q(e,t,n){return e.set(G(e,t),n),n}function z(e,t){return e.get(G(e,t))}function G(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function K(e){return new Promise((function(t){var n=new XMLHttpRequest;n.open("HEAD",e,!0),n.onload=function(){t(n.responseURL||e)},n.onerror=function(n){console.error(n),t(e)},n.send(null)}))}function Q(e){var t=e.parentNode;if(t)try{t.removeChild(e)}catch(e){console.error("error removing dialog element: ".concat(e))}}function J(e,t){var n=e.replace(/\\N/gi,"\n").replace(/\r/gi,"").replace(/{\\.*?}/gi,"").split("\n").map((function(e){return"".concat(e)})).join("\n");return t?n.replace(/\n/gi,"<br>"):n}function X(e,t,n){if(S.Ay.isLocalItem(t)&&e.Path)return e.Path;var r=k.f.getSubtitleUrl(e,t.ServerId);return n&&(r=r.replace(".vtt",n)),r}var Y=new WeakMap,Z=new WeakMap,$=new WeakMap,ee=new WeakMap,te=new WeakMap,ne=new WeakMap,re=new WeakMap,ie=new WeakMap,ae=new WeakMap,oe=new WeakMap,se=new WeakMap,ue=new WeakMap,le=new WeakMap,ce=new WeakMap,de=new WeakMap,fe=new WeakMap,he=new WeakMap,ve=new WeakMap,pe=new WeakMap,me=new WeakMap,ye=new WeakMap,ke=new WeakMap,ge=new WeakMap,be=new WeakSet,Se=function(){function e(){var t,n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),N(this,t=be),t.add(this),H(this,"name",void 0),H(this,"type",E.Q.MediaPlayer),H(this,"id","htmlvideoplayer"),H(this,"priority",1),H(this,"isFetching",!1),j(this,Y,void 0),j(this,Z,void 0),j(this,$,void 0),j(this,ee,void 0),j(this,te,void 0),j(this,ne,void 0),j(this,re,void 0),j(this,ie,void 0),j(this,ae,void 0),j(this,oe,void 0),j(this,se,void 0),j(this,ue,void 0),j(this,le,void 0),j(this,ce,void 0),j(this,de,void 0),j(this,fe,void 0),j(this,he,void 0),j(this,ve,0),j(this,pe,void 0),j(this,me,void 0),j(this,ye,void 0),j(this,ke,void 0),H(this,"_flvPlayer",void 0),H(this,"_hlsPlayer",void 0),H(this,"_castPlayer",void 0),H(this,"_currentPlayOptions",void 0),j(this,ge,void 0),H(this,"setSubtitleOffset",(0,a.A)(this._setSubtitleOffset,100)),H(this,"onEnded",(function(e){var t=e.target;n.destroyCustomTrack(t),(0,b.X9)(n,t,n.onError)})),H(this,"onTimeUpdate",(function(e){var t=e.target,r=t.currentTime;r&&!z(ye,n)&&(q(ye,n,!0),n.ensureValidVideo(t)),q(ke,n,r);var i=n._currentPlayOptions;if(i){var a=1e3*r;a+=(i.transcodingOffsetTicks||0)/1e4,n.updateSubtitleText(a)}C.A.trigger(n,"timeupdate")})),H(this,"onVolumeChange",(function(e){var t=e.target;(0,b.iP)(t.volume),C.A.trigger(n,"volumechange")})),H(this,"onNavigatedToOsd",(function(){var e=z(Y,n);e&&(e.classList.remove("videoPlayerContainer-onTop"),n.onStartedAndNavigatedToOsd())})),H(this,"onPlaying",(function(e){var t=e.target;z(me,n)||(q(me,n,!0),t.removeAttribute("controls"),m.Ay.hide(),(0,b.HI)(n,e.target,n._currentPlayOptions.playerStartPositionTicks,(function(){z(te,n)&&(z(te,n).timeOffset=(n._currentPlayOptions.transcodingOffsetTicks||0)/1e7+z(oe,n),z(te,n).resize(),z(te,n).resetRenderAheadCache(!1))})),n._currentPlayOptions.fullscreen?g.appRouter.showVideoOsd().then(n.onNavigatedToOsd):((0,T.FB)(T.KH.Backdrop),z(Y,n).classList.remove("videoPlayerContainer-onTop"),n.onStartedAndNavigatedToOsd())),C.A.trigger(n,"playing")})),H(this,"onPlay",(function(){C.A.trigger(n,"unpause")})),H(this,"onClick",(function(){C.A.trigger(n,"click")})),H(this,"onDblClick",(function(){C.A.trigger(n,"dblclick")})),H(this,"onPause",(function(){C.A.trigger(n,"pause")})),H(this,"onWaiting",(function(){C.A.trigger(n,"waiting")})),H(this,"onError",(function(e){var t,r=e.target,i=r.error&&r.error.code||0,a=r.error&&r.error.message||"";switch(console.error("media element error: ".concat(i," ").concat(a)),i){case 1:default:return;case 2:t=h.F.NETWORK_ERROR;break;case 3:if(n._hlsPlayer)return void(0,b.bR)(n);t=h.F.MEDIA_DECODE_ERROR;break;case 4:t=h.F.MEDIA_NOT_SUPPORTED}(0,b.jK)(n,t)})),s.A.edgeUwp?this.name="Windows Video Player":this.name="Html Video Player"}return t=e,r=[{key:"currentSrc",value:function(){return z(pe,this)}},{key:"incrementFetchQueue",value:function(){var e;z(ve,this)<=0&&(this.isFetching=!0,C.A.trigger(this,"beginFetch")),q(ve,this,(e=z(ve,this),++e))}},{key:"decrementFetchQueue",value:function(){var e;q(ve,this,(e=z(ve,this),--e)),z(ve,this)<=0&&(this.isFetching=!1,C.A.trigger(this,"endFetch"))}},{key:"updateVideoUrl",value:function(e){var t=e.mediaSource,n=e.item;if(t&&n&&!t.RunTimeTicks&&M(t)&&"Transcode"===e.playMethod&&(s.A.iOS||s.A.osx)){var r=e.url.replace("master.m3u8","live.m3u8");return m.Ay.show(),console.debug("prefetching hls playlist: ".concat(r)),d.tF.getApiClient(n.ServerId).ajax({type:"GET",url:r}).then((function(){console.debug("completed prefetching hls playlist: ".concat(r)),m.Ay.hide(),e.url=r}),(function(){console.error("error prefetching hls playlist: ".concat(r)),m.Ay.hide()}))}return Promise.resolve()}},{key:"play",value:(U=_(V().m((function e(t){var n;return V().w((function(e){for(;;)switch(e.n){case 0:return q(me,this,!1),q(ye,this,!1),q(ke,this,null),!1!==t.resetSubtitleOffset&&this.resetSubtitleOffset(),e.n=1,this.createMediaElement(t);case 1:return n=e.v,G(be,this,we).call(this,t.aspectRatio||this.getAspectRatio()),e.n=2,this.updateVideoUrl(t);case 2:return e.a(2,this.setCurrentSrc(n,t))}}),e,this)}))),function(e){return U.apply(this,arguments)})},{key:"setSrcWithFlvJs",value:function(e,t,r){var i=this;return Promise.all([n.e(68470),n.e(63755)]).then(n.t.bind(n,70494,23)).then((function(t){var n=t.default.createPlayer({type:"flv",url:r},{seekType:"range",lazyLoad:!1});return n.attachMediaElement(e),n.load(),i._flvPlayer=n,q(pe,i,r),n.play()}))}},{key:"setSrcWithHlsJs",value:function(e,t,r){var i=this;return new Promise((function(a,o){var u;u=_(V().m((function n(){var u,l,c;return V().w((function(n){for(;;)switch(n.n){case 0:return u=30,(s.A.chrome||s.A.edgeChromium||s.A.firefox)&&k.f.getMaxStreamingBitrate(i)>=25e6&&(u=6),n.n=1,(0,P.Io)();case 1:l=n.v,(c=new Hls({startPosition:t.playerStartPositionTicks/1e7,manifestLoadingTimeOut:2e4,maxBufferLength:u,maxMaxBufferLength:u,videoPreference:{preferHDR:!0},xhrSetup:function(e){e.withCredentials=l}})).loadSource(r),c.attachMedia(e),(0,b.EK)(i,c,e,i.onError,a,o),i._hlsPlayer=c,q(pe,i,r);case 2:return n.a(2)}}),n)}))),Promise.all([n.e(62907),n.e(86136)]).then(n.t.bind(n,5725,23)).then((function(e){var t=e.default;t.DefaultConfig.lowLatencyMode=!1,t.DefaultConfig.backBufferLength=1/0,t.DefaultConfig.liveBackBufferLength=90,window.Hls=t,u()}))}))}},{key:"setCurrentSrc",value:(W=_(V().m((function e(t,n){var r,i,a,o,s,u,l,c=this;return V().w((function(e){for(;;)switch(e.n){case 0:if(t.removeEventListener("error",this.onError),i=n.url,console.debug("playing url: ".concat(i)),(a=(n.playerStartPositionTicks||0)/1e7)&&(i+="#t=".concat(a)),(0,b.JN)(this),(0,b.we)(this),(0,b.ZB)(this),o=!0,q(Z,this,null==n.mediaSource.DefaultSubtitleStreamIndex?-1:n.mediaSource.DefaultSubtitleStreamIndex),null!=z(Z,this)&&z(Z,this)>=0?((s=n.mediaSource.MediaStreams[z(Z,this)])&&"Encode"!==s.DeliveryMethod||(q(Z,this,-1),o=!1),s&&!k.f.trackHasSecondarySubtitleSupport(s,this)&&(o=!1)):o=!1,q(ee,this,"Transcode"===n.playMethod?null:n.mediaSource.DefaultAudioStreamIndex),this._currentPlayOptions=n,o?(q($,this,null==n.mediaSource.DefaultSecondarySubtitleStreamIndex?-1:n.mediaSource.DefaultSecondarySubtitleStreamIndex),null!=z($,this)&&z($,this)>=0&&((u=n.mediaSource.MediaStreams[z($,this)])&&k.f.trackHasSecondarySubtitleSupport(u,this)||q($,this,-1))):q($,this,-1),(l=(0,b.qQ)(n.mediaSource))&&(t.crossOrigin=l),!(0,b.B1)(n.mediaSource,"Video")||!M(n.mediaSource)){e.n=1;break}return e.a(2,this.setSrcWithHlsJs(t,n,i));case 1:if("Transcode"===n.playMethod||"FLV"!==(null===(r=n.mediaSource.Container)||void 0===r?void 0:r.toUpperCase())){e.n=2;break}return e.a(2,this.setSrcWithFlvJs(t,n,i));case 2:return t.autoplay=!0,e.n=3,(0,P.Io)();case 3:return e.v&&(t.crossOrigin="use-credentials"),e.a(2,(0,b.n8)(t,i,n).then((function(){return q(pe,c,i),(0,b.Oy)(t,c.onError)})));case 4:return e.a(2)}}),e,this)}))),function(e,t){return W.apply(this,arguments)})},{key:"setSubtitleStreamIndex",value:function(e){this.setCurrentTrackElement(e)}},{key:"setSecondarySubtitleStreamIndex",value:function(e){this.setCurrentTrackElement(e,1)}},{key:"resetSubtitleOffset",value:function(){q(oe,this,0),q(se,this,0),q(ae,this,!1)}},{key:"enableShowingSubtitleOffset",value:function(){q(ae,this,!0)}},{key:"disableShowingSubtitleOffset",value:function(){q(ae,this,!1)}},{key:"isShowingSubtitleOffsetEnabled",value:function(){return z(ae,this)}},{key:"getTextTracks",value:function(){var e=z(he,this);return e?Array.from(e.textTracks).filter((function(e){return"showing"===e.mode})):null}},{key:"_setSubtitleOffset",value:function(e){var t=this,n=parseFloat(e);if(z(te,this))this.updateCurrentTrackOffset(n),z(te,this).timeOffset=(this._currentPlayOptions.transcodingOffsetTicks||0)/1e7+n;else if(z(ne,this))this.updateCurrentTrackOffset(n),z(ne,this).timeOffset=(this._currentPlayOptions.transcodingOffsetTicks||0)/1e7+n;else{var r=this.getTextTracks();(null==r?void 0:r.length)>0?r.forEach((function(e,r){t.setTextTrackSubtitleOffset(e,n,r)})):z(ce,this)||z(de,this)?(z(ce,this)&&this.setTrackEventsSubtitleOffset(z(ce,this),n,0),z(de,this)&&this.setTrackEventsSubtitleOffset(z(de,this),n,1)):console.debug("No available track, cannot apply offset: ",n)}}},{key:"updateCurrentTrackOffset",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=z(oe,this);this.isSecondaryTrack(t)&&(n=z(se,this));var r=e,i=e;return n&&(r-=n),this.isSecondaryTrack(t)?q(se,this,i):q(oe,this,i),r}},{key:"requiresHidingActiveCuesOnOffsetChange",value:function(){return!!s.A.firefox}},{key:"hideTextTrackWithActiveCues",value:function(e){e.activeCues&&(e.mode="hidden")}},{key:"forceClearTextTrackActiveCues",value:function(e){e.activeCues&&(e.mode="disabled",setTimeout((function(){e.mode="showing"}),0))}},{key:"setTextTrackSubtitleOffset",value:function(e,t,n){if(e.cues){if(0===(t=this.updateCurrentTrackOffset(t,n)))return;var r=this.requiresHidingActiveCuesOnOffsetChange();r&&this.hideTextTrackWithActiveCues(e),Array.from(e.cues).forEach((function(e){e.startTime-=t,e.endTime-=t})),r&&this.forceClearTextTrackActiveCues(e)}}},{key:"setTrackEventsSubtitleOffset",value:function(e,t,n){if(Array.isArray(e)){if(0==(t=1e7*this.updateCurrentTrackOffset(t,n)))return;e.forEach((function(e){e.StartPositionTicks-=t,e.EndPositionTicks-=t}))}}},{key:"getSubtitleOffset",value:function(){return z(oe,this)}},{key:"isPrimaryTrack",value:function(e){return 0===e}},{key:"isSecondaryTrack",value:function(e){return 1===e}},{key:"isAudioStreamSupported",value:function(e,t,n){var r=(e.Codec||"").toLowerCase();return!r||!t||(t.DirectPlayProfiles||[]).some((function(e){return"Video"===e.Type&&(0,x.q)((e.Container||"").toLowerCase(),n)&&(0,x.q)((e.AudioCodec||"").toLowerCase(),r)}))}},{key:"getSupportedAudioStreams",value:function(){var e=this,t=z(ge,this),n=this._currentPlayOptions.mediaSource,r=n.Container.toLowerCase();return function(e){return e.MediaStreams.filter((function(e){return"Audio"===e.Type}))}(n).filter((function(n){return e.isAudioStreamSupported(n,t,r)}))}},{key:"setAudioStreamIndex",value:function(e){var t=this.getSupportedAudioStreams();if(!(t.length<2)){var n,r=-1,i=L(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;if(r++,a.Index===e)break}}catch(e){i.e(e)}finally{i.f()}if(-1!==r){var o=z(he,this);if(o){var s=o.audioTracks||[];console.debug("found ".concat(s.length," audio tracks"));var u,l=L(Array.from(s).entries());try{for(l.s();!(u=l.n()).done;){var c=I(u.value,2),d=c[0],f=c[1];r===d?(console.debug("setting audio track ".concat(d," to enabled")),f.enabled=!0):(console.debug("setting audio track ".concat(d," to disabled")),f.enabled=!1)}}catch(e){l.e(e)}finally{l.f()}}}}}},{key:"stop",value:function(e){var t=z(he,this),n=z(pe,this);return t&&(n&&t.pause(),(0,b.X9)(this,t,this.onError)),this.destroyCustomTrack(t),e&&this.destroy(),Promise.resolve()}},{key:"destroy",value:function(){this.setSubtitleOffset.cancel(),(0,b.JN)(this),(0,b.we)(this),(0,T.FB)(T.KH.None),document.body.classList.remove("hide-scroll");var e=z(he,this);e&&(q(he,this,null),this.destroyCustomTrack(e),e.removeEventListener("timeupdate",this.onTimeUpdate),e.removeEventListener("ended",this.onEnded),e.removeEventListener("volumechange",this.onVolumeChange),e.removeEventListener("pause",this.onPause),e.removeEventListener("playing",this.onPlaying),e.removeEventListener("play",this.onPlay),e.removeEventListener("click",this.onClick),e.removeEventListener("dblclick",this.onDblClick),e.removeEventListener("waiting",this.onWaiting),e.removeEventListener("error",this.onError),(0,b.si)(e),e.parentNode.removeChild(e));var t=z(Y,this);t&&(q(Y,this,null),t.parentNode.removeChild(t)),o.A.isEnabled?o.A.exit():document.webkitIsFullScreen&&document.webkitCancelFullscreen&&document.webkitCancelFullscreen()}},{key:"onStartedAndNavigatedToOsd",value:function(){var e=this;this.setCurrentTrackElement(z(Z,this)),null!=z(ee,this)&&this.canSetAudioStreamIndex()&&this.setAudioStreamIndex(z(ee,this)),null!=z($,this)&&z($,this)>=0&&setTimeout((function(){return e.setSecondarySubtitleStreamIndex(z($,e))}),0)}},{key:"ensureValidVideo",value:function(e){if(e===z(he,this)&&0===e.videoWidth&&0===e.videoHeight){var t,n=null===(t=this._currentPlayOptions)||void 0===t?void 0:t.mediaSource;n&&!n.RunTimeTicks||(0,b.jK)(this,h.F.NO_MEDIA_ERROR)}}},{key:"destroyCustomRenderedTrackElements",value:function(e){if(this.isPrimaryTrack(e))z(ue,this)&&(Q(z(ue,this)),q(ue,this,null));else if(this.isSecondaryTrack(e))z(le,this)&&(Q(z(le,this)),q(le,this,null));else if(z(ue,this)){var t=z(ue,this).parentNode;t&&Q(t),q(ue,this,null),q(le,this,null)}}},{key:"destroyNativeTracks",value:function(e,t){if(e)for(var n="number"==typeof t,r=e.textTracks||[],i=0;i<r.length;i++){var a=r[i];n&&t!==i||a.label.includes("manualTrack")&&(a.mode="disabled")}}},{key:"destroyStoredTrackInfo",value:function(e){this.isPrimaryTrack(e)?(q(re,this,-1),q(ce,this,null)):this.isSecondaryTrack(e)?(q(ie,this,-1),q(de,this,null)):(q(re,this,-1),q(ie,this,-1),q(ce,this,null),q(de,this,null))}},{key:"destroyCustomTrack",value:function(e,t){this.destroyCustomRenderedTrackElements(t),this.destroyNativeTracks(e,t),this.destroyStoredTrackInfo(t);var n=z(te,this);n&&n.dispose(),q(te,this,null);var r=z(ne,this);r&&r.dispose(),q(ne,this,null)}},{key:"fetchSubtitlesUwp",value:function(e){return Windows.Storage.StorageFile.getFileFromPathAsync(e.Path).then((function(e){return Windows.Storage.FileIO.readTextAsync(e)})).then((function(e){return JSON.parse(e)}))}},{key:"fetchSubtitles",value:(R=_(V().m((function e(t,n){var r;return V().w((function(e){for(;;)switch(e.n){case 0:if(!window.Windows||!S.Ay.isLocalItem(n)){e.n=1;break}return e.a(2,this.fetchSubtitlesUwp(t,n));case 1:return this.incrementFetchQueue(),e.p=2,e.n=3,fetch(X(t,n,".js"));case 3:if((r=e.v).ok){e.n=4;break}throw new Error(r);case 4:return e.a(2,r.json());case 5:return e.p=5,this.decrementFetchQueue(),e.f(5);case 6:return e.a(2)}}),e,this,[[2,,5,6]])}))),function(e,t){return R.apply(this,arguments)})},{key:"setTrackForDisplay",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(t){var r=z(re,this);if(this.isSecondaryTrack(n)&&(r=z(ie,this)),r!==t.Index){this.resetSubtitleOffset();var i=this._currentPlayOptions.item;this.destroyCustomTrack(e,n),this.isSecondaryTrack(n)?q(ie,this,t.Index):q(re,this,t.Index),this.renderTracksEvents(e,t,i,n)}}else this.destroyCustomTrack(e,this.isSecondaryTrack(n)?n:void 0)}},{key:"renderSsaAss",value:function(e,t,r){var i=this,a=["application/vnd.ms-opentype","application/x-truetype-font","font/otf","font/ttf","font/woff","font/woff2"],o=[],s=this._currentPlayOptions.mediaSource.MediaAttachments||[],u=d.tF.getApiClient(r);s.forEach((function(e){a.includes(e.MimeType)&&o.push(u.getUrl(e.DeliveryUrl))}));var l=u.getUrl("/FallbackFont/Fonts",{ApiKey:u.accessToken()}),c=this;Promise.all([n.e(41783),n.e(41374)]).then(n.t.bind(n,12541,23)).then((function(n){var a,s=n.default,d=(a=i._currentPlayOptions.mediaSource,a.MediaStreams.filter((function(e){return"Video"===e.Type})))[0],f={video:e,subUrl:X(t,r),fonts:o,workerUrl:"".concat(g.appRouter.baseUrl(),"/libraries/subtitles-octopus-worker.js"),legacyWorkerUrl:"".concat(g.appRouter.baseUrl(),"/libraries/subtitles-octopus-worker-legacy.js"),onError:function(){var e=this;q(te,c,null),setTimeout((function(){(0,b.jK)(e,h.F.ASS_RENDER_ERROR)}),0)},timeOffset:(i._currentPlayOptions.transcodingOffsetTicks||0)/1e7,renderMode:"wasm-blend",dropAllAnimations:!1,libassMemoryLimit:40,libassGlyphLimit:40,targetFps:(null==d?void 0:d.ReferenceFrameRate)||24,prescaleFactor:.8,prescaleHeightLimit:1080,maxRenderHeight:2160,resizeVariation:.2,renderAhead:90};Promise.all([u.getNamedConfiguration("encoding"),K(f.workerUrl),K(f.legacyWorkerUrl)]).then((function(e){var t=I(e,3),n=t[0],r=t[1],a=t[2];f.workerUrl=r,f.legacyWorkerUrl=a,n.EnableFallbackFont?u.getJSON(l).then((function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e){var t=u.getUrl("/FallbackFont/Fonts/".concat(encodeURIComponent(e.Name)),{ApiKey:u.accessToken()});o.push(t)})),q(te,i,new s(f))})):q(te,i,new s(f))}))}))}},{key:"renderPgs",value:function(e,t,r){var i=this;Promise.all([n.e(75748),n.e(18993)]).then(n.bind(n,73639)).then((function(n){var a="auto"===i.getAspectRatio()?"contain":i.getAspectRatio(),o={video:e,subUrl:X(t,r),workerUrl:"".concat(g.appRouter.baseUrl(),"/libraries/libpgs.worker.js"),timeOffset:(i._currentPlayOptions.transcodingOffsetTicks||0)/1e7,aspectRatio:a};q(ne,i,new n.PgsRenderer(o))}))}},{key:"renderSubtitlesWithCustomElement",value:function(e,t,n,r){var i=this;this.fetchSubtitles(t,n).then((function(t){var n=f.currentSettings.getSubtitleAppearanceSettings(),a=parseInt(n.verticalPosition,10);if(z(ue,i)||i.isSecondaryTrack(r)){if(!z(le,i)&&i.isSecondaryTrack(r)){var o=document.querySelector(".videoSubtitles");if(!o)return;var s=document.createElement("div");s.classList.add("videoSecondarySubtitlesInner"),a<0?o.insertBefore(s,o.firstChild):o.appendChild(s),q(le,i,s),i.setSubtitleAppearance(o,z(le,i)),q(de,i,t.TrackEvents)}}else{var u=document.querySelector(".videoSubtitles");u||(u=document.createElement("div")).classList.add("videoSubtitles");var l=document.createElement("div");l.classList.add("videoSubtitlesInner"),u.appendChild(l),q(ue,i,l),i.setSubtitleAppearance(u,z(ue,i)),e.parentNode.appendChild(u),q(ce,i,t.TrackEvents)}}))}},{key:"setSubtitleAppearance",value:function(e,t){l.Ay.applyStyles({text:t,window:e},f.currentSettings.getSubtitleAppearanceSettings())}},{key:"getCueCss",value:function(e,t){return"".concat(t,"::cue {\n ").concat(e.text.map((function(e){return void 0!==e.value&&""!==e.value?"".concat(e.name,":").concat(e.value,"!important;"):""})).join(""),"\n }")}},{key:"setCueAppearance",value:function(){var e="".concat(this.id,"-cuestyle"),t=document.querySelector("#".concat(e));t||((t=document.createElement("style")).id=e,document.getElementsByTagName("head")[0].appendChild(t)),t.innerHTML=this.getCueCss(l.Ay.getStyles(f.currentSettings.getSubtitleAppearanceSettings()),".htmlvideoplayer")}},{key:"renderTracksEvents",value:(F=_(V().m((function e(t,n,r){var i,a,o,s=arguments;return V().w((function(e){for(;;)switch(e.n){case 0:if(i=s.length>3&&void 0!==s[3]?s[3]:0,S.Ay.isLocalItem(r)&&!n.IsExternal){e.n=3;break}if("ssa"!==(a=(n.Codec||"").toLowerCase())&&"ass"!==a){e.n=1;break}return this.renderSsaAss(t,n,r),e.a(2);case 1:if("pgssub"!==a){e.n=2;break}return this.renderPgs(t,n,r),e.a(2);case 2:if(!u(f.currentSettings)){e.n=3;break}return this.renderSubtitlesWithCustomElement(t,n,r,i),e.a(2);case 3:if(o=null,t.textTracks&&t.textTracks.length>(this.isSecondaryTrack(i)?1:0)){o=t.textTracks[i];try{for(o.mode="showing";o.cues.length;)o.removeCue(o.cues[0])}catch(e){console.error("error removing cue from textTrack",e)}o.mode="disabled"}else o=t.addTextTrack("subtitles","manualTrack","und");this.fetchSubtitles(n,r).then((function(e){console.debug("downloaded ".concat(e.TrackEvents.length," track events"));var t,n=f.currentSettings.getSubtitleAppearanceSettings(),r=parseInt(n.verticalPosition,10),i=L(e.TrackEvents);try{for(i.s();!(t=i.n()).done;){var a=t.value,s=window.VTTCue||window.TextTrackCue,u=J(a.Text,!1),l=new s(a.StartPositionTicks/1e7,a.EndPositionTicks/1e7,u);if("auto"===l.line)if(r<0){var c=(u.match(/\n/g)||[]).length;l.line=r-c}else l.line=r;o.addCue(l)}}catch(e){i.e(e)}finally{i.f()}o.mode="showing"}));case 4:return e.a(2)}}),e,this)}))),function(e,t,n){return F.apply(this,arguments)})},{key:"updateSubtitleText",value:function(e){for(var t=[z(ce,this),z(de,this)],n=[z(ue,this),z(le,this)],r=0;r<t.length;r++){var a=t[r],o=n[r];if(a&&o){var s,u,l=1e4*e,c=void 0,d=L(a);try{for(d.s();!(u=d.n()).done;){var f=u.value;if(f.StartPositionTicks<=l&&f.EndPositionTicks>=l){c=f;break}}}catch(e){d.e(e)}finally{d.f()}null!==(s=c)&&void 0!==s&&s.Text?(o.innerHTML=i().sanitize(J(c.Text,!0)),o.classList.remove("hide")):o.classList.add("hide")}}}},{key:"setCurrentTrackElement",value:function(e,t){console.debug("setting new text track index to: ".concat(e));var n,r=this._currentPlayOptions.mediaSource.MediaStreams.filter((function(e){return"Subtitle"===e.Type})),i=-1===e?null:r.filter((function(t){return t.Index===e}))[0],a="DirectPlay"===this._currentPlayOptions.playMethod,o=v.A.alwaysBurnInSubtitleWhenTranscoding();if(!a&&o){var u=d.tF.getApiClient(this._currentPlayOptions.item.ServerId);n=u.getSessions({deviceId:u.deviceId()}).then((function(e){return e[0]||{}}),(function(){return Promise.resolve({})}))}else n=Promise.resolve({});var l=this;n.then((function(n){var a;!n.TranscodingInfo||n.TranscodingInfo.IsVideoDirect?(r.forEach((function(e){var t;e.DeliveryMethod=null!==(t=e.realDeliveryMethod)&&void 0!==t?t:e.DeliveryMethod})),l.setTrackForDisplay(z(he,l),i,t),function(e,t){if("Embed"===(null==t?void 0:t.DeliveryMethod))return!0;if(s.A.firefox&&M(e))return!1;if(s.A.ps4)return!1;if(s.A.web0s)return!1;if(s.A.edge)return!1;if(s.A.iOS&&(s.A.iosVersion||10)<10)return!1;if(t){var n=(t.Codec||"").toLowerCase();if("ssa"===n||"ass"===n||"pgssub"===n)return!1}return!0}(null===(a=l._currentPlayOptions)||void 0===a?void 0:a.mediaSource,i)?-1!==e&&l.setCueAppearance():(e=-1,i=null)):(r.forEach((function(e){e.realDeliveryMethod=e.DeliveryMethod,e.DeliveryMethod="Encode"})),l.setTrackForDisplay(z(he,l),null,-1))}))}},{key:"createMediaElement",value:function(e){var t=this,r=document.querySelector(".videoPlayerContainer");if(r){e.fullscreen&&(document.body.classList.add("hide-scroll"),!this.forcedFullscreen&&!window.NativeShell&&s.A.web0s&&o.A.isEnabled&&o.A.request().then((function(){t.forcedFullscreen=!0})));var i=r.querySelector("video");return e.backdropUrl&&(i.poster=e.backdropUrl),Promise.resolve(i)}return n.e(98887).then(n.bind(n,28157)).then((function(){e.fullscreen&&m.Ay.show();var n=document.createElement("div");n.setAttribute("dir","ltr"),n.classList.add("videoPlayerContainer"),e.fullscreen&&n.classList.add("videoPlayerContainer-onTop");var r="",i="htmlvideoplayer";p.g.supports(c.Y.HtmlVideoAutoplay)?s.A.web0s?r+='<video class="'+i+'" preload="auto" autoplay="autoplay" webkit-playsinline playsinline>':r+='<video class="'+i+'" preload="metadata" autoplay="autoplay" webkit-playsinline playsinline>':r+='<video class="'+i+'" preload="metadata" autoplay="autoplay" controls="controls" webkit-playsinline playsinline>',r+="</video>",n.innerHTML=r;var a,u=n.querySelector("video");if(p.g.supports(c.Y.PhysicalVolumeControl)||(u.volume=(0,b.Y3)()),u.addEventListener("timeupdate",t.onTimeUpdate),u.addEventListener("ended",t.onEnded),u.addEventListener("volumechange",t.onVolumeChange),u.addEventListener("pause",t.onPause),u.addEventListener("playing",t.onPlaying),u.addEventListener("play",t.onPlay),u.addEventListener("click",t.onClick),u.addEventListener("dblclick",t.onDblClick),u.addEventListener("waiting",t.onWaiting),e.backdropUrl&&(u.poster=e.backdropUrl),document.body.insertBefore(n,document.body.firstChild),q(Y,t,n),q(he,t,u),delete t.forcedFullscreen,e.fullscreen){if(document.body.classList.add("hide-scroll"),!window.NativeShell&&s.A.web0s&&o.A.isEnabled)return o.A.request().then((function(){t.forcedFullscreen=!0})),u;if(!s.A.slow&&s.A.supportsCssAnimation())return(a=n,new Promise((function(e){a.style.animation="htmlvideoplayer-zoomin ".concat(240,"ms ease-in normal"),y.Ay.addEventListener(a,y.Ay.whichAnimationEvent(),e,{once:!0})}))).then((function(){return u}))}return u}))}},{key:"canPlayMediaType",value:function(e){return"video"===(e||"").toLowerCase()}},{key:"supportsPlayMethod",value:function(e,t){return!p.g.supportsPlayMethod||p.g.supportsPlayMethod(e,t)}},{key:"getDeviceProfile",value:function(t,n){var r=this;return e.getDeviceProfileInternal(t,n).then((function(e){return q(ge,r,e),e}))}},{key:"supports",value:function(t){return z(fe,this)||q(fe,this,e.getSupportedFeatures()),z(fe,this).includes(t)}},{key:"currentTime",value:function(e){var t=z(he,this);if(t){if(null!=e)return void(t.currentTime=e/1e3);var n=z(ke,this);return n?1e3*n:1e3*(t.currentTime||0)}}},{key:"duration",value:function(){var e=z(he,this);if(e){var t=e.duration;if((0,b.di)(t))return 1e3*t}return null}},{key:"canSetAudioStreamIndex",value:function(){var e=z(he,this);return!!e&&(0,A.L)(e)}},{key:"setPictureInPictureEnabled",value:function(t){var n=z(he,this);document.pictureInPictureEnabled?n&&(t?n.requestPictureInPicture().catch(e.onPictureInPictureError):document.exitPictureInPicture().catch(e.onPictureInPictureError)):window.Windows?(this.isPip=t,t?Windows.UI.ViewManagement.ApplicationView.getForCurrentView().tryEnterViewModeAsync(Windows.UI.ViewManagement.ApplicationViewMode.compactOverlay):Windows.UI.ViewManagement.ApplicationView.getForCurrentView().tryEnterViewModeAsync(Windows.UI.ViewManagement.ApplicationViewMode.default)):null!=n&&n.webkitSupportsPresentationMode&&"function"==typeof n.webkitSetPresentationMode&&n.webkitSetPresentationMode(t?"picture-in-picture":"inline")}},{key:"isPictureInPictureEnabled",value:function(){if(document.pictureInPictureEnabled)return!!document.pictureInPictureElement;if(window.Windows)return this.isPip||!1;var e=z(he,this);return!!e&&"picture-in-picture"===e.webkitPresentationMode}},{key:"isAirPlayEnabled",value:function(){return!!document.AirPlayEnabled&&!!document.AirplayElement}},{key:"setAirPlayEnabled",value:function(e){var t=z(he,this);document.AirPlayEnabled?t&&(e?t.requestAirPlay().catch((function(e){console.error("Error requesting AirPlay",e)})):document.exitAirPLay().catch((function(e){console.error("Error exiting AirPlay",e)}))):t.webkitShowPlaybackTargetPicker()}},{key:"setBrightness",value:function(e){var t=z(he,this);if(t){e=Math.max(0,e);var n=e=Math.min(100,e),r=(n=Math.max(20,n))>=100?"none":n/100;t.style["-webkit-filter"]="brightness(".concat(r,")"),t.style.filter="brightness(".concat(r,")"),t.brightnessValue=e,C.A.trigger(this,"brightnesschange")}}},{key:"getBrightness",value:function(){var e=z(he,this);if(e){var t=e.brightnessValue;return null==t?100:t}}},{key:"seekable",value:function(){var e=z(he,this);if(e){var t=e.seekable;if(null!=t&&t.length){var n=t.start(0),r=t.end(0);return(0,b.di)(n)||(n=0),(0,b.di)(r)||(r=0),r-n>0}return!1}}},{key:"pause",value:function(){var e=z(he,this);e&&e.pause()}},{key:"resume",value:function(){this.unpause()}},{key:"unpause",value:function(){var e=z(he,this);e&&e.play()}},{key:"paused",value:function(){var e=z(he,this);return!!e&&e.paused}},{key:"setPlaybackRate",value:function(e){var t=z(he,this);t&&(t.playbackRate=e)}},{key:"getPlaybackRate",value:function(){var e=z(he,this);return e?e.playbackRate:null}},{key:"getSupportedPlaybackRates",value:function(){return[{name:"0.5x",id:.5},{name:"0.75x",id:.75},{name:"1x",id:1},{name:"1.25x",id:1.25},{name:"1.5x",id:1.5},{name:"1.75x",id:1.75},{name:"2x",id:2},{name:"2.5x",id:2.5},{name:"3x",id:3},{name:"3.5x",id:3.5},{name:"4.0x",id:4}]}},{key:"setVolume",value:function(e){var t=z(he,this);t&&(t.volume=Math.pow(e/100,3))}},{key:"getVolume",value:function(){var e=z(he,this);if(e)return Math.min(Math.round(100*Math.pow(e.volume,1/3)),100)}},{key:"volumeUp",value:function(){this.setVolume(Math.min(this.getVolume()+2,100))}},{key:"volumeDown",value:function(){this.setVolume(Math.max(this.getVolume()-2,0))}},{key:"setMute",value:function(e){var t=z(he,this);t&&(t.muted=e)}},{key:"isMuted",value:function(){var e=z(he,this);return!!e&&e.muted}},{key:"setAspectRatio",value:function(e){v.A.aspectRatio(e),G(be,this,we).call(this,e)}},{key:"getAspectRatio",value:function(){return v.A.aspectRatio()||"auto"}},{key:"getSupportedAspectRatios",value:function(){return[{name:w.Ay.translate("Auto"),id:"auto"},{name:w.Ay.translate("AspectRatioCover"),id:"cover"},{name:w.Ay.translate("AspectRatioFill"),id:"fill"}]}},{key:"togglePictureInPicture",value:function(){return this.setPictureInPictureEnabled(!this.isPictureInPictureEnabled())}},{key:"toggleAirPlay",value:function(){return this.setAirPlayEnabled(!this.isAirPlayEnabled())}},{key:"getBufferedRanges",value:function(){var e=z(he,this);return e?(0,b.qh)(this,e):[]}},{key:"getStats",value:function(){var e=z(he,this),t=this._currentPlayOptions||[],n=[];if(!e)return Promise.resolve({categories:n});var r={stats:[],type:"media"};if(n.push(r),t.url){var i=document.createElement("a");i.setAttribute("href",t.url);var a=(i.protocol||"").replace(":","");a&&r.stats.push({label:w.Ay.translate("LabelProtocol"),value:a}),i=null}this._hlsPlayer?r.stats.push({label:w.Ay.translate("LabelStreamType"),value:"HLS"}):r.stats.push({label:w.Ay.translate("LabelStreamType"),value:"Video"});var o={stats:[],type:"video"};n.push(o);var u=window.devicePixelRatio||1,l=e.getBoundingClientRect?e.getBoundingClientRect():{},c=Math.round(l.height*u),d=Math.round(l.width*u);if(d&&c&&!s.A.tv&&o.stats.push({label:w.Ay.translate("LabelPlayerDimensions"),value:"".concat(d,"x").concat(c)}),c=e.videoHeight,(d=e.videoWidth)&&c&&o.stats.push({label:w.Ay.translate("LabelVideoResolution"),value:"".concat(d,"x").concat(c)}),e.getVideoPlaybackQuality){var f=e.getVideoPlaybackQuality(),h=f.droppedVideoFrames||0;o.stats.push({label:w.Ay.translate("LabelDroppedFrames"),value:h});var v=f.corruptedVideoFrames||0;o.stats.push({label:w.Ay.translate("LabelCorruptedFrames"),value:v})}var p={stats:[],type:"audio"};n.push(p);var m=e.sinkId;return m&&p.stats.push({label:"Sink Id:",value:m}),Promise.resolve({categories:n})}}],O=[{key:"getDeviceProfileInternal",value:function(e,t){return p.g.getDeviceProfile?p.g.getDeviceProfile(e,t):(0,A.A)({})}},{key:"getSupportedFeatures",value:function(){var e=[],t=document.createElement("video");return("function"==typeof t.webkitSupportsPresentationMode&&t.webkitSupportsPresentationMode("picture-in-picture")&&"function"==typeof t.webkitSetPresentationMode||window.Windows&&Windows.UI.ViewManagement.ApplicationView.getForCurrentView().isViewModeSupported(Windows.UI.ViewManagement.ApplicationViewMode.compactOverlay)||document.pictureInPictureEnabled)&&e.push("PictureInPicture"),(s.A.safari||s.A.iOS||s.A.iPad)&&e.push("AirPlay"),"number"==typeof t.playbackRate&&e.push("PlaybackRate"),e.push("SetBrightness"),e.push("SetAspectRatio"),e.push("SecondarySubtitles"),e}},{key:"onPictureInPictureError",value:function(e){console.error("Picture in picture error: ".concat(e))}}],r&&D(t.prototype,r),O&&D(t,O),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,O,F,R,W,U}();function we(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAspectRatio(),t=z(he,this);t&&("auto"===e?t.style.removeProperty("object-fit"):t.style["object-fit"]=e),z(ne,this)&&(z(ne,this).aspectRatio="auto"===e?"contain":e)}var Ae=Se},64763:function(e,t,n){function r(e,t){var n=[];switch(e.textSize||""){case"smaller":n.push({name:"font-size",value:".8em"});break;case"small":n.push({name:"font-size",value:"inherit"});break;case"larger":n.push({name:"font-size",value:"2em"});break;case"extralarge":n.push({name:"font-size",value:"2.2em"});break;case"large":n.push({name:"font-size",value:"1.72em"});break;default:n.push({name:"font-size",value:"1.36em"})}switch("bold"===(e.textWeight||"")?n.push({name:"font-weight",value:"bold"}):n.push({name:"font-weight",value:"normal"}),e.dropShadow||""){case"raised":n.push({name:"text-shadow",value:"-0.04em -0.04em #fff, 0px -0.04em #fff, -0.04em 0px #fff, 0.04em 0.04em #000, 0px 0.04em #000, 0.04em 0px #000"});break;case"depressed":n.push({name:"text-shadow",value:"0.04em 0.04em #fff, 0px 0.04em #fff, 0.04em 0px #fff, -0.04em -0.04em #000, 0px -0.04em #000, -0.04em 0px #000"});break;case"uniform":n.push({name:"text-shadow",value:"#000 0px 0.03em, #000 0px -0.03em, #000 0px 0.05em, #000 0px -0.05em, #000 0.03em 0px, #000 -0.03em 0px, #000 0.03em 0.03em, #000 -0.03em 0.03em, #000 0.03em -0.03em, #000 -0.03em -0.03em, #000 0.03em 0.05em, #000 -0.03em 0.05em, #000 0.03em -0.05em, #000 -0.03em -0.05em, #000 0.05em 0px, #000 -0.05em 0px, #000 0.05em 0.03em, #000 -0.05em 0.03em, #000 0.05em -0.03em, #000 -0.05em -0.03em"});break;case"none":n.push({name:"text-shadow",value:"none"});break;default:n.push({name:"text-shadow",value:"#000000 0px 0px 7px"})}var r=e.textBackground||"transparent";r&&n.push({name:"background-color",value:r});var i=e.textColor||"#ffffff";switch(i&&n.push({name:"color",value:i}),e.font||""){case"typewriter":n.push({name:"font-family",value:'"Courier New",monospace'}),n.push({name:"font-variant",value:"none"});break;case"print":n.push({name:"font-family",value:"Georgia,Times New Roman,Arial,Helvetica,serif"}),n.push({name:"font-variant",value:"none"});break;case"console":n.push({name:"font-family",value:"Consolas,Lucida Console,Menlo,Monaco,monospace"}),n.push({name:"font-variant",value:"none"});break;case"cursive":n.push({name:"font-family",value:"Lucida Handwriting,Brush Script MT,Segoe Script,cursive,Quintessential,system-ui,-apple-system,BlinkMacSystemFont,sans-serif"}),n.push({name:"font-variant",value:"none"});break;case"casual":n.push({name:"font-family",value:"Gabriola,Segoe Print,Comic Sans MS,Chalkboard,Short Stack,system-ui,-apple-system,BlinkMacSystemFont,sans-serif"}),n.push({name:"font-variant",value:"none"});break;case"smallcaps":n.push({name:"font-family",value:"Copperplate Gothic,Copperplate Gothic Bold,Copperplate,system-ui,-apple-system,BlinkMacSystemFont,sans-serif"}),n.push({name:"font-variant",value:"small-caps"});break;default:n.push({name:"font-family",value:"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol"}),n.push({name:"font-variant",value:"none"})}if(!t){var a=parseInt(e.verticalPosition,10);if(a<0){var o=1.35*Math.abs(a+1);n.push({name:"margin-bottom",value:"".concat(o,"em")}),n.push({name:"margin-top",value:""})}else{var s=1.35*a;n.push({name:"margin-bottom",value:""}),n.push({name:"margin-top",value:"".concat(s,"em")})}}return n}function i(e,t){var n=[];return t||(parseInt(e.verticalPosition,10)<0?(n.push({name:"top",value:""}),n.push({name:"bottom",value:"0"})):(n.push({name:"top",value:"0"}),n.push({name:"bottom",value:""}))),n}function a(e,t){return{text:r(e,t),window:i(e,t)}}function o(e,t){for(var n=0,r=e.length;n<r;n++){var i=e[n];t.style[i.name]=i.value}}n(96054),t.Ay={getStyles:a,applyStyles:function(e,t){var n=a(t,!!e.preview);e.text&&o(n.text,e.text),e.window&&o(n.window,e.window)}}}}]);