"undefined"!=typeof window&&function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Hls=e():t.Hls=e()}(this,(function(){return function(t){var e={};function r(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,a){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(a,n,function(e){return t[e]}.bind(null,n));return a},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/dist/",r(r.s=20)}([function(t,e,r){"use strict";var a;r.d(e,"a",(function(){return a})),function(t){t.MEDIA_ATTACHING="hlsMediaAttaching",t.MEDIA_ATTACHED="hlsMediaAttached",t.MEDIA_DETACHING="hlsMediaDetaching",t.MEDIA_DETACHED="hlsMediaDetached",t.BUFFER_RESET="hlsBufferReset",t.BUFFER_CODECS="hlsBufferCodecs",t.BUFFER_CREATED="hlsBufferCreated",t.BUFFER_APPENDING="hlsBufferAppending",t.BUFFER_APPENDED="hlsBufferAppended",t.BUFFER_EOS="hlsBufferEos",t.BUFFER_FLUSHING="hlsBufferFlushing",t.BUFFER_FLUSHED="hlsBufferFlushed",t.MANIFEST_LOADING="hlsManifestLoading",t.MANIFEST_LOADED="hlsManifestLoaded",t.MANIFEST_PARSED="hlsManifestParsed",t.LEVEL_SWITCHING="hlsLevelSwitching",t.LEVEL_SWITCHED="hlsLevelSwitched",t.LEVEL_LOADING="hlsLevelLoading",t.LEVEL_LOADED="hlsLevelLoaded",t.LEVEL_UPDATED="hlsLevelUpdated",t.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",t.LEVELS_UPDATED="hlsLevelsUpdated",t.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",t.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",t.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",t.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",t.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",t.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",t.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",t.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",t.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",t.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",t.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",t.CUES_PARSED="hlsCuesParsed",t.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",t.INIT_PTS_FOUND="hlsInitPtsFound",t.FRAG_LOADING="hlsFragLoading",t.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",t.FRAG_LOADED="hlsFragLoaded",t.FRAG_DECRYPTED="hlsFragDecrypted",t.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",t.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",t.FRAG_PARSING_METADATA="hlsFragParsingMetadata",t.FRAG_PARSED="hlsFragParsed",t.FRAG_BUFFERED="hlsFragBuffered",t.FRAG_CHANGED="hlsFragChanged",t.FPS_DROP="hlsFpsDrop",t.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",t.ERROR="hlsError",t.DESTROYING="hlsDestroying",t.KEY_LOADING="hlsKeyLoading",t.KEY_LOADED="hlsKeyLoaded",t.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",t.BACK_BUFFER_REACHED="hlsBackBufferReached"}(a||(a={}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return l}));var a=function(){},n={trace:a,debug:a,log:a,warn:a,info:a,error:a},i=n;function o(t){var e=self.console[t];return e?e.bind(self.console,"["+t+"] >"):a}function s(t){if(self.console&&!0===t||"object"==typeof t){!function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),a=1;a>8*(15-r)&255;return e},r.setDecryptDataFromLevelKey=function(t,e){var r=t;return"AES-128"===(null==t?void 0:t.method)&&t.uri&&!t.iv&&((r=s.a.fromURI(t.uri)).method=t.method,r.iv=this.createInitializationVector(e),r.keyFormat="identity"),r},r.setElementaryStreamInfo=function(t,e,r,a,n,i){void 0===i&&(i=!1);var o=this.elementaryStreams,s=o[t];s?(s.startPTS=Math.min(s.startPTS,e),s.endPTS=Math.max(s.endPTS,r),s.startDTS=Math.min(s.startDTS,a),s.endDTS=Math.max(s.endDTS,n)):o[t]={startPTS:e,endPTS:r,startDTS:a,endDTS:n,partial:i}},r.clearElementaryStreamInfo=function(){var t=this.elementaryStreams;t[a.AUDIO]=null,t[a.VIDEO]=null,t[a.AUDIOVIDEO]=null},d(e,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var t=this.sn;"number"!=typeof t&&(this.levelkey&&"AES-128"===this.levelkey.method&&!this.levelkey.iv&&o.b.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),t=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,t)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime)return null;if(!Object(n.a)(this.programDateTime))return null;var t=Object(n.a)(this.duration)?this.duration:0;return this.programDateTime+1e3*t}},{key:"encrypted",get:function(){var t;return!(null===(t=this.decryptdata)||void 0===t||!t.keyFormat||!this.decryptdata.uri)}}]),e}(h),f=function(t){function e(e,r,a,n,i){var o;(o=t.call(this,a)||this).fragOffset=0,o.duration=0,o.gap=!1,o.independent=!1,o.relurl=void 0,o.fragment=void 0,o.index=void 0,o.stats=new l.a,o.duration=e.decimalFloatingPoint("DURATION"),o.gap=e.bool("GAP"),o.independent=e.bool("INDEPENDENT"),o.relurl=e.enumeratedString("URI"),o.fragment=r,o.index=n;var s=e.enumeratedString("BYTERANGE");return s&&o.setByteRange(s,i),i&&(o.fragOffset=i.fragOffset+i.duration),o}return c(e,t),d(e,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var t=this.elementaryStreams;return!!(t.audio||t.video||t.audiovideo)}}]),e}(h)},function(t,e,r){"use strict";r.d(e,"b",(function(){return u})),r.d(e,"g",(function(){return d})),r.d(e,"f",(function(){return h})),r.d(e,"d",(function(){return p})),r.d(e,"c",(function(){return f})),r.d(e,"e",(function(){return y})),r.d(e,"h",(function(){return v})),r.d(e,"a",(function(){return g}));var a=r(9),n=r(5),i=Math.pow(2,32)-1,o=[].push;function s(t){return String.fromCharCode.apply(null,t)}function l(t,e){"data"in t&&(e+=t.start,t=t.data);var r=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3];return r<0?4294967296+r:r}function c(t,e,r){"data"in t&&(e+=t.start,t=t.data),t[e]=r>>24,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r}function u(t,e){var r,a,n,i=[];if(!e.length)return i;"data"in t?(r=t.data,a=t.start,n=t.end):(a=0,n=(r=t).byteLength);for(var c=a;c1?c+d:n;if(s(r.subarray(c+4,c+8))===e[0])if(1===e.length)i.push({data:r,start:c+8,end:h});else{var p=u({data:r,start:c+8,end:h},e.slice(1));p.length&&o.apply(i,p)}c=h}return i}function d(t){var e=u(t,["moov"])[0],r=e?e.end:null,a=u(t,["sidx"]);if(!a||!a[0])return null;var n=[],i=a[0],o=i.data[0],s=0===o?8:16,c=l(i,s);s+=4,s+=0===o?8:16,s+=2;var d=i.end+0,h=function(t,e){"data"in t&&(e+=t.start,t=t.data);var r=t[e]<<8|t[e+1];return r<0?65536+r:r}(i,s);s+=2;for(var p=0;p>>31)return console.warn("SIDX has hierarchical references (not supported)"),null;var v=l(i,f);f+=4,n.push({referenceSize:y,subsegmentDuration:v,info:{duration:v/c,start:d,end:d+y-1}}),d+=y,s=f+=4}return{earliestPresentationTime:0,timescale:c,version:o,referencesCount:h,references:n,moovEndOffset:r}}function h(t){for(var e=[],r=u(t,["moov","trak"]),a=0;a0)return t.subarray(r,r+a)},s=function(t,e){var r=0;return r=(127&t[e])<<21,r|=(127&t[e+1])<<14,(r|=(127&t[e+2])<<7)|127&t[e+3]},l=function(t,e){return n(t,e)&&s(t,e+6)+10<=t.length-e},c=function(t){for(var e=h(t),r=0;r>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c+=String.fromCharCode(i);break;case 12:case 13:o=t[u++],c+=String.fromCharCode((31&i)<<6|63&o);break;case 14:o=t[u++],s=t[u++],c+=String.fromCharCode((15&i)<<12|(63&o)<<6|(63&s)<<0)}}return c};function b(){return a||void 0===self.TextDecoder||(a=new self.TextDecoder("utf-8")),a}},function(t,e,r){"use strict";function a(t,e,r,a){void 0===r&&(r=1),void 0===a&&(a=!1);var n=t*e*r;return a?Math.round(n):n}function n(t,e,r,n){return void 0===r&&(r=1),void 0===n&&(n=!1),a(t,e,1/r,n)}function i(t,e){return void 0===e&&(e=!1),a(t,1e3,1/9e4,e)}function o(t,e){return void 0===e&&(e=1),a(t,9e4,1/e)}r.d(e,"c",(function(){return n})),r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return o}))},function(t,e,r){"use strict";function a(t,e,r){return Uint8Array.prototype.slice?t.slice(e,r):new Uint8Array(Array.prototype.slice.call(t,e,r))}r.d(e,"a",(function(){return a}))},function(t,e,r){"use strict";r.d(e,"c",(function(){return lt})),r.d(e,"d",(function(){return ut})),r.d(e,"a",(function(){return dt})),r.d(e,"b",(function(){return ht}));var a=r(0),n=r(2),i=r(15),o=r(3),s=r(7),l=r(6),c=r(9),u=function(){function t(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var e=t.prototype;return e.resetInitSegment=function(t,e,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},e.resetTimeStamp=function(){},e.resetContiguity=function(){},e.canParse=function(t,e){return!1},e.appendFrame=function(t,e,r){},e.demux=function(t,e){this.cachedData&&(t=Object(l.a)(this.cachedData,t),this.cachedData=null);var r,a,n=s.b(t,0),i=n?n.length:0,o=this._audioTrack,u=this._id3Track,h=n?s.d(n):void 0,p=t.length;for(0!==this.frameIndex&&null!==this.initPTS||(this.initPTS=d(h,e)),n&&n.length>0&&u.samples.push({pts:this.initPTS,dts:this.initPTS,data:n}),a=this.initPTS;i>>5}function v(t,e){return e+1=t.length)return!1;var a=y(t,e);if(a<=r)return!1;var n=e+a;return n===t.length||v(t,n)}return!1}function b(t,e,r,i,o){if(!t.samplerate){var s=function(t,e,r,i){var o,s,l,c,u=navigator.userAgent.toLowerCase(),d=i,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];o=1+((192&e[r+2])>>>6);var f=(60&e[r+2])>>>2;if(!(f>h.length-1))return l=(1&e[r+2])<<2,l|=(192&e[r+3])>>>6,p.b.log("manifest codec:"+i+", ADTS type:"+o+", samplingIndex:"+f),/firefox/i.test(u)?f>=6?(o=5,c=new Array(4),s=f-3):(o=2,c=new Array(2),s=f):-1!==u.indexOf("android")?(o=2,c=new Array(2),s=f):(o=5,c=new Array(4),i&&(-1!==i.indexOf("mp4a.40.29")||-1!==i.indexOf("mp4a.40.5"))||!i&&f>=6?s=f-3:((i&&-1!==i.indexOf("mp4a.40.2")&&(f>=6&&1===l||/vivaldi/i.test(u))||!i&&1===l)&&(o=2,c=new Array(2)),s=f)),c[0]=o<<3,c[0]|=(14&f)>>1,c[1]|=(1&f)<<7,c[1]|=l<<3,5===o&&(c[1]|=(14&s)>>1,c[2]=(1&s)<<7,c[2]|=8,c[3]=0),{config:c,samplerate:h[f],channelCount:l,codec:"mp4a.40."+o,manifestCodec:d};t.trigger(a.a.ERROR,{type:n.b.MEDIA_ERROR,details:n.a.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+f})}(e,r,i,o);if(!s)return;t.config=s.config,t.samplerate=s.samplerate,t.channelCount=s.channelCount,t.codec=s.codec,t.manifestCodec=s.manifestCodec,p.b.log("parsed codec:"+t.codec+", rate:"+s.samplerate+", channels:"+s.channelCount)}}function w(t){return 9216e4/t}function k(t,e,r,a,n){var i=function(t,e,r,a,n){var i=m(t,e),o=y(t,e);if((o-=i)>0)return{headerLength:i,frameLength:o,stamp:r+a*n}}(e,r,a,n,w(t.samplerate));if(i){var o,s=i.frameLength,l=i.headerLength,c=i.stamp,u=l+s,d=Math.max(0,r+u-e.length);d?(o=new Uint8Array(u-l)).set(e.subarray(r+l,e.length),0):o=e.subarray(r+l,r+u);var h={unit:o,pts:c};return d||t.samples.push(h),{sample:h,length:u,missing:d}}}function S(t,e){return(S=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var T=function(t){var e,r;function a(e,r){var a;return(a=t.call(this)||this).observer=void 0,a.config=void 0,a.observer=e,a.config=r,a}r=t,(e=a).prototype=Object.create(r.prototype),e.prototype.constructor=e,S(e,r);var n=a.prototype;return n.resetInitSegment=function(e,r,a){t.prototype.resetInitSegment.call(this,e,r,a),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:e,duration:a,inputTimeScale:9e4,dropped:0}},a.probe=function(t){if(!t)return!1;for(var e=(s.b(t,0)||[]).length,r=t.length;e0},e.demux=function(t){var e=t,r={type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0};if(this.config.progressive){this.remainderData&&(e=Object(l.a)(this.remainderData,t));var a=Object(l.h)(e);this.remainderData=a.remainder,r.samples=a.valid||new Uint8Array}else r.samples=e;return{audioTrack:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0},avcTrack:r,id3Track:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0},textTrack:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},e.flush=function(){var t={type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0};return t.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0},avcTrack:t,id3Track:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0},textTrack:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},e.demuxSampleAes=function(t,e,r){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},e.destroy=function(){},t}();E.minProbeByteLength=1024;var L=E,_=null,A=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],R=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],C=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],D=[0,1,1,4];function O(t,e,r,a,n){if(!(r+24>e.length)){var i=I(e,r);if(i&&r+i.frameLength<=e.length){var o=a+n*(9e4*i.samplesPerFrame/i.sampleRate),s={unit:e.subarray(r,r+i.frameLength),pts:o,dts:o};return t.config=[],t.channelCount=i.channelCount,t.samplerate=i.sampleRate,t.samples.push(s),{sample:s,length:i.frameLength,missing:0}}}}function I(t,e){var r=t[e+1]>>3&3,a=t[e+1]>>1&3,n=t[e+2]>>4&15,i=t[e+2]>>2&3;if(1!==r&&0!==n&&15!==n&&3!==i){var o=t[e+2]>>1&1,s=t[e+3]>>6,l=1e3*A[14*(3===r?3-a:3===a?3:4)+n-1],c=R[3*(3===r?0:2===r?1:2)+i],u=3===s?1:2,d=C[r][a],h=D[a],p=8*d*h,f=Math.floor(d*l/c+o)*h;if(null===_){var m=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);_=m?parseInt(m[1]):0}return!!_&&_<=87&&2===a&&l>=224e3&&0===s&&(t[e+3]=128|t[e+3]),{sampleRate:c,channelCount:u,frameLength:f,samplesPerFrame:p}}}function P(t,e){return 255===t[e]&&224==(224&t[e+1])&&0!=(6&t[e+1])}function M(t,e){return e+1t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,t-=(e=t>>3)>>3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)},e.readBits=function(t){var e=Math.min(this.bitsAvailable,t),r=this.word>>>32-e;return t>32&&p.b.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),(e=t-e)>0&&this.bitsAvailable?r<>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},e.skipUEG=function(){this.skipBits(1+this.skipLZ())},e.skipEG=function(){this.skipBits(1+this.skipLZ())},e.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},e.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},e.readBoolean=function(){return 1===this.readBits(1)},e.readUByte=function(){return this.readBits(8)},e.readUShort=function(){return this.readBits(16)},e.readUInt=function(){return this.readBits(32)},e.skipScalingList=function(t){for(var e=8,r=8,a=0;a=t.length)return void r();if(!(t[e].unit.length<32)){var a=this.decrypter.isSync();if(this.decryptAacSample(t,e,r,a),!a)return}}},e.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,r=new Int8Array(e),a=0,n=32;n=t.length)return void a();for(var n=t[e].units;!(r>=n.length);r++){var i=n[r];if(!(i.data.length<=48||1!==i.type&&5!==i.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(t,e,r,a,i,o),!o)return}}}},t}(),U={video:1,audio:2,id3:3,text:4},j=function(){function t(t,e,r){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=t,this.config=e,this.typeSupported=r}t.probe=function(e){var r=t.syncOffset(e);return!(r<0||(r&&p.b.warn("MPEG2-TS detected but first sync word found @ offset "+r+", junk ahead ?"),0))},t.syncOffset=function(t){for(var e=Math.min(1e3,t.length-564),r=0;r>4>1){if((A=E+5+e[E+4])===E+188)continue}else A=E+4;switch(_){case h:L&&(f&&(s=Y(f))&&this.parseAVCPES(s,!1),f={data:[],size:0}),f&&(f.data.push(e.subarray(A,E+188)),f.size+=E+188-A);break;case m:L&&(v&&(s=Y(v))&&(u.isAAC?this.parseAACPES(s):this.parseMPEGPES(s)),v={data:[],size:0}),v&&(v.data.push(e.subarray(A,E+188)),v.size+=E+188-A);break;case y:L&&(g&&(s=Y(g))&&this.parseID3PES(s),g={data:[],size:0}),g&&(g.data.push(e.subarray(A,E+188)),g.size+=E+188-A);break;case 0:L&&(A+=e[A]+1),k=this._pmtId=H(e,A);break;case k:L&&(A+=e[A]+1);var R=V(e,A,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,i);(h=R.avc)>0&&(c.pid=h),(m=R.audio)>0&&(u.pid=m,u.isAAC=R.isAAC),(y=R.id3)>0&&(d.pid=y),b&&!w&&(p.b.log("reparse from beginning"),b=!1,E=T-188),w=this.pmtParsed=!0;break;case 17:case 8191:break;default:b=!0}}else x++;x>0&&this.observer.emit(a.a.ERROR,a.a.ERROR,{type:n.b.MEDIA_ERROR,details:n.a.FRAG_PARSING_ERROR,fatal:!1,reason:"Found "+x+" TS packet/s that do not start with 0x47"}),c.pesData=f,u.pesData=v,d.pesData=g;var C={audioTrack:u,avcTrack:c,id3Track:d,textTrack:this._txtTrack};return o&&this.extractRemainingSamples(C),C},e.flush=function(){var t,e=this.remainderData;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t},e.extractRemainingSamples=function(t){var e,r=t.audioTrack,a=t.avcTrack,n=t.id3Track,i=a.pesData,o=r.pesData,s=n.pesData;i&&(e=Y(i))?(this.parseAVCPES(e,!0),a.pesData=null):a.pesData=i,o&&(e=Y(o))?(r.isAAC?this.parseAACPES(e):this.parseMPEGPES(e),r.pesData=null):(null!=o&&o.size&&p.b.log("last AAC PES packet truncated,might overlap between fragments"),r.pesData=o),s&&(e=Y(s))?(this.parseID3PES(e),n.pesData=null):n.pesData=s},e.demuxSampleAes=function(t,e,r){var a=this.demux(t,r,!0,!this.config.progressive),n=this.sampleAes=new N(this.observer,this.config,e);return this.decrypt(a,n)},e.decrypt=function(t,e){return new Promise((function(r){var a=t.audioTrack,n=t.avcTrack;a.samples&&a.isAAC?e.decryptAacSamples(a.samples,0,(function(){n.samples?e.decryptAvcSamples(n.samples,0,0,(function(){r(t)})):r(t)})):n.samples&&e.decryptAvcSamples(n.samples,0,0,(function(){r(t)}))}))},e.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},e.parseAVCPES=function(t,e){var r,a=this,n=this._avcTrack,i=this.parseAVCNALu(t.data),o=this.avcSample,l=!1;t.data=null,o&&i.length&&!n.audFound&&(z(o,n),o=this.avcSample=G(!1,t.pts,t.dts,"")),i.forEach((function(e){switch(e.type){case 1:r=!0,o||(o=a.avcSample=G(!0,t.pts,t.dts,"")),o.frame=!0;var i=e.data;if(l&&i.length>4){var c=new B(i).readSliceType();2!==c&&4!==c&&7!==c&&9!==c||(o.key=!0)}break;case 5:r=!0,o||(o=a.avcSample=G(!0,t.pts,t.dts,"")),o.key=!0,o.frame=!0;break;case 6:r=!0;var u=new B(W(e.data));u.readUByte();for(var d=0,h=0,p=!1,f=0;!p&&u.bytesAvailable>1;){d=0;do{d+=f=u.readUByte()}while(255===f);h=0;do{h+=f=u.readUByte()}while(255===f);if(4===d&&0!==u.bytesAvailable){if(p=!0,181===u.readUByte()&&49===u.readUShort()&&1195456820===u.readUInt()&&3===u.readUByte()){for(var m=u.readUByte(),y=31&m,v=[m,u.readUByte()],g=0;g16){for(var b=[],w=0;w<16;w++)b.push(u.readUByte().toString(16)),3!==w&&5!==w&&7!==w&&9!==w||b.push("-");for(var k=h-16,S=new Uint8Array(k),T=0;T=0){var d={data:t.subarray(c,l-i-1),type:u};s.push(d)}else{var h=this.getLastNalUnit();if(h&&(o&&l<=4-o&&h.state&&(h.data=h.data.subarray(0,h.data.byteLength-o)),(r=l-i-1)>0)){var p=new Uint8Array(h.data.byteLength+r);p.set(h.data,0),p.set(t.subarray(0,r),h.data.byteLength),h.data=p,h.state=0}}l=0&&i>=0){var f={data:t.subarray(c,a),type:u,state:i};s.push(f)}if(0===s.length){var m=this.getLastNalUnit();if(m){var y=new Uint8Array(m.data.byteLength+t.byteLength);y.set(m.data,0),y.set(t,m.data.byteLength),m.data=y}}return n.naluState=i,s},e.parseAACPES=function(t){var e,r,i,o,s,l=0,c=this._audioTrack,u=this.aacOverFlow,d=t.data;if(u){this.aacOverFlow=null;var h=u.sample.unit.byteLength,f=Math.min(u.missing,h),m=h-f;u.sample.unit.set(d.subarray(0,f),m),c.samples.push(u.sample),l=u.missing}for(e=l,r=d.length;e1;){var l=new Uint8Array(s[0].length+s[1].length);l.set(s[0]),l.set(s[1],s[0].length),s[0]=l,s.splice(1,1)}if(1===((e=s[0])[0]<<16)+(e[1]<<8)+e[2]){if((r=(e[4]<<8)+e[5])&&r>t.size-6)return null;var c=e[7];192&c&&(n=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,64&c?n-(i=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2)>54e5&&(p.b.warn(Math.round((n-i)/9e4)+"s delta between PTS and DTS, align them"),n=i):i=n);var u=(a=e[8])+9;if(t.size<=u)return null;t.size-=u;for(var d=new Uint8Array(t.size),h=0,f=s.length;hm){u-=m;continue}e=e.subarray(u),m-=u,u=0}d.set(e,o),o+=m}return r&&(r-=a+3),{data:d,pts:n,dts:i,len:r}}return null}function z(t,e){if(t.units.length&&t.frame){if(void 0===t.pts){var r=e.samples,a=r.length;if(!a)return void e.dropped++;var n=r[a-1];t.pts=n.pts,t.dts=n.dts}e.samples.push(t)}t.debug.length&&p.b.log(t.pts+"/"+t.dts+":"+t.debug)}function q(t,e){var r=t.length;if(r>0){if(e.pts>=t[r-1].pts)t.push(e);else for(var a=r-1;a>=0;a--)if(e.pts0?this.lastEndDTS=y:(p.b.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var v=!!h.audio,g=!!h.video,b="";v&&(b+="audio"),g&&(b+="video");var w={data1:u,startPTS:m,startDTS:m,endPTS:y,endDTS:y,type:b,hasAudio:v,hasVideo:g,nb:1,dropped:0};return c.audio="audio"===w.type?w:void 0,c.video="audio"!==w.type?w:void 0,c.text=a,c.id3=r,c.initSegment=d,c},t}(),et=function(t,e,r){return Object(l.d)(t,e)-r};function rt(t,e){var r=null==t?void 0:t.codec;return r&&r.length>4?r:"hvc1"===r?"hvc1.1.c.L120.90":"av01"===r?"av01.0.04M.08":"avc1"===r||e===$.a.VIDEO?"avc1.42e01e":"mp4a.40.5"}var at,nt=tt,it=r(13);try{at=self.performance.now.bind(self.performance)}catch(t){p.b.debug("Unable to use Performance API on this environment"),at=self.Date.now}var ot=[{demux:K,remux:Q.a},{demux:L,remux:nt},{demux:x,remux:Q.a},{demux:J,remux:Q.a}],st=1024;ot.forEach((function(t){var e=t.demux;st=Math.max(st,e.minProbeByteLength)}));var lt=function(){function t(t,e,r,a,n){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new it.a,this.observer=t,this.typeSupported=e,this.config=r,this.vendor=a,this.id=n}var e=t.prototype;return e.configure=function(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()},e.push=function(t,e,r,a){var n=this,i=r.transmuxing;i.executeStart=at();var o=new Uint8Array(t),s=this.cache,c=this.config,u=this.currentTransmuxState,d=this.transmuxConfig;a&&(this.currentTransmuxState=a);var h=function(t,e){var r=null;return t.byteLength>0&&null!=e&&null!=e.key&&null!==e.iv&&null!=e.method&&(r=e),r}(o,e);if(h&&"AES-128"===h.method){var p=this.getDecrypter();if(!c.enableSoftwareAES)return this.decryptionPromise=p.webCryptoDecrypt(o,h.key.buffer,h.iv.buffer).then((function(t){var e=n.push(t,null,r);return n.decryptionPromise=null,e})),this.decryptionPromise;var f=p.softwareDecrypt(o,h.key.buffer,h.iv.buffer);if(!f)return i.executeEnd=at(),ct(r);o=new Uint8Array(f)}var m=a||u,y=m.contiguous,v=m.discontinuity,g=m.trackSwitch,b=m.accurateTimeOffset,w=m.timeOffset,k=m.initSegmentChange,S=d.audioCodec,T=d.videoCodec,x=d.defaultInitPts,E=d.duration,L=d.initSegmentData;if((v||g||k)&&this.resetInitSegment(L,S,T,E),(v||k)&&this.resetInitialTimestamp(x),y||this.resetContiguity(),this.needsProbing(o,v,g)){if(s.dataLength){var _=s.flush();o=Object(l.a)(_,o)}this.configureTransmuxer(o,d)}var A=this.transmux(o,h,w,b,r),R=this.currentTransmuxState;return R.contiguous=!0,R.discontinuity=!1,R.trackSwitch=!1,i.executeEnd=at(),A},e.flush=function(t){var e=this,r=t.transmuxing;r.executeStart=at();var i=this.decrypter,o=this.cache,s=this.currentTransmuxState,l=this.decryptionPromise;if(l)return l.then((function(){return e.flush(t)}));var c=[],u=s.timeOffset;if(i){var d=i.flush();d&&c.push(this.push(d,null,t))}var h=o.dataLength;o.reset();var p=this.demuxer,f=this.remuxer;if(!p||!f)return h>=st&&this.observer.emit(a.a.ERROR,a.a.ERROR,{type:n.b.MEDIA_ERROR,details:n.a.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),r.executeEnd=at(),[ct(t)];var m=p.flush(u);return ut(m)?m.then((function(r){return e.flushRemux(c,r,t),c})):(this.flushRemux(c,m,t),c)},e.flushRemux=function(t,e,r){var a=e.audioTrack,n=e.avcTrack,i=e.id3Track,o=e.textTrack,s=this.currentTransmuxState,l=s.accurateTimeOffset,c=s.timeOffset;p.b.log("[transmuxer.ts]: Flushed fragment "+r.sn+(r.part>-1?" p: "+r.part:"")+" of level "+r.level);var u=this.remuxer.remux(a,n,i,o,c,l,!0,this.id);t.push({remuxResult:u,chunkMeta:r}),r.transmuxing.executeEnd=at()},e.resetInitialTimestamp=function(t){var e=this.demuxer,r=this.remuxer;e&&r&&(e.resetTimeStamp(t),r.resetTimeStamp(t))},e.resetContiguity=function(){var t=this.demuxer,e=this.remuxer;t&&e&&(t.resetContiguity(),e.resetNextTimestamp())},e.resetInitSegment=function(t,e,r,a){var n=this.demuxer,i=this.remuxer;n&&i&&(n.resetInitSegment(e,r,a),i.resetInitSegment(t,e,r))},e.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},e.transmux=function(t,e,r,a,n){return e&&"SAMPLE-AES"===e.method?this.transmuxSampleAes(t,e,r,a,n):this.transmuxUnencrypted(t,r,a,n)},e.transmuxUnencrypted=function(t,e,r,a){var n=this.demuxer.demux(t,e,!1,!this.config.progressive),i=n.audioTrack,o=n.avcTrack,s=n.id3Track,l=n.textTrack;return{remuxResult:this.remuxer.remux(i,o,s,l,e,r,!1,this.id),chunkMeta:a}},e.transmuxSampleAes=function(t,e,r,a,n){var i=this;return this.demuxer.demuxSampleAes(t,e,r).then((function(t){return{remuxResult:i.remuxer.remux(t.audioTrack,t.avcTrack,t.id3Track,t.textTrack,r,a,!1,i.id),chunkMeta:n}}))},e.configureTransmuxer=function(t,e){for(var r,a=this.config,n=this.observer,i=this.typeSupported,o=this.vendor,s=e.audioCodec,l=e.defaultInitPts,c=e.duration,u=e.initSegmentData,d=e.videoCodec,h=0,f=ot.length;h>>8^255&y^99,t[p]=y,e[y]=p;var v=h[p],g=h[v],b=h[g],w=257*h[y]^16843008*y;a[p]=w<<24|w>>>8,n[p]=w<<16|w>>>16,i[p]=w<<8|w>>>24,o[p]=w,w=16843009*b^65537*g^257*v^16843008*p,l[y]=w<<24|w>>>8,c[y]=w<<16|w>>>16,u[y]=w<<8|w>>>24,d[y]=w,p?(p=v^h[h[h[b^v]]],f^=h[h[f]]):p=f=1}},e.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),r=!0,a=0;a1?r-1:0),n=1;n>24&255,s[1]=e>>16&255,s[2]=e>>8&255,s[3]=255&e,s.set(t,4),i=0,e=8;i>24&255,e>>16&255,e>>8&255,255&e,a>>24,a>>16&255,a>>8&255,255&a,n>>24,n>>16&255,n>>8&255,255&n,85,196,0,0]))},t.mdia=function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))},t.mfhd=function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},t.minf=function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))},t.moof=function(e,r,a){return t.box(t.types.moof,t.mfhd(e),t.traf(a,r))},t.moov=function(e){for(var r=e.length,a=[];r--;)a[r]=t.trak(e[r]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(a).concat(t.mvex(e)))},t.mvex=function(e){for(var r=e.length,a=[];r--;)a[r]=t.trex(e[r]);return t.box.apply(null,[t.types.mvex].concat(a))},t.mvhd=function(e,r){r*=e;var a=Math.floor(r/(i+1)),n=Math.floor(r%(i+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,a>>24,a>>16&255,a>>8&255,255&a,n>>24,n>>16&255,n>>8&255,255&n,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t.box(t.types.mvhd,o)},t.sdtp=function(e){var r,a,n=e.samples||[],i=new Uint8Array(4+n.length);for(r=0;r>>8&255),i.push(255&n),i=i.concat(Array.prototype.slice.call(a));for(r=0;r>>8&255),o.push(255&n),o=o.concat(Array.prototype.slice.call(a));var s=t.box(t.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|e.sps.length].concat(i).concat([e.pps.length]).concat(o))),l=e.width,c=e.height,u=e.pixelRatio[0],d=e.pixelRatio[1];return t.box(t.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,c>>8&255,255&c,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),t.box(t.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,d>>24,d>>16&255,d>>8&255,255&d])))},t.esds=function(t){var e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))},t.mp4a=function(e){var r=e.samplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),t.box(t.types.esds,t.esds(e)))},t.mp3=function(e){var r=e.samplerate;return t.box(t.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))},t.stsd=function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))},t.tkhd=function(e){var r=e.id,a=e.duration*e.timescale,n=e.width,o=e.height,s=Math.floor(a/(i+1)),l=Math.floor(a%(i+1));return t.box(t.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,l>>24,l>>16&255,l>>8&255,255&l,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,o>>8&255,255&o,0,0]))},t.traf=function(e,r){var a=t.sdtp(e),n=e.id,o=Math.floor(r/(i+1)),s=Math.floor(r%(i+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,s>>24,s>>16&255,s>>8&255,255&s])),t.trun(e,a.length+16+20+8+16+8+8),a)},t.trak=function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))},t.trex=function(e){var r=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},t.trun=function(e,r){var a,n,i,o,s,l,c=e.samples||[],u=c.length,d=12+16*u,h=new Uint8Array(d);for(r+=8+d,h.set([0,0,15,1,u>>>24&255,u>>>16&255,u>>>8&255,255&u,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),a=0;a>>24&255,i>>>16&255,i>>>8&255,255&i,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,61440&s.degradPrio,15&s.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*a);return t.box(t.types.trun,h)},t.initSegment=function(e){t.types||t.init();var r=t.moov(e),a=new Uint8Array(t.FTYP.byteLength+r.byteLength);return a.set(t.FTYP),a.set(r,t.FTYP.byteLength),a},t}();o.types=void 0,o.HDLR_TYPES=void 0,o.STTS=void 0,o.STSC=void 0,o.STCO=void 0,o.STSZ=void 0,o.VMHD=void 0,o.SMHD=void 0,o.STSD=void 0,o.FTYP=void 0,o.DINF=void 0;var s=o,l=r(0),c=r(2),u=r(1),d=r(4),h=r(8);function p(){return(p=Object.assign||function(t){for(var e=1;e0?t:r.pts}),t[0].pts);return e&&u.b.debug("PTS rollover detected"),r},e.remux=function(t,e,r,a,n,i,o,s){var l,c,h,p,f,m,y=n,v=n,b=t.pid>-1,w=e.pid>-1,k=e.samples.length,S=t.samples.length>0,T=k>1;if((!b||S)&&(!w||T)||this.ISGenerated||o){this.ISGenerated||(h=this.generateIS(t,e,n));var x=this.isVideoContiguous,E=-1;if(T&&(E=function(t){for(var e=0;e0){u.b.warn("[mp4-remuxer]: Dropped "+E+" out of "+k+" video samples due to a missing keyframe");var L=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(E),e.dropped+=E,v+=(e.samples[0].pts-L)/(e.timescale||9e4)}else-1===E&&(u.b.warn("[mp4-remuxer]: No keyframe found out of "+k+" video samples"),m=!1);if(this.ISGenerated){if(S&&T){var _=this.getVideoStartPts(e.samples),A=(g(t.samples[0].pts,_)-_)/e.inputTimeScale;y+=Math.max(0,A),v+=Math.max(0,-A)}if(S){if(t.samplerate||(u.b.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),h=this.generateIS(t,e,n)),c=this.remuxAudio(t,y,this.isAudioContiguous,i,w||T||s===d.b.AUDIO?v:void 0),T){var R=c?c.endPTS-c.startPTS:0;e.inputTimeScale||(u.b.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),h=this.generateIS(t,e,n)),l=this.remuxVideo(e,v,x,R)}}else T&&(l=this.remuxVideo(e,v,x,0));l&&(l.firstKeyFrame=E,l.independent=-1!==E)}}return this.ISGenerated&&(r.samples.length&&(f=this.remuxID3(r,n)),a.samples.length&&(p=this.remuxText(a,n))),{audio:c,video:l,initSegment:h,independent:m,text:p,id3:f}},e.generateIS=function(t,e,r){var n,i,o,l=t.samples,c=e.samples,u=this.typeSupported,d={},h=!Object(a.a)(this._initPTS),p="audio/mp4";if(h&&(n=i=1/0),t.config&&l.length&&(t.timescale=t.samplerate,t.isAAC||(u.mpeg?(p="audio/mpeg",t.codec=""):u.mp3&&(t.codec="mp3")),d.audio={id:"audio",container:p,codec:t.codec,initSegment:!t.isAAC&&u.mpeg?new Uint8Array(0):s.initSegment([t]),metadata:{channelCount:t.channelCount}},h&&(o=t.inputTimeScale,n=i=l[0].pts-Math.round(o*r))),e.sps&&e.pps&&c.length&&(e.timescale=e.inputTimeScale,d.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:s.initSegment([e]),metadata:{width:e.width,height:e.height}},h)){o=e.inputTimeScale;var f=this.getVideoStartPts(c),m=Math.round(o*r);i=Math.min(i,g(c[0].dts,f)-m),n=Math.min(n,f-m)}if(Object.keys(d).length)return this.ISGenerated=!0,h&&(this._initPTS=n,this._initDTS=i),{tracks:d,initPTS:n,timescale:o}},e.remuxVideo=function(t,e,r,a){var n,i,o,d=t.inputTimeScale,m=t.samples,v=[],w=m.length,k=this._initPTS,S=this.nextAvcDts,T=8,x=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY,L=0,_=!1;r&&null!==S||(S=e*d-(m[0].pts-g(m[0].dts,m[0].pts)));for(var A=0;AR.pts&&(L=Math.max(Math.min(L,R.pts-R.dts),-18e3)),R.dts0?A-1:A].dts&&(_=!0)}_&&m.sort((function(t,e){var r=t.dts-e.dts,a=t.pts-e.pts;return r||a})),i=m[0].dts,o=m[m.length-1].dts;var C=Math.round((o-i)/(w-1));if(L<0){if(L<-2*C){u.b.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(h.b)(-C,!0)+" ms");for(var D=L,O=0;OC;if(M||P<-1){M?u.b.warn("AVC: "+Object(h.b)(P,!0)+" ms ("+P+"dts) hole between fragments detected, filling it"):u.b.warn("AVC: "+Object(h.b)(-P,!0)+" ms ("+P+"dts) overlapping between fragments detected"),i=S;var F=m[0].pts-P;m[0].dts=i,m[0].pts=F,u.b.log("Video: First PTS/DTS adjusted: "+Object(h.b)(F,!0)+"/"+Object(h.b)(i,!0)+", delta: "+Object(h.b)(P,!0)+" ms")}}y&&(i=Math.max(0,i));for(var B=0,N=0,U=0;U0?K-1:K].dts;if(at.stretchShortVideoTrack&&null!==this.nextAudioPts){var it=Math.floor(at.maxBufferHole*d),ot=(a?x+a*d:this.nextAudioPts)-X.pts;ot>it?((n=ot-nt)<0&&(n=nt),u.b.log("[mp4-remuxer]: It is approximately "+ot/90+" ms to the next segment; using duration "+n/90+" ms for the last video frame.")):n=nt}else n=nt}var st=Math.round(X.pts-X.dts);v.push(new b(X.key,n,J,st))}if(v.length&&f&&f<70){var lt=v[0].flags;lt.dependsOn=2,lt.isNonSync=0}this.nextAvcDts=S=o+n,this.isVideoContiguous=!0;var ct={data1:s.moof(t.sequenceNumber++,i,p({},t,{samples:v})),data2:z,startPTS:x/d,endPTS:(E+n)/d,startDTS:i/d,endDTS:S/d,type:"video",hasAudio:!1,hasVideo:!0,nb:v.length,dropped:t.dropped};return t.samples=[],t.dropped=0,ct},e.remuxAudio=function(t,e,r,a,i){var o=t.inputTimeScale,d=o/(t.samplerate?t.samplerate:o),h=t.isAAC?1024:1152,f=h*d,m=this._initPTS,y=!t.isAAC&&this.typeSupported.mpeg,v=[],w=t.samples,k=y?0:8,S=this.nextAudioPts||-1,T=e*o;if(this.isAudioContiguous=r=r||w.length&&S>0&&(a&&Math.abs(T-S)<9e3||Math.abs(g(w[0].pts-m,T)-S)<20*f),w.forEach((function(t){t.pts=g(t.pts-m,T)})),!r||S<0){if(!(w=w.filter((function(t){return t.pts>=0}))).length)return;S=0===i?0:a?Math.max(0,T):w[0].pts}if(t.isAAC)for(var x=void 0!==i,E=this.config.maxAudioFramesDrift,L=0,_=S;L=E*f&&D<1e4&&x){var O=Math.round(C/f);(_=R-O*f)<0&&(O--,_+=f),0===L&&(this.nextAudioPts=S=_),u.b.warn("[mp4-remuxer]: Injecting "+O+" audio frame @ "+(_/o).toFixed(3)+"s due to "+Math.round(1e3*C/o)+" ms gap.");for(var I=0;I0))return;U+=k;try{F=new Uint8Array(U)}catch(t){return void this.observer.emit(l.a.ERROR,l.a.ERROR,{type:c.b.MUX_ERROR,details:c.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:U,reason:"fail allocating audio mdat "+U})}y||(new DataView(F.buffer).setUint32(0,U),F.set(s.types.mdat,4))}F.set(Y,k);var q=Y.byteLength;k+=q,v.push(new b(!0,h,q,0)),N=z}var W=v.length;if(W){var K=v[v.length-1];this.nextAudioPts=S=N+d*K.duration;var X=y?new Uint8Array(0):s.moof(t.sequenceNumber++,B/d,p({},t,{samples:v}));t.samples=[];var Z=B/o,J=S/o,Q={data1:X,data2:F,startPTS:Z,endPTS:J,startDTS:Z,endDTS:J,type:"audio",hasAudio:!0,hasVideo:!1,nb:W};return this.isAudioContiguous=!0,Q}},e.remuxEmptyAudio=function(t,e,r,a){var i=t.inputTimeScale,o=i/(t.samplerate?t.samplerate:i),s=this.nextAudioPts,l=(null!==s?s:a.startDTS*i)+this._initDTS,c=a.endDTS*i+this._initDTS,d=1024*o,h=Math.ceil((c-l)/d),p=n.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(u.b.warn("[mp4-remuxer]: remux empty Audio"),p){for(var f=[],m=0;m4294967296;)t+=r;return t}var b=function(t,e,r,a){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=e,this.size=r,this.cts=a,this.flags=new w(t)},w=function(t){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=t?2:1,this.isNonSync=t?0:1}},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var a=r(11);function n(t,e){for(var r=0;r0}),!1)}t.exports=function(t,e){e=e||{};var n={main:r.m},s=e.all?{main:Object.keys(n.main)}:function(t,e){for(var r={main:[e]},a={main:[]},n={main:{}};o(r);)for(var s=Object.keys(r),l=0;lt.endSN||e>0||0===e&&r>0,this.updated||this.advanced?this.misses=Math.floor(.6*t.misses):this.misses=t.misses+1,this.availabilityDelay=t.availabilityDelay},e=t,(r=[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&Object(n.a)(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var t=this.driftEndTime-this.driftStartTime;return t>0?1e3*(this.driftEnd-this.driftStart)/t:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var t;return null!==(t=this.fragments)&&void 0!==t&&t.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}])&&u(e.prototype,r),t}(),h=r(17),p=/^(\d+)x(\d+)$/,f=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,m=function(){function t(e){for(var r in"string"==typeof e&&(e=t.parseAttrList(e)),e)e.hasOwnProperty(r)&&(this[r]=e[r])}var e=t.prototype;return e.decimalInteger=function(t){var e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.hexadecimalInteger=function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var r=new Uint8Array(e.length/2),a=0;aNumber.MAX_SAFE_INTEGER?1/0:e},e.decimalFloatingPoint=function(t){return parseFloat(this[t])},e.optionalFloat=function(t,e){var r=this[t];return r?parseFloat(r):e},e.enumeratedString=function(t){return this[t]},e.bool=function(t){return"YES"===this[t]},e.decimalResolution=function(t){var e=p.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},t.parseAttrList=function(t){var e,r={};for(f.lastIndex=0;null!==(e=f.exec(t));){var a=e[2];0===a.indexOf('"')&&a.lastIndexOf('"')===a.length-1&&(a=a.slice(1,-1)),r[e[1]]=a}return r},t}(),y={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function v(t,e){return MediaSource.isTypeSupported((e||"video")+'/mp4;codecs="'+t+'"')}var g=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,b=/#EXT-X-MEDIA:(.*)/g,w=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),k=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),S=/\.(mp4|m4s|m4v|m4a)$/i,T=function(){function t(){}return t.findGroup=function(t,e){for(var r=0;r2){var r=e.shift()+".";return(r+=parseInt(e.shift()).toString(16))+("000"+parseInt(e.shift()).toString(16)).substr(-4)}return t},t.resolve=function(t,e){return a.buildAbsoluteURL(e,t,{alwaysNormalize:!0})},t.parseMasterPlaylist=function(e,r){var a,n=[],i={},o=!1;for(g.lastIndex=0;null!=(a=g.exec(e));)if(a[1]){var s=new m(a[1]),l={attrs:s,bitrate:s.decimalInteger("AVERAGE-BANDWIDTH")||s.decimalInteger("BANDWIDTH"),name:s.NAME,url:t.resolve(a[2],r)},c=s.decimalResolution("RESOLUTION");c&&(l.width=c.width,l.height=c.height),x((s.CODECS||"").split(/[ ,]+/).filter((function(t){return t})),l),l.videoCodec&&-1!==l.videoCodec.indexOf("avc1")&&(l.videoCodec=t.convertAVC1ToAVCOTI(l.videoCodec)),n.push(l)}else if(a[3]){var u=new m(a[3]);u["DATA-ID"]&&(o=!0,i[u["DATA-ID"]]=u)}return{levels:n,sessionData:o?i:null}},t.parseMasterPlaylistMedia=function(e,r,a,n){var i;void 0===n&&(n=[]);var o=[],s=0;for(b.lastIndex=0;null!==(i=b.exec(e));){var l=new m(i[1]);if(l.TYPE===a){var c={attrs:l,bitrate:0,id:s++,groupId:l["GROUP-ID"],instreamId:l["INSTREAM-ID"],name:l.NAME||l.LANGUAGE||"",type:a,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:l.LANGUAGE,url:l.URI?t.resolve(l.URI,r):""};if(n.length){var u=t.findGroup(n,c.groupId)||n[0];E(c,u,"audioCodec"),E(c,u,"textCodec")}o.push(c)}}return o},t.parseLevelPlaylist=function(t,e,r,i,o){var l,u,p,f=new d(e),y=f.fragments,v=null,g=0,b=0,T=0,x=0,E=null,_=new c.b(i,e),A=-1,R=!1;for(w.lastIndex=0,f.m3u8=t;null!==(l=w.exec(t));){R&&(R=!1,(_=new c.b(i,e)).start=T,_.sn=g,_.cc=x,_.level=r,v&&(_.initSegment=v,_.rawProgramDateTime=v.rawProgramDateTime));var C=l[1];if(C){_.duration=parseFloat(C);var D=(" "+l[2]).slice(1);_.title=D||null,_.tagList.push(D?["INF",C,D]:["INF",C])}else if(l[3])Object(n.a)(_.duration)&&(_.start=T,p&&(_.levelkey=p),_.sn=g,_.level=r,_.cc=x,_.urlId=o,y.push(_),_.relurl=(" "+l[3]).slice(1),L(_,E),E=_,T+=_.duration,g++,b=0,R=!0);else if(l[4]){var O=(" "+l[4]).slice(1);E?_.setByteRange(O,E):_.setByteRange(O)}else if(l[5])_.rawProgramDateTime=(" "+l[5]).slice(1),_.tagList.push(["PROGRAM-DATE-TIME",_.rawProgramDateTime]),-1===A&&(A=y.length);else{if(!(l=l[0].match(k))){s.b.warn("No matches on slow regex match for level playlist!");continue}for(u=1;u-1){s.b.warn("Keyformat "+W+" is not supported from the manifest");continue}if("identity"!==W)continue;H&&(p=h.a.fromURL(e,V),V&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(H)>=0&&(p.method=H,p.keyFormat=W,q&&(p.keyID=q),z&&(p.keyFormatVersions=z),p.iv=Y));break;case"START":var K=new m(P).decimalFloatingPoint("TIME-OFFSET");Object(n.a)(K)&&(f.startTimeOffset=K);break;case"MAP":var X=new m(P);_.relurl=X.URI,X.BYTERANGE&&_.setByteRange(X.BYTERANGE),_.level=r,_.sn="initSegment",p&&(_.levelkey=p),_.initSegment=null,v=_,R=!0;break;case"SERVER-CONTROL":var Z=new m(P);f.canBlockReload=Z.bool("CAN-BLOCK-RELOAD"),f.canSkipUntil=Z.optionalFloat("CAN-SKIP-UNTIL",0),f.canSkipDateRanges=f.canSkipUntil>0&&Z.bool("CAN-SKIP-DATERANGES"),f.partHoldBack=Z.optionalFloat("PART-HOLD-BACK",0),f.holdBack=Z.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var J=new m(P);f.partTarget=J.decimalFloatingPoint("PART-TARGET");break;case"PART":var Q=f.partList;Q||(Q=f.partList=[]);var $=b>0?Q[Q.length-1]:void 0,tt=b++,et=new c.c(new m(P),_,e,tt,$);Q.push(et),_.duration+=et.duration;break;case"PRELOAD-HINT":var rt=new m(P);f.preloadHint=rt;break;case"RENDITION-REPORT":var at=new m(P);f.renditionReports=f.renditionReports||[],f.renditionReports.push(at);break;default:s.b.warn("line parsed but not handled: "+l)}}}E&&!E.relurl?(y.pop(),T-=E.duration,f.partList&&(f.fragmentHint=E)):f.partList&&(L(_,E),_.cc=x,f.fragmentHint=_);var nt=y.length,it=y[0],ot=y[nt-1];if((T+=f.skippedSegments*f.targetduration)>0&&nt&&ot){f.averagetargetduration=T/nt;var st=ot.sn;f.endSN="initSegment"!==st?st:0,it&&(f.startCC=it.cc,it.initSegment||f.fragments.every((function(t){return t.relurl&&(e=t.relurl,S.test(null!=(r=null===(n=a.parseURL(e))||void 0===n?void 0:n.path)?r:""));var e,r,n}))&&(s.b.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(_=new c.b(i,e)).relurl=ot.relurl,_.level=r,_.sn="initSegment",it.initSegment=_,f.needSidxRanges=!0))}else f.endSN=0,f.startCC=0;return f.fragmentHint&&(T+=f.fragmentHint.duration),f.totalduration=T,f.endCC=x,A>0&&function(t,e){for(var r=t[e],a=e;a--;){var n=t[a];if(!n)return;n.programDateTime=r.programDateTime-1e3*n.duration,r=n}}(y,A),f},t}();function x(t,e){["video","audio","text"].forEach((function(r){var a=t.filter((function(t){return function(t,e){var r=y[e];return!!r&&!0===r[t.slice(0,4)]}(t,r)}));if(a.length){var n=a.filter((function(t){return 0===t.lastIndexOf("avc1",0)||0===t.lastIndexOf("mp4a",0)}));e[r+"Codec"]=n.length>0?n[0]:a[0],t=t.filter((function(t){return-1===a.indexOf(t)}))}})),e.unknownCodecs=t}function E(t,e,r){var a=e[r];a&&(t[r]=a)}function L(t,e){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime):null!=e&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime),Object(n.a)(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}var _=r(4);function A(t,e){var r=t.url;return void 0!==r&&0!==r.indexOf("data:")||(r=e.url),r}var R=function(){function t(t){this.hls=void 0,this.loaders=Object.create(null),this.hls=t,this.registerListeners()}var e=t.prototype;return e.registerListeners=function(){var t=this.hls;t.on(i.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(i.a.LEVEL_LOADING,this.onLevelLoading,this),t.on(i.a.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(i.a.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.unregisterListeners=function(){var t=this.hls;t.off(i.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(i.a.LEVEL_LOADING,this.onLevelLoading,this),t.off(i.a.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(i.a.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.createInternalLoader=function(t){var e=this.hls.config,r=e.pLoader,a=e.loader,n=new(r||a)(e);return t.loader=n,this.loaders[t.type]=n,n},e.getInternalLoader=function(t){return this.loaders[t.type]},e.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},e.destroyInternalLoaders=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}},e.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},e.onManifestLoading=function(t,e){var r=e.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:_.a.MANIFEST,url:r,deliveryDirectives:null})},e.onLevelLoading=function(t,e){var r=e.id,a=e.level,n=e.url,i=e.deliveryDirectives;this.load({id:r,groupId:null,level:a,responseType:"text",type:_.a.LEVEL,url:n,deliveryDirectives:i})},e.onAudioTrackLoading=function(t,e){var r=e.id,a=e.groupId,n=e.url,i=e.deliveryDirectives;this.load({id:r,groupId:a,level:null,responseType:"text",type:_.a.AUDIO_TRACK,url:n,deliveryDirectives:i})},e.onSubtitleTrackLoading=function(t,e){var r=e.id,a=e.groupId,n=e.url,i=e.deliveryDirectives;this.load({id:r,groupId:a,level:null,responseType:"text",type:_.a.SUBTITLE_TRACK,url:n,deliveryDirectives:i})},e.load=function(t){var e,r,a,n,i,o,l=this.hls.config,c=this.getInternalLoader(t);if(c){var u=c.context;if(u&&u.url===t.url)return void s.b.trace("[playlist-loader]: playlist request ongoing");s.b.log("[playlist-loader]: aborting previous loader for type: "+t.type),c.abort()}switch(t.type){case _.a.MANIFEST:r=l.manifestLoadingMaxRetry,a=l.manifestLoadingTimeOut,n=l.manifestLoadingRetryDelay,i=l.manifestLoadingMaxRetryTimeout;break;case _.a.LEVEL:case _.a.AUDIO_TRACK:case _.a.SUBTITLE_TRACK:r=0,a=l.levelLoadingTimeOut;break;default:r=l.levelLoadingMaxRetry,a=l.levelLoadingTimeOut,n=l.levelLoadingRetryDelay,i=l.levelLoadingMaxRetryTimeout}if(c=this.createInternalLoader(t),null!==(e=t.deliveryDirectives)&&void 0!==e&&e.part&&(t.type===_.a.LEVEL&&null!==t.level?o=this.hls.levels[t.level].details:t.type===_.a.AUDIO_TRACK&&null!==t.id?o=this.hls.audioTracks[t.id].details:t.type===_.a.SUBTITLE_TRACK&&null!==t.id&&(o=this.hls.subtitleTracks[t.id].details),o)){var d=o.partTarget,h=o.targetduration;d&&h&&(a=Math.min(1e3*Math.max(3*d,.8*h),a))}var p={timeout:a,maxRetry:r,retryDelay:n,maxRetryDelay:i,highWaterMark:0},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};c.load(t,p,f)},e.loadsuccess=function(t,e,r,a){if(void 0===a&&(a=null),r.isSidxRequest)return this.handleSidxRequest(t,r),void this.handlePlaylistLoaded(t,e,r,a);this.resetInternalLoader(r.type);var n=t.data;0===n.indexOf("#EXTM3U")?(e.parsing.start=performance.now(),n.indexOf("#EXTINF:")>0||n.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,e,r,a):this.handleMasterPlaylist(t,e,r,a)):this.handleManifestParsingError(t,r,"no EXTM3U delimiter",a)},e.loaderror=function(t,e,r){void 0===r&&(r=null),this.handleNetworkError(e,r,!1,t)},e.loadtimeout=function(t,e,r){void 0===r&&(r=null),this.handleNetworkError(e,r,!0)},e.handleMasterPlaylist=function(t,e,r,a){var n=this.hls,o=t.data,l=A(t,r),c=T.parseMasterPlaylist(o,l),u=c.levels,d=c.sessionData;if(u.length){var h=u.map((function(t){return{id:t.attrs.AUDIO,audioCodec:t.audioCodec}})),p=u.map((function(t){return{id:t.attrs.SUBTITLES,textCodec:t.textCodec}})),f=T.parseMasterPlaylistMedia(o,l,"AUDIO",h),y=T.parseMasterPlaylistMedia(o,l,"SUBTITLES",p),v=T.parseMasterPlaylistMedia(o,l,"CLOSED-CAPTIONS");f.length&&(f.some((function(t){return!t.url}))||!u[0].audioCodec||u[0].attrs.AUDIO||(s.b.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),f.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new m({}),bitrate:0,url:""}))),n.trigger(i.a.MANIFEST_LOADED,{levels:u,audioTracks:f,subtitles:y,captions:v,url:l,stats:e,networkDetails:a,sessionData:d})}else this.handleManifestParsingError(t,r,"no level found in manifest",a)},e.handleTrackOrLevelPlaylist=function(t,e,r,a){var s=this.hls,l=r.id,c=r.level,u=r.type,d=A(t,r),h=Object(n.a)(l)?l:0,p=Object(n.a)(c)?c:h,f=function(t){switch(t.type){case _.a.AUDIO_TRACK:return _.b.AUDIO;case _.a.SUBTITLE_TRACK:return _.b.SUBTITLE;default:return _.b.MAIN}}(r),y=T.parseLevelPlaylist(t.data,d,p,f,h);if(y.fragments.length){if(u===_.a.MANIFEST){var v={attrs:new m({}),bitrate:0,details:y,name:"",url:d};s.trigger(i.a.MANIFEST_LOADED,{levels:[v],audioTracks:[],url:d,stats:e,networkDetails:a,sessionData:null})}if(e.parsing.end=performance.now(),y.needSidxRanges){var g,b=null===(g=y.fragments[0].initSegment)||void 0===g?void 0:g.url;this.load({url:b,isSidxRequest:!0,type:u,level:c,levelDetails:y,id:l,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null})}else r.levelDetails=y,this.handlePlaylistLoaded(t,e,r,a)}else s.trigger(i.a.ERROR,{type:o.b.NETWORK_ERROR,details:o.a.LEVEL_EMPTY_ERROR,fatal:!1,url:d,reason:"no fragments found in level",level:"number"==typeof r.level?r.level:void 0})},e.handleSidxRequest=function(t,e){var r=Object(l.g)(new Uint8Array(t.data));if(r){var a=r.references,n=e.levelDetails;a.forEach((function(t,e){var a=t.info,i=n.fragments[e];0===i.byteRange.length&&i.setByteRange(String(1+a.end-a.start)+"@"+String(a.start)),i.initSegment&&i.initSegment.setByteRange(String(r.moovEndOffset)+"@0")}))}},e.handleManifestParsingError=function(t,e,r,a){this.hls.trigger(i.a.ERROR,{type:o.b.NETWORK_ERROR,details:o.a.MANIFEST_PARSING_ERROR,fatal:e.type===_.a.MANIFEST,url:t.url,reason:r,response:t,context:e,networkDetails:a})},e.handleNetworkError=function(t,e,r,a){void 0===r&&(r=!1),s.b.warn("[playlist-loader]: A network "+(r?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var n=o.a.UNKNOWN,l=!1,c=this.getInternalLoader(t);switch(t.type){case _.a.MANIFEST:n=r?o.a.MANIFEST_LOAD_TIMEOUT:o.a.MANIFEST_LOAD_ERROR,l=!0;break;case _.a.LEVEL:n=r?o.a.LEVEL_LOAD_TIMEOUT:o.a.LEVEL_LOAD_ERROR,l=!1;break;case _.a.AUDIO_TRACK:n=r?o.a.AUDIO_TRACK_LOAD_TIMEOUT:o.a.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case _.a.SUBTITLE_TRACK:n=r?o.a.SUBTITLE_TRACK_LOAD_TIMEOUT:o.a.SUBTITLE_LOAD_ERROR,l=!1}c&&this.resetInternalLoader(t.type);var u={type:o.b.NETWORK_ERROR,details:n,fatal:l,url:t.url,loader:c,context:t,networkDetails:e};a&&(u.response=a),this.hls.trigger(i.a.ERROR,u)},e.handlePlaylistLoaded=function(t,e,r,a){var n=r.type,o=r.level,s=r.id,l=r.groupId,c=r.loader,u=r.levelDetails,d=r.deliveryDirectives;if(null!=u&&u.targetduration){if(c)switch(u.live&&(c.getCacheAge&&(u.ageHeader=c.getCacheAge()||0),c.getCacheAge&&!isNaN(u.ageHeader)||(u.ageHeader=0)),n){case _.a.MANIFEST:case _.a.LEVEL:this.hls.trigger(i.a.LEVEL_LOADED,{details:u,level:o||0,id:s||0,stats:e,networkDetails:a,deliveryDirectives:d});break;case _.a.AUDIO_TRACK:this.hls.trigger(i.a.AUDIO_TRACK_LOADED,{details:u,id:s||0,groupId:l||"",stats:e,networkDetails:a,deliveryDirectives:d});break;case _.a.SUBTITLE_TRACK:this.hls.trigger(i.a.SUBTITLE_TRACK_LOADED,{details:u,id:s||0,groupId:l||"",stats:e,networkDetails:a,deliveryDirectives:d})}}else this.handleManifestParsingError(t,r,"invalid target duration",a)},t}(),C=function(){function t(t){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){this.hls.on(i.a.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(i.a.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){for(var t in this._unregisterListeners(),this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={}},e.onKeyLoading=function(t,e){var r=e.frag,a=r.type,n=this.loaders[a];if(r.decryptdata){var o=r.decryptdata.uri;if(o!==this.decrypturl||null===this.decryptkey){var l=this.hls.config;if(n&&(s.b.warn("abort previous key loader for type:"+a),n.abort()),!o)return void s.b.warn("key uri is falsy");var c=l.loader,u=r.loader=this.loaders[a]=new c(l);this.decrypturl=o,this.decryptkey=null;var d={url:o,frag:r,responseType:"arraybuffer"},h={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(d,h,p)}else this.decryptkey&&(r.decryptdata.key=this.decryptkey,this.hls.trigger(i.a.KEY_LOADED,{frag:r}))}else s.b.warn("Missing decryption data on fragment in onKeyLoading")},e.loadsuccess=function(t,e,r){var a=r.frag;a.decryptdata?(this.decryptkey=a.decryptdata.key=new Uint8Array(t.data),a.loader=null,delete this.loaders[a.type],this.hls.trigger(i.a.KEY_LOADED,{frag:a})):s.b.error("after key load, decryptdata unset")},e.loaderror=function(t,e){var r=e.frag,a=r.loader;a&&a.abort(),delete this.loaders[r.type],this.hls.trigger(i.a.ERROR,{type:o.b.NETWORK_ERROR,details:o.a.KEY_LOAD_ERROR,fatal:!1,frag:r,response:t})},e.loadtimeout=function(t,e){var r=e.frag,a=r.loader;a&&a.abort(),delete this.loaders[r.type],this.hls.trigger(i.a.ERROR,{type:o.b.NETWORK_ERROR,details:o.a.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},t}();function D(t,e){var r;try{r=new Event("addtrack")}catch(t){(r=document.createEvent("Event")).initEvent("addtrack",!1,!1)}r.track=t,e.dispatchEvent(r)}function O(t,e){var r=t.mode;if("disabled"===r&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(e.id))try{if(t.addCue(e),!t.cues.getCueById(e.id))throw new Error("addCue is failed for: "+e)}catch(r){s.b.debug("[texttrack-utils]: "+r);var a=new self.TextTrackCue(e.startTime,e.endTime,e.text);a.id=e.id,t.addCue(a)}"disabled"===r&&(t.mode=r)}function I(t){var e=t.mode;if("disabled"===e&&(t.mode="hidden"),t.cues)for(var r=t.cues.length;r--;)t.removeCue(t.cues[r]);"disabled"===e&&(t.mode=e)}function P(t,e,r){var a=t.mode;if("disabled"===a&&(t.mode="hidden"),t.cues&&t.cues.length>0)for(var n=function(t,e,r){var a=[],n=function(t,e){if(et[r].endTime)return-1;for(var a=0,n=r;a<=n;){var i=Math.floor((n+a)/2);if(et[i].startTime&&a-1)for(var i=n,o=t.length;i=e&&s.endTime<=r)a.push(s);else if(s.startTime>r)return a}return a}(t.cues,e,r),i=0;i.05&&this.forwardBufferLength>1){var c=Math.min(2,Math.max(1,i)),u=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;t.playbackRate=Math.min(c,Math.max(1,u))}else 1!==t.playbackRate&&0!==t.playbackRate&&(t.playbackRate=1)}}}}},a.estimateLiveEdge=function(){var t=this.levelDetails;return null===t?null:t.edge+t.age},a.computeLatency=function(){var t=this.estimateLiveEdge();return null===t?null:t-this.currentTime},e=t,(r=[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var t=this.config,e=this.levelDetails;return void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:e?t.liveMaxLatencyDurationCount*e.targetduration:0}},{key:"targetLatency",get:function(){var t=this.levelDetails;if(null===t)return null;var e=t.holdBack,r=t.partHoldBack,a=t.targetduration,n=this.config,i=n.liveSyncDuration,o=n.liveSyncDurationCount,s=n.lowLatencyMode,l=this.hls.userConfig,c=s&&r||e;(l.liveSyncDuration||l.liveSyncDurationCount||0===c)&&(c=void 0!==i?i:o*a);var u=a;return c+Math.min(1*this.stallCount,u)}},{key:"liveSyncPosition",get:function(){var t=this.estimateLiveEdge(),e=this.targetLatency,r=this.levelDetails;if(null===t||null===e||null===r)return null;var a=r.edge,n=t-e-this.edgeStalled,i=a-r.totalduration,o=a-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(i,n),o)}},{key:"drift",get:function(){var t=this.levelDetails;return null===t?1:t.drift}},{key:"edgeStalled",get:function(){var t=this.levelDetails;if(null===t)return 0;var e=3*(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.max(t.age-e,0)}},{key:"forwardBufferLength",get:function(){var t=this.media,e=this.levelDetails;if(!t||!e)return 0;var r=t.buffered.length;return r?t.buffered.end(r-1):e.edge-this.currentTime}}])&&B(e.prototype,r),t}();function j(t,e){for(var r=0;rt.sn?(i=r-t.start,a=t):(i=t.start-r,a=e),a.duration!==i&&(a.duration=i)}else e.sn>t.sn?t.cc===e.cc&&t.minEndPTS?e.start=t.start+(t.minEndPTS-t.start):e.start=t.start+t.duration:e.start=Math.max(t.start-e.duration,0)}function q(t,e,r,a,i,o){a-r<=0&&(s.b.warn("Fragment should have a positive duration",e),a=r+e.duration,o=i+e.duration);var l=r,c=a,u=e.startPTS,d=e.endPTS;if(Object(n.a)(u)){var h=Math.abs(u-r);Object(n.a)(e.deltaPTS)?e.deltaPTS=Math.max(h,e.deltaPTS):e.deltaPTS=h,l=Math.max(r,u),r=Math.min(r,u),i=Math.min(i,e.startDTS),c=Math.min(a,d),a=Math.max(a,d),o=Math.max(o,e.endDTS)}e.duration=a-r;var p=r-e.start;e.appendedPTS=a,e.start=e.startPTS=r,e.maxStartPTS=l,e.startDTS=i,e.endPTS=a,e.minEndPTS=c,e.endDTS=o;var f,m=e.sn;if(!t||mt.endSN)return 0;var y=m-t.startSN,v=t.fragments;for(v[y]=e,f=y;f>0;f--)z(v[f],v[f-1]);for(f=y;f=0;i--){var o=a[i].initSegment;if(o){r=o;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var l,c=0;if(function(t,e,r){for(var a=e.skippedSegments,n=Math.max(t.startSN,e.startSN)-e.startSN,i=(t.fragmentHint?1:0)+(a?e.endSN:Math.min(t.endSN,e.endSN))-e.startSN,o=e.startSN-t.startSN,s=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,c=n;c<=i;c++){var u=l[o+c],d=s[c];a&&!d&&c=a.length||X(e,a[r].start)}function X(t,e){if(e){for(var r=t.fragments,a=t.skippedSegments;ae.partTarget&&(l+=1)}if(Object(n.a)(s))return new G(s,Object(n.a)(l)?l:void 0,N.No)}}},e.loadPlaylist=function(t){},e.shouldLoadTrack=function(t){return this.canLoad&&t&&!!t.url&&(!t.details||t.details.live)},e.playlistLoaded=function(t,e,r){var a=this,n=e.details,i=e.stats,o=i.loading.end?Math.max(0,self.performance.now()-i.loading.end):0;if(n.advancedDateTime=Date.now()-o,n.live||null!=r&&r.live){if(n.reloaded(r),r&&this.log("live playlist "+t+" "+(n.advanced?"REFRESHED "+n.lastPartSn+"-"+n.lastPartIndex:"MISSED")),r&&n.fragments.length>0&&W(r,n),!this.canLoad||!n.live)return;var s,l=void 0,c=void 0;if(n.canBlockReload&&n.endSN&&n.advanced){var u=this.hls.config.lowLatencyMode,d=n.lastPartSn,h=n.endSN,p=n.lastPartIndex,f=d===h;-1!==p?(l=f?h+1:d,c=f?u?0:p:p+1):l=h+1;var m=n.age,y=m+n.ageHeader,v=Math.min(y-n.partTarget,1.5*n.targetduration);if(v>0){if(r&&v>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+v+" with playlist age: "+n.age),v=0;else{var g=Math.floor(v/n.targetduration);l+=g,void 0!==c&&(c+=Math.round(v%n.targetduration/n.partTarget)),this.log("CDN Tune-in age: "+n.ageHeader+"s last advanced "+m.toFixed(2)+"s goal: "+v+" skip sn "+g+" to part "+c)}n.tuneInGoal=v}if(s=this.getDeliveryDirectives(n,e.deliveryDirectives,l,c),u||!f)return void this.loadPlaylist(s)}else s=this.getDeliveryDirectives(n,e.deliveryDirectives,l,c);var b=function(t,e){var r,a=1e3*t.levelTargetDuration,n=a/2,i=t.age,o=i>0&&i<3*a,s=e.loading.end-e.loading.start,l=t.availabilityDelay;if(!1===t.updated)if(o){var c=333*t.misses;r=Math.max(Math.min(n,2*s),c),t.availabilityDelay=(t.availabilityDelay||0)+r}else r=n;else o?(l=Math.min(l||a/2,i),t.availabilityDelay=l,r=l+a-i):r=a-s;return Math.round(r)}(n,i);void 0!==l&&n.canBlockReload&&(b-=n.partTarget||1),this.log("reload live playlist "+t+" in "+Math.round(b)+" ms"),this.timer=self.setTimeout((function(){return a.loadPlaylist(s)}),b)}else this.clearTimer()},e.getDeliveryDirectives=function(t,e,r,a){var n=function(t,e){var r=t.canSkipUntil,a=t.canSkipDateRanges,n=t.endSN;return r&&(void 0!==e?e-n:0)-1&&null!==(e=t.context)&&void 0!==e&&e.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+t.details+'"'),this.loadPlaylist();else{var i=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout((function(){return r.loadPlaylist()}),i),this.warn("retry playlist loading #"+this.retryCount+" in "+i+' ms after "'+t.details+'"')}else this.warn('cannot recover from error "'+t.details+'"'),this.clearTimer(),t.fatal=!0;return n},t}();function J(){return(J=Object.assign||function(t){for(var e=1;e0){r=n[0].bitrate,n.sort((function(t,e){return t.bitrate-e.bitrate})),this._levels=n;for(var p=0;pthis.hls.config.fragLoadingMaxRetry&&(i=r.frag.level)):i=r.frag.level}break;case o.a.LEVEL_LOAD_ERROR:case o.a.LEVEL_LOAD_TIMEOUT:a&&(a.deliveryDirectives&&(l=!1),i=a.level),s=!0;break;case o.a.REMUX_ALLOC_ERROR:i=r.level,s=!0}void 0!==i&&this.recoverLevel(r,i,s,l)}}},l.recoverLevel=function(t,e,r,a){var n=t.details,i=this._levels[e];if(i.loadError++,r){if(!this.retryLoadingOrFail(t))return void(this.currentLevelIndex=-1);t.levelRetry=!0}if(a){var o=i.url.length;if(o>1&&i.loadError1){var a=(e.urlId+1)%r;this.warn("Switching to redundant URL-id "+a),this._levels.forEach((function(t){t.urlId=a})),this.level=t}},l.onFragLoaded=function(t,e){var r=e.frag;if(void 0!==r&&r.type===_.b.MAIN){var a=this._levels[r.level];void 0!==a&&(a.fragmentError=0,a.loadError=0)}},l.onLevelLoaded=function(t,e){var r,a,n=e.level,i=e.details,o=this._levels[n];if(!o)return this.warn("Invalid level index "+n),void(null!==(a=e.deliveryDirectives)&&void 0!==a&&a.skip&&(i.deltaUpdateFailed=!0));n===this.currentLevelIndex?(0===o.fragmentError&&(o.loadError=0,this.retryCount=0),this.playlistLoaded(n,e,o.details)):null!==(r=e.deliveryDirectives)&&void 0!==r&&r.skip&&(i.deltaUpdateFailed=!0)},l.onAudioTrackSwitched=function(t,e){var r=this.hls.levels[this.currentLevelIndex];if(r&&r.audioGroupIds){for(var a=-1,n=this.hls.audioTracks[e.id].groupId,i=0;i0){var a=r.urlId,n=r.url[a];if(t)try{n=t.addDirectives(n)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Attempt loading level index "+e+(t?" at sn "+t.msn+" part "+t.part:"")+" with URL-id "+a+" "+n),this.clearTimer(),this.hls.trigger(i.a.LEVEL_LOADING,{url:n,level:e,id:a,deliveryDirectives:t||null})}},l.removeLevel=function(t,e){var r=function(t,r){return r!==e},a=this._levels.filter((function(a,n){return n!==t||a.url.length>1&&void 0!==e&&(a.url=a.url.filter(r),a.audioGroupIds&&(a.audioGroupIds=a.audioGroupIds.filter(r)),a.textGroupIds&&(a.textGroupIds=a.textGroupIds.filter(r)),a.urlId=0,!0)})).map((function(t,e){var r=t.details;return null!=r&&r.fragments&&r.fragments.forEach((function(t){t.level=e})),t}));this._levels=a,this.hls.trigger(i.a.LEVELS_UPDATED,{levels:a})},n=a,(s=[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var e,r=this._levels;if(0!==r.length&&(this.currentLevelIndex!==t||null===(e=r[t])||void 0===e||!e.details)){if(t<0||t>=r.length){var a=t<0;if(this.hls.trigger(i.a.ERROR,{type:o.b.OTHER_ERROR,details:o.a.LEVEL_SWITCH_ERROR,level:t,fatal:a,reason:"invalid level idx"}),a)return;t=Math.min(t,r.length-1)}this.clearTimer();var n=this.currentLevelIndex,s=r[n],l=r[t];this.log("switching to level "+t+" from "+n),this.currentLevelIndex=t;var c=J({},l,{level:t,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete c._urlId,this.hls.trigger(i.a.LEVEL_SWITCHING,c);var u=l.details;if(!u||u.live){var d=this.switchParams(l.uri,null==s?void 0:s.details);this.loadPlaylist(d)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var t=this.hls.config.startLevel;return void 0!==t?t:this._firstLevel}return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}}])&&Q(n.prototype,s),a}(Z);!function(t){t.NOT_LOADED="NOT_LOADED",t.BACKTRACKED="BACKTRACKED",t.APPENDING="APPENDING",t.PARTIAL="PARTIAL",t.OK="OK"}(tt||(tt={}));var at=function(){function t(t){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){var t=this.hls;t.on(i.a.BUFFER_APPENDED,this.onBufferAppended,this),t.on(i.a.FRAG_BUFFERED,this.onFragBuffered,this),t.on(i.a.FRAG_LOADED,this.onFragLoaded,this)},e._unregisterListeners=function(){var t=this.hls;t.off(i.a.BUFFER_APPENDED,this.onBufferAppended,this),t.off(i.a.FRAG_BUFFERED,this.onFragBuffered,this),t.off(i.a.FRAG_LOADED,this.onFragLoaded,this)},e.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},e.getAppendedFrag=function(t,e){if(e===_.b.MAIN){var r=this.activeFragment,a=this.activeParts;if(!r)return null;if(a)for(var n=a.length;n--;){var i=a[n],o=i?i.end:r.appendedPTS;if(i.start<=t&&void 0!==o&&t<=o)return n>9&&(this.activeParts=a.slice(n-9)),i}else if(r.start<=t&&void 0!==r.appendedPTS&&t<=r.appendedPTS)return r}return this.getBufferedFrag(t,e)},e.getBufferedFrag=function(t,e){for(var r=this.fragments,a=Object.keys(r),n=a.length;n--;){var i=r[a[n]];if((null==i?void 0:i.body.type)===e&&i.buffered){var o=i.body;if(o.start<=t&&t<=o.end)return o}}return null},e.detectEvictedFragments=function(t,e,r){var a=this;Object.keys(this.fragments).forEach((function(n){var i=a.fragments[n];if(i)if(i.buffered){var o=i.range[t];o&&o.time.some((function(t){var r=!a.isTimeBuffered(t.startPTS,t.endPTS,e);return r&&a.removeFragment(i.body),r}))}else i.body.type===r&&a.removeFragment(i.body)}))},e.detectPartialFragments=function(t){var e=this,r=this.timeRanges,a=t.frag,n=t.part;if(r&&"initSegment"!==a.sn){var i=it(a),o=this.fragments[i];o&&(Object.keys(r).forEach((function(t){var i=a.elementaryStreams[t];if(i){var s=r[t],l=null!==n||!0===i.partial;o.range[t]=e.getBufferedTimes(a,n,l,s)}})),o.backtrack=o.loaded=null,Object.keys(o.range).length?o.buffered=!0:this.removeFragment(o.body))}},e.fragBuffered=function(t){var e=it(t),r=this.fragments[e];r&&(r.backtrack=r.loaded=null,r.buffered=!0)},e.getBufferedTimes=function(t,e,r,a){for(var n={time:[],partial:r},i=e?e.start:t.start,o=e?e.end:t.end,s=t.minEndPTS||o,l=t.maxStartPTS||i,c=0;c=u&&s<=d){n.time.push({startPTS:Math.max(i,a.start(c)),endPTS:Math.min(o,a.end(c))});break}if(iu)n.partial=!0,n.time.push({startPTS:Math.max(i,a.start(c)),endPTS:Math.min(o,a.end(c))});else if(o<=u)break}return n},e.getPartialFragment=function(t){var e,r,a,n=null,i=0,o=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach((function(l){var c=s[l];c&&nt(c)&&(r=c.body.start-o,a=c.body.end+o,t>=r&&t<=a&&(e=Math.min(t-r,a-t),i<=e&&(n=c.body,i=e)))})),n},e.getState=function(t){var e=it(t),r=this.fragments[e];return r?r.buffered?nt(r)?tt.PARTIAL:tt.OK:r.backtrack?tt.BACKTRACKED:tt.APPENDING:tt.NOT_LOADED},e.backtrack=function(t,e){var r=it(t),a=this.fragments[r];if(!a||a.backtrack)return null;var n=a.backtrack=e||a.loaded;return a.loaded=null,n},e.getBacktrackData=function(t){var e=it(t),r=this.fragments[e];if(r){var a,n=r.backtrack;if(null!=n&&null!==(a=n.payload)&&void 0!==a&&a.byteLength)return n;this.removeFragment(t)}return null},e.isTimeBuffered=function(t,e,r){for(var a,n,i=0;i=a&&e<=n)return!0;if(e<=a)return!1}return!1},e.onFragLoaded=function(t,e){var r=e.frag,a=e.part;if("initSegment"!==r.sn&&!r.bitrateTest&&!a){var n=it(r);this.fragments[n]={body:r,loaded:e,backtrack:null,buffered:!1,range:Object.create(null)}}},e.onBufferAppended=function(t,e){var r=this,a=e.frag,n=e.part,i=e.timeRanges;if(a.type===_.b.MAIN)if(this.activeFragment=a,n){var o=this.activeParts;o||(this.activeParts=o=[]),o.push(n)}else this.activeParts=null;this.timeRanges=i,Object.keys(i).forEach((function(t){var e=i[t];if(r.detectEvictedFragments(t,e),!n)for(var o=0;ot&&a.removeFragment(o)}}))},e.removeFragment=function(t){var e=it(t);t.stats.loaded=0,t.clearElementaryStreamInfo(),delete this.fragments[e]},e.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},t}();function nt(t){var e,r;return t.buffered&&((null===(e=t.range.video)||void 0===e?void 0:e.partial)||(null===(r=t.range.audio)||void 0===r?void 0:r.partial))}function it(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn}var ot=function(){function t(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var e=t.prototype;return e.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},e.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},e.onHandlerDestroyed=function(){},e.hasInterval=function(){return!!this._tickInterval},e.hasNextTick=function(){return!!this._tickTimer},e.setInterval=function(t){return!this._tickInterval&&(this._tickInterval=self.setInterval(this._boundTick,t),!0)},e.clearInterval=function(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)},e.clearNextTick=function(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)},e.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},e.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},e.doTick=function(){},t}(),st={length:0,start:function(){return 0},end:function(){return 0}},lt=function(){function t(){}return t.isBuffered=function(e,r){try{if(e)for(var a=t.getBuffered(e),n=0;n=a.start(n)&&r<=a.end(n))return!0}catch(t){}return!1},t.bufferInfo=function(e,r,a){try{if(e){var n,i=t.getBuffered(e),o=[];for(n=0;no&&(a[i-1].end=t[n].end):a.push(t[n])}else a.push(t[n])}else a=t;for(var s,l=0,c=e,u=e,d=0;d=h&&er.startCC||t&&t.cc0)r=n+1;else{if(!(o<0))return i;a=n-1}}return null};function yt(t,e,r,a){void 0===r&&(r=0),void 0===a&&(a=0);var n=null;return t?n=e[t.sn-e[0].sn+1]||null:0===r&&0===e[0].start&&(n=e[0]),n&&0===vt(r,a,n)?n:mt(e,vt.bind(null,r,a))||n}function vt(t,e,r){void 0===t&&(t=0),void 0===e&&(e=0);var a=Math.min(e,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-a<=t?1:r.start-a>t&&r.start?-1:0}function gt(t,e,r){var a=1e3*Math.min(e,r.duration+(r.deltaPTS?r.deltaPTS:0));return(r.endProgramDateTime||0)-a>t}function bt(t){var e="function"==typeof Map?new Map:void 0;return(bt=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,a)}function a(){return wt(t,arguments,Tt(this).constructor)}return a.prototype=Object.create(t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),St(a,t)})(t)}function wt(t,e,r){return(wt=kt()?Reflect.construct:function(t,e,r){var a=[null];a.push.apply(a,e);var n=new(Function.bind.apply(t,a));return r&&St(n,r.prototype),n}).apply(null,arguments)}function kt(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function St(t,e){return(St=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Tt(t){return(Tt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var xt=Math.pow(2,17),Et=function(){function t(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var e=t.prototype;return e.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},e.abort=function(){this.loader&&this.loader.abort()},e.load=function(t,e){var r=this,a=t.url;if(!a)return Promise.reject(new _t({type:o.b.NETWORK_ERROR,details:o.a.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(a?"part list":"url")));this.abort();var n=this.config,i=n.fLoader,s=n.loader;return new Promise((function(a,l){r.loader&&r.loader.destroy();var c=r.loader=t.loader=i?new i(n):new s(n),u=Lt(t),d={timeout:n.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:n.fragLoadingMaxRetryTimeout,highWaterMark:xt};t.stats=c.stats,c.load(u,d,{onSuccess:function(e,n,i,o){r.resetLoader(t,c),a({frag:t,part:null,payload:e.data,networkDetails:o})},onError:function(e,a,n){r.resetLoader(t,c),l(new _t({type:o.b.NETWORK_ERROR,details:o.a.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:e,networkDetails:n}))},onAbort:function(e,a,n){r.resetLoader(t,c),l(new _t({type:o.b.NETWORK_ERROR,details:o.a.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:n}))},onTimeout:function(e,a,n){r.resetLoader(t,c),l(new _t({type:o.b.NETWORK_ERROR,details:o.a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:n}))},onProgress:function(r,a,n,i){e&&e({frag:t,part:null,payload:n,networkDetails:i})}})}))},e.loadPart=function(t,e,r){var a=this;this.abort();var n=this.config,i=n.fLoader,s=n.loader;return new Promise((function(l,c){a.loader&&a.loader.destroy();var u=a.loader=t.loader=i?new i(n):new s(n),d=Lt(t,e),h={timeout:n.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:n.fragLoadingMaxRetryTimeout,highWaterMark:xt};e.stats=u.stats,u.load(d,h,{onSuccess:function(n,i,o,s){a.resetLoader(t,u),a.updateStatsFromPart(t,e);var c={frag:t,part:e,payload:n.data,networkDetails:s};r(c),l(c)},onError:function(r,n,i){a.resetLoader(t,u),c(new _t({type:o.b.NETWORK_ERROR,details:o.a.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:r,networkDetails:i}))},onAbort:function(r,n,i){t.stats.aborted=e.stats.aborted,a.resetLoader(t,u),c(new _t({type:o.b.NETWORK_ERROR,details:o.a.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,networkDetails:i}))},onTimeout:function(r,n,i){a.resetLoader(t,u),c(new _t({type:o.b.NETWORK_ERROR,details:o.a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,networkDetails:i}))}})}))},e.updateStatsFromPart=function(t,e){var r=t.stats,a=e.stats,n=a.total;if(r.loaded+=a.loaded,n){var i=Math.round(t.duration/e.duration),o=Math.min(Math.round(r.loaded/n),i),s=(i-o)*Math.round(r.loaded/o);r.total=r.loaded+s}else r.total=Math.max(r.loaded,r.total);var l=r.loading,c=a.loading;l.start?l.first+=c.first-c.start:(l.start=c.start,l.first=c.first),l.end=c.end},e.resetLoader=function(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()},t}();function Lt(t,e){void 0===e&&(e=null);var r=e||t,a={frag:t,part:e,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},i=r.byteRangeStartOffset,o=r.byteRangeEndOffset;return Object(n.a)(i)&&Object(n.a)(o)&&(a.rangeStart=i,a.rangeEnd=o),a}var _t=function(t){var e,r;function a(e){for(var r,a=arguments.length,n=new Array(a>1?a-1:0),i=1;i=e.endSN&&!t.nextStart){var n=e.partList;if(null!=n&&n.length){var i=n[n.length-1];return lt.isBuffered(this.media,i.start+i.duration/2)}var o=a.getState(r);return o===tt.PARTIAL||o===tt.OK}return!1},d.onMediaAttached=function(t,e){var r=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),r.addEventListener("seeking",this.onvseeking),r.addEventListener("ended",this.onvended);var a=this.config;this.levels&&a.autoStartLoad&&this.state===Ot&&this.startLoad(a.startPosition)},d.onMediaDetaching=function(){var t=this.media;null!=t&&t.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},d.onMediaSeeking=function(){var t=this.config,e=this.fragCurrent,r=this.media,a=this.mediaBuffer,i=this.state,o=r?r.currentTime:0,s=lt.bufferInfo(a||r,o,t.maxBufferHole);if(this.log("media seeking to "+(Object(n.a)(o)?o.toFixed(3):o)+", state: "+i),i===Gt)this.resetLoadingState();else if(e&&!s.len){var l=t.maxFragLookUpTolerance,c=e.start-l,u=o>e.start+e.duration+l;(o0&&o&&o.key&&o.iv&&"AES-128"===o.method){var s=self.performance.now();return e.decrypter.webCryptoDecrypt(new Uint8Array(n),o.key.buffer,o.iv.buffer).then((function(e){var n=self.performance.now();return a.trigger(i.a.FRAG_DECRYPTED,{frag:t,payload:e,stats:{tstart:s,tdecrypt:n}}),r.payload=e,r}))}return r})).then((function(r){var a=e.fragCurrent,n=e.hls,o=e.levels;if(!o)throw new Error("init load aborted, missing levels");o[t.level].details;var s=t.stats;e.state=It,e.fragLoadError=0,t.data=new Uint8Array(r.payload),s.parsing.start=s.buffering.start=self.performance.now(),s.parsing.end=s.buffering.end=self.performance.now(),r.frag===a&&n.trigger(i.a.FRAG_BUFFERED,{stats:s,frag:a,part:null,id:t.type}),e.tick()})).catch((function(r){e.warn(r),e.resetFragmentLoading(t)}))},d.fragContextChanged=function(t){var e=this.fragCurrent;return!t||!e||t.level!==e.level||t.sn!==e.sn||t.urlId!==e.urlId},d.fragBufferedComplete=function(t,e){var r=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+t.type+" sn: "+t.sn+(e?" part: "+e.index:"")+" of "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level+" "+Rt(lt.getBuffered(r))),this.state=It,this.tick()},d._handleFragmentLoadComplete=function(t){var e=this.transmuxer;if(e){var r=t.frag,a=t.part,n=t.partsLoaded,i=!n||0===n.length||n.some((function(t){return!t})),o=new ct(r.level,r.sn,r.stats.chunkCount+1,0,a?a.index:-1,!i);e.flush(o)}},d._handleFragmentLoadProgress=function(t){},d._doFragLoad=function(t,e,r,a){var o=this;if(void 0===r&&(r=null),!this.levels)throw new Error("frag load aborted, missing levels");if(r=Math.max(t.start,r||0),this.config.lowLatencyMode&&e){var s=e.partList;if(s&&a){r>t.end&&e.fragmentHint&&(t=e.fragmentHint);var l=this.getNextPart(s,t,r);if(l>-1){var c=s[l];return this.log("Loading part sn: "+t.sn+" p: "+c.index+" cc: "+t.cc+" of playlist ["+e.startSN+"-"+e.endSN+"] parts [0-"+l+"-"+(s.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(r.toFixed(3))),this.nextLoadPosition=c.start+c.duration,this.state=Mt,this.hls.trigger(i.a.FRAG_LOADING,{frag:t,part:s[l],targetBufferTime:r}),this.doFragPartsLoad(t,s,l,a).catch((function(t){return o.handleFragLoadError(t)}))}if(!t.url||this.loadedEndOfParts(s,r))return Promise.resolve(null)}}return this.log("Loading fragment "+t.sn+" cc: "+t.cc+" "+(e?"of ["+e.startSN+"-"+e.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(r.toFixed(3))),Object(n.a)(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=Mt,this.hls.trigger(i.a.FRAG_LOADING,{frag:t,targetBufferTime:r}),this.fragmentLoader.load(t,a).catch((function(t){return o.handleFragLoadError(t)}))},d.doFragPartsLoad=function(t,e,r,a){var n=this;return new Promise((function(o,s){var l=[];!function r(c){var u=e[c];n.fragmentLoader.loadPart(t,u,a).then((function(a){l[u.index]=a;var s=a.part;n.hls.trigger(i.a.FRAG_LOADED,a);var d=e[c+1];if(!d||d.fragment!==t)return o({frag:t,part:s,partsLoaded:l});r(c+1)})).catch(s)}(r)}))},d.handleFragLoadError=function(t){var e=t.data;return e&&e.details===o.a.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):this.hls.trigger(i.a.ERROR,e),null},d._handleTransmuxerFlush=function(t){var e=this.getCurrentContext(t);if(e&&this.state===Nt){var r=e.frag,a=e.part,n=e.level,i=self.performance.now();r.stats.parsing.end=i,a&&(a.stats.parsing.end=i),this.updateLevelTiming(r,a,n,t.partial)}else this.fragCurrent||(this.state=It)},d.getCurrentContext=function(t){var e=this.levels,r=t.level,a=t.sn,n=t.part;if(!e||!e[r])return this.warn("Levels object was unset while buffering fragment "+a+" of level "+r+". The current chunk will not be buffered."),null;var i=e[r],o=n>-1?function(t,e,r){if(!t||!t.details)return null;var a=t.details.partList;if(a)for(var n=a.length;n--;){var i=a[n];if(i.index===r&&i.fragment.sn===e)return i}return null}(i,a,n):null,s=o?o.fragment:function(t,e,r){if(!t||!t.details)return null;var a=t.details,n=a.fragments[e-a.startSN];return n||((n=a.fragmentHint)&&n.sn===e?n:ei&&this.flushMainBuffer(o,t.start)}else this.flushMainBuffer(0,t.start)},d.getFwdBufferInfo=function(t,e){var r=this.config,a=this.getLoadPosition();if(!Object(n.a)(a))return null;var i=lt.bufferInfo(t,a,r.maxBufferHole);if(0===i.len&&void 0!==i.nextStart){var o=this.fragmentTracker.getBufferedFrag(a,e);if(o&&i.nextStart=r&&(e.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+e.maxMaxBufferLength+"s"),!0)},d.getNextFragment=function(t,e){var r,a,n=e.fragments,i=n.length;if(!i)return null;var o,s=this.config,l=n[0].start;if(e.live){var c=s.initialLiveManifestSize;if(i-1&&rr.start&&r.loaded},d.getInitialLiveFragment=function(t,e){var r=this.fragPrevious,a=null;if(r){if(t.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+r.programDateTime),a=function(t,e,r){if(null===e||!Array.isArray(t)||!t.length||!Object(n.a)(e))return null;if(e<(t[0].programDateTime||0))return null;if(e>=(t[t.length-1].endProgramDateTime||0))return null;r=r||0;for(var a=0;a=t.startSN&&i<=t.endSN){var o=e[i-t.startSN];r.cc===o.cc&&(a=o,this.log("Live playlist, switching playlist, load frag with next SN: "+a.sn))}a||(a=function(t,e){return mt(t,(function(t){return t.cce?-1:0}))}(e,r.cc))&&this.log("Live playlist, switching playlist, load frag with same CC: "+a.sn)}}else{var s=this.hls.liveSyncPosition;null!==s&&(a=this.getFragmentAtPosition(s,this.bitrateTest?t.fragmentEnd:t.edge,t))}return a},d.getFragmentAtPosition=function(t,e,r){var a,n=this.config,i=this.fragPrevious,o=r.fragments,s=r.endSN,l=r.fragmentHint,c=n.maxFragLookUpTolerance,u=!!(n.lowLatencyMode&&r.partList&&l);if(u&&l&&!this.bitrateTest&&(o=o.concat(l),s=l.sn),a=te-c?0:c):o[o.length-1]){var d=a.sn-r.startSN,h=i&&a.level===i.level,p=o[d+1];if(this.fragmentTracker.getState(a)===tt.BACKTRACKED){a=null;for(var f=d;o[f]&&this.fragmentTracker.getState(o[f])===tt.BACKTRACKED;)a=i?o[f--]:o[--f];a||(a=p)}else i&&a.sn===i.sn&&!u&&h&&(a.sn=i-e.maxFragLookUpTolerance&&n<=o;if(null!==a&&r.duration>a&&(n"+t.startSN+" prev-sn: "+(i?i.sn:"na")+" fragments: "+s),d}return l},d.waitForCdnTuneIn=function(t){return t.live&&t.canBlockReload&&t.tuneInGoal>Math.max(t.partHoldBack,3*t.partTarget)},d.setStartPosition=function(t,e){var r=this.startPosition;if(r"+t))}}])&&Ct(c.prototype,u),a}(ot);function qt(){return self.MediaSource||self.WebKitMediaSource}function Wt(){return self.SourceBuffer||self.WebKitSourceBuffer}var Kt=r(18),Xt=r(10),Zt=r(14),Jt=qt()||{isTypeSupported:function(){return!1}},Qt=function(){function t(t,e,r,a){var n=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=t,this.id=e,this.onTransmuxComplete=r,this.onFlush=a;var l=t.config,c=function(e,r){(r=r||{}).frag=n.frag,r.id=n.id,t.trigger(e,r)};this.observer=new Zt.EventEmitter,this.observer.on(i.a.FRAG_DECRYPTED,c),this.observer.on(i.a.ERROR,c);var u={mp4:Jt.isTypeSupported("video/mp4"),mpeg:Jt.isTypeSupported("audio/mpeg"),mp3:Jt.isTypeSupported('audio/mp4; codecs="mp3"')},d=navigator.vendor;if(l.enableWorker&&"undefined"!=typeof Worker){var h;s.b.log("demuxing in webworker");try{h=this.worker=Kt(19),this.onwmsg=this.onWorkerMessage.bind(this),h.addEventListener("message",this.onwmsg),h.onerror=function(e){t.trigger(i.a.ERROR,{type:o.b.OTHER_ERROR,details:o.a.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(e.message+" ("+e.filename+":"+e.lineno+")")})},h.postMessage({cmd:"init",typeSupported:u,vendor:d,id:e,config:JSON.stringify(l)})}catch(t){s.b.warn("Error in worker:",t),s.b.error("Error while initializing DemuxerWorker, fallback to inline"),h&&self.URL.revokeObjectURL(h.objectURL),this.transmuxer=new Xt.c(this.observer,u,l,d,e),this.worker=null}}else this.transmuxer=new Xt.c(this.observer,u,l,d,e)}var e=t.prototype;return e.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null;else{var e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}var r=this.observer;r&&r.removeAllListeners(),this.observer=null},e.push=function(t,e,r,a,n,i,o,l,c,u){var d,h,p=this;c.transmuxing.start=self.performance.now();var f=this.transmuxer,m=this.worker,y=i?i.start:n.start,v=n.decryptdata,g=this.frag,b=!(g&&n.cc===g.cc),w=!(g&&c.level===g.level),k=g?c.sn-g.sn:-1,S=this.part?c.part-this.part.index:1,T=!w&&(1===k||0===k&&1===S),x=self.performance.now();(w||k||0===n.stats.parsing.start)&&(n.stats.parsing.start=x),!i||!S&&T||(i.stats.parsing.start=x);var E=!(g&&(null===(d=n.initSegment)||void 0===d?void 0:d.url)===(null===(h=g.initSegment)||void 0===h?void 0:h.url)),L=new Xt.b(b,T,l,w,y,E);if(!T||b||E){s.b.log("[transmuxer-interface, "+n.type+"]: Starting new transmux session for sn: "+c.sn+" p: "+c.part+" level: "+c.level+" id: "+c.id+"\n discontinuity: "+b+"\n trackSwitch: "+w+"\n contiguous: "+T+"\n accurateTimeOffset: "+l+"\n timeOffset: "+y+"\n initSegmentChange: "+E);var _=new Xt.a(r,a,e,o,u);this.configureTransmuxer(_)}if(this.frag=n,this.part=i,m)m.postMessage({cmd:"demux",data:t,decryptdata:v,chunkMeta:c,state:L},t instanceof ArrayBuffer?[t]:[]);else if(f){var A=f.push(t,v,c,L);Object(Xt.d)(A)?A.then((function(t){p.handleTransmuxComplete(t)})):this.handleTransmuxComplete(A)}},e.flush=function(t){var e=this;t.transmuxing.start=self.performance.now();var r=this.transmuxer,a=this.worker;if(a)a.postMessage({cmd:"flush",chunkMeta:t});else if(r){var n=r.flush(t);Object(Xt.d)(n)?n.then((function(r){e.handleFlushResult(r,t)})):this.handleFlushResult(n,t)}},e.handleFlushResult=function(t,e){var r=this;t.forEach((function(t){r.handleTransmuxComplete(t)})),this.onFlush(e)},e.onWorkerMessage=function(t){var e=t.data,r=this.hls;switch(e.event){case"init":self.URL.revokeObjectURL(this.worker.objectURL);break;case"transmuxComplete":this.handleTransmuxComplete(e.data);break;case"flush":this.onFlush(e.data);break;default:e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,r.trigger(e.event,e.data)}},e.configureTransmuxer=function(t){var e=this.worker,r=this.transmuxer;e?e.postMessage({cmd:"configure",config:t}):r&&r.configure(t)},e.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},t}(),$t=function(){function t(t,e,r,a){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=t,this.media=e,this.fragmentTracker=r,this.hls=a}var e=t.prototype;return e.destroy=function(){this.hls=this.fragmentTracker=this.media=null},e.poll=function(t){var e=this.config,r=this.media,a=this.stalled,n=r.currentTime,i=r.seeking,o=this.seeking&&!i,l=!this.seeking&&i;if(this.seeking=i,n===t){if((l||o)&&(this.stalled=null),!r.paused&&!r.ended&&0!==r.playbackRate&<.getBuffered(r).length){var c=lt.bufferInfo(r,n,0),u=c.len>0,d=c.nextStart||0;if(u||d){if(i){var h=c.len>2,p=!d||d-n>2&&!this.fragmentTracker.getPartialFragment(n);if(h||p)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var f,m=Math.max(d,c.start||0)-n,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,v=(null==y||null===(f=y.details)||void 0===f?void 0:f.live)?2*y.details.targetduration:2;if(m>0&&m<=v)return void this._trySkipBufferHole(null)}var g=self.performance.now();if(null!==a){var b=g-a;!i&&b>=250&&this._reportStall(c.len);var w=lt.bufferInfo(r,n,e.maxBufferHole);this._tryFixBufferStall(w,b)}else this.stalled=g}}}else if(this.moved=!0,null!==a){if(this.stallReported){var k=self.performance.now()-a;s.b.warn("playback not stuck anymore @"+n+", after "+Math.round(k)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}},e._tryFixBufferStall=function(t,e){var r=this.config,a=this.fragmentTracker,n=this.media.currentTime,i=a.getPartialFragment(n);i&&this._trySkipBufferHole(i)||t.len>r.maxBufferHole&&e>1e3*r.highBufferWatchdogPeriod&&(s.b.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},e._reportStall=function(t){var e=this.hls,r=this.media;this.stallReported||(this.stallReported=!0,s.b.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+t+")"),e.trigger(i.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.BUFFER_STALLED_ERROR,fatal:!1,buffer:t}))},e._trySkipBufferHole=function(t){for(var e=this.config,r=this.hls,a=this.media,n=a.currentTime,l=0,c=lt.getBuffered(a),u=0;u=l&&n0&&-1===t&&(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e),this.state=It,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this._forceStartLoad=!0,this.state=Ot},d.stopLoad=function(){this._forceStartLoad=!1,t.prototype.stopLoad.call(this)},d.doTick=function(){switch(this.state){case It:this.doTickIdle();break;case Yt:var t,e=this.levels,r=this.level,a=null==e||null===(t=e[r])||void 0===t?void 0:t.details;if(a&&(!a.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(a))break;this.state=It;break}break;case Ft:var n,i=self.performance.now(),o=this.retryDate;(!o||i>=o||null!==(n=this.media)&&void 0!==n&&n.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=It)}this.onTickEnd()},d.onTickEnd=function(){t.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},d.doTickIdle=function(){var t,e,r=this.hls,a=this.levelLastLoaded,n=this.levels,o=this.media,s=r.config,l=r.nextLoadLevel;if(null!==a&&(o||!this.startFragRequested&&s.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&n&&n[l]){var u=n[l];this.level=r.nextLoadLevel=l;var d=u.details;if(!d||this.state===Yt||d.live&&this.levelLastLoaded!==l)this.state=Yt;else{var h=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:o,_.b.MAIN);if(null!==h&&!(h.len>=this.getMaxBufferLength(u.maxBitrate))){if(this._streamEnded(h,d)){var p={};return this.altAudio&&(p.type="video"),this.hls.trigger(i.a.BUFFER_EOS,p),void(this.state=Gt)}var f=h.end,m=this.getNextFragment(f,d);if(this.couldBacktrack&&!this.fragPrevious&&m&&"initSegment"!==m.sn){var y=m.sn-d.startSN;y>1&&(m=d.fragments[y-1],this.fragmentTracker.removeFragment(m))}if(m&&this.fragmentTracker.getState(m)===tt.OK&&this.nextLoadPosition>f){var v=this.audioOnly&&!this.altAudio?c.a.AUDIO:c.a.VIDEO;this.afterBufferFlushed(o,v,_.b.MAIN),m=this.getNextFragment(this.nextLoadPosition,d)}m&&(!m.initSegment||m.initSegment.data||this.bitrateTest||(m=m.initSegment),"identity"!==(null===(t=m.decryptdata)||void 0===t?void 0:t.keyFormat)||null!==(e=m.decryptdata)&&void 0!==e&&e.key?this.loadFragment(m,d,f):this.loadKey(m,d))}}}},d.loadFragment=function(e,r,a){var n,i=this.fragmentTracker.getState(e);if(this.fragCurrent=e,i===tt.BACKTRACKED){var o=this.fragmentTracker.getBacktrackData(e);if(o)return this._handleFragmentLoadProgress(o),void this._handleFragmentLoadComplete(o);i=tt.NOT_LOADED}i===tt.NOT_LOADED||i===tt.PARTIAL?"initSegment"===e.sn?this._loadInitSegment(e):this.bitrateTest?(e.bitrateTest=!0,this.log("Fragment "+e.sn+" of level "+e.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(e)):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,r,a)):i===tt.APPENDING?this.reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e):0===(null===(n=this.media)||void 0===n?void 0:n.buffered.length)&&this.fragmentTracker.removeAllFragments()},d.getAppendedFrag=function(t){var e=this.fragmentTracker.getAppendedFrag(t,_.b.MAIN);return e&&"fragment"in e?e.fragment:e},d.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,_.b.MAIN)},d.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.end+.5):null},d.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},d.nextLevelSwitch=function(){var t=this.levels,e=this.media;if(null!=e&&e.readyState){var r,a=this.getAppendedFrag(e.currentTime);if(a&&a.start>1&&this.flushMainBuffer(0,a.start-1),!e.paused&&t){var n=t[this.hls.nextLoadLevel],i=this.fragLastKbps;r=i&&this.fragCurrent?this.fragCurrent.duration*n.maxBitrate/(1e3*i)+1:0}else r=0;var o=this.getBufferedFrag(e.currentTime+r);if(o){var s=this.followingBufferedFrag(o);if(s){this.abortCurrentFrag();var l=s.maxStartPTS?s.maxStartPTS:s.start,c=s.duration,u=Math.max(o.end,l+Math.min(Math.max(c-this.config.maxFragLookUpTolerance,.5*c),.75*c));this.flushMainBuffer(u,Number.POSITIVE_INFINITY)}}}},d.abortCurrentFrag=function(){var t=this.fragCurrent;this.fragCurrent=null,null!=t&&t.loader&&t.loader.abort(),this.state===Pt&&(this.state=It),this.nextLoadPosition=this.getLoadPosition()},d.flushMainBuffer=function(e,r){t.prototype.flushMainBuffer.call(this,e,r,this.altAudio?"video":null)},d.onMediaAttached=function(e,r){t.prototype.onMediaAttached.call(this,e,r);var a=r.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),a.addEventListener("playing",this.onvplaying),a.addEventListener("seeked",this.onvseeked),this.gapController=new $t(this.config,a,this.fragmentTracker,this.hls)},d.onMediaDetaching=function(){var e=this.media;e&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),t.prototype.onMediaDetaching.call(this)},d.onMediaPlaying=function(){this.tick()},d.onMediaSeeked=function(){var t=this.media,e=t?t.currentTime:null;Object(n.a)(e)&&this.log("Media seeked to "+e.toFixed(3)),this.tick()},d.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(i.a.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},d.onManifestParsed=function(t,e){var r,a,n,i=!1,o=!1;e.levels.forEach((function(t){(r=t.audioCodec)&&(-1!==r.indexOf("mp4a.40.2")&&(i=!0),-1!==r.indexOf("mp4a.40.5")&&(o=!0))})),this.audioCodecSwitch=i&&o&&!("function"==typeof(null==(n=Wt())||null===(a=n.prototype)||void 0===a?void 0:a.changeType)),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1},d.onLevelLoading=function(t,e){var r=this.levels;if(r&&this.state===It){var a=r[e.level];(!a.details||a.details.live&&this.levelLastLoaded!==e.level||this.waitForCdnTuneIn(a.details))&&(this.state=Yt)}},d.onLevelLoaded=function(t,e){var r,a=this.levels,n=e.level,o=e.details,s=o.totalduration;if(a){this.log("Level "+n+" loaded ["+o.startSN+","+o.endSN+"], cc ["+o.startCC+", "+o.endCC+"] duration:"+s);var l=this.fragCurrent;!l||this.state!==Mt&&this.state!==Ft||l.level!==e.level&&l.loader&&(this.state=It,l.loader.abort());var c=a[n],u=0;if(o.live||null!==(r=c.details)&&void 0!==r&&r.live){if(o.fragments[0]||(o.deltaUpdateFailed=!0),o.deltaUpdateFailed)return;u=this.alignPlaylists(o,c.details)}if(c.details=o,this.levelLastLoaded=n,this.hls.trigger(i.a.LEVEL_UPDATED,{details:o,level:n}),this.state===Yt){if(this.waitForCdnTuneIn(o))return;this.state=It}this.startFragRequested?o.live&&this.synchronizeToLiveEdge(o):this.setStartPosition(o,u),this.tick()}else this.warn("Levels were reset while loading level "+n)},d._handleFragmentLoadProgress=function(t){var e,r=t.frag,a=t.part,n=t.payload,i=this.levels;if(i){var o=i[r.level],s=o.details;if(s){var l=o.videoCodec,c=s.PTSKnown||!s.live,u=null===(e=r.initSegment)||void 0===e?void 0:e.data,d=this._getAudioCodec(o),h=this.transmuxer=this.transmuxer||new Qt(this.hls,_.b.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),p=a?a.index:-1,f=-1!==p,m=new ct(r.level,r.sn,r.stats.chunkCount,n.byteLength,p,f),y=this.initPTS[r.cc];h.push(n,u,d,l,r,a,s.totalduration,c,m,y)}else this.warn("Dropping fragment "+r.sn+" of level "+r.level+" after level details were reset")}else this.warn("Levels were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered")},d.onAudioTrackSwitching=function(t,e){var r=this.altAudio,a=!!e.url,n=e.id;if(!a){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var o=this.fragCurrent;null!=o&&o.loader&&(this.log("Switching to main audio track, cancel main fragment load"),o.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var s=this.hls;r&&s.trigger(i.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),s.trigger(i.a.AUDIO_TRACK_SWITCHED,{id:n})}},d.onAudioTrackSwitched=function(t,e){var r=e.id,a=!!this.hls.audioTracks[r].url;if(a){var n=this.videoBuffer;n&&this.mediaBuffer!==n&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=a,this.tick()},d.onBufferCreated=function(t,e){var r,a,n=e.tracks,i=!1;for(var o in n){var s=n[o];if("main"===s.id){if(a=o,r=s,"video"===o){var l=n[o];l&&(this.videoBuffer=l.buffer)}}else i=!0}i&&r?(this.log("Alternate track found, use "+a+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media},d.onFragBuffered=function(t,e){var r=e.frag,a=e.part;if(!r||r.type===_.b.MAIN){if(this.fragContextChanged(r))return this.warn("Fragment "+r.sn+(a?" p: "+a.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state),void(this.state===Ut&&(this.state=It));var n=a?a.stats:r.stats;this.fragLastKbps=Math.round(8*n.total/(n.buffering.end-n.loading.first)),"initSegment"!==r.sn&&(this.fragPrevious=r),this.fragBufferedComplete(r,a)}},d.onError=function(t,e){switch(e.details){case o.a.FRAG_LOAD_ERROR:case o.a.FRAG_LOAD_TIMEOUT:case o.a.KEY_LOAD_ERROR:case o.a.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(_.b.MAIN,e);break;case o.a.LEVEL_LOAD_ERROR:case o.a.LEVEL_LOAD_TIMEOUT:this.state!==Ht&&(e.fatal?(this.warn(""+e.details),this.state=Ht):e.levelRetry||this.state!==Yt||(this.state=It));break;case o.a.BUFFER_FULL_ERROR:if("main"===e.parent&&(this.state===Nt||this.state===Ut)){var r=!0,a=this.getFwdBufferInfo(this.media,_.b.MAIN);a&&a.len>.5&&(r=!this.reduceMaxBufferLength(a.len)),r&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}}},d.checkBuffer=function(){var t=this.media,e=this.gapController;if(t&&e&&t.readyState){var r=lt.getBuffered(t);!this.loadedmetadata&&r.length?(this.loadedmetadata=!0,this.seekToStartPos()):e.poll(this.lastCurrentTime),this.lastCurrentTime=t.currentTime}},d.onFragLoadEmergencyAborted=function(){this.state=It,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},d.onBufferFlushed=function(t,e){var r=e.type;if(r!==c.a.AUDIO||this.audioOnly&&!this.altAudio){var a=(r===c.a.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(a,r,_.b.MAIN)}},d.onLevelsUpdated=function(t,e){this.levels=e.levels},d.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},d.seekToStartPos=function(){var t=this.media,e=t.currentTime,r=this.startPosition;if(r>=0&&e0&&(n1&&!1===t.seeking){var r=t.currentTime;if(lt.isBuffered(t,r)?e=this.getAppendedFrag(r):lt.isBuffered(t,r+.1)&&(e=this.getAppendedFrag(r+.1)),e){var a=this.fragPlaying,n=e.level;a&&e.sn===a.sn&&a.level===n&&e.urlId===a.urlId||(this.hls.trigger(i.a.FRAG_CHANGED,{frag:e}),a&&a.level===n||this.hls.trigger(i.a.LEVEL_SWITCHED,{level:n}),this.fragPlaying=e)}}},l=a,(u=[{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"currentLevel",get:function(){var t=this.media;if(t){var e=this.getAppendedFrag(t.currentTime);if(e)return e.level}return-1}},{key:"nextBufferedFrag",get:function(){var t=this.media;if(t){var e=this.getAppendedFrag(t.currentTime);return this.followingBufferedFrag(e)}return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}])&&te(l.prototype,u),a}(zt),ae=function(){function t(t,e,r){void 0===e&&(e=0),void 0===r&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=r}var e=t.prototype;return e.sample=function(t,e){var r=Math.pow(this.alpha_,t);this.estimate_=e*(1-r)+r*this.estimate_,this.totalWeight_+=t},e.getTotalWeight=function(){return this.totalWeight_},e.getEstimate=function(){if(this.alpha_){var t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_},t}(),ne=function(){function t(t,e,r){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new ae(t),this.fast_=new ae(e)}var e=t.prototype;return e.update=function(t,e){var r=this.slow_,a=this.fast_;this.slow_.halfLife!==t&&(this.slow_=new ae(t,r.getEstimate(),r.getTotalWeight())),this.fast_.halfLife!==e&&(this.fast_=new ae(e,a.getEstimate(),a.getTotalWeight()))},e.sample=function(t,e){var r=(t=Math.max(t,this.minDelayMs_))/1e3,a=8*e/r;this.fast_.sample(r,a),this.slow_.sample(r,a)},e.canEstimate=function(){var t=this.fast_;return t&&t.getTotalWeight()>=this.minWeight_},e.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},e.destroy=function(){},t}();function ie(t,e){for(var r=0;r=2*u/h||g<=w)){var k,S=Number.POSITIVE_INFINITY;for(k=t.level-1;k>f&&!((S=u*p[k].maxBitrate/(6.4*v))=g)){var T=this.bwEstimator.getEstimate();s.b.warn("Fragment "+t.sn+(e?" part "+e.index:"")+" of level "+t.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+k+"\n Current BW estimate: "+(Object(n.a)(T)?(T/1024).toFixed(3):"Unknown")+" Kb/s\n Estimated load time for current fragment: "+g.toFixed(3)+" s\n Estimated load time for the next fragment: "+S.toFixed(3)+" s\n Time to underbuffer: "+w.toFixed(3)+" s"),r.nextLoadLevel=k,this.bwEstimator.sample(d,c.loaded),this.clearTimer(),t.loader&&(this.fragCurrent=this.partCurrent=null,t.loader.abort()),r.trigger(i.a.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:e,stats:c})}}}}}},a.onFragLoaded=function(t,e){var r=e.frag,a=e.part;if(r.type===_.b.MAIN&&Object(n.a)(r.sn)){var o=a?a.stats:r.stats,s=a?a.duration:r.duration;if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var l=this.hls.levels[r.level],c=(l.loaded?l.loaded.bytes:0)+o.loaded,u=(l.loaded?l.loaded.duration:0)+s;l.loaded={bytes:c,duration:u},l.realBitrate=Math.round(8*c/u)}if(r.bitrateTest){var d={stats:o,frag:r,part:a,id:r.type};this.onFragBuffered(i.a.FRAG_BUFFERED,d),r.bitrateTest=!1}}},a.onFragBuffered=function(t,e){var r=e.frag,a=e.part,n=a?a.stats:r.stats;if(!n.aborted&&r.type===_.b.MAIN&&"initSegment"!==r.sn){var i=n.parsing.end-n.loading.start;this.bwEstimator.sample(i,n.loaded),n.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=i/1e3:this.bitrateTestDelay=0}},a.onError=function(t,e){switch(e.details){case o.a.FRAG_LOAD_ERROR:case o.a.FRAG_LOAD_TIMEOUT:this.clearTimer()}},a.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},a.getNextABRAutoLevel=function(){var t=this.fragCurrent,e=this.partCurrent,r=this.hls,a=r.maxAutoLevel,n=r.config,i=r.minAutoLevel,o=r.media,l=e?e.duration:t?t.duration:0,c=o?o.currentTime:0,u=o&&0!==o.playbackRate?Math.abs(o.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():n.abrEwmaDefaultEstimate,h=(lt.bufferInfo(o,c,n.maxBufferHole).end-c)/u,p=this.findBestLevel(d,i,a,h,n.abrBandWidthFactor,n.abrBandWidthUpFactor);if(p>=0)return p;s.b.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var f=l?Math.min(l,n.maxStarvationDelay):n.maxStarvationDelay,m=n.abrBandWidthFactor,y=n.abrBandWidthUpFactor;if(!h){var v=this.bitrateTestDelay;v&&(f=(l?Math.min(l,n.maxLoadingDelay):n.maxLoadingDelay)-v,s.b.trace("bitrate test took "+Math.round(1e3*v)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*f)+" ms"),m=y=1)}return p=this.findBestLevel(d,i,a,h+f,m,y),Math.max(p,0)},a.findBestLevel=function(t,e,r,a,n,i){for(var o,l=this.fragCurrent,c=this.partCurrent,u=this.lastLoadedFragLevel,d=this.hls.levels,h=d[u],p=!(null==h||null===(o=h.details)||void 0===o||!o.live),f=null==h?void 0:h.codecSet,m=c?c.duration:l?l.duration:0,y=r;y>=e;y--){var v=d[y];if(v&&(!f||v.codecSet===f)){var g,b=v.details,w=(c?null==b?void 0:b.partTarget:null==b?void 0:b.averagetargetduration)||m;g=y<=u?n*t:i*t;var k=d[y].maxBitrate,S=k*w/g;if(s.b.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+y+"/"+Math.round(g)+"/"+k+"/"+w+"/"+a+"/"+S),g>k&&(!S||p&&!this.bitrateTestDelay||S0&&-1===t?(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),this.state=It):(this.loadedmetadata=!1,this.state=Bt),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()},l.doTick=function(){switch(this.state){case It:this.doTickIdle();break;case Bt:var e,r=this.levels,a=this.trackId,n=null==r||null===(e=r[a])||void 0===e?void 0:e.details;if(n){if(this.waitForCdnTuneIn(n))break;this.state=Vt}break;case Ft:var i,o=performance.now(),l=this.retryDate;(!l||o>=l||null!==(i=this.media)&&void 0!==i&&i.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=It);break;case Vt:var c=this.waitingData;if(c){var u=c.frag,d=c.part,h=c.cache,p=c.complete;if(void 0!==this.initPTS[u.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=Mt;var f={frag:u,part:d,payload:h.flush(),networkDetails:null};this._handleFragmentLoadProgress(f),p&&t.prototype._handleFragmentLoadComplete.call(this,f)}else if(this.videoTrackCC!==this.waitingVideoCC)s.b.log("Waiting fragment cc ("+u.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var m=this.getLoadPosition(),y=lt.bufferInfo(this.mediaBuffer,m,this.config.maxBufferHole);vt(y.end,this.config.maxFragLookUpTolerance,u)<0&&(s.b.log("Waiting fragment cc ("+u.cc+") @ "+u.start+" cancelled because another fragment at "+y.end+" is needed"),this.clearWaitingFragment())}}else this.state=It}this.onTickEnd()},l.clearWaitingFragment=function(){var t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=It)},l.onTickEnd=function(){var t=this.media;if(t&&t.readyState){var e=(this.mediaBuffer?this.mediaBuffer:t).buffered;!this.loadedmetadata&&e.length&&(this.loadedmetadata=!0),this.lastCurrentTime=t.currentTime}},l.doTickIdle=function(){var t,e,r=this.hls,a=this.levels,n=this.media,o=this.trackId,s=r.config;if(a&&a[o]&&(n||!this.startFragRequested&&s.startFragPrefetch)){var l=a[o].details;if(!l||l.live&&this.levelLastLoaded!==o||this.waitForCdnTuneIn(l))this.state=Bt;else{this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,c.a.AUDIO,_.b.AUDIO));var u=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,_.b.AUDIO);if(null!==u){var d=u.len,h=this.getMaxBufferLength(),p=this.audioSwitch;if(!(d>=h)||p){if(!p&&this._streamEnded(u,l))return r.trigger(i.a.BUFFER_EOS,{type:"audio"}),void(this.state=Gt);var f=l.fragments[0].start,m=u.end;if(p){var y=this.getLoadPosition();m=y,l.PTSKnown&&yf||u.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=f+.05)}var v=this.getNextFragment(m,l);v?"identity"!==(null===(t=v.decryptdata)||void 0===t?void 0:t.keyFormat)||null!==(e=v.decryptdata)&&void 0!==e&&e.key?this.loadFragment(v,l,m):this.loadKey(v,l):this.bufferFlushed=!0}}}}},l.getMaxBufferLength=function(){var e=t.prototype.getMaxBufferLength.call(this),r=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,_.b.MAIN);return null===r?e:Math.max(e,r.len)},l.onMediaDetaching=function(){this.videoBuffer=null,t.prototype.onMediaDetaching.call(this)},l.onAudioTracksUpdated=function(t,e){var r=e.audioTracks;this.resetTransmuxer(),this.levels=r.map((function(t){return new H(t)}))},l.onAudioTrackSwitching=function(t,e){var r=!!e.url;this.trackId=e.id;var a=this.fragCurrent;null!=a&&a.loader&&a.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),r?this.setInterval(100):this.resetTransmuxer(),r?(this.audioSwitch=!0,this.state=It):this.state=Ot,this.tick()},l.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},l.onLevelLoaded=function(t,e){this.mainDetails=e.details},l.onAudioTrackLoaded=function(t,e){var r,a=this.levels,n=e.details,i=e.id;if(a){this.log("Track "+i+" loaded ["+n.startSN+","+n.endSN+"],duration:"+n.totalduration);var o=a[i],s=0;if(n.live||null!==(r=o.details)&&void 0!==r&&r.live){var l=this.mainDetails;if(n.fragments[0]||(n.deltaUpdateFailed=!0),n.deltaUpdateFailed||!l)return;!o.details&&n.hasProgramDateTime&&l.hasProgramDateTime?(ft(n,l),s=n.fragments[0].start):s=this.alignPlaylists(n,o.details)}o.details=n,this.levelLastLoaded=i,this.startFragRequested||!this.mainDetails&&n.live||this.setStartPosition(o.details,s),this.state!==Bt||this.waitForCdnTuneIn(n)||(this.state=It),this.tick()}else this.warn("Audio tracks were reset while loading level "+i)},l._handleFragmentLoadProgress=function(t){var e,r=t.frag,a=t.part,n=t.payload,i=this.config,o=this.trackId,l=this.levels;if(l){var c=l[o],u=c.details,d=i.defaultAudioCodec||c.audioCodec||"mp4a.40.2",h=this.transmuxer;h||(h=this.transmuxer=new Qt(this.hls,_.b.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var p=this.initPTS[r.cc],f=null===(e=r.initSegment)||void 0===e?void 0:e.data;if(void 0!==p){var m=a?a.index:-1,y=-1!==m,v=new ct(r.level,r.sn,r.stats.chunkCount,n.byteLength,m,y);h.push(n,f,d,"",r,a,u.totalduration,!1,v,p)}else s.b.log("Unknown video PTS for cc "+r.cc+", waiting for video PTS before demuxing audio frag "+r.sn+" of ["+u.startSN+" ,"+u.endSN+"],track "+o),(this.waitingData=this.waitingData||{frag:r,part:a,cache:new se.a,complete:!1}).cache.push(new Uint8Array(n)),this.waitingVideoCC=this.videoTrackCC,this.state=Vt}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered")},l._handleFragmentLoadComplete=function(e){this.waitingData?this.waitingData.complete=!0:t.prototype._handleFragmentLoadComplete.call(this,e)},l.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},l.onBufferCreated=function(t,e){var r=e.tracks.audio;r&&(this.mediaBuffer=r.buffer),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer)},l.onFragBuffered=function(t,e){var r=e.frag,a=e.part;r.type===_.b.AUDIO&&(this.fragContextChanged(r)?this.warn("Fragment "+r.sn+(a?" p: "+a.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch):("initSegment"!==r.sn&&(this.fragPrevious=r,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(i.a.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(r,a)))},l.onError=function(e,r){switch(r.details){case o.a.FRAG_LOAD_ERROR:case o.a.FRAG_LOAD_TIMEOUT:case o.a.KEY_LOAD_ERROR:case o.a.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(_.b.AUDIO,r);break;case o.a.AUDIO_TRACK_LOAD_ERROR:case o.a.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==Ht&&this.state!==Ot&&(this.state=r.fatal?Ht:It,this.warn(r.details+" while loading frag, switching to "+this.state+" state"));break;case o.a.BUFFER_FULL_ERROR:if("audio"===r.parent&&(this.state===Nt||this.state===Ut)){var a=!0,n=this.getFwdBufferInfo(this.mediaBuffer,_.b.AUDIO);n&&n.len>.5&&(a=!this.reduceMaxBufferLength(n.len)),a&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}}},l.onBufferFlushed=function(t,e){e.type===c.a.AUDIO&&(this.bufferFlushed=!0)},l._handleTransmuxComplete=function(t){var e,r="audio",a=this.hls,n=t.remuxResult,o=t.chunkMeta,s=this.getCurrentContext(o);if(!s)return this.warn("The loading context changed while buffering fragment "+o.sn+" of level "+o.level+". This chunk will not be buffered."),void this.resetLiveStartWhenNotLoaded(o.level);var l=s.frag,u=s.part,d=n.audio,h=n.text,p=n.id3,f=n.initSegment;if(!this.fragContextChanged(l)){if(this.state=Nt,this.audioSwitch&&d&&this.completeAudioSwitch(),null!=f&&f.tracks&&(this._bufferInitSegment(f.tracks,l,o),a.trigger(i.a.FRAG_PARSING_INIT_SEGMENT,{frag:l,id:r,tracks:f.tracks})),d){var m=d.startPTS,y=d.endPTS,v=d.startDTS,g=d.endDTS;u&&(u.elementaryStreams[c.a.AUDIO]={startPTS:m,endPTS:y,startDTS:v,endDTS:g}),l.setElementaryStreamInfo(c.a.AUDIO,m,y,v,g),this.bufferFragmentData(d,l,u,o)}if(null!=p&&null!==(e=p.samples)&&void 0!==e&&e.length){var b=le({frag:l,id:r},p);a.trigger(i.a.FRAG_PARSING_METADATA,b)}if(h){var w=le({frag:l,id:r},h);a.trigger(i.a.FRAG_PARSING_USERDATA,w)}}},l._bufferInitSegment=function(t,e,r){if(this.state===Nt){t.video&&delete t.video;var a=t.audio;if(a){a.levelCodec=a.codec,a.id="audio",this.log("Init audio buffer, container:"+a.container+", codecs[parsed]=["+a.codec+"]"),this.hls.trigger(i.a.BUFFER_CODECS,t);var n=a.initSegment;if(null!=n&&n.byteLength){var o={type:"audio",frag:e,part:null,chunkMeta:r,parent:e.type,data:n};this.hls.trigger(i.a.BUFFER_APPENDING,o)}this.tick()}}},l.loadFragment=function(e,r,a){var i=this.fragmentTracker.getState(e);this.fragCurrent=e,(this.audioSwitch||i===tt.NOT_LOADED||i===tt.PARTIAL)&&("initSegment"===e.sn?this._loadInitSegment(e):r.live&&!Object(n.a)(this.initPTS[e.cc])?(this.log("Waiting for video PTS in continuity counter "+e.cc+" of live stream before loading audio fragment "+e.sn+" of level "+this.trackId),this.state=Vt):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,r,a)))},l.completeAudioSwitch=function(){var e=this.hls,r=this.media,a=this.trackId;r&&(this.log("Switching audio track : flushing all audio"),t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,e.trigger(i.a.AUDIO_TRACK_SWITCHED,{id:a})},a}(zt);function de(t,e){for(var r=0;r=e.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var r=e[this.trackId];this.log("Now switching to audio-track index "+t);var a=e[t],n=a.id,o=a.groupId,s=void 0===o?"":o,l=a.name,c=a.type,u=a.url;if(this.trackId=t,this.trackName=l,this.selectDefaultTrack=!1,this.hls.trigger(i.a.AUDIO_TRACK_SWITCHING,{id:n,groupId:s,name:l,type:c,url:u}),!a.details||a.details.live){var d=this.switchParams(a.url,null==r?void 0:r.details);this.loadPlaylist(d)}}},l.selectInitialTrack=function(){this.tracksInGroup;var t=this.trackName,e=this.findTrackId(t)||this.findTrackId();-1!==e?this.setAudioTrack(e):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(i.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},l.findTrackId=function(t){for(var e=this.tracksInGroup,r=0;r=n[s].start&&o<=n[s].end){i=n[s];break}var l=r.start+r.duration;i?i.end=l:(i={start:o,end:l},n.push(i)),this.fragmentTracker.fragBuffered(r)}}},s.onBufferFlushing=function(t,e){var r=e.startOffset,a=e.endOffset;if(0===r&&a!==Number.POSITIVE_INFINITY){var n=this.currentTrackId,i=this.levels;if(!i.length||!i[n]||!i[n].details)return;var o=a-i[n].details.targetduration;if(o<=0)return;e.endOffsetSubtitles=Math.max(0,o),this.tracksBuffered.forEach((function(t){for(var e=0;e=o.length||n!==i)&&s){if(this.mediaBuffer=this.mediaBufferTimeRanges,a.live||null!==(r=s.details)&&void 0!==r&&r.live){var l=this.mainDetails;if(a.deltaUpdateFailed||!l)return;var c=l.fragments[0];s.details?0===this.alignPlaylists(a,s.details)&&c&&X(a,c.start):a.hasProgramDateTime&&l.hasProgramDateTime?ft(a,l):c&&X(a,c.start)}s.details=a,this.levelLastLoaded=n,this.tick(),a.live&&!this.fragCurrent&&this.media&&this.state===It&&(yt(null,a.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),s.details=void 0))}}},s._handleFragmentLoadComplete=function(t){var e=t.frag,r=t.payload,a=e.decryptdata,n=this.hls;if(!this.fragContextChanged(e)&&r&&r.byteLength>0&&a&&a.key&&a.iv&&"AES-128"===a.method){var o=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(r),a.key.buffer,a.iv.buffer).then((function(t){var r=performance.now();n.trigger(i.a.FRAG_DECRYPTED,{frag:e,payload:t,stats:{tstart:o,tdecrypt:r}})}))}},s.doTick=function(){if(this.media){if(this.state===It){var t,e=this.currentTrackId,r=this.levels;if(!r.length||!r[e]||!r[e].details)return;var a=r[e].details,n=a.targetduration,i=this.config,o=this.media,s=lt.bufferedInfo(this.mediaBufferTimeRanges,o.currentTime-n,i.maxBufferHole),l=s.end;if(s.len>this.getMaxBufferLength()+n)return;var c,u=a.fragments,d=u.length,h=a.edge,p=this.fragPrevious;l-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))},s.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},s.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),be(this.media.textTracks).forEach((function(t){I(t)})),this.subtitleTrack=-1,this.media=null)},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},s.onManifestParsed=function(t,e){this.tracks=e.subtitleTracks},s.onSubtitleTrackLoaded=function(t,e){var r=e.id,a=e.details,n=this.trackId,i=this.tracksInGroup[n];if(i){var o=i.details;i.details=e.details,this.log("subtitle track "+r+" loaded ["+a.startSN+"-"+a.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,e,o))}else this.warn("Invalid subtitle track id "+r)},s.onLevelLoading=function(t,e){this.switchLevel(e.level)},s.onLevelSwitching=function(t,e){this.switchLevel(e.level)},s.switchLevel=function(t){var e=this.hls.levels[t];if(null!=e&&e.textGroupIds){var r=e.textGroupIds[e.urlId];if(this.groupId!==r){var a=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,n=this.tracks.filter((function(t){return!r||t.groupId===r}));this.tracksInGroup=n;var o=this.findTrackId(null==a?void 0:a.name)||this.findTrackId();this.groupId=r;var s={subtitleTracks:n};this.log("Updating subtitle tracks, "+n.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(i.a.SUBTITLE_TRACKS_UPDATED,s),-1!==o&&this.setSubtitleTrack(o,a)}}},s.findTrackId=function(t){for(var e=this.tracksInGroup,r=0;r=a.length)){this.clearTimer();var n=a[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,n){var o=n.id,s=n.groupId,l=void 0===s?"":s,c=n.name,u=n.type,d=n.url;this.hls.trigger(i.a.SUBTITLE_TRACK_SWITCH,{id:o,groupId:l,name:c,type:u,url:d});var h=this.switchParams(n.url,null==e?void 0:e.details);this.loadPlaylist(h)}else this.hls.trigger(i.a.SUBTITLE_TRACK_SWITCH,{id:t})}}else this.queuedDefaultTrack=t},s.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var t=-1,e=be(this.media.textTracks),r=0;r0||Object.keys(this.pendingTracks).length>0},e.destroy=function(){this.unregisterListeners(),this.details=null},e.registerListeners=function(){var t=this.hls;t.on(i.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(i.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(i.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(i.a.BUFFER_RESET,this.onBufferReset,this),t.on(i.a.BUFFER_APPENDING,this.onBufferAppending,this),t.on(i.a.BUFFER_CODECS,this.onBufferCodecs,this),t.on(i.a.BUFFER_EOS,this.onBufferEos,this),t.on(i.a.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(i.a.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(i.a.FRAG_PARSED,this.onFragParsed,this),t.on(i.a.FRAG_CHANGED,this.onFragChanged,this)},e.unregisterListeners=function(){var t=this.hls;t.off(i.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(i.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(i.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(i.a.BUFFER_RESET,this.onBufferReset,this),t.off(i.a.BUFFER_APPENDING,this.onBufferAppending,this),t.off(i.a.BUFFER_CODECS,this.onBufferCodecs,this),t.off(i.a.BUFFER_EOS,this.onBufferEos,this),t.off(i.a.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(i.a.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(i.a.FRAG_PARSED,this.onFragParsed,this),t.off(i.a.FRAG_CHANGED,this.onFragChanged,this)},e._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new Se(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},e.onManifestParsed=function(t,e){var r=2;(e.audio&&!e.video||!e.altAudio)&&(r=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=r,this.details=null,s.b.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},e.onMediaAttaching=function(t,e){var r=this.media=e.media;if(r&&Te){var a=this.mediaSource=new Te;a.addEventListener("sourceopen",this._onMediaSourceOpen),a.addEventListener("sourceended",this._onMediaSourceEnded),a.addEventListener("sourceclose",this._onMediaSourceClose),r.src=self.URL.createObjectURL(a),this._objectUrl=r.src}},e.onMediaDetaching=function(){var t=this.media,e=this.mediaSource,r=this._objectUrl;if(e){if(s.b.log("[buffer-controller]: media source detaching"),"open"===e.readyState)try{e.endOfStream()}catch(t){s.b.warn("[buffer-controller]: onMediaDetaching: "+t.message+" while calling endOfStream")}this.onBufferReset(),e.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("sourceended",this._onMediaSourceEnded),e.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(r&&self.URL.revokeObjectURL(r),t.src===r?(t.removeAttribute("src"),t.load()):s.b.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(i.a.MEDIA_DETACHED,void 0)},e.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach((function(e){var r=t.sourceBuffer[e];try{r&&(t.removeBufferListeners(e),t.mediaSource&&t.mediaSource.removeSourceBuffer(r),t.sourceBuffer[e]=void 0)}catch(t){s.b.warn("[buffer-controller]: Failed to reset the "+e+" buffer",t)}})),this._initSourceBuffer()},e.onBufferCodecs=function(t,e){var r=this,a=this.getSourceBufferTypes().length;Object.keys(e).forEach((function(t){if(a){var n=r.tracks[t];if(n&&"function"==typeof n.buffer.changeType){var i=e[t],o=i.codec,s=i.levelCodec,l=i.container;if((n.levelCodec||n.codec).replace(xe,"$1")!==(s||o).replace(xe,"$1")){var c=l+";codecs="+(s||o);r.appendChangeType(t,c)}}}else r.pendingTracks[t]=e[t]})),a||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},e.appendChangeType=function(t,e){var r=this,a=this.operationQueue,n={execute:function(){var n=r.sourceBuffer[t];n&&(s.b.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+e),n.changeType(e)),a.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(e){s.b.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",e)}};a.append(n,t)},e.onBufferAppending=function(t,e){var r=this,a=this.hls,n=this.operationQueue,l=this.tracks,c=e.data,u=e.type,d=e.frag,h=e.part,p=e.chunkMeta,f=p.buffering[u],m=self.performance.now();f.start=m;var y=d.stats.buffering,v=h?h.stats.buffering:null;0===y.start&&(y.start=m),v&&0===v.start&&(v.start=m);var g=l.audio,b="audio"===u&&1===p.id&&"audio/mpeg"===(null==g?void 0:g.container),w={execute:function(){if(f.executeStart=self.performance.now(),b){var t=r.sourceBuffer[u];if(t){var e=d.start-t.timestampOffset;Math.abs(e)>=.1&&(s.b.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+d.start+" (delta: "+e+") sn: "+d.sn+")"),t.timestampOffset=d.start)}}r.appendExecutor(c,u)},onStart:function(){},onComplete:function(){var t=self.performance.now();f.executeEnd=f.end=t,0===y.first&&(y.first=t),v&&0===v.first&&(v.first=t);var e=r.sourceBuffer,a={};for(var n in e)a[n]=lt.getBuffered(e[n]);r.appendError=0,r.hls.trigger(i.a.BUFFER_APPENDED,{type:u,frag:d,part:h,chunkMeta:p,parent:d.type,timeRanges:a})},onError:function(t){s.b.error("[buffer-controller]: Error encountered while trying to append to the "+u+" SourceBuffer",t);var e={type:o.b.MEDIA_ERROR,parent:d.type,details:o.a.BUFFER_APPEND_ERROR,err:t,fatal:!1};t.code===DOMException.QUOTA_EXCEEDED_ERR?e.details=o.a.BUFFER_FULL_ERROR:(r.appendError++,e.details=o.a.BUFFER_APPEND_ERROR,r.appendError>a.config.appendErrorMaxRetry&&(s.b.error("[buffer-controller]: Failed "+a.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),e.fatal=!0)),a.trigger(i.a.ERROR,e)}};n.append(w,u)},e.onBufferFlushing=function(t,e){var r=this,a=this.operationQueue,n=function(t){return{execute:r.removeExecutor.bind(r,t,e.startOffset,e.endOffset),onStart:function(){},onComplete:function(){r.hls.trigger(i.a.BUFFER_FLUSHED,{type:t})},onError:function(e){s.b.warn("[buffer-controller]: Failed to remove from "+t+" SourceBuffer",e)}}};e.type?a.append(n(e.type),e.type):this.getSourceBufferTypes().forEach((function(t){a.append(n(t),t)}))},e.onFragParsed=function(t,e){var r=this,a=e.frag,n=e.part,o=[],l=n?n.elementaryStreams:a.elementaryStreams;l[c.a.AUDIOVIDEO]?o.push("audiovideo"):(l[c.a.AUDIO]&&o.push("audio"),l[c.a.VIDEO]&&o.push("video")),0===o.length&&s.b.warn("Fragments must have at least one ElementaryStreamType set. type: "+a.type+" level: "+a.level+" sn: "+a.sn),this.blockBuffers((function(){var t=self.performance.now();a.stats.buffering.end=t,n&&(n.stats.buffering.end=t);var e=n?n.stats:a.stats;r.hls.trigger(i.a.FRAG_BUFFERED,{frag:a,part:n,stats:e,id:a.type})}),o)},e.onFragChanged=function(t,e){this.flushBackBuffer()},e.onBufferEos=function(t,e){var r=this;this.getSourceBufferTypes().reduce((function(t,a){var n=r.sourceBuffer[a];return e.type&&e.type!==a||n&&!n.ended&&(n.ended=!0,s.b.log("[buffer-controller]: "+a+" sourceBuffer now EOS")),t&&!(n&&!n.ended)}),!0)&&this.blockBuffers((function(){var t=r.mediaSource;t&&"open"===t.readyState&&t.endOfStream()}))},e.onLevelUpdated=function(t,e){var r=e.details;r.fragments.length&&(this.details=r,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},e.flushBackBuffer=function(){var t=this.hls,e=this.details,r=this.media,a=this.sourceBuffer;if(r&&null!==e){var o=this.getSourceBufferTypes();if(o.length){var s=e.live&&null!==t.config.liveBackBufferLength?t.config.liveBackBufferLength:t.config.backBufferLength;if(Object(n.a)(s)&&!(s<0)){var l=r.currentTime,c=e.levelTargetDuration,u=Math.max(s,c),d=Math.floor(l/c)*c-u;o.forEach((function(r){var n=a[r];if(n){var o=lt.getBuffered(n);o.length>0&&d>o.start(0)&&(t.trigger(i.a.BACK_BUFFER_REACHED,{bufferEnd:d}),e.live&&t.trigger(i.a.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d}),t.trigger(i.a.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:r}))}}))}}}},e.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var t=this.details,e=this.hls,r=this.media,a=this.mediaSource,i=t.fragments[0].start+t.totalduration,o=r.duration,l=Object(n.a)(a.duration)?a.duration:0;t.live&&e.config.liveDurationInfinity?(s.b.log("[buffer-controller]: Media Source duration is set to Infinity"),a.duration=1/0,this.updateSeekableRange(t)):(i>l&&i>o||!Object(n.a)(o))&&(s.b.log("[buffer-controller]: Updating Media Source duration to "+i.toFixed(3)),a.duration=i)}},e.updateSeekableRange=function(t){var e=this.mediaSource,r=t.fragments;if(r.length&&t.live&&null!=e&&e.setLiveSeekableRange){var a=Math.max(0,r[0].start),n=Math.max(a,a+t.totalduration);e.setLiveSeekableRange(a,n)}},e.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,e=this.operationQueue,r=this.pendingTracks,a=Object.keys(r).length;if(a&&!t||2===a){this.createSourceBuffers(r),this.pendingTracks={};var n=this.getSourceBufferTypes();if(0===n.length)return void this.hls.trigger(i.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});n.forEach((function(t){e.executeNext(t)}))}},e.createSourceBuffers=function(t){var e=this.sourceBuffer,r=this.mediaSource;if(!r)throw Error("createSourceBuffers called when mediaSource was null");var a=0;for(var n in t)if(!e[n]){var l=t[n];if(!l)throw Error("source buffer exists for track "+n+", however track does not");var c=l.levelCodec||l.codec,u=l.container+";codecs="+c;s.b.log("[buffer-controller]: creating sourceBuffer("+u+")");try{var d=e[n]=r.addSourceBuffer(u),h=n;this.addBufferListener(h,"updatestart",this._onSBUpdateStart),this.addBufferListener(h,"updateend",this._onSBUpdateEnd),this.addBufferListener(h,"error",this._onSBUpdateError),this.tracks[n]={buffer:d,codec:c,container:l.container,levelCodec:l.levelCodec,id:l.id},a++}catch(t){s.b.error("[buffer-controller]: error while trying to add sourceBuffer: "+t.message),this.hls.trigger(i.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:t,mimeType:u})}}a&&this.hls.trigger(i.a.BUFFER_CREATED,{tracks:this.tracks})},e._onSBUpdateStart=function(t){this.operationQueue.current(t).onStart()},e._onSBUpdateEnd=function(t){var e=this.operationQueue;e.current(t).onComplete(),e.shiftAndExecuteNext(t)},e._onSBUpdateError=function(t,e){s.b.error("[buffer-controller]: "+t+" SourceBuffer error",e),this.hls.trigger(i.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.BUFFER_APPENDING_ERROR,fatal:!1});var r=this.operationQueue.current(t);r&&r.onError(e)},e.removeExecutor=function(t,e,r){var a=this.media,i=this.mediaSource,o=this.operationQueue,l=this.sourceBuffer[t];if(!a||!i||!l)return s.b.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),void o.shiftAndExecuteNext(t);var c=Object(n.a)(a.duration)?a.duration:1/0,u=Object(n.a)(i.duration)?i.duration:1/0,d=Math.max(0,e),h=Math.min(r,c,u);h>d?(s.b.log("[buffer-controller]: Removing ["+d+","+h+"] from the "+t+" SourceBuffer"),l.remove(d,h)):o.shiftAndExecuteNext(t)},e.appendExecutor=function(t,e){var r=this.operationQueue,a=this.sourceBuffer[e];if(!a)return s.b.warn("[buffer-controller]: Attempting to append to the "+e+" SourceBuffer, but it does not exist"),void r.shiftAndExecuteNext(e);a.ended=!1,a.appendBuffer(t)},e.blockBuffers=function(t,e){var r=this;if(void 0===e&&(e=this.getSourceBufferTypes()),!e.length)return s.b.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve(t);var a=this.operationQueue,n=e.map((function(t){return a.appendBlocker(t)}));Promise.all(n).then((function(){t(),e.forEach((function(t){var e=r.sourceBuffer[t];e&&e.updating||a.shiftAndExecuteNext(t)}))}))},e.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},e.addBufferListener=function(t,e,r){var a=this.sourceBuffer[t];if(a){var n=r.bind(this,t);this.listeners[t].push({event:e,listener:n}),a.addEventListener(e,n)}},e.removeBufferListeners=function(t){var e=this.sourceBuffer[t];e&&this.listeners[t].forEach((function(t){e.removeEventListener(t.event,t.listener)}))},t}(),Le={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},_e=function(t){var e=t;return Le.hasOwnProperty(t)&&(e=Le[t]),String.fromCharCode(e)},Ae={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Re={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Ce={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},De={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Oe=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];!function(t){t[t.ERROR=0]="ERROR",t[t.TEXT=1]="TEXT",t[t.WARNING=2]="WARNING",t[t.INFO=2]="INFO",t[t.DEBUG=3]="DEBUG",t[t.DATA=3]="DATA"}(we||(we={}));var Ie=function(){function t(){this.time=null,this.verboseLevel=we.ERROR}return t.prototype.log=function(t,e){this.verboseLevel>=t&&s.b.log(this.time+" ["+t+"] "+e)},t}(),Pe=function(t){for(var e=[],r=0;r100&&(this.logger.log(we.DEBUG,"Too large cursor position "+this.pos),this.pos=100)},e.moveCursor=function(t){var e=this.pos+t;if(t>1)for(var r=this.pos+1;r=144&&this.backSpace();var e=_e(t);this.pos>=100?this.logger.log(we.ERROR,"Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1))},e.clearFromPos=function(t){var e;for(e=t;e<100;e++)this.chars[e].reset()},e.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},e.clearToEndOfRow=function(){this.clearFromPos(this.pos)},e.getTextString=function(){for(var t=[],e=!0,r=0;r<100;r++){var a=this.chars[r].uchar;" "!==a&&(e=!1),t.push(a)}return e?"":t.join("")},e.setPenStyles=function(t){this.currPenState.setStyles(t),this.chars[this.pos].setPenState(this.currPenState)},t}(),Ne=function(){function t(t){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var e=0;e<15;e++)this.rows.push(new Be(t));this.logger=t,this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var e=t.prototype;return e.reset=function(){for(var t=0;t<15;t++)this.rows[t].clear();this.currRow=14},e.equals=function(t){for(var e=!0,r=0;r<15;r++)if(!this.rows[r].equals(t.rows[r])){e=!1;break}return e},e.copy=function(t){for(var e=0;e<15;e++)this.rows[e].copy(t.rows[e])},e.isEmpty=function(){for(var t=!0,e=0;e<15;e++)if(!this.rows[e].isEmpty()){t=!1;break}return t},e.backSpace=function(){this.rows[this.currRow].backSpace()},e.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},e.insertChar=function(t){this.rows[this.currRow].insertChar(t)},e.setPen=function(t){this.rows[this.currRow].setPenStyles(t)},e.moveCursor=function(t){this.rows[this.currRow].moveCursor(t)},e.setCursor=function(t){this.logger.log(we.INFO,"setCursor: "+t),this.rows[this.currRow].setCursor(t)},e.setPAC=function(t){this.logger.log(we.INFO,"pacData = "+JSON.stringify(t));var e=t.row-1;if(this.nrRollUpRows&&e0&&(r=t?"["+e.join(" | ")+"]":e.join("\n")),r},e.getTextAndFormat=function(){return this.rows},t}(),Ue=function(){function t(t,e,r){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new Ne(r),this.nonDisplayedMemory=new Ne(r),this.lastOutputScreen=new Ne(r),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}var e=t.prototype;return e.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},e.getHandler=function(){return this.outputFilter},e.setHandler=function(t){this.outputFilter=t},e.setPAC=function(t){this.writeScreen.setPAC(t)},e.setBkgData=function(t){this.writeScreen.setBkgData(t)},e.setMode=function(t){t!==this.mode&&(this.mode=t,this.logger.log(we.INFO,"MODE="+t),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)},e.insertChars=function(t){for(var e=0;e=46,e.italics)e.foreground="white";else{var r=Math.floor(t/2)-16;e.foreground=["white","green","blue","cyan","red","yellow","magenta"][r]}this.logger.log(we.INFO,"MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)},e.outputDataUpdate=function(t){void 0===t&&(t=!1);var e=this.logger.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},e.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},t}();function je(t,e,r){r.a=t,r.b=e}function Ge(t,e,r){return r.a===t&&r.b===e}var He=function(){function t(t,e,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var a=new Ie;this.channels=[null,new Ue(t,e,a),new Ue(t+1,r,a)],this.cmdHistory={a:null,b:null},this.logger=a}var e=t.prototype;return e.getHandler=function(t){return this.channels[t].getHandler()},e.setHandler=function(t,e){this.channels[t].setHandler(e)},e.addData=function(t,e){var r,a,n,i=!1;this.logger.time=t;for(var o=0;o ("+Pe([a,n])+")"),(r=this.parseCmd(a,n))||(r=this.parseMidrow(a,n)),r||(r=this.parsePAC(a,n)),r||(r=this.parseBackgroundAttributes(a,n)),!r&&(i=this.parseChars(a,n))){var s=this.currentChannel;s&&s>0?this.channels[s].insertChars(i):this.logger.log(we.WARNING,"No channel found yet. TEXT-MODE?")}r||i||this.logger.log(we.WARNING,"Couldn't parse cleaned data "+Pe([a,n])+" orig: "+Pe([e[o],e[o+1]]))}},e.parseCmd=function(t,e){var r=this.cmdHistory;if(!((20===t||28===t||21===t||29===t)&&e>=32&&e<=47||(23===t||31===t)&&e>=33&&e<=35))return!1;if(Ge(t,e,r))return je(null,null,r),this.logger.log(we.DEBUG,"Repeated command ("+Pe([t,e])+") is dropped"),!0;var a=20===t||21===t||23===t?1:2,n=this.channels[a];return 20===t||21===t||28===t||29===t?32===e?n.ccRCL():33===e?n.ccBS():34===e?n.ccAOF():35===e?n.ccAON():36===e?n.ccDER():37===e?n.ccRU(2):38===e?n.ccRU(3):39===e?n.ccRU(4):40===e?n.ccFON():41===e?n.ccRDC():42===e?n.ccTR():43===e?n.ccRTD():44===e?n.ccEDM():45===e?n.ccCR():46===e?n.ccENM():47===e&&n.ccEOC():n.ccTO(e-32),je(t,e,r),this.currentChannel=a,!0},e.parseMidrow=function(t,e){var r=0;if((17===t||25===t)&&e>=32&&e<=47){if((r=17===t?1:2)!==this.currentChannel)return this.logger.log(we.ERROR,"Mismatch channel in midrow parsing"),!1;var a=this.channels[r];return!!a&&(a.ccMIDROW(e),this.logger.log(we.DEBUG,"MIDROW ("+Pe([t,e])+")"),!0)}return!1},e.parsePAC=function(t,e){var r,a=this.cmdHistory;if(!((t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127||(16===t||24===t)&&e>=64&&e<=95))return!1;if(Ge(t,e,a))return je(null,null,a),!0;var n=t<=23?1:2;r=e>=64&&e<=95?1===n?Ae[t]:Ce[t]:1===n?Re[t]:De[t];var i=this.channels[n];return!!i&&(i.setPAC(this.interpretPAC(r,e)),je(t,e,a),this.currentChannel=n,!0)},e.interpretPAC=function(t,e){var r,a={color:null,italics:!1,indent:null,underline:!1,row:t};return r=e>95?e-96:e-64,a.underline=1==(1&r),r<=13?a.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(a.italics=!0,a.color="white"):a.indent=4*Math.floor((r-16)/2),a},e.parseChars=function(t,e){var r,a,n=null,i=null;if(t>=25?(r=2,i=t-8):(r=1,i=t),i>=17&&i<=19?(a=17===i?e+80:18===i?e+112:e+144,this.logger.log(we.INFO,"Special char '"+_e(a)+"' in channel "+r),n=[a]):t>=32&&t<=127&&(n=0===e?[t]:[t,e]),n){var o=Pe(n);this.logger.log(we.DEBUG,"Char codes = "+o.join(",")),je(t,e,this.cmdHistory)}return n},e.parseBackgroundAttributes=function(t,e){var r;if(!((16===t||24===t)&&e>=32&&e<=47||(23===t||31===t)&&e>=45&&e<=47))return!1;var a={};16===t||24===t?(r=Math.floor((e-32)/2),a.background=Oe[r],e%2==1&&(a.background=a.background+"_semi")):45===e?a.background="transparent":(a.foreground="black",47===e&&(a.underline=!0));var n=t<=23?1:2;return this.channels[n].setBkgData(a),je(t,e,this.cmdHistory),!0},e.reset=function(){for(var t=0;tt)&&(this.startTime=t),this.endTime=e,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)},e.reset=function(){this.cueRanges=[],this.startTime=null},t}(),Ye=function(){if("undefined"!=typeof self&&self.VTTCue)return self.VTTCue;var t=["","lr","rl"],e=["start","middle","end","left","right"];function r(t,e){if("string"!=typeof e)return!1;if(!Array.isArray(t))return!1;var r=e.toLowerCase();return!!~t.indexOf(r)&&r}function a(t){return r(e,t)}function n(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),a=1;a100)throw new Error("Position must be between 0 and 100.");b=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",n({},l,{get:function(){return w},set:function(t){var e=a(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");w=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",n({},l,{get:function(){return k},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");k=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",n({},l,{get:function(){return S},set:function(t){var e=a(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");S=e,this.hasBeenReset=!0}})),s.displayState=void 0}return i.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},i}(),ze=function(){function t(){}return t.prototype.decode=function(t,e){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))},t}();function qe(t){function e(t,e,r,a){return 3600*(0|t)+60*(0|e)+(0|r)+parseFloat(a||0)}var r=t.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?e(r[2],r[3],0,r[4]):e(r[1],r[2],r[3],r[4]):null}var We=function(){function t(){this.values=Object.create(null)}var e=t.prototype;return e.set=function(t,e){this.get(t)||""===e||(this.values[t]=e)},e.get=function(t,e,r){return r?this.has(t)?this.values[t]:e[r]:this.has(t)?this.values[t]:e},e.has=function(t){return t in this.values},e.alt=function(t,e,r){for(var a=0;a=0&&r<=100)return this.set(t,r),!0}return!1},t}();function Ke(t,e,r,a){var n=a?t.split(a):[t];for(var i in n)if("string"==typeof n[i]){var o=n[i].split(r);2===o.length&&e(o[0],o[1])}}var Xe=new Ye(0,0,""),Ze="middle"===Xe.align?"middle":"center";function Je(t,e,r){var a=t;function n(){var e=qe(t);if(null===e)throw new Error("Malformed timestamp: "+a);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function i(){t=t.replace(/^\s+/,"")}if(i(),e.startTime=n(),i(),"--\x3e"!==t.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+a);t=t.substr(3),i(),e.endTime=n(),i(),function(t,e){var a=new We;Ke(t,(function(t,e){var n;switch(t){case"region":for(var i=r.length-1;i>=0;i--)if(r[i].id===e){a.set(t,r[i].region);break}break;case"vertical":a.alt(t,e,["rl","lr"]);break;case"line":n=e.split(","),a.integer(t,n[0]),a.percent(t,n[0])&&a.set("snapToLines",!1),a.alt(t,n[0],["auto"]),2===n.length&&a.alt("lineAlign",n[1],["start",Ze,"end"]);break;case"position":n=e.split(","),a.percent(t,n[0]),2===n.length&&a.alt("positionAlign",n[1],["start",Ze,"end","line-left","line-right","auto"]);break;case"size":a.percent(t,e);break;case"align":a.alt(t,e,["start",Ze,"end","left","right"])}}),/:/,/\s/),e.region=a.get("region",null),e.vertical=a.get("vertical","");var n=a.get("line","auto");"auto"===n&&-1===Xe.line&&(n=-1),e.line=n,e.lineAlign=a.get("lineAlign","start"),e.snapToLines=a.get("snapToLines",!0),e.size=a.get("size",100),e.align=a.get("align",Ze);var i=a.get("position","auto");"auto"===i&&50===Xe.position&&(i="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=i}(t,e)}function Qe(t){return t.replace(//gi,"\n")}var $e=function(){function t(){this.state="INITIAL",this.buffer="",this.decoder=new ze,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var e=t.prototype;return e.parse=function(t){var e=this;function r(){var t=e.buffer,r=0;for(t=Qe(t);r>>0).toString()};function ir(t,e,r){return nr(t.toString())+nr(e.toString())+nr(r)}function or(t,e,r,a,i,o,s,l){var c,u=new $e,d=Object(M.f)(new Uint8Array(t)).trim().replace(rr,"\n").split("\n"),h=[],p=Object(tr.a)(e,r),f="00:00.000",m=0,y=0,v=!0,g=!1;u.oncue=function(t){var e=a[i],r=a.ccOffset,n=(m-p)/9e4;if(null!=e&&e.new&&(void 0!==y?r=a.ccOffset=e.start:function(t,e,r){var a=t[e],n=t[a.prevCC];if(!n||!n.new&&a.new)return t.ccOffset=t.presentationOffset=a.start,void(a.new=!1);for(;null!==(i=n)&&void 0!==i&&i.new;){var i;t.ccOffset+=a.start-n.start,a.new=!1,n=t[(a=n).prevCC]}t.presentationOffset=r}(a,i,n)),n&&(r=n-a.presentationOffset),g){var s=t.endTime-t.startTime,l=Object(er.b)(9e4*(t.startTime+r-y),9e4*o)/9e4;t.startTime=l,t.endTime=l+s}var c=t.text.trim();t.text=decodeURIComponent(encodeURIComponent(c)),t.id||(t.id=ir(t.startTime,t.endTime,c)),t.endTime>0&&h.push(t)},u.onparsingerror=function(t){c=t},u.onflush=function(){c?l(c):s(h)},d.forEach((function(t){if(v){if(ar(t,"X-TIMESTAMP-MAP=")){v=!1,g=!0,t.substr(16).split(",").forEach((function(t){ar(t,"LOCAL:")?f=t.substr(6):ar(t,"MPEGTS:")&&(m=parseInt(t.substr(7)))}));try{y=function(t){var e=parseInt(t.substr(-3)),r=parseInt(t.substr(-6,2)),a=parseInt(t.substr(-9,2)),i=t.length>9?parseInt(t.substr(0,t.indexOf(":"))):0;if(!(Object(n.a)(e)&&Object(n.a)(r)&&Object(n.a)(a)&&Object(n.a)(i)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+t);return e+=1e3*r,(e+=6e4*a)+36e5*i}(f)/1e3}catch(t){g=!1,c=t}return}""===t&&(v=!1)}u.parse(t+"\n")})),u.flush()}function sr(){return(sr=Object.assign||function(t){for(var e=1;e=0&&(h[0]=Math.min(h[0],e),h[1]=Math.max(h[1],r),u=!0,p/(r-e)>.5))return}if(u||n.push([e,r]),this.config.renderTextTracksNatively){var f=this.captionsTracks[t];this.Cues.newCue(f,e,r,a)}else{var m=this.Cues.newCue(null,e,r,a);this.hls.trigger(i.a.CUES_PARSED,{type:"captions",cues:m,track:t})}},e.onInitPtsFound=function(t,e){var r=this,a=e.frag,n=e.id,o=e.initPTS,s=e.timescale,l=this.unparsedVttFrags;"main"===n&&(this.initPTS[a.cc]=o,this.timescale[a.cc]=s),l.length&&(this.unparsedVttFrags=[],l.forEach((function(t){r.onFragLoaded(i.a.FRAG_LOADED,t)})))},e.getExistingTrack=function(t){var e=this.media;if(e)for(var r=0;r0&&this.mediaWidth>0){var t=this.hls.levels;if(t.length){var e=this.hls;e.autoLevelCapping=this.getMaxLevel(t.length-1),e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}},n.getMaxLevel=function(e){var r=this,a=this.hls.levels;if(!a.length)return-1;var n=a.filter((function(a,n){return t.isLevelAllowed(n,r.restrictedLevels)&&n<=e}));return this.clientRect=null,t.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)},n.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},n.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},n.getDimensions=function(){if(this.clientRect)return this.clientRect;var t=this.media,e={width:0,height:0};if(t){var r=t.getBoundingClientRect();e.width=r.width,e.height=r.height,e.width||e.height||(e.width=r.right-r.left||t.width||0,e.height=r.bottom-r.top||t.height||0)}return this.clientRect=e,e},t.isLevelAllowed=function(t,e){return void 0===e&&(e=[]),-1===e.indexOf(t)},t.getMaxLevelByMediaSize=function(t,e,r){if(!t||!t.length)return-1;for(var a,n,i=t.length-1,o=0;o=e||s.height>=r)&&(a=s,!(n=t[o+1])||a.width!==n.width||a.height!==n.height)){i=o;break}}return i},e=t,a=[{key:"contentScaleFactor",get:function(){var t=1;try{t=self.devicePixelRatio}catch(t){}return t}}],(r=[{key:"mediaWidth",get:function(){return this.getDimensions().width*t.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*t.contentScaleFactor}}])&&br(e.prototype,r),a&&br(e,a),t}(),Sr=function(){function t(t){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=t,this.registerListeners()}var e=t.prototype;return e.setStreamController=function(t){this.streamController=t},e.registerListeners=function(){this.hls.on(i.a.MEDIA_ATTACHING,this.onMediaAttaching,this)},e.unregisterListeners=function(){this.hls.off(i.a.MEDIA_ATTACHING,this.onMediaAttaching)},e.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},e.onMediaAttaching=function(t,e){var r=this.hls.config;if(r.capLevelOnFPSDrop){var a=e.media instanceof self.HTMLVideoElement?e.media:null;this.media=a,a&&"function"==typeof a.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}},e.checkFPS=function(t,e,r){var a=performance.now();if(e){if(this.lastTime){var n=a-this.lastTime,o=r-this.lastDroppedFrames,l=e-this.lastDecodedFrames,c=1e3*o/n,u=this.hls;if(u.trigger(i.a.FPS_DROP,{currentDropped:o,currentDecoded:l,totalDroppedFrames:r}),c>0&&o>u.config.fpsDroppedMonitoringThreshold*l){var d=u.currentLevel;s.b.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(-1===u.autoLevelCapping||u.autoLevelCapping>=d)&&(d-=1,u.trigger(i.a.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:u.currentLevel}),u.autoLevelCapping=d,this.streamController.nextLevelSwitch())}}this.lastTime=a,this.lastDroppedFrames=r,this.lastDecodedFrames=e}},e.checkFPSInterval=function(){var t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},t}();!function(t){t.WIDEVINE="com.widevine.alpha",t.PLAYREADY="com.microsoft.playready"}(wr||(wr={}));var Tr="undefined"!=typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;function xr(t,e){for(var r=0;r3)return void this.hls.trigger(i.a.ERROR,{type:o.b.KEY_SYSTEM_ERROR,details:o.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});var c=3-this._requestLicenseFailureCount+1;s.b.warn("Retrying license request, "+c+" attempts left"),this._requestLicense(r,a)}}},a._generateLicenseRequestChallenge=function(t,e){switch(t.mediaKeySystemDomain){case wr.WIDEVINE:return e}throw new Error("unsupported key-system: "+t.mediaKeySystemDomain)},a._requestLicense=function(t,e){s.b.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r)return s.b.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.hls.trigger(i.a.ERROR,{type:o.b.KEY_SYSTEM_ERROR,details:o.a.KEY_SYSTEM_NO_ACCESS,fatal:!0});try{var a=this.getLicenseServerUrl(r.mediaKeySystemDomain),n=this._createLicenseXhr(a,t,e);s.b.log("Sending license request to URL: "+a);var l=this._generateLicenseRequestChallenge(r,t);n.send(l)}catch(t){s.b.error("Failure requesting DRM license: "+t),this.hls.trigger(i.a.ERROR,{type:o.b.KEY_SYSTEM_ERROR,details:o.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},a.onMediaAttached=function(t,e){if(this._emeEnabled){var r=e.media;this._media=r,r.addEventListener("encrypted",this._onMediaEncrypted)}},a.onMediaDetached=function(){var t=this._media,e=this._mediaKeysList;t&&(t.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(e.map((function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch((function(){}))}))).then((function(){return t.setMediaKeys(null)})).catch((function(){})))},a.onManifestParsed=function(t,e){if(this._emeEnabled){var r=e.levels.map((function(t){return t.audioCodec})).filter((function(t){return!!t})),a=e.levels.map((function(t){return t.videoCodec})).filter((function(t){return!!t}));this._attemptKeySystemAccess(wr.WIDEVINE,r,a)}},e=t,(r=[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}])&&xr(e.prototype,r),t}();function Rr(t,e){for(var r=0;r=t.length?{done:!0}:{done:!1,value:t[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Or(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,a=new Array(e);r-1?n+1:a.levels.length;e=a.levels.slice(0,i)}for(var o,s=Dr(e);!(o=s()).done;){var l=o.value;l.bitrate>r&&(r=l.bitrate)}return r>0?r:NaN},e.getBufferLength=function(t){var e=this.hls.media,r=t===Er.AUDIO?this.audioBuffer:this.videoBuffer;return r&&e?1e3*lt.bufferInfo(r,e.currentTime,this.config.maxBufferHole).len:NaN},e.createPlaylistLoader=function(){var t=this.config.pLoader,e=this.applyPlaylistData,r=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new r(t)}var a=t.prototype;return a.destroy=function(){this.loader.destroy()},a.abort=function(){this.loader.abort()},a.load=function(t,r,a){e(t),this.loader.load(t,r,a)},Cr(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},e.createFragmentLoader=function(){var t=this.config.fLoader,e=this.applyFragmentData,r=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new r(t)}var a=t.prototype;return a.destroy=function(){this.loader.destroy()},a.abort=function(){this.loader.abort()},a.load=function(t,r,a){e(t),this.loader.load(t,r,a)},Cr(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},t.uuid=function(){var t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.substr(e.lastIndexOf("/")+1)},t.serialize=function(t){for(var e,r=[],a=function(t){return!Number.isNaN(t)&&null!=t&&""!==t&&!1!==t},n=function(t){return Math.round(t)},i=function(t){return 100*n(t/100)},o={br:n,d:n,bl:i,dl:i,mtp:i,nor:function(t){return encodeURIComponent(t)},rtp:i,tb:n},s=Dr(Object.keys(t||{}).sort());!(e=s()).done;){var l=e.value,c=t[l];if(a(c)&&!("v"===l&&1===c||"pr"==l&&1===c)){var u=o[l];u&&(c=u(c));var d,h=typeof c;d="ot"===l||"sf"===l||"st"===l?l+"="+c:"boolean"===h?l:"number"===h?l+"="+c:l+"="+JSON.stringify(c),r.push(d)}}return r.join(",")},t.toHeaders=function(e){for(var r={},a=["Object","Request","Session","Status"],n=[{},{},{},{}],i={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},o=0,s=Object.keys(e);o=2)if(self.clearTimeout(this.requestTimeout),0===r.loading.first&&(r.loading.first=Math.max(self.performance.now(),r.loading.start)),4===a){e.onreadystatechange=null,e.onprogress=null;var i=e.status;if(i>=200&&i<300){var o,l;if(r.loading.end=Math.max(self.performance.now(),r.loading.first),l="arraybuffer"===t.responseType?(o=e.response).byteLength:(o=e.responseText).length,r.loaded=r.total=l,!this.callbacks)return;var c=this.callbacks.onProgress;if(c&&c(r,t,o,e),!this.callbacks)return;var u={url:e.responseURL,data:o};this.callbacks.onSuccess(u,r,t,e)}else r.retry>=n.maxRetry||i>=400&&i<499?(s.b.error(i+" while loading "+t.url),this.callbacks.onError({code:i,text:e.statusText},t,e)):(s.b.warn(i+" while loading "+t.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,n.maxRetryDelay),r.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout)}},e.loadtimeout=function(){s.b.warn("timeout while loading "+this.context.url);var t=this.callbacks;t&&(this.abortInternal(),t.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(t){var e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)},e.getCacheAge=function(){var t=null;if(this.loader&&Fr.test(this.loader.getAllResponseHeaders())){var e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t},t}();function Nr(t){var e="function"==typeof Map?new Map:void 0;return(Nr=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,a)}function a(){return Ur(t,arguments,Hr(this).constructor)}return a.prototype=Object.create(t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),Gr(a,t)})(t)}function Ur(t,e,r){return(Ur=jr()?Reflect.construct:function(t,e,r){var a=[null];a.push.apply(a,e);var n=new(Function.bind.apply(t,a));return r&&Gr(n,r.prototype),n}).apply(null,arguments)}function jr(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Gr(t,e){return(Gr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Hr(t){return(Hr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Vr(){return(Vr=Object.assign||function(t){for(var e=1;e=a&&n(e,r,i.flush(),t)):n(e,r,l,t),s()})).catch((function(){return Promise.reject()}))}()},t}();function zr(t,e){return new self.Request(t.url,e)}var qr=function(t){var e,r;function a(e,r,a){var n;return(n=t.call(this,e)||this).code=void 0,n.details=void 0,n.code=r,n.details=a,n}return r=t,(e=a).prototype=Object.create(r.prototype),e.prototype.constructor=e,Gr(e,r),a}(Nr(Error)),Wr=Yr,Kr=/\s/;function Xr(){return(Xr=Object.assign||function(t){for(var e=1;e=16?s--:s++;var p=Qe(l.trim()),f=ir(e,r,p);t&&t.cues&&t.cues.getCueById(f)||((i=new u(e,r,p)).id=f,i.line=d+1,i.align="left",i.position=10+Math.min(80,10*Math.floor(8*s/32)),c.push(i))}return t&&c.length&&(c.sort((function(t,e){return"auto"===t.line||"auto"===e.line?0:t.line>8&&e.line>8?e.line-t.line:t.line-e.line})),c.forEach((function(e){return O(t,e)}))),c}},enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:ye,subtitleTrackController:ke,timelineController:vr,audioStreamController:ue,audioTrackController:pe,emeController:Ar,cmcdController:Pr});function ta(t,e){for(var r=0;re)return a;return 0}},{key:"maxAutoLevel",get:function(){var t=this.levels,e=this.autoLevelCapping;return-1===e&&t&&t.length?t.length-1:e}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var e=this.audioTrackController;e&&(e.audioTrack=t)}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return!!t&&t.subtitleDisplay},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(t){this.config.lowLatencyMode=t}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}])&&ta(e.prototype,r),n&&ta(e,n),t}();ea.defaultConfig=void 0}]).default})),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("smartplayer",[],e):"object"==typeof exports?exports.smartplayer=e():t.smartplayer=e()}(window,(function(){return function(t){var e={};function r(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,a){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(a,n,function(e){return t[e]}.bind(null,n));return a},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s=71)}([function(t,e,r){"use strict";function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n=r(10),i=Object.prototype.toString;function o(t){return"[object Array]"===i.call(t)}function s(t){return void 0===t}function l(t){return null!==t&&"object"===a(t)}function c(t){if("[object Object]"!==i.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function u(t){return"[object Function]"===i.call(t)}function d(t,e){if(null!=t)if("object"!==a(t)&&(t=[t]),o(t))for(var r=0,n=t.length;r\n
\n
',e+=n(i||"BLOQUEADO"),e+="
\n ",o&&s&&(e+='\n ',e+=n(s),e+="\n "),e+="\n
\n\n"}},function(t,e,r){"use strict";t.exports=r(52)},function(t,e,r){"use strict";var a=r(19),n=r.n(a)()((function(t){return t[1]}));n.push([t.i,'#smartplayer#smartplayer,#smartplayer#smartplayer:after,#smartplayer#smartplayer :after,#smartplayer#smartplayer:before,#smartplayer#smartplayer :before,#smartplayer#smartplayer :not(a):not(animate):not(animateMotion):not(animateTransform):not(canvas):not(circle):not(clipPath):not(defs):not(desc):not(discard):not(ellipse):not(feBlend):not(feColorMatrix):not(feComponentTransfer):not(feComposite):not(feConvolveMatrix):not(feDiffuseLighting):not(feDisplacementMap):not(feDistantLight):not(feDropShadow):not(feFlood):not(feFuncA):not(feFuncB):not(feFuncG):not(feFuncR):not(feGaussianBlur):not(feImage):not(feMerge):not(feMergeNode):not(feMorphology):not(feOffset):not(fePointLight):not(feSpecularLighting):not(feSpotLight):not(feTile):not(feTurbulence):not(filter):not(foreignObject):not(g):not(image):not(line):not(linearGradient):not(marker):not(mask):not(metadata):not(mpath):not(path):not(pattern):not(polygon):not(polyline):not(radialGradient):not(rect):not(script):not(set):not(stop):not(style):not(switch):not(symbol):not(text):not(textPath):not(title):not(tspan):not(use):not(view){-ms-flex-line-pack:stretch;align-content:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;align-self:auto;-webkit-animation-delay:0s;animation-delay:0s;-webkit-animation-direction:normal;animation-direction:normal;-webkit-animation-duration:0s;animation-duration:0s;-webkit-animation-fill-mode:none;animation-fill-mode:none;-webkit-animation-iteration-count:1;animation-iteration-count:1;-webkit-animation-name:none;animation-name:none;-webkit-animation-play-state:running;animation-play-state:running;-webkit-animation-timing-function:ease;animation-timing-function:ease;azimuth:center;-webkit-backface-visibility:visible;backface-visibility:visible;background-attachment:scroll;background-blend-mode:normal;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-repeat:repeat;background-size:auto auto;block-size:auto;border-block-end-color:currentcolor;border-block-end-style:none;border-block-end-width:medium;border-block-start-color:currentcolor;border-block-start-style:none;border-block-start-width:medium;border-bottom-left-radius:0;border-bottom-right-radius:0;border-collapse:separate;border-image-outset:0s;border-image-repeat:stretch;border-image-slice:100%;border-image-source:none;border-image-width:1;border-inline-end-color:currentcolor;border-inline-end-style:none;border-inline-end-width:medium;border-inline-start-color:currentcolor;border-inline-start-style:none;border-inline-start-width:medium;border-spacing:0;border-top-left-radius:0;border-top-right-radius:0;border:none;bottom:auto;-webkit-box-decoration-break:slice;box-decoration-break:slice;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-column-break-after:auto;-moz-column-break-after:auto;break-after:auto;-webkit-column-break-before:auto;-moz-column-break-before:auto;break-before:auto;-webkit-column-break-inside:auto;-moz-column-break-inside:auto;break-inside:auto;caption-side:top;caret-color:auto;clear:none;clip:auto;-webkit-clip-path:none;clip-path:none;color:initial;-webkit-column-count:auto;-moz-column-count:auto;-webkit-column-fill:balance;-moz-column-fill:balance;column-fill:balance;-webkit-column-gap:normal;-moz-column-gap:normal;column-gap:normal;-webkit-column-rule-color:currentcolor;-moz-column-rule-color:currentcolor;column-rule-color:currentcolor;-webkit-column-rule-style:none;-moz-column-rule-style:none;column-rule-style:none;-webkit-column-rule-width:medium;-moz-column-rule-width:medium;column-rule-width:medium;-webkit-column-span:none;-moz-column-span:none;column-span:none;-webkit-column-width:auto;-moz-column-width:auto;columns:auto;content:normal;counter-increment:none;counter-reset:none;cursor:auto;display:inline;empty-cells:show;-webkit-filter:none;filter:none;-ms-flex-preferred-size:auto;flex-basis:auto;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:1;flex-shrink:1;-ms-flex-wrap:nowrap;flex-wrap:nowrap;float:none;font-family:initial;-webkit-font-feature-settings:normal;font-feature-settings:normal;-webkit-font-kerning:auto;font-kerning:auto;-webkit-font-language-override:normal;font-language-override:normal;font-size:medium;font-size-adjust:none;font-stretch:normal;font-style:normal;font-synthesis:weight style;font-variant:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-east-asian:normal;-webkit-font-variant-ligatures:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-position:normal;font-weight:400;grid-auto-columns:auto;grid-auto-flow:row;grid-auto-rows:auto;grid-column-end:auto;grid-column-gap:0;grid-column-start:auto;grid-row-end:auto;grid-row-gap:0;grid-row-start:auto;grid-template-areas:none;grid-template-columns:none;grid-template-rows:none;height:auto;-webkit-hyphens:manual;-ms-hyphens:manual;hyphens:manual;image-orientation:0deg;image-rendering:auto;image-resolution:1dppx;ime-mode:auto;inline-size:auto;isolation:auto;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;left:auto;letter-spacing:normal;line-break:auto;line-height:normal;list-style-image:none;list-style-position:outside;list-style-type:disc;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-end:0;margin-inline-end:0;-webkit-margin-start:0;margin-inline-start:0;margin:0;-webkit-mask-clip:border-box;mask-clip:border-box;-webkit-mask-composite:source-over;mask-composite:add;-webkit-mask-image:none;mask-image:none;mask-mode:match-source;-webkit-mask-origin:border-box;mask-origin:border-box;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:repeat;mask-repeat:repeat;-webkit-mask-size:auto;mask-size:auto;mask-type:luminance;max-height:none;max-width:none;min-block-size:0;min-height:0;min-inline-size:0;min-width:0;mix-blend-mode:normal;-o-object-fit:fill;object-fit:fill;-o-object-position:50% 50%;object-position:50% 50%;offset-block-end:auto;offset-block-start:auto;offset-inline-end:auto;offset-inline-start:auto;opacity:1;-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0;orphans:2;outline-color:initial;outline-offset:0;outline-style:none;outline-width:medium;overflow:visible;overflow-wrap:normal;overflow-x:visible;overflow-y:visible;-webkit-padding-after:0;padding-block-end:0;-webkit-padding-before:0;padding-block-start:0;-webkit-padding-end:0;padding-inline-end:0;-webkit-padding-start:0;padding-inline-start:0;padding:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;-webkit-perspective:none;perspective:none;-webkit-perspective-origin:50% 50%;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:initial;resize:none;right:auto;ruby-align:space-around;ruby-merge:separate;ruby-position:over;scroll-behavior:auto;-ms-scroll-snap-coordinate:none;scroll-snap-coordinate:none;-ms-scroll-snap-destination:0 0;scroll-snap-destination:0 0;-ms-scroll-snap-points-x:none;scroll-snap-points-x:none;-ms-scroll-snap-points-y:none;scroll-snap-points-y:none;-ms-scroll-snap-type:none;scroll-snap-type:none;shape-image-threshold:0;shape-margin:0;shape-outside:none;-moz-tab-size:8;-o-tab-size:8;tab-size:8;table-layout:auto;text-align:initial;-moz-text-align-last:auto;text-align-last:auto;text-combine-upright:none;-webkit-text-decoration-color:currentcolor;text-decoration-color:currentcolor;-webkit-text-decoration-line:none;text-decoration-line:none;-webkit-text-decoration-style:solid;text-decoration-style:solid;-webkit-text-emphasis-color:currentcolor;text-emphasis-color:currentcolor;-webkit-text-emphasis-position:over;text-emphasis-position:over right;-webkit-text-emphasis-style:none;text-emphasis-style:none;text-indent:0;text-justify:auto;text-orientation:mixed;text-overflow:clip;text-rendering:auto;text-shadow:none;text-transform:none;text-underline-position:auto;top:auto;-ms-touch-action:auto;touch-action:auto;-webkit-transform:none;-ms-transform:none;transform:none;transform-box:border-box;-webkit-transform-origin:50% 50% 0;-ms-transform-origin:50% 50% 0;transform-origin:50% 50% 0;-webkit-transform-style:flat;transform-style:flat;-webkit-transition-delay:0s;transition-delay:0s;-webkit-transition-duration:0s;transition-duration:0s;-webkit-transition-property:all;transition-property:all;-webkit-transition-timing-function:ease;transition-timing-function:ease;vertical-align:baseline;visibility:visible;white-space:normal;widows:2;width:auto;will-change:auto;word-break:normal;word-spacing:normal;word-wrap:normal;-webkit-writing-mode:horizontal-tb;-ms-writing-mode:lr-tb;writing-mode:horizontal-tb;z-index:auto;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none}#smartplayer#smartplayer,#smartplayer#smartplayer:after,#smartplayer#smartplayer :after,#smartplayer#smartplayer:before,#smartplayer#smartplayer :before,#smartplayer#smartplayer :not(a):not(animate):not(animateMotion):not(animateTransform):not(canvas):not(circle):not(clipPath):not(defs):not(desc):not(discard):not(ellipse):not(feBlend):not(feColorMatrix):not(feComponentTransfer):not(feComposite):not(feConvolveMatrix):not(feDiffuseLighting):not(feDisplacementMap):not(feDistantLight):not(feDropShadow):not(feFlood):not(feFuncA):not(feFuncB):not(feFuncG):not(feFuncR):not(feGaussianBlur):not(feImage):not(feMerge):not(feMergeNode):not(feMorphology):not(feOffset):not(fePointLight):not(feSpecularLighting):not(feSpotLight):not(feTile):not(feTurbulence):not(filter):not(foreignObject):not(g):not(image):not(line):not(linearGradient):not(marker):not(mask):not(metadata):not(mpath):not(path):not(pattern):not(polygon):not(polyline):not(radialGradient):not(rect):not(script):not(set):not(stop):not(style):not(switch):not(symbol):not(text):not(textPath):not(title):not(tspan):not(use):not(view){-webkit-box-sizing:border-box;box-sizing:border-box;font-family:Arial,Helvetica,sans-serif;text-decoration:none}#smartplayer#smartplayer#smartplayer{@import"../../node_modules/balloon-css/balloon.css"}#smartplayer#smartplayer#smartplayer,#smartplayer#smartplayer#smartplayer div{display:block}@-webkit-keyframes my-face{2%{-webkit-transform:translateY(1.5px) rotate(1.5deg);transform:translateY(1.5px) rotate(1.5deg)}4%{-webkit-transform:translateY(-1.5px) rotate(-.5deg);transform:translateY(-1.5px) rotate(-.5deg)}6%{-webkit-transform:translateY(1.5px) rotate(-1.5deg);transform:translateY(1.5px) rotate(-1.5deg)}8%{-webkit-transform:translateY(-1.5px) rotate(-1.5deg);transform:translateY(-1.5px) rotate(-1.5deg)}10%{-webkit-transform:translateY(2.5px) rotate(1.5deg);transform:translateY(2.5px) rotate(1.5deg)}12%{-webkit-transform:translateY(-.5px) rotate(1.5deg);transform:translateY(-.5px) rotate(1.5deg)}14%{-webkit-transform:translateY(-1.5px) rotate(1.5deg);transform:translateY(-1.5px) rotate(1.5deg)}16%{-webkit-transform:translateY(-.5px) rotate(-1.5deg);transform:translateY(-.5px) rotate(-1.5deg)}18%{-webkit-transform:translateY(.5px) rotate(-1.5deg);transform:translateY(.5px) rotate(-1.5deg)}20%{-webkit-transform:translateY(-1.5px) rotate(2.5deg);transform:translateY(-1.5px) rotate(2.5deg)}22%{-webkit-transform:translateY(.5px) rotate(-1.5deg);transform:translateY(.5px) rotate(-1.5deg)}24%{-webkit-transform:translateY(1.5px) rotate(1.5deg);transform:translateY(1.5px) rotate(1.5deg)}26%{-webkit-transform:translateY(.5px) rotate(.5deg);transform:translateY(.5px) rotate(.5deg)}28%{-webkit-transform:translateY(.5px) rotate(1.5deg);transform:translateY(.5px) rotate(1.5deg)}30%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}32%{-webkit-transform:translateY(1.5px) rotate(-.5deg);transform:translateY(1.5px) rotate(-.5deg)}34%{-webkit-transform:translateY(1.5px) rotate(-.5deg);transform:translateY(1.5px) rotate(-.5deg)}36%{-webkit-transform:translateY(-1.5px) rotate(2.5deg);transform:translateY(-1.5px) rotate(2.5deg)}38%{-webkit-transform:translateY(1.5px) rotate(-1.5deg);transform:translateY(1.5px) rotate(-1.5deg)}40%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}42%{-webkit-transform:translateY(2.5px) rotate(-1.5deg);transform:translateY(2.5px) rotate(-1.5deg)}44%{-webkit-transform:translateY(1.5px) rotate(.5deg);transform:translateY(1.5px) rotate(.5deg)}46%{-webkit-transform:translateY(-1.5px) rotate(2.5deg);transform:translateY(-1.5px) rotate(2.5deg)}48%{-webkit-transform:translateY(-.5px) rotate(.5deg);transform:translateY(-.5px) rotate(.5deg)}50%{-webkit-transform:translateY(.5px) rotate(.5deg);transform:translateY(.5px) rotate(.5deg)}52%{-webkit-transform:translateY(2.5px) rotate(2.5deg);transform:translateY(2.5px) rotate(2.5deg)}54%{-webkit-transform:translateY(-1.5px) rotate(1.5deg);transform:translateY(-1.5px) rotate(1.5deg)}56%{-webkit-transform:translateY(2.5px) rotate(2.5deg);transform:translateY(2.5px) rotate(2.5deg)}58%{-webkit-transform:translateY(.5px) rotate(2.5deg);transform:translateY(.5px) rotate(2.5deg)}60%{-webkit-transform:translateY(2.5px) rotate(2.5deg);transform:translateY(2.5px) rotate(2.5deg)}62%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}64%{-webkit-transform:translateY(-.5px) rotate(1.5deg);transform:translateY(-.5px) rotate(1.5deg)}66%{-webkit-transform:translateY(1.5px) rotate(-.5deg);transform:translateY(1.5px) rotate(-.5deg)}68%{-webkit-transform:translateY(-1.5px) rotate(-.5deg);transform:translateY(-1.5px) rotate(-.5deg)}70%{-webkit-transform:translateY(1.5px) rotate(.5deg);transform:translateY(1.5px) rotate(.5deg)}72%{-webkit-transform:translateY(2.5px) rotate(1.5deg);transform:translateY(2.5px) rotate(1.5deg)}74%{-webkit-transform:translateY(-.5px) rotate(.5deg);transform:translateY(-.5px) rotate(.5deg)}76%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}78%{-webkit-transform:translateY(-.5px) rotate(1.5deg);transform:translateY(-.5px) rotate(1.5deg)}80%{-webkit-transform:translateY(1.5px) rotate(1.5deg);transform:translateY(1.5px) rotate(1.5deg)}82%{-webkit-transform:translateY(-.5px) rotate(.5deg);transform:translateY(-.5px) rotate(.5deg)}84%{-webkit-transform:translateY(1.5px) rotate(2.5deg);transform:translateY(1.5px) rotate(2.5deg)}86%{-webkit-transform:translateY(-1.5px) rotate(-1.5deg);transform:translateY(-1.5px) rotate(-1.5deg)}88%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}90%{-webkit-transform:translateY(2.5px) rotate(-.5deg);transform:translateY(2.5px) rotate(-.5deg)}92%{-webkit-transform:translateY(.5px) rotate(-.5deg);transform:translateY(.5px) rotate(-.5deg)}94%{-webkit-transform:translateY(2.5px) rotate(.5deg);transform:translateY(2.5px) rotate(.5deg)}96%{-webkit-transform:translateY(-.5px) rotate(1.5deg);transform:translateY(-.5px) rotate(1.5deg)}98%{-webkit-transform:translateY(-1.5px) rotate(-.5deg);transform:translateY(-1.5px) rotate(-.5deg)}0%,to{-webkit-transform:translate(0) rotate(0deg);transform:translate(0) rotate(0deg)}}@keyframes my-face{2%{-webkit-transform:translateY(1.5px) rotate(1.5deg);transform:translateY(1.5px) rotate(1.5deg)}4%{-webkit-transform:translateY(-1.5px) rotate(-.5deg);transform:translateY(-1.5px) rotate(-.5deg)}6%{-webkit-transform:translateY(1.5px) rotate(-1.5deg);transform:translateY(1.5px) rotate(-1.5deg)}8%{-webkit-transform:translateY(-1.5px) rotate(-1.5deg);transform:translateY(-1.5px) rotate(-1.5deg)}10%{-webkit-transform:translateY(2.5px) rotate(1.5deg);transform:translateY(2.5px) rotate(1.5deg)}12%{-webkit-transform:translateY(-.5px) rotate(1.5deg);transform:translateY(-.5px) rotate(1.5deg)}14%{-webkit-transform:translateY(-1.5px) rotate(1.5deg);transform:translateY(-1.5px) rotate(1.5deg)}16%{-webkit-transform:translateY(-.5px) rotate(-1.5deg);transform:translateY(-.5px) rotate(-1.5deg)}18%{-webkit-transform:translateY(.5px) rotate(-1.5deg);transform:translateY(.5px) rotate(-1.5deg)}20%{-webkit-transform:translateY(-1.5px) rotate(2.5deg);transform:translateY(-1.5px) rotate(2.5deg)}22%{-webkit-transform:translateY(.5px) rotate(-1.5deg);transform:translateY(.5px) rotate(-1.5deg)}24%{-webkit-transform:translateY(1.5px) rotate(1.5deg);transform:translateY(1.5px) rotate(1.5deg)}26%{-webkit-transform:translateY(.5px) rotate(.5deg);transform:translateY(.5px) rotate(.5deg)}28%{-webkit-transform:translateY(.5px) rotate(1.5deg);transform:translateY(.5px) rotate(1.5deg)}30%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}32%{-webkit-transform:translateY(1.5px) rotate(-.5deg);transform:translateY(1.5px) rotate(-.5deg)}34%{-webkit-transform:translateY(1.5px) rotate(-.5deg);transform:translateY(1.5px) rotate(-.5deg)}36%{-webkit-transform:translateY(-1.5px) rotate(2.5deg);transform:translateY(-1.5px) rotate(2.5deg)}38%{-webkit-transform:translateY(1.5px) rotate(-1.5deg);transform:translateY(1.5px) rotate(-1.5deg)}40%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}42%{-webkit-transform:translateY(2.5px) rotate(-1.5deg);transform:translateY(2.5px) rotate(-1.5deg)}44%{-webkit-transform:translateY(1.5px) rotate(.5deg);transform:translateY(1.5px) rotate(.5deg)}46%{-webkit-transform:translateY(-1.5px) rotate(2.5deg);transform:translateY(-1.5px) rotate(2.5deg)}48%{-webkit-transform:translateY(-.5px) rotate(.5deg);transform:translateY(-.5px) rotate(.5deg)}50%{-webkit-transform:translateY(.5px) rotate(.5deg);transform:translateY(.5px) rotate(.5deg)}52%{-webkit-transform:translateY(2.5px) rotate(2.5deg);transform:translateY(2.5px) rotate(2.5deg)}54%{-webkit-transform:translateY(-1.5px) rotate(1.5deg);transform:translateY(-1.5px) rotate(1.5deg)}56%{-webkit-transform:translateY(2.5px) rotate(2.5deg);transform:translateY(2.5px) rotate(2.5deg)}58%{-webkit-transform:translateY(.5px) rotate(2.5deg);transform:translateY(.5px) rotate(2.5deg)}60%{-webkit-transform:translateY(2.5px) rotate(2.5deg);transform:translateY(2.5px) rotate(2.5deg)}62%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}64%{-webkit-transform:translateY(-.5px) rotate(1.5deg);transform:translateY(-.5px) rotate(1.5deg)}66%{-webkit-transform:translateY(1.5px) rotate(-.5deg);transform:translateY(1.5px) rotate(-.5deg)}68%{-webkit-transform:translateY(-1.5px) rotate(-.5deg);transform:translateY(-1.5px) rotate(-.5deg)}70%{-webkit-transform:translateY(1.5px) rotate(.5deg);transform:translateY(1.5px) rotate(.5deg)}72%{-webkit-transform:translateY(2.5px) rotate(1.5deg);transform:translateY(2.5px) rotate(1.5deg)}74%{-webkit-transform:translateY(-.5px) rotate(.5deg);transform:translateY(-.5px) rotate(.5deg)}76%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}78%{-webkit-transform:translateY(-.5px) rotate(1.5deg);transform:translateY(-.5px) rotate(1.5deg)}80%{-webkit-transform:translateY(1.5px) rotate(1.5deg);transform:translateY(1.5px) rotate(1.5deg)}82%{-webkit-transform:translateY(-.5px) rotate(.5deg);transform:translateY(-.5px) rotate(.5deg)}84%{-webkit-transform:translateY(1.5px) rotate(2.5deg);transform:translateY(1.5px) rotate(2.5deg)}86%{-webkit-transform:translateY(-1.5px) rotate(-1.5deg);transform:translateY(-1.5px) rotate(-1.5deg)}88%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}90%{-webkit-transform:translateY(2.5px) rotate(-.5deg);transform:translateY(2.5px) rotate(-.5deg)}92%{-webkit-transform:translateY(.5px) rotate(-.5deg);transform:translateY(.5px) rotate(-.5deg)}94%{-webkit-transform:translateY(2.5px) rotate(.5deg);transform:translateY(2.5px) rotate(.5deg)}96%{-webkit-transform:translateY(-.5px) rotate(1.5deg);transform:translateY(-.5px) rotate(1.5deg)}98%{-webkit-transform:translateY(-1.5px) rotate(-.5deg);transform:translateY(-1.5px) rotate(-.5deg)}0%,to{-webkit-transform:translate(0) rotate(0deg);transform:translate(0) rotate(0deg)}}#smartplayer#smartplayer#smartplayer [data-balloon]:before{display:none}#smartplayer#smartplayer#smartplayer [data-balloon]:after{padding:.3em .7em;background:rgba(17,17,17,.7)}#smartplayer#smartplayer#smartplayer [data-balloon][data-balloon-pos=up]:after{margin-bottom:0}#smartplayer#smartplayer#smartplayer .smartplayer-bezel{position:absolute;left:0;right:0;top:0;bottom:0;font-size:22px;color:#fff;pointer-events:none}#smartplayer#smartplayer#smartplayer .smartplayer-bezel .smartplayer-bezel-icon{position:absolute;top:50%;left:50%;margin:-26px 0 0 -26px;height:52px;width:52px;padding:12px;-webkit-box-sizing:border-box;box-sizing:border-box;background:rgba(0,0,0,.5);border-radius:50%;opacity:0;pointer-events:none}#smartplayer#smartplayer#smartplayer .smartplayer-bezel .smartplayer-bezel-icon.smartplayer-bezel-transition{-webkit-animation:bezel-hide .5s linear;animation:bezel-hide .5s linear}@-webkit-keyframes bezel-hide{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform:scale(2);transform:scale(2)}}@keyframes bezel-hide{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform:scale(2);transform:scale(2)}}#smartplayer#smartplayer#smartplayer .smartplayer-bezel .smartplayer-danloading{position:absolute;top:50%;margin-top:-7px;width:100%;text-align:center;font-size:14px;line-height:14px;-webkit-animation:my-face 5s ease-in-out infinite;animation:my-face 5s ease-in-out infinite}#smartplayer#smartplayer#smartplayer .smartplayer-bezel .smartplayer-loading-icon{display:none;position:absolute;top:50%;left:50%;margin:-50px 0 0 -50px;height:100px;width:100px;pointer-events:none}#smartplayer#smartplayer#smartplayer .smartplayer-bezel .smartplayer-loading-icon .smartplayer-loading-hide{display:none}#smartplayer#smartplayer#smartplayer .smartplayer-bezel .smartplayer-loading-icon .smartplayer-loading-dot{-webkit-animation:smartplayer-loading-dot-fade .8s ease infinite;animation:smartplayer-loading-dot-fade .8s ease infinite;opacity:0;-webkit-transform-origin:4px 4px;-ms-transform-origin:4px 4px;transform-origin:4px 4px}#smartplayer#smartplayer#smartplayer .smartplayer-bezel .smartplayer-loading-icon .smartplayer-loading-dot.smartplayer-loading-dot-7{-webkit-animation-delay:.7s;animation-delay:.7s}#smartplayer#smartplayer#smartplayer .smartplayer-bezel .smartplayer-loading-icon .smartplayer-loading-dot.smartplayer-loading-dot-6{-webkit-animation-delay:.6s;animation-delay:.6s}#smartplayer#smartplayer#smartplayer .smartplayer-bezel .smartplayer-loading-icon .smartplayer-loading-dot.smartplayer-loading-dot-5{-webkit-animation-delay:.5s;animation-delay:.5s}#smartplayer#smartplayer#smartplayer .smartplayer-bezel .smartplayer-loading-icon .smartplayer-loading-dot.smartplayer-loading-dot-4{-webkit-animation-delay:.4s;animation-delay:.4s}#smartplayer#smartplayer#smartplayer .smartplayer-bezel .smartplayer-loading-icon .smartplayer-loading-dot.smartplayer-loading-dot-3{-webkit-animation-delay:.3s;animation-delay:.3s}#smartplayer#smartplayer#smartplayer .smartplayer-bezel .smartplayer-loading-icon .smartplayer-loading-dot.smartplayer-loading-dot-2{-webkit-animation-delay:.2s;animation-delay:.2s}#smartplayer#smartplayer#smartplayer .smartplayer-bezel .smartplayer-loading-icon .smartplayer-loading-dot.smartplayer-loading-dot-1{-webkit-animation-delay:.1s;animation-delay:.1s}@-webkit-keyframes smartplayer-loading-dot-fade{0%{opacity:.7;-webkit-transform:scale(1.2);transform:scale(1.2)}50%{opacity:.25;-webkit-transform:scale(.9);transform:scale(.9)}to{opacity:.25;-webkit-transform:scale(.85);transform:scale(.85)}}@keyframes smartplayer-loading-dot-fade{0%{opacity:.7;-webkit-transform:scale(1.2);transform:scale(1.2)}50%{opacity:.25;-webkit-transform:scale(.9);transform:scale(.9)}to{opacity:.25;-webkit-transform:scale(.85);transform:scale(.85)}}#smartplayer#smartplayer#smartplayer .smartplayer-controller-mask{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom;height:98px;width:100%;position:absolute;bottom:0;-webkit-transition:all .3s ease;transition:all .3s ease;cursor:pointer}#smartplayer#smartplayer#smartplayer .smartplayer-controller{position:absolute;bottom:0;left:0;right:0;height:41px;padding:0 20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .3s ease;transition:all .3s ease}#smartplayer#smartplayer#smartplayer .smartplayer-controller.smartplayer-controller-comment .smartplayer-icons{display:none}#smartplayer#smartplayer#smartplayer .smartplayer-controller.smartplayer-controller-comment .smartplayer-icons.smartplayer-comment-box{display:block}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-bar-wrap{padding:5px 0;cursor:pointer;position:absolute;bottom:33px;width:calc(100% - 40px);height:3px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-bar-wrap:hover .smartplayer-bar .smartplayer-played .smartplayer-thumb{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-bar-wrap:hover .smartplayer-highlight{display:block;width:8px;-webkit-transform:translateX(-4px);-ms-transform:translateX(-4px);transform:translateX(-4px);top:4px;height:40%}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-bar-wrap .smartplayer-highlight{z-index:12;position:absolute;top:5px;width:6px;height:20%;border-radius:6px;background-color:#fff;text-align:center;-webkit-transform:translateX(-3px);-ms-transform:translateX(-3px);transform:translateX(-3px);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-bar-wrap .smartplayer-highlight:hover .smartplayer-highlight-text{display:block}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-bar-wrap .smartplayer-highlight:hover~.smartplayer-bar-preview{opacity:0}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-bar-wrap .smartplayer-highlight:hover~.smartplayer-bar-time{opacity:0}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-bar-wrap .smartplayer-highlight .smartplayer-highlight-text{display:none;position:absolute;left:50%;top:-24px;padding:5px 8px;background-color:rgba(0,0,0,.62);color:#fff;border-radius:4px;font-size:12px;white-space:nowrap;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%)}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-bar-wrap .smartplayer-bar-preview{position:absolute;background:#fff;pointer-events:none;display:none;background-size:16000px 100%}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-bar-wrap .smartplayer-bar-preview-canvas{position:absolute;width:100%;height:100%;z-index:1;pointer-events:none}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-bar-wrap .smartplayer-bar-time{position:absolute;left:0;top:-20px;border-radius:4px;padding:5px 7px;background-color:rgba(0,0,0,.62);color:#fff;font-size:12px;text-align:center;opacity:1;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;word-wrap:normal;word-break:normal;z-index:2;pointer-events:none}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-bar-wrap .smartplayer-bar-time.smartplayer-hidden{opacity:0}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-bar-wrap .smartplayer-bar{position:relative;height:3px;width:100%;background:hsla(0,0%,100%,.2);cursor:pointer}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-bar-wrap .smartplayer-bar .smartplayer-loaded{position:absolute;left:0;top:0;bottom:0;background:hsla(0,0%,100%,.4);height:3px;-webkit-transition:all .5s ease;transition:all .5s ease;will-change:width}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-bar-wrap .smartplayer-bar .smartplayer-played{position:absolute;left:0;top:0;bottom:0;height:3px;will-change:width}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-bar-wrap .smartplayer-bar .smartplayer-played .smartplayer-thumb{position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;cursor:pointer;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons{height:38px;position:absolute;bottom:0}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box{display:none;position:absolute;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;z-index:2;height:38px;bottom:0;left:20px;right:20px;color:#fff}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-icon{padding:7px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-setting-icon{position:absolute;left:0;top:0}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-send-icon{position:absolute;right:0;top:0}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-setting-box{position:absolute;background:rgba(28,28,28,.9);bottom:41px;left:0;-webkit-box-shadow:0 0 25px rgba(0,0,0,.3);box-shadow:0 0 25px rgba(0,0,0,.3);border-radius:4px;padding:10px 10px 16px;font-size:14px;width:204px;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-setting-box.smartplayer-comment-setting-open{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-setting-box input[type=radio]{display:none}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-setting-box label{cursor:pointer}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-setting-box .smartplayer-comment-setting-title{font-size:13px;color:#fff;line-height:30px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-setting-box .smartplayer-comment-setting-type{font-size:0}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-setting-box .smartplayer-comment-setting-type .smartplayer-comment-setting-title{margin-bottom:6px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-setting-box .smartplayer-comment-setting-type label:nth-child(2) span{border-radius:4px 0 0 4px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-setting-box .smartplayer-comment-setting-type label:nth-child(4) span{border-radius:0 4px 4px 0}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-setting-box .smartplayer-comment-setting-type span{width:33%;padding:4px 6px;line-height:16px;display:inline-block;font-size:12px;color:#fff;border:1px solid #fff;margin-right:-1px;-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;cursor:pointer}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-setting-box .smartplayer-comment-setting-type input:checked+span{background:#e4e4e6;color:#1c1c1c}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-setting-box .smartplayer-comment-setting-color{font-size:0}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-setting-box .smartplayer-comment-setting-color label{font-size:0;padding:6px;display:inline-block}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-setting-box .smartplayer-comment-setting-color span{width:22px;height:22px;display:inline-block;border-radius:50%;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-setting-box .smartplayer-comment-setting-color span:hover{-webkit-animation:my-face 5s ease-in-out infinite;animation:my-face 5s ease-in-out infinite}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-input{outline:none;border:none;padding:8px 31px;font-size:14px;line-height:18px;text-align:center;border-radius:4px;background:none;margin:0;height:100%;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;color:#fff}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-input::-webkit-input-placeholder{color:#fff;opacity:.8}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-input::-moz-placeholder{color:#fff;opacity:.8}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-input:-ms-input-placeholder{color:#fff;opacity:.8}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-input::-ms-input-placeholder{color:#fff;opacity:.8}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-input::placeholder{color:#fff;opacity:.8}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-comment-box .smartplayer-comment-input::-ms-clear{display:none}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-icons-left .smartplayer-icon{padding:7px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-icons-right{right:20px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons.smartplayer-icons-right .smartplayer-icon{padding:8px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-live-badge,#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-time,#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-time span{line-height:38px;color:#eee;text-shadow:0 0 2px rgba(0,0,0,.5);vertical-align:middle;font-size:13px;cursor:default}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-live-dot{display:inline-block;width:6px;height:6px;vertical-align:4%;margin-right:5px;content:"";border-radius:6px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-icon{width:40px;height:100%;border:none;background-color:rgba(0,0,0,0);outline:none;cursor:pointer;vertical-align:middle;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-icon .smartplayer-icon-content{-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;opacity:.8;cursor:pointer}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-icon:hover .smartplayer-icon-content{opacity:1}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-icon.smartplayer-quality-icon{color:#fff;width:auto;line-height:22px;font-size:14px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-icon.smartplayer-comment-icon{padding:10px 9px 9px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-icon.smartplayer-setting-icon{padding-top:8.5px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-icon.smartplayer-volume-icon{width:43px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-icon svg{cursor:pointer}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-volume{position:relative;display:inline-block;cursor:pointer;height:100%}@media(min-width:550px){#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-volume:hover .smartplayer-volume-bar-wrap .smartplayer-volume-bar{width:45px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-volume:hover .smartplayer-volume-bar-wrap .smartplayer-volume-bar .smartplayer-volume-bar-inner .smartplayer-thumb{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-volume.smartplayer-volume-active .smartplayer-volume-bar-wrap .smartplayer-volume-bar{width:45px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-volume.smartplayer-volume-active .smartplayer-volume-bar-wrap .smartplayer-volume-bar .smartplayer-volume-bar-inner .smartplayer-thumb{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-volume .smartplayer-volume-bar-wrap{display:inline-block;margin:0 10px 0 -5px;vertical-align:middle;height:100%;cursor:pointer}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-volume .smartplayer-volume-bar-wrap .smartplayer-volume-bar{position:relative;top:17px;width:0;height:3px;background:#aaa;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;cursor:pointer}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-volume .smartplayer-volume-bar-wrap .smartplayer-volume-bar .smartplayer-volume-bar-inner{position:absolute;bottom:0;left:0;height:100%;-webkit-transition:all .1s ease;transition:all .1s ease;will-change:width}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-volume .smartplayer-volume-bar-wrap .smartplayer-volume-bar .smartplayer-volume-bar-inner .smartplayer-thumb{position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;cursor:pointer;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}@media(max-width:550px){#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-volume{pointer-events:none}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-volume .smartplayer-icon{pointer-events:all}}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-subtitle-btn{display:inline-block;height:100%}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-speed-control{display:inline-block;width:40px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-speed-control .smartplayer-speed-control-display{background-color:#fff;padding:0;width:100%;height:18px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-speed-control .smartplayer-speed-control-display .smartplayer-speed-control-display-content{color:#000;font-size:12px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-speed-control .smartplayer-speed-control-box-to-left{right:0}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-speed-control .smartplayer-speed-control-box-to-right{left:0}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-speed-control .smartplayer-speed-control-box{position:absolute;bottom:50px;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);width:150px;border-radius:2px;background:rgba(28,28,28,.9);padding:7px 0;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;overflow:hidden;z-index:2}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-speed-control .smartplayer-speed-control-box>div{display:none}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-speed-control .smartplayer-speed-control-box>div.smartplayer-speed-control-origin-panel{display:block}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-speed-control .smartplayer-speed-control-box.smartplayer-speed-control-box-open{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-speed-control .smartplayer-speed-control-item,#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-speed-control .smartplayer-speed-control-speed-item{height:30px;padding:5px 10px;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;position:relative}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-speed-control .smartplayer-speed-control-item:hover,#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-speed-control .smartplayer-speed-control-speed-item:hover{background-color:hsla(0,0%,100%,.1)}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-setting{display:inline-block;height:100%}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-setting .smartplayer-setting-box{position:absolute;right:0;bottom:50px;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);width:150px;border-radius:2px;background:rgba(28,28,28,.9);padding:7px 0;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;overflow:hidden;z-index:2}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-setting .smartplayer-setting-box>div{display:none}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-setting .smartplayer-setting-box>div.smartplayer-setting-origin-panel{display:block}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-setting .smartplayer-setting-box.smartplayer-setting-box-open{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-setting .smartplayer-setting-box.smartplayer-setting-box-narrow{width:70px;text-align:center}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-setting .smartplayer-setting-box .smartplayer-setting-origin-panel{display:none}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-setting .smartplayer-setting-item{height:30px;padding:5px 10px;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;position:relative}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-setting .smartplayer-setting-item:hover{background-color:hsla(0,0%,100%,.1)}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-full{display:inline-block;height:100%;position:relative}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-full .smartplayer-full-in-icon{display:none}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-quality{position:relative;display:inline-block;height:100%;z-index:2}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-quality:hover .smartplayer-quality-list,#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-quality:hover .smartplayer-quality-mask{display:block}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-quality .smartplayer-quality-mask{display:none;position:absolute;bottom:38px;left:-18px;width:80px;padding-bottom:12px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-quality .smartplayer-quality-list{display:none;font-size:12px;width:80px;border-radius:2px;background:rgba(28,28,28,.9);padding:5px 0;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;overflow:hidden;color:#fff;text-align:center}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-quality .smartplayer-quality-item{height:25px;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;line-height:25px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-quality .smartplayer-quality-item:hover{background-color:hsla(0,0%,100%,.1)}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-comment{display:inline-block;height:100%}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-label{color:#eee;font-size:13px;display:inline-block;vertical-align:middle;white-space:nowrap}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-toggle{width:32px;height:20px;text-align:center;font-size:0;vertical-align:middle;position:absolute;top:5px;right:10px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-toggle input{max-height:0;max-width:0;display:none}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-toggle input+label{display:inline-block;position:relative;-webkit-box-shadow:#dfdfdf 0 0 0 0 inset;box-shadow:inset 0 0 0 0 #dfdfdf;border:1px solid #dfdfdf;height:20px;width:32px;border-radius:10px;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;-webkit-transition:.2s ease-in-out;transition:.2s ease-in-out}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-toggle input+label:before{content:"";position:absolute;display:block;height:18px;width:18px;top:0;left:0;border-radius:15px;-webkit-transition:.2s ease-in-out;transition:.2s ease-in-out}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-toggle input+label:after{content:"";position:absolute;display:block;left:0;top:0;border-radius:15px;background:#fff;-webkit-transition:.2s ease-in-out;transition:.2s ease-in-out;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.4);box-shadow:0 1px 3px rgba(0,0,0,.4);height:18px;width:18px}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-toggle input:checked+label{border-color:hsla(0,0%,100%,.5)}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-toggle input:checked+label:before{width:30px;background:hsla(0,0%,100%,.5)}#smartplayer#smartplayer#smartplayer .smartplayer-controller .smartplayer-icons .smartplayer-toggle input:checked+label:after{left:12px}#smartplayer#smartplayer#smartplayer .smartplayer-mobile-play{display:none;width:50px;height:50px;border:none;background-color:rgba(0,0,0,0);outline:none;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;bottom:0;opacity:.8;position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}#smartplayer#smartplayer#smartplayer .smartplayer-logo{pointer-events:none;position:absolute;left:20px;top:20px;max-width:50px;max-height:50px}#smartplayer#smartplayer#smartplayer .smartplayer-logo img{max-width:100%;max-height:100%;background:none}#smartplayer#smartplayer#smartplayer .smartplayer-menu{position:absolute;width:170px;border-radius:2px;background:rgba(28,28,28,.85);padding:5px 0;overflow:hidden;z-index:12;display:none}#smartplayer#smartplayer#smartplayer .smartplayer-menu.smartplayer-menu-show{display:block}#smartplayer#smartplayer#smartplayer .smartplayer-menu .smartplayer-menu-item{height:30px;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer}#smartplayer#smartplayer#smartplayer .smartplayer-menu .smartplayer-menu-item:hover{background-color:hsla(0,0%,100%,.1)}#smartplayer#smartplayer#smartplayer .smartplayer-menu .smartplayer-menu-item a{padding:0 10px;line-height:30px;color:#eee;font-size:13px;margin:0;display:inline-block;vertical-align:middle;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;text-decoration:none}#smartplayer#smartplayer#smartplayer .smartplayer-menu .smartplayer-menu-item a:hover{text-decoration:none}#smartplayer#smartplayer#smartplayer .smartplayer-notice{opacity:0;position:absolute;bottom:60px;left:20px;font-size:14px;border-radius:2px;background:rgba(28,28,28,.9);padding:7px 20px;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;overflow:hidden;color:#fff;pointer-events:none}#smartplayer#smartplayer#smartplayer .smartplayer-subtitle{position:absolute;bottom:40px;width:90%;left:5%;text-align:center;color:#fff;text-shadow:.5px .5px .5px rgba(0,0,0,.5);font-size:20px}#smartplayer#smartplayer#smartplayer .smartplayer-subtitle.smartplayer-subtitle-hide{display:none}#smartplayer#smartplayer#smartplayer .smartplayer-mask{position:absolute;top:0;bottom:0;left:0;right:0;z-index:11;display:none}#smartplayer#smartplayer#smartplayer .smartplayer-mask.smartplayer-mask-show{display:block}#smartplayer#smartplayer#smartplayer.smartplayer-playing:not(.smartplayer-fulled):not(.smartplayer-loading) .smartplayer-video-wrap{background:rgba(0,0,0,0)}#smartplayer#smartplayer#smartplayer .smartplayer-video-wrap{position:absolute;font-size:0;width:100%;height:100%;top:0;left:0;right:0;bottom:0}#smartplayer#smartplayer#smartplayer .smartplayer-video-wrap .smartplayer-video{position:absolute;width:100%;height:100%;top:0;left:0;right:0;bottom:0;display:none;-o-object-fit:contain;object-fit:contain;cursor:pointer}#smartplayer#smartplayer#smartplayer .smartplayer-video-wrap .smartplayer-video-current{display:block}#smartplayer#smartplayer#smartplayer .smartplayer-video-wrap .smartplayer-video-prepare{display:none}#smartplayer#smartplayer#smartplayer.smartplayer-initial .smartplayer-video-wrap{background:rgba(0,0,0,0)}#smartplayer#smartplayer#smartplayer.smartplayer-fulled .smartplayer-video-wrap{background:#000}#smartplayer#smartplayer#smartplayer .smartplayer-info-panel{position:absolute;top:10px;left:10px;width:400px;background:rgba(28,28,28,.8);padding:10px;color:#fff;font-size:12px;border-radius:2px}#smartplayer#smartplayer#smartplayer .smartplayer-info-panel-hide{display:none}#smartplayer#smartplayer#smartplayer .smartplayer-info-panel .smartplayer-info-panel-close{cursor:pointer;position:absolute;right:10px;top:10px}#smartplayer#smartplayer#smartplayer .smartplayer-info-panel .smartplayer-info-panel-item>span{display:inline-block;vertical-align:middle;line-height:15px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}#smartplayer#smartplayer#smartplayer .smartplayer-info-panel .smartplayer-info-panel-item-title{width:100px;text-align:right;margin-right:10px}#smartplayer#smartplayer#smartplayer .smartplayer-info-panel .smartplayer-info-panel-item-data{width:260px}#smartplayer#smartplayer#smartplayer .smartplayer-call-action{position:absolute;top:0;left:0;width:100%;height:100%;padding:20px 20px 40px;-webkit-transform:initial;-ms-transform:initial;transform:none;display:block;pointer-events:none}#smartplayer#smartplayer#smartplayer .smartplayer-call-action.smartplayer-hide{display:none}#smartplayer#smartplayer#smartplayer .smartplayer-call-action>*{position:absolute}#smartplayer#smartplayer#smartplayer .smartplayer-call-action__tc>*,#smartplayer#smartplayer#smartplayer .smartplayer-call-action__tl>*,#smartplayer#smartplayer#smartplayer .smartplayer-call-action__tr>*{top:20px}#smartplayer#smartplayer#smartplayer .smartplayer-call-action__cc>*,#smartplayer#smartplayer#smartplayer .smartplayer-call-action__cl>*,#smartplayer#smartplayer#smartplayer .smartplayer-call-action__cr>*{top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}#smartplayer#smartplayer#smartplayer .smartplayer-call-action__bc>*,#smartplayer#smartplayer#smartplayer .smartplayer-call-action__bl>*,#smartplayer#smartplayer#smartplayer .smartplayer-call-action__br>*{bottom:40px}#smartplayer#smartplayer#smartplayer .smartplayer-call-action__bl>*,#smartplayer#smartplayer#smartplayer .smartplayer-call-action__cl>*,#smartplayer#smartplayer#smartplayer .smartplayer-call-action__tl>*{left:20px}#smartplayer#smartplayer#smartplayer .smartplayer-call-action__bc>*,#smartplayer#smartplayer#smartplayer .smartplayer-call-action__cc>*,#smartplayer#smartplayer#smartplayer .smartplayer-call-action__tc>*{left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%)}#smartplayer#smartplayer#smartplayer .smartplayer-call-action__cc>*{-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}#smartplayer#smartplayer#smartplayer .smartplayer-call-action__br>*,#smartplayer#smartplayer#smartplayer .smartplayer-call-action__cr>*,#smartplayer#smartplayer#smartplayer .smartplayer-call-action__tr>*{right:20px}#smartplayer#smartplayer#smartplayer .smartplayer-call-action--link{pointer-events:all;display:inline-block;padding:.65em .5em .5em;text-align:center;border-radius:5px;color:#fff;font-weight:700;line-height:1.2;-webkit-transition:all .15s ease-out;transition:all .15s ease-out;text-decoration:none}#smartplayer#smartplayer#smartplayer .smartplayer-resume{position:absolute;top:0;left:0;right:0;bottom:0;z-index:9999;background-color:rgba(0,0,0,.6);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);padding:8px;cursor:auto}#smartplayer#smartplayer#smartplayer .smartplayer-resume__content{position:absolute;top:50%;left:0;right:0;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);text-align:center}#smartplayer#smartplayer#smartplayer .smartplayer-resume__title{margin:0 8px 16px;min-width:180px;font-size:2em;line-height:1.3;text-align:center;color:#fff;font-weight:700}#smartplayer#smartplayer#smartplayer .smartplayer-resume__actions{display:inline-block}#smartplayer#smartplayer#smartplayer .smartplayer-resume__actions>div{background:rgba(0,0,0,0);padding:0;margin:4px;text-align:left;cursor:pointer;border:none;display:inline-table;color:#fff;min-width:180px;opacity:1;-webkit-transition:opacity .2s ease;transition:opacity .2s ease}@media(max-width:550px){#smartplayer#smartplayer#smartplayer .smartplayer-resume__actions>div{display:table}}#smartplayer#smartplayer#smartplayer .smartplayer-resume__actions>div:hover{opacity:.8}#smartplayer#smartplayer#smartplayer .smartplayer-resume__text{text-align:left;font-size:16px;line-height:1.1;font-weight:700;display:table-cell;vertical-align:middle;padding:0 1em 0 .6em}#smartplayer#smartplayer#smartplayer .smartplayer-resume__icon{width:45px;height:45px;padding:5px;border:2px solid #fff;border-radius:50%;margin-right:8px;display:table-cell;vertical-align:middle}#smartplayer#smartplayer#smartplayer .smartplayer-resume__icon svg{display:block}#smartplayer#smartplayer#smartplayer .smartplayer-resume__play .smartplayer-resume__icon{padding-left:10px}#smartplayer#smartplayer#smartplayer .smartplayer-resume__rewind .smartplayer-resume__icon{padding:9px 9px 9px 7px}@media(max-width:550px){#smartplayer#smartplayer#smartplayer .smartplayer-resume__title{font-size:1.15em;margin-bottom:8px}#smartplayer#smartplayer#smartplayer .smartplayer-resume__text{font-size:.9em}#smartplayer#smartplayer#smartplayer .smartplayer-resume__icon{width:30px;height:30px}#smartplayer#smartplayer#smartplayer .smartplayer-resume__rewind .smartplayer-resume__icon{padding:4px 4px 4px 2px}#smartplayer#smartplayer#smartplayer .smartplayer-resume__play .smartplayer-resume__icon{padding-left:5px}}#smartplayer#smartplayer#smartplayer .smartplayer-bigplay{width:150px;height:150px;border-radius:75px;padding-left:20px;border:none;background-color:rgba(0,0,0,0);outline:none;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;bottom:0;opacity:.9;position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:10}#smartplayer#smartplayer#smartplayer .smartplayer-bigplay.smartplayer-hidden{display:none}#smartplayer#smartplayer#smartplayer .smartplayer-bigplay svg{cursor:pointer}@media(max-width:550px){#smartplayer#smartplayer#smartplayer .smartplayer-bigplay{width:70px;height:70px;padding-left:13px;padding-right:6px}}#smartplayer#smartplayer#smartplayer.smartplayer-smart-auto-play .smartplayer-bigplay{display:none}#smartplayer#smartplayer#smartplayer .smartplayer-offline-content{display:none;position:absolute;top:0;right:0;font-size:12px;overflow:hidden;pointer-events:none;z-index:10000;max-width:100%}#smartplayer#smartplayer#smartplayer .smartplayer-offline-content__box{background:rgba(0,0,0,.5);padding:2px 6px;border-bottom-left-radius:8px;-webkit-transform:translateX(91%);-ms-transform:translateX(91%);transform:translateX(91%);-webkit-transition:-webkit-transform .3s .5s;transition:-webkit-transform .3s .5s;transition:transform .3s .5s;transition:transform .3s .5s,-webkit-transform .3s .5s;pointer-events:auto;white-space:nowrap}#smartplayer#smartplayer#smartplayer .smartplayer-offline-content__box:hover{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0);-webkit-transition:-webkit-transform .3s 0s;transition:-webkit-transform .3s 0s;transition:transform .3s 0s;transition:transform .3s 0s,-webkit-transform .3s 0s}#smartplayer#smartplayer#smartplayer .smartplayer-offline-content__icon{height:12px;width:12px;display:inline-block;margin-right:6px;color:#fff}#smartplayer#smartplayer#smartplayer .smartplayer-offline-content__icon svg{display:block}#smartplayer#smartplayer#smartplayer .smartplayer-offline-content__text{color:#fff;font-size:12px;line-height:12px;white-space:nowrap}#smartplayer#smartplayer#smartplayer.smartplayer-offline .smartplayer-offline-content{display:block}#smartplayer#smartplayer#smartplayer .smartplayer-fake-bar{left:0;width:0;bottom:0;height:10px;opacity:.8;z-index:100005;position:absolute}#smartplayer#smartplayer#smartplayer .smartplayer-blocked{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;background-color:#202020;-webkit-box-shadow:inset 0 0 160px 0 #000;box-shadow:inset 0 0 160px 0 #000}#smartplayer#smartplayer#smartplayer .smartplayer-blocked__logo{position:absolute;width:100%;height:100%}#smartplayer#smartplayer#smartplayer .smartplayer-blocked__logo svg{position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);height:80%;opacity:.035}#smartplayer#smartplayer#smartplayer .smartplayer-blocked__logo svg path{fill:#fff}#smartplayer#smartplayer#smartplayer .smartplayer-blocked__content{top:50%;left:50%;width:80%;position:absolute;max-width:32em;text-align:center;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}#smartplayer#smartplayer#smartplayer .smartplayer-blocked__msg{color:#ccc;text-align:center;font-size:1.2em;text-shadow:0 2px 0 #000,0 3px 3px #000}#smartplayer#smartplayer#smartplayer .smartplayer-blocked__button{color:#fff;padding:.7em 1.5em;display:inline-block;font-size:1em;margin:1.2em auto 0;background:#f1582d;font-weight:600;border-radius:5px;text-decoration:none;-webkit-transition:-webkit-transform .2s;transition:-webkit-transform .2s;transition:transform .2s;transition:transform .2s,-webkit-transform .2s}#smartplayer#smartplayer#smartplayer .smartplayer-blocked__button:hover{-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}@media(max-width:480px){#smartplayer#smartplayer#smartplayer .smartplayer-blocked__msg{font-size:1em}#smartplayer#smartplayer#smartplayer .smartplayer-blocked__button{font-size:.8em}}#smartplayer#smartplayer#smartplayer.smartplay:not(.smartplayer-in-resume):not(.smartplayer-smart-auto-play) .smartplayer-image-finish,#smartplayer#smartplayer#smartplayer.smartplay:not(.smartplayer-in-resume):not(.smartplayer-smart-auto-play) .smartplayer-image-pause,#smartplayer#smartplayer#smartplayer.smartplay:not(.smartplayer-in-resume):not(.smartplayer-smart-auto-play) .smartplayer-image-start{position:absolute;top:0;display:none;width:100%;height:100%;background-color:#000;background-position:50%;background-repeat:no-repeat;background-size:contain;cursor:pointer}#smartplayer#smartplayer#smartplayer.smartplay:not(.smartplayer-in-resume):not(.smartplayer-smart-auto-play).smartplayer-initial .smartplayer-image-start{z-index:9;display:block;background-color:rgba(0,0,0,0)}#smartplayer#smartplayer#smartplayer.smartplay:not(.smartplayer-in-resume):not(.smartplayer-smart-auto-play).smartplayer-paused:not(.smartplayer-finished) .smartplayer-image-pause{z-index:9;display:block}#smartplayer#smartplayer#smartplayer.smartplay:not(.smartplayer-in-resume):not(.smartplayer-smart-auto-play).smartplayer-finished .smartplayer-image-finish{z-index:9;display:block}#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail{position:absolute;top:0;display:none;width:100%;height:100%;background-color:#000;background-position:50%;background-repeat:no-repeat;background-size:contain;pointer-events:none;cursor:pointer}#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--tc,#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--tl,#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--tr{top:1.25rem}#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--cc,#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--cl,#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--cr{top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--bc,#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--bl,#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--br{bottom:1.25rem}#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--bl,#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--cl,#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--tl{left:1.25rem}#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--bc,#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--cc,#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--tc{left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%)}#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--cc{-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--br,#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--cr,#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--tr{right:1.25rem}#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--link{position:absolute;display:inline-block;pointer-events:all;padding:.5em;color:#fff;font-size:1rem;font-weight:700;line-height:1.2;text-align:center;border-radius:5px;text-decoration:none;-webkit-transition:all .15s ease-out;transition:all .15s ease-out}#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--md{font-size:1.25rem}#smartplayer#smartplayer#smartplayer.smartplay .smartplayer-thumbnail--lg{font-size:1.5rem}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-paused:not(.smartplayer-in-resume):not(.smartplayer-smart-auto-play) .smartplayer-thumbnail--ready{z-index:9;display:block}#smartplayer#smartplayer#smartplayer #smartplayer#smartplayer#smartplayer .smartplayer-elements-container,#smartplayer#smartplayer#smartplayer .smartplayer-mini-hooks-container{top:50%;position:absolute;-webkit-transform:translateX(-50%) translateY(-50%);-ms-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);left:50%}#smartplayer#smartplayer#smartplayer .smartplayer-mini-hooks-container{pointer-events:none;z-index:0}#smartplayer#smartplayer#smartplayer .smartplayer-mini-hooks-element{pointer-events:none;cursor:pointer;opacity:0}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-smart-auto-play{cursor:pointer}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-smart-auto-play .smartplayer-controller,#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-smart-auto-play .smartplayer-controller-mask{opacity:0!important;-webkit-transform:translateY(100%)!important;-ms-transform:translateY(100%)!important;transform:translateY(100%)!important}#smartplayer#smartplayer#smartplayer .smartplayer-smartplay{cursor:pointer;z-index:9999;position:absolute;top:0;opacity:0;width:100%;height:100%}#smartplayer#smartplayer#smartplayer .smartplayer-smartplay *{cursor:pointer}#smartplayer#smartplayer#smartplayer.smartplayer-show-smart-auto-play .smartplayer-smartplay{opacity:1}#smartplayer#smartplayer#smartplayer.smartplayer-smart-auto-play:not(.smartplayer-show-smart-auto-play) .smartplayer-loading-icon{opacity:0}#smartplayer#smartplayer#smartplayer.smartplay{position:relative;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:1;width:100%;max-width:100%;max-height:100%}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-initial{cursor:pointer!important}#smartplayer#smartplayer#smartplayer.smartplay svg{width:100%;height:100%}#smartplayer#smartplayer#smartplayer.smartplay svg circle,#smartplayer#smartplayer#smartplayer.smartplay svg path{fill:#fff}#smartplayer#smartplayer#smartplayer.smartplay:-webkit-full-screen{width:100%;height:100%;background:#000;position:fixed;z-index:100000;left:0;top:0;margin:0;padding:0!important;-webkit-transform:translate(0);transform:translate(0)}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-live .smartplayer-bar-wrap,#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-live .smartplayer-setting-loop,#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-live .smartplayer-time{display:none}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-arrow .smartplayer-icon{margin:0 -3px}@media(min-width:900px){#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-playing .smartplayer-controller,#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-playing .smartplayer-controller-mask{opacity:0}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-playing:hover .smartplayer-controller,#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-playing:hover .smartplayer-controller-mask{opacity:1}}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-loading .smartplayer-bezel .smartplayer-loading-icon{display:block}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-hide-controller{cursor:none}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-hide-controller .smartplayer-controller,#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-hide-controller .smartplayer-controller-mask{opacity:0;-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%)}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-show-controller .smartplayer-controller,#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-show-controller .smartplayer-controller-mask{opacity:1}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-fulled{position:fixed!important;z-index:100000;left:0;top:0;width:100%!important;height:100%!important;padding:0!important}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-fulled .smartplayer-video-wrap,#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-fulled .smartplayer-video-wrap .smartplayer-video-current{height:100%}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-mobile .smartplayer-controller .smartplayer-icons .smartplayer-full .smartplayer-full-in-icon{position:static;display:inline-block}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-mobile .smartplayer-bar-time,#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-mobile.smartplayer-hide-controller .smartplayer-mobile-play,#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-mobile .smartplayer-mobile-play{display:none}.smartplayer-web-fullscreen-fix{position:fixed;top:0;left:0;margin:0;padding:0}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-in-resume .smartplayer-controller,#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-in-resume .smartplayer-controller-mask{opacity:0!important;-webkit-transform:translateY(100%)!important;-ms-transform:translateY(100%)!important;transform:translateY(100%)!important}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-in-resume .smartplayer-bigplay{display:none}#smartplayer#smartplayer#smartplayer:not(.smartplayer-fulled){width:100%;position:relative;padding:56.25% 0 0}#smartplayer#smartplayer#smartplayer .smartplayer-content{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%}#smartplayer#smartplayer#smartplayer .smartplayer-opacity-0{opacity:0!important}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-mobile .smartplayer-icon.smartplayer-full-in-icon{display:block}#smartplayer#smartplayer#smartplayer.smartplay.smartplayer-mobile .smartplayer-icon.smartplayer-full-icon{display:none}',""]),e.a=n},function(t,e,r){(function(t){var a=void 0!==t&&t||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function i(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new i(n.call(setTimeout,a,arguments),clearTimeout)},e.setInterval=function(){return new i(n.call(setInterval,a,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(a,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(48),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(2))},function(t,e){var r,a,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{a="function"==typeof clearTimeout?clearTimeout:o}catch(t){a=o}}();var l,c=[],u=!1,d=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&p())}function p(){if(!u){var t=s(h);u=!0;for(var e=c.length;e;){for(l=c,c=[];++d1)for(var r=1;r>>((3&e)<<3)&255;return n}}},function(t,e){for(var r=[],a=0;a<256;++a)r[a]=(a+256).toString(16).substr(1);t.exports=function(t,e){var a=e||0,n=r;return[n[t[a++]],n[t[a++]],n[t[a++]],n[t[a++]],"-",n[t[a++]],n[t[a++]],"-",n[t[a++]],n[t[a++]],"-",n[t[a++]],n[t[a++]],"-",n[t[a++]],n[t[a++]],n[t[a++]],n[t[a++]],n[t[a++]],n[t[a++]]].join("")}},function(t,e,r){"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),a=0;a=200&&t<300}};l.headers={common:{Accept:"application/json, text/plain, */*"}},a.forEach(["delete","get","head"],(function(t){l.headers[t]={}})),a.forEach(["post","put","patch"],(function(t){l.headers[t]=a.merge(i)})),t.exports=l}).call(this,r(7))},function(t,e,r){"use strict";var a=r(0),n=r(61),i=r(63),o=r(11),s=r(64),l=r(67),c=r(68),u=r(15);t.exports=function(t){return new Promise((function(e,r){var d=t.data,h=t.headers;a.isFormData(d)&&delete h["Content-Type"];var p=new XMLHttpRequest;if(t.auth){var f=t.auth.username||"",m=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";h.Authorization="Basic "+btoa(f+":"+m)}var y=s(t.baseURL,t.url);if(p.open(t.method.toUpperCase(),o(y,t.params,t.paramsSerializer),!0),p.timeout=t.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var a="getAllResponseHeaders"in p?l(p.getAllResponseHeaders()):null,i={data:t.responseType&&"text"!==t.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:a,config:t,request:p};n(e,r,i),p=null}},p.onabort=function(){p&&(r(u("Request aborted",t,"ECONNABORTED",p)),p=null)},p.onerror=function(){r(u("Network Error",t,null,p)),p=null},p.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(u(e,t,"ECONNABORTED",p)),p=null},a.isStandardBrowserEnv()){var v=(t.withCredentials||c(y))&&t.xsrfCookieName?i.read(t.xsrfCookieName):void 0;v&&(h[t.xsrfHeaderName]=v)}if("setRequestHeader"in p&&a.forEach(h,(function(t,e){void 0===d&&"content-type"===e.toLowerCase()?delete h[e]:p.setRequestHeader(e,t)})),a.isUndefined(t.withCredentials)||(p.withCredentials=!!t.withCredentials),t.responseType)try{p.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&p.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){p&&(p.abort(),r(t),p=null)})),d||(d=null),p.send(d)}))}},function(t,e,r){"use strict";var a=r(62);t.exports=function(t,e,r,n,i){var o=new Error(t);return a(o,e,r,n,i)}},function(t,e,r){"use strict";var a=r(0);t.exports=function(t,e){e=e||{};var r={},n=["url","method","data"],i=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function l(t,e){return a.isPlainObject(t)&&a.isPlainObject(e)?a.merge(t,e):a.isPlainObject(e)?a.merge({},e):a.isArray(e)?e.slice():e}function c(n){a.isUndefined(e[n])?a.isUndefined(t[n])||(r[n]=l(void 0,t[n])):r[n]=l(t[n],e[n])}a.forEach(n,(function(t){a.isUndefined(e[t])||(r[t]=l(void 0,e[t]))})),a.forEach(i,c),a.forEach(o,(function(n){a.isUndefined(e[n])?a.isUndefined(t[n])||(r[n]=l(void 0,t[n])):r[n]=l(void 0,e[n])})),a.forEach(s,(function(a){a in e?r[a]=l(t[a],e[a]):a in t&&(r[a]=l(void 0,t[a]))}));var u=n.concat(i).concat(o).concat(s),d=Object.keys(t).concat(Object.keys(e)).filter((function(t){return-1===u.indexOf(t)}));return a.forEach(d,c),r}},function(t,e,r){"use strict";function a(t){this.message=t}a.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},a.prototype.__CANCEL__=!0,t.exports=a},function(t,e,r){"use strict";var a,n=function(){return void 0===a&&(a=Boolean(window&&document&&document.all&&!window.atob)),a},i=function(){var t={};return function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}t[e]=r}return t[e]}}(),o=[];function s(t){for(var e=-1,r=0;r'},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e,r){var a=r(4);t.exports=function(t){"use strict";var e="",r=(t=t||{}).options,n=a.$escape,i=t.icons,o=a.$each,s=(t.$value,t.$index,t.undefined),l=t.video,c=t.tran;return e+='
\n
\n ',r.logo&&r.displays.logo&&(e+='\n \n '),e+='\n
\n
\n \n ',e+=i.loading,e+="\n
\n
\n\n",r.mini_hooks&&r.mini_hooks_elements&&r.mini_hooks_elements.length>0&&(e+="\n\n
\n ',o(r.mini_hooks_elements,(function(t,r){e+="\n ","text"===t.type&&(e+='\n ',e+=n(t.properties.value),e+="\n "),e+="\n ","image"===t.type&&(e+='\n \n '),e+="\n ","box"===t.type&&(e+='\n
\n '),e+="\n "})),e+="\n
\n"),e+="\n\n",l.pic&&(e+='\n
\n'),e+="\n\n",l.pic_pause&&(e+='\n
\n'),e+="\n\n",l.pic_finish&&(e+='\n
\n'),e+="\n\n",r.thumbs.length>0&&(e+='\n
\n\n"),e+='\n\n
\n
\n
\n ',r.displays.play_pause&&(e+='\n \n "),e+="\n\n ",r.displays.backward&&(e+='\n \n "),e+="\n ",r.displays.forward&&(e+='\n \n "),e+="\n ",r.displays.speed_control&&(e+='\n
\n \n
\n
\n ',o(r.playbackSpeed,(function(t,r){e+='\n
\n ',e+=n(t),e+="\n
\n "})),e+="\n
\n
\n
\n "),e+="\n ",r.displays.volume&&(e+='\n
\n \n\n ",r.displays.volume_bar&&(e+='\n
\n
\n
\n \n
\n
\n
\n '),e+="\n
\n "),e+="\n\n ",r.displays.time&&(e+='\n \n 0:00 /\n 0:00\n \n '),e+="\n ",r.live&&(e+='\n ',e+=n(c("Live")),e+="\n "),e+='\n
\n
\n ',r.video.quality&&(e+='\n
\n \n
\n
\n ',o(r.video.quality,(function(t,r){e+='\n
',e+=n(t.name),e+="
\n "})),e+="\n
\n
\n
\n "),e+="\n ",r.screenshot&&(e+='\n
\n
\n "),e+="\n ",r.airplay&&(e+='\n
\n
\n "),e+="\n ",r.subtitle&&r.displays.subtitleSettings&&(e+='\n
\n \n
\n "),e+="\n ",r.displays.settings&&(e+='\n
\n \n
\n
\n
\n ',e+=n(c("Loop")),e+='\n
\n \n \n
\n
\n
\n
\n
\n '),e+="\n\n ",r.displays.fullscreen&&(e+='\n
\n \n \n
\n "),e+="\n
\n ",r.displays.seekbar&&(e+='\n
\n ',r.displays.seekbar_time&&(e+='\n
00:00
\n '),e+='\n
\n
\n
\n
\n \n
\n
\n
\n '),e+='\n
\n\n
\n
[x]
\n
\n Player version\n \n
\n
\n Player FPS\n \n
\n
\n Video type\n \n
\n
\n Video url\n \n
\n
\n Video resolution\n \n
\n
\n Video duration\n \n
\n
\n',"smartplay"!=r.autoplay||r.smart_autoplay_elements&&r.smart_autoplay_elements.length||(e+='\n
\n',e+=r.smartplay,e+="\n
\n"),e+="\n\n","smartplay"==r.autoplay&&r.smart_autoplay_elements&&r.smart_autoplay_elements.length&&(e+='\n
\n ',o(r.smart_autoplay_elements,(function(t,r){e+="\n ","text"===t.type&&(e+='\n ',e+=n(t.properties.value),e+="\n "),e+="\n ","image"===t.type&&(e+='\n ',e+=n(t.properties.alt),e+='\n '),e+="\n ","box"===t.type&&(e+='\n
\n '),e+="\n "})),e+=" \n
\n"),e+="\n\n",r.foreground_color&&(e+="\n \n"),e+="\n\n",r.displays.big_play&&(e+="\n\n\n"),e+='\n
\n ',o(r.contextmenu,(function(t,r){e+='\n
\n ',e+=n(c("Powered by Vturb")),e+="\n
\n "})),e+='\n
\n
\n\n\n",r.callAction&&r.callAction.length>0&&(e+="\n\n",o(r.callAction,(function(t,r){e+="\n ",null!=t.type&&"inner_button"!=t.type||(e+='\n \n "),e+="\n"})),e+="\n"),e+='\n\n
\n
\n ',e+=i.warning,e+='Identificamos um problema de conexão!\n
\n
\n\n',r.fake_bar&&(e+='\n
\n\n"),e+="\n\n",r.resume&&(e+='\n\n"),e+="\n"}},function(t,e,r){"use strict";(function(e){function r(t){var e,r,n,i,o,s,l=Object.create(null);if(this[c]=l,t)if("string"==typeof t)for("?"===t.charAt(0)&&(t=t.slice(1)),o=0,s=(i=t.split("&")).length;o\n ",r&&(e+='\n \n '),e+="\n\n"}},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var a,n,i,o,s,l=1,c={},u=!1,d=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?a=function(t){e.nextTick((function(){f(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((i=new MessageChannel).port1.onmessage=function(t){f(t.data)},a=function(t){i.port2.postMessage(t)}):d&&"onreadystatechange"in d.createElement("script")?(n=d.documentElement,a=function(t){var e=d.createElement("script");e.onreadystatechange=function(){f(t),e.onreadystatechange=null,n.removeChild(e),e=null},n.appendChild(e)}):a=function(t){setTimeout(f,0,t)}:(o="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(o)&&f(+e.data.slice(o.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),a=function(e){t.postMessage(o+e,"*")}),h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;rs)&&void 0===t.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=f,l=m,n=h;var v=(1e4*(268435455&(f+=122192928e5))+m)%4294967296;u[c++]=v>>>24&255,u[c++]=v>>>16&255,u[c++]=v>>>8&255,u[c++]=255&v;var g=f/4294967296*1e4&268435455;u[c++]=g>>>8&255,u[c++]=255&g,u[c++]=g>>>24&15|16,u[c++]=g>>>16&255,u[c++]=h>>>8|128,u[c++]=255&h;for(var b=0;b<6;++b)u[c+b]=d[b];return e||o(u)}},function(t,e,r){var a=r(8),n=r(9);t.exports=function(t,e,r){var i=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||a)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var s=0;s<16;++s)e[i+s]=o[s];return e||n(o)}},function(t,e,r){"use strict";(function(e){var r="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:{},a=Object.create(r),n=/["&'<>]/;a.$escape=function(t){return function(t){var e=""+t,r=n.exec(e);if(!r)return t;var a="",i=void 0,o=void 0,s=void 0;for(i=r.index,o=0;i=0;r--)if(i(e[r])){var a=e[r].split("="),n=unescape(a[0]);t(unescape(a[1]),n)}}function l(t){t&&c(t)&&(o.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function c(t){return new RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(o.cookie)}},627:function(t,e,r){var a=r(78).Global;function n(){return a.localStorage}function i(t){return n().getItem(t)}t.exports={name:"localStorage",read:i,write:function(t,e){return n().setItem(t,e)},each:function(t){for(var e=n().length-1;e>=0;e--){var r=n().key(e);t(i(r),r)}},remove:function(t){return n().removeItem(t)},clearAll:function(){return n().clear()}}},728:function(t){t.exports={name:"memoryStorage",read:function(t){return e[t]},write:function(t,r){e[t]=r},each:function(t){for(var r in e)e.hasOwnProperty(r)&&t(e[r],r)},remove:function(t){delete e[t]},clearAll:function(t){e={}}};var e={}}},a={};function n(t){var e=a[t];if(void 0!==e)return e.exports;var i=a[t]={exports:{}};return r[t](i,i.exports,n),i.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==("undefined"==typeof globalThis?"undefined":e(globalThis)))return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==("undefined"==typeof window?"undefined":e(window)))return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(function(){"use strict";n.r(i);var r={};n.r(r),n.d(r,{createStorage:function(){return Dt}});var a={accountId:"",dryRun:!1,debug:!1,fetch:{base:"https://a.vturb.net/",fetch:"x",beacon:"y",gif:"g"},queue:{capacity:5e3,interval:5},retry:{limit:3,initialDelay:100,retryOnResponseStatuses:[400,404,408,500,502,503,504],fallbackToBeacon:!0},unique:!0,cache:{namespace:"cacheHermes",storage:void 0,hashingMethod:"md5",maxAge:36e5}},o=function(){var t,e,r;if("undefined"==typeof window||!window.screen)return{};for(var a=["height","width","colorDepth","pixelDepth","availHeight","availWidth"],n={},i=0;iwindow.innerHeight?"landscape":"portrait"},n},s=function(){var t,e,r,a,n;if("undefined"==typeof document)return{};var i=document.body||{},o=document.documentElement||{},s={height:null!==(t=window.innerHeight)&&void 0!==t?t:null===(e=document.documentElement)||void 0===e?void 0:e.offsetHeight,width:null!==(r=window.innerWidth)&&void 0!==r?r:null===(a=document.documentElement)||void 0===a?void 0:a.offsetWidth,scrollHeight:null!==(n=Math.max(i.scrollHeight,i.offsetHeight,o.clientHeight,o.scrollHeight,o.offsetHeight))&&void 0!==n?n:void 0};return window.screen&&(s.ratio={height:window.screen.availHeight?parseFloat((window.innerHeight/window.screen.availHeight).toFixed(2)):null,width:window.screen.availWidth?parseFloat((window.innerWidth/window.screen.availWidth).toFixed(2)):null}),s};function l(){var t,e;return document&&"function"==typeof document.querySelector&&(e=document.querySelector('meta[name="description"]')),null!==(t=null==e?void 0:e.content)&&void 0!==t?t:""}var c=function(){return(c=Object.assign||function(t){for(var e,r=1,a=arguments.length;r0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]=a+r?(a=i,[4,f(0)]):[3,3]):[3,4];case 2:o.sent(),o.label=3;case 3:return++n,[3,1];case 4:return[2]}}))}))}function g(t){t.then(void 0,(function(){}))}function b(t,e){t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]],e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]];var r=[0,0,0,0];return r[3]+=t[3]+e[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=t[2]+e[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=t[1]+e[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=t[0]+e[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function w(t,e){t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]],e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]];var r=[0,0,0,0];return r[3]+=t[3]*e[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=t[2]*e[3],r[1]+=r[2]>>>16,r[2]&=65535,r[2]+=t[3]*e[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=t[1]*e[3],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=t[2]*e[2],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=t[3]*e[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=t[0]*e[3]+t[1]*e[2]+t[2]*e[1]+t[3]*e[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function k(t,e){return 32==(e%=64)?[t[1],t[0]]:e<32?[t[0]<>>32-e,t[1]<>>32-e]:(e-=32,[t[1]<>>32-e,t[0]<>>32-e])}function S(t,e){return 0==(e%=64)?t:e<32?[t[0]<>>32-e,t[1]<>>1]),t=T(t=w(t,[4283543511,3981806797]),[0,t[0]>>>1]),T(t=w(t,[3301882366,444984403]),[0,t[0]>>>1])}function E(t){return parseInt(t)}function L(t){return parseFloat(t)}function _(t,e){return"number"==typeof t&&isNaN(t)?e:t}function A(t){return t.reduce((function(t,e){return t+(e?1:0)}),0)}function R(t,e){if(void 0===e&&(e=1),Math.abs(e)>=1)return Math.round(t/e)*e;var r=1/e;return Math.round(t*r)/r}function C(t){return t&&"object"==e(t)&&"message"in t?t:{message:t}}function D(t){return"function"!=typeof t}function O(t,e,r){var a=Object.keys(t).filter((function(t){return!function(t,e){for(var r=0,a=t.length;r=4}function P(){var t=window,e=navigator;return A(["webkitPersistentStorage"in e,"webkitTemporaryStorage"in e,0===e.vendor.indexOf("Google"),"webkitResolveLocalFileSystemURL"in t,"BatteryManager"in t,"webkitMediaStream"in t,"webkitSpeechGrammar"in t])>=5}function M(){var t=window,e=navigator;return A(["ApplePayError"in t,"CSSPrimitiveValue"in t,"Counter"in t,0===e.vendor.indexOf("Apple"),"getStorageUpdates"in e,"WebKitMediaKeys"in t])>=4}function F(){var t=window;return A(["safari"in t,!("DeviceMotionEvent"in t),!("ongestureend"in t),!("standalone"in navigator)])>=3}function B(){var t=document;return(t.exitFullscreen||t.msExitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen).call(t)}function N(){var t=P(),e=function(){var t,e,r=window;return A(["buildID"in navigator,"MozAppearance"in(null!==(e=null===(t=document.documentElement)||void 0===t?void 0:t.style)&&void 0!==e?e:{}),"onmozfullscreenchange"in r,"mozInnerScreenX"in r,"CSSMozDocumentRule"in r,"CanvasCaptureMediaStream"in r])>=4}();if(!t&&!e)return!1;var r=window;return A(["onorientationchange"in r,"orientation"in r,t&&!("SharedWorker"in r),e&&/android/i.test(navigator.appVersion)])>=2}function U(t){var e=new Error(t);return e.name=t,e}function j(t,e,r){var a,n,i;return void 0===r&&(r=50),u(this,void 0,void 0,(function(){var o,s;return d(this,(function(l){switch(l.label){case 0:o=document,l.label=1;case 1:return o.body?[3,3]:[4,f(r)];case 2:return l.sent(),[3,1];case 3:s=o.createElement("iframe"),l.label=4;case 4:return l.trys.push([4,,10,11]),[4,new Promise((function(t,r){var a=!1,n=function(){a=!0,t()};s.onload=n,s.onerror=function(t){a=!0,r(t)};var i=s.style;i.setProperty("display","block","important"),i.position="absolute",i.top="0",i.left="0",i.visibility="hidden",e&&"srcdoc"in s?s.srcdoc=e:s.src="about:blank",o.body.appendChild(s);!function t(){var e,r;a||("complete"===(null===(r=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===r?void 0:r.readyState)?n():setTimeout(t,10))}()}))];case 5:l.sent(),l.label=6;case 6:return(null===(n=null===(a=s.contentWindow)||void 0===a?void 0:a.document)||void 0===n?void 0:n.body)?[3,8]:[4,f(r)];case 7:return l.sent(),[3,6];case 8:return[4,t(s,s.contentWindow)];case 9:return[2,l.sent()];case 10:return null===(i=s.parentNode)||void 0===i||i.removeChild(s),[7];case 11:return[2]}}))}))}function G(t){for(var e=function(t){for(var e,r,a="Unexpected syntax '".concat(t,"'"),n=/^\s*([a-z-]*)(.*)$/i.exec(t),i=n[1]||void 0,o={},s=/([.:#][\w-]+|\[.+?\])/gi,l=function(t,e){o[t]=o[t]||[],o[t].push(e)};;){var c=s.exec(n[2]);if(!c)break;var u=c[0];switch(u[0]){case".":l("class",u.slice(1));break;case"#":l("id",u.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(!d)throw new Error(a);l(d[1],null!==(r=null!==(e=d[4])&&void 0!==e?e:d[5])&&void 0!==r?r:"");break;default:throw new Error(a)}}return[i,o]}(t),r=e[0],a=e[1],n=document.createElement(null!=r?r:"div"),i=0,o=Object.keys(a);i.6*r.length}))).sort(),[2,n]}var s}))}))},fontPreferences:function(){return function(t,e){return void 0===e&&(e=4e3),j((function(t,r){var a=r.document,n=a.body,i=n.style;i.width="".concat(e,"px"),i.webkitTextSizeAdjust=i.textSizeAdjust="none",P()?n.style.zoom="".concat(1/r.devicePixelRatio):M()&&(n.style.zoom="reset");var o=a.createElement("div");return o.textContent=h([],Array(e/20<<0),!0).map((function(){return"word"})).join(" "),n.appendChild(o),function(t,e){for(var r={},a={},n=0,i=Object.keys(it);n')}()},audio:function(){var t=window,e=t.OfflineAudioContext||t.webkitOfflineAudioContext;if(!e)return-2;if(M()&&!F()&&!function(){var t=window;return A(["DOMRectList"in t,"RTCPeerConnectionIceEvent"in t,"SVGGeometryElement"in t,"ontransitioncancel"in t])>=3}())return-1;var r=new e(1,5e3,44100),a=r.createOscillator();a.type="triangle",a.frequency.value=1e4;var n=r.createDynamicsCompressor();n.threshold.value=-50,n.knee.value=40,n.ratio.value=12,n.attack.value=0,n.release.value=.25,a.connect(n),n.connect(r.destination),a.start(0);var i=function(t){var e=function(){};return[new Promise((function(r,a){var n=!1,i=0,o=0;t.oncomplete=function(t){return r(t.renderedBuffer)};var s=function(){setTimeout((function(){return a(U("timeout"))}),Math.min(500,o+5e3-Date.now()))};(function e(){try{var r=t.startRendering();switch(m(r)&&g(r),t.state){case"running":o=Date.now(),n&&s();break;case"suspended":document.hidden||i++,n&&i>=3?a(U("suspended")):setTimeout(e,500)}}catch(t){a(t)}})(),e=function(){n||(n=!0,o>0&&s())}})),e]}(r),o=i[0],s=i[1],l=o.then((function(t){return function(t){for(var e=0,r=0;r=3||r.push(e.languages);else if("string"==typeof e.languages){var n=e.languages;n&&r.push(n.split(","))}return r},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return _(L(navigator.deviceMemory),void 0)},screenResolution:function(){var t=screen,e=function(t){return _(E(t),null)},r=[e(t.width),e(t.height)];return r.sort().reverse(),r},hardwareConcurrency:function(){return _(E(navigator.hardwareConcurrency),void 0)},timezone:function(){var t,e=null===(t=window.Intl)||void 0===t?void 0:t.DateTimeFormat;if(e){var r=(new e).resolvedOptions().timeZone;if(r)return r}var a,n=(a=(new Date).getFullYear(),-Math.max(L(new Date(a,0,1).getTimezoneOffset()),L(new Date(a,6,1).getTimezoneOffset())));return"UTC".concat(n>=0?"+":"").concat(Math.abs(n))},sessionStorage:function(){try{return!!window.sessionStorage}catch(t){return!0}},localStorage:function(){try{return!!window.localStorage}catch(t){return!0}},indexedDB:function(){var t,e;if(!(I()||(t=window,e=navigator,A(["msWriteProfilerMark"in t,"MSStream"in t,"msLaunchUri"in e,"msSaveBlob"in e])>=3&&!I())))try{return!!window.indexedDB}catch(t){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var t=navigator.platform;return"MacIntel"===t&&M()&&!F()?function(){if("iPad"===navigator.platform)return!0;var t=screen,e=t.width/t.height;return A(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,e>.65&&e<1.53])>=2}()?"iPad":"iPhone":t},plugins:function(){var t=navigator.plugins;if(t){for(var e=[],r=0;r>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)}(function(t){for(var e="",r=0,a=Object.keys(t).sort();r=.001))try{var t=new XMLHttpRequest;t.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(p,"/npm-monitoring"),!0),t.send()}catch(t){console.error(t)}}(),[4,ut(r)];case 1:return t.sent(),[2,dt(O(ot,{debug:a},[]),a)]}}))}))},hashComponents:ct,componentsToDebugString:lt}).load();function ht(){return"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}var pt=ht,ft=function(){return{cookies:void 0!==navigator.cookieEnabled&&navigator.cookieEnabled,codeName:navigator.appCodeName,description:l(),language:navigator.language,name:navigator.appName,online:navigator.onLine,platform:navigator.platform,useragent:navigator.userAgent,version:navigator.appVersion,doNotTrack:navigator.doNotTrack,screen:o(),window:s()}},mt=function(){try{var t=new URLSearchParams(window.location.search),e={};return["utm_source","utm_medium","utm_campaign","utm_term","utm_content"].forEach((function(r){t.has(r)&&(e[r]=t.get(r))})),e}catch(t){return console.error("Error checking utms",t),{}}},yt=function(){function t(t){this.level=t}return t.prototype.debug=function(t){15&this.level&&console.debug(t)},t.prototype.info=function(t){7&this.level&&console.log(t)},t.prototype.warn=function(t){7&this.level&&console.warn(t)},t.prototype.error=function(t){1&this.level&&console.error(t)},t}(),vt=n(148),gt=n.n(vt),bt=n(812),wt=n.n(bt),kt=n(195),St=n.n(kt),Tt=n(580),xt=n.n(Tt),Et=n(627),Lt=n.n(Et),_t=n(728),At=n.n(_t),Rt=[Lt(),xt(),At()],Ct=[gt(),wt()],Dt=function(t,e){var r=St().createStore(Rt,Ct,t);return{get:function(t,e){r.removeExpiredKeys();var a=r.get(t,e);return null==a?null:a},set:function(t,a){return r.set(t,a,Date.now()+e),a}}};function Ot(t,e,r,a,n,i){return Bt(function(t,e){return t<>>32-e}(Bt(Bt(e,t),Bt(a,i)),n),r)}function It(t,e,r,a,n,i,o){return Ot(e&r|~e&a,t,e,n,i,o)}function Pt(t,e,r,a,n,i,o){return Ot(e&a|r&~a,t,e,n,i,o)}function Mt(t,e,r,a,n,i,o){return Ot(e^r^a,t,e,n,i,o)}function Ft(t,e,r,a,n,i,o){return Ot(r^(e|~a),t,e,n,i,o)}function Bt(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}var Nt,Ut=function(t){return function(t){for(var e,r="0123456789ABCDEF",a="",n=0;n>>4&15)+r.charAt(15&e);return a}(function(t){for(var e="",r=0;r<32*t.length;r+=8)e+=String.fromCharCode(t[r>>5]>>>r%32&255);return e}(function(t,e){t[e>>5]|=128<>>9<<4)]=e;for(var r=1732584193,a=-271733879,n=-1732584194,i=271733878,o=0;o>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<0&&this.interval>=this.config.interval||this.capacity>=this.config.capacity},e}(Gt());!function(){function t(t){this.count=t||0}t.prototype.start=function(){var t=this;return this.pause(),this.interval=setInterval((function(){t.count++}),1e3),this},t.prototype.pause=function(){return clearInterval(this.interval),this},t.prototype.value=function(){return this.count},t.prototype.clear=function(){return this.count=0,this}}();var zt=function(t){var e=this.constructor;return this.then((function(r){return e.resolve(t()).then((function(){return r}))}),(function(r){return e.resolve(t()).then((function(){return e.reject(r)}))}))},qt=function(t){return new this((function(r,a){if(!t||void 0===t.length)return a(new TypeError(e(t)+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var n=Array.prototype.slice.call(t);if(0===n.length)return r([]);var i=n.length;function o(t,a){if(a&&("object"==e(a)||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,(function(e){o(t,e)}),(function(e){n[t]={status:"rejected",reason:e},0==--i&&r(n)}))}n[t]={status:"fulfilled",value:a},0==--i&&r(n)}for(var s=0;se}))}var r=le.find((function(e){return t.hash===e.hash}));if(r){if(!(r.expiryTime&&r.expiryTime-1};function ke(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function Se(t){return"string"!=typeof t&&(t=String(t)),t}function Te(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return me&&(e[Symbol.iterator]=function(){return e}),e}function xe(t){this.map={},t instanceof xe?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function Ee(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function Le(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function _e(t){var e=new FileReader,r=Le(e);return e.readAsArrayBuffer(t),r}function Ae(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function Re(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:ye&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:ve&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:fe&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():ge&&ye&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=Ae(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):ge&&(ArrayBuffer.prototype.isPrototypeOf(t)||we(t))?this._bodyArrayBuffer=Ae(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):fe&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},ye&&(this.blob=function(){var t=Ee(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?Ee(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(_e)}),this.text=function(){var t,e,r,a=Ee(this);if(a)return a;if(this._bodyBlob)return t=this._bodyBlob,r=Le(e=new FileReader),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),a=0;a-1?a:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var i=/([?&])_=[^&]*/;i.test(this.url)?this.url=this.url.replace(i,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function Oe(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),a=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(a),decodeURIComponent(n))}})),e}function Ie(t,e){if(!(this instanceof Ie))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new xe(e.headers),this.url=e.url||"",this._initBody(t)}De.prototype.clone=function(){return new De(this,{body:this._bodyInit})},Re.call(De.prototype),Re.call(Ie.prototype),Ie.prototype.clone=function(){return new Ie(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new xe(this.headers),url:this.url})},Ie.error=function(){var t=new Ie(null,{status:0,statusText:""});return t.type="error",t};var Pe=[301,302,303,307,308];Ie.redirect=function(t,e){if(-1===Pe.indexOf(e))throw new RangeError("Invalid status code");return new Ie(null,{status:e,headers:{location:t}})};var Me=pe.DOMException;try{new Me}catch(r){(Me=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),Me.prototype.constructor=Me}function Fe(t,r){return new Promise((function(a,n){var i=new De(t,r);if(i.signal&&i.signal.aborted)return n(new Me("Aborted","AbortError"));var o=new XMLHttpRequest;function s(){o.abort()}o.onload=function(){var t,e,r={status:o.status,statusText:o.statusText,headers:(t=o.getAllResponseHeaders()||"",e=new xe,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var r=t.split(":"),a=r.shift().trim();if(a){var n=r.join(":").trim();e.append(a,n)}})),e)};r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var n="response"in o?o.response:o.responseText;setTimeout((function(){a(new Ie(n,r))}),0)},o.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},o.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},o.onabort=function(){setTimeout((function(){n(new Me("Aborted","AbortError"))}),0)},o.open(i.method,function(t){try{return""===t&&pe.location.href?pe.location.href:t}catch(e){return t}}(i.url),!0),"include"===i.credentials?o.withCredentials=!0:"omit"===i.credentials&&(o.withCredentials=!1),"responseType"in o&&(ye?o.responseType="blob":ge&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(o.responseType="arraybuffer")),!r||"object"!=e(r.headers)||r.headers instanceof xe?i.headers.forEach((function(t,e){o.setRequestHeader(e,t)})):Object.getOwnPropertyNames(r.headers).forEach((function(t){o.setRequestHeader(t,Se(r.headers[t]))})),i.signal&&(i.signal.addEventListener("abort",s),o.onreadystatechange=function(){4===o.readyState&&i.signal.removeEventListener("abort",s)}),o.send(void 0===i._bodyInit?null:i._bodyInit)}))}Fe.polyfill=!0,pe.fetch||(pe.fetch=Fe,pe.Headers=xe,pe.Request=De,pe.Response=Ie);var Be="REQUEST_FALLBACK",Ne=function(){return(Ne=Object.assign||function(t){for(var e,r=1,a=arguments.length;r0?f():i(t)})).catch((function(t){if(t.code===DOMException.ABORT_ERR)return a("REQUEST_ABORTED");o>0?f():i(t)}))};function f(){u+=1,setTimeout((function(){p(o-u)}),2^u*s)}p(o-u)}));return p.abort=function(){n.abort()},p}var je=function(){return(je=Object.assign||function(t){for(var e,r=1,a=arguments.length;r0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]=0)return;o[e]="set-cookie"===e?(o[e]?o[e]:[]).concat([r]):o[e]?o[e]+", "+r:r}})),o):o}},function(t,e,r){"use strict";var a=r(0);t.exports=a.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var a=t;return e&&(r.setAttribute("href",a),a=r.href),r.setAttribute("href",a),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=n(window.location.href),function(e){var r=a.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},function(t,e,r){"use strict";var a=r(17);function n(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;t((function(t){r.reason||(r.reason=new a(t),e(r.reason))}))}n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.source=function(){var t;return{token:new n((function(e){t=e})),cancel:t}},t.exports=n},function(t,e,r){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,r){"use strict";r.r(e);var a=r(18),n=r.n(a),i=r(5),o={insert:"head",singleton:!1},s=(n()(i.a,o),i.a.locals,r(1));function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};c(this,t),this.hls=null,this.video=e,this.player=r,this.options=h(h({},m),a),this.resolutions=[],this.optionsSmartAutoPlay=h(h({},this.options),{},{maxBufferLength:8,maxMaxBufferLength:8}),window.Hls.isSupported()?this.init():this.video.src=this.player.options.video.url}var e,r,a;return e=t,(r=[{key:"getLevelfromVideoWidth",value:function(){var t=this.player.container.getBoundingClientRect().width;return this.resolutions.map((function(e,r){var a=e.width,n=parseFloat(t)/parseFloat(a);return[e,n>=1?n-1:-1*(n-1),r,a,t,n]})).sort((function(t,e){return t[1]-e[1]}))[0][2]}},{key:"init",value:function(){var t=this;"smartplay"===this.player.options.autoplay?(this.hls=new window.Hls(this.optionsSmartAutoPlay),this.player.on("smartplay_play",(function(){t.hls.config.maxBufferLength=t.options.maxBufferLength,t.hls.config.maxMaxBufferLength=t.options.maxMaxBufferLength}))):this.hls=new window.Hls(this.options),this.player.plugins.hls=this.hls,this.player.on("online",(function(){t.hls.startLoad()})),this.player.on("destroy",(function(){t.hls.destroy(),delete t.player.plugins.hls})),this.hls.on(window.Hls.Events.MANIFEST_PARSED,(function(e,r){var a=r.levels;t.resolutions=a;var n=t.getLevelfromVideoWidth();t.hls.autoLevelCapping=n})),this.hls.loadSource(this.player.options.video.url),this.hls.attachMedia(this.video)}}])&&u(e.prototype,r),a&&u(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();function v(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return g(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var a=0,n=function(){};return{s:n,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:n}}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 i,o=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){s=!0,i=t},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,a=new Array(e);r0?[e,r,a]:[r,a]).map((function(t){return t<10?"0"+t:""+t})).join(":")},getElementViewLeft:function(t){var e=t.offsetLeft,r=t.offsetParent,a=document.body.scrollLeft+document.documentElement.scrollLeft;if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement)for(;null!==r&&r!==t;)e+=r.offsetLeft,r=r.offsetParent;else for(;null!==r;)e+=r.offsetLeft,r=r.offsetParent;return e-a},getBoundingClientRectViewLeft:function(t){var e=window.scrollY||window.pageYOffset||document.body.scrollTop+(document.documentElement&&document.documentElement.scrollTop||0);if(t.getBoundingClientRect){if("number"!=typeof this.getBoundingClientRectViewLeft.offset){var r=document.createElement("div");r.style.cssText="position:absolute;top:0;left:0;",document.body.appendChild(r),this.getBoundingClientRectViewLeft.offset=-r.getBoundingClientRect().top-e,document.body.removeChild(r),r=null}var a=t.getBoundingClientRect(),n=this.getBoundingClientRectViewLeft.offset;return a.left+n}return this.getElementViewLeft(t)},getScrollPosition:function(){return{left:window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0,top:window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}},setScrollPosition:function(t){var e=t.left,r=void 0===e?0:e,a=t.top,n=void 0===a?0:a;this.isFirefox?(document.documentElement.scrollLeft=r,document.documentElement.scrollTop=n):window.scrollTo(r,n)},isMobile:b,isFirefox:/firefox/i.test(window.navigator.userAgent),isChrome:/chrome/i.test(window.navigator.userAgent),storage:{set:function(t,e){localStorage.setItem(t,e)},get:function(t){return localStorage.getItem(t)}},nameMap:{dragStart:b?"touchstart":"mousedown",dragMove:b?"touchmove":"mousemove",dragEnd:b?"touchend":"mouseup"},uniqID:function(){return"uid_".concat(Math.floor(Math.random()*Date.now()),"_").concat(++k)},color2Number:function(t){return"#"===t[0]&&(t=t.substr(1)),3===t.length&&(t="".concat(t[0]).concat(t[0]).concat(t[1]).concat(t[1]).concat(t[2]).concat(t[2])),parseInt(t,16)+0&16777215},number2Color:function(t){return"#"+("00000"+t.toString(16)).slice(-6)},number2Type:function(t){switch(t){case 0:return"right";case 1:return"top";case 2:return"bottom";default:return"right"}},checkLocalStorage:function(){try{if(localStorage.setItem("feature_test","yes"),"yes"===localStorage.getItem("feature_test"))return localStorage.removeItem("feature_test"),!0}catch(t){return!1}return!1},cookieSet:function(t,e,r){t=["".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e))],r&&("expiry"in r&&("number"==typeof r.expiry&&(r.expiry=new Date(1e3*r.expiry+ +new Date)),t.push("expires=".concat(r.expiry.toGMTString()))),"domain"in r&&t.push("domain=".concat(r.domain)),"path"in r&&t.push("path=".concat(r.path)),"secure"in r&&r.secure&&t.push("secure")),document.cookie=t.join("; ")},cookieGet:function(t,e){for(var r=[],a=document.cookie.split(/; */),n=0;n=Date.now()?a.uuid:w()}catch(t){e=w()}try{localStorage.setItem("vturb.session",JSON.stringify({uuid:e,expires:Date.now()+432e5}))}catch(t){console.log("vturb cannot set data in localstorage")}return t.options.session_id=e,e},removeSmartPlay:function(t){t.smartAutoPlay=!1,t.container.classList.remove("smartplayer-smart-auto-play"),t.container.classList.remove("smartplayer-show-smart-auto-play"),t.template.smartPlay.remove(),t.seek(0),t.volume(100),t.events.trigger("smartplay_play"),t.events.trigger("play"),t.video.paused&&Promise.resolve(t.video.play()).catch((function(){setTimeout((function(){t.video.play()}),100)}))},canUseScale:function(){try{return CSS.supports("scale: 0.5")}catch(t){return console.error(t),!1}},chooseRandomEntry:function(t,e,r){var a,n=t.reduce((function(t,e){return t+e.weight}),0),i=Math.random()*n,o=v(t);try{for(o.s();!(a=o.n()).done;){var s=a.value;if((i-=s.weight)<=0)return s[e]}}catch(t){o.e(t)}finally{o.f()}return r}};var T={en:{"Powered by Vturb":"Powered by Vturb"},"pt-br":{"Powered by Vturb":"Conheça o Vturb"},"zh-cn":{Top:"顶部",Bottom:"底部",Rolling:"滚动","About author":"关于作者","SmartPlayer feedback":"播放器意见反馈","About SmartPlayer":"关于 SmartPlayer 播放器",Loop:"洗脑循环",Speed:"速度",Normal:"正常","Video load failed":"视频加载失败","Switching to":"正在切换至","Switched to":"已经切换至",quality:"画质",FF:"快进",REW:"快退",Setting:"设置","Full screen":"全屏","Web full screen":"页面全屏",Send:"发送",Screenshot:"截图",AirPlay:"无线投屏",s:"秒","Show subtitle":"显示字幕","Hide subtitle":"隐藏字幕",Volume:"音量",Live:"直播","Video info":"视频统计信息"},"zh-tw":{Top:"頂部",Bottom:"底部",Rolling:"滾動","About author":"關於作者","SmartPlayer feedback":"播放器意見回饋","About SmartPlayer":"關於 SmartPlayer 播放器",Loop:"循環播放",Speed:"速度",Normal:"正常","Video load failed":"影片載入失敗","Switching to":"正在切換至","Switched to":"已經切換至",quality:"畫質",FF:"快進",REW:"快退",Setting:"設定","Full screen":"全螢幕","Web full screen":"頁面全螢幕",Send:"發送",Screenshot:"截圖",AirPlay:"無線投屏",s:"秒","Show subtitle":"顯示字幕","Hide subtitle":"隱藏字幕",Volume:"音量",Live:"直播","Video info":"影片統計訊息"}},x=function(t){var e=this;this.lang=t,this.tran=function(t){return T[e.lang]&&T[e.lang][t]?T[e.lang][t]:t}},E=r(22),L=r.n(E),_=r(23),A=r.n(_),R=r(24),C=r.n(R),D=r(25),O=r.n(D),I=r(26),P=r.n(I),M=r(27),F=r.n(M),B=r(28),N=r.n(B),U=r(29),j=r.n(U),G=r(30),H=r.n(G),V=r(31),Y=r.n(V),z=r(32),q=r.n(z),W=r(33),K=r.n(W),X=r(34),Z=r.n(X),J=r(35),Q=r.n(J),$=r(36),tt=r.n($),et=r(37),rt=r.n(et),at=r(38),nt=r.n(at),it=r(39),ot=r.n(it),st=r(40),lt=r.n(st),ct=r(41),ut=r.n(ct),dt=r(42),ht=r.n(dt),pt=r(43),ft=r.n(pt),mt=r(44),yt=r.n(mt),vt={play:L.a,pause:A.a,seekRewind:ot.a,seekForward:lt.a,volumeUp:C.a,volumeDown:O.a,volumeOff:P.a,full:F.a,fullWeb:N.a,setting:j.a,right:H.a,comment:Y.a,commentOff:q.a,send:K.a,pallette:Z.a,camera:Q.a,subtitle:rt.a,loading:nt.a,airplay:tt.a,synchronizeRewind:ut.a,synchronizeForward:ht.a,warning:ft.a,vturb:yt.a},gt=r(45),bt=r.n(gt);function wt(t){return(wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kt(t,e){for(var r=0;r-1&&this.events[t].splice(r,1)}}},{key:"trigger",value:function(t,e){if(this.events[t]&&this.events[t].length)for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"browser";switch(t){case"browser":return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement;case"web":return this.player.container.classList.contains("smartplayer-fulled")}}},{key:"canDoFullscreenOnContent",value:function(){return this.player.container.requestFullscreen||this.player.container.mozRequestFullScreen||this.player.container.webkitRequestFullscreen||this.player.container.msRequestFullscreen}},{key:"requestFullscreenBrowser",value:function(){this.player.container.requestFullscreen?this.player.container.requestFullscreen():this.player.container.mozRequestFullScreen?this.player.container.mozRequestFullScreen():this.player.container.webkitRequestFullscreen?this.player.container.webkitRequestFullscreen():this.player.container.msRequestFullscreen?this.player.container.msRequestFullscreen():this.player.video.webkitEnterFullscreen?this.player.video.webkitEnterFullscreen():this.player.video.webkitEnterFullScreen&&this.player.video.webkitEnterFullScreen()}},{key:"request",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"browser";if("web"==t&&this.canDoFullscreenOnContent()&&(t="browser"),this.player.options.displays.fullscreen){var e="browser"===t?"web":"browser",r=this.isFullScreen(e);switch(r||(this.lastScrollPosition=S.getScrollPosition()),this.nextSibling=this.player.container.nextElementSibling,this.parentElement=this.player.container.parentElement,document.body.appendChild(this.player.container),t){case"browser":this.requestFullscreenBrowser();break;case"web":this.isIframe&&this.requestFullscreenBrowser(),this.player.container.classList.add("smartplayer-fulled"),document.body.classList.add("smartplayer-web-fullscreen-fix"),this.player.events.trigger("webfullscreen")}r&&this.cancel(e)}}},{key:"returnPosition",value:function(){this.parentElement&&(this.nextSibling?this.parentElement.insertBefore(this.player.container,this.nextSibling):this.parentElement.appendChild(this.player.container),this.parentElement=null)}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"browser";switch(this.returnPosition(),t){case"browser":document.cancelFullScreen?document.cancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.webkitCancelFullscreen?document.webkitCancelFullscreen():document.msCancelFullScreen?document.msCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen();break;case"web":this.player.container.classList.remove("smartplayer-fulled"),document.body.classList.remove("smartplayer-web-fullscreen-fix"),this.player.events.trigger("webfullscreen_cancel")}}},{key:"toggle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"browser";this.isFullScreen("browser")?this.cancel("browser"):this.isFullScreen("web")?this.cancel("web"):this.request(t)}}])&&_t(e.prototype,r),a&&_t(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Rt(t){return(Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ct(t,e){for(var r=0;r".concat(t,"

")})).join("");t.container.innerHTML=n}t.events.trigger("subtitle_change")}}}},{key:"show",value:function(){this.container.classList.remove("smartplayer-subtitle-hide"),this.events.trigger("subtitle_show")}},{key:"hide",value:function(){this.container.classList.add("smartplayer-subtitle-hide"),this.events.trigger("subtitle_hide")}},{key:"toggle",value:function(){this.container.classList.contains("smartplayer-subtitle-hide")?this.show():this.hide()}}])&&Ct(e.prototype,r),a&&Ct(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ot(t){return(Ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function It(t,e){for(var r=0;r3||e<2?2:e:2}catch(t){return 2}}}])&&Ft(e.prototype,r),a&&Ft(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Nt(t){return(Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ut(t,e){for(var r=0;re&&!t.player.video.paused&&(t.player.container.classList.remove("smartplayer-loading"),a=!1,t.player.events.trigger("finishLoading")),e=r)}),100)}},{key:"initfpsChecker",value:function(){var t=this;window.requestAnimationFrame((function(){if(t.enablefpsChecker)if(t.initfpsChecker(),t.fpsStart){t.fpsIndex++;var e=new Date;e-t.fpsStart>1e3&&(t.player.infoPanel.fps(t.fpsIndex/(e-t.fpsStart)*1e3),t.fpsStart=new Date,t.fpsIndex=0)}else t.fpsStart=new Date,t.fpsIndex=0;else t.fpsStart=0,t.fpsIndex=0}))}},{key:"initinfoChecker",value:function(){var t=this;this.infoChecker=setInterval((function(){t.enableinfoChecker&&t.player.infoPanel.update()}),1e3)}},{key:"enable",value:function(t){this["enable".concat(t,"Checker")]=!0,"fps"===t&&this.initfpsChecker()}},{key:"disable",value:function(t){this["enable".concat(t,"Checker")]=!1}},{key:"destroy",value:function(){var t=this;this.types.map((function(e){return t["enable".concat(e,"Checker")]=!1,t["".concat(e,"Checker")]&&clearInterval(t["".concat(e,"Checker")]),e}))}}])&&Ut(e.prototype,r),a&&Ut(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Gt(t){return(Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ht(t,e){for(var r=0;r'+t.player.options.highlight[r].text+"",t.player.template.playedBarWrap.insertBefore(a,t.player.template.playedBarTime)}}}))}},{key:"initThumbnails",value:function(){var t=this;this.player.options.video.thumbnails&&(this.thumbnails=new qt({container:this.player.template.barPreview,barWidth:this.player.template.barWrap.offsetWidth,url:this.player.options.video.thumbnails,events:this.player.events}),this.player.on("loadedmetadata",(function(){t.thumbnails.resize(160,t.player.video.videoHeight/t.player.video.videoWidth*160,t.player.template.barWrap.offsetWidth)})))}},{key:"initPlayedBar",value:function(){var t=this;if(this.player.options.displays.seekbar){var e=function(e){var r=((e.clientX||e.changedTouches[0].clientX)-S.getBoundingClientRectViewLeft(t.player.template.playedBarWrap))/t.player.template.playedBarWrap.clientWidth;r=Math.max(r,0),r=Math.min(r,1),t.player.bar.set("played",r,"width");var a=t.calculateCurrentTime(r);t.player.template.ptime.innerHTML=S.secondToTime(a)},r=function r(a){document.removeEventListener(S.nameMap.dragEnd,r),document.removeEventListener(S.nameMap.dragMove,e);var n=((a.clientX||a.changedTouches[0].clientX)-S.getBoundingClientRectViewLeft(t.player.template.playedBarWrap))/t.player.template.playedBarWrap.clientWidth;n=Math.max(n,0),n=Math.min(n,1),t.player.bar.set("played",n,"width"),t.player.seek(t.player.bar.get("played")*t.player.video.duration),t.player.timer.enable("progress")};this.player.template.playedBarWrap.addEventListener(S.nameMap.dragStart,(function(){t.player.timer.disable("progress"),document.addEventListener(S.nameMap.dragMove,e),document.addEventListener(S.nameMap.dragEnd,r)})),this.player.template.playedBarWrap.addEventListener(S.nameMap.dragMove,(function(e){if(t.player.video.duration){var r=t.player.template.playedBarWrap.getBoundingClientRect().left,a=(e.clientX||e.changedTouches[0].clientX)-r;if(a<0||a>t.player.template.playedBarWrap.offsetWidth)return;var n=t.calculatePlayedBarTime(a);S.isMobile&&t.thumbnails&&t.thumbnails.show(),t.thumbnails&&t.thumbnails.move(a),t.player.options.displays.seekbar_time&&(t.player.template.playedBarTime.style.left="".concat(a-(n>=3600?25:20),"px"),t.player.template.playedBarTime.innerText=S.secondToTime(n),t.player.template.playedBarTime.classList.remove("smartplayer-hidden"))}})),this.player.template.playedBarWrap.addEventListener(S.nameMap.dragEnd,(function(){S.isMobile&&t.thumbnails&&t.thumbnails.hide()})),S.isMobile||(this.player.template.playedBarWrap.addEventListener("mouseenter",(function(){t.player.video&&t.player.video.duration&&(t.thumbnails&&t.thumbnails.show(),t.player.options.displays.seekbar_time&&t.player.template.playedBarTime.classList.remove("smartplayer-hidden"))})),this.player.template.playedBarWrap.addEventListener("mouseleave",(function(){t.player.video&&t.player.video.duration&&(t.thumbnails&&t.thumbnails.hide(),t.player.options.displays.seekbar_time&&t.player.template.playedBarTime.classList.add("smartplayer-hidden"))})))}}},{key:"calculatePlayedBarTime",value:function(t){var e=this.player.video.duration*(t/this.player.template.playedBarWrap.offsetWidth);return this.player.turbo&&this.player.turbo.chosenSpeed?e/this.player.turbo.chosenSpeed:e}},{key:"calculateCurrentTime",value:function(t){var e=t*this.player.video.duration;return this.player.turbo&&this.player.turbo.chosenSpeed?e/this.player.turbo.chosenSpeed:e}},{key:"initFullButton",value:function(){var t=this;this.player.template.browserFullButton&&this.player.template.browserFullButton.addEventListener("click",(function(){t.player.fullScreen.toggle("browser")})),this.player.template.webFullButton&&this.player.template.webFullButton.addEventListener("click",(function(){t.player.fullScreen.toggle("web")}))}},{key:"initVolumeButton",value:function(){var t=this;if(this.player.options.displays.volume){if(this.player.template.volumeBarWrapWrap){var e=function(e){var r=e||window.event,a=((r.clientX||r.changedTouches[0].clientX)-S.getBoundingClientRectViewLeft(t.player.template.volumeBarWrap)-5.5)/35;t.player.volume(a)},r=function r(){document.removeEventListener(S.nameMap.dragEnd,r),document.removeEventListener(S.nameMap.dragMove,e),t.player.template.volumeButton.classList.remove("smartplayer-volume-active")};this.player.template.volumeBarWrapWrap.addEventListener("click",(function(e){var r=e||window.event,a=((r.clientX||r.changedTouches[0].clientX)-S.getBoundingClientRectViewLeft(t.player.template.volumeBarWrap)-5.5)/35;t.player.volume(a)})),this.player.template.volumeBarWrapWrap.addEventListener(S.nameMap.dragStart,(function(){document.addEventListener(S.nameMap.dragMove,e),document.addEventListener(S.nameMap.dragEnd,r),t.player.template.volumeButton.classList.add("smartplayer-volume-active")}))}this.player.template.volumeButtonIcon.addEventListener("click",(function(){t.player.video.muted?(t.player.video.muted=!1,t.player.switchVolumeIcon(),t.player.bar.set("volume",t.player.volume(),"width")):(t.player.video.muted=!0,t.player.template.volumeIcon.innerHTML=vt.volumeOff,t.player.bar.set("volume",0,"width"))}))}}},{key:"initQualityButton",value:function(){var t=this;this.player.options.video.quality&&this.player.template.qualityList.addEventListener("click",(function(e){e.target.classList.contains("smartplayer-quality-item")&&t.player.switchQuality(e.target.dataset.index)}))}},{key:"initScreenshotButton",value:function(){var t=this;this.player.options.screenshot&&this.player.template.camareButton.addEventListener("click",(function(){var e,r=document.createElement("canvas");r.width=t.player.video.videoWidth,r.height=t.player.video.videoHeight,r.getContext("2d").drawImage(t.player.video,0,0,r.width,r.height),r.toBlob((function(t){e=URL.createObjectURL(t);var r=document.createElement("a");r.href=e,r.download="smartplayer.png",r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(e)})),t.player.events.trigger("screenshot",e)}))}},{key:"initAirplayButton",value:function(){this.player.options.airplay&&(window.WebKitPlaybackTargetAvailabilityEvent?this.player.video.addEventListener("webkitplaybacktargetavailabilitychanged",function(t){switch(t.availability){case"available":this.template.airplayButton.disable=!1;break;default:this.template.airplayButton.disable=!0}this.template.airplayButton.addEventListener("click",function(){this.video.webkitShowPlaybackTargetPicker()}.bind(this))}.bind(this.player)):this.player.template.airplayButton.style.display="none")}},{key:"initSubtitleButton",value:function(){var t=this;this.player.options.subtitle&&(this.player.events.on("subtitle_show",(function(){t.player.template.subtitleButton.dataset.balloon=t.player.tran("Hide subtitle"),t.player.template.subtitleButtonInner.style.opacity=""})),this.player.events.on("subtitle_hide",(function(){t.player.template.subtitleButton.dataset.balloon=t.player.tran("Show subtitle"),t.player.template.subtitleButtonInner.style.opacity="0.4"})),this.player.template.subtitleButton.addEventListener("click",(function(){t.player.subtitle.toggle()})))}},{key:"setAutoHide",value:function(){var t=this;this.show(),clearTimeout(this.autoHideTimer),this.autoHideTimer=setTimeout((function(){t.player.video&&t.player.video.played.length&&!t.player.paused&&!t.disableAutoHide&&t.hide()}),3e3)}},{key:"show",value:function(){!this.player.smartAutoPlay&&this.player.wasPlayed&&this.player.container.classList.remove("smartplayer-hide-controller")}},{key:"hide",value:function(){this.player.container.classList.add("smartplayer-hide-controller"),this.player.setting.hide(),this.player.comment&&this.player.comment.hide()}},{key:"isShow",value:function(){return!this.player.container.classList.contains("smartplayer-hide-controller")}},{key:"toggle",value:function(){this.isShow()?this.hide():this.show()}},{key:"destroy",value:function(){clearTimeout(this.autoHideTimer)}}])&&Kt(e.prototype,r),a&&Kt(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Zt(t){return(Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jt(t,e){for(var r=0;r=r.width?(this.player.template.menu.style.right=r.width-t+"px",this.player.template.menu.style.left="initial"):(this.player.template.menu.style.left=t+"px",this.player.template.menu.style.right="initial"),e+this.player.template.menu.offsetHeight>=r.height?(this.player.template.menu.style.bottom=r.height-e+"px",this.player.template.menu.style.top="initial"):(this.player.template.menu.style.top=e+"px",this.player.template.menu.style.bottom="initial"),this.player.template.mask.classList.add("smartplayer-mask-show"),this.shown=!0,this.player.events.trigger("contextmenu_show")}}},{key:"hide",value:function(){this.player.template.mask.classList.remove("smartplayer-mask-show"),this.player.template.menu.classList.remove("smartplayer-menu-show"),this.shown=!1,this.player.events.trigger("contextmenu_hide")}}]),t}();function de(t){return(de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function he(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:0;if(this.player.video.paused){var r=this.player.video.duration;isNaN(r)&&(r=30),e>=r&&(e=0),this.forceAutoPlayTimeout=setTimeout((function(){t.player.seek(e+.1),t.forceAutoPlay(e+.1)}),60)}}},{key:"muted",value:function(){var t=this;this.player.container.classList.add("smartplayer-smart-auto-play");var e=this.player.video.muted;this.player.video.muted="muted";return s.a.resolve(this.player.video.play()).then((function(){return t.customAutoPlay()})).catch((function(){t.player.video.muted=e,t.times<5?setTimeout((function(){t.player.video.currentTime<=.01&&t.init()}),50):(t.customAutoPlay(),t.forceAutoPlay(t.smartplay_options.start_at))}))}},{key:"removeSmartPlay",value:function(){this.forceAutoPlayTimeout&&clearTimeout(this.forceAutoPlayTimeout),this.player.off("timeupdate",this.customAutoPlayTimeEvent),this.player.volume(0),S.removeSmartPlay(this.player)}},{key:"customAutoPlayTimeEvent",value:function(){this.player.video.currentTime>=this.smartplay_options.end_at&&(this.forceAutoPlayTimeout?(clearTimeout(this.forceAutoPlayTimeout),this.forceAutoPlay(this.smartplay_options.start_at)):this.player.seek(this.smartplay_options.start_at))}},{key:"customAutoPlay",value:function(){null!==this.smartplay_options.end_at&&0!==this.smartplay_options.end_at&&(this.player.seek(this.smartplay_options.start_at),this.player.on("timeupdate",this.customAutoPlayTimeEvent))}},{key:"init",value:function(){if(this.times+=1,this.player.options.preview)return this.muted();!0!==this.player.video.muted&&"muted"!==this.player.video.muted?s.a.resolve(this.player.video.play()).then(this.removeSmartPlay).catch(this.muted):this.player.video.play()}}]),t}();function fe(t){return(fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function me(t,e){for(var r=0;r0&&void 0!==arguments[0]&&arguments[0];if(!t.player.smartAutoPlay&&!t.player.inResume){var r=Math.round(t.player.video.currentTime);if((r-=r%t.timeControlDelay)=0){var e=document.createElement("div"),r=document.createElement("img");return this.setImageAttributes(r),this.setHeadlineElInitialAttributes(e,t),this.addImageEvents(e,r),e.appendChild(r),t.container.parentElement.insertBefore(e,t.container),e}}},{key:"setHeadlineElAttributes",value:function(t){t.setAttribute("style","text-align:center;margin-bottom:30px;width: 100%;")}},{key:"setHeadlineElInitialAttributes",value:function(t){t.setAttribute("style","text-align:center;margin-bottom:30px;"),t.id=this.headline_data.id,t.classList.add("smartplayer-headline")}},{key:"addImageEvents",value:function(t,e){var r=this;e.addEventListener("load",(function(){r.setHeadlineElAttributes(t)}))}},{key:"setImageAttributes",value:function(t){if(this.headline_data.is_responsive&&S.isMobile)t.setAttribute("src",this.headline_data.url_mobile);else{var e=this.headline_data.url_desktop||this.headline_data.url_mobile;t.setAttribute("src",e)}t.setAttribute("style","background-color: transparent;max-width: 100%;"),t.id="vturb-headline-image"}},{key:"getHeadlineData",value:function(){var t,e=this;return(t=this.player.options.headlines.find((function(t){return t.number==e.player.options.headline_number})))||(t=this.player.options.headlines[0]),t}},{key:"hermesV2",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.player&&this.player.analytics&&this.player.analytics.hermesV2&&this.player.analytics.hermesV2.event(t,e)}}],[{key:"filterHeadlines",value:function(t){return t.filter((function(t){return t.active}))}},{key:"shouldLoadHeadline",value:function(e){return!!e.headline&&(!!e.headlines&&!!t.filterHeadlines(e.headlines).length)}}]),t}();function _e(t){return(_e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ae(t,e){for(var r=0;r0&&(t=this.player.options.turbos.filter((function(t){return t.active}))),t}},{key:"setSpeed",value:function(){if(this.turbo_auto_test){var t=this.filterSpeeds();this.player.options.turbo&&t.length>0&&(this.chosenSpeed=S.chooseRandomEntry(t,"speed",1))}else this.chosenSpeed=this.turbo_speed?this.turbo_speed:1}},{key:"hermesV2",value:function(){this.shouldSendData()&&this.player.analytics.hermesV2.event("turbo",{speed:this.chosenSpeed})}},{key:"shouldSendData",value:function(){return this.player&&this.player.analytics&&this.player.analytics.hermesV2&&!this.player.options.preview&&this.player.options.turbo_auto_test}}]),t}(),Ce=r(46),De=r.n(Ce),Oe="URLSearchParams"in window?window.URLSearchParams:De.a;function Ie(t){return(Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pe(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Me(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Me(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var a=0,n=function(){};return{s:n,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:n}}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 i,o=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){s=!0,i=t},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}function Me(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,a=new Array(e);r0&&(this.onSeek=this.onSeek.bind(this),this.onDestroy=this.onDestroy.bind(this),this.callActions=e.options.callAction.map((function(t){var e=null;e=t.type&&"inner_button"!==t.type?r.insertButtonBelow(t):document.getElementById(t.id),r.addUtmTransferClass(e);var a=e.querySelector(".smartplayer-call-action--link");return Ge(Ge({},t),{},{el:e,elLink:a,showed:!1})})),this.setEvents()),this.transferUtm()}return function(t,e,r){e&&Ve(t.prototype,e),r&&Ve(t,r),Object.defineProperty(t,"prototype",{writable:!1})}(t,[{key:"insertButtonBelow",value:function(t){var e=document.createElement("div");switch(e.id=t.id,e.classList.add("smartplayer-call-action","smartplayer-hide","smartplayer-call-action__".concat(t.position),"".concat(t.id)),t.type){case"below_button":var r=document.createElement("a");r.href=t.link||"#",r.title=t.btnText,r.target="_parent",r.innerText=t.btnText,r.classList.add("smartplayer-call-action--link");var a="18px";"md"==t.size&&(a="22px"),"lg"==t.size&&(a="26px");var n=document.createElement("style"),i=".smartplayer-call-action.smartplayer-hide {display: none}.smartplayer-call-action.".concat(t.id," {text-align: center;padding: 40px 10px;}.smartplayer-call-action.").concat(t.id," a.smartplayer-call-action--link {background-color: ").concat(t.colors.background,";color: ").concat(t.colors.text,";padding: 1em 3em;display: inline-block;border-radius: 0.4em;font-size: ").concat(a,";line-height: 1;font-weight: 600;box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);text-decoration: none;}.smartplayer-call-action.").concat(t.id," a.smartplayer-call-action--link:hover {background-color: ").concat(t.colors.background_hover,";color: ").concat(t.colors.text_hover,";text-decoration: none;}");n.innerText=i,e.appendChild(n),e.appendChild(r);break;case"custom_html":var o=document.createRange().createContextualFragment(t.custom_html||""),s=document.createElement("style");s.innerText=".smartplayer-call-action.smartplayer-hide {display: none}",e.appendChild(s),e.appendChild(o)}return S.insertAfter(this.player.container,e),e}},{key:"checkCallAction",value:function(t,e){!t.showed&&t.range.starte?(t.showed=!0,t.el&&t.el.classList.remove("smartplayer-hide")):t.showed&&(t.range.start>e||t.range.finish5&&this.set(t)}}},{key:"setEvents",value:function(){this.onSeek=this.onSeek.bind(this),this.player.on("timeupdate",this.onSeek)}},{key:"get",value:function(){return this.hasLocalstorage?window.localStorage.getItem(this.id):S.cookieGet(this.id)}},{key:"set",value:function(t){return this.hasLocalstorage?window.localStorage.setItem(this.id,t):S.cookieSet(this.id,t)}}]),t}();function Ze(t){return(Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Je(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:null;window.fbq&&"function"==typeof window.fbq||this.initFbPixel(),window.fbq("trackSingleCustom",t.pixel_id,e||t.pixel_value)}},{key:"initFbPixel",value:function(){var t,e,r,a,n,i;t=window,e=document,r="script",t.fbq||(a=t.fbq=function(){a.callMethod?a.callMethod.apply(a,arguments):a.queue.push(arguments)},t._fbq||(t._fbq=a),a.push=a,a.loaded=!0,a.version="2.0",a.queue=[],(n=e.createElement(r)).async=!0,n.src="",(i=e.getElementsByTagName(r)[0]).parentNode.insertBefore(n,i)),this.pixels.forEach((function(t){"facebook"===t.type&&window.fbq("init",t.pixel_id)})),window.fbq("track","PageView")}},{key:"initGooglePixel",value:function(){var t=window.gtag&&"function"==typeof window.gtag,e=window.dataLayer&&"function"==typeof window.dataLayer.push;t||e||(window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),this.pixels.forEach((function(t){"google"===t.type&&(window.dataLayer.find((function(e){return e&&e.config&&e.config.send_to===t.pixel_id}))||(window.gtag("config",t.pixel_id),document.head.innerHTML+='