# webappsstore2

originKey: rb.moc.lou.saiciton.:https:443
scope: rb.moc.lou.saiciton.:https:443
key: UOLPlayer-watchdog
value:
  {"url":"//player.mais.uol.com.br/js/uolplayer.watchdog.min.js?v=2.1.51","key":"watchdog","type":"javascript","checksum":"watchdog","crossOrigin":"anonymous","size":3767,"crc32":622701347,"createdAt":1553026068971,"data":"try{window.UOLPlayerWatchDog=function(){},window.UOLPlayerWatchDogCounter=0,window.UOLPlayerWatchDogMaxDispatch=window.UOLPlayer&&(window.UOLPlayer.isIOS||window.UOLPlayer.isSafariMacOS)?10:3,UOLPlayerWatchDog.prototype.watch=function(){if(\"function\"==typeof window.onerror){var o=window.onerror,e=this;window.onerror=function(){var r=Array.prototype.slice.call(arguments);o.apply(null,r),e.listener.apply(e,r)}}window.addEventListener(\"error\",this.listener.bind(this))},UOLPlayerWatchDog.prototype.listener=function(){var o=Array.prototype.slice.call(arguments),e=this,r=function(){e.process.apply(e,o)};clearTimeout(UOLPlayerWatchDog.timeoutProcess),UOLPlayerWatchDog.timeoutProcess=setTimeout(r,400)},UOLPlayerWatchDog.prototype.process=function(o,e,r,n,t){window.UOLPlayerWatchDogCounter+=1;var i=\"unknow\",a=/^data:text\\/javascript,%2F.%3C%5Buolplayer_(\\w+)%5D%3E.%2F/,s=\"\",c=\"\";t&&\"function\"!=typeof t.substring&&(c=t&&t.stack?t.stack:\"\",r=r||t.line,n=n||t.column,t=JSON.stringify(t)),o&&o.message?(r=r||o.lineno,n=n||o.colno,c=o.error&&o.error.stack?o.error.stack:\"\",e=e||o.filename,o.filename.match(a)&&(i=o.filename.match(a).pop()),o=o.message):\"string\"==typeof e&&e.match(a)&&(i=e.match(a).pop());var l=this.ignoreMatch(e,o,t,c);window.UOLPlayerWatchDogCounter<=window.UOLPlayerWatchDogMaxDispatch&&(c=c.substring(0,4096),this.log(e,i,o,t,c,r,n,s,l))},UOLPlayerWatchDog.prototype.ignoreMatch=function(o,e,r,n){var t=Array.prototype.slice.call(arguments).join(\" \"),i=[/\\.uolCliques-\\d+x\\d+/g,/apis\\.google\\.com/g,/connect\\.facebook\\.net/g,/document.getElementsByClassName.ToString/g,/DOM Exception \\d+/g,/Erro de sintaxe/g,/IMA SDK is either not loaded from a google domain or is not a supported version/g,/jsuol\\.com\\.br/g,/pagead2\\.googlesyndication\\.com/g,/platform\\.twitter\\.com/g,/Script error/g,/Uncaught ReferenceError: vid_mate_check is not defined/g,/Uncaught SyntaxError: Unexpected token/g,/UOLPD.Audience2.countMetrics/g,/window.universal_variable.page.tags.length/g,/'setAttribute'\\s+of\\s+undefined\\s+or\\s+null\\s+reference\\s+at\\s+Anonymous\\s+function\\s+\\(Function\\s+code:2:5\\)/,/'setAttribute'\\s+de\\s+refer.{1,3}ncia\\s+indefinida\\s+ou\\s+nula\\s+at\\s+Anonymous\\s+function\\s+\\(Function\\s+code:2:5\\)/];return i.filter(function(o){return o.test(t)}).length>0},UOLPlayerWatchDog.prototype.log=function(o,e,r,n,t,i,a,s,c){var l=window.UOLPlayer&&window.UOLPlayer.getCookie?window.UOLPlayer.getCookie(\"DNA\")||\"\":\"\";l=l.split(\"|\").shift();var w=\"\";if(window.location.href.indexOf(\"ia_shareURL\")===-1)w=window.parent===window?window.location.href:document.referrer;else{var d=window.location.href.match(/ia_shareURL=([^&])+/);w=d?decodeURIComponent(d.pop):window.parent===window?window.location.href:document.referrer}var g=\"\",u=\"\";window.UOLPlayer&&window.UOLPlayer.info&&(g=window.UOLPlayer.info.browser+\" \"+window.UOLPlayer.info.browserMajorVersion,u=window.UOLPlayer.info.os+\" \"+window.UOLPlayer.info.osVersion,null===u.match(/android 4\\./i)&&null===g.match(/chrome (3\\d|4[0123])/i)||(c=!0));var p=function(o){return\"string\"==typeof o?o:JSON.stringify(o)},y=[{groupingMap:{log:\"watchdog\",dna:l,script:e,scriptUrl:o,error:p(n),message:p(r),line:i,column:a,url:w,browser:g,os:u,ignore:c,stack:p(t),args:p(s),version:window.UOLPlayer&&window.UOLPlayer.version?window.UOLPlayer.version:\"\",iframe:window.parent!==window,userAgent:navigator.userAgent},measureMap:{counter:window.UOLPlayerWatchDogCounter}}],f=new XMLHttpRequest;f.open(\"POST\",\"//logger.uol.com.br/v1/?disp=true&mm=true&prd=935\",!0),f.setRequestHeader(\"Content-Type\",\"application/json\"),f.send(JSON.stringify(y))},window.UOLPlayerWatchDog.instance=new UOLPlayerWatchDog,window.UOLPlayerWatchDog.instance.watch()}catch(__EX__){window.console&&window.console.error&&window.console.error(__EX__)}","skip":false,"stamp":1553026068971,"expire":1571026068971,"updatedAt":1553026068974}


originKey: rb.moc.lou.saiciton.:https:443
scope: rb.moc.lou.saiciton.:https:443
key: UOLPlayer-hls
value:
  {"url":"//player.mais.uol.com.br/js/uolplayer.hls.min.js?v=2.1.51","key":"hls","type":"javascript","checksum":"hls","crossOrigin":"anonymous","size":177377,"crc32":-513395979,"createdAt":1553026071003,"data":"!function(t,e){t.Hls=e()}(this,function(){return function(t){function e(i){if(r[i])return r[i].exports;var a=r[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var r=t&&t.__esModule?function(){return t[\"default\"]}:function(){return t};return e.d(r,\"a\",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p=\"/dist/\",e(e.s=10)}([function(t,e,r){\"use strict\";function i(){}function a(t,e){return e=\"[\"+t+\"] > \"+e}function n(t){var e=f.console[t];return e?function(){for(var r=arguments.length,i=Array(r),n=0;n<r;n++)i[n]=arguments[n];i[0]&&(i[0]=a(t,i[0])),e.apply(f.console,i)}:i}function o(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];r.forEach(function(e){u[e]=t[e]?t[e].bind(t):n(e)})}r.d(e,\"a\",function(){return h}),r.d(e,\"b\",function(){return c});var s=r(4),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},d={trace:i,debug:i,log:i,warn:i,info:i,error:i},u=d,f=Object(s.a)(),h=function(t){if(t===!0||\"object\"===(\"undefined\"==typeof t?\"undefined\":l(t))){o(t,\"debug\",\"log\",\"info\",\"warn\",\"error\");try{u.log()}catch(e){u=d}}else u=d},c=u},function(t,e,r){\"use strict\";var i={MEDIA_ATTACHING:\"hlsMediaAttaching\",MEDIA_ATTACHED:\"hlsMediaAttached\",MEDIA_DETACHING:\"hlsMediaDetaching\",MEDIA_DETACHED:\"hlsMediaDetached\",BUFFER_RESET:\"hlsBufferReset\",BUFFER_CODECS:\"hlsBufferCodecs\",BUFFER_CREATED:\"hlsBufferCreated\",BUFFER_APPENDING:\"hlsBufferAppending\",BUFFER_APPENDED:\"hlsBufferAppended\",BUFFER_EOS:\"hlsBufferEos\",BUFFER_FLUSHING:\"hlsBufferFlushing\",BUFFER_FLUSHED:\"hlsBufferFlushed\",MANIFEST_LOADING:\"hlsManifestLoading\",MANIFEST_LOADED:\"hlsManifestLoaded\",MANIFEST_PARSED:\"hlsManifestParsed\",LEVEL_SWITCHING:\"hlsLevelSwitching\",LEVEL_SWITCHED:\"hlsLevelSwitched\",LEVEL_LOADING:\"hlsLevelLoading\",LEVEL_LOADED:\"hlsLevelLoaded\",LEVEL_UPDATED:\"hlsLevelUpdated\",LEVEL_PTS_UPDATED:\"hlsLevelPtsUpdated\",AUDIO_TRACKS_UPDATED:\"hlsAudioTracksUpdated\",AUDIO_TRACK_SWITCHING:\"hlsAudioTrackSwitching\",AUDIO_TRACK_SWITCHED:\"hlsAudioTrackSwitched\",AUDIO_TRACK_LOADING:\"hlsAudioTrackLoading\",AUDIO_TRACK_LOADED:\"hlsAudioTrackLoaded\",SUBTITLE_TRACKS_UPDATED:\"hlsSubtitleTracksUpdated\",SUBTITLE_TRACK_SWITCH:\"hlsSubtitleTrackSwitch\",SUBTITLE_TRACK_LOADING:\"hlsSubtitleTrackLoading\",SUBTITLE_TRACK_LOADED:\"hlsSubtitleTrackLoaded\",SUBTITLE_FRAG_PROCESSED:\"hlsSubtitleFragProcessed\",INIT_PTS_FOUND:\"hlsInitPtsFound\",FRAG_LOADING:\"hlsFragLoading\",FRAG_LOAD_PROGRESS:\"hlsFragLoadProgress\",FRAG_LOAD_EMERGENCY_ABORTED:\"hlsFragLoadEmergencyAborted\",FRAG_LOADED:\"hlsFragLoaded\",FRAG_DECRYPTED:\"hlsFragDecrypted\",FRAG_PARSING_INIT_SEGMENT:\"hlsFragParsingInitSegment\",FRAG_PARSING_USERDATA:\"hlsFragParsingUserdata\",FRAG_PARSING_METADATA:\"hlsFragParsingMetadata\",FRAG_PARSING_DATA:\"hlsFragParsingData\",FRAG_PARSED:\"hlsFragParsed\",FRAG_BUFFERED:\"hlsFragBuffered\",FRAG_CHANGED:\"hlsFragChanged\",FPS_DROP:\"hlsFpsDrop\",FPS_DROP_LEVEL_CAPPING:\"hlsFpsDropLevelCapping\",ERROR:\"hlsError\",DESTROYING:\"hlsDestroying\",KEY_LOADING:\"hlsKeyLoading\",KEY_LOADED:\"hlsKeyLoaded\",STREAM_STATE_TRANSITION:\"hlsStreamStateTransition\"};e.a=i},function(t,e,r){\"use strict\";r.d(e,\"b\",function(){return i}),r.d(e,\"a\",function(){return a});var i={NETWORK_ERROR:\"networkError\",MEDIA_ERROR:\"mediaError\",KEY_SYSTEM_ERROR:\"keySystemError\",MUX_ERROR:\"muxError\",OTHER_ERROR:\"otherError\"},a={KEY_SYSTEM_NO_KEYS:\"keySystemNoKeys\",KEY_SYSTEM_NO_ACCESS:\"keySystemNoAccess\",KEY_SYSTEM_NO_SESSION:\"keySystemNoSession\",KEY_SYSTEM_LICENSE_REQUEST_FAILED:\"keySystemLicenseRequestFailed\",MANIFEST_LOAD_ERROR:\"manifestLoadError\",MANIFEST_LOAD_TIMEOUT:\"manifestLoadTimeOut\",MANIFEST_PARSING_ERROR:\"manifestParsingError\",MANIFEST_INCOMPATIBLE_CODECS_ERROR:\"manifestIncompatibleCodecsError\",LEVEL_LOAD_ERROR:\"levelLoadError\",LEVEL_LOAD_TIMEOUT:\"levelLoadTimeOut\",LEVEL_SWITCH_ERROR:\"levelSwitchError\",AUDIO_TRACK_LOAD_ERROR:\"audioTrackLoadError\",AUDIO_TRACK_LOAD_TIMEOUT:\"audioTrackLoadTimeOut\",FRAG_LOAD_ERROR:\"fragLoadError\",FRAG_LOAD_TIMEOUT:\"fragLoadTimeOut\",FRAG_DECRYPT_ERROR:\"fragDecryptError\",FRAG_PARSING_ERROR:\"fragParsingError\",REMUX_ALLOC_ERROR:\"remuxAllocError\",KEY_LOAD_ERROR:\"keyLoadError\",KEY_LOAD_TIMEOUT:\"keyLoadTimeOut\",BUFFER_ADD_CODEC_ERROR:\"bufferAddCodecError\",BUFFER_APPEND_ERROR:\"bufferAppendError\",BUFFER_APPENDING_ERROR:\"bufferAppendingError\",BUFFER_STALLED_ERROR:\"bufferStalledError\",BUFFER_FULL_ERROR:\"bufferFullError\",BUFFER_SEEK_OVER_HOLE:\"bufferSeekOverHole\",BUFFER_NUDGE_ON_STALL:\"bufferNudgeOnStall\",INTERNAL_EXCEPTION:\"internalException\"}},function(t,e){t.exports=void 0},function(t,e,r){\"use strict\";function i(){return\"undefined\"==typeof window?self:window}e.a=i},function(t,e,r){!function(e){var r=/^((?:[a-zA-Z0-9+\\-.]+:)?)(\\/\\/[^\\/\\;?#]*)?(.*?)??(;.*?)?(\\?.*?)?(#.*?)?$/,i=/^([^\\/;?#]*)(.*)$/,a=/(?:\\/|^)\\.(?=\\/)/g,n=/(?:\\/|^)\\.\\.\\/(?!\\.\\.\\/).*?(?=\\/)/g,o={buildAbsoluteURL:function(t,e,r){if(r=r||{},t=t.trim(),e=e.trim(),!e){if(!r.alwaysNormalize)return t;var a=this.parseURL(t);if(!s)throw new Error(\"Error trying to parse base URL.\");return a.path=o.normalizePath(a.path),o.buildURLFromParts(a)}var n=this.parseURL(e);if(!n)throw new Error(\"Error trying to parse relative URL.\");if(n.scheme)return r.alwaysNormalize?(n.path=o.normalizePath(n.path),o.buildURLFromParts(n)):e;var s=this.parseURL(t);if(!s)throw new Error(\"Error trying to parse base URL.\");if(!s.netLoc&&s.path&&\"/\"!==s.path[0]){var l=i.exec(s.path);s.netLoc=l[1],s.path=l[2]}s.netLoc&&!s.path&&(s.path=\"/\");var d={scheme:s.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(d.netLoc=s.netLoc,\"/\"!==n.path[0]))if(n.path){var u=s.path,f=u.substring(0,u.lastIndexOf(\"/\")+1)+n.path;d.path=o.normalizePath(f)}else d.path=s.path,n.params||(d.params=s.params,n.query||(d.query=s.query));return null===d.path&&(d.path=r.alwaysNormalize?o.normalizePath(n.path):n.path),o.buildURLFromParts(d)},parseURL:function(t){var e=r.exec(t);return e?{scheme:e[1]||\"\",netLoc:e[2]||\"\",path:e[3]||\"\",params:e[4]||\"\",query:e[5]||\"\",fragment:e[6]||\"\"}:null},normalizePath:function(t){for(t=t.split(\"\").reverse().join(\"\").replace(a,\"\");t.length!==(t=t.replace(n,\"\")).length;);return t.split(\"\").reverse().join(\"\")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}};t.exports=o}(this)},function(t,e){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return\"function\"==typeof t}function a(t){return\"number\"==typeof t}function n(t){return\"object\"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!a(t)||t<0||isNaN(t))throw TypeError(\"n must be a positive number\");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,r,a,s,l,d;if(this._events||(this._events={}),\"error\"===t&&(!this._events.error||n(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;var u=new Error('Uncaught, unspecified \"error\" event. ('+e+\")\");throw u.context=e,u}if(r=this._events[t],o(r))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(n(r))for(s=Array.prototype.slice.call(arguments,1),d=r.slice(),a=d.length,l=0;l<a;l++)d[l].apply(this,s);return!0},r.prototype.addListener=function(t,e){var a;if(!i(e))throw TypeError(\"listener must be a function\");return this._events||(this._events={}),this._events.newListener&&this.emit(\"newListener\",t,i(e.listener)?e.listener:e),this._events[t]?n(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,n(this._events[t])&&!this._events[t].warned&&(a=o(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,a&&a>0&&this._events[t].length>a&&(this._events[t].warned=!0,console.error(\"(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.\",this._events[t].length),\"function\"==typeof console.trace&&console.trace())),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function r(){this.removeListener(t,r),a||(a=!0,e.apply(this,arguments))}if(!i(e))throw TypeError(\"listener must be a function\");var a=!1;return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var r,a,o,s;if(!i(e))throw TypeError(\"listener must be a function\");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,a=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit(\"removeListener\",t,e);else if(n(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){a=s;break}if(a<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(a,1),this._events.removeListener&&this.emit(\"removeListener\",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)\"removeListener\"!==e&&this.removeAllListeners(e);return this.removeAllListeners(\"removeListener\"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,r){\"use strict\";function i(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}var a=function(){function t(){i(this,t)}return t.isHeader=function(t,e){return e+10<=t.length&&73===t[e]&&68===t[e+1]&&51===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},t.isFooter=function(t,e){return e+10<=t.length&&51===t[e]&&68===t[e+1]&&73===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},t.getID3Data=function(e,r){for(var i=r,a=0;t.isHeader(e,r);){a+=10;var n=t._readSize(e,r+6);a+=n,t.isFooter(e,r+10)&&(a+=10),r+=a}if(a>0)return e.subarray(i,i+a)},t._readSize=function(t,e){var r=0;return r=(127&t[e])<<21,r|=(127&t[e+1])<<14,r|=(127&t[e+2])<<7,r|=127&t[e+3]},t.getTimeStamp=function(e){for(var r=t.getID3Frames(e),i=0;i<r.length;i++){var a=r[i];if(t.isTimeStampFrame(a))return t._readTimeStamp(a)}},t.isTimeStampFrame=function(t){return t&&\"PRIV\"===t.key&&\"com.apple.streaming.transportStreamTimestamp\"===t.info},t._getFrameData=function(e){var r=String.fromCharCode(e[0],e[1],e[2],e[3]),i=t._readSize(e,4),a=10;return{type:r,size:i,data:e.subarray(a,a+i)}},t.getID3Frames=function(e){for(var r=0,i=[];t.isHeader(e,r);){var a=t._readSize(e,r+6);r+=10;for(var n=r+a;r+8<n;){var o=t._getFrameData(e.subarray(r)),s=t._decodeFrame(o);s&&i.push(s),r+=o.size+10}t.isFooter(e,r)&&(r+=10)}return i},t._decodeFrame=function(e){return\"PRIV\"===e.type?t._decodePrivFrame(e):\"T\"===e.type[0]?t._decodeTextFrame(e):\"W\"===e.type[0]?t._decodeURLFrame(e):void 0},t._readTimeStamp=function(t){if(8===t.data.byteLength){var e=new Uint8Array(t.data),r=1&e[3],i=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return i/=45,r&&(i+=47721858.84),Math.round(i)}},t._decodePrivFrame=function(e){if(!(e.size<2)){var r=t._utf8ArrayToStr(e.data,!0),i=new Uint8Array(e.data.subarray(r.length+1));return{key:e.type,info:r,data:i.buffer}}},t._decodeTextFrame=function(e){if(!(e.size<2)){if(\"TXXX\"===e.type){var r=1,i=t._utf8ArrayToStr(e.data.subarray(r));r+=i.length+1;var a=t._utf8ArrayToStr(e.data.subarray(r));return{key:e.type,info:i,data:a}}var n=t._utf8ArrayToStr(e.data.subarray(1));return{key:e.type,data:n}}},t._decodeURLFrame=function(e){if(\"WXXX\"===e.type){if(e.size<2)return;var r=1,i=t._utf8ArrayToStr(e.data.subarray(r));r+=i.length+1;var a=t._utf8ArrayToStr(e.data.subarray(r));return{key:e.type,info:i,data:a}}var n=t._utf8ArrayToStr(e.data);return{key:e.type,data:n}},t._utf8ArrayToStr=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.length,i=void 0,a=void 0,n=void 0,o=\"\",s=0;s<r;){if(i=t[s++],0===i&&e)return o;if(0!==i&&3!==i)switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(i);break;case 12:case 13:a=t[s++],o+=String.fromCharCode((31&i)<<6|63&a);break;case 14:a=t[s++],n=t[s++],o+=String.fromCharCode((15&i)<<12|(63&a)<<6|(63&n)<<0)}}return o},t}();a._utf8ArrayToStr;e.a=a},function(t,e,r){\"use strict\";function i(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}var a=r(0),n=r(1),o=Math.pow(2,32)-1,s=function(){function t(e,r){i(this,t),this.observer=e,this.remuxer=r}return t.prototype.resetTimeStamp=function(t){this.initPTS=t},t.prototype.resetInitSegment=function(e,r,i,a){if(e&&e.byteLength){var o=this.initData=t.parseInitSegment(e);null==r&&(r=\"mp4a.40.5\"),null==i&&(i=\"avc1.42e01e\");var s={};o.audio&&o.video?s.audiovideo={container:\"video/mp4\",codec:r+\",\"+i,initSegment:a?e:null}:(o.audio&&(s.audio={container:\"audio/mp4\",codec:r,initSegment:a?e:null}),o.video&&(s.video={container:\"video/mp4\",codec:i,initSegment:a?e:null})),this.observer.trigger(n.a.FRAG_PARSING_INIT_SEGMENT,{tracks:s})}else r&&(this.audioCodec=r),i&&(this.videoCodec=i)},t.probe=function(e){return t.findBox({data:e,start:0,end:Math.min(e.length,16384)},[\"moof\"]).length>0},t.bin2str=function(t){return String.fromCharCode.apply(null,t)},t.readUint16=function(t,e){t.data&&(e+=t.start,t=t.data);var r=t[e]<<8|t[e+1];return r<0?65536+r:r},t.readUint32=function(t,e){t.data&&(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},t.writeUint32=function(t,e,r){t.data&&(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},t.findBox=function(e,r){var i=[],a=void 0,n=void 0,o=void 0,s=void 0,l=void 0,d=void 0,u=void 0;if(e.data?(d=e.start,s=e.end,e=e.data):(d=0,s=e.byteLength),!r.length)return null;for(a=d;a<s;)n=t.readUint32(e,a),o=t.bin2str(e.subarray(a+4,a+8)),u=n>1?a+n:s,o===r[0]&&(1===r.length?i.push({data:e,start:a+8,end:u}):(l=t.findBox({data:e,start:a+8,end:u},r.slice(1)),l.length&&(i=i.concat(l)))),a=u;return i},t.parseSegmentIndex=function(e){var r=t.findBox(e,[\"moov\"])[0],i=r?r.end:null,a=0,n=t.findBox(e,[\"sidx\"]),o=void 0;if(!n||!n[0])return null;o=[],n=n[0];var s=n.data[0];a=0===s?8:16;var l=t.readUint32(n,a);a+=4;var d=0,u=0;a+=0===s?8:16,a+=2;var f=n.end+u,h=t.readUint16(n,a);a+=2;for(var c=0;c<h;c++){var p=a,v=t.readUint32(n,p);p+=4;var g=2147483647&v,m=(2147483648&v)>>>31;if(1===m)return void console.warn(\"SIDX has hierarchical references (not supported)\");var y=t.readUint32(n,p);p+=4,o.push({referenceSize:g,subsegmentDuration:y,info:{duration:y/l,start:f,end:f+g-1}}),f+=g,p+=4,a=p}return{earliestPresentationTime:d,timescale:l,version:s,referencesCount:h,references:o,moovEndOffset:i}},t.parseInitSegment=function(e){var r=[],i=t.findBox(e,[\"moov\",\"trak\"]);return i.forEach(function(e){var i=t.findBox(e,[\"tkhd\"])[0];if(i){var n=i.data[i.start],o=0===n?12:20,s=t.readUint32(i,o),l=t.findBox(e,[\"mdia\",\"mdhd\"])[0];if(l){n=l.data[l.start],o=0===n?12:20;var d=t.readUint32(l,o),u=t.findBox(e,[\"mdia\",\"hdlr\"])[0];if(u){var f=t.bin2str(u.data.subarray(u.start+8,u.start+12)),h={soun:\"audio\",vide:\"video\"}[f];if(h){var c=t.findBox(e,[\"mdia\",\"minf\",\"stbl\",\"stsd\"]);if(c.length){c=c[0];var p=t.bin2str(c.data.subarray(c.start+12,c.start+16));a.b.log(\"MP4Demuxer:\"+h+\":\"+p+\" found\")}r[s]={timescale:d,type:h},r[h]={timescale:d,id:s}}}}}}),r},t.getStartDTS=function(e,r){var i=void 0,a=void 0,n=void 0;return i=t.findBox(r,[\"moof\",\"traf\"]),a=[].concat.apply([],i.map(function(r){return t.findBox(r,[\"tfhd\"]).map(function(i){var a=void 0,n=void 0,o=void 0;return a=t.readUint32(i,4),n=e[a].timescale||9e4,o=t.findBox(r,[\"tfdt\"]).map(function(e){var r=void 0,i=void 0;return r=e.data[e.start],i=t.readUint32(e,4),1===r&&(i*=Math.pow(2,32),i+=t.readUint32(e,8)),i})[0],o/n})})),n=Math.min.apply(null,a),isFinite(n)?n:0},t.offsetStartDTS=function(e,r,i){t.findBox(r,[\"moof\",\"traf\"]).map(function(r){return t.findBox(r,[\"tfhd\"]).map(function(a){var n=t.readUint32(a,4),s=e[n].timescale||9e4;t.findBox(r,[\"tfdt\"]).map(function(e){var r=e.data[e.start],a=t.readUint32(e,4);if(0===r)t.writeUint32(e,4,a-i*s);else{a*=Math.pow(2,32),a+=t.readUint32(e,8),a-=i*s,a=Math.max(a,0);var n=Math.floor(a/(o+1)),l=Math.floor(a%(o+1));t.writeUint32(e,4,n),t.writeUint32(e,8,l)}})})})},t.prototype.append=function(e,r,i,a){var o=this.initData;o||(this.resetInitSegment(e,this.audioCodec,this.videoCodec,!1),o=this.initData);var s=void 0,l=this.initPTS;if(void 0===l){var d=t.getStartDTS(o,e);this.initPTS=l=d-r,this.observer.trigger(n.a.INIT_PTS_FOUND,{initPTS:l})}t.offsetStartDTS(o,e,l),s=t.getStartDTS(o,e),this.remuxer.remux(o.audio,o.video,null,null,s,i,a,e)},t.prototype.destroy=function(){},t}();e.a=s},function(t,e,r){\"use strict\";function i(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function a(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function n(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function o(t){var e=t.byteLength,r=e&&new DataView(t).getUint8(e-1);return r?t.slice(0,e-r):t}function s(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function l(t,e,r,i){var a=void 0,n=void 0,o=void 0,s=void 0,l=void 0,d=navigator.userAgent.toLowerCase(),u=i,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];return a=((192&e[r+2])>>>6)+1,n=(60&e[r+2])>>>2,n>f.length-1?void t.trigger(D.a.ERROR,{type:I.b.MEDIA_ERROR,details:I.a.FRAG_PARSING_ERROR,fatal:!0,reason:\"invalid ADTS sampling index:\"+n}):(s=(1&e[r+2])<<2,s|=(192&e[r+3])>>>6,M.b.log(\"manifest codec:\"+i+\",ADTS data:type:\"+a+\",sampleingIndex:\"+n+\"[\"+f[n]+\"Hz],channelConfig:\"+s),/firefox/i.test(d)?n>=6?(a=5,l=new Array(4),o=n-3):(a=2,l=new Array(2),o=n):d.indexOf(\"android\")!==-1?(a=2,l=new Array(2),o=n):(a=5,l=new Array(4),i&&(i.indexOf(\"mp4a.40.29\")!==-1||i.indexOf(\"mp4a.40.5\")!==-1)||!i&&n>=6?o=n-3:((i&&i.indexOf(\"mp4a.40.2\")!==-1&&(n>=6&&1===s||/vivaldi/i.test(d))||!i&&1===s)&&(a=2,l=new Array(2)),o=n)),l[0]=a<<3,l[0]|=(14&n)>>1,l[1]|=(1&n)<<7,l[1]|=s<<3,5===a&&(l[1]|=(14&o)>>1,l[2]=(1&o)<<7,l[2]|=8,l[3]=0),{config:l,samplerate:f[n],channelCount:s,codec:\"mp4a.40.\"+a,manifestCodec:u})}function d(t,e){return 255===t[e]&&240===(246&t[e+1])}function u(t,e){return 1&t[e+1]?7:9}function f(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}function h(t,e){return!!(e+1<t.length&&d(t,e))}function c(t,e){if(e+1<t.length&&d(t,e)){var r=u(t,e),i=r;e+5<t.length&&(i=f(t,e));var a=e+i;if(a===t.length||a+1<t.length&&d(t,a))return!0}return!1}function p(t,e,r,i,a){if(!t.samplerate){var n=l(e,r,i,a);t.config=n.config,t.samplerate=n.samplerate,t.channelCount=n.channelCount,t.codec=n.codec,t.manifestCodec=n.manifestCodec,M.b.log(\"parsed codec:\"+t.codec+\",rate:\"+n.samplerate+\",nb channel:\"+n.channelCount)}}function v(t){return 9216e4/t}function g(t,e,r,i,a){var n=void 0,o=void 0,s=void 0,l=t.length;if(n=u(t,e),o=f(t,e),o-=n,o>0&&e+n+o<=l)return s=r+i*a,{headerLength:n,frameLength:o,stamp:s}}function m(t,e,r,i,a){var n=v(t.samplerate),o=g(e,r,i,a,n);if(o){var s=o.stamp,l=o.headerLength,d=o.frameLength,u={unit:e.subarray(r+l,r+l+d),pts:s,dts:s};return t.samples.push(u),t.len+=d,{sample:u,length:d+l}}}function y(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function b(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function E(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function T(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function S(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function A(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function _(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function R(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function L(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function w(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}var D=r(1),I=r(2),O=function(){function t(e,r){i(this,t),this.subtle=e,this.aesIV=r}return t.prototype.decrypt=function(t,e){return this.subtle.decrypt({name:\"AES-CBC\",iv:this.aesIV},e,t)},t}(),k=O,x=function(){function t(e,r){a(this,t),this.subtle=e,this.key=r}return t.prototype.expandKey=function(){return this.subtle.importKey(\"raw\",this.key,{name:\"AES-CBC\"},!1,[\"encrypt\",\"decrypt\"])},t}(),P=x,C=function(){function t(){n(this,t),this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.initTable()}return t.prototype.uint8ArrayToUint32Array_=function(t){for(var e=new DataView(t),r=new Uint32Array(4),i=0;i<4;i++)r[i]=e.getUint32(4*i);return r},t.prototype.initTable=function(){var t=this.sBox,e=this.invSBox,r=this.subMix,i=r[0],a=r[1],n=r[2],o=r[3],s=this.invSubMix,l=s[0],d=s[1],u=s[2],f=s[3],h=new Uint32Array(256),c=0,p=0,v=0;for(v=0;v<256;v++)v<128?h[v]=v<<1:h[v]=v<<1^283;for(v=0;v<256;v++){var g=p^p<<1^p<<2^p<<3^p<<4;g=g>>>8^255&g^99,t[c]=g,e[g]=c;var m=h[c],y=h[m],b=h[y],E=257*h[g]^16843008*g;i[c]=E<<24|E>>>8,a[c]=E<<16|E>>>16,n[c]=E<<8|E>>>24,o[c]=E,E=16843009*b^65537*y^257*m^16843008*c,l[g]=E<<24|E>>>8,d[g]=E<<16|E>>>16,u[g]=E<<8|E>>>24,f[g]=E,c?(c=m^h[h[h[b^m]]],p^=h[h[p]]):c=p=1}},t.prototype.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),r=!0,i=0;i<e.length&&r;)r=e[i]===this.key[i],i++;if(!r){this.key=e;var a=this.keySize=e.length;if(4!==a&&6!==a&&8!==a)throw new Error(\"Invalid aes key size=\"+a);var n=this.ksRows=4*(a+6+1),o=void 0,s=void 0,l=this.keySchedule=new Uint32Array(n),d=this.invKeySchedule=new Uint32Array(n),u=this.sBox,f=this.rcon,h=this.invSubMix,c=h[0],p=h[1],v=h[2],g=h[3],m=void 0,y=void 0;for(o=0;o<n;o++)o<a?m=l[o]=e[o]:(y=m,o%a===0?(y=y<<8|y>>>24,y=u[y>>>24]<<24|u[y>>>16&255]<<16|u[y>>>8&255]<<8|u[255&y],y^=f[o/a|0]<<24):a>6&&o%a===4&&(y=u[y>>>24]<<24|u[y>>>16&255]<<16|u[y>>>8&255]<<8|u[255&y]),l[o]=m=(l[o-a]^y)>>>0);for(s=0;s<n;s++)o=n-s,y=3&s?l[o]:l[o-4],s<4||o<=4?d[s]=y:d[s]=c[u[y>>>24]]^p[u[y>>>16&255]]^v[u[y>>>8&255]]^g[u[255&y]],d[s]=d[s]>>>0}},t.prototype.networkToHostOrderSwap=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},t.prototype.decrypt=function(t,e,r,i){for(var a=this.keySize+6,n=this.invKeySchedule,s=this.invSBox,l=this.invSubMix,d=l[0],u=l[1],f=l[2],h=l[3],c=this.uint8ArrayToUint32Array_(r),p=c[0],v=c[1],g=c[2],m=c[3],y=new Int32Array(t),b=new Int32Array(y.length),E=void 0,T=void 0,S=void 0,A=void 0,_=void 0,R=void 0,L=void 0,w=void 0,D=void 0,I=void 0,O=void 0,k=void 0,x=void 0,P=void 0,C=this.networkToHostOrderSwap;e<y.length;){for(D=C(y[e]),I=C(y[e+1]),O=C(y[e+2]),k=C(y[e+3]),_=D^n[0],R=k^n[1],L=O^n[2],w=I^n[3],x=4,P=1;P<a;P++)E=d[_>>>24]^u[R>>16&255]^f[L>>8&255]^h[255&w]^n[x],T=d[R>>>24]^u[L>>16&255]^f[w>>8&255]^h[255&_]^n[x+1],S=d[L>>>24]^u[w>>16&255]^f[_>>8&255]^h[255&R]^n[x+2],A=d[w>>>24]^u[_>>16&255]^f[R>>8&255]^h[255&L]^n[x+3],_=E,R=T,L=S,w=A,x+=4;E=s[_>>>24]<<24^s[R>>16&255]<<16^s[L>>8&255]<<8^s[255&w]^n[x],T=s[R>>>24]<<24^s[L>>16&255]<<16^s[w>>8&255]<<8^s[255&_]^n[x+1],S=s[L>>>24]<<24^s[w>>16&255]<<16^s[_>>8&255]<<8^s[255&R]^n[x+2],A=s[w>>>24]<<24^s[_>>16&255]<<16^s[R>>8&255]<<8^s[255&L]^n[x+3],x+=3,b[e]=C(E^p),b[e+1]=C(A^v),b[e+2]=C(S^g),b[e+3]=C(T^m),p=D,v=I,g=O,m=k,e+=4}return i?o(b.buffer):b.buffer},t.prototype.destroy=function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0},t}(),F=C,M=r(0),N=r(4),U=Object(N.a)(),B=function(){function t(e,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=i.removePKCS7Padding,n=void 0===a||a;if(s(this,t),this.logEnabled=!0,this.observer=e,this.config=r,this.removePKCS7Padding=n,n)try{var o=U.crypto;o&&(this.subtle=o.subtle||o.webkitSubtle)}catch(l){}this.disableWebCrypto=!this.subtle}return t.prototype.isSync=function(){return this.disableWebCrypto&&this.config.enableSoftwareAES},t.prototype.decrypt=function(t,e,r,i){var a=this;if(this.disableWebCrypto&&this.config.enableSoftwareAES){this.logEnabled&&(M.b.log(\"JS AES decrypt\"),this.logEnabled=!1);var n=this.decryptor;n||(this.decryptor=n=new F),n.expandKey(e),i(n.decrypt(t,0,r,this.removePKCS7Padding))}else{this.logEnabled&&(M.b.log(\"WebCrypto AES decrypt\"),this.logEnabled=!1);var o=this.subtle;this.key!==e&&(this.key=e,this.fastAesKey=new P(o,e)),this.fastAesKey.expandKey().then(function(n){var s=new k(o,r);s.decrypt(t,n)[\"catch\"](function(n){a.onWebCryptoError(n,t,e,r,i)}).then(function(t){i(t)})})[\"catch\"](function(n){a.onWebCryptoError(n,t,e,r,i)})}},t.prototype.onWebCryptoError=function(t,e,r,i,a){this.config.enableSoftwareAES?(M.b.log(\"WebCrypto Error, disable WebCrypto API\"),this.disableWebCrypto=!0,this.logEnabled=!0,this.decrypt(e,r,i,a)):(M.b.error(\"decrypting error : \"+t.message),this.observer.trigger(D.a.ERROR,{type:I.b.MEDIA_ERROR,details:I.a.FRAG_DECRYPT_ERROR,fatal:!0,reason:t.message}))},t.prototype.destroy=function(){var t=this.decryptor;t&&(t.destroy(),this.decryptor=void 0)},t}(),G=B,j=r(7),K=function(){function t(e,r,i){y(this,t),this.observer=e,this.config=i,this.remuxer=r}return t.prototype.resetInitSegment=function(t,e,r,i){this._audioTrack={container:\"audio/adts\",type:\"audio\",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:e,duration:i,inputTimeScale:9e4}},t.prototype.resetTimeStamp=function(){},t.probe=function(t){if(!t)return!1;for(var e=j.a.getID3Data(t,0)||[],r=e.length,i=t.length;r<i;r++)if(c(t,r))return M.b.log(\"ADTS sync word found !\"),!0;return!1},t.prototype.append=function(t,e,r,i){for(var a=this._audioTrack,n=j.a.getID3Data(t,0)||[],o=j.a.getTimeStamp(n),s=o?90*o:9e4*e,l=0,d=s,u=t.length,f=n.length,c=[{pts:d,dts:d,data:n}];f<u-1;)if(h(t,f)&&f+5<u){p(a,this.observer,t,f,a.manifestCodec);var v=m(a,t,f,s,l);if(!v){M.b.log(\"Unable to parse AAC frame\");break}f+=v.length,d=v.sample.pts,l++}else j.a.isHeader(t,f)?(n=j.a.getID3Data(t,f),c.push({pts:d,dts:d,data:n}),f+=n.length):f++;this.remuxer.remux(a,{samples:[]},{samples:c,inputTimeScale:9e4},{samples:[]},e,r,i)},t.prototype.destroy=function(){},t}(),H=K,V=r(8),W={BitratesMap:[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],SamplingRateMap:[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],SamplesCoefficients:[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],BytesInSlot:[0,1,1,4],appendFrame:function(t,e,r,i,a){if(!(r+24>e.length)){var n=this.parseHeader(e,r);if(n&&r+n.frameLength<=e.length){var o=9e4*n.samplesPerFrame/n.sampleRate,s=i+a*o,l={unit:e.subarray(r,r+n.frameLength),pts:s,dts:s};return t.config=[],t.channelCount=n.channelCount,t.samplerate=n.sampleRate,t.samples.push(l),t.len+=n.frameLength,{sample:l,length:n.frameLength}}}},parseHeader:function(t,e){var r=t[e+1]>>3&3,i=t[e+1]>>1&3,a=t[e+2]>>4&15,n=t[e+2]>>2&3,o=t[e+2]>>1&1;if(1!==r&&0!==a&&15!==a&&3!==n){var s=3===r?3-i:3===i?3:4,l=1e3*W.BitratesMap[14*s+a-1],d=3===r?0:2===r?1:2,u=W.SamplingRateMap[3*d+n],f=t[e+3]>>6===3?1:2,h=W.SamplesCoefficients[r][i],c=W.BytesInSlot[i],p=8*h*c,v=parseInt(h*l/u+o,10)*c;return{sampleRate:u,channelCount:f,frameLength:v,samplesPerFrame:p}}},isHeaderPattern:function(t,e){return 255===t[e]&&224===(224&t[e+1])&&0!==(6&t[e+1])},isHeader:function(t,e){return!!(e+1<t.length&&this.isHeaderPattern(t,e))},probe:function(t,e){if(e+1<t.length&&this.isHeaderPattern(t,e)){var r=4,i=this.parseHeader(t,e),a=r;i&&i.frameLength&&(a=i.frameLength);var n=e+a;if(n===t.length||n+1<t.length&&this.isHeaderPattern(t,n))return!0}return!1}},Y=W,z=function(){function t(e){b(this,t),this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}return t.prototype.loadWord=function(){var t=this.data,e=this.bytesAvailable,r=t.byteLength-e,i=new Uint8Array(4),a=Math.min(4,e);if(0===a)throw new Error(\"no bytes available\");i.set(t.subarray(r,r+a)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=8*a,this.bytesAvailable-=a},t.prototype.skipBits=function(t){var e=void 0;this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,e=t>>3,t-=e>>3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)},t.prototype.readBits=function(t){var e=Math.min(this.bitsAvailable,t),r=this.word>>>32-e;return t>32&&M.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,e>0&&this.bitsAvailable?r<<e|this.readBits(e):r},t.prototype.skipLZ=function(){var t=void 0;for(t=0;t<this.bitsAvailable;++t)if(0!==(this.word&2147483648>>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},t.prototype.skipUEG=function(){this.skipBits(1+this.skipLZ())},t.prototype.skipEG=function(){this.skipBits(1+this.skipLZ())},t.prototype.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},t.prototype.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},t.prototype.readBoolean=function(){return 1===this.readBits(1)},t.prototype.readUByte=function(){return this.readBits(8)},t.prototype.readUShort=function(){return this.readBits(16)},t.prototype.readUInt=function(){return this.readBits(32)},t.prototype.skipScalingList=function(t){var e=8,r=8,i=void 0,a=void 0;for(i=0;i<t;i++)0!==r&&(a=this.readEG(),r=(e+a+256)%256),e=0===r?e:r},t.prototype.readSPS=function(){var t=0,e=0,r=0,i=0,a=void 0,n=void 0,o=void 0,s=void 0,l=void 0,d=void 0,u=void 0,f=void 0,h=void 0,c=this.readUByte.bind(this),p=this.readBits.bind(this),v=this.readUEG.bind(this),g=this.readBoolean.bind(this),m=this.skipBits.bind(this),y=this.skipEG.bind(this),b=this.skipUEG.bind(this),E=this.skipScalingList.bind(this);if(c(),a=c(),n=p(5),m(3),o=c(),b(),100===a||110===a||122===a||244===a||44===a||83===a||86===a||118===a||128===a){var T=v();if(3===T&&m(1),b(),b(),m(1),g())for(f=3!==T?8:12,h=0;h<f;h++)g()&&E(h<6?16:64)}b();var S=v();if(0===S)v();else if(1===S)for(m(1),y(),y(),s=v(),h=0;h<s;h++)y();b(),m(1),l=v(),d=v(),u=p(1),0===u&&m(1),m(1),g()&&(t=v(),e=v(),r=v(),i=v());var A=[1,1];if(g()&&g()){var _=c();switch(_){case 1:A=[1,1];break;case 2:A=[12,11];break;case 3:A=[10,11];break;case 4:A=[16,11];break;case 5:A=[40,33];break;case 6:A=[24,11];break;case 7:A=[20,11];break;case 8:A=[32,11];break;case 9:A=[80,33];break;case 10:A=[18,11];break;case 11:A=[15,11];break;case 12:A=[64,33];break;case 13:A=[160,99];break;case 14:A=[4,3];break;case 15:A=[3,2];break;case 16:A=[2,1];break;case 255:A=[c()<<8|c(),c()<<8|c()]}}return{width:Math.ceil(16*(l+1)-2*t-2*e),height:(2-u)*(d+1)*16-(u?2:4)*(r+i),pixelRatio:A}},t.prototype.readSliceType=function(){\nreturn this.readUByte(),this.readUEG(),this.readUEG()},t}(),X=z,q=function(){function t(e,r,i,a){E(this,t),this.decryptdata=i,this.discardEPB=a,this.decrypter=new G(e,r,{removePKCS7Padding:!1})}return t.prototype.decryptBuffer=function(t,e){this.decrypter.decrypt(t,this.decryptdata.key.buffer,this.decryptdata.iv.buffer,e)},t.prototype.decryptAacSample=function(t,e,r,i){var a=t[e].unit,n=a.subarray(16,a.length-a.length%16),o=n.buffer.slice(n.byteOffset,n.byteOffset+n.length),s=this;this.decryptBuffer(o,function(n){n=new Uint8Array(n),a.set(n,16),i||s.decryptAacSamples(t,e+1,r)})},t.prototype.decryptAacSamples=function(t,e,r){for(;;e++){if(e>=t.length)return void r();if(!(t[e].unit.length<32)){var i=this.decrypter.isSync();if(this.decryptAacSample(t,e,r,i),!i)return}}},t.prototype.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,r=new Int8Array(e),i=0,a=32;a<=t.length-16;a+=160,i+=16)r.set(t.subarray(a,a+16),i);return r},t.prototype.getAvcDecryptedUnit=function(t,e){e=new Uint8Array(e);for(var r=0,i=32;i<=t.length-16;i+=160,r+=16)t.set(e.subarray(r,r+16),i);return t},t.prototype.decryptAvcSample=function(t,e,r,i,a,n){var o=this.discardEPB(a.data),s=this.getAvcEncryptedData(o),l=this;this.decryptBuffer(s.buffer,function(s){a.data=l.getAvcDecryptedUnit(o,s),n||l.decryptAvcSamples(t,e,r+1,i)})},t.prototype.decryptAvcSamples=function(t,e,r,i){for(;;e++,r=0){if(e>=t.length)return void i();for(var a=t[e].units;!(r>=a.length);r++){var n=a[r];if(!(n.length<=48||1!==n.type&&5!==n.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(t,e,r,i,n,o),!o)return}}}},t}(),Q=q,Z={video:1,audio:2,id3:3,text:4},J=function(){function t(e,r,i,a){T(this,t),this.observer=e,this.config=i,this.typeSupported=a,this.remuxer=r,this.sampleAes=null}return t.prototype.setDecryptData=function(t){null!=t&&null!=t.key&&\"SAMPLE-AES\"===t.method?this.sampleAes=new Q(this.observer,this.config,t,this.discardEPB):this.sampleAes=null},t.probe=function(e){var r=t._syncOffset(e);return!(r<0)&&(r&&M.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<e;){if(71===t[r]&&71===t[r+188]&&71===t[r+376])return r;r++}return-1},t.createTrack=function(t,e){return{container:\"video\"===t||\"audio\"===t?\"video/mp2t\":void 0,type:t,id:Z[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0,dropped:\"video\"===t?0:void 0,isAAC:\"audio\"===t||void 0,duration:\"audio\"===t?e:void 0}},t.prototype.resetInitSegment=function(e,r,i,a){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=t.createTrack(\"video\",a),this._audioTrack=t.createTrack(\"audio\",a),this._id3Track=t.createTrack(\"id3\",a),this._txtTrack=t.createTrack(\"text\",a),this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=r,this.videoCodec=i,this._duration=a},t.prototype.resetTimeStamp=function(){},t.prototype.append=function(e,r,i,a){var n=void 0,o=e.length,s=void 0,l=void 0,d=void 0,u=void 0,f=void 0,h=!1;this.contiguous=i;var c=this.pmtParsed,p=this._avcTrack,v=this._audioTrack,g=this._id3Track,m=p.pid,y=v.pid,b=g.pid,E=this._pmtId,T=p.pesData,S=v.pesData,A=g.pesData,_=this._parsePAT,R=this._parsePMT,L=this._parsePES,w=this._parseAVCPES.bind(this),O=this._parseAACPES.bind(this),k=this._parseMPEGPES.bind(this),x=this._parseID3PES.bind(this),P=t._syncOffset(e);for(o-=(o+P)%188,n=P;n<o;n+=188)if(71===e[n]){if(s=!!(64&e[n+1]),l=((31&e[n+1])<<8)+e[n+2],d=(48&e[n+3])>>4,d>1){if(u=n+5+e[n+4],u===n+188)continue}else u=n+4;switch(l){case m:s&&(T&&(f=L(T))&&void 0!==f.pts&&w(f,!1),T={data:[],size:0}),T&&(T.data.push(e.subarray(u,n+188)),T.size+=n+188-u);break;case y:s&&(S&&(f=L(S))&&void 0!==f.pts&&(v.isAAC?O(f):k(f)),S={data:[],size:0}),S&&(S.data.push(e.subarray(u,n+188)),S.size+=n+188-u);break;case b:s&&(A&&(f=L(A))&&void 0!==f.pts&&x(f),A={data:[],size:0}),A&&(A.data.push(e.subarray(u,n+188)),A.size+=n+188-u);break;case 0:s&&(u+=e[u]+1),E=this._pmtId=_(e,u);break;case E:s&&(u+=e[u]+1);var C=R(e,u,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,null!=this.sampleAes);m=C.avc,m>0&&(p.pid=m),y=C.audio,y>0&&(v.pid=y,v.isAAC=C.isAAC),b=C.id3,b>0&&(g.pid=b),h&&!c&&(M.b.log(\"reparse from beginning\"),h=!1,n=P-188),c=this.pmtParsed=!0;break;case 17:case 8191:break;default:h=!0}}else this.observer.trigger(D.a.ERROR,{type:I.b.MEDIA_ERROR,details:I.a.FRAG_PARSING_ERROR,fatal:!1,reason:\"TS packet did not start with 0x47\"});T&&(f=L(T))&&void 0!==f.pts?(w(f,!0),p.pesData=null):p.pesData=T,S&&(f=L(S))&&void 0!==f.pts?(v.isAAC?O(f):k(f),v.pesData=null):(S&&S.size&&M.b.log(\"last AAC PES packet truncated,might overlap between fragments\"),v.pesData=S),A&&(f=L(A))&&void 0!==f.pts?(x(f),g.pesData=null):g.pesData=A,null==this.sampleAes?this.remuxer.remux(v,p,g,this._txtTrack,r,i,a):this.decryptAndRemux(v,p,g,this._txtTrack,r,i,a)},t.prototype.decryptAndRemux=function(t,e,r,i,a,n,o){if(t.samples&&t.isAAC){var s=this;this.sampleAes.decryptAacSamples(t.samples,0,function(){s.decryptAndRemuxAvc(t,e,r,i,a,n,o)})}else this.decryptAndRemuxAvc(t,e,r,i,a,n,o)},t.prototype.decryptAndRemuxAvc=function(t,e,r,i,a,n,o){if(e.samples){var s=this;this.sampleAes.decryptAvcSamples(e.samples,0,0,function(){s.remuxer.remux(t,e,r,i,a,n,o)})}else this.remuxer.remux(t,e,r,i,a,n,o)},t.prototype.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},t.prototype._parsePAT=function(t,e){return(31&t[e+10])<<8|t[e+11]},t.prototype._parsePMT=function(t,e,r,i){var a=void 0,n=void 0,o=void 0,s=void 0,l={audio:-1,avc:-1,id3:-1,isAAC:!0};for(a=(15&t[e+1])<<8|t[e+2],n=e+3+a-4,o=(15&t[e+10])<<8|t[e+11],e+=12+o;e<n;){switch(s=(31&t[e+1])<<8|t[e+2],t[e]){case 207:if(!i){M.b.log(\"unkown stream type:\"+t[e]);break}case 15:l.audio===-1&&(l.audio=s);break;case 21:l.id3===-1&&(l.id3=s);break;case 219:if(!i){M.b.log(\"unkown stream type:\"+t[e]);break}case 27:l.avc===-1&&(l.avc=s);break;case 3:case 4:r?l.audio===-1&&(l.audio=s,l.isAAC=!1):M.b.log(\"MPEG audio found, not supported in this browser for now\");break;case 36:M.b.warn(\"HEVC stream type found, not supported for now\");break;default:M.b.log(\"unkown stream type:\"+t[e])}e+=((15&t[e+3])<<8|t[e+4])+5}return l},t.prototype._parsePES=function(t){var e=0,r=void 0,i=void 0,a=void 0,n=void 0,o=void 0,s=void 0,l=void 0,d=void 0,u=void 0,f=t.data;if(!t||0===t.size)return null;for(;f[0].length<19&&f.length>1;){var h=new Uint8Array(f[0].length+f[1].length);h.set(f[0]),h.set(f[1],f[0].length),f[0]=h,f.splice(1,1)}if(r=f[0],a=(r[0]<<16)+(r[1]<<8)+r[2],1===a){if(n=(r[4]<<8)+r[5],n&&n>t.size-6)return null;i=r[7],192&i&&(l=536870912*(14&r[9])+4194304*(255&r[10])+16384*(254&r[11])+128*(255&r[12])+(254&r[13])/2,l>4294967295&&(l-=8589934592),64&i?(d=536870912*(14&r[14])+4194304*(255&r[15])+16384*(254&r[16])+128*(255&r[17])+(254&r[18])/2,d>4294967295&&(d-=8589934592),l-d>54e5&&(M.b.warn(Math.round((l-d)/9e4)+\"s delta between PTS and DTS, align them\"),l=d)):d=l),o=r[8],u=o+9,t.size-=u,s=new Uint8Array(t.size);for(var c=0,p=f.length;c<p;c++){r=f[c];var v=r.byteLength;if(u){if(u>v){u-=v;continue}r=r.subarray(u),v-=u,u=0}s.set(r,e),e+=v}return n&&(n-=o+3),{data:s,pts:l,dts:d,len:n}}return null},t.prototype.pushAccesUnit=function(t,e){if(t.units.length&&t.frame){var r=e.samples,i=r.length;!this.config.forceKeyFrameOnDiscontinuity||t.key===!0||e.sps&&(i||this.contiguous)?(t.id=i,r.push(t)):e.dropped++}t.debug.length&&M.b.log(t.pts+\"/\"+t.dts+\":\"+t.debug)},t.prototype._parseAVCPES=function(t,e){var r=this,i=this._avcTrack,a=this._parseAVCNALu(t.data),n=!1,o=void 0,s=this.avcSample,l=void 0,d=!1,u=void 0,f=this.pushAccesUnit.bind(this),h=function(t,e,r,i){return{key:t,pts:e,dts:r,units:[],debug:i}};t.data=null,s&&a.length&&!i.audFound&&(f(s,i),s=this.avcSample=h(!1,t.pts,t.dts,\"\")),a.forEach(function(e){switch(e.type){case 1:l=!0,s||(s=r.avcSample=h(!0,t.pts,t.dts,\"\")),n&&(s.debug+=\"NDR \"),s.frame=!0;var a=e.data;if(d&&a.length>4){var c=new X(a).readSliceType();2!==c&&4!==c&&7!==c&&9!==c||(s.key=!0)}break;case 5:l=!0,s||(s=r.avcSample=h(!0,t.pts,t.dts,\"\")),n&&(s.debug+=\"IDR \"),s.key=!0,s.frame=!0;break;case 6:l=!0,n&&s&&(s.debug+=\"SEI \"),o=new X(r.discardEPB(e.data)),o.readUByte();for(var p=0,v=0,g=!1,m=0;!g&&o.bytesAvailable>1;){p=0;do m=o.readUByte(),p+=m;while(255===m);v=0;do m=o.readUByte(),v+=m;while(255===m);if(4===p&&0!==o.bytesAvailable){g=!0;var y=o.readUByte();if(181===y){var b=o.readUShort();if(49===b){var E=o.readUInt();if(1195456820===E){var T=o.readUByte();if(3===T){var S=o.readUByte(),A=o.readUByte(),_=31&S,R=[S,A];for(u=0;u<_;u++)R.push(o.readUByte()),R.push(o.readUByte()),R.push(o.readUByte());r._insertSampleInOrder(r._txtTrack.samples,{type:3,pts:t.pts,bytes:R})}}}}}else if(v<o.bytesAvailable)for(u=0;u<v;u++)o.readUByte()}break;case 7:if(l=!0,d=!0,n&&s&&(s.debug+=\"SPS \"),!i.sps){o=new X(e.data);var L=o.readSPS();i.width=L.width,i.height=L.height,i.pixelRatio=L.pixelRatio,i.sps=[e.data],i.duration=r._duration;var w=e.data.subarray(1,4),D=\"avc1.\";for(u=0;u<3;u++){var I=w[u].toString(16);I.length<2&&(I=\"0\"+I),D+=I}i.codec=D}break;case 8:l=!0,n&&s&&(s.debug+=\"PPS \"),i.pps||(i.pps=[e.data]);break;case 9:l=!1,i.audFound=!0,s&&f(s,i),s=r.avcSample=h(!1,t.pts,t.dts,n?\"AUD \":\"\");break;case 12:l=!1;break;default:l=!1,s&&(s.debug+=\"unknown NAL \"+e.type+\" \")}if(s&&l){var O=s.units;O.push(e)}}),e&&s&&(f(s,i),this.avcSample=null)},t.prototype._insertSampleInOrder=function(t,e){var r=t.length;if(r>0){if(e.pts>=t[r-1].pts)t.push(e);else for(var i=r-1;i>=0;i--)if(e.pts<t[i].pts){t.splice(i,0,e);break}}else t.push(e)},t.prototype._getLastNalUnit=function(){var t=this.avcSample,e=void 0;if(!t||0===t.units.length){var r=this._avcTrack,i=r.samples;t=i[i.length-1]}if(t){var a=t.units;e=a[a.length-1]}return e},t.prototype._parseAVCNALu=function(t){var e=0,r=t.byteLength,i=void 0,a=void 0,n=this._avcTrack,o=n.naluState||0,s=o,l=[],d=void 0,u=void 0,f=-1,h=void 0;for(o===-1&&(f=0,h=31&t[0],o=0,e=1);e<r;)if(i=t[e++],o)if(1!==o)if(i)if(1===i){if(f>=0)d={data:t.subarray(f,e-o-1),type:h},l.push(d);else{var c=this._getLastNalUnit();if(c&&(s&&e<=4-s&&c.state&&(c.data=c.data.subarray(0,c.data.byteLength-s)),a=e-o-1,a>0)){var p=new Uint8Array(c.data.byteLength+a);p.set(c.data,0),p.set(t.subarray(0,a),c.data.byteLength),c.data=p}}e<r?(u=31&t[e],f=e,h=u,o=0):o=-1}else o=0;else o=3;else o=i?0:2;else o=i?0:1;if(f>=0&&o>=0&&(d={data:t.subarray(f,r),type:h,state:o},l.push(d)),0===l.length){var v=this._getLastNalUnit();if(v){var g=new Uint8Array(v.data.byteLength+t.byteLength);g.set(v.data,0),g.set(t,v.data.byteLength),v.data=g}}return n.naluState=o,l},t.prototype.discardEPB=function(t){for(var e=t.byteLength,r=[],i=1,a=void 0,n=void 0;i<e-2;)0===t[i]&&0===t[i+1]&&3===t[i+2]?(r.push(i+2),i+=2):i++;if(0===r.length)return t;a=e-r.length,n=new Uint8Array(a);var o=0;for(i=0;i<a;o++,i++)o===r[0]&&(o++,r.shift()),n[i]=t[o];return n},t.prototype._parseAACPES=function(t){var e=this._audioTrack,r=t.data,i=t.pts,a=0,n=this.aacOverFlow,o=this.aacLastPTS,s=void 0,l=void 0,d=void 0,u=void 0,f=void 0;if(n){var c=new Uint8Array(n.byteLength+r.byteLength);c.set(n,0),c.set(r,n.byteLength),r=c}for(d=a,f=r.length;d<f-1&&!h(r,d);d++);if(d){var g=void 0,y=void 0;if(d<f-1?(g=\"AAC PES did not start with ADTS header,offset:\"+d,y=!1):(g=\"no ADTS header found in AAC PES\",y=!0),M.b.warn(\"parsing error:\"+g),this.observer.trigger(D.a.ERROR,{type:I.b.MEDIA_ERROR,details:I.a.FRAG_PARSING_ERROR,fatal:y,reason:g}),y)return}if(p(e,this.observer,r,d,this.audioCodec),l=0,s=v(e.samplerate),n&&o){var b=o+s;Math.abs(b-i)>1&&(M.b.log(\"AAC: align PTS for overlapping frames by \"+Math.round((b-i)/90)),i=b)}for(;d<f;)if(h(r,d)&&d+5<f){var E=m(e,r,d,i,l);if(!E)break;d+=E.length,u=E.sample.pts,l++}else d++;n=d<f?r.subarray(d,f):null,this.aacOverFlow=n,this.aacLastPTS=u},t.prototype._parseMPEGPES=function(t){for(var e=t.data,r=e.length,i=0,a=0,n=t.pts;a<r;)if(Y.isHeader(e,a)){var o=Y.appendFrame(this._audioTrack,e,a,n,i);if(!o)break;a+=o.length,i++}else a++},t.prototype._parseID3PES=function(t){this._id3Track.samples.push(t)},t}(),$=J,tt=function(){function t(e,r,i){S(this,t),this.observer=e,this.config=i,this.remuxer=r}return t.prototype.resetInitSegment=function(t,e,r,i){this._audioTrack={container:\"audio/mpeg\",type:\"audio\",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:e,duration:i,inputTimeScale:9e4}},t.prototype.resetTimeStamp=function(){},t.probe=function(t){var e=void 0,r=void 0,i=j.a.getID3Data(t,0);if(i&&void 0!==j.a.getTimeStamp(i))for(e=i.length,r=Math.min(t.length-1,e+100);e<r;e++)if(Y.probe(t,e))return M.b.log(\"MPEG Audio sync word found !\"),!0;return!1},t.prototype.append=function(t,e,r,i){for(var a=j.a.getID3Data(t,0),n=j.a.getTimeStamp(a),o=n?90*n:9e4*e,s=a.length,l=t.length,d=0,u=0,f=this._audioTrack,h=[{pts:o,dts:o,data:a}];s<l;)if(Y.isHeader(t,s)){var c=Y.appendFrame(f,t,s,o,d);if(!c)break;s+=c.length,u=c.sample.pts,d++}else j.a.isHeader(t,s)?(a=j.a.getID3Data(t,s),h.push({pts:u,dts:u,data:a}),s+=a.length):s++;this.remuxer.remux(f,{samples:[]},{samples:h,inputTimeScale:9e4},{samples:[]},e,r,i)},t.prototype.destroy=function(){},t}(),et=tt,rt=function(){function t(){A(this,t)}return t.getSilentFrame=function(t,e){switch(t){case\"mp4a.40.2\":if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},t}(),it=rt,at=Math.pow(2,32)-1,nt=function(){function t(){_(this,t)}return t.init=function(){t.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],\".mp3\":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var e=void 0;for(e in t.types)t.types.hasOwnProperty(e)&&(t.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);t.HDLR_TYPES={video:r,audio:i};var a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n=new Uint8Array([0,0,0,0,0,0,0,0]);t.STTS=t.STSC=t.STCO=n,t.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),t.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),t.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);t.FTYP=t.box(t.types.ftyp,o,l,o,s),t.DINF=t.box(t.types.dinf,t.box(t.types.dref,a))},t.box=function(t){for(var e=Array.prototype.slice.call(arguments,1),r=8,i=e.length,a=i,n=void 0;i--;)r+=e[i].byteLength;for(n=new Uint8Array(r),n[0]=r>>24&255,n[1]=r>>16&255,n[2]=r>>8&255,n[3]=255&r,n.set(t,4),i=0,r=8;i<a;i++)n.set(e[i],r),r+=e[i].byteLength;return n},t.hdlr=function(e){return t.box(t.types.hdlr,t.HDLR_TYPES[e])},t.mdat=function(e){return t.box(t.types.mdat,e)},t.mdhd=function(e,r){r*=e;var i=Math.floor(r/(at+1)),a=Math.floor(r%(at+1));return t.box(t.types.mdhd,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,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a,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,i){return t.box(t.types.moof,t.mfhd(e),t.traf(i,r))},t.moov=function(e){for(var r=e.length,i=[];r--;)i[r]=t.trak(e[r]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(i).concat(t.mvex(e)))},t.mvex=function(e){for(var r=e.length,i=[];r--;)i[r]=t.trex(e[r]);return t.box.apply(null,[t.types.mvex].concat(i))},t.mvhd=function(e,r){r*=e;var i=Math.floor(r/(at+1)),a=Math.floor(r%(at+1)),n=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,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a,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,n)},t.sdtp=function(e){var r=e.samples||[],i=new Uint8Array(4+r.length),a=void 0,n=void 0;for(n=0;n<r.length;n++)a=r[n].flags,i[n+4]=a.dependsOn<<4|a.isDependedOn<<2|a.hasRedundancy;return t.box(t.types.sdtp,i)},t.stbl=function(e){return t.box(t.types.stbl,t.stsd(e),t.box(t.types.stts,t.STTS),t.box(t.types.stsc,t.STSC),t.box(t.types.stsz,t.STSZ),t.box(t.types.stco,t.STCO))},t.avc1=function(e){var r=[],i=[],a=void 0,n=void 0,o=void 0;for(a=0;a<e.sps.length;a++)n=e.sps[a],o=n.byteLength,r.push(o>>>8&255),r.push(255&o),r=r.concat(Array.prototype.slice.call(n));for(a=0;a<e.pps.length;a++)n=e.pps[a],o=n.byteLength,i.push(o>>>8&255),i.push(255&o),i=i.concat(Array.prototype.slice.call(n));var s=t.box(t.types.avcC,new Uint8Array([1,r[3],r[4],r[5],255,224|e.sps.length].concat(r).concat([e.pps.length]).concat(i))),l=e.width,d=e.height,u=e.pixelRatio[0],f=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,d>>8&255,255&d,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,f>>24,f>>16&255,f>>8&255,255&f])))},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,i=e.duration*e.timescale,a=e.width,n=e.height,o=Math.floor(i/(at+1)),s=Math.floor(i%(at+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,o>>24,o>>16&255,o>>8&255,255&o,s>>24,s>>16&255,s>>8&255,255&s,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,a>>8&255,255&a,0,0,n>>8&255,255&n,0,0]))},t.traf=function(e,r){var i=t.sdtp(e),a=e.id,n=Math.floor(r/(at+1)),o=Math.floor(r%(at+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,o>>24,o>>16&255,o>>8&255,255&o])),t.trun(e,i.length+16+20+8+16+8+8),i)},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 i=e.samples||[],a=i.length,n=12+16*a,o=new Uint8Array(n),s=void 0,l=void 0,d=void 0,u=void 0,f=void 0,h=void 0;for(r+=8+n,o.set([0,0,15,1,a>>>24&255,a>>>16&255,a>>>8&255,255&a,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),s=0;s<a;s++)l=i[s],d=l.duration,u=l.size,f=l.flags,h=l.cts,o.set([d>>>24&255,d>>>16&255,d>>>8&255,255&d,u>>>24&255,u>>>16&255,u>>>8&255,255&u,f.isLeading<<2|f.dependsOn,f.isDependedOn<<6|f.hasRedundancy<<4|f.paddingValue<<1|f.isNonSync,61440&f.degradPrio,15&f.degradPrio,h>>>24&255,h>>>16&255,h>>>8&255,255&h],12+16*s);return t.box(t.types.trun,o)},t.initSegment=function(e){t.types||t.init();var r=t.moov(e),i=void 0;return i=new Uint8Array(t.FTYP.byteLength+r.byteLength),i.set(t.FTYP),i.set(r,t.FTYP.byteLength),i},t}(),ot=nt,st=1e4,lt=function(){function t(e,r,i,a){R(this,t),this.observer=e,this.config=r,this.typeSupported=i;var n=navigator.userAgent;this.isSafari=a&&a.indexOf(\"Apple\")>-1&&n&&!n.match(\"CriOS\"),this.ISGenerated=!1}return t.prototype.destroy=function(){},t.prototype.resetTimeStamp=function(t){this._initPTS=this._initDTS=t},t.prototype.resetInitSegment=function(){this.ISGenerated=!1},t.prototype.remux=function(t,e,r,i,a,n,o){if(this.ISGenerated||this.generateIS(t,e,a),this.ISGenerated){var s=t.samples.length,l=e.samples.length,d=a,u=a;if(s&&l){var f=(t.samples[0].dts-e.samples[0].dts)/e.inputTimeScale;d+=Math.max(0,f),u+=Math.max(0,-f)}if(s){t.timescale||(M.b.warn(\"regenerate InitSegment as audio detected\"),this.generateIS(t,e,a));var h=this.remuxAudio(t,d,n,o);if(l){var c=void 0;h&&(c=h.endPTS-h.startPTS),e.timescale||(M.b.warn(\"regenerate InitSegment as video detected\"),this.generateIS(t,e,a)),this.remuxVideo(e,u,n,c,o)}}else if(l){var p=this.remuxVideo(e,u,n,0,o);p&&t.codec&&this.remuxEmptyAudio(t,d,n,p)}}r.samples.length&&this.remuxID3(r,a),i.samples.length&&this.remuxText(i,a),this.observer.trigger(D.a.FRAG_PARSED)},t.prototype.generateIS=function(t,e,r){var i=this.observer,a=t.samples,n=e.samples,o=this.typeSupported,s=\"audio/mp4\",l={},d={tracks:l},u=void 0===this._initPTS,f=void 0,h=void 0;if(u&&(f=h=1/0),t.config&&a.length&&(t.timescale=t.samplerate,M.b.log(\"audio sampling rate : \"+t.samplerate),t.isAAC||(o.mpeg?(s=\"audio/mpeg\",t.codec=\"\"):o.mp3&&(t.codec=\"mp3\")),l.audio={container:s,codec:t.codec,initSegment:!t.isAAC&&o.mpeg?new Uint8Array:ot.initSegment([t]),metadata:{channelCount:t.channelCount}},u&&(f=h=a[0].pts-t.inputTimeScale*r)),e.sps&&e.pps&&n.length){var c=e.inputTimeScale;e.timescale=c,l.video={container:\"video/mp4\",codec:e.codec,initSegment:ot.initSegment([e]),metadata:{width:e.width,height:e.height}},u&&(f=Math.min(f,n[0].pts-c*r),h=Math.min(h,n[0].dts-c*r),this.observer.trigger(D.a.INIT_PTS_FOUND,{initPTS:f}))}Object.keys(l).length?(i.trigger(D.a.FRAG_PARSING_INIT_SEGMENT,d),this.ISGenerated=!0,u&&(this._initPTS=f,this._initDTS=h)):i.trigger(D.a.ERROR,{type:I.b.MEDIA_ERROR,details:I.a.FRAG_PARSING_ERROR,fatal:!1,reason:\"no audio/video samples found\"})},t.prototype.remuxVideo=function(t,e,r,i,a){var n=8,o=t.timescale,s=void 0,l=void 0,d=void 0,u=void 0,f=void 0,h=void 0,c=void 0,p=void 0,v=t.samples,g=[],m=v.length,y=this._PTSNormalize,b=this._initDTS,E=this.nextAvcDts,T=this.isSafari;if(0!==m){T&&(r|=v.length&&E&&(a&&Math.abs(e-E/o)<.1||Math.abs(v[0].pts-E-b)<o/5)),r||(E=e*o),v.forEach(function(t){t.pts=y(t.pts-b,E),t.dts=y(t.dts-b,E)}),v.sort(function(t,e){var r=t.dts-e.dts,i=t.pts-e.pts;return r||i||t.id-e.id});var S=v.reduce(function(t,e){return Math.max(Math.min(t,e.pts-e.dts),-18e3)},0);if(S<0){M.b.warn(\"PTS < DTS detected in video samples, shifting DTS by \"+Math.round(S/90)+\" ms to overcome this issue\");for(var A=0;A<v.length;A++)v[A].dts+=S}var _=v[0];f=Math.max(_.dts,0),u=Math.max(_.pts,0);var R=Math.round((f-E)/90);r&&R&&(R>1?M.b.log(\"AVC:\"+R+\" ms hole between fragments detected,filling it\"):R<-1&&M.b.log(\"AVC:\"+-R+\" ms overlapping between fragments detected\"),f=E,v[0].dts=f,u=Math.max(u-R,E),v[0].pts=u,M.b.log(\"Video/PTS/DTS adjusted: \"+Math.round(u/90)+\"/\"+Math.round(f/90)+\",delta:\"+R+\" ms\")),h=f,_=v[v.length-1],p=Math.max(_.dts,0),c=Math.max(_.pts,0,p),T&&(s=Math.round((p-f)/(v.length-1)));for(var L=0,w=0,O=0;O<m;O++){for(var k=v[O],x=k.units,P=x.length,C=0,F=0;F<P;F++)C+=x[F].data.length;w+=C,L+=P,k.length=C,T?k.dts=f+O*s:k.dts=Math.max(k.dts,f),k.pts=Math.max(k.pts,k.dts)}var N=w+4*L+8;try{l=new Uint8Array(N)}catch(U){return void this.observer.trigger(D.a.ERROR,{type:I.b.MUX_ERROR,details:I.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:N,reason:\"fail allocating video mdat \"+N})}var B=new DataView(l.buffer);B.setUint32(0,N),l.set(ot.types.mdat,4);for(var G=0;G<m;G++){for(var j=v[G],K=j.units,H=0,V=void 0,W=0,Y=K.length;W<Y;W++){var z=K[W],X=z.data,q=z.data.byteLength;B.setUint32(n,q),n+=4,l.set(X,n),n+=q,H+=4+q}if(T)V=Math.max(0,s*Math.round((j.pts-j.dts)/s));else{if(G<m-1)s=v[G+1].dts-j.dts;else{var Q=this.config,Z=j.dts-v[G>0?G-1:G].dts;if(Q.stretchShortVideoTrack){var J=Q.maxBufferHole,$=Math.floor(J*o),tt=(i?u+i*o:this.nextAudioPts)-j.pts;tt>$?(s=tt-Z,s<0&&(s=Z),M.b.log(\"It is approximately \"+tt/90+\" ms to the next segment; using duration \"+s/90+\" ms for the last video frame.\")):s=Z}else s=Z}V=Math.round(j.pts-j.dts)}g.push({size:H,duration:s,cts:V,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:j.key?2:1,isNonSync:j.key?0:1}})}this.nextAvcDts=p+s;var et=t.dropped;if(t.len=0,t.nbNalu=0,t.dropped=0,g.length&&navigator.userAgent.toLowerCase().indexOf(\"chrome\")>-1){var rt=g[0].flags;rt.dependsOn=2,rt.isNonSync=0}t.samples=g,d=ot.moof(t.sequenceNumber++,f,t),t.samples=[];var it={data1:d,data2:l,startPTS:u/o,endPTS:(c+s)/o,startDTS:f/o,endDTS:this.nextAvcDts/o,type:\"video\",hasAudio:!1,hasVideo:!0,nb:g.length,dropped:et};return this.observer.trigger(D.a.FRAG_PARSING_DATA,it),it}},t.prototype.remuxAudio=function(t,e,r,i){var a=t.inputTimeScale,n=t.timescale,o=a/n,s=t.isAAC?1024:1152,l=s*o,d=this._PTSNormalize,u=this._initDTS,f=!t.isAAC&&this.typeSupported.mpeg,h=void 0,c=void 0,p=void 0,v=void 0,g=void 0,m=void 0,y=void 0,b=t.samples,E=[],T=this.nextAudioPts;if(r|=b.length&&T&&(i&&Math.abs(e-T/a)<.1||Math.abs(b[0].pts-T-u)<20*l),b.forEach(function(t){t.pts=t.dts=d(t.pts-u,e*a)}),b=b.filter(function(t){return t.pts>=0}),0!==b.length){if(r||(T=i?e*a:b[0].pts),t.isAAC)for(var S=this.config.maxAudioFramesDrift,A=0,_=T;A<b.length;){var R,L=b[A],w=L.pts;R=w-_;var O=Math.abs(1e3*R/a);if(R<=-S*l)M.b.warn(\"Dropping 1 audio frame @ \"+(_/a).toFixed(3)+\"s due to \"+Math.round(O)+\" ms overlap.\"),b.splice(A,1),t.len-=L.unit.length;else if(R>=S*l&&O<st&&_){var k=Math.round(R/l);M.b.warn(\"Injecting \"+k+\" audio frame @ \"+(_/a).toFixed(3)+\"s due to \"+Math.round(1e3*R/a)+\" ms gap.\");for(var x=0;x<k;x++){var P=Math.max(_,0);p=it.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),p||(M.b.log(\"Unable to get silent frame for given audio codec; duplicating last frame instead.\"),p=L.unit.subarray()),b.splice(A,0,{unit:p,pts:P,dts:P}),t.len+=p.length,_+=l,A++}L.pts=L.dts=_,_+=l,A++}else Math.abs(R)>.1*l,L.pts=L.dts=_,_+=l,A++}for(var C=0,F=b.length;C<F;C++){var N=b[C],U=N.unit,B=N.pts;if(void 0!==y)c.duration=Math.round((B-y)/o);else{var G=Math.round(1e3*(B-T)/a),j=0;if(r&&t.isAAC&&G){if(G>0&&G<st)j=Math.round((B-T)/l),M.b.log(G+\" ms hole between AAC samples detected,filling it\"),j>0&&(p=it.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),p||(p=U.subarray()),t.len+=j*p.length);else if(G<-12){M.b.log(\"drop overlapping AAC sample, expected/parsed/delta:\"+(T/a).toFixed(3)+\"s/\"+(B/a).toFixed(3)+\"s/\"+-G+\"ms\"),t.len-=U.byteLength;continue}B=T}if(m=B,!(t.len>0))return;var K=f?t.len:t.len+8;h=f?0:8;try{v=new Uint8Array(K)}catch(H){return void this.observer.trigger(D.a.ERROR,{type:I.b.MUX_ERROR,details:I.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:K,reason:\"fail allocating audio mdat \"+K})}if(!f){var V=new DataView(v.buffer);V.setUint32(0,K),v.set(ot.types.mdat,4)}for(var W=0;W<j;W++)p=it.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),p||(M.b.log(\"Unable to get silent frame for given audio codec; duplicating this frame instead.\"),p=U.subarray()),v.set(p,h),h+=p.byteLength,c={size:p.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},E.push(c)}v.set(U,h);var Y=U.byteLength;h+=Y,c={size:Y,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},E.push(c),y=B}var z=0,X=E.length;if(X>=2&&(z=E[X-2].duration,c.duration=z),X){this.nextAudioPts=T=y+o*z,t.len=0,t.samples=E,g=f?new Uint8Array:ot.moof(t.sequenceNumber++,m/o,t),t.samples=[];var q=m/a,Q=T/a,Z={data1:g,data2:v,startPTS:q,endPTS:Q,startDTS:q,endDTS:Q,type:\"audio\",hasAudio:!0,hasVideo:!1,nb:X};return this.observer.trigger(D.a.FRAG_PARSING_DATA,Z),Z}return null}},t.prototype.remuxEmptyAudio=function(t,e,r,i){var a=t.inputTimeScale,n=t.samplerate?t.samplerate:a,o=a/n,s=this.nextAudioPts,l=(void 0!==s?s:i.startDTS*a)+this._initDTS,d=i.endDTS*a+this._initDTS,u=1024,f=o*u,h=Math.ceil((d-l)/f),c=it.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(M.b.warn(\"remux empty Audio\"),!c)return void M.b.trace(\"Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!\");for(var p=[],v=0;v<h;v++){var g=l+v*f;p.push({unit:c,pts:g,dts:g}),t.len+=c.length}t.samples=p,this.remuxAudio(t,e,r)},t.prototype.remuxID3=function(t,e){var r=t.samples.length,i=void 0,a=t.inputTimeScale,n=this._initPTS,o=this._initDTS;if(r){for(var s=0;s<r;s++)i=t.samples[s],i.pts=(i.pts-n)/a,i.dts=(i.dts-o)/a;this.observer.trigger(D.a.FRAG_PARSING_METADATA,{samples:t.samples})}t.samples=[],e=e},t.prototype.remuxText=function(t,e){t.samples.sort(function(t,e){return t.pts-e.pts});var r=t.samples.length,i=void 0,a=t.inputTimeScale,n=this._initPTS;if(r){for(var o=0;o<r;o++)i=t.samples[o],i.pts=(i.pts-n)/a;this.observer.trigger(D.a.FRAG_PARSING_USERDATA,{samples:t.samples})}t.samples=[],e=e},t.prototype._PTSNormalize=function(t,e){var r=void 0;if(void 0===e)return t;for(r=e<t?-8589934592:8589934592;Math.abs(t-e)>4294967296;)t+=r;return t},t}(),dt=lt,ut=function(){function t(e){L(this,t),this.observer=e}return t.prototype.destroy=function(){},t.prototype.resetTimeStamp=function(){},t.prototype.resetInitSegment=function(){},t.prototype.remux=function(t,e,r,i,a,n,o,s){var l=this.observer,d=\"\";t&&(d+=\"audio\"),e&&(d+=\"video\"),l.trigger(D.a.FRAG_PARSING_DATA,{data1:s,startPTS:a,startDTS:a,type:d,hasAudio:!!t,hasVideo:!!e,nb:1,dropped:0}),l.trigger(D.a.FRAG_PARSED)},t}(),ft=ut,ht=Object(N.a)(),ct=ht,pt=function(){function t(e,r,i,a){w(this,t),this.observer=e,this.typeSupported=r,this.config=i,this.vendor=a}return t.prototype.destroy=function(){var t=this.demuxer;t&&t.destroy()},t.prototype.push=function(t,e,r,i,a,n,o,s,l,d,u,f){if(t.byteLength>0&&null!=e&&null!=e.key&&\"AES-128\"===e.method){var h=this.decrypter;null==h&&(h=this.decrypter=new G(this.observer,this.config));var c=this,p=void 0;try{p=ct.now()}catch(v){p=Date.now()}h.decrypt(t,e.key.buffer,e.iv.buffer,function(t){var h=void 0;try{h=ct.now()}catch(v){h=Date.now()}c.observer.trigger(D.a.FRAG_DECRYPTED,{stats:{tstart:p,tdecrypt:h}}),c.pushDecrypted(new Uint8Array(t),e,new Uint8Array(r),i,a,n,o,s,l,d,u,f)})}else this.pushDecrypted(new Uint8Array(t),e,new Uint8Array(r),i,a,n,o,s,l,d,u,f)},t.prototype.pushDecrypted=function(t,e,r,i,a,n,o,s,l,d,u,f){var h=this.demuxer;if(!h||(o||s)&&!this.probe(t)){for(var c=this.observer,p=this.typeSupported,v=this.config,g=[{demux:$,remux:dt},{demux:V.a,remux:ft},{demux:H,remux:dt\n},{demux:et,remux:dt}],m=0,y=g.length;m<y;m++){var b=g[m],E=b.demux.probe;if(E(t)){var T=this.remuxer=new b.remux(c,v,p,this.vendor);h=new b.demux(c,T,v,p),this.probe=E;break}}if(!h)return void c.trigger(D.a.ERROR,{type:I.b.MEDIA_ERROR,details:I.a.FRAG_PARSING_ERROR,fatal:!0,reason:\"no demux matching with content found\"});this.demuxer=h}var S=this.remuxer;(o||s)&&(h.resetInitSegment(r,i,a,d),S.resetInitSegment()),o&&(h.resetTimeStamp(f),S.resetTimeStamp(f)),\"function\"==typeof h.setDecryptData&&h.setDecryptData(e),h.append(t,n,l,u)},t}();e.a=pt},function(t,e,r){\"use strict\";function i(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function a(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function n(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function o(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function s(t,e){var r=Ft[e];return!!r&&r[t.slice(0,4)]===!0}function l(t,e){return window.MediaSource.isTypeSupported((e||\"video\")+'/mp4;codecs=\"'+t+'\"')}function d(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function u(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function f(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}function h(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function c(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function p(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}function v(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function g(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function m(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}function y(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function b(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function E(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}function T(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function S(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function A(){if(\"undefined\"!=typeof window)return window.MediaSource||window.WebKitMediaSource}function _(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function R(t,e,r){switch(e){case\"audio\":t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds.push(r);break;case\"text\":t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds.push(r)}}function L(t,e,r){var i=t[e],a=t[r],n=a.startPTS;isNaN(n)?r>e?a.start=i.start+i.duration:a.start=Math.max(i.start-a.duration,0):r>e?(i.duration=n-i.start,i.duration<0&&bt.b.warn(\"negative duration computed for frag \"+i.sn+\",level \"+i.level+\", there should be some duration drift between playlist and fragment!\")):(a.duration=i.start-n,a.duration<0&&bt.b.warn(\"negative duration computed for frag \"+a.sn+\",level \"+a.level+\", there should be some duration drift between playlist and fragment!\"))}function w(t,e,r,i,a,n){var o=r;if(!isNaN(e.startPTS)){var s=Math.abs(e.startPTS-r);isNaN(e.deltaPTS)?e.deltaPTS=s:e.deltaPTS=Math.max(s,e.deltaPTS),o=Math.max(r,e.startPTS),r=Math.min(r,e.startPTS),i=Math.max(i,e.endPTS),a=Math.min(a,e.startDTS),n=Math.max(n,e.endDTS)}var l=r-e.start;e.start=e.startPTS=r,e.maxStartPTS=o,e.endPTS=i,e.startDTS=a,e.endDTS=n,e.duration=i-r;var d=e.sn;if(!t||d<t.startSN||d>t.endSN)return 0;var u=void 0,f=void 0,h=void 0;for(u=d-t.startSN,f=t.fragments,f[u]=e,h=u;h>0;h--)L(f,h,h-1);for(h=u;h<f.length-1;h++)L(f,h,h+1);return t.PTSKnown=!0,l}function D(t,e){var r=Math.max(t.startSN,e.startSN)-e.startSN,i=Math.min(t.endSN,e.endSN)-e.startSN,a=e.startSN-t.startSN,n=t.fragments,o=e.fragments,s=0,l=void 0;if(e.initSegment&&t.initSegment&&(e.initSegment=t.initSegment),i<r)return void(e.PTSKnown=!1);for(var d=r;d<=i;d++){var u=n[a+d],f=o[d];f&&u&&(s=u.cc-f.cc,isNaN(u.startPTS)||(f.start=f.startPTS=u.startPTS,f.endPTS=u.endPTS,f.duration=u.duration,f.backtracked=u.backtracked,f.dropped=u.dropped,l=f))}if(s)for(bt.b.log(\"discontinuity sliding from playlist, take drift into account\"),d=0;d<o.length;d++)o[d].cc+=s;if(l)w(e,l,l.startPTS,l.endPTS,l.startDTS,l.endDTS);else if(a>=0&&a<n.length){var h=n[a].start;for(d=0;d<o.length;d++)o[d].start+=h}e.PTSKnown=t.PTSKnown}function I(t,e){for(var r=null,i=0;i<t.length;i+=1){var a=t[i];if(a&&a.cc===e){r=a;break}}return r}function O(t,e,r){var i=!1;return e&&e.details&&r&&(r.endCC>r.startCC||t&&t.cc<r.startCC)&&(i=!0),i}function k(t,e){var r=t.fragments,i=e.fragments;if(!i.length||!r.length)return void bt.b.log(\"No fragments to align\");var a=I(r,i[0].cc);return!a||a&&!a.startPTS?void bt.b.log(\"No frag in previous level to align on\"):a}function x(t,e){e.fragments.forEach(function(e){if(e){var r=e.start+t;e.start=e.startPTS=r,e.endPTS=r+e.duration}}),e.PTSKnown=!0}function P(t,e,r){if(O(t,e,r)){var i=k(e.details,r);i&&(bt.b.log(\"Adjusting PTS using last level due to CC increase within current level\"),x(i.start,r))}if(r.PTSKnown===!1&&e&&e.details&&e.details.fragments&&e.details.fragments.length){var a=e.details.programDateTime,n=r.programDateTime,o=(n-a)/1e3+e.details.fragments[0].start;isNaN(o)||(bt.b.log(\"adjusting PTS using programDateTime delta, sliding:\"+o.toFixed(3)),x(o,r))}}function C(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function F(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}function M(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function N(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments[2],i=0;if(r.programDateTime){var a=Date.parse(r.programDateTime);isNaN(a)||(i=1e3*e+a-1e3*t)}return i}function U(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!Array.isArray(t)||!t.length||null===e)return null;var r=t[0];if(e<r.pdt)return null;var i=t[t.length-1];if(e>=i.endPdt)return null;for(var a=0;a<t.length;++a){var n=t[a];if(e<n.endPdt)return n}return null}function B(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,n=void 0,o=t?e[t.sn-e[0].sn+1]:null;return r<i&&(r>i-a&&(a=0),n=o&&!G(r,a,o)?o:ie.search(e,G.bind(null,r,a))),n}function G(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments[2],i=Math.min(e,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-i<=t?1:r.start-i>t&&r.start?-1:0}function j(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function K(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}function H(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function V(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function W(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}function Y(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function z(t,e){var r=null;try{r=new window.Event(\"addtrack\")}catch(i){r=document.createEvent(\"Event\"),r.initEvent(\"addtrack\",!1,!1)}r.track=t,e.dispatchEvent(r)}function X(t){if(t&&t.cues)for(;t.cues.length>0;)t.removeCue(t.cues[0])}function q(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function Q(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}function Z(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function J(){var t=A(),e=window.SourceBuffer||window.WebKitSourceBuffer,r=t&&\"function\"==typeof t.isTypeSupported&&t.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"'),i=!e||e.prototype&&\"function\"==typeof e.prototype.appendBuffer&&\"function\"==typeof e.prototype.remove;return!!r&&!!i}function $(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function tt(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function et(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function rt(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}function it(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function at(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function nt(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}function ot(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function st(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function lt(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}function dt(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function ut(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function ft(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}function ht(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function ct(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function pt(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}Object.defineProperty(e,\"__esModule\",{value:!0});var vt=r(5),gt=r.n(vt),mt=r(2),yt=r(1),bt=r(0),Et=\"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},Tt=new Set([\"hlsEventGeneric\",\"hlsHandlerDestroying\",\"hlsHandlerDestroyed\"]),St=function(){function t(e){i(this,t),this.hls=e,this.onEvent=this.onEvent.bind(this);for(var r=arguments.length,a=Array(r>1?r-1:0),n=1;n<r;n++)a[n-1]=arguments[n];this.handledEvents=a,this.useGenericHandler=!0,this.registerListeners()}return t.prototype.destroy=function(){this.onHandlerDestroying(),this.unregisterListeners(),this.onHandlerDestroyed()},t.prototype.onHandlerDestroying=function(){},t.prototype.onHandlerDestroyed=function(){},t.prototype.isEventHandler=function(){return\"object\"===Et(this.handledEvents)&&this.handledEvents.length&&\"function\"==typeof this.onEvent},t.prototype.registerListeners=function(){this.isEventHandler()&&this.handledEvents.forEach(function(t){if(Tt.has(t))throw new Error(\"Forbidden event-name: \"+t);this.hls.on(t,this.onEvent)},this)},t.prototype.unregisterListeners=function(){this.isEventHandler()&&this.handledEvents.forEach(function(t){this.hls.off(t,this.onEvent)},this)},t.prototype.onEvent=function(t,e){this.onEventGeneric(t,e)},t.prototype.onEventGeneric=function(t,e){var r=function(t,e){var r=\"on\"+t.replace(\"hls\",\"\");if(\"function\"!=typeof this[r])throw new Error(\"Event \"+t+\" has no generic handler in this \"+this.constructor.name+\" class (tried \"+r+\")\");return this[r].bind(this,e)};try{r.call(this,t,e).call()}catch(i){bt.b.error(\"An internal error happened while handling event \"+t+'. Error message: \"'+i.message+'\". Here is a stacktrace:',i),this.hls.trigger(yt.a.ERROR,{type:mt.b.OTHER_ERROR,details:mt.a.INTERNAL_EXCEPTION,fatal:!1,event:t,err:i})}},t}(),At=St,_t=r(8),Rt=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,\"value\"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),Lt=function(){function t(){a(this,t),this.method=null,this.key=null,this.iv=null,this._uri=null}return Rt(t,[{key:\"uri\",get:function(){return!this._uri&&this.reluri&&(this._uri=gt.a.buildAbsoluteURL(this.baseuri,this.reluri,{alwaysNormalize:!0})),this._uri}}]),t}(),wt=Lt,Dt=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,\"value\"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),It=function(){function t(){var e;n(this,t),this._url=null,this._byteRange=null,this._decryptdata=null,this.tagList=[],this._elementaryStreams=(e={},e[t.ElementaryStreamTypes.AUDIO]=!1,e[t.ElementaryStreamTypes.VIDEO]=!1,e)}return t.prototype.addElementaryStream=function(t){this._elementaryStreams[t]=!0},t.prototype.hasElementaryStream=function(t){return this._elementaryStreams[t]===!0},t.prototype.createInitializationVector=function(t){for(var e=new Uint8Array(16),r=12;r<16;r++)e[r]=t>>8*(15-r)&255;return e},t.prototype.fragmentDecryptdataFromLevelkey=function(t,e){var r=t;return t&&t.method&&t.uri&&!t.iv&&(r=new wt,r.method=t.method,r.baseuri=t.baseuri,r.reluri=t.reluri,r.iv=this.createInitializationVector(e)),r},Dt(t,[{key:\"url\",get:function(){return!this._url&&this.relurl&&(this._url=gt.a.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(t){this._url=t}},{key:\"programDateTime\",get:function(){return!this._programDateTime&&this.rawProgramDateTime&&(this._programDateTime=new Date(Date.parse(this.rawProgramDateTime))),this._programDateTime}},{key:\"byteRange\",get:function(){if(!this._byteRange&&!this.rawByteRange)return[];if(this._byteRange)return this._byteRange;var t=[];if(this.rawByteRange){var e=this.rawByteRange.split(\"@\",2);if(1===e.length){var r=this.lastByteRangeEndOffset;t[0]=r||0}else t[0]=parseInt(e[1]);t[1]=parseInt(e[0])+t[0],this._byteRange=t}return t}},{key:\"byteRangeStartOffset\",get:function(){return this.byteRange[0]}},{key:\"byteRangeEndOffset\",get:function(){return this.byteRange[1]}},{key:\"decryptdata\",get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata}},{key:\"encrypted\",get:function(){return!(!this.decryptdata||null===this.decryptdata.uri||null!==this.decryptdata.key)}}],[{key:\"ElementaryStreamTypes\",get:function(){return{AUDIO:\"audio\",VIDEO:\"video\"}}}]),t}(),Ot=It,kt=/^(\\d+)x(\\d+)$/,xt=/\\s*(.+?)\\s*=((?:\\\".*?\\\")|.*?)(?:,|$)/g,Pt=function(){function t(e){o(this,t),\"string\"==typeof e&&(e=t.parseAttrList(e));for(var r in e)e.hasOwnProperty(r)&&(this[r]=e[r])}return t.prototype.decimalInteger=function(t){var e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e},t.prototype.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),i=0;i<e.length/2;i++)r[i]=parseInt(e.slice(2*i,2*i+2),16);return r}return null},t.prototype.hexadecimalIntegerAsNumber=function(t){var e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e},t.prototype.decimalFloatingPoint=function(t){return parseFloat(this[t])},t.prototype.enumeratedString=function(t){return this[t]},t.prototype.decimalResolution=function(t){var e=kt.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},t.parseAttrList=function(t){var e=void 0,r={};for(xt.lastIndex=0;null!==(e=xt.exec(t));){var i=e[2],a='\"';0===i.indexOf(a)&&i.lastIndexOf(a)===i.length-1&&(i=i.slice(1,-1)),r[e[1]]=i}return r},t}(),Ct=Pt,Ft={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,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}},Mt=/#EXT-X-STREAM-INF:([^\\n\\r]*)[\\r\\n]+([^\\r\\n]+)/g,Nt=/#EXT-X-MEDIA:(.*)/g,Ut=new RegExp([/#EXTINF:\\s*(\\d*(?:\\.\\d+)?)(?:,(.*)\\s+)?/.source,/|(?!#)(\\S+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(\"\"),\"g\"),Bt=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\\d+))|(?:#EXT-X-(TARGETDURATION): *(\\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)(.*):(.*))|(?:(#)(.*))(?:.*)\\r?\\n?/,Gt=/\\.(mp4|m4s|m4v|m4a)$/i,jt=function(){function t(){d(this,t)}return t.findGroup=function(t,e){if(!t)return null;for(var r=null,i=0;i<t.length;i++){var a=t[i];a.id===e&&(r=a)}return r},t.convertAVC1ToAVCOTI=function(t){var e=void 0,r=t.split(\".\");return r.length>2?(e=r.shift()+\".\",e+=parseInt(r.shift()).toString(16),e+=(\"000\"+parseInt(r.shift()).toString(16)).substr(-4)):e=t,e},t.resolve=function(t,e){return gt.a.buildAbsoluteURL(e,t,{alwaysNormalize:!0})},t.parseMasterPlaylist=function(e,r){function i(t,e){[\"video\",\"audio\"].forEach(function(r){var i=t.filter(function(t){return s(t,r)});if(i.length){var a=i.filter(function(t){return 0===t.lastIndexOf(\"avc1\",0)||0===t.lastIndexOf(\"mp4a\",0)});e[r+\"Codec\"]=a.length>0?a[0]:i[0],t=t.filter(function(t){return i.indexOf(t)===-1})}}),e.unknownCodecs=t}var a=[],n=void 0;for(Mt.lastIndex=0;null!=(n=Mt.exec(e));){var o={},l=o.attrs=new Ct(n[1]);o.url=t.resolve(n[2],r);var d=l.decimalResolution(\"RESOLUTION\");d&&(o.width=d.width,o.height=d.height),o.bitrate=l.decimalInteger(\"AVERAGE-BANDWIDTH\")||l.decimalInteger(\"BANDWIDTH\"),o.name=l.NAME,i([].concat((l.CODECS||\"\").split(/[ ,]+/)),o),o.videoCodec&&o.videoCodec.indexOf(\"avc1\")!==-1&&(o.videoCodec=t.convertAVC1ToAVCOTI(o.videoCodec)),a.push(o)}return a},t.parseMasterPlaylistMedia=function(e,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],n=void 0,o=[],s=0;for(Nt.lastIndex=0;null!==(n=Nt.exec(e));){var l={},d=new Ct(n[1]);if(d.TYPE===i){if(l.groupId=d[\"GROUP-ID\"],l.name=d.NAME,l.type=i,l[\"default\"]=\"YES\"===d.DEFAULT,l.autoselect=\"YES\"===d.AUTOSELECT,l.forced=\"YES\"===d.FORCED,d.URI&&(l.url=t.resolve(d.URI,r)),l.lang=d.LANGUAGE,l.name||(l.name=l.lang),a.length){var u=t.findGroup(a,l.groupId);l.audioCodec=u?u.codec:a[0].codec}l.id=s++,o.push(l)}}return o},t.parseLevelPlaylist=function(t,e,r,i,a){var n=0,o=0,s={type:null,version:null,url:e,fragments:[],live:!0,startSN:0},l=new wt,d=0,u=null,f=new Ot,h=void 0,c=void 0;for(Ut.lastIndex=0;null!==(h=Ut.exec(t));){var p=h[1];if(p){f.duration=parseFloat(p);var v=(\" \"+h[2]).slice(1);f.title=v||null,f.tagList.push(v?[\"INF\",p,v]:[\"INF\",p])}else if(h[3]){if(!isNaN(f.duration)){var g=n++;f.type=i,f.start=o,f.levelkey=l,f.sn=g,f.level=r,f.cc=d,f.urlId=a,f.baseurl=e,f.relurl=(\" \"+h[3]).slice(1),s.programDateTime&&(u?f.rawProgramDateTime?f.pdt=Date.parse(f.rawProgramDateTime):f.pdt=u.pdt+1e3*u.duration:f.pdt=Date.parse(s.programDateTime),f.endPdt=f.pdt+1e3*f.duration),s.fragments.push(f),u=f,o+=f.duration,f=new Ot}}else if(h[4]){if(f.rawByteRange=(\" \"+h[4]).slice(1),u){var m=u.byteRangeEndOffset;m&&(f.lastByteRangeEndOffset=m)}}else if(h[5])f.rawProgramDateTime=(\" \"+h[5]).slice(1),f.tagList.push([\"PROGRAM-DATE-TIME\",f.rawProgramDateTime]),void 0===s.programDateTime&&(s.programDateTime=new Date(new Date(Date.parse(h[5]))-1e3*o));else{for(h=h[0].match(Bt),c=1;c<h.length&&void 0===h[c];c++);var y=(\" \"+h[c+1]).slice(1),b=(\" \"+h[c+2]).slice(1);switch(h[c]){case\"#\":f.tagList.push(b?[y,b]:[y]);break;case\"PLAYLIST-TYPE\":s.type=y.toUpperCase();break;case\"MEDIA-SEQUENCE\":n=s.startSN=parseInt(y);break;case\"TARGETDURATION\":s.targetduration=parseFloat(y);break;case\"VERSION\":s.version=parseInt(y);break;case\"EXTM3U\":break;case\"ENDLIST\":s.live=!1;break;case\"DIS\":d++,f.tagList.push([\"DIS\"]);break;case\"DISCONTINUITY-SEQ\":d=parseInt(y);break;case\"KEY\":var E=y,T=new Ct(E),S=T.enumeratedString(\"METHOD\"),A=T.URI,_=T.hexadecimalInteger(\"IV\");S&&(l=new wt,A&&[\"AES-128\",\"SAMPLE-AES\",\"SAMPLE-AES-CENC\"].indexOf(S)>=0&&(l.method=S,l.baseuri=e,l.reluri=A,l.key=null,l.iv=_));break;case\"START\":var R=y,L=new Ct(R),w=L.decimalFloatingPoint(\"TIME-OFFSET\");isNaN(w)||(s.startTimeOffset=w);break;case\"MAP\":var D=new Ct(y);f.relurl=D.URI,f.rawByteRange=D.BYTERANGE,f.baseurl=e,f.level=r,f.type=i,f.sn=\"initSegment\",s.initSegment=f,f=new Ot;break;default:bt.b.warn(\"line parsed but not handled: \"+h)}}}return f=u,f&&!f.relurl&&(s.fragments.pop(),o-=f.duration),s.totalduration=o,s.averagetargetduration=o/s.fragments.length,s.endSN=n-1,s.startCC=s.fragments[0]?s.fragments[0].cc:0,s.endCC=d,!s.initSegment&&s.fragments.length&&s.fragments.every(function(t){return Gt.test(t.relurl)})&&(bt.b.warn(\"MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX\"),f=new Ot,f.relurl=s.fragments[0].relurl,f.baseurl=e,f.level=r,f.type=i,f.sn=\"initSegment\",s.initSegment=f,s.needSidxRanges=!0),s},t}(),Kt=jt,Ht=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,\"value\"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),Vt=window,Wt=Vt.performance,Yt={MANIFEST:\"manifest\",LEVEL:\"level\",AUDIO_TRACK:\"audioTrack\",SUBTITLE_TRACK:\"subtitleTrack\"},zt={MAIN:\"main\",AUDIO:\"audio\",SUBTITLE:\"subtitle\"},Xt=function(t){function e(r){u(this,e);var i=f(this,t.call(this,r,yt.a.MANIFEST_LOADING,yt.a.LEVEL_LOADING,yt.a.AUDIO_TRACK_LOADING,yt.a.SUBTITLE_TRACK_LOADING));return i.loaders={},i}return h(e,t),e.canHaveQualityLevels=function(t){return t!==Yt.AUDIO_TRACK&&t!==Yt.SUBTITLE_TRACK},e.mapContextToLevelType=function(t){var e=t.type;switch(e){case Yt.AUDIO_TRACK:return zt.AUDIO;case Yt.SUBTITLE_TRACK:return zt.SUBTITLE;default:return zt.MAIN}},e.getResponseUrl=function(t,e){var r=t.url;return void 0!==r&&0!==r.indexOf(\"data:\")||(r=e.url),r},e.prototype.createInternalLoader=function(t){var e=this.hls.config,r=e.pLoader,i=e.loader,a=r||i,n=new a(e);return t.loader=n,this.loaders[t.type]=n,n},e.prototype.getInternalLoader=function(t){return this.loaders[t.type]},e.prototype.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},e.prototype.destroyInternalLoaders=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}},e.prototype.destroy=function(){this.destroyInternalLoaders(),t.prototype.destroy.call(this)},e.prototype.onManifestLoading=function(t){this.load(t.url,{type:Yt.MANIFEST,level:0,id:null})},e.prototype.onLevelLoading=function(t){this.load(t.url,{type:Yt.LEVEL,level:t.level,id:t.id})},e.prototype.onAudioTrackLoading=function(t){this.load(t.url,{type:Yt.AUDIO_TRACK,level:0,id:t.id})},e.prototype.onSubtitleTrackLoading=function(t){this.load(t.url,{type:Yt.SUBTITLE_TRACK,level:0,id:t.id})},e.prototype.load=function(t,e){var r=this.hls.config;bt.b.debug(\"Loading playlist of type \"+e.type+\", level: \"+e.level+\", id: \"+e.id);var i=this.getInternalLoader(e);if(i){var a=i.context;if(a&&a.url===t)return bt.b.trace(\"playlist request ongoing\"),!1;bt.b.warn(\"aborting previous loader for type: \"+e.type),i.abort()}var n=void 0,o=void 0,s=void 0,l=void 0;switch(e.type){case Yt.MANIFEST:n=r.manifestLoadingMaxRetry,o=r.manifestLoadingTimeOut,s=r.manifestLoadingRetryDelay,l=r.manifestLoadingMaxRetryTimeout;break;case Yt.LEVEL:n=0,o=r.levelLoadingTimeOut;break;default:n=r.levelLoadingMaxRetry,o=r.levelLoadingTimeOut,s=r.levelLoadingRetryDelay,l=r.levelLoadingMaxRetryTimeout}i=this.createInternalLoader(e),e.url=t,e.responseType=e.responseType||\"\";var d={timeout:o,maxRetry:n,retryDelay:s,maxRetryDelay:l},u={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};return bt.b.debug(\"Calling internal loader delegate for URL: \"+t),i.load(e,d,u),!0},e.prototype.loadsuccess=function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(r.isSidxRequest)return this._handleSidxRequest(t,r),void this._handlePlaylistLoaded(t,e,r,i);this.resetInternalLoader(r.type);var a=t.data;return e.tload=Wt.now(),0!==a.indexOf(\"#EXTM3U\")?void this._handleManifestParsingError(t,r,\"no EXTM3U delimiter\",i):void(a.indexOf(\"#EXTINF:\")>0||a.indexOf(\"#EXT-X-TARGETDURATION:\")>0?this._handleTrackOrLevelPlaylist(t,e,r,i):this._handleMasterPlaylist(t,e,r,i))},e.prototype.loaderror=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._handleNetworkError(e,r)},e.prototype.loadtimeout=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._handleNetworkError(e,r,!0)},e.prototype._handleMasterPlaylist=function(t,r,i,a){var n=this.hls,o=t.data,s=e.getResponseUrl(t,i),l=Kt.parseMasterPlaylist(o,s);if(!l.length)return void this._handleManifestParsingError(t,i,\"no level found in manifest\",a);var d=l.map(function(t){return{id:t.attrs.AUDIO,codec:t.audioCodec}}),u=Kt.parseMasterPlaylistMedia(o,s,\"AUDIO\",d),f=Kt.parseMasterPlaylistMedia(o,s,\"SUBTITLES\");if(u.length){var h=!1;u.forEach(function(t){t.url||(h=!0)}),h===!1&&l[0].audioCodec&&!l[0].attrs.AUDIO&&(bt.b.log(\"audio codec signaled in quality level, but no embedded audio track signaled, create one\"),u.unshift({type:\"main\",name:\"main\"}))}n.trigger(yt.a.MANIFEST_LOADED,{levels:l,audioTracks:u,subtitles:f,url:s,stats:r,networkDetails:a})},e.prototype._handleTrackOrLevelPlaylist=function(t,r,i,a){var n=this.hls,o=i.id,s=i.level,l=i.type,d=e.getResponseUrl(t,i),u=isNaN(o)?0:o,f=isNaN(s)?u:s,h=e.mapContextToLevelType(i),c=Kt.parseLevelPlaylist(t.data,d,f,h,u);if(c.tload=r.tload,l===Yt.MANIFEST){var p={url:d,details:c};n.trigger(yt.a.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:d,stats:r,networkDetails:a})}if(r.tparsed=Wt.now(),c.needSidxRanges){var v=c.initSegment.url;return void this.load(v,{isSidxRequest:!0,type:l,level:s,levelDetails:c,id:o,rangeStart:0,rangeEnd:2048,responseType:\"arraybuffer\"})}i.levelDetails=c,this._handlePlaylistLoaded(t,r,i,a)},e.prototype._handleSidxRequest=function(t,e){var r=_t.a.parseSegmentIndex(new Uint8Array(t.data));r.references.forEach(function(t,r){var i=t.info,a=e.levelDetails.fragments[r];0===a.byteRange.length&&(a.rawByteRange=String(1+i.end-i.start)+\"@\"+String(i.start))}),e.levelDetails.initSegment.rawByteRange=String(r.moovEndOffset)+\"@0\"},e.prototype._handleManifestParsingError=function(t,e,r,i){this.hls.trigger(yt.a.ERROR,{type:mt.b.NETWORK_ERROR,details:mt.a.MANIFEST_PARSING_ERROR,fatal:!0,url:t.url,reason:r,networkDetails:i})},e.prototype._handleNetworkError=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];bt.b.info(\"A network error occured while loading a \"+t.type+\"-type playlist\");var i=void 0,a=void 0,n=this.getInternalLoader(t);switch(t.type){case Yt.MANIFEST:i=r?mt.a.MANIFEST_LOAD_TIMEOUT:mt.a.MANIFEST_LOAD_ERROR,a=!0;break;case Yt.LEVEL:i=r?mt.a.LEVEL_LOAD_TIMEOUT:mt.a.LEVEL_LOAD_ERROR,a=!1;break;case Yt.AUDIO_TRACK:i=r?mt.a.AUDIO_TRACK_LOAD_TIMEOUT:mt.a.AUDIO_TRACK_LOAD_ERROR,a=!1;break;default:a=!1}n&&(n.abort(),this.resetInternalLoader(t.type)),this.hls.trigger(yt.a.ERROR,{type:mt.b.NETWORK_ERROR,details:i,fatal:a,url:n.url,loader:n,context:t,networkDetails:e})},e.prototype._handlePlaylistLoaded=function(t,r,i,a){var n=i.type,o=i.level,s=i.id,l=i.levelDetails;if(!l.targetduration)return void this._handleManifestParsingError(t,i,\"invalid target duration\",a);var d=e.canHaveQualityLevels(i.type);if(d)this.hls.trigger(yt.a.LEVEL_LOADED,{details:l,level:o||0,id:s||0,stats:r,networkDetails:a});else switch(n){case Yt.AUDIO_TRACK:this.hls.trigger(yt.a.AUDIO_TRACK_LOADED,{details:l,id:s,stats:r,networkDetails:a});break;case Yt.SUBTITLE_TRACK:this.hls.trigger(yt.a.SUBTITLE_TRACK_LOADED,{details:l,id:s,stats:r,networkDetails:a})}},Ht(e,null,[{key:\"ContextType\",get:function(){return Yt}},{key:\"LevelType\",get:function(){return zt}}]),e}(At),qt=Xt,Qt=function(t){function e(r){c(this,e);var i=p(this,t.call(this,r,yt.a.FRAG_LOADING));return i.loaders={},i}return v(e,t),e.prototype.destroy=function(){var e=this.loaders;for(var r in e){var i=e[r];i&&i.destroy()}this.loaders={},t.prototype.destroy.call(this)},e.prototype.onFragLoading=function(t){var e=t.frag,r=e.type,i=this.loaders,a=this.hls.config,n=a.fLoader,o=a.loader;e.loaded=0;var s=i[r];s&&(bt.b.warn(\"abort previous fragment loader for type: \"+r),s.abort()),s=i[r]=e.loader=a.fLoader?new n(a):new o(a);\nvar l=void 0,d=void 0,u=void 0;l={url:e.url,frag:e,responseType:\"arraybuffer\",progressData:!1};var f=e.byteRangeStartOffset,h=e.byteRangeEndOffset;isNaN(f)||isNaN(h)||(l.rangeStart=f,l.rangeEnd=h),d={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:a.fragLoadingMaxRetryTimeout},u={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},s.load(l,d,u)},e.prototype.loadsuccess=function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=t.data,n=r.frag;n.loader=void 0,this.loaders[n.type]=void 0,this.hls.trigger(yt.a.FRAG_LOADED,{payload:a,frag:n,stats:e,networkDetails:i})},e.prototype.loaderror=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=e.loader;i&&i.abort(),this.loaders[e.type]=void 0,this.hls.trigger(yt.a.ERROR,{type:mt.b.NETWORK_ERROR,details:mt.a.FRAG_LOAD_ERROR,fatal:!1,frag:e.frag,response:t,networkDetails:r})},e.prototype.loadtimeout=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=e.loader;i&&i.abort(),this.loaders[e.type]=void 0,this.hls.trigger(yt.a.ERROR,{type:mt.b.NETWORK_ERROR,details:mt.a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e.frag,networkDetails:r})},e.prototype.loadprogress=function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=e.frag;a.loaded=t.loaded,this.hls.trigger(yt.a.FRAG_LOAD_PROGRESS,{frag:a,stats:t,networkDetails:i})},e}(At),Zt=Qt,Jt=function(t){function e(r){g(this,e);var i=m(this,t.call(this,r,yt.a.KEY_LOADING));return i.loaders={},i.decryptkey=null,i.decrypturl=null,i}return y(e,t),e.prototype.destroy=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={},At.prototype.destroy.call(this)},e.prototype.onKeyLoading=function(t){var e=t.frag,r=e.type,i=this.loaders[r],a=e.decryptdata,n=a.uri;if(n!==this.decrypturl||null===this.decryptkey){var o=this.hls.config;i&&(bt.b.warn(\"abort previous key loader for type:\"+r),i.abort()),e.loader=this.loaders[r]=new o.loader(o),this.decrypturl=n,this.decryptkey=null;var s=void 0,l=void 0,d=void 0;s={url:n,frag:e,responseType:\"arraybuffer\"},l={timeout:o.fragLoadingTimeOut,maxRetry:o.fragLoadingMaxRetry,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},e.loader.load(s,l,d)}else this.decryptkey&&(a.key=this.decryptkey,this.hls.trigger(yt.a.KEY_LOADED,{frag:e}))},e.prototype.loadsuccess=function(t,e,r){var i=r.frag;this.decryptkey=i.decryptdata.key=new Uint8Array(t.data),i.loader=void 0,this.loaders[i.type]=void 0,this.hls.trigger(yt.a.KEY_LOADED,{frag:i})},e.prototype.loaderror=function(t,e){var r=e.frag,i=r.loader;i&&i.abort(),this.loaders[e.type]=void 0,this.hls.trigger(yt.a.ERROR,{type:mt.b.NETWORK_ERROR,details:mt.a.KEY_LOAD_ERROR,fatal:!1,frag:r,response:t})},e.prototype.loadtimeout=function(t,e){var r=e.frag,i=r.loader;i&&i.abort(),this.loaders[e.type]=void 0,this.hls.trigger(yt.a.ERROR,{type:mt.b.NETWORK_ERROR,details:mt.a.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},e}(At),$t=Jt,te={NOT_LOADED:\"NOT_LOADED\",APPENDING:\"APPENDING\",PARTIAL:\"PARTIAL\",OK:\"OK\"},ee=function(t){function e(r){b(this,e);var i=E(this,t.call(this,r,yt.a.BUFFER_APPENDED,yt.a.FRAG_BUFFERED,yt.a.FRAG_LOADED));return i.bufferPadding=.2,i.fragments=Object.create(null),i.timeRanges=Object.create(null),i.config=r.config,i}return T(e,t),e.prototype.destroy=function(){this.fragments=null,this.timeRanges=null,this.config=null,At.prototype.destroy.call(this),t.prototype.destroy.call(this)},e.prototype.getBufferedFrag=function(t,e){var r=this.fragments,i=Object.keys(r).filter(function(i){var a=r[i];if(a.body.type!==e)return!1;if(!a.buffered)return!1;var n=a.body;return n.startPTS<=t&&t<=n.endPTS});if(0===i.length)return null;var a=i.pop();return r[a].body},e.prototype.detectEvictedFragments=function(t,e){var r=this,i=void 0,a=void 0;Object.keys(this.fragments).forEach(function(n){var o=r.fragments[n];if(o.buffered===!0){var s=o.range[t];if(s){i=s.time;for(var l=0;l<i.length;l++)if(a=i[l],r.isTimeBuffered(a.startPTS,a.endPTS,e)===!1){r.removeFragment(o.body);break}}}})},e.prototype.detectPartialFragments=function(t){var e=this,r=this.getFragmentKey(t),i=this.fragments[r];i&&(i.buffered=!0,Object.keys(this.timeRanges).forEach(function(r){if(t.hasElementaryStream(r)===!0){var a=e.timeRanges[r];i.range[r]=e.getBufferedTimes(t.startPTS,t.endPTS,a)}}))},e.prototype.getBufferedTimes=function(t,e,r){for(var i=[],a=void 0,n=void 0,o=!1,s=0;s<r.length;s++){if(a=r.start(s)-this.bufferPadding,n=r.end(s)+this.bufferPadding,t>=a&&e<=n){i.push({startPTS:Math.max(t,r.start(s)),endPTS:Math.min(e,r.end(s))});break}if(t<n&&e>a)i.push({startPTS:Math.max(t,r.start(s)),endPTS:Math.min(e,r.end(s))}),o=!0;else if(e<=a)break}return{time:i,partial:o}},e.prototype.getFragmentKey=function(t){return t.type+\"_\"+t.level+\"_\"+t.urlId+\"_\"+t.sn},e.prototype.getPartialFragment=function(t){var e=this,r=void 0,i=void 0,a=void 0,n=null,o=0;return Object.keys(this.fragments).forEach(function(s){var l=e.fragments[s];e.isPartial(l)&&(i=l.body.startPTS-e.bufferPadding,a=l.body.endPTS+e.bufferPadding,t>=i&&t<=a&&(r=Math.min(t-i,a-t),o<=r&&(n=l.body,o=r)))}),n},e.prototype.getState=function(t){var e=this.getFragmentKey(t),r=this.fragments[e],i=te.NOT_LOADED;return void 0!==r&&(i=r.buffered?this.isPartial(r)===!0?te.PARTIAL:te.OK:te.APPENDING),i},e.prototype.isPartial=function(t){return t.buffered===!0&&(void 0!==t.range.video&&t.range.video.partial===!0||void 0!==t.range.audio&&t.range.audio.partial===!0)},e.prototype.isTimeBuffered=function(t,e,r){for(var i=void 0,a=void 0,n=0;n<r.length;n++){if(i=r.start(n)-this.bufferPadding,a=r.end(n)+this.bufferPadding,t>=i&&e<=a)return!0;if(e<=i)return!1}return!1},e.prototype.onFragLoaded=function(t){var e=t.frag;if(!isNaN(e.sn)&&!e.bitrateTest){var r=this.getFragmentKey(e),i={body:e,range:Object.create(null),buffered:!1};this.fragments[r]=i}},e.prototype.onBufferAppended=function(t){var e=this;this.timeRanges=t.timeRanges,Object.keys(this.timeRanges).forEach(function(t){var r=e.timeRanges[t];e.detectEvictedFragments(t,r)})},e.prototype.onFragBuffered=function(t){this.detectPartialFragments(t.frag)},e.prototype.hasFragment=function(t){var e=this.getFragmentKey(t);return void 0!==this.fragments[e]},e.prototype.removeFragment=function(t){var e=this.getFragmentKey(t);delete this.fragments[e]},e.prototype.removeAllFragments=function(){this.fragments=Object.create(null)},e}(At),re={search:function(t,e){for(var r=0,i=t.length-1,a=null,n=null;r<=i;){a=(r+i)/2|0,n=t[a];var o=e(n);if(o>0)r=a+1;else{if(!(o<0))return n;i=a-1}}return null}},ie=re,ae=function(){function t(){S(this,t)}return t.isBuffered=function(t,e){try{if(t)for(var r=t.buffered,i=0;i<r.length;i++)if(e>=r.start(i)&&e<=r.end(i))return!0}catch(a){}return!1},t.bufferInfo=function(t,e,r){try{if(t){var i=t.buffered,a=[],n=void 0;for(n=0;n<i.length;n++)a.push({start:i.start(n),end:i.end(n)});return this.bufferedInfo(a,e,r)}}catch(o){}return{len:0,start:e,end:e,nextStart:void 0}},t.bufferedInfo=function(t,e,r){var i=[],a=void 0,n=void 0,o=void 0,s=void 0,l=void 0;for(t.sort(function(t,e){var r=t.start-e.start;return r?r:e.end-t.end}),l=0;l<t.length;l++){var d=i.length;if(d){var u=i[d-1].end;t[l].start-u<r?t[l].end>u&&(i[d-1].end=t[l].end):i.push(t[l])}else i.push(t[l])}for(l=0,a=0,n=o=e;l<i.length;l++){var f=i[l].start,h=i[l].end;if(e+r>=f&&e<h)n=f,o=h,a=o-e;else if(e+r<f){s=f;break}}return{len:a,start:n,end:o,nextStart:s}},t}(),ne=r(6),oe=r.n(ne),se=r(11),le=r.n(se),de=r(9),ue=r(4),fe=Object(ue.a)(),he=A(),ce=function(){function t(e,r){_(this,t),this.hls=e,this.id=r;var i=this.observer=new oe.a,a=e.config;i.trigger=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),a=1;a<e;a++)r[a-1]=arguments[a];i.emit.apply(i,[t,t].concat(r))},i.off=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),a=1;a<e;a++)r[a-1]=arguments[a];i.removeListener.apply(i,[t].concat(r))};var n=function(t,r){r=r||{},r.frag=this.frag,r.id=this.id,e.trigger(t,r)}.bind(this);i.on(yt.a.FRAG_DECRYPTED,n),i.on(yt.a.FRAG_PARSING_INIT_SEGMENT,n),i.on(yt.a.FRAG_PARSING_DATA,n),i.on(yt.a.FRAG_PARSED,n),i.on(yt.a.ERROR,n),i.on(yt.a.FRAG_PARSING_METADATA,n),i.on(yt.a.FRAG_PARSING_USERDATA,n),i.on(yt.a.INIT_PTS_FOUND,n);var o={mp4:he.isTypeSupported(\"video/mp4\"),mpeg:he.isTypeSupported(\"audio/mpeg\"),mp3:he.isTypeSupported('audio/mp4; codecs=\"mp3\"')},s=navigator.vendor;if(a.enableWorker&&\"undefined\"!=typeof Worker){bt.b.log(\"demuxing in webworker\");var l=void 0;try{l=this.w=le()(12),this.onwmsg=this.onWorkerMessage.bind(this),l.addEventListener(\"message\",this.onwmsg),l.onerror=function(t){e.trigger(yt.a.ERROR,{type:mt.b.OTHER_ERROR,details:mt.a.INTERNAL_EXCEPTION,fatal:!0,event:\"demuxerWorker\",err:{message:t.message+\" (\"+t.filename+\":\"+t.lineno+\")\"}})},l.postMessage({cmd:\"init\",typeSupported:o,vendor:s,id:r,config:JSON.stringify(a)})}catch(d){bt.b.error(\"error while initializing DemuxerWorker, fallback on DemuxerInline\"),l&&fe.URL.revokeObjectURL(l.objectURL),this.demuxer=new de.a(i,o,a,s),this.w=void 0}}else this.demuxer=new de.a(i,o,a,s)}return t.prototype.destroy=function(){var t=this.w;if(t)t.removeEventListener(\"message\",this.onwmsg),t.terminate(),this.w=null;else{var e=this.demuxer;e&&(e.destroy(),this.demuxer=null)}var r=this.observer;r&&(r.removeAllListeners(),this.observer=null)},t.prototype.push=function(t,e,r,i,a,n,o,s){var l=this.w,d=isNaN(a.startDTS)?a.start:a.startDTS,u=a.decryptdata,f=this.frag,h=!(f&&a.cc===f.cc),c=!(f&&a.level===f.level),p=f&&a.sn===f.sn+1,v=!c&&p;if(h&&bt.b.log(this.id+\":discontinuity detected\"),c&&bt.b.log(this.id+\":switch detected\"),this.frag=a,l)l.postMessage({cmd:\"demux\",data:t,decryptdata:u,initSegment:e,audioCodec:r,videoCodec:i,timeOffset:d,discontinuity:h,trackSwitch:c,contiguous:v,duration:n,accurateTimeOffset:o,defaultInitPTS:s},t instanceof ArrayBuffer?[t]:[]);else{var g=this.demuxer;g&&g.push(t,u,e,r,i,d,h,c,v,n,o,s)}},t.prototype.onWorkerMessage=function(t){var e=t.data,r=this.hls;switch(e.event){case\"init\":fe.URL.revokeObjectURL(this.w.objectURL);break;case yt.a.FRAG_PARSING_DATA:e.data.data1=new Uint8Array(e.data1),e.data2&&(e.data.data2=new Uint8Array(e.data2));default:e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,r.trigger(e.event,e.data)}},t}(),pe=ce,ve={toString:function(t){for(var e=\"\",r=t.length,i=0;i<r;i++)e+=\"[\"+t.start(i).toFixed(3)+\",\"+t.end(i).toFixed(3)+\"]\";return e}},ge=ve,me=function(t){function e(r){C(this,e);for(var i=arguments.length,a=Array(i>1?i-1:0),n=1;n<i;n++)a[n-1]=arguments[n];var o=F(this,t.call.apply(t,[this,r].concat(a)));return o._tickInterval=null,o._tickTimer=null,o._tickCallCount=0,o._boundTick=o.tick.bind(o),o}return M(e,t),e.prototype.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},e.prototype.hasInterval=function(){return!!this._tickInterval},e.prototype.hasNextTick=function(){return!!this._tickTimer},e.prototype.setInterval=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t){return!this._tickInterval&&(this._tickInterval=setInterval(this._boundTick,t),!0)}),e.prototype.clearInterval=function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(){return!!this._tickInterval&&(clearInterval(this._tickInterval),this._tickInterval=null,!0)}),e.prototype.clearNextTick=function(){return!!this._tickTimer&&(clearTimeout(this._tickTimer),this._tickTimer=null,!0)},e.prototype.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&(this.clearNextTick(),this._tickTimer=setTimeout(this._boundTick,0)),this._tickCallCount=0)},e.prototype.doTick=function(){},e}(At),ye=me,be=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,\"value\"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),Ee={STOPPED:\"STOPPED\",IDLE:\"IDLE\",KEY_LOADING:\"KEY_LOADING\",FRAG_LOADING:\"FRAG_LOADING\",FRAG_LOADING_WAITING_RETRY:\"FRAG_LOADING_WAITING_RETRY\",WAITING_LEVEL:\"WAITING_LEVEL\",PARSING:\"PARSING\",PARSED:\"PARSED\",BUFFER_FLUSHING:\"BUFFER_FLUSHING\",ENDED:\"ENDED\",ERROR:\"ERROR\"},Te=function(t){function e(r,i){j(this,e);var a=K(this,t.call(this,r,yt.a.MEDIA_ATTACHED,yt.a.MEDIA_DETACHING,yt.a.MANIFEST_LOADING,yt.a.MANIFEST_PARSED,yt.a.LEVEL_LOADED,yt.a.KEY_LOADED,yt.a.FRAG_LOADED,yt.a.FRAG_LOAD_EMERGENCY_ABORTED,yt.a.FRAG_PARSING_INIT_SEGMENT,yt.a.FRAG_PARSING_DATA,yt.a.FRAG_PARSED,yt.a.ERROR,yt.a.AUDIO_TRACK_SWITCHING,yt.a.AUDIO_TRACK_SWITCHED,yt.a.BUFFER_CREATED,yt.a.BUFFER_APPENDED,yt.a.BUFFER_FLUSHED));return a.fragmentTracker=i,a.config=r.config,a.audioCodecSwap=!1,a._state=Ee.STOPPED,a.stallReported=!1,a}return H(e,t),e.prototype.onHandlerDestroying=function(){this.stopLoad(),t.prototype.onHandlerDestroying.call(this)},e.prototype.onHandlerDestroyed=function(){this.state=Ee.STOPPED,this.fragmentTracker=null,t.prototype.onHandlerDestroyed.call(this)},e.prototype.startLoad=function(t){if(this.levels){var e=this.lastCurrentTime,r=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var i=r.startLevel;i===-1&&(i=0,this.bitrateTest=!0),this.level=r.nextLoadLevel=i,this.loadedmetadata=!1}e>0&&t===-1&&(bt.b.log(\"override startPosition with lastCurrentTime @\"+e.toFixed(3)),t=e),this.state=Ee.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this.forceStartLoad=!0,this.state=Ee.STOPPED},e.prototype.stopLoad=function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragmentTracker.removeFragment(t),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.clearInterval(),this.state=Ee.STOPPED,this.forceStartLoad=!1},e.prototype.doTick=function(){switch(this.state){case Ee.BUFFER_FLUSHING:this.fragLoadError=0;break;case Ee.IDLE:this._doTickIdle();break;case Ee.WAITING_LEVEL:var t=this.levels[this.level];t&&t.details&&(this.state=Ee.IDLE);break;case Ee.FRAG_LOADING_WAITING_RETRY:var e=window.performance.now(),r=this.retryDate;(!r||e>=r||this.media&&this.media.seeking)&&(bt.b.log(\"mediaController: retryDate reached, switch back to IDLE state\"),this.state=Ee.IDLE);break;case Ee.ERROR:case Ee.STOPPED:case Ee.FRAG_LOADING:case Ee.PARSING:case Ee.PARSED:case Ee.ENDED:}this._checkBuffer(),this._checkFragmentChanged()},e.prototype._doTickIdle=function(){var t=this.hls,e=t.config,r=this.media;if(void 0!==this.levelLastLoaded&&(r||!this.startFragRequested&&e.startFragPrefetch)){var i=void 0;i=this.loadedmetadata?r.currentTime:this.nextLoadPosition;var a=t.nextLoadLevel,n=this.levels[a];if(n){var o=n.bitrate,s=void 0;s=o?Math.max(8*e.maxBufferSize/o,e.maxBufferLength):e.maxBufferLength,s=Math.min(s,e.maxMaxBufferLength);var l=ae.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,i,e.maxBufferHole),d=l.len;if(!(d>=s)){bt.b.trace(\"buffer length of \"+d.toFixed(3)+\" is below max of \"+s.toFixed(3)+\". checking for more payload ...\"),this.level=t.nextLoadLevel=a;var u=n.details;if(!u||u.live&&this.levelLastLoaded!==a)return void(this.state=Ee.WAITING_LEVEL);var f=this.fragPrevious;if(!u.live&&f&&!f.backtracked&&f.sn===u.endSN&&!l.nextStart){var h=Math.min(r.duration,f.start+f.duration);if(h-Math.max(l.end,f.start)<=Math.max(.2,f.duration)){var c={};return this.altAudio&&(c.type=\"video\"),this.hls.trigger(yt.a.BUFFER_EOS,c),void(this.state=Ee.ENDED)}}this._fetchPayloadOrEos(i,l,u)}}}},e.prototype._fetchPayloadOrEos=function(t,e,r){var i=this.fragPrevious,a=this.level,n=r.fragments,o=n.length;if(0!==o){var s=n[0].start,l=n[o-1].start+n[o-1].duration,d=e.end,u=void 0;if(r.initSegment&&!r.initSegment.data)u=r.initSegment;else if(r.live){var f=this.config.initialLiveManifestSize;if(o<f)return void bt.b.warn(\"Can not start playback of a level, reason: not enough fragments \"+o+\" < \"+f);if(u=this._ensureFragmentAtLivePoint(r,d,s,l,i,n,o),null===u)return}else d<s&&(u=n[0]);u||(u=this._findFragment(s,i,o,n,d,l,r)),u&&(u.encrypted?(bt.b.log(\"Loading key for \"+u.sn+\" of [\"+r.startSN+\" ,\"+r.endSN+\"],level \"+a),this._loadKey(u)):(bt.b.log(\"Loading \"+u.sn+\" of [\"+r.startSN+\" ,\"+r.endSN+\"],level \"+a+\", currentTime:\"+t.toFixed(3)+\",bufferEnd:\"+d.toFixed(3)),this._loadFragment(u)))}},e.prototype._ensureFragmentAtLivePoint=function(t,e,r,i,a,n,o){var s=this.hls.config,l=this.media,d=void 0,u=void 0!==s.liveMaxLatencyDuration?s.liveMaxLatencyDuration:s.liveMaxLatencyDurationCount*t.targetduration;if(e<Math.max(r-s.maxFragLookUpTolerance,i-u)){var f=this.liveSyncPosition=this.computeLivePosition(r,t);bt.b.log(\"buffer end: \"+e.toFixed(3)+\" is located too far from the end of live sliding playlist, reset currentTime to : \"+f.toFixed(3)),e=f,l&&l.readyState&&l.duration>f&&(l.currentTime=f),this.nextLoadPosition=f}if(t.PTSKnown&&e>i&&l&&l.readyState)return null;if(this.startFragRequested&&!t.PTSKnown){if(a)if(t.programDateTime)d=U(n,a.endPdt+1);else{var h=a.sn+1;if(h>=t.startSN&&h<=t.endSN){var c=n[h-t.startSN];a.cc===c.cc&&(d=c,bt.b.log(\"live playlist, switching playlist, load frag with next SN: \"+d.sn))}d||(d=ie.search(n,function(t){return a.cc-t.cc}),d&&bt.b.log(\"live playlist, switching playlist, load frag with same CC: \"+d.sn))}d||(d=n[Math.min(o-1,Math.round(o/2))],bt.b.log(\"live playlist, switching playlist, unknown, load middle frag : \"+d.sn))}return d},e.prototype._findFragment=function(t,e,r,i,a,n,o){var s=this.hls.config,l=function(){return B(e,i,a,n,s.maxFragLookUpTolerance)},d=void 0,u=void 0;if(a<n?o.programDateTime?(u=U(i,N(t,a,o)),u&&!G(a,s.maxFragLookUpTolerance,u)||(bt.b.warn(\"Frag found by PDT search did not fit within tolerance; falling back to finding by SN\"),u=l())):u=B(e,i,a,n,s.maxFragLookUpTolerance):u=i[r-1],u){d=u;var f=d.sn-o.startSN,h=e&&d.level===e.level,c=i[f-1],p=i[f+1];if(e&&d.sn===e.sn)if(h&&!d.backtracked)if(d.sn<o.endSN){var v=e.deltaPTS;v&&v>s.maxBufferHole&&e.dropped&&f?(d=c,bt.b.warn(\"SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this\")):(d=p,bt.b.log(\"SN just loaded, load next one: \"+d.sn))}else d=null;else d.backtracked&&(p&&p.backtracked?(bt.b.warn(\"Already backtracked from fragment \"+p.sn+\", will not backtrack to fragment \"+d.sn+\". Loading fragment \"+p.sn),d=p):(bt.b.warn(\"Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe\"),d.dropped=0,c?(d=c,d.backtracked=!0):f&&(d=null)))}return d},e.prototype._loadKey=function(t){this.state=Ee.KEY_LOADING,this.hls.trigger(yt.a.KEY_LOADING,{frag:t})},e.prototype._loadFragment=function(t){var e=this.fragmentTracker.getState(t);this.fragCurrent=t,this.startFragRequested=!0,isNaN(t.sn)||t.bitrateTest||(this.nextLoadPosition=t.start+t.duration),t.backtracked||e===te.NOT_LOADED||e===te.PARTIAL?(t.autoLevel=this.hls.autoLevelEnabled,t.bitrateTest=this.bitrateTest,this.hls.trigger(yt.a.FRAG_LOADING,{frag:t}),this.demuxer||(this.demuxer=new pe(this.hls,\"main\")),this.state=Ee.FRAG_LOADING):e===te.APPENDING&&this._reduceMaxBufferLength(t.duration)&&this.fragmentTracker.removeFragment(t)},e.prototype.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,qt.LevelType.MAIN)},e.prototype.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.endPTS+.5):null},e.prototype._checkFragmentChanged=function(){var t=void 0,e=void 0,r=this.media;if(r&&r.readyState&&r.seeking===!1&&(e=r.currentTime,e>this.lastCurrentTime&&(this.lastCurrentTime=e),ae.isBuffered(r,e)?t=this.getBufferedFrag(e):ae.isBuffered(r,e+.1)&&(t=this.getBufferedFrag(e+.1)),t)){var i=t;if(i!==this.fragPlaying){this.hls.trigger(yt.a.FRAG_CHANGED,{frag:i});var a=i.level;this.fragPlaying&&this.fragPlaying.level===a||this.hls.trigger(yt.a.LEVEL_SWITCHED,{level:a}),this.fragPlaying=i}}},e.prototype.immediateLevelSwitch=function(){if(bt.b.log(\"immediateLevelSwitch\"),!this.immediateSwitch){this.immediateSwitch=!0;var t=this.media,e=void 0;t?(e=t.paused,t.pause()):e=!0,this.previouslyPaused=e}var r=this.fragCurrent;r&&r.loader&&r.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},e.prototype.immediateLevelSwitchEnd=function(){var t=this.media;t&&t.buffered.length&&(this.immediateSwitch=!1,ae.isBuffered(t,t.currentTime)&&(t.currentTime-=1e-4),this.previouslyPaused||t.play())},e.prototype.nextLevelSwitch=function(){var t=this.media;if(t&&t.readyState){var e=void 0,r=void 0,i=void 0;if(r=this.getBufferedFrag(t.currentTime),r&&r.startPTS>1&&this.flushMainBuffer(0,r.startPTS-1),t.paused)e=0;else{var a=this.hls.nextLoadLevel,n=this.levels[a],o=this.fragLastKbps;e=o&&this.fragCurrent?this.fragCurrent.duration*n.bitrate/(1e3*o)+1:0}if(i=this.getBufferedFrag(t.currentTime+e),i&&(i=this.followingBufferedFrag(i))){var s=this.fragCurrent;s&&s.loader&&s.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(i.maxStartPTS,Number.POSITIVE_INFINITY)}}},e.prototype.flushMainBuffer=function(t,e){this.state=Ee.BUFFER_FLUSHING;var r={startOffset:t,endOffset:e};this.altAudio&&(r.type=\"video\"),this.hls.trigger(yt.a.BUFFER_FLUSHING,r)},e.prototype.onMediaAttached=function(t){var e=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),e.addEventListener(\"seeking\",this.onvseeking),e.addEventListener(\"seeked\",this.onvseeked),e.addEventListener(\"ended\",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.hls.startLoad(r.startPosition)},e.prototype.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(bt.b.log(\"MSE detaching and video ended, reset startPosition\"),this.startPosition=this.lastCurrentTime=0);var e=this.levels;e&&e.forEach(function(t){t.details&&t.details.fragments.forEach(function(t){t.backtracked=void 0})}),t&&(t.removeEventListener(\"seeking\",this.onvseeking),t.removeEventListener(\"seeked\",this.onvseeked),t.removeEventListener(\"ended\",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},e.prototype.onMediaSeeking=function(){var t=this.media,e=t?t.currentTime:void 0,r=this.config;isNaN(e)||bt.b.log(\"media seeking to \"+e.toFixed(3));var i=this.mediaBuffer?this.mediaBuffer:t,a=ae.bufferInfo(i,e,this.config.maxBufferHole);if(this.state===Ee.FRAG_LOADING){var n=this.fragCurrent;if(0===a.len&&n){var o=r.maxFragLookUpTolerance,s=n.start-o,l=n.start+n.duration+o;e<s||e>l?(n.loader&&(bt.b.log(\"seeking outside of buffer while fragment load in progress, cancel fragment load\"),n.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=Ee.IDLE):bt.b.log(\"seeking outside of buffer but within currently loaded fragment range\")}}else this.state===Ee.ENDED&&(0===a.len&&(this.fragPrevious=0),this.state=Ee.IDLE);t&&(this.lastCurrentTime=e),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=e),this.tick()},e.prototype.onMediaSeeked=function(){var t=this.media,e=t?t.currentTime:void 0;isNaN(e)||bt.b.log(\"media seeked to \"+e.toFixed(3)),this.tick()},e.prototype.onMediaEnded=function(){bt.b.log(\"media ended\"),this.startPosition=this.lastCurrentTime=0},e.prototype.onManifestLoading=function(){bt.b.log(\"trigger BUFFER_RESET\"),this.hls.trigger(yt.a.BUFFER_RESET),this.fragmentTracker.removeAllFragments(),this.stalled=!1,this.startPosition=this.lastCurrentTime=0},e.prototype.onManifestParsed=function(t){var e=!1,r=!1,i=void 0;t.levels.forEach(function(t){i=t.audioCodec,i&&(i.indexOf(\"mp4a.40.2\")!==-1&&(e=!0),i.indexOf(\"mp4a.40.5\")!==-1&&(r=!0))}),this.audioCodecSwitch=e&&r,this.audioCodecSwitch&&bt.b.log(\"both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC\"),this.levels=t.levels,this.startFragRequested=!1;var a=this.config;(a.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(a.startPosition)},e.prototype.onLevelLoaded=function(t){var e=t.details,r=t.level,i=this.levels[this.levelLastLoaded],a=this.levels[r],n=e.totalduration,o=0;if(bt.b.log(\"level \"+r+\" loaded [\"+e.startSN+\",\"+e.endSN+\"],duration:\"+n),e.live){var s=a.details;s&&e.fragments.length>0?(D(s,e),o=e.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(o,s),e.PTSKnown&&!isNaN(o)?bt.b.log(\"live playlist sliding:\"+o.toFixed(3)):(bt.b.log(\"live playlist - outdated PTS, unknown sliding\"),P(this.fragPrevious,i,e))):(bt.b.log(\"live playlist - first load, unknown sliding\"),e.PTSKnown=!1,P(this.fragPrevious,i,e))}else e.PTSKnown=!1;if(a.details=e,this.levelLastLoaded=r,this.hls.trigger(yt.a.LEVEL_UPDATED,{details:e,level:r}),this.startFragRequested===!1){if(this.startPosition===-1||this.lastCurrentTime===-1){var l=e.startTimeOffset;isNaN(l)?e.live?(this.startPosition=this.computeLivePosition(o,e),bt.b.log(\"configure startPosition to \"+this.startPosition)):this.startPosition=0:(l<0&&(bt.b.log(\"negative start time offset \"+l+\", count from end of last fragment\"),l=o+n+l),bt.b.log(\"start time offset found in playlist, adjust startPosition to \"+l),this.startPosition=l),this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===Ee.WAITING_LEVEL&&(this.state=Ee.IDLE),this.tick()},e.prototype.onKeyLoaded=function(){this.state===Ee.KEY_LOADING&&(this.state=Ee.IDLE,this.tick())},e.prototype.onFragLoaded=function(t){var e=this.fragCurrent,r=t.frag;if(this.state===Ee.FRAG_LOADING&&e&&\"main\"===r.type&&r.level===e.level&&r.sn===e.sn){var i=t.stats,a=this.levels[e.level],n=a.details;if(bt.b.log(\"Loaded  \"+e.sn+\" of [\"+n.startSN+\" ,\"+n.endSN+\"],level \"+e.level),this.bitrateTest=!1,this.stats=i,r.bitrateTest===!0&&this.hls.nextLoadLevel)this.state=Ee.IDLE,this.startFragRequested=!1,i.tparsed=i.tbuffered=window.performance.now(),this.hls.trigger(yt.a.FRAG_BUFFERED,{stats:i,frag:e,id:\"main\"}),this.tick();else if(\"initSegment\"===r.sn)this.state=Ee.IDLE,i.tparsed=i.tbuffered=window.performance.now(),n.initSegment.data=t.payload,this.hls.trigger(yt.a.FRAG_BUFFERED,{stats:i,frag:e,id:\"main\"}),this.tick();else{this.state=Ee.PARSING;var o=n.totalduration,s=e.level,l=e.sn,d=this.config.defaultAudioCodec||a.audioCodec;this.audioCodecSwap&&(bt.b.log(\"swapping playlist audio codec\"),void 0===d&&(d=this.lastAudioCodec),d&&(d=d.indexOf(\"mp4a.40.5\")!==-1?\"mp4a.40.2\":\"mp4a.40.5\")),this.pendingBuffering=!0,this.appended=!1,bt.b.log(\"Parsing \"+l+\" of [\"+n.startSN+\" ,\"+n.endSN+\"],level \"+s+\", cc \"+e.cc);var u=this.demuxer;u||(u=this.demuxer=new pe(this.hls,\"main\"));var f=this.media,h=f&&f.seeking,c=!h&&(n.PTSKnown||!n.live),p=n.initSegment?n.initSegment.data:[];u.push(t.payload,p,d,a.videoCodec,e,o,c,void 0)}}this.fragLoadError=0},e.prototype.onFragParsingInitSegment=function(t){var e=this.fragCurrent,r=t.frag;if(e&&\"main\"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===Ee.PARSING){var i=t.tracks,a=void 0,n=void 0;if(i.audio&&this.altAudio&&delete i.audio,n=i.audio){var o=this.levels[this.level].audioCodec,s=navigator.userAgent.toLowerCase();o&&this.audioCodecSwap&&(bt.b.log(\"swapping playlist audio codec\"),o=o.indexOf(\"mp4a.40.5\")!==-1?\"mp4a.40.2\":\"mp4a.40.5\"),this.audioCodecSwitch&&1!==n.metadata.channelCount&&s.indexOf(\"firefox\")===-1&&(o=\"mp4a.40.5\"),s.indexOf(\"android\")!==-1&&\"audio/mpeg\"!==n.container&&(o=\"mp4a.40.2\",bt.b.log(\"Android: force audio codec to \"+o)),n.levelCodec=o,n.id=t.id}n=i.video,n&&(n.levelCodec=this.levels[this.level].videoCodec,n.id=t.id),this.hls.trigger(yt.a.BUFFER_CODECS,i);for(a in i){n=i[a],bt.b.log(\"main track:\"+a+\",container:\"+n.container+\",codecs[level/parsed]=[\"+n.levelCodec+\"/\"+n.codec+\"]\");var l=n.initSegment;l&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(yt.a.BUFFER_APPENDING,{type:a,data:l,parent:\"main\",content:\"initSegment\"}))}this.tick()}},e.prototype.onFragParsingData=function(t){var e=this,r=this.fragCurrent,i=t.frag;if(r&&\"main\"===t.id&&i.sn===r.sn&&i.level===r.level&&(\"audio\"!==t.type||!this.altAudio)&&this.state===Ee.PARSING){var a=this.levels[this.level],n=r;if(isNaN(t.endPTS)&&(t.endPTS=t.startPTS+r.duration,t.endDTS=t.startDTS+r.duration),t.hasAudio===!0&&n.addElementaryStream(Ot.ElementaryStreamTypes.AUDIO),t.hasVideo===!0&&n.addElementaryStream(Ot.ElementaryStreamTypes.VIDEO),bt.b.log(\"Parsed \"+t.type+\",PTS:[\"+t.startPTS.toFixed(3)+\",\"+t.endPTS.toFixed(3)+\"],DTS:[\"+t.startDTS.toFixed(3)+\"/\"+t.endDTS.toFixed(3)+\"],nb:\"+t.nb+\",dropped:\"+(t.dropped||0)),\"video\"===t.type)if(n.dropped=t.dropped,n.dropped)if(n.backtracked)bt.b.warn(\"Already backtracked on this fragment, appending with the gap\",n.sn);else{var o=a.details;if(!o||n.sn!==o.startSN)return bt.b.warn(\"missing video frame(s), backtracking fragment\",n.sn),this.fragmentTracker.removeFragment(n),n.backtracked=!0,this.nextLoadPosition=t.startPTS,this.state=Ee.IDLE,this.fragPrevious=n,void this.tick();bt.b.warn(\"missing video frame(s) on first frag, appending with gap\",n.sn)}else n.backtracked=!1;var s=w(a.details,n,t.startPTS,t.endPTS,t.startDTS,t.endDTS),l=this.hls;l.trigger(yt.a.LEVEL_PTS_UPDATED,{details:a.details,level:this.level,drift:s,type:t.type,start:t.startPTS,end:t.endPTS}),[t.data1,t.data2].forEach(function(r){r&&r.length&&e.state===Ee.PARSING&&(e.appended=!0,e.pendingBuffering=!0,l.trigger(yt.a.BUFFER_APPENDING,{type:t.type,data:r,parent:\"main\",content:\"data\"}))}),this.tick()}},e.prototype.onFragParsed=function(t){var e=this.fragCurrent,r=t.frag;e&&\"main\"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===Ee.PARSING&&(this.stats.tparsed=window.performance.now(),this.state=Ee.PARSED,this._checkAppendedParsed())},e.prototype.onAudioTrackSwitching=function(t){var e=!!t.url,r=t.id;if(!e){if(this.mediaBuffer!==this.media){bt.b.log(\"switching on main audio, use media.buffered to schedule main fragment loading\"),this.mediaBuffer=this.media;var i=this.fragCurrent;i.loader&&(bt.b.log(\"switching to main audio track, cancel main fragment load\"),i.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=Ee.IDLE}var a=this.hls;a.trigger(yt.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:\"audio\"}),a.trigger(yt.a.AUDIO_TRACK_SWITCHED,{id:r}),this.altAudio=!1}},e.prototype.onAudioTrackSwitched=function(t){var e=t.id,r=!!this.hls.audioTracks[e].url;if(r){var i=this.videoBuffer;i&&this.mediaBuffer!==i&&(bt.b.log(\"switching on alternate audio, use video.buffered to schedule main fragment loading\"),this.mediaBuffer=i)}this.altAudio=r,this.tick()},e.prototype.onBufferCreated=function(t){var e=t.tracks,r=void 0,i=void 0,a=!1;for(var n in e){var o=e[n];\"main\"===o.id?(i=n,r=o,\"video\"===n&&(this.videoBuffer=e[n].buffer)):a=!0}a&&r?(bt.b.log(\"alternate track found, use \"+i+\".buffered to schedule main fragment loading\"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media},e.prototype.onBufferAppended=function(t){if(\"main\"===t.parent){var e=this.state;e!==Ee.PARSING&&e!==Ee.PARSED||(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},e.prototype._checkAppendedParsed=function(){if(!(this.state!==Ee.PARSED||this.appended&&this.pendingBuffering)){var t=this.fragCurrent;if(t){var e=this.mediaBuffer?this.mediaBuffer:this.media;bt.b.log(\"main buffered : \"+ge.toString(e.buffered)),this.fragPrevious=t;var r=this.stats;r.tbuffered=window.performance.now(),this.fragLastKbps=Math.round(8*r.total/(r.tbuffered-r.tfirst)),this.hls.trigger(yt.a.FRAG_BUFFERED,{stats:r,frag:t,id:\"main\"}),this.state=Ee.IDLE}this.tick()}},e.prototype.onError=function(t){var e=t.frag||this.fragCurrent;if(!e||\"main\"===e.type){var r=!!this.media&&ae.isBuffered(this.media,this.media.currentTime)&&ae.isBuffered(this.media,this.media.currentTime+.5);switch(t.details){case mt.a.FRAG_LOAD_ERROR:case mt.a.FRAG_LOAD_TIMEOUT:case mt.a.KEY_LOAD_ERROR:case mt.a.KEY_LOAD_TIMEOUT:if(!t.fatal)if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){\nvar i=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);bt.b.warn(\"mediaController: frag loading failed, retry in \"+i+\" ms\"),this.retryDate=window.performance.now()+i,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.fragLoadError++,this.state=Ee.FRAG_LOADING_WAITING_RETRY}else bt.b.error(\"mediaController: \"+t.details+\" reaches max retry, redispatch as fatal ...\"),t.fatal=!0,this.state=Ee.ERROR;break;case mt.a.LEVEL_LOAD_ERROR:case mt.a.LEVEL_LOAD_TIMEOUT:this.state!==Ee.ERROR&&(t.fatal?(this.state=Ee.ERROR,bt.b.warn(\"streamController: \"+t.details+\",switch to \"+this.state+\" state ...\")):t.levelRetry||this.state!==Ee.WAITING_LEVEL||(this.state=Ee.IDLE));break;case mt.a.BUFFER_FULL_ERROR:\"main\"!==t.parent||this.state!==Ee.PARSING&&this.state!==Ee.PARSED||(r?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=Ee.IDLE):(bt.b.warn(\"buffer full error also media.currentTime is not buffered, flush everything\"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)))}}},e.prototype._reduceMaxBufferLength=function(t){var e=this.config;return e.maxMaxBufferLength>=t&&(e.maxMaxBufferLength/=2,bt.b.warn(\"main:reduce max buffer length to \"+e.maxMaxBufferLength+\"s\"),!0)},e.prototype._checkBuffer=function(){var t=this.config,e=this.media,r=1e3;if(e&&0!==e.readyState){var i=e.currentTime,a=this.mediaBuffer?this.mediaBuffer:e,n=a.buffered;if(!this.loadedmetadata&&n.length)this.loadedmetadata=!0,this._seekToStartPos();else if(this.immediateSwitch)this.immediateLevelSwitchEnd();else{var o=!(e.paused&&e.readyState>1||e.ended||0===e.buffered.length),s=window.performance.now();if(i!==this.lastCurrentTime)this.stallReported&&(bt.b.warn(\"playback not stuck anymore @\"+i+\", after \"+Math.round(s-this.stalled)+\"ms\"),this.stallReported=!1),this.stalled=null,this.nudgeRetry=0;else if(o){var l=s-this.stalled,d=ae.bufferInfo(e,i,t.maxBufferHole);if(!this.stalled)return void(this.stalled=s);l>=r&&this._reportStall(d.len),this._tryFixBufferStall(d,l)}}}},e.prototype.onFragLoadEmergencyAborted=function(){this.state=Ee.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},e.prototype.onBufferFlushed=function(){var t=this.mediaBuffer?this.mediaBuffer:this.media;t&&this.fragmentTracker.detectEvictedFragments(Ot.ElementaryStreamTypes.VIDEO,t.buffered),this.state=Ee.IDLE,this.fragPrevious=null},e.prototype.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},e.prototype.computeLivePosition=function(t,e){var r=void 0!==this.config.liveSyncDuration?this.config.liveSyncDuration:this.config.liveSyncDurationCount*e.targetduration;return t+Math.max(0,e.totalduration-r)},e.prototype._tryFixBufferStall=function(t,e){var r=this.config,i=this.media,a=i.currentTime,n=.5,o=this.fragmentTracker.getPartialFragment(a);o&&this._trySkipBufferHole(o),t.len>n&&e>1e3*r.highBufferWatchdogPeriod&&(this.stalled=null,this._tryNudgeBuffer())},e.prototype._reportStall=function(t){var e=this.hls,r=this.media,i=this.stallReported;i||(this.stallReported=!0,bt.b.warn(\"Playback stalling at @\"+r.currentTime+\" due to low buffer\"),e.trigger(yt.a.ERROR,{type:mt.b.MEDIA_ERROR,details:mt.a.BUFFER_STALLED_ERROR,fatal:!1,buffer:t}))},e.prototype._trySkipBufferHole=function(t){for(var e=this.hls,r=this.media,i=r.currentTime,a=0,n=0;n<r.buffered.length;n++){var o=r.buffered.start(n);if(i>=a&&i<o)return r.currentTime=Math.max(o,r.currentTime+.1),bt.b.warn(\"skipping hole, adjusting currentTime from \"+i+\" to \"+r.currentTime),this.stalled=null,void e.trigger(yt.a.ERROR,{type:mt.b.MEDIA_ERROR,details:mt.a.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:\"fragment loaded with buffer holes, seeking from \"+i+\" to \"+r.currentTime,frag:t});a=r.buffered.end(n)}},e.prototype._tryNudgeBuffer=function(){var t=this.config,e=this.hls,r=this.media,i=r.currentTime,a=(this.nudgeRetry||0)+1;if(this.nudgeRetry=a,a<t.nudgeMaxRetry){var n=i+a*t.nudgeOffset;bt.b.log(\"adjust currentTime from \"+i+\" to \"+n),r.currentTime=n,e.trigger(yt.a.ERROR,{type:mt.b.MEDIA_ERROR,details:mt.a.BUFFER_NUDGE_ON_STALL,fatal:!1})}else bt.b.error(\"still stuck in high buffer @\"+i+\" after \"+t.nudgeMaxRetry+\", raise fatal error\"),e.trigger(yt.a.ERROR,{type:mt.b.MEDIA_ERROR,details:mt.a.BUFFER_STALLED_ERROR,fatal:!0})},e.prototype._seekToStartPos=function(){var t=this.media,e=t.currentTime,r=t.seeking?e:this.startPosition;e!==r&&(bt.b.log(\"target start position not buffered, seek to buffered.start(0) \"+r+\" from current time \"+e+\" \"),t.currentTime=r)},be(e,[{key:\"state\",set:function(t){if(this.state!==t){var e=this.state;this._state=t,bt.b.log(\"main stream:\"+e+\"->\"+t),this.hls.trigger(yt.a.STREAM_STATE_TRANSITION,{previousState:e,nextState:t})}},get:function(){return this._state}},{key:\"currentLevel\",get:function(){var t=this.media;if(t){var e=this.getBufferedFrag(t.currentTime);if(e)return e.level}return-1}},{key:\"nextBufferedFrag\",get:function(){var t=this.media;return t?this.followingBufferedFrag(this.getBufferedFrag(t.currentTime)):null}},{key:\"nextLevel\",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:\"liveSyncPosition\",get:function(){return this._liveSyncPosition},set:function(t){this._liveSyncPosition=t}}]),e}(ye),Se=Te,Ae=\"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},_e=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,\"value\"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),Re=window,Le=Re.performance,we=function(t){function e(r){V(this,e);var i=W(this,t.call(this,r,yt.a.MANIFEST_LOADED,yt.a.LEVEL_LOADED,yt.a.AUDIO_TRACK_SWITCHED,yt.a.FRAG_LOADED,yt.a.ERROR));return i.canload=!1,i.currentLevelIndex=null,i.manualLevelIndex=-1,i.timer=null,i}return Y(e,t),e.prototype.onHandlerDestroying=function(){this.clearTimer(),this.manualLevelIndex=-1},e.prototype.clearTimer=function(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.startLoad=function(){var t=this._levels;this.canload=!0,this.levelRetryCount=0,t&&t.forEach(function(t){t.loadError=0;var e=t.details;e&&e.live&&(t.details=void 0)}),null!==this.timer&&this.loadLevel()},e.prototype.stopLoad=function(){this.canload=!1},e.prototype.onManifestLoaded=function(t){var e=[],r=void 0,i={},a=null,n=!1,o=!1,s=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),d=[];if(t.levels.forEach(function(t){t.loadError=0,t.fragmentError=!1,n=n||!!t.videoCodec,o=o||!!t.audioCodec||!(!t.attrs||!t.attrs.AUDIO),s&&t.audioCodec&&t.audioCodec.indexOf(\"mp4a.40.34\")!==-1&&(t.audioCodec=void 0),a=i[t.bitrate],a?a.url.push(t.url):(t.url=[t.url],t.urlId=0,i[t.bitrate]=t,e.push(t)),t.attrs&&t.attrs.AUDIO&&R(a||t,\"audio\",t.attrs.AUDIO),t.attrs&&t.attrs.SUBTITLES&&R(a||t,\"text\",t.attrs.SUBTITLES)}),n&&o&&(e=e.filter(function(t){var e=t.videoCodec;return!!e})),e=e.filter(function(t){var e=t.audioCodec,r=t.videoCodec;return(!e||l(e))&&(!r||l(r))}),t.audioTracks&&(d=t.audioTracks.filter(function(t){return!t.audioCodec||l(t.audioCodec,\"audio\")})),e.length>0){r=e[0].bitrate,e.sort(function(t,e){return t.bitrate-e.bitrate}),this._levels=e;for(var u=0;u<e.length;u++)if(e[u].bitrate===r){this._firstLevel=u,bt.b.log(\"manifest loaded,\"+e.length+\" level(s) found, first bitrate:\"+r);break}this.hls.trigger(yt.a.MANIFEST_PARSED,{levels:e,audioTracks:d,firstLevel:this._firstLevel,stats:t.stats,audio:o,video:n,altAudio:d.length>0&&n})}else this.hls.trigger(yt.a.ERROR,{type:mt.b.MEDIA_ERROR,details:mt.a.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:this.hls.url,reason:\"no level with compatible codecs found in manifest\"})},e.prototype.setLevelInternal=function(t){var e=this._levels,r=this.hls;if(t>=0&&t<e.length){if(this.clearTimer(),this.currentLevelIndex!==t){bt.b.log(\"switching to level \"+t),this.currentLevelIndex=t;var i=e[t];i.level=t,r.trigger(yt.a.LEVEL_SWITCHING,i)}var a=e[t],n=a.details;if(!n||n.live){var o=a.urlId;r.trigger(yt.a.LEVEL_LOADING,{url:a.url[o],level:t,id:o})}}else r.trigger(yt.a.ERROR,{type:mt.b.OTHER_ERROR,details:mt.a.LEVEL_SWITCH_ERROR,level:t,fatal:!1,reason:\"invalid level idx\"})},e.prototype.onError=function(t){if(t.fatal)return void(t.type===mt.b.NETWORK_ERROR&&this.clearTimer());var e=!1,r=!1,i=void 0;switch(t.details){case mt.a.FRAG_LOAD_ERROR:case mt.a.FRAG_LOAD_TIMEOUT:case mt.a.KEY_LOAD_ERROR:case mt.a.KEY_LOAD_TIMEOUT:i=t.frag.level,r=!0;break;case mt.a.LEVEL_LOAD_ERROR:case mt.a.LEVEL_LOAD_TIMEOUT:i=t.context.level,e=!0;break;case mt.a.REMUX_ALLOC_ERROR:i=t.level,e=!0}void 0!==i&&this.recoverLevel(t,i,e,r)},e.prototype.recoverLevel=function(t,e,r,i){var a=this,n=this.hls.config,o=t.details,s=this._levels[e],l=void 0,d=void 0,u=void 0;if(s.loadError++,s.fragmentError=i,r){if(!(this.levelRetryCount+1<=n.levelLoadingMaxRetry))return bt.b.error(\"level controller, cannot recover from \"+o+\" error\"),this.currentLevelIndex=null,this.clearTimer(),void(t.fatal=!0);d=Math.min(Math.pow(2,this.levelRetryCount)*n.levelLoadingRetryDelay,n.levelLoadingMaxRetryTimeout),this.timer=setTimeout(function(){return a.loadLevel()},d),t.levelRetry=!0,this.levelRetryCount++,bt.b.warn(\"level controller, \"+o+\", retry in \"+d+\" ms, current retry count is \"+this.levelRetryCount)}(r||i)&&(l=s.url.length,l>1&&s.loadError<l?(s.urlId=(s.urlId+1)%l,s.details=void 0,bt.b.warn(\"level controller, \"+o+\" for level \"+e+\": switching to redundant URL-id \"+s.urlId)):this.manualLevelIndex===-1?(u=0===e?this._levels.length-1:e-1,bt.b.warn(\"level controller, \"+o+\": switch to \"+u),this.hls.nextAutoLevel=this.currentLevelIndex=u):i&&(bt.b.warn(\"level controller, \"+o+\": reload a fragment\"),this.currentLevelIndex=null))},e.prototype.onFragLoaded=function(t){var e=t.frag;if(void 0!==e&&\"main\"===e.type){var r=this._levels[e.level];void 0!==r&&(r.fragmentError=!1,r.loadError=0,this.levelRetryCount=0)}},e.prototype.onLevelLoaded=function(t){var e=this,r=t.level;if(r===this.currentLevelIndex){var i=this._levels[r];i.fragmentError||(i.loadError=0,this.levelRetryCount=0);var a=t.details;if(a.live){var n=1e3*(a.averagetargetduration?a.averagetargetduration:a.targetduration),o=n,s=i.details;s&&a.endSN===s.endSN&&(o/=2,bt.b.log(\"same live playlist, reload twice faster\")),o-=Le.now()-t.stats.trequest,o=Math.max(n/2,Math.round(o)),bt.b.log(\"live playlist, reload in \"+Math.round(o)+\" ms\"),this.timer=setTimeout(function(){return e.loadLevel()},o)}else this.clearTimer()}},e.prototype.onAudioTrackSwitched=function(t){var e=this.hls.audioTracks[t.id].groupId,r=this.hls.levels[this.currentLevelIndex];if(r&&r.audioGroupIds){var i=r.audioGroupIds.findIndex(function(t){return t===e});i!==r.urlId&&(r.urlId=i,this.startLoad())}},e.prototype.loadLevel=function(){if(bt.b.debug(\"call to loadLevel\"),null!==this.currentLevelIndex&&this.canload){var t=this._levels[this.currentLevelIndex];if(\"object\"===(\"undefined\"==typeof t?\"undefined\":Ae(t))&&t.url.length>0){var e=this.currentLevelIndex,r=t.urlId,i=t.url[r];bt.b.log(\"Attempt loading level index \"+e+\" with URL-id \"+r),this.hls.trigger(yt.a.LEVEL_LOADING,{url:i,level:e,id:r})}}},_e(e,[{key:\"levels\",get:function(){return this._levels}},{key:\"level\",get:function(){return this.currentLevelIndex},set:function(t){var e=this._levels;e&&(t=Math.min(t,e.length-1),this.currentLevelIndex===t&&e[t].details||this.setLevelInternal(t))}},{key:\"manualLevel\",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),t!==-1&&(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 this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=t)}}]),e}(At),De=we,Ie=r(7),Oe=function(t){function e(r){q(this,e);var i=Q(this,t.call(this,r,yt.a.MEDIA_ATTACHED,yt.a.MEDIA_DETACHING,yt.a.FRAG_PARSING_METADATA));return i.id3Track=void 0,i.media=void 0,i}return Z(e,t),e.prototype.destroy=function(){At.prototype.destroy.call(this)},e.prototype.onMediaAttached=function(t){this.media=t.media,!this.media},e.prototype.onMediaDetaching=function(){X(this.id3Track),this.id3Track=void 0,this.media=void 0},e.prototype.getID3Track=function(t){for(var e=0;e<t.length;e++){var r=t[e];if(\"metadata\"===r.kind&&\"id3\"===r.label)return z(r,this.media),r}return this.media.addTextTrack(\"metadata\",\"id3\")},e.prototype.onFragParsingMetadata=function(t){var e=t.frag,r=t.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode=\"hidden\");for(var i=window.WebKitDataCue||window.VTTCue||window.TextTrackCue,a=0;a<r.length;a++){var n=Ie.a.getID3Frames(r[a].data);if(n){var o=r[a].pts,s=a<r.length-1?r[a+1].pts:e.endPTS;o===s&&(s+=1e-4);for(var l=0;l<n.length;l++){var d=n[l];if(!Ie.a.isTimeStampFrame(d)){var u=new i(o,s,\"\");u.value=d,this.id3Track.addCue(u)}}}}},e}(At),ke=Oe,xe=function(){function t(e){$(this,t),this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=0,this.totalWeight_=0}return t.prototype.sample=function(t,e){var r=Math.pow(this.alpha_,t);this.estimate_=e*(1-r)+r*this.estimate_,this.totalWeight_+=t},t.prototype.getTotalWeight=function(){return this.totalWeight_},t.prototype.getEstimate=function(){if(this.alpha_){var t=1-Math.pow(this.alpha_,this.totalWeight_);return this.estimate_/t}return this.estimate_},t}(),Pe=xe,Ce=function(){function t(e,r,i,a){tt(this,t),this.hls=e,this.defaultEstimate_=a,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Pe(r),this.fast_=new Pe(i)}return t.prototype.sample=function(t,e){t=Math.max(t,this.minDelayMs_);var r=8e3*e/t,i=t/1e3;this.fast_.sample(i,r),this.slow_.sample(i,r)},t.prototype.canEstimate=function(){var t=this.fast_;return t&&t.getTotalWeight()>=this.minWeight_},t.prototype.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},t.prototype.destroy=function(){},t}(),Fe=Ce,Me=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,\"value\"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),Ne=window,Ue=Ne.performance,Be=function(t){function e(r){et(this,e);var i=rt(this,t.call(this,r,yt.a.FRAG_LOADING,yt.a.FRAG_LOADED,yt.a.FRAG_BUFFERED,yt.a.ERROR));return i.lastLoadedFragLevel=0,i._nextAutoLevel=-1,i.hls=r,i.timer=null,i._bwEstimator=null,i.onCheck=i._abandonRulesCheck.bind(i),i}return it(e,t),e.prototype.destroy=function(){this.clearTimer(),At.prototype.destroy.call(this)},e.prototype.onFragLoading=function(t){var e=t.frag;if(\"main\"===e.type&&(this.timer||(this.fragCurrent=e,this.timer=setInterval(this.onCheck,100)),!this._bwEstimator)){var r=this.hls,i=r.config,a=e.level,n=r.levels[a].details.live,o=void 0,s=void 0;n?(o=i.abrEwmaFastLive,s=i.abrEwmaSlowLive):(o=i.abrEwmaFastVoD,s=i.abrEwmaSlowVoD),this._bwEstimator=new Fe(r,s,o,i.abrEwmaDefaultEstimate)}},e.prototype._abandonRulesCheck=function(){var t=this.hls,e=t.media,r=this.fragCurrent;if(r){var i=r.loader,a=t.minAutoLevel;if(!i||i.stats&&i.stats.aborted)return bt.b.warn(\"frag loader destroy or aborted, disarm abandonRules\"),this.clearTimer(),void(this._nextAutoLevel=-1);var n=i.stats;if(e&&n&&(!e.paused&&0!==e.playbackRate||!e.readyState)&&r.autoLevel&&r.level){var o=Ue.now()-n.trequest,s=Math.abs(e.playbackRate);if(o>500*r.duration/s){var l=t.levels,d=Math.max(1,n.bw?n.bw/8:1e3*n.loaded/o),u=l[r.level],f=u.realBitrate?Math.max(u.realBitrate,u.bitrate):u.bitrate,h=n.total?n.total:Math.max(n.loaded,Math.round(r.duration*f/8)),c=e.currentTime,p=(h-n.loaded)/d,v=(ae.bufferInfo(e,c,t.config.maxBufferHole).end-c)/s;if(v<2*r.duration/s&&p>v){var g=void 0,m=void 0;for(m=r.level-1;m>a;m--){var y=l[m].realBitrate?Math.max(l[m].realBitrate,l[m].bitrate):l[m].bitrate;if(g=r.duration*y/(6.4*d),g<v)break}g<p&&(bt.b.warn(\"loading too slow, abort fragment loading and switch to level \"+m+\":fragLoadedDelay[\"+m+\"]<fragLoadedDelay[\"+(r.level-1)+\"];bufferStarvationDelay:\"+g.toFixed(1)+\"<\"+p.toFixed(1)+\":\"+v.toFixed(1)),t.nextLoadLevel=m,this._bwEstimator.sample(o,n.loaded),i.abort(),this.clearTimer(),t.trigger(yt.a.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,stats:n}))}}}}},e.prototype.onFragLoaded=function(t){var e=t.frag;if(\"main\"===e.type&&!isNaN(e.sn)){if(this.clearTimer(),this.lastLoadedFragLevel=e.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var r=this.hls.levels[e.level],i=(r.loaded?r.loaded.bytes:0)+t.stats.loaded,a=(r.loaded?r.loaded.duration:0)+t.frag.duration;r.loaded={bytes:i,duration:a},r.realBitrate=Math.round(8*i/a)}if(t.frag.bitrateTest){var n=t.stats;n.tparsed=n.tbuffered=n.tload,this.onFragBuffered(t)}}},e.prototype.onFragBuffered=function(t){var e=t.stats,r=t.frag;if(!(e.aborted===!0||\"main\"!==r.type||isNaN(r.sn)||r.bitrateTest&&e.tload!==e.tbuffered)){var i=e.tparsed-e.trequest;bt.b.log(\"latency/loading/parsing/append/kbps:\"+Math.round(e.tfirst-e.trequest)+\"/\"+Math.round(e.tload-e.tfirst)+\"/\"+Math.round(e.tparsed-e.tload)+\"/\"+Math.round(e.tbuffered-e.tparsed)+\"/\"+Math.round(8*e.loaded/(e.tbuffered-e.trequest))),this._bwEstimator.sample(i,e.loaded),e.bwEstimate=this._bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=i/1e3:this.bitrateTestDelay=0}},e.prototype.onError=function(t){switch(t.details){case mt.a.FRAG_LOAD_ERROR:case mt.a.FRAG_LOAD_TIMEOUT:this.clearTimer()}},e.prototype.clearTimer=function(){clearInterval(this.timer),this.timer=null},e.prototype._findBestLevel=function(t,e,r,i,a,n,o,s,l){for(var d=a;d>=i;d--){var u=l[d],f=u.details,h=f?f.totalduration/f.fragments.length:e,c=!!f&&f.live,p=void 0;p=d<=t?o*r:s*r;var v=l[d].realBitrate?Math.max(l[d].realBitrate,l[d].bitrate):l[d].bitrate,g=v*h/p;if(bt.b.trace(\"level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: \"+d+\"/\"+Math.round(p)+\"/\"+v+\"/\"+h+\"/\"+n+\"/\"+g),p>v&&(!g||c&&!this.bitrateTestDelay||g<n))return d}return-1},Me(e,[{key:\"nextAutoLevel\",get:function(){var t=this._nextAutoLevel,e=this._bwEstimator;if(!(t===-1||e&&e.canEstimate()))return t;var r=this._nextABRAutoLevel;return t!==-1&&(r=Math.min(t,r)),r},set:function(t){this._nextAutoLevel=t}},{key:\"_nextABRAutoLevel\",get:function(){var t=this.hls,e=t.maxAutoLevel,r=t.levels,i=t.config,a=t.minAutoLevel,n=t.media,o=this.lastLoadedFragLevel,s=this.fragCurrent?this.fragCurrent.duration:0,l=n?n.currentTime:0,d=n&&0!==n.playbackRate?Math.abs(n.playbackRate):1,u=this._bwEstimator?this._bwEstimator.getEstimate():i.abrEwmaDefaultEstimate,f=(ae.bufferInfo(n,l,i.maxBufferHole).end-l)/d,h=this._findBestLevel(o,s,u,a,e,f,i.abrBandWidthFactor,i.abrBandWidthUpFactor,r);if(h>=0)return h;bt.b.trace(\"rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering\");var c=s?Math.min(s,i.maxStarvationDelay):i.maxStarvationDelay,p=i.abrBandWidthFactor,v=i.abrBandWidthUpFactor;if(0===f){var g=this.bitrateTestDelay;if(g){var m=s?Math.min(s,i.maxLoadingDelay):i.maxLoadingDelay;c=m-g,bt.b.trace(\"bitrate test took \"+Math.round(1e3*g)+\"ms, set first fragment max fetchDuration to \"+Math.round(1e3*c)+\" ms\"),p=v=1}}return h=this._findBestLevel(o,s,u,a,e,f+c,p,v,r),Math.max(h,0)}}]),e}(At),Ge=Be,je=A(),Ke=function(t){function e(r){at(this,e);var i=nt(this,t.call(this,r,yt.a.MEDIA_ATTACHING,yt.a.MEDIA_DETACHING,yt.a.MANIFEST_PARSED,yt.a.BUFFER_RESET,yt.a.BUFFER_APPENDING,yt.a.BUFFER_CODECS,yt.a.BUFFER_EOS,yt.a.BUFFER_FLUSHING,yt.a.LEVEL_PTS_UPDATED,yt.a.LEVEL_UPDATED));return i._msDuration=null,i._levelDuration=null,i._live=null,i._objectUrl=null,i.onsbue=i.onSBUpdateEnd.bind(i),i.onsbe=i.onSBUpdateError.bind(i),i.pendingTracks={},i.tracks={},i}return ot(e,t),e.prototype.destroy=function(){At.prototype.destroy.call(this)},e.prototype.onLevelPtsUpdated=function(t){var e=t.type,r=this.tracks.audio;if(\"audio\"===e&&r&&\"audio/mpeg\"===r.container){var i=this.sourceBuffer.audio,a=Math.abs(i.timestampOffset-t.start);if(a>.1){var n=i.updating;try{i.abort()}catch(o){n=!0,bt.b.warn(\"can not abort audio buffer: \"+o)}n?this.audioTimestampOffset=t.start:(bt.b.warn(\"change mpeg audio timestamp offset from \"+i.timestampOffset+\" to \"+t.start),i.timestampOffset=t.start)}}},e.prototype.onManifestParsed=function(t){var e=t.audio,r=t.video||t.levels.length&&t.altAudio,i=0;t.altAudio&&(e||r)&&(i=(e?1:0)+(r?1:0),bt.b.log(i+\" sourceBuffer(s) expected\")),this.sourceBufferNb=i},e.prototype.onMediaAttaching=function(t){var e=this.media=t.media;if(e){var r=this.mediaSource=new je;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),r.addEventListener(\"sourceopen\",this.onmso),r.addEventListener(\"sourceended\",this.onmse),r.addEventListener(\"sourceclose\",this.onmsc),e.src=window.URL.createObjectURL(r),this._objectUrl=e.src}},e.prototype.onMediaDetaching=function(){bt.b.log(\"media source detaching\");var t=this.mediaSource;if(t){if(\"open\"===t.readyState)try{t.endOfStream()}catch(e){bt.b.warn(\"onMediaDetaching:\"+e.message+\" while calling endOfStream\")}t.removeEventListener(\"sourceopen\",this.onmso),t.removeEventListener(\"sourceended\",this.onmse),t.removeEventListener(\"sourceclose\",this.onmsc),this.media&&(window.URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute(\"src\"),this.media.load()):bt.b.warn(\"media.src was changed by a third party - skip cleanup\")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(yt.a.MEDIA_DETACHED)},e.prototype.onMediaSourceOpen=function(){bt.b.log(\"media source opened\"),this.hls.trigger(yt.a.MEDIA_ATTACHED,{media:this.media});var t=this.mediaSource;t&&t.removeEventListener(\"sourceopen\",this.onmso),this.checkPendingTracks()},e.prototype.checkPendingTracks=function(){var t=this.pendingTracks,e=Object.keys(t).length;e&&(this.sourceBufferNb<=e||0===this.sourceBufferNb)&&(this.createSourceBuffers(t),this.pendingTracks={},this.doAppending())},e.prototype.onMediaSourceClose=function(){bt.b.log(\"media source closed\")},e.prototype.onMediaSourceEnded=function(){bt.b.log(\"media source ended\")},e.prototype.onSBUpdateEnd=function(){if(this.audioTimestampOffset){var t=this.sourceBuffer.audio;bt.b.warn(\"change mpeg audio timestamp offset from \"+t.timestampOffset+\" to \"+this.audioTimestampOffset),t.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var e=this.parent,r=this.segments.reduce(function(t,r){return r.parent===e?t+1:t},0),i={},a=this.sourceBuffer;for(var n in a)i[n]=a[n].buffered;this.hls.trigger(yt.a.BUFFER_APPENDED,{parent:e,pending:r,timeRanges:i}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration()},e.prototype.onSBUpdateError=function(t){bt.b.error(\"sourceBuffer error:\",t),this.hls.trigger(yt.a.ERROR,{type:mt.b.MEDIA_ERROR,details:mt.a.BUFFER_APPENDING_ERROR,fatal:!1})},e.prototype.onBufferReset=function(){var t=this.sourceBuffer;for(var e in t){var r=t[e];try{this.mediaSource.removeSourceBuffer(r),r.removeEventListener(\"updateend\",this.onsbue),r.removeEventListener(\"error\",this.onsbe)}catch(i){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},e.prototype.onBufferCodecs=function(t){if(0===Object.keys(this.sourceBuffer).length){for(var e in t)this.pendingTracks[e]=t[e];var r=this.mediaSource;r&&\"open\"===r.readyState&&this.checkPendingTracks()}},e.prototype.createSourceBuffers=function(t){var e=this.sourceBuffer,r=this.mediaSource;for(var i in t)if(!e[i]){var a=t[i],n=a.levelCodec||a.codec,o=a.container+\";codecs=\"+n;bt.b.log(\"creating sourceBuffer(\"+o+\")\");try{var s=e[i]=r.addSourceBuffer(o);s.addEventListener(\"updateend\",this.onsbue),s.addEventListener(\"error\",this.onsbe),this.tracks[i]={codec:n,container:a.container},a.buffer=s}catch(l){bt.b.error(\"error while trying to add sourceBuffer:\"+l.message),this.hls.trigger(yt.a.ERROR,{type:mt.b.MEDIA_ERROR,details:mt.a.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:l,mimeType:o})}}this.hls.trigger(yt.a.BUFFER_CREATED,{tracks:t})},e.prototype.onBufferAppending=function(t){this._needsFlush||(this.segments?this.segments.push(t):this.segments=[t],this.doAppending())},e.prototype.onBufferAppendFail=function(t){bt.b.error(\"sourceBuffer error:\",t.event),this.hls.trigger(yt.a.ERROR,{type:mt.b.MEDIA_ERROR,details:mt.a.BUFFER_APPENDING_ERROR,fatal:!1})},e.prototype.onBufferEos=function(t){var e=this.sourceBuffer,r=t.type;for(var i in e)r&&i!==r||e[i].ended||(e[i].ended=!0,bt.b.log(i+\" sourceBuffer now EOS\"));this.checkEos()},e.prototype.checkEos=function(){var t=this.sourceBuffer,e=this.mediaSource;if(!e||\"open\"!==e.readyState)return void(this._needsEos=!1);for(var r in t){var i=t[r];if(!i.ended)return;if(i.updating)return void(this._needsEos=!0)}bt.b.log(\"all media data available, signal endOfStream() to MediaSource and stop loading fragment\");try{e.endOfStream()}catch(a){bt.b.warn(\"exception while calling mediaSource.endOfStream()\")}this._needsEos=!1},e.prototype.onBufferFlushing=function(t){this.flushRange.push({start:t.startOffset,end:t.endOffset,type:t.type}),this.flushBufferCounter=0,this.doFlush()},e.prototype.onLevelUpdated=function(t){var e=t.details;e.fragments.length>0&&(this._levelDuration=e.totalduration+e.fragments[0].start,this._live=e.live,this.updateMediaElementDuration())},e.prototype.updateMediaElementDuration=function(){var t=this.hls.config,e=void 0;if(null!==this._levelDuration&&this.media&&this.mediaSource&&this.sourceBuffer&&0!==this.media.readyState&&\"open\"===this.mediaSource.readyState){for(var r in this.sourceBuffer)if(this.sourceBuffer[r].updating===!0)return;e=this.media.duration,null===this._msDuration&&(this._msDuration=this.mediaSource.duration),this._live===!0&&t.liveDurationInfinity===!0?(bt.b.log(\"Media Source duration is set to Infinity\"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>e||e===1/0||isNaN(e))&&(bt.b.log(\"Updating Media Source duration to \"+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},e.prototype.doFlush=function(){for(;this.flushRange.length;){var t=this.flushRange[0];if(!this.flushBuffer(t.start,t.end,t.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var e=0,r=this.sourceBuffer;try{for(var i in r)e+=r[i].buffered.length}catch(a){bt.b.error(\"error while accessing sourceBuffer.buffered\")}this.appended=e,this.hls.trigger(yt.a.BUFFER_FLUSHED)}},e.prototype.doAppending=function(){var t=this.hls,e=this.sourceBuffer,r=this.segments;if(Object.keys(e).length){if(this.media.error)return this.segments=[],void bt.b.error(\"trying to append although a media error occured, flush segment and abort\");if(this.appending)return;if(r&&r.length){var i=r.shift();try{var a=i.type,n=e[a];n?n.updating?r.unshift(i):(n.ended=!1,this.parent=i.parent,n.appendBuffer(i.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(o){bt.b.error(\"error while trying to append buffer:\"+o.message),r.unshift(i);var s={type:mt.b.MEDIA_ERROR,parent:i.parent};22!==o.code?(this.appendError?this.appendError++:this.appendError=1,s.details=mt.a.BUFFER_APPEND_ERROR,this.appendError>t.config.appendErrorMaxRetry?(bt.b.log(\"fail \"+t.config.appendErrorMaxRetry+\" times to append segment in sourceBuffer\"),r=[],s.fatal=!0,t.trigger(yt.a.ERROR,s)):(s.fatal=!1,t.trigger(yt.a.ERROR,s))):(this.segments=[],s.details=mt.a.BUFFER_FULL_ERROR,s.fatal=!1,t.trigger(yt.a.ERROR,s))}}}},e.prototype.flushBuffer=function(t,e,r){var i=void 0,a=void 0,n=void 0,o=void 0,s=void 0,l=void 0,d=this.sourceBuffer;if(Object.keys(d).length){if(bt.b.log(\"flushBuffer,pos/start/end: \"+this.media.currentTime.toFixed(3)+\"/\"+t+\"/\"+e),this.flushBufferCounter<this.appended){for(var u in d)if(!r||u===r){if(i=d[u],i.ended=!1,i.updating)return bt.b.warn(\"cannot flush, sb updating in progress\"),!1;try{for(a=0;a<i.buffered.length;a++)if(n=i.buffered.start(a),o=i.buffered.end(a),navigator.userAgent.toLowerCase().indexOf(\"firefox\")!==-1&&e===Number.POSITIVE_INFINITY?(s=t,l=e):(s=Math.max(n,t),l=Math.min(o,e)),Math.min(l,o)-s>.5)return this.flushBufferCounter++,bt.b.log(\"flush \"+u+\" [\"+s+\",\"+l+\"], of [\"+n+\",\"+o+\"], pos:\"+this.media.currentTime),i.remove(s,l),!1}catch(f){bt.b.warn(\"exception while accessing sourcebuffer, it might have been removed from MediaSource\")}}}else bt.b.warn(\"abort flushing too many retries\");bt.b.log(\"buffer flushed\")}return!0},e}(At),He=Ke,Ve=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,\"value\"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),We=function(t){function e(r){st(this,e);var i=lt(this,t.call(this,r,yt.a.FPS_DROP_LEVEL_CAPPING,yt.a.MEDIA_ATTACHING,yt.a.MANIFEST_PARSED,yt.a.BUFFER_CODECS));return i.autoLevelCapping=Number.POSITIVE_INFINITY,i.firstLevel=null,i.levels=[],i.media=null,i.restrictedLevels=[],i.timer=null,i}return dt(e,t),e.prototype.destroy=function(){this.hls.config.capLevelToPlayerSize&&(this.media=null,this._stopCapping())},e.prototype.onFpsDropLevelCapping=function(t){e.isLevelAllowed(t.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(t.droppedLevel)},e.prototype.onMediaAttaching=function(t){this.media=t.media instanceof window.HTMLVideoElement?t.media:null},e.prototype.onManifestParsed=function(t){var e=this.hls;this.restrictedLevels=[],this.levels=t.levels,this.firstLevel=t.firstLevel,e.config.capLevelToPlayerSize&&(t.video||t.levels.length&&t.altAudio)&&this._startCapping()},e.prototype.onBufferCodecs=function(t){var e=this.hls;e.config.capLevelToPlayerSize&&t.video&&this._startCapping()},e.prototype.onLevelsUpdated=function(t){this.levels=t.levels},e.prototype.detectPlayerSize=function(){if(this.media){var t=this.levels?this.levels.length:0;if(t){var e=this.hls;e.autoLevelCapping=this.getMaxLevel(t-1),e.autoLevelCapping>this.autoLevelCapping&&e.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}},e.prototype.getMaxLevel=function(t){var r=this;if(!this.levels)return-1;var i=this.levels.filter(function(i,a){return e.isLevelAllowed(a,r.restrictedLevels)&&a<=t});return e.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},e.prototype._startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},e.prototype._stopCapping=function(){this.restrictedLevels=[],this.firstLevel=null,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer),this.timer=null)},e.isLevelAllowed=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.indexOf(t)===-1},e.getMaxLevelByMediaSize=function(t,e,r){if(!t||t&&!t.length)return-1;for(var i=function(t,e){return!e||(t.width!==e.width||t.height!==e.height)},a=t.length-1,n=0;n<t.length;n+=1){var o=t[n];if((o.width>=e||o.height>=r)&&i(o,t[n+1])){a=n;break}}return a},Ve(e,[{key:\"mediaWidth\",get:function(){var t=void 0,r=this.media;return r&&(t=r.width||r.clientWidth||r.offsetWidth,t*=e.contentScaleFactor),t}},{\nkey:\"mediaHeight\",get:function(){var t=void 0,r=this.media;return r&&(t=r.height||r.clientHeight||r.offsetHeight,t*=e.contentScaleFactor),t}}],[{key:\"contentScaleFactor\",get:function(){var t=1;try{t=window.devicePixelRatio}catch(e){}return t}}]),e}(At),Ye=We,ze=window,Xe=ze.performance,qe=function(t){function e(r){return ut(this,e),ft(this,t.call(this,r,yt.a.MEDIA_ATTACHING))}return ht(e,t),e.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},e.prototype.onMediaAttaching=function(t){var e=this.hls.config;if(e.capLevelOnFPSDrop){var r=this.video=t.media instanceof window.HTMLVideoElement?t.media:null;\"function\"==typeof r.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),e.fpsDroppedMonitoringPeriod)}},e.prototype.checkFPS=function(t,e,r){var i=Xe.now();if(e){if(this.lastTime){var a=i-this.lastTime,n=r-this.lastDroppedFrames,o=e-this.lastDecodedFrames,s=1e3*n/a,l=this.hls;if(l.trigger(yt.a.FPS_DROP,{currentDropped:n,currentDecoded:o,totalDroppedFrames:r}),s>0&&n>l.config.fpsDroppedMonitoringThreshold*o){var d=l.currentLevel;bt.b.warn(\"drop FPS ratio greater than max allowed value for currentLevel: \"+d),d>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=d)&&(d-=1,l.trigger(yt.a.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:l.currentLevel}),l.autoLevelCapping=d,l.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=r,this.lastDecodedFrames=e}},e.prototype.checkFPSInterval=function(){var t=this.video;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},e}(At),Qe=qe,Ze=window,Je=Ze.performance,$e=Ze.XMLHttpRequest,tr=function(){function t(e){ct(this,t),e&&e.xhrSetup&&(this.xhrSetup=e.xhrSetup)}return t.prototype.destroy=function(){this.abort(),this.loader=null},t.prototype.abort=function(){var t=this.loader;t&&4!==t.readyState&&(this.stats.aborted=!0,t.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},t.prototype.load=function(t,e,r){this.context=t,this.config=e,this.callbacks=r,this.stats={trequest:Je.now(),retry:0},this.retryDelay=e.retryDelay,this.loadInternal()},t.prototype.loadInternal=function(){var t=void 0,e=this.context;t=this.loader=new $e;var r=this.stats;r.tfirst=0,r.loaded=0;var i=this.xhrSetup;try{if(i)try{i(t,e.url)}catch(a){t.open(\"GET\",e.url,!0),i(t,e.url)}t.readyState||t.open(\"GET\",e.url,!0)}catch(a){return void this.callbacks.onError({code:t.status,text:a.message},e,t)}e.rangeEnd&&t.setRequestHeader(\"Range\",\"bytes=\"+e.rangeStart+\"-\"+(e.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=e.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),t.send()},t.prototype.readystatechange=function(t){var e=t.currentTarget,r=e.readyState,i=this.stats,a=this.context,n=this.config;if(!i.aborted&&r>=2)if(window.clearTimeout(this.requestTimeout),0===i.tfirst&&(i.tfirst=Math.max(Je.now(),i.trequest)),4===r){var o=e.status;if(o>=200&&o<300){i.tload=Math.max(i.tfirst,Je.now());var s=void 0,l=void 0;\"arraybuffer\"===a.responseType?(s=e.response,l=s.byteLength):(s=e.responseText,l=s.length),i.loaded=i.total=l;var d={url:e.responseURL,data:s};this.callbacks.onSuccess(d,i,a,e)}else i.retry>=n.maxRetry||o>=400&&o<499?(bt.b.error(o+\" while loading \"+a.url),this.callbacks.onError({code:o,text:e.statusText},a,e)):(bt.b.warn(o+\" while loading \"+a.url+\", retrying in \"+this.retryDelay+\"...\"),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,n.maxRetryDelay),i.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),n.timeout)},t.prototype.loadtimeout=function(){bt.b.warn(\"timeout while loading \"+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},t.prototype.loadprogress=function(t){var e=t.currentTarget,r=this.stats;r.loaded=t.loaded,t.lengthComputable&&(r.total=t.total);var i=this.callbacks.onProgress;i&&i(r,this.context,null,e)},t}(),er=tr,rr=r(3),ir=(r.n(rr),function(){return\"undefined\"!=typeof window&&window.navigator&&window.navigator.requestMediaKeySystemAccess?window.navigator.requestMediaKeySystemAccess.bind(window.navigator):null}()),ar={autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,maxBufferSize:6e7,maxBufferHole:.5,lowBufferWatchdogPeriod:.5,highBufferWatchdogPeriod:3,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,liveDurationInfinity:!1,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:er,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,abrController:Ge,bufferController:He,capLevelController:Ye,fpsController:Qe,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,requestMediaKeySystemAccessFunc:ir},nr=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,\"value\"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}();r(13);var or=function(){function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};pt(this,t);var i=t.DefaultConfig;if((r.liveSyncDurationCount||r.liveMaxLatencyDurationCount)&&(r.liveSyncDuration||r.liveMaxLatencyDuration))throw new Error(\"Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration\");for(var a in i)a in r||(r[a]=i[a]);if(void 0!==r.liveMaxLatencyDurationCount&&r.liveMaxLatencyDurationCount<=r.liveSyncDurationCount)throw new Error('Illegal hls.js config: \"liveMaxLatencyDurationCount\" must be gt \"liveSyncDurationCount\"');if(void 0!==r.liveMaxLatencyDuration&&(r.liveMaxLatencyDuration<=r.liveSyncDuration||void 0===r.liveSyncDuration))throw new Error('Illegal hls.js config: \"liveMaxLatencyDuration\" must be gt \"liveSyncDuration\"');Object(bt.a)(r.debug),this.config=r,this._autoLevelCapping=-1;var n=this.observer=new oe.a;n.trigger=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];n.emit.apply(n,[t,t].concat(r))},n.off=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];n.removeListener.apply(n,[t].concat(r))},this.on=n.on.bind(n),this.off=n.off.bind(n),this.once=n.once.bind(n),this.trigger=n.trigger.bind(n);var o=this.abrController=new r.abrController(this),s=new r.bufferController(this),l=new r.capLevelController(this),d=new r.fpsController(this),u=new qt(this),f=new Zt(this),h=new $t(this),c=new ke(this),p=this.levelController=new De(this),v=new ee(this),g=this.streamController=new Se(this,v),m=[p,g],y=r.audioStreamController;y&&m.push(new y(this,v)),this.networkControllers=m;var b=[u,f,h,o,s,l,d,c,v];if(y=r.audioTrackController){var E=new y(this);this.audioTrackController=E,b.push(E)}if(y=r.subtitleTrackController){var T=new y(this);this.subtitleTrackController=T,b.push(T)}if(y=r.emeController){var S=new y(this);this.emeController=S,b.push(S)}[r.subtitleStreamController,r.timelineController].forEach(function(t){t&&b.push(new t(e))}),this.coreComponents=b}return t.isSupported=function(){return J()},nr(t,null,[{key:\"version\",get:function(){return\"0.10.0\"}},{key:\"Events\",get:function(){return yt.a}},{key:\"ErrorTypes\",get:function(){return mt.b}},{key:\"ErrorDetails\",get:function(){return mt.a}},{key:\"DefaultConfig\",get:function(){return t.defaultConfig?t.defaultConfig:ar},set:function(e){t.defaultConfig=e}}]),t.prototype.destroy=function(){bt.b.log(\"destroy\"),this.trigger(yt.a.DESTROYING),this.detachMedia(),this.coreComponents.concat(this.networkControllers).forEach(function(t){t.destroy()}),this.url=null,this.observer.removeAllListeners(),this._autoLevelCapping=-1},t.prototype.attachMedia=function(t){bt.b.log(\"attachMedia\"),this.media=t,this.trigger(yt.a.MEDIA_ATTACHING,{media:t})},t.prototype.detachMedia=function(){bt.b.log(\"detachMedia\"),this.trigger(yt.a.MEDIA_DETACHING),this.media=null},t.prototype.loadSource=function(t){t=gt.a.buildAbsoluteURL(window.location.href,t,{alwaysNormalize:!0}),bt.b.log(\"loadSource:\"+t),this.url=t,this.trigger(yt.a.MANIFEST_LOADING,{url:t})},t.prototype.startLoad=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;bt.b.log(\"startLoad(\"+t+\")\"),this.networkControllers.forEach(function(e){e.startLoad(t)})},t.prototype.stopLoad=function(){bt.b.log(\"stopLoad\"),this.networkControllers.forEach(function(t){t.stopLoad()})},t.prototype.swapAudioCodec=function(){bt.b.log(\"swapAudioCodec\"),this.streamController.swapAudioCodec()},t.prototype.recoverMediaError=function(){bt.b.log(\"recoverMediaError\");var t=this.media;this.detachMedia(),this.attachMedia(t)},nr(t,[{key:\"levels\",get:function(){return this.levelController.levels}},{key:\"currentLevel\",get:function(){return this.streamController.currentLevel},set:function(t){bt.b.log(\"set currentLevel:\"+t),this.loadLevel=t,this.streamController.immediateLevelSwitch()}},{key:\"nextLevel\",get:function(){return this.streamController.nextLevel},set:function(t){bt.b.log(\"set nextLevel:\"+t),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}},{key:\"loadLevel\",get:function(){return this.levelController.level},set:function(t){bt.b.log(\"set loadLevel:\"+t),this.levelController.manualLevel=t}},{key:\"nextLoadLevel\",get:function(){return this.levelController.nextLoadLevel},set:function(t){this.levelController.nextLoadLevel=t}},{key:\"firstLevel\",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(t){bt.b.log(\"set firstLevel:\"+t),this.levelController.firstLevel=t}},{key:\"startLevel\",get:function(){return this.levelController.startLevel},set:function(t){bt.b.log(\"set startLevel:\"+t);var e=this;t!==-1&&(t=Math.max(t,e.minAutoLevel)),e.levelController.startLevel=t}},{key:\"autoLevelCapping\",get:function(){return this._autoLevelCapping},set:function(t){bt.b.log(\"set autoLevelCapping:\"+t),this._autoLevelCapping=t}},{key:\"autoLevelEnabled\",get:function(){return this.levelController.manualLevel===-1}},{key:\"manualLevel\",get:function(){return this.levelController.manualLevel}},{key:\"minAutoLevel\",get:function(){for(var t=this,e=t.levels,r=t.config.minAutoBitrate,i=e?e.length:0,a=0;a<i;a++){var n=e[a].realBitrate?Math.max(e[a].realBitrate,e[a].bitrate):e[a].bitrate;if(n>r)return a}return 0}},{key:\"maxAutoLevel\",get:function(){var t=this,e=t.levels,r=t.autoLevelCapping,i=void 0;return i=r===-1&&e&&e.length?e.length-1:r}},{key:\"nextAutoLevel\",get:function(){var t=this;return Math.min(Math.max(t.abrController.nextAutoLevel,t.minAutoLevel),t.maxAutoLevel)},set:function(t){var e=this;e.abrController.nextAutoLevel=Math.max(e.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:\"liveSyncPosition\",get:function(){return this.streamController.liveSyncPosition}},{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:\"subtitleDisplay\",get:function(){var t=this.subtitleTrackController;return!!t&&t.subtitleDisplay},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}}]),t}();e[\"default\"]=or},function(t,e,r){function i(t){function e(i){if(r[i])return r[i].exports;var a=r[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var r={};e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var r=t&&t.__esModule?function(){return t[\"default\"]}:function(){return t};return e.d(r,\"a\",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p=\"/\",e.oe=function(t){throw console.error(t),t};var i=e(e.s=ENTRY_MODULE);return i[\"default\"]||i}function a(t){return(t+\"\").replace(/[.?*+^$[\\]\\\\(){}|-]/g,\"\\\\$&\")}function n(t,e,i){var n={};n[i]=[];var o=e.toString(),s=o.match(/^function\\s?\\(\\w+,\\s*\\w+,\\s*(\\w+)\\)/);if(!s)return n;for(var u,f=s[1],h=new RegExp(\"(\\\\\\\\n|\\\\W)\"+a(f)+d,\"g\");u=h.exec(o);)\"dll-reference\"!==u[3]&&n[i].push(u[3]);for(h=new RegExp(\"\\\\(\"+a(f)+'\\\\(\"(dll-reference\\\\s('+l+'))\"\\\\)\\\\)'+d,\"g\");u=h.exec(o);)t[u[2]]||(n[i].push(u[1]),t[u[2]]=r(u[1]).m),n[u[2]]=n[u[2]]||[],n[u[2]].push(u[4]);return n}function o(t){var e=Object.keys(t);return e.reduce(function(e,r){return e||t[r].length>0},!1)}function s(t,e){for(var r={main:[e]},i={main:[]},a={main:{}};o(r);)for(var s=Object.keys(r),l=0;l<s.length;l++){var d=s[l],u=r[d],f=u.pop();if(a[d]=a[d]||{},!a[d][f]&&t[d][f]){a[d][f]=!0,i[d]=i[d]||[],i[d].push(f);for(var h=n(t,t[d][f],d),c=Object.keys(h),p=0;p<c.length;p++)r[c[p]]=r[c[p]]||[],r[c[p]]=r[c[p]].concat(h[c[p]])}}return i}var l=\"[\\\\.|\\\\-|\\\\+|\\\\w|/|@]+\",d=\"\\\\((/\\\\*.*?\\\\*/)?s?.*?(\"+l+\").*?\\\\)\";t.exports=function(t,e){e=e||{};var a={main:r.m},n=e.all?{main:Object.keys(a)}:s(a,t),o=\"\";Object.keys(n).filter(function(t){return\"main\"!==t}).forEach(function(t){for(var e=0;n[t][e];)e++;n[t].push(e),a[t][e]=\"(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })\",o=o+\"var \"+t+\" = (\"+i.toString().replace(\"ENTRY_MODULE\",JSON.stringify(e))+\")({\"+n[t].map(function(e){return\"\"+JSON.stringify(e)+\": \"+a[t][e].toString()}).join(\",\")+\"});\\n\"}),o=o+\"(\"+i.toString().replace(\"ENTRY_MODULE\",JSON.stringify(t))+\")({\"+n.main.map(function(t){return\"\"+JSON.stringify(t)+\": \"+a.main[t].toString()}).join(\",\")+\"})(self);\";var l=new window.Blob([o],{type:\"text/javascript\"});if(e.bare)return l;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,u=d.createObjectURL(l),f=new window.Worker(u);return f.objectURL=u,f}},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var i=r(9),a=r(1),n=r(0),o=r(6),s=r.n(o),l=function(t){var e=new s.a;e.trigger=function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];e.emit.apply(e,[t,t].concat(i))},e.off=function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];e.removeListener.apply(e,[t].concat(i))};var r=function(e,r){t.postMessage({event:e,data:r})};t.addEventListener(\"message\",function(a){var o=a.data;switch(o.cmd){case\"init\":var s=JSON.parse(o.config);t.demuxer=new i.a(e,o.typeSupported,s,o.vendor);try{Object(n.a)(s.debug===!0)}catch(l){console.warn(\"demuxerWorker: unable to enable logs\")}r(\"init\",null);break;case\"demux\":t.demuxer.push(o.data,o.decryptdata,o.initSegment,o.audioCodec,o.videoCodec,o.timeOffset,o.discontinuity,o.trackSwitch,o.contiguous,o.duration,o.accurateTimeOffset,o.defaultInitPTS)}}),e.on(a.a.FRAG_DECRYPTED,r),e.on(a.a.FRAG_PARSING_INIT_SEGMENT,r),e.on(a.a.FRAG_PARSED,r),e.on(a.a.ERROR,r),e.on(a.a.FRAG_PARSING_METADATA,r),e.on(a.a.FRAG_PARSING_USERDATA,r),e.on(a.a.INIT_PTS_FOUND,r),e.on(a.a.FRAG_PARSING_DATA,function(e,r){var i=[],a={event:e,data:r};r.data1&&(a.data1=r.data1.buffer,i.push(r.data1.buffer),delete r.data1),r.data2&&(a.data2=r.data2.buffer,i.push(r.data2.buffer),delete r.data2),t.postMessage(a,i)})};e[\"default\"]=l},function(t,e){String.prototype.endsWith||!function(){\"use strict\";var t=function(){try{var t={},e=Object.defineProperty,r=e(t,t,t)&&e}catch(i){}return r}(),e={}.toString,r=function(t){if(null==this)throw TypeError();var r=String(this);if(t&&\"[object RegExp]\"==e.call(t))throw TypeError();var i=r.length,a=String(t),n=a.length,o=i;if(arguments.length>1){var s=arguments[1];void 0!==s&&(o=s?Number(s):0,o!=o&&(o=0))}var l=Math.min(Math.max(o,0),i),d=l-n;if(d<0)return!1;for(var u=-1;++u<n;)if(r.charCodeAt(d+u)!=a.charCodeAt(u))return!1;return!0};t?t(String.prototype,\"endsWith\",{value:r,configurable:!0,writable:!0}):String.prototype.endsWith=r}()}])[\"default\"]});","skip":false,"stamp":1553026071003,"expire":1571026071003,"updatedAt":1553026071025}


originKey: rb.moc.aidivn.www.:https:443
scope: rb.moc.aidivn.www.:https:443
key: _at.hist.0501
value:
  {"m":600,"k":2,"l":{"0":462,"1":474},"b":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":67125248,"15":0,"16":0,"17":0,"18":0}}


originKey: rb.moc.teltuoaortele.www.:https:443
scope: rb.moc.teltuoaortele.www.:https:443
key: _at.hist.0501
value:
  {"m":600,"k":2,"l":{"0":41,"1":188},"b":{"0":0,"1":512,"2":0,"3":0,"4":0,"5":268435456,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0}}


originKey: moc.dooggnab.rb.:https:443
scope: moc.dooggnab.rb.:https:443
key: CODCountryName
value:
  {"AE":"United Arab Emirates","SA":"Saudi Arabia","KW":"Kuwait","OM":"Oman","BH":"Bahrain","SG":"Singapore","TH":"Thailand","PH":"Philippines","MY":"Malaysia","ID":"Indonesia","VN":"Viet Nam","QA":"Qatar"}


originKey: rb.moc.lou.saiciton.:https:443
scope: rb.moc.lou.saiciton.:https:443
key: UOLPlayer-core
value:
  {"url":"//player.mais.uol.com.br/js/uolplayer.core.min.js?v=3.0.4","key":"core","type":"javascript","checksum":"core","crossOrigin":"anonymous","size":218716,"crc32":-1618023183,"createdAt":1557584307281,"data":"UOLPlayer.prototype.initialize=function(e){if(sh=UOLPlayer.getUrlParameter(\"sh\"),mp=UOLPlayer.getUrlParameter(\"mp\"),pingback=UOLPlayer.getUrlParameter(\"pingback\"),fd=UOLPlayer.getUrlParameter(\"fd\"),sh&&\"undefined\"!=typeof sh&&mp&&\"undefined\"!=typeof mp){var t={logName:\"metrics-search\",module:\"uolmais-drakkar\",hash:sh,mp:mp};\"boolean\"==typeof pingback&&(t.pingback=pingback),\"boolean\"==typeof fd&&(t.fd=fd),UOLPlayer.searchLog(t)}if(UOLPlayer.loaded=!0,!e)return UOLPlayer.e(\"Mal uso do player: wrapper inválido: \",e);if(this.wrapper=e,this.parentNode=this.wrapper.parentNode||this.wrapper,this.originalWrapper=this.wrapper.cloneNode(!1),!e.getData(\"materialized\")){if(this.iuDFP=\"\",this.replay=!1,this.hlsFallback=this.wrapper.getData(\"hlsFallback\"),this.hashId=this.hlsFallback?this.wrapper.getData(\"hashId\"):UOLPlayer.createHashId(),this.mediaId=UOLPlayer.parseInt(this.wrapper.getData(\"mediaid\",UOLPlayer.config.mediaId)),this.startTime=UOLPlayer.parseInt(this.wrapper.getData(\"start\",UOLPlayer.config.startTime)),this.startHd=this.wrapper.getData(\"starthd\",UOLPlayer.config.startHd),this.preload=this.wrapper.getData(\"preload\",UOLPlayer.config.preload),this.skin=this.wrapper.getData(\"skin\",UOLPlayer.config.skin)||UOLPlayer.skin,this.poster=this.wrapper.getData(\"poster\",UOLPlayer.config.poster),this.mediaType=this.wrapper.getData(\"type\",UOLPlayer.urlParameter.type),this.totaltime=this.wrapper.getData(\"totaltime\",UOLPlayer.urlParameter.totaltime)||this.wrapper.getData(\"duration\",UOLPlayer.urlParameter.duration)||!1,this.flashFallback=this.wrapper.getData(\"flashFallback\",UOLPlayer.toBoolean(UOLPlayer.urlParameter.flashFallback)),this._detach=this.wrapper.getData(\"detach\",UOLPlayer.urlParameter.detach),this.download=UOLPlayer.toBoolean(this.wrapper.getData(\"download\",UOLPlayer.urlParameter.download)),this.coverMessage=this.isMobile&&this.wrapper.getData(\"covermessage\",UOLPlayer.urlParameter.coverMessage)||!1,this.detachOnce=!1,this.serverTime={},this.clientTime={},this.canTestsplit=!UOLPlayer.isIOS,e.setData(\"mediaId\",this.mediaId),UOLPlayer.isIframe&&(UOLPlayer.mediaId=this.mediaId),this.autoplay=this._autoplay=this.wrapper.getData(\"autoplay\",UOLPlayer.config.autoplay),this.autoplayMobile=!1,UOLPlayer.isMobile&&this.autoplay?(this.autoplay=!(\"iOS\"===UOLPlayer.info.os&&UOLPlayer.info.osMajorVersion<=9),this.autoplay=!(\"wifi\"!==UOLPlayer.info.connectionType||!this.autoplay),this.autoplayMobile=this.autoplay):UOLPlayer.isMobile&&(this.autoplay=!1),UOLPlayer.urlParameter.startMute===!1?this.startMute=!1:(this.startMute=!UOLPlayer.isMobile&&this.wrapper.getData(\"startmute\",UOLPlayer.config.startMute),this.startMute=this.wrapper.getData(\"changevideo\")?this.wrapper.getData(\"startmute\"):this.startMute),null===this.mediaId||void 0===this.mediaId||isNaN(this.mediaId)||!UOLPlayer.isNumeric(this.mediaId))return this.mountMarkup(),this.wrapper.addClass(\"_video\"),this.setError(UOLPlayer.ElementErrorHandler.errorCodes.INVALID_MEDIA_ID),void UOLPlayer.e(\"[ UOLPlayer ] mediaId não atribuído\");if(this.observer=(new UOLPlayer.observeDOM).observe(this.wrapper.parentNode.parentNode||this.wrapper.parentNode,function(e){var t=document.getElementById(\"UOLPlayer_\"+this.hashId);null!==t&&void 0!==t||this.destroy()}.bind(this)),this.controls=this.wrapper.getData(\"controls\",UOLPlayer.config.controls),this.related=this.wrapper.getData(\"related\",UOLPlayer.config.related),this.autorep=this.wrapper.getData(\"autorep\",UOLPlayer.config.autorep),this.playlist=this.wrapper.getData(\"playlist\",UOLPlayer.config.playlist),this.cover=this.wrapper.getData(\"cover\",UOLPlayer.config.cover),this.title=this.wrapper.getData(\"title\",UOLPlayer.config.title),this.share=this.wrapper.getData(\"share\",UOLPlayer.config.share),this.thumbTooltip=this.wrapper.getData(\"thumbtooltip\",UOLPlayer.config.thumbTooltip),this.onDemand=this.wrapper.getData(\"ondemand\")!==!1&&UOLPlayer.urlParameter.onDemand!==!1&&(UOLPlayer.isMobile||UOLPlayer.onDemand),this.onDemandClicked=this.wrapper.getData(\"onDemandClicked\")===!0,this._dfp=this.wrapper.getData(\"dfp\",UOLPlayer.config.dfp),this.webmEnabled=!1,this.isFlash=!1,this.externalCDN=!1,this.isAutoplayOk=!1,this.isAutoplayMuted=!1,this.rebufferingCount=0,this.forceCDN=UOLPlayer.urlParameter.cdn,this.revision=0,this.autoplayRejects=0,this.pauseCounts=0,this.recommended=UOLPlayer.urlParameter.recommended!==!1,this.forwardRewindBase=15,this.headers={},this.logHeaders=[\"cache-hit\",\"x-cache-error\",\"x-error-reason\",\"server\",\"content-length\"],!window.UOLPlayer[this.mediaId]||window.UOLPlayer[this.mediaId].wrapper!==this.wrapper){this.storeIntance(),this.initBackbone();var r=this.wrapper.getData(\"previousStates\");if(r&&window.JSON&&(r=JSON.parse(JSON.parse(r))),this.tracker=new UOLPlayer.Tracker(UOLPlayer.toBoolean(UOLPlayer.urlParameter.trackerDebug),r),this.playerStarted=!1,this.chronoLoadApi=new UOLPlayer.Chronometer(\"loadApi\"),this.chronoFirstMilestone=new UOLPlayer.Chronometer(\"firstMilestone\"),this.chronoAdDuration=new UOLPlayer.Chronometer(\"adDuration\"),this.dataParser=this.createDataParser(),this.wrapper.removeClass(\"_video\").removeClass(\"_audio\"),\"audio\"===this.mediaType?this.wrapper.addClass(\"_audio\"):(this.mediaType=\"video\",this.wrapper.addClass(\"_video _mouseout\")),this.statistic={time:0,size:0,amountTime:0,amountSize:0},e.setData(\"materialized\",!0),e.setAttribute(\"id\",\"UOLPlayer_\"+this.hashId),this.checkFixedPoster(),this.checkSize(),this.logCreated(),this.onDemand===!0&&(this.mountMarkup(),this.wrapper.getData(\"detachstate\")===UOLPlayer.Detach.states.DETACHED&&(this.detach=new UOLPlayer.Detach(this,this.wrapper),this.detach.detachPlayer(!0)),this.wrapper.getElementsByClassName(\"bt-play\")[0].show(),this.setClick=function(){var e=this.wrapper.getElementsByClassName(\"up-bt-play-big\")[0];e?e.addEventListener(\"click\",function(e){this.syntheticPlay=void 0!==this.syntheticPlay?this.syntheticPlay:e.isTrusted,this.play()}.bind(this)):this._setClick||(this._setClick=setTimeout(this.setClick.bind(this),400))}.bind(this),this.setForwardRewind=function(){this.jumpSize=0,this.jumpTimeout=!1,this.jump=function(e){this.forward(this.jumpSize),this.jumpSize=0,this.isPlaying()||this.play(),this.wrapper.getElementsByClassName(\"rewind-jump-step\")[0].removeClass(\"new\").innerHTML=\"\",this.wrapper.getElementsByClassName(\"forward-jump-step\")[0].removeClass(\"new\").innerHTML=\"\"}.bind(this),this.jumpController=function(e){if(e<0)var t=this.wrapper.getElementsByClassName(\"rewind-jump-step\")[0],a=\"-\";else var t=this.wrapper.getElementsByClassName(\"forward-jump-step\")[0],a=\"+\";this.jumpTimeout&&(clearTimeout(this.jumpTimeout),this.jumpTimeout=!1),this.jumpSize+=this.forwardRewindBase*e,this.jumpTimeout||(t.innerHTML=a+Math.abs(this.jumpSize),t.addClass(\"new\"),this.jumpTimeout=setTimeout(function(){this.jump(t)}.bind(this),500))}.bind(this);var e=this.wrapper.getElementsByClassName(\"up-bt-forward-spin\")[0],t=this.wrapper.getElementsByClassName(\"up-bt-rewind-spin\")[0];e&&e.addEventListener(\"click\",function(e){this.jumpController(1)}.bind(this)),t&&t.addEventListener(\"click\",function(e){this.jumpController(-1)}.bind(this))}.bind(this),this.autoplay===!1?(this.onDemandClicked=!0,this.wrapper.addClass(\"_ondemand\"),this.chronoLoadApi.start(),this._play=function(){if(this.autoplay=!0,\"audio\"===this.mediaType){var e=this.wrapper.getElementsByClassName(\"bt-play\")[0]||this.wrapper.getElementsByClassName(\"up-control-bar\")[0];e&&e.remove()}this.wrapper.addClass(\"_loading\"),this.initiated||(this.initiated=!0,UOLPlayer.onInit(this)),this.init()}.bind(this),this.play=function(){\"function\"==typeof this.clickBait?this.clickBait(this._play):this._play()}.bind(this),this.dataParser.loadApi().then(function(){this.dataParser.dataParsedPromise().then(function(){if(this.checkFixedPoster(),this.mountDownload(),\"audio\"===this.mediaType){var e=this.wrapper.getElementsByClassName(\"up-bt-play\")[0],t=function(){this.play(),e.removeEventListener(\"click\",t)}.bind(this);e?e.addEventListener(\"click\",t):setTimeout(function(){e=this.wrapper.getElementsByClassName(\"up-bt-play\")[0],e&&e.addEventListener(\"click\",t)}.bind(this),400),this.wrapper.getElementsByClassName(\"up-time-duration\")[0].innerHTML=this.data.item.duration.formatted}else\"video\"===this.mediaType&&(UOLPlayer.each(this.wrapper.getElementsByClassName(\"up-poster\"),function(e){UOLPlayer.setPoster(this,e)}.bind(this)),this.setClick(),this.setForwardRewind())}.bind(this))}.bind(this))):this.autoplay===!0&&(this.setClick(),this.setForwardRewind())),UOLPlayer.isMobile&&!this.autoplay&&(this.mountMarkup(),this.wrapper.addClass(\"first-click\").removeClass(\"_loading\"),this.dataParser.loadApi().then(function(){this.dataParser.dataParsedPromise().then(function(){\"video\"===this.mediaType?this.abrLib&&\"dash\"==this.abrLib.libName?this.abrLib.then(function(e){this.data&&this.data.formats&&this.data.formats[\"default\"]&&\"DASH\"===this.data.formats[\"default\"].type&&this.dashEnabled&&e&&!e.error?this.mediaPlayer=new UOLPlayer.DASH(this,this.wrapper):this.mediaPlayer=new UOLPlayer.VideoPlayer(this,this.wrapper)}.bind(this)):this.abrLib&&\"hls\"==this.abrLib.libName?this.abrLib.then(function(e){this.data&&this.data.formats&&this.data.formats[\"default\"]&&\"HLS\"===this.data.formats[\"default\"].type&&this.hlsEnabled&&e&&!e.error?this.mediaPlayer=new UOLPlayer.HLS(this,this.wrapper):this.mediaPlayer=new UOLPlayer.VideoPlayer(this,this.wrapper)}.bind(this)):this.mediaPlayer=new UOLPlayer.VideoPlayer(this,this.wrapper):this.mediaPlayer=new UOLPlayer.AudioPlayer(this,this.wrapper);var e=this.wrapper.getElementsByClassName(\"video-element\")[0];this.clickBait=function(t){if(this.syntheticPlay=void 0!==this.syntheticPlay?this.syntheticPlay:t.isTrusted,this.fingers=this.fingers||0,this.fingers+=1,this.fingers>1)return void UOLPlayer.i(\"disable multitouch\");t&&t.stopPropagation&&t.stopPropagation();var a=function(){this.clickBait=void 0,\"function\"==typeof t?t.call(this):this.play()}.bind(this);if(this.onDemand===!1)return a();var r=function(){this.wrapper.removeClass(\"first-click\"),\"audio\"===this.mediaType?(e=this.wrapper.getElementsByClassName(\"audio-element\")[0],e.play()):(e=this.wrapper.getElementsByClassName(\"video-element\")[0],UOLPlayer.isInstantArticle&&UOLPlayer.isIOS?e.removeEventListener(\"touchend\",this.clickBait):e.removeEventListener(\"click\",this.clickBait))}.bind(this);\"video\"===this.mediaType?this.abrLib&&this.abrLib.then(function(e){this.mediaPlayer.attachMedia(),r(),a()}.bind(this)):(this.mediaPlayer.setAudio(),r(),a())}.bind(this),UOLPlayer.isInstantArticle&&UOLPlayer.isIOS?e&&e.addEventListener(\"touchend\",this.clickBait):e&&e.addEventListener(\"click\",this.clickBait)}.bind(this))}.bind(this))),this.onDemand!==!1&&this.autoplay!==!0||this.init(),void 0!==this.wrapper.getElementsByClassName(\"bt-play\")){var i=this.wrapper.getElementsByClassName(\"bt-play\")[0];this.totaltime&&(i.getElementsByClassName(\"up-play-time\")[0].innerHTML=this.totaltime),this.coverMessage&&this.onDemand===!0&&(this.wrapper.addClass(\"_covermessage\"),i.addClass(\"cover-message\").getElementsByClassName(\"up-play-time\")[0].innerHTML=this.coverMessage)}this.logger=new UOLPlayerLog(this),UOLPlayer.isMobile?(this.logger.log(\"UOLPlayer - ver:\"+UOLPlayer.version),this.wrapper.addClass(\"is-mobile\")):this.wrapper.addClass(\"is-desktop\"),this.logger.log(\"ENVIRONMENT: \"+UOLPlayer.environment()),this.logger.log(\"CONNECTION TYPE: \"+UOLPlayer.info.connectionType),this.bindOnlineMonitor();try{if(UOLPlayer.getURL().indexOf(\"simulateBug=app\")>-1){window.console&&window.console.info&&window.console.info(\"SIMULATE BUG APP\");var s;setTimeout(function(){a+b},null!==(s=UOLPlayer.getURL().match(/simulateBugTime=(\\d+)/))?parseInt(s.pop()):7e3)}}catch(o){}}}},UOLPlayer.prototype.logCreated=function(){UOLPlayer.instancesMaterialized+=1,setTimeout(function(){UOLPlayerLog.send(this,\"create\")}.bind(this),100)},UOLPlayer.prototype.logFirstMilestone=function(e,t){if(this.playerStarted&&!this.firstMilestoneSended){this.firstMilestoneSended=!0;var a=e;[\"videoBegin\",\"error\"].indexOf(e)===-1&&(a=this.getFullState());var r={};t=t||{},t.endSource=e,t.endPoint=a,t.mediaStaterd=!!this._videoBeginSended,t.timeAd=this.chronoAdDuration.getCurrentTime().elapsedTime.time,t.adsActive=this.adsActive,t.adsDone=this.adsDone,this.ads&&(r.ad=this.ads.adPos,r.adObj=this.ads.ad),r.time=this.chronoFirstMilestone.getCurrentTime().elapsedTime,r.payload=t,this.logger.send(\"firstMilestone\",r)}},UOLPlayer.prototype.init=function(){if(this.chronoVideoBegin=new UOLPlayer.Chronometer(\"videoBegin\"),this.chronoVideoBegin.start(),this.play=function(){\"function\"==typeof this.clickBait&&this.clickBait(),this.onClick()}.bind(this),null===this.wrapper||void 0===this.wrapper)return void UOLPlayer.e(\"[ UOLPlayer ] container inexistente ou não atribuído\");if(1==UOLPlayer.toBoolean(this.wrapper.getData(\"minimal\"))&&(this.cover=!1,this.controls=!1,this.preload=\"metadata\",this.share=!1,this.related=!1,this.dfp=!1,this.wrapper.addClass(\"_minimal\")),null===this.mediaId||void 0===this.mediaId||isNaN(this.mediaId)||!UOLPlayer.isNumeric(this.mediaId))return this.setError(UOLPlayer.ElementErrorHandler.errorCodes.INVALID_MEDIA_ID),void UOLPlayer.e(\"[ UOLPlayer ] mediaId não atribuído\");if(this.mountMarkup(),UOLPlayer.toBoolean(UOLPlayer.urlParameter.debugMediaElement))for(var e=this.wrapper.querySelector(\".video-element\"),t=[\"abort\",\"canplay\",\"canplaythrough\",\"change\",\"drag\",\"dragend\",\"dragenter\",\"dragleave\",\"dragover\",\"dragstart\",\"drop\",\"durationchange\",\"emptied\",\"encrypted\",\"ended\",\"error\",\"focus\",\"focusin\",\"focusout\",\"input\",\"interruptbegin\",\"interruptend\",\"keydown\",\"keypress\",\"load\",\"loadeddata\",\"loadedmetadata\",\"loadstart\",\"mousedown\",\"mousemove\",\"mouseout\",\"mouseover\",\"mouseup\",\"mousewheel\",\"mozaudioavailable\",\"onkeyup\",\"onMSVideoFormatChanged\",\"onMSVideoFrameStepCompleted\",\"onMSVideoOptimalLayoutChanged\",\"onselect\",\"pause\",\"play\",\"playing\",\"progress\",\"ratechange\",\"readystatechange\",\"reset\",\"resize\",\"seeked\",\"seeking\",\"stalled\",\"suspend\",\"timeupdate\",\"volumechange\",\"waiting\"],a=0;a<t.length;++a)e.addEventListener(t[a],function(e){this.desbuga!==!1&&UOLPlayer.l([e.type,e])}.bind(this));if(UOLPlayer.isIE&&UOLPlayer.info.browserMajorVersion<11&&!UOLPlayer.isEdge&&!UOLPlayer.isMobile)return void this.setError(UOLPlayer.ElementErrorHandler.errorCodes.BROWSER_DEPRECATED);if(this.flashFallback)return void this.embedFlash(\"Media MP4 encoded with FLV\");this.ads=null,this.metrics=null,this.ui=null,this.timeouts=null,this.playing=!1,this.seeking=!1,this.fullscreen=!1,this.adsActive=!1,this.adsDone=!1,this.retryTimeout=3e3,this.lastPauseTime=null,this.adTagUrl=null,this.qualityChanged=!1,this.logSendedAfterTimeout=!1,this.wrapper.addClass(\"_loading\"),this.onDemand!==!1&&this.autoplay!==!0||this.chronoLoadApi.start(),this.dataParser.loadApi().then(function(){this.dataParser.dataParsedPromise().then(function(){this.checkSize(),this.mount()}.bind(this))}.bind(this))},UOLPlayer.prototype.createDataParser=function(){return this.data={},this.configured=!1,new UOLPlayer.Data(this,{closedMedia:function(){this.wrapper.addClass(\"_closed\")}.bind(this),metadata:function(e){if(this.revision=e.revision,this.data.item=e.item?e.item:e,\"P\"===this.data.item.type)this.mediaType=\"audio\",this.wrapper.removeClass(\"_video\").addClass(\"_audio\");else{this.mediaType=\"video\",this.wrapper.removeClass(\"_audio\").addClass(\"video\");var t=this.wrapper.getElementsByClassName(\"video-element\")[0];t.setAttribute(\"poster\",this.data.item.thumbnail),t.setAttribute(\"title\",this.data.item.title)}}.bind(this),formats:function(e){this.data.item.formats=e.formats||e}.bind(this),critical:function(e){this.dfp=!1,this.share=!1,this.related=!1,this.autorep=!1,this.criticalFailure=!0,this.payloadConsoled||(this.payloadConsoled=!0,this.logger.logError(\"Fallback for API critical failure\"))}.bind(this),config:function(e,t){if(!this.serverTime.start&&e.current_time&&(this.serverTime.start=e.current_time),this.clientTime.start||(this.clientTime.start=Date.now()),this.data.item.userIp=e.userIp,this.data.item.playerParameters=e.playerParameters,this.customTimeout=UOLPlayer.safariMultiplier(UOLPlayer.toBoolean(this.data.item.playerParameters.dfp_custom_timeout_on)||UOLPlayer.customTimeout,this),UOLPlayer.urlParameter.hls===!1||UOLPlayer.urlParameter.mp4===!0||UOLPlayer.urlParameter.webm===!0?(this.hlsEnabled=!1,this.hlsNative=!1):(UOLPlayer.Fingerprint.mediaTypeSupported.hls?this.hlsEnabled=UOLPlayer.toBoolean(this.data.item.playerParameters.hls_enabled):this.hlsEnabled=!1,UOLPlayer.Fingerprint.mediaTypeSupported.hlsNative&&UOLPlayer.isIOS?this.hlsNative=UOLPlayer.toBoolean(this.data.item.playerParameters.hls_enabled):this.hlsNative=!1),UOLPlayer.urlParameter.dash===!1||UOLPlayer.urlParameter.hls===!0||UOLPlayer.urlParameter.mp4===!0||UOLPlayer.urlParameter.webm===!0?this.dashEnabled=!1:UOLPlayer.Fingerprint.mediaTypeSupported.dash?this.dashEnabled=UOLPlayer.toBoolean(this.data.item.playerParameters.dash_enabled):this.dashEnabled=!1,this.testEnabled=this.data.item.playerParameters.test_enabled?this.data.item.playerParameters.test_enabled:\"\",this.testEnabled&&!this.configured&&(this.logger.log(\"TEST AB ENABLED: \"+this.testEnabled),UOLPlayer.i(\"[UOLPLAYER] AB TEST ENABLED: \"+this.testEnabled),this.configured=!0),\"V\"==this.data.item.type){if(this.hlsEnabled&&this.dashEnabled&&this.data.item.formats.HLS&&this.data.item.formats.DASH&&UOLPlayer.toBoolean(this.data.item.playerParameters.testsplit_enabled)&&this.canTestsplit){var a=Math.random()>=.5?\"DASH\":\"HLS\";this.dashEnabled=\"DASH\"==a,this.hlsEnabled=!this.dashEnabled,this.logger.logTEST(\"CANDIDATO AO TESTE P-VALUE: \"+a),this.testParticipant=!0}else this.logger.logTEST(\"RECUSADO AO TESTE P-VALUE: OFF\"),this.testParticipant=!1;this.hlsFallback&&(this.hlsEnabled=!1),this.iuDFP=this.data.item.iu,UOLPlayer.toBoolean(UOLPlayer.urlParameter.forcedfp)?this.dfp=!0:this.dfp=this._dfp!==!1&&this.data.item.playerParameters.dfp_on!==!1&&!!this.iuDFP;var r,i;this.dfp?this.imaLib=r=this.imaLib||UOLPlayer.Cache.require({url:UOLPlayer[\"const\"].urls.IMASDK,key:\"ima\",type:UOLPlayer.Cache.type.JAVASCRIPT,skip:!0,jsonp:!0}):(this.imaLib=r=this.imaLib||new UOLPlayer.Promise,r.reject(!1)),this.data.item.formats.DASH&&this.dashEnabled?(this.abrLib=i=this.abrLib||UOLPlayer.Cache.require({url:UOLPlayer[\"const\"].urls.DASH,key:\"dash\",type:UOLPlayer.Cache.type.JAVASCRIPT,checksum:UOLPlayer.isLocal?\"dash_dev\":\"dash\",crossOrigin:\"anonymous\"}),this.abrLib.libName=\"dash\"):this.data.item.formats.HLS&&this.hlsEnabled?(this.abrLib=i=this.abrLib||UOLPlayer.Cache.require({url:UOLPlayer[\"const\"].urls.HLS,key:\"hls\",type:UOLPlayer.Cache.type.JAVASCRIPT,checksum:UOLPlayer.isLocal?\"hls_dev\":\"hls\",crossOrigin:\"anonymous\"}),this.abrLib.libName=\"hls\"):(this.abrLib=i=this.abrLib||new UOLPlayer.Promise,this.abrLib.libName=\"no lib\",i.reject(!1)),r.then(function(e){return e},function(e){return!1}).then(function(e){return this.dfp=\"boolean\"==typeof e?e:!e.error,e.time&&(this.chronoLoadLibDFP=e.time,this.logger.logTime(\"DFP LIB: \"+e.time.time)),i}.bind(this)).then(function(e){return e}.bind(this),function(e){return e}).then(function(a){a.state&&this.logger.log(\"CACHE HLS/DASH: \"+a.state);var r=i.libName;if(\"no lib\"!=r&&void 0===UOLPlayer.urlParameter[r]){var s=\"boolean\"==typeof a?a:!a.error;\"hls\"===r?this.hlsEnabled=s:this.dashEnabled=s}else\"hls\"===r?this.hlsEnabled=UOLPlayer.toBoolean(UOLPlayer.urlParameter.hls):\"dash\"===r&&(this.dashEnabled=UOLPlayer.toBoolean(UOLPlayer.urlParameter.dash));\"hls\"===r?(a.state&&(this.hlsLibState=a.state),a.time&&(this.chronoLoadLibHLS=a.time,this.logger.logTime(\"HLS LIB: \"+a.time.time))):\"dash\"===r&&(a.state&&(this.dashLibState=a.state),a.time&&(this.chronoLoadLibDASH=a.time,this.logger.logTime(\"DASH LIB: \"+a.time.time))),this.parseFormats(this.data.item.formats),t(e)}.bind(this))}else this.parseFormats(this.data.item.formats),t(e);this.chronoLoadApi.stop()}.bind(this)})},UOLPlayer.prototype.mount=function(){function e(){UOLPlayer.isHidden()||UOLPlayer.isMobile||!this.autoplay||(this.onClick(),document.removeEventListener(UOLPlayer.visibilityChange,t))}if(this.initTimeouts(),this.balaioTimeout=this.timeouts[this.timeouts.type.RETRY_BALAIO],this.criticalFailure&&this.wrapper.addClass(\"_critical-failure\"),this.mountDownload(),\"V\"==this.data.item.type){if(this.mediaType=\"video\",this.wrapper.removeClass(\"_loading\"),UOLPlayer.isIframe&&this.checkSize(),!UOLPlayer.supportedMediaTypesList.mp4&&!UOLPlayer.supportedMediaTypesList.webm)return void this.setError(UOLPlayer.ElementErrorHandler.errorCodes.CODEC_UNAVAILABLE);if(\"DASH\"===this.data.formats[\"default\"].type&&this.dashEnabled?this.mediaPlayer||(this.mediaPlayer=new UOLPlayer.DASH(this,this.wrapper),this.mediaPlayer.attachMedia()):\"HLS\"===this.data.formats[\"default\"].type&&this.hlsEnabled?(this.mediaPlayer?(this.initMetrics(),setTimeout(function(){this.mediaPlayer.events.ready.dispatch({})}.bind(this),400)):(this.mediaPlayer=new UOLPlayer.HLS(this,this.wrapper),this.mediaPlayer.attachMedia()),this.mediaPlayer.registerEventListener(\"ready\",function(){this.initMetrics()}.bind(this))):this.mediaPlayer||(this.mediaPlayer=new UOLPlayer.VideoPlayer(this,this.wrapper),this.mediaPlayer.setInitialQuality()),this.mediaPlayer.registerEventListener(UOLPlayer.isPhone?\"webkitendfullscreen\":\"fullscreenchange\",this.onFullscreenChange.bind(this)),this.mediaPlayer.registerEventListener(\"reload\",function(){this.balaioTimeout.abort()}.bind(this)),this.shareVideo=new UOLPlayerShare(this),UOLPlayer.isMobile||(this.relatedVideos=new UOLPlayerRelated(this)),this.errorCallback=this.onVideoError.bind(this),UOLPlayer.isHidden()){var t=e.bind(this);document.addEventListener(UOLPlayer.visibilityChange,t,!1)}this.mountAd();var a;window.addEventListener(\"resize\",function(){clearTimeout(a),a=setTimeout(function(){this.isFullscreen()&&this.onFullscreenChange()}.bind(this),250)}.bind(this)),(this._detach!==!0&&this._detach!==!1&&UOLPlayer.toBoolean(this.data.item.playerParameters.detach)||UOLPlayer.checkAllowedDomain(this.data.item.playerParameters.detach_allow_domain_regexp))&&(this._detach=!0),this._detach===!0&&(this.detach=new UOLPlayer.Detach(this,this.wrapper),this.wrapper.getData(\"detachstate\")===UOLPlayer.Detach.states.DETACHED&&this.detach.detachPlayer(!0))}else\"P\"==this.data.item.type&&(this.mediaType=\"audio\",this.audio=!0,this.share=!1,this.related=!1,this.initMetrics(),this.mediaPlayer||(this.mediaPlayer=new UOLPlayer.AudioPlayer(this,this.wrapper),this.mediaPlayer.setAudio()),this.errorCallback=this.onAudioError.bind(this),this.checkFixedPoster());this.initUI(),this.mediaPlayer.setPreload(this.preload),this.videoPlayingCallback=this.playingVideo.bind(this),this.videoEndedCallback=this.onContentEnded.bind(this),this.mediaPlayer.registerEventListener(\"pause\",this.onVideoPause.bind(this),!0),this.mediaPlayer.registerEventListener(\"error\",this.errorCallback,!0),this.mediaPlayer.registerEventListener(\"onReject\",function(){this.balaioTimeout.abort(),this.playing=!1,this.ui.setState(\"stop\"),this.autoplayRejects+=1,this.logger.send(\"autoplayRejected\")}.bind(this)),this.mediaPlayer.registerEventListener(\"onPlaying\",function(){this.playing=!0,this.wrapper.addClass(\"_clicked\"),this.ui.setState(\"play\")}.bind(this)),this.chronoVideoBegin.pause(),!UOLPlayer.isHidden()&&this.autoplay?this.onClick():UOLPlayer.isMobile&&this.wrapper.removeClass(\"_loading\");var r=this.controlBar=new UOLPlayer.ControlBar(this,this.mediaPlayer);r.registerEventListener(\"volumeChange\",function(e){this.clearMute(),this.ads&&this.ads.setVolume(e)}.bind(this)),r.registerEventListener(\"toggleMute\",function(){this.toggleMute()}.bind(this)),this.startMute&&this.mute()},UOLPlayer.prototype.initBackbone=function(){this.backbone=this.backbone||new UOLPlayer.Backbone(this)},UOLPlayer.prototype.initMetrics=function(){this.metrics=this.metrics||new UOLPlayer.Metrics(this)},UOLPlayer.prototype.initTimeouts=function(){this.timeouts=this.timeouts||new UOLPlayer.Timeout(this)},UOLPlayer.prototype.mountAd=function(){this.dfp&&window.google&&window.google.ima?(this.adTagUrl=this.createAdTag(),this.ads=new UOLPlayerAds(this,this.mediaPlayer),this.ads.registerEventListener(\"adStarted\",function(){this.playing=!0}.bind(this)),this.ads.registerEventListener(\"contentCompleted\",function(){UOLPlayer.isMobile&&this.mediaPlayer.reloadContent()}.bind(this)),this.ads.registerEventListener(\"allAdsCompleted\",function(){UOLPlayer.isSafari&&UOLPlayer.isMobile&&this.mediaPlayer.reloadContent(),this.AllContentEnded()}.bind(this)),this.ads.registerEventListener(\"contentPauseRequested\",function(e){this.pauseForAd(),this.setVideoEndedCallbackEnabled(!1)}.bind(this)),this.ads.registerEventListener(\"contentResumeRequested\",function(e){this.controlBar.isMute()&&this.ads.adSkipped&&this.controlBar.clearMute(),e!=-1&&(this.resumeAfterAd(),this.mediaPlayer.play()),this.setVideoEndedCallbackEnabled(!0)}.bind(this)),this.ads.registerEventListener(\"timeupdate\",function(e){this.controlBar.updateProgress(e.currentTime,e.duration)}.bind(this))):this.logger.logDFP(\"DFP DESLIGADO\")},UOLPlayer.prototype.mountDownload=function(){if(this.download&&this.data.item){var e=this.wrapper.getElementsByClassName(\"up-bt-download\")[0],t=this.data.item.hash||this.mediaId;if(t=t.split(\"-\"),t.length>1&&t.pop(),t=t.join(\"-\").replace(/-+/g,\"-\"),\"V\"==this.data.item.type){var a=\"0\";for(var r in this.data.formats.available)parseInt(r)>parseInt(a)&&(a=r);parseInt(a)>0&&(this.wrapper.getElementsByClassName(\"up-bt-download-display\")[0].show(),e.setAttribute(\"alt\",a),e.setAttribute(\"text\",a),e.setAttribute(\"href\",UOLPlayer.mediaSourceURL(this.data.formats.available[a].url,this.revision,this.hashId)),e.setAttribute(\"download\",t+\".mp4\"))}else{var i=UOLPlayer.mediaSourceURL(this.data.formats.url,this.revision,this.hashId);e.setAttribute(\"href\",i),e.setAttribute(\"download\",t+\".mp3\"),this.wrapper.getElementsByClassName(\"up-bt-download-display\")[0].show()}}},UOLPlayer.prototype.checkSize=function(){var e=this.getSize();this.isDetached()||this.isFullscreen()?this.isDetached()&&!this.isFullscreen()?this.wrapper.addClass(\"_small\"):this.isFullscreen()&&this.wrapper.removeClass(\"_small\").removeClass(\"_medium\"):e.width<=250?(this.wrapper.removeClass(\"_medium\").addClass(\"_small\"),this.related=!1):e.width>250&&e.width<=350?this.wrapper.removeClass(\"_small\").addClass(\"_medium\"):this.wrapper.removeClass(\"_small\").removeClass(\"_medium\");var t=this.wrapper.getElementsByClassName(\"uolplayer-container\")[0],a=function(){if(t&&\"video\"===this.mediaType){var e=this.getSize(),a=e.windowWidth,r=e.windowWidth/(16/9),i=Math.floor(a/r*e.windowHeight);e.windowHeight;r>e.windowHeight?(t.style.width=i+\"px\",t.style.margin=\"auto\"):t.style.width=\"auto\"}}.bind(this);UOLPlayer.isIframe&&(a(),window.addEventListener(\"resize\",this.checkSize.bind(this)))},UOLPlayer.prototype.toggleMute=function(){this.wrapper.hasClass(\"_mute\")?this.wrapper.removeClass(\"_mute\"):this.wrapper.addClass(\"_mute\"),this.mediaPlayer.toggleMute(),this.controlBar.toggleMute(),this.ads&&this.ads.toggleMute()},UOLPlayer.prototype.mute=function(){this.wrapper.addClass(\"_mute\"),this.mediaPlayer.mute(),this.controlBar.mute(),this.ads&&this.ads.mute()},UOLPlayer.prototype.clearMute=function(){this.wrapper.removeClass(\"_mute\"),this.wrapper.setData(\"startmute\",!1),this.startMute=!1},UOLPlayer.prototype.embedFlash=function(e){var t=this,a=UOLPlayer.Promise.get(UOLPlayer[\"const\"].urls.data.METADATA.replace(\"{mediaId}\",t.mediaId));a.then(function(e,a,r){return t.data=e,\"P\"==e.item.type?t.setError(UOLPlayer.ElementErrorHandler.errorCodes.AUDIO_FLASH_DEPRECATED):t.setError(UOLPlayer.ElementErrorHandler.errorCodes.VIDEO_FLASH_DEPRECATED)},function(e,a,r){return 400===a?t.setError(UOLPlayer.ElementErrorHandler.errorCodes.INVALID_MEDIA_ID):t.setError(UOLPlayer.ElementErrorHandler.errorCodes.MEDIA_NOT_FOUND)})},UOLPlayer.prototype.renderMarkup=function(e,t){var a=UOLPlayer.urlParameter.cors?\"crossorigin=\"+UOLPlayer.urlParameter.cors:\"\";this.btPlayMarkup=UOLPlayerUI.btPlayMarkup.replace(/\\{\\{this.app.forwardRewindBase\\}\\}/g,this.forwardRewindBase),this.ctrlBarMarkup=UOLPlayerUI.controlbarMarkup,this.autorepMarkup='<div class=\"up-autorep\"><div class=\"up-autorep-label\">Reprodução<br />automática <span class=\"up-time\">em 5s</span></div><svg class=\"up-switch up-switch-off\" xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"28\" viewBox=\"0 10 48 28\"><g fill=\"none\" fill-rule=\"evenodd\"><rect class=\"up-switch-countdown\" width=\"46\" height=\"22\" x=\"1\" y=\"13\" stroke=\"#FFF\" rx=\"11\"/><rect width=\"46\" height=\"22\" x=\"1\" y=\"13\" stroke=\"rgba(255,255,255,0.2)\" stroke-width=\"2px\" rx=\"11\"/><rect width=\"40\" height=\"16\" x=\"4\" y=\"16\" fill=\"#FFF\" rx=\"8\"/><circle class=\"up-switch-circle\" cx=\"34\" cy=\"24\" r=\"4\" fill=\"#22DC72\"/></g></svg></div>',this.startMuteMarkup='<div class=\"up-startmute up-bt up-bt-volume up-bt-volume-mute\"></div>',this.toolbarMarkup=this.related||this.share||this.autorep?'<div class=\"up-toolbar\"><div class=\"up-bt-related display-none\"></div><div class=\"up-bt-share display-none\"></div></div>':\"\",this.preloadMarkup=this.hasClass(\"up-preload\")?\"\":'<div class=\"up-preload\"><div class=\"up-icon up-preload-spinner\"></div><div class=\"up-poster\"></div></div>',this.markup=this.preloadMarkup+this.startMuteMarkup+'<div class=\"ui\" style=\"display:none\">'+this.toolbarMarkup+this.ctrlBarMarkup+this.autorepMarkup+'<div class=\"up-for-ad\"><div class=\"up-ad-visit-advertiser\"><div class=\"up-ad-text\">Visitar anunciante</div></div><div class=\"up-ad-countdown\"><div class=\"up-ad-text\">Publicidade &#8226; <span class=\"up-ad-remaining-time\"></span></div></div><div class=\"up-ad-progress\"><div class=\"up-ad-bar\"></div></div></div><div class=\"up-error display-none\"><p>Este v&iacute;deo est&aacute; indispon&iacute;vel no momento</p></div>'+this.btPlayMarkup+'</div><audio class=\"audio-element\" type=\"audio/mpeg\"></audio><video '+a+\" \"+(this.autoplay&&UOLPlayer.isMobile?\"autoplay\":\"\")+' playsinline class=\"video-element\" type=\"video/mp4\"></video><div class=\"ad-container\"></div>',this.wrapper.appendHtml('<div class=\"uolplayer-container\"><div class=\"uolplayer-elements\">'+this.markup+\"</div></div>\"),e()},UOLPlayer.prototype.mountMarkup=function(){return this.markupPromise=this.markupPromise||new UOLPlayer.Promise(this.renderMarkup.bind(this)),this.markupPromise},UOLPlayer.prototype.changeVideo=function(e,t){UOLPlayer.i('UOLPlayer: ChangeVideo(\"'+e+'\")');var t=t||{},a=JSON.stringify(this.tracker.getData());UOLPlayer.sendUnloadLog(this.wrapper,\"changeVideo\"),this.destroy();var r=this.wrapper;for(value in t)r.setData(value,t[value]);return r.setData(\"mediaid\",e).setData(\"changeVideo\",!0).setData(\"materialized\",!1),this.detach&&r.setData(\"detachstate\",this.detach.state),r.setData(\"startmute\",!1),this.onDemandClicked&&!UOLPlayer.isMobile&&r.setData(\"onDemandClicked\",this.onDemandClicked),t.autoplay===!1?r.setData(\"autoplay\",!1):(t&&!t.hlsFallback&&!UOLPlayer.isMobile||this.autoplay===!0)&&r.setData(\"autoplay\",!0),r.setData(\"previousStates\",JSON.stringify(a)),delete this,new UOLPlayer(r)},UOLPlayer.prototype.initUI=function(){this.ui=new UOLPlayerUI(this,this.mediaPlayer),this.ui.btplay&&this.ui.btplay.show(),this.isMobile||this.onDemand||this.ui.btplay.addEventListener(\"click\",this.onClick.bind(this),!1);var e=this.wrapper.getElementsByClassName(\"up-duration\")[0]||this.wrapper.getElementsByClassName(\"up-time-duration\")[0];e.innerHTML=this.data&&this.data.item&&this.data.item.duration?this.data.item.duration.formatted:\"\",this.title&&(this.wrapper.addClass(\"with-title\"),this.wrapper.getElementsByClassName(\"up-title\")[0].innerHTML=this.data.item.title),this.rotateFallback(0)},UOLPlayer.prototype.rotateFallback=function(e){if(\"transform\"in document.body.style==!1&&\"webkitTransform\"in document.body.style==!0){var t=document.querySelector(\".up-preload-spinner\"),a=\"rotate(\"+e+\"deg)\";if(t){var r=-t.offsetWidth/2;t.style.marginTop=r+\"px\",t.style.marginLeft=r+\"px\",t.style.transform=a,t.style.webkitTransform=a,t.style.OTransform=a,t.style.MozTransform=a}setTimeout(this.rotateFallback.bind(this),10,e<360?e+5:0)}},UOLPlayer.prototype.renderFormats=function(e){\nif(this.tracker.pushState(\"formats\",Object.keys(e)),e&&e.hasOwnProperty(\"MP3\")){if(e.MP3.token&&e.MP3.sign){for(var t in e.MP3.alternatives)e.MP3.alternatives[t]=e.MP3.alternatives[t]+\"?token=\"+encodeURI(e.MP3.token)+\"&sign=\"+encodeURI(e.MP3.sign);e.MP3.url=e.MP3.url+\"?token=\"+encodeURI(e.MP3.token)+\"&sign=\"+encodeURI(e.MP3.sign)}return e.MP3}if(!e||void 0===e.audioUrl){var a,r,i={},s=\"8096p\",o=\"0p\";i.available={},i.list=[];for(r in e)if(a=e[r],a.type=r,r.indexOf(\"3gp\")==-1){if(r.indexOf(\"DASH\")!=-1&&UOLPlayer.Fingerprint.mediaTypeSupported.dash&&this.dashEnabled){if(a.mediaType=\"dash\",!UOLPlayer.isMobile){a.url=a.url.replace(\".mpd\",\".desk.mpd\");for(var t=0;t<a.alternatives.length;t++)a.alternatives[t]=a.alternatives[t].replace(\".mpd\",\".desk.mpd\")}i.available[r]=a}if(this.hlsFallback||r.indexOf(\"HLS\")==-1||!this.hlsEnabled&&!this.hlsNative||(a.mediaType=this.hlsNative?\"hlsNative\":\"hls\",i.available[r]=a),r.indexOf(\"WEBM\")!=-1&&UOLPlayer.Fingerprint.mediaTypeSupported.webm&&(a.mediaType=\"webm\",i.available[r]=a),r.indexOf(\"0p\")!=-1&&UOLPlayer.Fingerprint.mediaTypeSupported.mp4&&(a.mediaType=\"mp4\",r.indexOf(\"360p\")!=-1&&(i.available[r]=a),UOLPlayer.isMobile||(r.indexOf(\"720p\")!=-1&&(i.available[r]=a),r.indexOf(\"1080p\")!=-1&&(i.available[r]=a))),r.indexOf(\"mobile\")!=-1&&UOLPlayer.isMobile&&(a.mediaType=\"mp4Mobile\",i.available[r]=a),r.indexOf(\"mobile\")==-1&&\"flv\"!=r&&(parseInt(r)>0&&parseInt(r)<parseInt(s)&&(s=r),parseInt(r)>0&&parseInt(r)>parseInt(o)&&(o=r),i.list.push(a)),a.token&&a.sign){a.url+=\"?token=\"+encodeURI(a.token)+\"&sign=\"+encodeURI(a.sign);var n;for(n in a.alternatives)a.alternatives[n]+=\"?token=\"+encodeURI(a.token)+\"&sign=\"+encodeURI(a.sign)}}return i.minimalQualityMP4=s,UOLPlayer.Fingerprint.mediaTypeSupported.dash&&this.dashEnabled&&i.available.DASH?i[\"default\"]=i.available.DASH:(UOLPlayer.Fingerprint.mediaTypeSupported.hls&&this.hlsEnabled||this.hlsNative)&&i.available.HLS&&(i[\"default\"]=i.available.HLS),i[\"default\"]||(UOLPlayer.Fingerprint.mediaTypeSupported.mp4&&(i.available.mobile||i.available[s])?UOLPlayer.isMobile&&i.available.mobile?i[\"default\"]=i.available.mobile:i.available[s]?i[\"default\"]=i.available[s]:i.available.mobile&&(i[\"default\"]=i.available.mobile):UOLPlayer.Fingerprint.mediaTypeSupported.webm&&i.available.WEBM&&(i[\"default\"]=i.available.WEBM)),UOLPlayer.urlParameter.mp4===!0?i[\"default\"]=i.available[s]:UOLPlayer.urlParameter.webm===!0&&(i[\"default\"]=i.available.WEBM),this.renderRetry(i),i}},UOLPlayer.prototype.renderRetry=function(e){e.retry=[];var t=\"\";if(UOLPlayer.Fingerprint.mediaTypeSupported.mp4){var a={};UOLPlayer.isMobile&&e.available.mobile?a=UOLPlayer.cloneJSON(e.available.mobile):e.available[e.minimalQualityMP4]?a=UOLPlayer.cloneJSON(e.available[e.minimalQualityMP4]):e.available.mobile&&(a=UOLPlayer.cloneJSON(e.available.mobile)),a.token&&a.sign&&(t=\"?token=\"+encodeURI(a.token)+\"&sign=\"+encodeURI(a.sign)),a.alternatives&&(a.externalCDN||a.alternatives.push(\"video.m.mais.uol.com.br/\"+a.filename+\".mp4\"+t),e.retry.push(a))}if(UOLPlayer.Fingerprint.mediaTypeSupported.webm&&e.available.WEBM){var a={};a=UOLPlayer.cloneJSON(e.available.WEBM),a.token&&a.sign&&(t=\"?token=\"+encodeURI(a.token)+\"&sign=\"+encodeURI(a.sign)),a.alternatives&&!a.externalCDN&&a.alternatives.push(\"video.m.mais.uol.com.br/\"+a.filename+\".webm\"+t),e.retry.push(a)}},UOLPlayer.prototype.parseFormats=function(e){this.data.formats=this.data.formats||this.renderFormats(e)},UOLPlayer.prototype.createAdTag=function(){if(UOLPlayer.toBoolean(UOLPlayer.urlParameter.forcedfp))return\"https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&cmsid=496&vid=short_onecue&correlator=\";if(\"vpaid\"===UOLPlayer.urlParameter.forcedfp)return\"https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinearvpaid2js&correlator=\";var e,t,a=\"\";if(\"apple\"===UOLPlayer.urlParameter.forcedfp?this.iuDFP=\"/8804/teste/qa5\":UOLPlayer.isMobile&&this.iuDFP&&(this.iuDFP=this.iuDFP.replace(\"/uol/\",\"/uol_mobile/\").replace(\"/bol/\",\"/bol_mobile/\").replace(\"/folha/\",\"/folha_mobile/\").replace(\"/parceiros/\",\"/parceiros_mobile/\")),window.UOLPD){var r=window.UOLPD.dataLayer;for(key in r)a+=\"%26\"+key+\"%3D\"+r[key]}return e=\"codprofile%3D\"+this.data.item.codProfile+\"%26videotags%3D\"+this.data.item.tags+\"%26videoplayertype%3Dhtml5\"+a,t=UOLPlayer.HTTP+\"pubads.g.doubleclick.net/gampad/ads?sz=640x480&gdfp_req=1&iu=\"+this.iuDFP+\"&ciu_szs=300x250&url=[referrer_url]&correlator=[timestamp]&env=vp&unviewed_position_start=1&output=vast&impl=s&vid=\"+this.data.item.mediaId+\"&description_url=\"+this.data.item.url+\"&cust_params=\"+e},UOLPlayer.prototype.notifyMediaView=function(){var e=this;UOLPlayer.jsonp({url:UOLPlayer[\"const\"].urls.NOTIFY+this.mediaId,success:function(t){!e.serverTime.end&&t.item&&t.item.current_time&&(e.serverTime.end=t.item.current_time),e.clientTime.end||(e.clientTime.end=Date.now()),e.logger.log(\"notifyMediaView: OK!\")}})},UOLPlayer.prototype.onClick=function(){if(!this.playerStarted){this.initMetrics();var e={};this.hlsFallback&&(e.hlsFallback=!0),this.logger=this.logger||new UOLPlayerLog(this),this.logger.send(\"playerStart\",e),this.playerStarted=!0,this.chronoFirstMilestone.start(),this.detach&&this.detach.init(),this.initiated||(this.initiated=!0,UOLPlayer.onInit(this))}var t=UOLPlayer.getCurrentMedia();return void 0!==t&&t!==this&&t.deactivate(),this.wrapper.hasClass(\"_clicked\")||(UOLPlayer.onPlay(this),this.ui.setState(\"loading\"),this.ui.setState(\"play\"),this.wrapper.addClass(\"_clicked\")),this.audio||this.adsDone||!this.ads?(this.adsActive?this.playing?this.ads.pause():this.ads.resume():this.playing?(this.mediaPlayer.pause(),this.setRelated()):(this.setVideoEndedCallbackEnabled(!0),this.chronoVideoBegin.resume(),this.mediaPlayer.play(),this.wrapper.hasClass(\"_end\")&&(this.mediaPlayer.seek(0),this.wrapper.removeClass(\"_end\").removeClass(\"_share\").removeClass(\"_related\").removeClass(\"_tools\").removeClass(\"_error\").removeClass(\"_reload\"))),this.playing?this.ui.setState(\"pause\"):this.ui.setState(\"play\"),void(this.playing=!this.playing)):(this.ads.initialUserAction(),void this.mediaPlayer.preloadContent(function(){this.mediaPlayer.pause(),this.loadAds(),this.adsDone=!0}.bind(this)))},UOLPlayer.prototype.setFullscreen=function(){if(this.isIpad)return void(this.wrapper.hasClass(\"_fullscreen_ipad\")?(this.wrapper.removeClass(\"_fullscreen_ipad\"),this.ui.setFullscreen(!1)):(this.wrapper.addClass(\"_fullscreen_ipad\"),this.ui.setFullscreen(!0)));var e,t;this.isFullscreen()?(UOLPlayer.isIphone?this.mediaPlayer.mediaElement.webkitExitFullscreen():(t=document.exitFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.msExitFullscreen,t.call(document)),this.ui.setFullscreen(!1),this.tracker.pushState(\"fullscreen\",!1)):(UOLPlayer.isIphone?this.mediaPlayer.mediaElement.webkitEnterFullscreen():(e=this.wrapper.requestFullscreen||this.wrapper.mozRequestFullScreen||this.wrapper.webkitRequestFullscreen||this.wrapper.msRequestFullscreen,e.call(this.wrapper),this.ui.setFullscreen(!0)),this.tracker.pushState(\"fullscreen\",!0))},UOLPlayer.prototype.onFullscreenChange=function(){var e=this.getSize();this.isFullscreen()?(UOLPlayer.onFullscreen(this),this.ads&&this.ads.resize(e.fullscreenWidth,e.fullscreenHeight,\"FULLSCREEN\"),\"orientation\"in screen&&UOLPlayer.isMobile&&screen.orientation.lock(\"landscape-primary\")):(this.ui.setFullscreen(!1),this.ads&&this.ads.resize(e.width,e.height,\"NORMAL\"),\"orientation\"in screen&&UOLPlayer.isMobile&&screen.orientation.lock(\"natural\")),UOLPlayer.isIphone||this.checkSize()},UOLPlayer.prototype.loadAds=function(){this.mediaPlayer.removePreloadListener(),this.ads.requestAds(this.adTagUrl)},UOLPlayer.prototype.checkReBuffering=function(){if(this.chronoReBuffering){this.rebufferingCount+=1;var e=this.chronoReBuffering.stop(),t={time:e.elapsedTime,payload:{rebufferingCount:this.rebufferingCount}},a=10;this.data&&this.data.item&&this.data.item.playerParameters&&this.data.item.playerParameters.rebuffering_max_logs&&(a=this.data.item.playerParameters.rebuffering_max_logs),this.rebufferingCount<=a&&this.mediaPlayer.getCurrentTime()>0&&this.logger.send(\"rebuffering\",t)}this.chronoReBuffering=null},UOLPlayer.prototype.playingVideo=function(e){this.logger.log(\"playingVideo\");if(clearInterval(this.checkInterval),this.checkInterval=setInterval(function(){if(this.mediaPlayer.mediaElement.currentTime>0){if(clearInterval(this.checkInterval),!this.isPlaying()&&this._videoBeginSended!==!0){this._videoBeginSended=!0;var e=this.chronoVideoBegin.stop().elapsedTime,t=this.chronoVideoBegin.log(),a=this.serverTime.start?this.serverTime.start:\"Erro ao obter serverTimeStart\",r=this.serverTime.end?this.serverTime.end:\"Erro ao obter serverTimeEnd\",i=this.clientTime.start?this.clientTime.start:\"Erro ao obter clientTimeStart\",s=this.clientTime.end?this.clientTime.end:\"Erro ao obter clientTimeEnd\",o={debugDatesToTime:t.join(),debugTime:e.time,debugServerTimeStart:new Date(a).toString(),debugServerTimeEnd:new Date(r).toString(),debugClientTimeStart:new Date(i).toString(),debugClientTimeEnd:new Date(s).toString(),debugDiffTimeStart:this.serverTime.start-this.clientTime.start,debugDiffTimeEnd:this.serverTime.end-this.clientTime.end,debugTimeString:\"server: \"+a+\",\"+r+\" - client: \"+i+\",\"+s};this.logger.send(\"videoBegin\",{time:e,payload:o}),UOLPlayer.Promise.get(UOLPlayer[\"const\"].urls.BALANCE.replace(\"{mediaId}\",this.mediaId)),this.logFirstMilestone(\"videoBegin\")}this.ui.setState(\"playingVideo\"),this.detach&&this.detach.checkPosition()}}.bind(this),100),this.isPlaying()||this._videoBeginSended===!0)this.playing=!0,UOLPlayer.onResume(this),this.backbone.video.resume();else if(this.backbone.video.start(),this.notifyMediaView(),this.mediaPlayer.registerEventListener(\"waiting\",function(){this.ui.setState(\"waiting\"),this.chronoReBuffering=this.chronoReBuffering||new UOLPlayer.Chronometer(\"chronoReBuffering\"),this.chronoReBuffering.start()}.bind(this)),\"video\"===this.mediaType&&this.customTimeout&&!this.logSendedAfterTimeout&&(this.timeouts.dfpRequestAds.getStatus()||this.timeouts.dfpPlayAd.getStatus())){var t;clearInterval(t),t=setInterval(function(){this.mediaPlayer.mediaElement.currentTime>this.data.item.playerParameters.media_view_after_timeout&&(this.logSendedAfterTimeout=!0,this.logger.send(\"mediaViewAfterTimeout\"),clearInterval(t))}.bind(this),1e3)}this.balaioTimeout.abort(),this.ui.setState(\"play\"),this.wrapper.removeClass(\"_waiting\"),this.checkReBuffering()},UOLPlayer.prototype.pauseForAd=function(){this.logger.log(\"pauseForAd\"),this.adsActive=!0,this.mediaPlayer.pause(),this.ui.setState(\"loading\")},UOLPlayer.prototype.resumeAfterAd=function(){!this.ads.contentCompleteCalled&&UOLPlayer.isMobile&&this.ui.setState(\"loading\"),this.chronoVideoBegin.resume(),this.adsActive=!1,this.playing=!0},UOLPlayer.prototype.onContentEnded=function(){this.logger.log(\"onContentEnded\"),this.backbone.video.end(),this.ads?this.ads.adError?this.AllContentEnded():this.ads.contentEnded():this.AllContentEnded()},UOLPlayer.prototype.onVideoPause=function(e){this.isPlayingAd()||(UOLPlayer.onPause(this),this.pauseCounts+=1,this.playing=!1,this.backbone.video.pause())},UOLPlayer.prototype.forward=function(e){this.mediaPlayer&&this.mediaPlayer.forward(e)},UOLPlayer.prototype.rewind=function(e){this.mediaPlayer&&this.mediaPlayer.rewind(e)},UOLPlayer.prototype.setRelated=function(){this.playlist||UOLPlayer.isMobile||!this.related&&!this.autorep||this.relatedVideos.setRelated()},UOLPlayer.prototype.setShare=function(){(this.share&&UOLPlayer.isMobile||this.share&&!this.related&&!this.playlist&&!UOLPlayer.isMobile)&&(this.ui.setState(\"share\"),this.mediaPlayer.togglePause())},UOLPlayer.prototype.setError=function(e){this.logFirstMilestone(\"error\",{error:UOLPlayer.ElementErrorHandler.codeErros[e]});var t=null,a=this.wrapper.getElementsByClassName(\"up-error\")[0];if(a)t=a.getElementsByTagName(\"p\")[0];else{var r;r=UOLPlayer.domNode(\"div\"),r.className=\"ui\",a=UOLPlayer.domNode(\"div\"),a.addClass(\"up-error display-none\"),t=UOLPlayer.domNode(\"p\"),a.appendChild(t),r.appendChild(a),this.wrapper.appendChild(r)}UOLPlayer.e(\"ERROR REPORT\");var i=UOLPlayer.ElementErrorHandler.logMessage(e);if(e===UOLPlayer.ElementErrorHandler.errorCodes.VIDEO_FLASH_DEPRECATED||e===UOLPlayer.ElementErrorHandler.errorCodes.AUDIO_FLASH_DEPRECATED){var s=this.data.item.shareUrl||\"https://mais.uol.com.br/view/\"+this.mediaId;i.mensagem=i.mensagem.replace(/{mediaUrl}/g,s)}else if(e===UOLPlayer.ElementErrorHandler.errorCodes.PAYLOAD_TOO_LARGE){var o,n=\"\",l=\"\";try{o=UOLPlayer.isMobile?UOLPlayer.info.os:\"desktop\",n=UOLPlayer.ElementErrorHandler.supportUrls.cookies[UOLPlayer.info.browser.toLowerCase()][o.toLowerCase()],l='<a href=\"'+n+'\" target=\"_blank\">Clique aqui para iniciar.</a>'}catch(d){}i.mensagem=i.mensagem.replace(/{href}/g,l)}this.errorsReporteds=this.errorsReporteds||{},this.errorsReporteds[e]||(this.errorsReporteds[e]=!0,UOLPlayerLog.send(this,\"error\",i)),this.criticalFailure&&UOLPlayerLog.send(this,\"criticalFailure\",i),t.innerHTML=i.mensagem,setTimeout(function(){this.wrapper.removeClass(\"_loading\").removeClass(\"_waiting\").addClass(\"_error\")}.bind(this),100)},UOLPlayer.prototype.onVideoError=function(e){if(!e.srcElement||null!==e.srcElement.error){this.retryAttempts=this.retryAttempts||0;var t,a={};(\"undefined\"==typeof this.errorTime||this.mediaPlayer.getCurrentTime()>0)&&(this.errorTime=this.mediaPlayer.getCurrentTime()),this.data&&this.data.formats&&this.data.formats.retry&&(a=this.data.formats.retry);var r=function(){for(var i=0;a[i]&&a[i].mediaType!==this.mediaPlayer.mediaType;)i++;if((!this.currentRetryObj||this.currentRetryObj.alternatives&&0===this.currentRetryObj.alternatives.length)&&(this.currentRetryObj=a.splice(i,1)[0]),void 0!==this.currentRetryObj&&(t=this.currentRetryObj.alternatives.shift()),void 0===t&&a.length>0){var s=function(){this.mediaPlayer.mediaType=a[0].mediaType,r()}.bind(this);return this.dataParser&&this.dataParser.promises&&!this.dataParser.promises.formatsRetry?this.dataParser.formatsRetryPromise().then(function(t,a,r){this.data.item.formats=t,this.data.formats=this.renderFormats(t),this.hlsEnabled&&this.mediaPlayer.hls&&!UOLPlayer.isSafariMacOS?this.mediaPlayer.formatsReloaded():this.onVideoError(e)}.bind(this),s):s()}if(void 0!==t){if(UOLPlayer.isIOS&&this.hlsNative){this.hlsNative=!1,this.ads&&(this.ads.destroy(),this.ads=null),this.wrapper.addClass(\"_clicked\").addClass(\"_loading\"),this.setVideoEndedCallbackEnabled(!1);var o=setTimeout(function(){clearInterval(o),this.setVideoEndedCallbackEnabled(!0)}.bind(this),200)}this.retryAttempts++;var n=[this.data.formats[\"default\"].mediaType,this.mediaPlayer.lastUrl.split(\"?\")[0]];if(this.data.formats[\"default\"]=this.currentRetryObj,this.hlsEnabled&&this.mediaPlayer.hls){var l=e.error||\"\";this.mediaPlayer.currentM3u8&&(n[1]=this.mediaPlayer.currentM3u8),this.mediaPlayer.sendError(l),this.mediaPlayer.hls.destroy(),this.mediaPlayer=new UOLPlayer.VideoPlayer(this,this.wrapper),this.controlBar&&this.controlBar.update()}if(this.dashEnabled&&this.mediaPlayer.dash){var l=e.error||\"\";this.mediaPlayer.mpd&&(n[1]=this.mediaPlayer.mpd),this.mediaPlayer.sendError(l),this.mediaPlayer.dash.reset(),this.mediaPlayer=new UOLPlayer.VideoPlayer(this,this.wrapper),this.controlBar&&this.controlBar.update()}this.mediaPlayer.videoURL=UOLPlayer.mediaSourceURL(t,this.data.item.revision,this.hashId),this.mediaPlayer.reloadContent(this.errorTime);var d={retryPreviousFormat:n[0],retryPreviousServer:n[1],retryCurrentFormat:this.currentRetryObj.mediaType,retryCurrentServer:t,retryAttempt:this.retryAttempts};this.logger.send(\"retry\",{payload:d}),this.balaioTimeout&&this.balaioTimeout.start(function(){r()}.bind(this))}else this.balaioTimeout&&this.balaioTimeout.abort(),UOLPlayer.ElementErrorHandler.mediaElementErrorHanlder(this,this.mediaPlayer.mediaElement)}.bind(this);r()}},UOLPlayer.prototype.onAudioError=function(e){if(this.errorTime=void 0===this.errorTime?this.mediaPlayer.getCurrentTime():this.errorTime,this.retryAttempts=void 0===this.retryAttempts?this.data.formats.alternatives.length+2:this.retryAttempts,this.retryAttempts>0)this.tracker.pushState(\"retryError\",this.retryAttempts),!this.hasClass(\"_clicked\")&&this.ui&&this.ui.setState(\"loading\"),this.logger.logError(\"executando retentativa - \"+this.retryAttempts),this.mediaPlayer.reloadContent(),this.retryAttempts--;else{this.tracker.pushState(\"retryError\",0);var t=e.target||e.srcElement;t&&t.error?t.error.code:0;UOLPlayer.ElementErrorHandler.mediaElementErrorHanlder(this,this.mediaPlayer.mediaElement)}},UOLPlayer.prototype.AllContentEnded=function(){this.adsDone=!0,this.adsActive=!1,this.playing=!1,this.ads=!1,this.replay=!0,this.ui.setState(\"ended\"),this.wrapper.addClass(\"_end\"),this.setRelated(),this.setShare(),this.setRepro(),UOLPlayer.isMobile&&this.isFullscreen()&&this.setFullscreen(),this.detachPlayer&&this.detachPlayer(!1),UOLPlayer.onEnd(this)},UOLPlayer.prototype.setRepro=function(){this.repro&&this.repro.countdown()},UOLPlayer.prototype.setVideoEndedCallbackEnabled=function(e){this.logger.log(\"setVideoEndedCallbackEnabled: \"+e),e?(this.mediaPlayer.registerEventListener(\"loadstart\",this.videoLoadStartCallback),this.mediaPlayer.registerEventListener(\"playing\",this.videoPlayingCallback),this.mediaPlayer.registerEventListener(\"ended\",this.videoEndedCallback)):(this.mediaPlayer.removeEventListener(\"loadstart\",this.videoLoadStartCallback),this.mediaPlayer.removeEventListener(\"playing\",this.videoPlayingCallback),this.mediaPlayer.removeEventListener(\"ended\",this.videoEndedCallback))},UOLPlayer.prototype.hasClass=function(e){return this.wrapper.hasClass(e)},UOLPlayer.prototype.addClass=function(e){return this.wrapper.addClass(e),this},UOLPlayer.prototype.removeClass=function(e){return this.wrapper.removeClass(e),this},UOLPlayer.prototype.bindOnlineMonitor=function(){var e=function(){}.bind(this);window.addEventListener(\"online\",e),window.addEventListener(\"offline\",e),e()},UOLPlayer.prototype.checkFixedPoster=function(){this.poster&&\"audio\"===this.mediaType&&!this.wrapper.hasClass(\"_fixedposter\")&&(this.wrapper.addClass(\"_fixedposter\"),UOLPlayer.setThumb(this.wrapper,this.poster))},UOLPlayer.prototype.getSize=function(){var e=this.wrapper.getElementsByClassName(\"uolplayer-elements\")[0]||this.wrapper,t=e.offsetWidth,a=e.offsetHeight,r=window.innerWidth,i=window.innerHeight;return{width:t,height:a,fullscreenWidth:window.outerWidth,fullscreenHeight:window.outerHeight,windowWidth:r,windowHeight:i,formatted:t+\"x\"+a}},UOLPlayer.prototype.getState=function(){var e=\"\";return e=this.wrapper.hasClass(\"_loading\")?UOLPlayer.LOADING:this.wrapper.hasClass(\"_waiting\")?UOLPlayer.BUFFERING:this.wrapper.hasClass(\"_paused\")?UOLPlayer.PAUSED:this.wrapper.hasClass(\"_end\")?UOLPlayer.ENDED:this.wrapper.hasClass(\"_playing-ad\")?UOLPlayer.PLAYINGAD:this.wrapper.hasClass(\"_playing-video\")?\"video\"===this.mediaType?UOLPlayer.PLAYINGVIDEO:UOLPlayer.PLAYINGAUDIO:UOLPlayer.READY},UOLPlayer.prototype.getFullState=function(){var e=\"\";return e=this.wrapper.hasClass(\"_error\")?UOLPlayer.ERROR:this.wrapper.hasClass(\"_loading\")&&!this.wrapper.hasClass(\"_clicked\")?UOLPlayer.PRELOADING:this.wrapper.hasClass(\"_loading\")&&!this.wrapper.hasClass(\"_loading-ad\")?UOLPlayer.LOADING:this.wrapper.hasClass(\"_waiting\")?UOLPlayer.BUFFERING:this.wrapper.hasClass(\"_paused\")&&this.wrapper.hasClass(\"_playing-ad\")?UOLPlayer.ADPAUSED+(this.wrapper.getData(\"adPos\")?\"_\"+this.wrapper.getData(\"adPos\"):\"\"):this.wrapper.hasClass(\"_paused\")&&this.wrapper.hasClass(\"_playing\")?UOLPlayer.VIDEOPAUSED:this.wrapper.hasClass(\"_end\")?UOLPlayer.ENDED:this.wrapper.hasClass(\"_loading-ad\")?UOLPlayer.LOADINGAD+(this.wrapper.getData(\"adPos\")?\"_\"+this.wrapper.getData(\"adPos\"):\"\"):this.wrapper.hasClass(\"_playing-ad\")?UOLPlayer.PLAYINGAD+(this.wrapper.getData(\"adPos\")?\"_\"+this.wrapper.getData(\"adPos\"):\"\"):this.wrapper.hasClass(\"_playing-video\")?\"video\"===this.mediaType?UOLPlayer.PLAYINGVIDEO:UOLPlayer.PLAYINGAUDIO:UOLPlayer.READY},UOLPlayer.prototype.destroy=function(){function e(){}this.logger.log(\"[DESTROYING PLAYER]\"),window.clearInterval(this.queueInteractionsInterval),this.wrapper.empty();var t=this.mediaId,a=this.hashId;this.ads&&this.ads.destroy(!0),this.detach&&this.detach.destroy(),this.observer&&this.observer.disconnect();try{this.parentNode.replaceChild(this.originalWrapper,this.wrapper)}catch(r){}this.wrapper=this.originalWrapper,UOLPlayer[t]=UOLPlayer[a]=new e,delete UOLPlayer[a],delete UOLPlayer[t]},UOLPlayer.prototype.deactivate=function(){return clearTimeout(this.timeout),this.getState()===UOLPlayer.LOADING||this.getState()===UOLPlayer.BUFFERING?void(this.timeout=setTimeout(function(){UOLPlayer.getCurrentMedia()!==this&&this.deactivate()}.bind(this),100)):(this.ads&&this.ads.pause(),this.playing&&this.play(),void(this.deactivated=!0))},UOLPlayer.prototype.isStarted=function(){return this.wrapper.hasClass(\"_clicked\")&&this.getState()!==UOLPlayer.PAUSED&&this.getState()!==UOLPlayer.ENDED},UOLPlayer.prototype.isDetached=function(){return this.wrapper.hasClass(\"up-detach\")},UOLPlayer.prototype.isPlaying=function(){return this.wrapper.hasClass(\"_playing-video\")},UOLPlayer.prototype.wasPlayed=function(){return this.wrapper.hasClass(\"_playing\")},UOLPlayer.prototype.isPlayingAd=function(){return this.wrapper.hasClass(\"_playing-ad\")},UOLPlayer.prototype.isPaused=function(){return this.wrapper.hasClass(\"_paused\")},UOLPlayer.prototype.isFullscreen=function(){var e=(document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen||document.msFullscreenElement)&&(this.wrapper.hasClass(\"_fullscreen\")||this.wrapper.hasClass(\"_fullscreen_ipad\"));return UOLPlayer.isFullscreen=e,e},UOLPlayer.prototype.setControlHeight=function(e){e=parseInt(e)?parseInt(e):0,this.wrapper.querySelector(\".up-ctrlbar\").style.bottom=e+\"px\"};var UOLPlayerLog=function(e){this.app=e,this.performance=window.performance&&window.performance.now?window.performance:{now:function(){return 0}},this.logTimers={},this.logEnabled=UOLPlayer.config.log;var t={LOG:{color:\"#353535\"},DFP:{color:\"#2A852B\"},METRICS:{color:\"#E67C17\"},ERROR:{color:\"#850000\"},TIME:{color:\"#356AFF\"},TIMEOUT:{color:\"#7f2fd8\"},HLS:{color:\"#a4c0Ff\"},DASH:{color:\"#4286f4\"},TEST:{color:\"#e100ff\"}},a=function(e){var a=t[e].color;return this.logEnabled?function(t){UOLPlayer.isIE&&!UOLPlayer.isEdge?UOLPlayer.l(e+\" | \"+t):UOLPlayer.l(\"%c\"+e+\" | \"+t+\" \",\"background: \"+a+\"; color: #fff; font-size: 14px\"),this.logEnabled&&UOLPlayer.isMobile&&this.app.wrapper&&!this.divConsole&&(this.divConsole=UOLPlayer.domNode(\"div\"),this.divConsole.addClass(\"uolplayer-console\"),this.app.wrapper.appendChild(this.divConsole)),this.divConsole&&(this.divConsole.innerHTML=this.divConsole.innerHTML+'<br/><span style=\"background: '+a+'; color: #fff;\">'+e+\": \"+t+\"</span>\",this.divConsole.scrollTop=this.divConsole.scrollHeight)}:function(){}}.bind(this);this.log=a(\"LOG\"),this.logTime=a(\"TIME\"),this.logDFP=a(\"DFP\"),this.logMetrics=a(\"METRICS\"),this.logError=a(\"ERROR\"),this.logTimeout=a(\"TIMEOUT\"),this.logHLS=a(\"HLS\"),this.logDASH=a(\"DASH\"),this.logTEST=a(\"TEST\")};UOLPlayerLog.prototype.startTime=function(e){this.logTime(\"START - \"+e),this.logTimers[e]={},this.logTimers[e].startTime=(new Date).getTime(),this.logTimers[e].startPerformance=this.performance.now()},UOLPlayerLog.prototype.stopTime=function(e){if(this.logTimers[e])return this.logTimers[e].time=(new Date).getTime()-this.logTimers[e].startTime,this.logTimers[e].performance=Math.floor(this.performance.now()-this.logTimers[e].startPerformance),this.logTime(\"STOP - \"+e+\" - time: \"+this.logTimers[e].time+\" - performace: \"+this.logTimers[e].performance),this.logTimers[e]},UOLPlayerLog.prototype.tick=function(e){this.logTimers[e].tick||(this.logTimers[e].tick=[]),this.logTime(\"TICK - \"+e+\" - TIME: \"+this.stopTime(e).time),this.logTimers[e].tick.push(this.stopTime(e))},UOLPlayerLog.prototype.getTime=function(e){return this.logTimers[e]},UOLPlayerLog.prototype.send=function(e,t,a){this.log(\"LOG \"+e),UOLPlayerLog.send(this.app,e,t,a)},UOLPlayerLog.send=function(e,t,a,r){var i=UOLPlayerLog.prepareObject(e,t,a);(UOLPlayer.config.log||\"error\"===t)&&UOLPlayer.l(i),UOLPlayerLog.sendToMiner(e,t,i,r)},UOLPlayerLog.sendToMiner=function(e,t,a,r){var i=UOLPlayerLog.params(a,\";\"),s=\"&prd=17\",o=\"&msr=\"+t+\":1;\"+i.measures,n=\"&grp=\"+i.groups,l=UOLPlayer[\"const\"].urls.MINER+s+o+n,d=r||{};d.url=l,UOLPlayer.ajax(d)},UOLPlayerLog.params=function(e,t){var a=\"\",t=t||\"&\",r=[],i=[],s=[\"mediaId\",\"apiDrakkarStatus\",\"apiCroupierStatus\",\"typeError\",\"rebuffering\",\"rebufferingCount\"];for(var o in e)a=!1,e[o]&&e[o].push?e[o].length>0&&(a=o+\":\"+encodeURIComponent(JSON.stringify(e[o]))):a=o+\":\"+encodeURIComponent(e[o]),a!==!1&&(s.indexOf(o)===-1&&\"number\"==typeof e[o]?r.push(a):i.push(a));return{measures:r.join(t),groups:i.join(t)}},UOLPlayerLog.prepareObject=function(e,t,a){var r,i,s,o,n,r={},l=!1,d=\"\",p=\"\",u=\"\",h=0,m=0,c=\"\",y=0,g=0,v=0,P=0,f=0,L=0;try{if(a&&(r.timeout=!!a.timeout&&a.timeout,a.timeoutId&&(r.timeoutId=a.timeoutId),void 0!==a.adError&&(r.adError=a.adError),void 0!==a.ad&&(r.ad=a.ad),a.adObj&&(r.adId=a.adObj.getAdId(),r.adSystem=a.adObj.getAdSystem(),r.adCreativeId=a.adObj.getCreativeId(),r.adTitle=a.adObj.getTitle()+\"_\"+r.adId,r.adContentType=a.adObj.getContentType()),a.time&&(i=a.time.time,s=a.time.performance),void 0!==a.payload&&(r=UOLPlayer.mergeObject(r,a.payload)),void 0!==a.typeError&&(r=UOLPlayer.mergeObject(r,a)),\"GA\"==t))for(var n in a)r[\"GA_\"+n]=a[n];if(UOLPlayer.info&&(r.browser=UOLPlayer.info.browser+\" \"+UOLPlayer.info.browserMajorVersion,r.os=UOLPlayer.info.os+\" \"+UOLPlayer.info.osVersion),e.data&&e.data.item){if(l=e.data.item.userIp,d=e.data.item.url,p=e.data.item.duration.seconds,u=e.data.item.author,h=e.data.item.revision,e.data.item.playerParameters)for(var n in e.data.item.playerParameters)r[\"playerParameters_\"+n]=e.data.item.playerParameters[n];if(e.data.item.publishedDate){var O=e.data.item.publishedDate.formatted;r.publishedDate=parseInt(O.substr(4,4)+O.substr(2,2)+O.substr(0,2)),r.publishedTimestamp=e.data.item.publishedDate.timestamp}}if(e.statistic&&(r.downloadTime=e.statistic.amountTime,r.downloadSize=e.statistic.amountSize,r.downloadVelocity=e.statistic.amountTime>0?1e3*e.statistic.amountSize/e.statistic.amountTime:0,r.downloadVelocityKB=r.downloadVelocity/1024),e.keyboardState)for(var n in e.keyboardState)r[\"keyboard_\"+n]=e.keyboardState[n];if(e.wrapper){y=e.wrapper.clientWidth,g=e.wrapper.clientHeight,y>0&&g>0&&(v=y/g),UOLPlayer.isIframe&&(\"number\"==typeof window.innerWidth?(P=window.innerWidth,f=window.innerHeight):document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?(P=document.documentElement.clientWidth,f=document.documentElement.clientHeight):document.body&&(document.body.clientWidth||document.body.clientHeight)&&(P=document.body.clientWidth,f=document.body.clientHeight),P>0&&f>0&&(L=f/f));var o=UOLPlayer.getCookie(\"DNA\")||\"\";o=o.split(\"|\").shift()}e.mediaPlayer&&e.mediaPlayer.mediaElement&&(c=e.mediaPlayer.mediaElement.src,m=e.mediaPlayer.mediaElement.maxReadyState,r.currentTime=e.mediaPlayer.mediaElement.currentTime||0,r.playbackRate=e.mediaPlayer.mediaElement.playbackRate,e.mediaPlayer.mediaElement.error&&(r.mediaErrorCode=e.mediaPlayer.mediaElement.error.code,r.mediaErrorMessage=e.mediaPlayer.mediaElement.error.message));for(n in UOLPlayer.Cache.logs){var E=UOLPlayer.Cache.logs[n];r[\"cache_\"+n+\"_time\"]=E.time.time,r[\"cache_\"+n+\"_state\"]=E.state,r[\"cache_\"+n+\"_error\"]=E.error,r[\"cache_\"+n+\"_crc32\"]=E.crc32}if(UOLPlayer.Profiler.parsedAt){var U=new Date;r.parsedAt=UOLPlayer.Profiler.parsedAt.toDateTime(),r.logAt=U.toDateTime(),r.largeTimeDiff=U-UOLPlayer.Profiler.parsedAt>2e5}for(n in UOLPlayer.Profiler.requests)r[\"server_\"+n+\"_time_min\"]=UOLPlayer.Profiler.requests[n].minimum,r[\"server_\"+n+\"_time_max\"]=UOLPlayer.Profiler.requests[n].maximum,r[\"server_\"+n+\"_last_status\"]=UOLPlayer.Profiler.requests[n].status;for(n in UOLPlayer.Profiler.serverStatus)r[\"server_\"+n+\"_status\"]=UOLPlayer.Profiler.serverStatus[n];for(n in UOLPlayer.Profiler.apis)r[\"api_\"+n+\"_time\"]=UOLPlayer.Profiler.apis[n].time,r[\"api_\"+n+\"_status\"]=UOLPlayer.Profiler.apis[n].status;UOLPlayer.Profiler.servers&&(r.servers=UOLPlayer.Profiler.servers),r.caches_invalidation=UOLPlayer.invalidated;var b=/^https:/;r.ip=l,r.logName=t,r.hashId=e.hashId,r.mediaId=e.mediaId,r.time=i,r.performance=s,r.duration=p,r.author=u,r.revision=h,r.maxReadyState=m,r.dna=o,r.userAgent=UOLPlayer.info.userAgent,r.mobile=e.isMobile,r.mediaType=e.audio?\"audio\":\"video\",r.version=UOLPlayer.version,r.hlsNative=!!e.hlsNative,r.hls=!!e.hlsEnabled||r.hlsNative,r.webm=!!e.webmEnabled,r.mp4=!(r.hls&&r.webm),r.flashFallback=e.flashFallback,r.onDemand=e.onDemand,r.pauseCounts=e.pauseCounts,r.related=!!e.related,r.recommended=\"string\"==typeof e.recommended?e.recommended:!!e.recommended,r.autoplayScroll=!!e.wrapper.getData(\"autoplayscroll\"),r.autoplay=e._autoplay||r.autoplayScroll,r.autoplayMobile=!!e.autoplayMobile,r.autoplayRejects=!!e.autoplayRejects,r.syntheticPlay=e.syntheticPlay,r.replay=e.replay,r.XHR2Supported=UOLPlayer.isXHR2Supported,r.testEnabled=\"\"!==e.testEnabled&&e.testEnabled,r.dfp=e.dfp,r.iuDFP=e.iuDFP,r.hostname=UOLPlayer.hostName,r.url=UOLPlayer.getURL(),r.loadApiError=e.apiError&&e.apiError.length>0?e.apiError:\"\",r.criticalFailure=e.criticalFailure===!0,r.download=e.download,r.currentFormat=e.currentFormat,r.testParticipant=e.testParticipant,r.externalCDN=e.externalCDN,r.environment=UOLPlayer.environment(),r.isFlash=e.flashFallback||e.isFlash,r.isIframe=UOLPlayer.isIframe,r.isUrlSecurity=b.test(UOLPlayer.getURL()),r.isIframeSecurity=UOLPlayer.isIframe&&b.test(document.referrer),r.isInstantArticle=UOLPlayer.isInstantArticle,r.isAMP=UOLPlayer.isAMP,r.isLegacyIframe=UOLPlayer.isLegacyIframe,r.wrapperWidth=y,r.wrapperHeight=g,r.wrapperAspectRatio=v,r.iFrameWidth=P,r.iFrameHeight=f,r.iframeAspectRatio=L,r.fingerprint=UOLPlayer.Fingerprint.id,r.isAutoplayRejected=!e.isAutoplayOk,r.isAutoplayMuted=e.isAutoplayMuted,r.instancesAutoLoaded=UOLPlayer.instancesAutoLoaded,r.instancesMaterialized=UOLPlayer.instancesMaterialized,r.timeLoadApi=e.chronoLoadApi?e.chronoLoadApi.time:\"\",e.chronoLoadLibHLS&&(r.timeLoadLibHls=e.chronoLoadLibHLS.time),e.chronoLoadLibDFP&&(r.timeLoadLibDfp=e.chronoLoadLibDFP.time),e.tracker&&(r=UOLPlayer.mergeObject(r,e.tracker.getData())),UOLPlayer.supportedMediaTypes&&(r=UOLPlayer.mergeObject(r,UOLPlayer.supportedMediaTypes))}catch(C){UOLPlayer.e(C)}return r},UOLPlayer.searchLog=function(e){var t=function(e,t){var a=UOLPlayerLog.params(e,\";\"),r=\"&prd=17\",i=\"&msr=fix:1\",s=\"&grp=\"+a.groups,o=UOLPlayer[\"const\"].urls.MINER+r+i+s,n=t||{};n.url=o,UOLPlayer.ajax(n)};return t}(),UOLPlayer.currentFormatLog=function(e,t,a){return UOLPlayer.i(\"[UOLPLAYER] \"+t+\" - \"+a),e.logger.log(t+\" - \"+a),a};var UOLPlayerUI=function(e,t){this.app=e,this.player=t,this.ui=this.app.wrapper.getElementsByClassName(\"ui\")[0],this.posterPreload=this.app.wrapper.getElementsByClassName(\"up-poster\")[0],this.poster=this.ui.getElementsByClassName(\"up-poster\")[0],this.btplay=this.ui.getElementsByClassName(\"bt-play\")[0],this.btforward=this.ui.getElementsByClassName(\"up-bt-forward\")[0],this.timeoutMouseout=this.app.wrapper.getData(\"timeout\")||6e3,this.btplay&&(this.btplayIcon=this.btplay.getElementsByClassName(\"up-icon\")[0]),this.app.wrapper.getData(\"totaltime\")&&(this.btplay.getElementsByClassName(\"up-play-time\")[0].innerHTML=this.app.wrapper.getData(\"totaltime\")),this.initSkin(),this.initCtrlBar(),this.app.audio||(UOLPlayer.setPoster(this.app,this.poster),UOLPlayer.setPoster(this.app,this.posterPreload)),UOLPlayer.eventsControl.call(this),this.events={mouseover:new UOLPlayer.customEvents,\nmouseout:new UOLPlayer.customEvents}},volumeMarkup='<div class=\"up-ctrlbar-cell up-volume-group\"><div class=\"up-bt up-bt-volume up-bt-volume-mute\"></div><div class=\"up-volume\"><div class=\"up-dragbar-control up-dragbar up-volume-panel\"><div class=\"up-dragbar-handle\"></div><div class=\"up-dragbar-slider\"><div class=\"up-dragbar-bar\"></div><div class=\"up-dragbar-buffered\"></div></div></div></div></div>',changeQualityMarkup='<div class=\"up-ctrlbar-tools\"><div class=\"up-ctrlbar-wrapper\"><div class=\"up-ctrlbar-tools-panel\"><div class=\"up-ctrlbar-tools-item up-ctrlbar-tools-head up-ctrlbar-openquality\"><div class=\"up-ctrlbar-tools-label\">Qualidade</div><div class=\"up-ctrlbar-tools-content up-next-element\"><span class=\"quality-isauto\">Auto</span> <span class=\"quality-type\"></span></div></div><div class=\"up-ctrlbar-tools-item up-ctrlbar-tools-head up-ctrlbar-openplaybackrate\"><div class=\"up-ctrlbar-tools-label\">Velocidade</div><div class=\"up-ctrlbar-tools-content up-next-element playbackrate-current\">Normal</div></div><div class=\"up-ctrlbar-tools-item up-ctrlbar-autorep display-none\"><div class=\"up-ctrlbar-tools-label\">Reprodução automática</div><div class=\"up-ctrlbar-tools-content\"><svg  class=\"up-switch up-switch-on\" xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"28\" viewBox=\"0 10 48 28\"><g fill=\"none\" fill-rule=\"evenodd\"><rect width=\"40\" height=\"20\" x=\"4\" y=\"14\" fill=\"#FFF\" rx=\"10\"/><circle class=\"up-switch-circle\" cx=\"34\" cy=\"24\" r=\"4\" fill=\"#22DC72\"/></g></svg></div></div></div><div class=\"up-ctrlbar-tools-subpanel\"><div class=\"up-quality up-ctrlbar-tools-subpanel-item display-none\"><div class=\"up-ctrlbar-tools-item up-ctrlbar-tools-head up-ctrlbar-closequality\"><div class=\"up-ctrlbar-tools-content up-prev-element\"><span>Qualidade</span></div></div><div class=\"up-quality-type-group\"></div></div><div class=\"up-playbackrate up-ctrlbar-tools-subpanel-item display-none\"><div class=\"up-ctrlbar-tools-item up-ctrlbar-tools-head up-ctrlbar-closeplaybackrate\"><div class=\"up-ctrlbar-tools-content up-prev-element\"><span>Velocidade</span></div></div><div class=\"up-playbackrate-type-group\"></div></div></div></div></div>';UOLPlayerUI.btPlayMarkup='<div class=\"bt-play cursor-pointer display-none\"><p class=\"up-duration\"></p><p class=\"up-title\"></p><div class=\"up-icon up-bt-play-big\"></div><div class=\"up-bt-forward \"><div class=\"up-bt-spin up-bt-forward-spin display-none\">{{this.app.forwardRewindBase}}</div><div class=\"jump-step forward-jump-step display-none\"></div></div><div class=\"up-bt-rewind\"><div class=\"up-bt-spin up-bt-rewind-spin display-none\">{{this.app.forwardRewindBase}}</div><div class=\"jump-step rewind-jump-step display-none\"></div></div><div class=\"up-bt-share-mobile\"></div><div class=\"up-poster\"></div></div>',UOLPlayerUI.controlbarMarkup=changeQualityMarkup+'<div class=\"up-ctrlbar\"><div class=\"up-ctrlbar-cell up-bt up-bt-play\"></div><div class=\"up-ctrlbar-cell up-seek\"><div class=\"up-dragbar-control up-dragbar\"><div class=\"up-dragbar-handle\"></div><div class=\"up-dragbar-slider\"><div class=\"up-dragbar-bar\"></div><div class=\"up-dragbar-buffered\"></div></div></div></div><div class=\"up-ctrlbar-cell up-time-display\"><span class=\"up-time-current\">0:00</span><span class=\"up-time-separator\">/</span><span class=\"up-time-duration\">0:00</span></div>'+volumeMarkup+'<div class=\"up-ctrlbar-cell up-bt up-bt-tools\"></div><div class=\"up-ctrlbar-cell up-bt up-bt-detach display-none\"></div><div class=\"up-ctrlbar-cell up-bt up-bt-fullscreen\"></div><div class=\"up-ctrlbar-cell up-bt-download-display display-none\"><a class=\"up-bt up-bt-download\" target=\"_blank\" href=\"#\" download=\"download\"></a></div></div>',UOLPlayerUI.prototype.setState=function(e){var t=function(e){e?this.app.addClass(\"_tools\"):this.app.removeClass(\"_tools\")}.bind(this),a=function(e){e?this.app.addClass(\"_share\"):this.app.removeClass(\"_share\")}.bind(this),r=function(e){e?this.app.addClass(\"_related\"):this.app.removeClass(\"_related\")}.bind(this);switch(e){case\"stop\":this.btplay&&this.btplay.show(),this.setControlState(\"stop\"),this.loading(!1);break;case\"loading\":this.playingVideo(!1),this.playingAd(!1),this.loading(!0);break;case\"playingAd\":this.loading(!1),this.playingVideo(!1),this.playingAd(!0),this.app.addClass(\"_playing\").removeClass(\"_waiting\");break;case\"playingVideo\":this.loading(!1),this.playingAd(!1),this.playingVideo(!0),this.app.addClass(\"_playing\").removeClass(\"_waiting\");break;case\"play\":this.play(!0),r(!1),a(!1),t(!1);break;case\"pause\":this.play(!1),this.loading(!1),this.playingVideo(!1);break;case\"related\":this.app.hasClass(\"_related\")?(r(!1),a(!1),t(!1)):(t(!0),r(!0),a(!1)),this.app.hasClass(\"_end\")||this.controlbar.play.removeClass(\"up-bt-pause\");break;case\"share\":this.app.hasClass(\"_share\")?(a(!1),r(!1),t(!1)):(t(!0),a(!0),r(!1)),this.app.hasClass(\"_end\")||this.controlbar.play.removeClass(\"up-bt-pause\");break;case\"autorep\":this.app.hasClass(\"_autorep\")?this.app.removeClass(\"_autorep\"):this.app.addClass(\"_autorep\");break;case\"tools\":this.app.hasClass(\"_tools\")?this.app.removeClass(\"_tools\"):this.app.addClass(\"_tools\");break;case\"waiting\":this.app.addClass(\"_waiting\");break;case\"error\":this.error(),this.loading(!1);break;case\"ended\":this.app.removeClass(\"_clicked\"),this.app.removeClass(\"_playing-ad\"),this.app.removeClass(\"_playing\"),this.btplay&&this.btplay.show(),this.reload(),this.playingVideo(!1)}},UOLPlayerUI.prototype.play=function(e){e===!0?this.setControlState(\"play\"):this.setControlState(\"pause\")},UOLPlayerUI.prototype.reload=function(e){this.setControlState(\"reload\")},UOLPlayerUI.prototype.playingVideo=function(e){e===!0?this.app.addClass(\"_playing-video\"):this.app.removeClass(\"_playing-video\")},UOLPlayerUI.prototype.playingAd=function(e){e?(this.app.addClass(\"_playing-ad\").removeClass(\"_loading-ad\"),UOLPlayer.isSafari&&UOLPlayer.isMobile&&this.app.removeClass(\"_waiting\")):this.app.removeClass(\"_playing-ad\")},UOLPlayerUI.prototype.loading=function(e){e?this.app.addClass(\"_loading\"):this.app.removeClass(\"_loading\")},UOLPlayerUI.prototype.error=function(){this.app.addClass(\"_error\"),this.btplayIcon.addClass(\"fa-play\"),this.btplayIcon.removeClass(\"fa-pause\")},UOLPlayerUI.prototype.setFullscreen=function(e){e?(this.setControlState(\"fullscreen\"),this.app.addClass(\"_fullscreen\"),this.app.fullscreen=!0):(this.setControlState(\"normalscreen\"),this.app.removeClass(\"_fullscreen\"),this.app.fullscreen=!1)},UOLPlayerUI.prototype.setControlState=function(e){if(this.app.skin)switch(e){case\"stop\":this.controlbar.play.removeClass(\"up-bt-pause\").removeClass(\"up-bt-repeat\"),this.app.removeClass(\"_paused\").removeClass(\"_reload\").removeClass(\"_clicked\").removeClass(\"_waiting\");break;case\"play\":this.controlbar.play.addClass(\"up-bt-pause\").removeClass(\"up-bt-repeat\"),this.app.removeClass(\"_paused\").removeClass(\"_reload\").removeClass(\"_waiting\");break;case\"pause\":this.controlbar.play.removeClass(\"up-bt-pause\").removeClass(\"up-bt-repeat\"),this.app.addClass(\"_paused\").removeClass(\"_reload\").removeClass(\"_waiting\");break;case\"reload\":this.controlbar.play.removeClass(\"up-bt-pause\").addClass(\"up-bt-repeat\"),this.app.addClass(\"_reload\");break;case\"fullscreen\":this.controlbar.fullscreen.addClass(\"up-bt-fullscreen-back\");break;case\"normalscreen\":this.controlbar.fullscreen.removeClass(\"up-bt-fullscreen-back\")}},UOLPlayerUI.prototype.initSkin=function(){var e;this.mouseout=function(){this.app.addClass(\"_mouseout\").removeClass(\"_mouseover\"),this.controlbar.seek.seek.removeClass(\"_mouseover\"),this.events.mouseout.dispatch(),clearTimeout(e)}.bind(this),this.timeout=function(){this.app.addClass(\"_mouseover\").removeClass(\"_mouseout\"),clearTimeout(e),e=setTimeout(function(){this.mouseout()}.bind(this),this.timeoutMouseout)}.bind(this),this.app.wrapper.addEventListener(UOLPlayer.isMobile?\"touchstart\":\"mouseover\",function(){this.app.addClass(\"_mouseover\").removeClass(\"_mouseout\"),this.events.mouseover.dispatch()}.bind(this),UOLPlayer.supportsPassive),UOLPlayer.isMobile?this.app.wrapper.addEventListener(\"touchend\",this.timeout,UOLPlayer.supportsPassive):this.app.wrapper.addEventListener(\"mouseout\",this.mouseout),this.app.wrapper.addEventListener(UOLPlayer.isMobile?\"touchmove\":\"mousemove\",this.timeout,UOLPlayer.supportsPassive)},UOLPlayerUI.prototype.initCtrlBar=function(){var e=this.ui.getElementsByClassName(\"up-ctrlbar\")[0],t=this;this.app.skin?(e.show(),this.controlbar={controlbar:e,play:e.getElementsByClassName(\"up-bt-play\")[0],totalTime:e.getElementsByClassName(\"up-time-duration\")[0],currentTime:e.getElementsByClassName(\"up-time-current\")[0],fullscreen:e.getElementsByClassName(\"up-bt-fullscreen\")[0],seek:{seek:e.getElementsByClassName(\"up-seek\")[0],control:e.getElementsByClassName(\"up-seek-control\")[0],progress:e.getElementsByClassName(\"up-seek-progress\")[0],buffer:e.getElementsByClassName(\"up-seek-buffer\")[0]},volume:{root:e.getElementsByClassName(\"up-volume\")[0],bt:e.getElementsByClassName(\"up-volume-bt\")[0],control:e.getElementsByClassName(\"up-volume-control\")[0],bar:e.getElementsByClassName(\"up-volume-bar\")[0],slider:e.getElementsByClassName(\"up-volume-slider\")[0]}},this.controlbar.play.addEventListener(\"click\",function(e){t.app.onClick()}),this.player.mediaElement.addEventListener(\"click\",function(){UOLPlayer.isMobile&&this.hasClass(\"_clicked\")?this.addClass(\"_mouseover\"):this.onClick()}.bind(this.app)),UOLPlayer.fullscreenEnabled?this.controlbar.fullscreen.addEventListener(\"click\",function(){t.app.setFullscreen()}):this.controlbar.fullscreen.hide(),this.app.controls||this.controlbar.controlbar.hide(),this.app.cover||this.ui.getElementsByClassName(\"bt-play\")[0].addClass(\"opacity-0\")):e.hide()};var UOLPlayerAds=function(e,t){UOLPlayer.eventsControl.call(this),this.events={adStarted:new UOLPlayer.customEvents,allAdsCompleted:new UOLPlayer.customEvents,contentCompleted:new UOLPlayer.customEvents,contentPauseRequested:new UOLPlayer.customEvents,contentResumeRequested:new UOLPlayer.customEvents,timeupdate:new UOLPlayer.customEvents};var a=e.wrapper.getElementsByClassName(\"ui\")[0],r={btvisit:a.getElementsByClassName(\"up-ad-visit-advertiser\")[0],remaining:a.getElementsByClassName(\"up-ad-remaining-time\")[0],progressbar:a.getElementsByClassName(\"up-ad-bar\")[0]};this.contentCompleteCalled=!1,this.allAdsCompleteCalled=!1,this.adError=!1,this.app=e,this.ad=null,this.adPos=null,this.playingAd=!1,this.paused=!1,this.adPodIndex=0,this.customClickDiv=r.btvisit,this.isMute=!1,this.videoPlayer=t;try{google.ima}catch(i){UOLPlayer.w(\"UOLPLAYER: google.ima não carregado.\")}google.ima.settings.setLocale(\"pt-BR\"),this.adDisplayContainer=new google.ima.AdDisplayContainer(this.videoPlayer.adContainer,this.videoPlayer.mediaElement,this.customClickDiv),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsManager=null,this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.onAdsManagerLoaded,!1,this),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdError,!1,this),this.timeouts=this.app.timeouts,this.timeoutList={},this.timeoutList.requestAdsTimeout=this.timeouts[this.timeouts.type.REQUEST_ADS],this.timeoutList.loadAdTimeout=this.timeouts[this.timeouts.type.LOAD_AD],this.timeoutList.bufferTimeout=this.timeouts[this.timeouts.type.PLAYING_AD],this.startAdCountdown=function(){this.app.ui.setState(\"playingAd\");var e=function(){_perc=this.getCurrentPerc(),r.remaining.innerHTML=this.getRemainingTime()<0?\"0:00\":this.getRemainingTime().toString().formatTime(),r.progressbar.style.width=_perc+\"%\",this.events.timeupdate.dispatch({currentTime:this.getCurrentTime(),duration:this.getDuration(),perc:_perc})}.bind(this);r.remaining.innerHTML=\"\",r.progressbar.style.width=0,this.countdownTimer=setInterval(e,1e3),e(),this.timeoutList.bufferTimeout.start(function(){this.timeoutId=this.timeouts.type.PLAYING_AD,this.destroy(),this.adPos=this.getAdPosition(),this.app.tracker.pushStates([\"ad\",this.getAdPosition()],[\"adId\",this.ad.getAdId()],[\"adCreativeId\",this.ad.getCreativeId()],[\"adSystem\",this.ad.getAdSystem()],[\"adTitle\",this.ad.getTitle()]),this.app.logger.send(this.timeouts.type.PLAYING_AD,{timeout:!0})}.bind(this));var t=setTimeout(function(){(this.paused||this.getCurrentTime()>=this.timeouts.time.PLAYING_AD-5)&&(clearTimeout(t),this.timeoutList.bufferTimeout.abort())}.bind(this),1e3*(this.timeouts.time.PLAYING_AD-1))},this.stopAdCountdown=function(){r.remaining.innerHTML=\"\",r.progressbar.style.width=0,this.app.ui.playingAd(!1),this.countdownTimer&&clearInterval(this.countdownTimer)}};UOLPlayerAds.prototype.initialUserAction=function(){this.app.logger.logDFP(\"initialUserAction\"),this.contentCompleteCalled=!1,this.adDisplayContainer.initialize(),this.videoPlayer.pause()},UOLPlayerAds.prototype.requestAds=function(e){this.app.wrapper.addClass(\"_loading-ad\").setData(\"adPos\",this.getAdPosition()),this.app.logger.startTime(\"dfp-init\"),this.app.logger.startTime(\"dfpRequestAds\");var t=new google.ima.AdsRequest,a=this.app.getSize();t.adTagUrl=e,t.linearAdSlotWidth=a.width,t.linearAdSlotHeight=a.height,t.nonLinearAdSlotWidth=a.width,t.nonLinearAdSlotHeight=a.height,t.setAdWillAutoPlay(this.app.isAutoplayOk),t.setAdWillPlayMuted(this.app.isAutoplayMuted),this.adsLoader.requestAds(t),this.timeoutList.requestAdsTimeout.start(function(){this.timeoutId=this.timeouts.type.REQUEST_ADS,this.destroy(),this.trackAds(),this.app.logger.send(this.timeouts.type.REQUEST_ADS,{time:this.app.logger.stopTime(this.timeouts.type.REQUEST_ADS),timeout:!0})}.bind(this))},UOLPlayerAds.prototype.trackAds=function(){try{this.adPos=this.getAdPosition(),this.app.tracker.pushState(\"ad\",this.adPos),this.ad&&this.app.tracker.pushStates([\"adId\",this.ad.getAdId()],[\"adSystem\",this.ad.getAdSystem()],[\"adCreativeId\",this.ad.getCreativeId()],[\"adTitle\",this.ad.getTitle()])}catch(e){}},UOLPlayerAds.prototype.destroy=function(e){this.app.logger.logDFP(\"destroy\"),this.adDisplayContainer&&this.adDisplayContainer.destroy(),this.adsManager&&this.adsManager.destroy(),this.app.wrapper.removeClass(\"_playing-ad\").removeClass(\"_loading-ad\");for(var t in this.timeoutList)this.timeoutList[t].abort();e||this.onContentResumeRequested()},UOLPlayerAds.prototype.adClicked=function(){this.app.playing?this.pause():this.resume(),this.app.playing=!this.app.playing},UOLPlayerAds.prototype.pause=function(){this.adsManager&&this.adsManager.pause(),UOLPlayer.onPause(this.app)},UOLPlayerAds.prototype.resume=function(){this.adsManager&&this.adsManager.resume(),UOLPlayer.onResume(this.app)},UOLPlayerAds.prototype.resize=function(e,t,a){this.adsManager&&this.adsManager.resize(e,t,google.ima.ViewMode[a])},UOLPlayerAds.prototype.contentEnded=function(){this.adPodIndex=-1,this.app.logger.logDFP(\"contentEnded\"),this.app.logger.startTime(\"dfp-init\"),this.contentCompleteCalled=!0,this.adError=!1,this.adsLoader.contentComplete(),(void 0!==this.timeouts.status||this.allAdsCompleteCalled)&&(console.log(\"events.allAdsCompleted\"),this.events.allAdsCompleted.dispatch())},UOLPlayerAds.prototype.resumeAfterAd=function(){this.app.logger.logDFP(\"resumeAfterAd\");var e;!this.playingAd&&this.timeoutId&&(this.adPos=e=this.getAdPosition(),this.trackAds(),this.app.logger.send(\"dfpBegin\",{time:this.app.logger.stopTime(\"dfp-init\"),timeoutId:this.timeoutId,timeout:!0})),this.adError&&(this.trackAds(),this.adPos=e=UOLPlayerAds.adPosition(this.adPodIndex),this.app.logger.logError(\"DFP (\"+e+\") error: \"+this.adError),this.app.logger.send(\"dfpBegin\",{time:this.app.logger.stopTime(\"dfp-init\"),ad:e,adError:this.adError}),this.timeoutList.requestAdsTimeout.abort()),this.contentCompleteCalled||this.events.contentCompleted.dispatch()},UOLPlayerAds.prototype.allAdsCompleted=function(){this.app.logger.logDFP(\"allAdsCompleted\"),this.adPos=adPos=UOLPlayerAds.adPosition(this.adPodIndex),this.adError&&(this.app.logger.logError(\"DFP: (\"+adPos+\") error: \"+this.adError),this.app.logger.send(\"dfpBegin\",{time:this.app.logger.stopTime(\"dfp-init\"),ad:adPos,adError:this.adError})),1!=this.adPodIndex&&this.events.allAdsCompleted.dispatch(),this.allAdsCompleteCalled=!0},UOLPlayerAds.prototype.setVolume=function(e){this.adsManager&&this.adsManager.setVolume(Number(e))},UOLPlayerAds.prototype.mute=function(){this.setVolume(0),this.isMute=!0},UOLPlayerAds.prototype.toggleMute=function(){this.isMute?(this.setVolume(UOLPlayer.getCookie(\"lplr_vlm\")||1),this.isMute=!1):(this.setVolume(0),this.isMute=!0)},UOLPlayerAds.prototype.getAdPosition=function(){return UOLPlayerAds.adPosition(this.getAdPodIndex())},UOLPlayerAds.prototype.getAdPodIndex=function(){try{return this.ad&&this.ad.getAdPodInfo()?this.ad.getAdPodInfo().getPodIndex():0}catch(e){return 0}},UOLPlayerAds.prototype.getAdId=function(){return this.ad.getAdId()},UOLPlayerAds.prototype.getAdTitle=function(){return this.ad.getAdId()+\" - \"+this.ad.getTitle()},UOLPlayerAds.prototype.getDuration=function(){return this.ad.getDuration()},UOLPlayerAds.prototype.getCurrentTime=function(){return this.ad.getDuration()-this.getRemainingTime()},UOLPlayerAds.prototype.getCurrentPerc=function(){return Math.floor(100*(this.getCurrentTime()/this.getDuration()))},UOLPlayerAds.prototype.getRemainingTime=function(){return rt=Math.round(this.adsManager.getRemainingTime()),rt<=0?0:rt},UOLPlayerAds.prototype.processAdsManager=function(e){this.app.logger.logDFP(\"processAdsManager.\"),e.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this.onContentPauseRequested,!1,this),e.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this.onContentResumeRequested,!1,this),e.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdError,!1,this);var t=[google.ima.AdEvent.Type.AD_BREAK_READY,google.ima.AdEvent.Type.AD_METADATA,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,google.ima.AdEvent.Type.CLICK,google.ima.AdEvent.Type.COMPLETE,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,google.ima.AdEvent.Type.DURATION_CHANGE,google.ima.AdEvent.Type.FIRST_QUARTILE,google.ima.AdEvent.Type.THIRD_QUARTILE,google.ima.AdEvent.Type.IMPRESSION,google.ima.AdEvent.Type.LINEAR_CHANGED,google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.LOG,google.ima.AdEvent.Type.MIDPOINT,google.ima.AdEvent.Type.PAUSED,google.ima.AdEvent.Type.RESUMED,google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,google.ima.AdEvent.Type.SKIPPED,google.ima.AdEvent.Type.STARTED,google.ima.AdEvent.Type.USER_CLOSE,google.ima.AdEvent.Type.VOLUME_CHANGED,google.ima.AdEvent.Type.VOLUME_MUTED];for(var a in t)e.addEventListener(t[a],this.onAdEvent,!1,this);var r,i,s,o=this.app.getSize();this.app.isFullscreen()?(r=o.fullscreenWidth,i=o.fullscreenHeight,s=google.ima.ViewMode.FULLSCREEN):(r=o.width,i=o.height,s=google.ima.ViewMode.NORMAL);try{this.app.logger.logDFP(\"adsManager.init\"),e.init(r,i,s),e.start()}catch(n){this.app.logger.logError(n)}},UOLPlayerAds.prototype.onAdsManagerLoaded=function(e){this.app.logger.logDFP(\"Ads loaded.\");var t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!1,t.loadVideoTimeout=UOLPlayer.safariMultiplier(1e3*this.app.data.item.playerParameters.dfp_native_timeout_time,this.app),this.adsManager=e.getAdsManager(this.videoPlayer.mediaElement,t),this.processAdsManager(this.adsManager)},UOLPlayerAds.prototype.onContentPauseRequested=function(){this.videoPlayer.saveCurrentTime(),this.timeoutId=!1,this.app.logger.logDFP(\"onContentPauseRequested.\"),this.events.contentPauseRequested.dispatch()},UOLPlayerAds.prototype.onContentResumeRequested=function(e){this.timeoutList.bufferTimeout.abort(),this.app.logger.logDFP(\"onContentResumeRequested\"),this.stopAdCountdown(),this.resumeAfterAd(),this.events.contentResumeRequested.dispatch(this.getAdPodIndex())},UOLPlayerAds.prototype.onAdEvent=function(e){var t;this.app.logger.logDFP(\"Ad event: \"+e.type),this.ad=e.getAd();var a=function(){0!=this.adPodIndex||this.logSended||(this.app.logger.send(\"dfpRequestAds\",{time:this.app.logger.stopTime(\"dfpRequestAds\"),ad:t,adObj:this.ad}),this.timeoutList.requestAdsTimeout.abort()),this.logSended=!0}.bind(this);switch(e.type){case google.ima.AdEvent.Type.AD_METADATA:a(),this.adPos=t=this.getAdPosition(),this.app.logger.startTime(\"load-ads\"),this.app.tracker.pushState(\"adMetadata\",t),this.app.wrapper.addClass(\"_loading-ad\").setData(\"adPos\",t);break;case google.ima.AdEvent.Type.LOADED:a(),this.adPos=t=this.getAdPosition(),this.app.logger.startTime(\"load-ads\"),this.app.wrapper.addClass(\"_loading-ad\").setData(\"adPos\",t),this.timeoutList.loadAdTimeout.start(function(){this.timeoutId=this.timeouts.type.LOAD_AD,this.destroy(),this.app.logger.send(this.timeouts.type.LOAD_AD,{time:this.app.logger.stopTime(\"load-ads\"),ad:this.getAdPosition(),adObj:this.ad,payload:{timeout:!0}})}.bind(this));var r=t.split(/\\W/).map(function(e){return e.charAt(0).toUpperCase()+e.substring(1,e.length)}).join(\"\");this.app.tracker.pushState(\"adLoadedPos\",t);var i,s;!this.ad.g||this.ad.g.vpaid!==!1&&void 0!==this.ad.g.vpaid?(i=\"vpaid\",s=!0):(i=this.ad.getSkipTimeOffset()>-1,s=!1),this.app.tracker.pushState(\"ad\"+r+\"Skippable\",i,0),this.app.tracker.pushState(\"ad\"+r+\"SkipTime\",this.ad.getSkipTimeOffset(),0),this.app.tracker.pushState(\"ad\"+r+\"Duration\",this.ad.getDuration(),0),this.app.tracker.pushState(\"ad\"+r+\"Vpaid\",s,0);break;case google.ima.AdEvent.Type.CLICK:UOLPlayer.isMobile&&this.adClicked(),this.app.tracker.pushState(\"adClicked\",!0);break;case google.ima.AdEvent.Type.PAUSED:this.paused=!0,this.app.metrics.ad.pause(),this.app.tracker.pushState(\"adPaused\",this.paused);break;case google.ima.AdEvent.Type.RESUMED:this.paused=!1,this.app.metrics.ad.start(),this.app.tracker.pushState(\"adPaused\",this.paused);break;case google.ima.AdEvent.Type.STARTED:try{this.app.chronoAdDuration.start(),this.app.metrics.ad.start(),this.playingAd=!0,this.adPos=t=this.getAdPosition(),this.adSkipped=void 0,this.adPodIndex++,this.timeoutList.loadAdTimeout.abort(),this.app.logger.send(\"dfpLoadAds\",{time:this.app.logger.stopTime(\"load-ads\"),ad:t,adObj:this.ad}),this.app.logger.send(\"dfpBegin\",{time:this.app.logger.stopTime(\"dfp-init\"),ad:t,adObj:this.ad}),this.events.adStarted.dispatch(),this.startAdCountdown(),this.app.tracker.pushState(\"adStarted\",t)}catch(o){this.onAdError(o)}break;case google.ima.AdEvent.Type.SKIPPED:this.timeoutList.bufferTimeout.abort(),this.app.metrics.ad.skipped(),this.app.tracker.pushState(\"adSkiped\",!0),this.app.wrapper.setData(\"adPos\",\"skipped\"),this.adSkipped=!0;break;case google.ima.AdEvent.Type.COMPLETE:this.app.chronoAdDuration.stop(),this.app.metrics.ad.ended(),this.app.tracker.pushState(\"adComplete\",!0),this.app.wrapper.setData(\"adPos\",\"complete\"),this.events.timeupdate.dispatch({currentTime:this.getCurrentTime(),duration:this.getDuration(),perc:100});break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.app.chronoAdDuration.stop(),this.allAdsCompleted(),this.app.tracker.pushState(\"adAllAdsComplete\",!0);break;case google.ima.AdEvent.Type.LOG:if(e.getAdData()){e.getAdData();this.adPos=this.adError=\"noAd\",this.app.wrapper.removeClass(\"_loading-ad\").setData(\"adPos\",\"noAd\")}}},UOLPlayerAds.prototype.onAdError=function(e){this.app.chronoAdDuration.stop(),this.adError=e&&e.getError?e&&e.getError():\"unknow error\",this.app.logger.logError(\"Ad error: \"+this.adError),this.app.setVideoEndedCallbackEnabled(!0),this.onContentResumeRequested(),this.app.tracker.pushState(\"dfpError\",this.adError)},UOLPlayerAds.adPosition=function(e){var t=\"\";switch(e){case 0:t=\"pre-roll\";break;case-1:t=\"post-roll\";break;default:t=\"mid-roll\"}return t},UOLPlayer.ElementErrorHandler=function(){},UOLPlayer.ElementErrorHandler.errorCodes=function(){return{WITHOUT_MOBILE_FORMAT:0,INVALID_MEDIA_ID:1,API_INVALID_RESPONSE:4,FLASH_NOT_SUPPORTED:5,API_EMPTY_RESPONSE:6,CODEC_UNAVAILABLE:7,MEDIA_NOT_FOUND:8,NETWORK_BLOCKING_MP4:9,BROWSER_DEPRECATED:10,VIDEO_FLASH_DEPRECATED:11,AUDIO_FLASH_DEPRECATED:12,VIDEO_SOURCE_UNKNOWN_ERROR:20,VIDEO_SOURCE_ABORTED:21,VIDEO_SOURCE_NETWORK_UNSTABLE:22,VIDEO_SOURCE_FAIL_DECODE:23,VIDEO_SOURCE_NOT_SUPPORTED:24,VIDEO_SOURCE_ENCRYPTED:25,VIDEO_SOURCE_NETWORK_CONNECTION:26,VIDEO_SOURCE_WITHOUT_FALLBACK:27,AUDIO_SOURCE_UNKNOWN_ERROR:30,AUDIO_SOURCE_ABORTED:31,AUDIO_SOURCE_NETWORK_UNSTABLE:32,AUDIO_SOURCE_FAIL_DECODE:33,AUDIO_SOURCE_NOT_SUPPORTED:34,AUDIO_SOURCE_ENCRYPTED:35,AUDIO_SOURCE_NETWORK_CONNECTION:36,HLS_UNKNOWN_ERROR:40,HLS_NETWORK_UNSTABLE:41,HLS_MEDIA_ERROR:42,HLS_UNDEFINED_ON_INITIALIZE:43,PAYLOAD_TOO_LARGE:44,DASH_UNKNOWN_ERROR:55,DASH_NETWORK_UNSTABLE:56,DASH_MEDIA_ERROR:57,DASH_UNDEFINED_ON_INITIALIZE:58,DASH_MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE:510,DASH_MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE:511,DASH_XLINK_LOADER_LOADING_FAILURE_ERROR_CODE:512,DASH_SEGMENTS_UPDATE_FAILED_ERROR_CODE:513,DASH_SEGMENTS_UNAVAILABLE_ERROR_CODE:514,DASH_SEGMENT_BASE_LOADER_ERROR_CODE:515,DASH_TIME_SYNC_FAILED_ERROR_CODE:516,DASH_FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE:517,DASH_FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE:518,DASH_URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE:519,DASH_APPEND_ERROR_CODE:520,DASH_REMOVE_ERROR_CODE:521,DASH_DATA_UPDATE_FAILED_ERROR_CODE:522,DASH_CAPABILITY_MEDIASOURCE_ERROR_CODE:523,DASH_CAPABILITY_MEDIAKEYS_ERROR_CODE:524,DASH_DOWNLOAD_ERROR_ID_MANIFEST_CODE:525,DASH_DOWNLOAD_ERROR_ID_SIDX_CODE:526,DASH_DOWNLOAD_ERROR_ID_CONTENT_CODE:527,DASH_DOWNLOAD_ERROR_ID_INITIALIZATION_CODE:528,DASH_DOWNLOAD_ERROR_ID_XLINK_CODE:529,DASH_MANIFEST_ERROR_ID_CODEC_CODE:530,DASH_MANIFEST_ERROR_ID_PARSE_CODE:531,DASH_MANIFEST_ERROR_ID_NOSTREAMS_CODE:532,DASH_TIMED_TEXT_ERROR_ID_PARSE_CODE:533,DASH_MANIFEST_ERROR_ID_MULTIPLEXED_CODE:534,DASH_MEDIASOURCE_TYPE_UNSUPPORTED_CODE:535,VIDEO_NO_PERMISSION_UNTRACKED:900,VIDEO_NO_PERMISSION_JUST_OWNER:901,VIDEO_NO_PERMISSION_BY_DAT_SCHEDULING:902,VIDEO_NO_PERMISSION_JUST_FRIENDS_UOLK:903,VIDEO_NO_PERMISSION_FOR_THIS_COUNTRY:904,VIDEO_NO_PERMISSION_BY_PRODUCT:905,VIDEO_NO_PERMISSION_ANONYMOUS:906,VIDEO_NO_PERMISSION_SUBSCRIBER:907,VIDEO_NO_PERMISSION_BY_COD_STATUS:908,VIDEO_NO_PERMISSION_BY_EDITORIAL_STATUS:909,VIDEO_REMOVED:910,AUDIO_NO_PERMISSION_UNTRACKED:930,AUDIO_NO_PERMISSION_JUST_OWNER:931,AUDIO_NO_PERMISSION_BY_DAT_SCHEDULING:932,AUDIO_NO_PERMISSION_JUST_FRIENDS_UOLK:933,AUDIO_NO_PERMISSION_FOR_THIS_COUNTRY:934,AUDIO_NO_PERMISSION_BY_PRODUCT:935,AUDIO_NO_PERMISSION_ANONYMOUS:936,AUDIO_NO_PERMISSION_SUBSCRIBER:937,AUDIO_NO_PERMISSION_BY_COD_STATUS:938,AUDIO_NO_PERMISSION_BY_EDITORIAL_STATUS:939,AUDIO_REMOVED:940}}(),UOLPlayer.ElementErrorHandler.codeErros=function(){var e={};for(var t in UOLPlayer.ElementErrorHandler.errorCodes)e[UOLPlayer.ElementErrorHandler.errorCodes[t]]=t;return e}(),UOLPlayer.ElementErrorHandler.errorTypes=function(){return{0:{message:\"Este v&iacute;deo n&atilde;o &eacute; compat&iacute;vel com o seu dispositivo [Erro UV-000]\",error:\"Este video nao e compativel com o seu dispositivo\"},1:{message:\"N&atilde;o foi poss&iacute;vel encontrar o v&iacute;deo [Erro UV-001]\",error:\"Nao foi possivel encontrar o video\"},4:{message:\"Este v&iacute;deo est&aacute; indispon&iacute;vel no momento [Erro UV-004]\",error:\"Este video esta indisponivel no momento\"},5:{message:\"Para ver este v&iacute;deo, seu navegador precisa ter o Flash Player instalado [Erro UV-005]\",error:\"Para ver este video, seu navegador precisa ter o Flash Player instalado\"},6:{message:\"N&atilde;o foi poss&iacute;vel encontrar o v&iacute;deo [Erro UV-006]\",error:\"Nao foi possivel encontrar o video\"},7:{message:\"Seu navegador n&atilde;o toca v&iacute;deos no formato .mp4 [Erro UV-007]\",error:\"Codec nao instalado ou desativado\"},8:{message:\"Esta m&iacute;dia n&atilde;o existe em nosso acervo [Erro UV-008]\",error:\"Midia excluida ou nao encontrada\"},9:{message:\"Sua configura&ccedil;&atilde;o de rede est&aacute; bloqueando a transfer&ecirc;ncia de arquivos de v&iacute;deo [Erro UV-009]\",error:\"Bloqueio de rede\"},10:{message:\"Por favor, para ver o v&iacute;deo, atualize o seu navegador. [Erro UV-010]\",error:\"Browser depreciado e sem suporte\"},11:{message:'Este formato de v&iacute;deo est&aacute; &eacute; mais suportado [Erro UV-011]<br><br>Para visualizar o v&iacute;deo, clique aqui: <a href=\"{mediaUrl}\" target=\"_blank\" class=\"up-txt-primary-color\"><u>{mediaUrl}</u></a>',error:\"Flash video depreciado e sem suporte\"},12:{message:'Este formato de &aacute;udio n&atilde;o &eacute; mais suportado [Erro UV-012]<br><br>Para ouvir o &aacute;udio, clique aqui: <a href=\"{mediaUrl}\" target=\"_blank\" class=\"up-txt-primary-color\"><u>{mediaUrl}</u></a>',error:\"Flash audio depreciado e sem suporte\"},20:{message:\"N&atilde;o foi poss&iacute;vel carregar o v&iacute;deo. Por favor, verifique sua conex&atilde;o &agrave; internet [Erro UV-020]\",error:\"Nao foi possivel carregar o video. Por favor, verifique sua conexao a internet\"},21:{message:\"Conex&atilde;o interrompida pelo usu&aacute;rio [Erro UV-021]\",error:\"Conexao interrompida pelo usuario\"},22:{message:\"N&atilde;o foi poss&iacute;vel carregar o v&iacute;deo. Por favor, verifique sua conex&atilde;o &agrave; internet [Erro UV-022]\",error:\"Nao foi possivel carregar o video. Por favor, verifique sua conexao a internet\"},23:{message:\"O formato deste v&iacute;deo n&atilde;o &eacute; suportado pelo seu navegador [Erro UV-023]\",error:\"O formato deste video nao e suportado pelo seu navegador\"},24:{message:\"Execu&ccedil;&atilde;o do v&iacute;deo interrompida por falha&nbsp;na conex&atilde;o&nbsp;&agrave; internet [Erro UV-024]\",error:\"Execucao do video interrompida por falhaa conexao internet\"},25:{message:\"N&atilde;o foi poss&iacute;vel descriptografar o v&iacute;deo [Erro UV-025]\",error:\"Nao foi possivel descriptografar o video\"},26:{message:\"N&atilde;o foi poss&iacute;vel carregar o v&iacute;deo. Por favor, verifique sua conex&atilde;o &agrave; internet [Erro UV-026]\",error:\"Erro de conexao com o servidor ou resposta invalida\"},27:{message:\"N&atilde;o foi poss&iacute;vel carregar o v&iacute;deo. Por favor, verifique sua conex&atilde;o &agrave; internet [Erro UV-026]\",error:\"Vídeo sem fallback disponível\"},30:{message:\"N&atilde;o foi poss&iacute;vel carregar o&nbsp;&aacute;udio. Por favor, verifique sua conex&atilde;o &agrave; internet [Erro UV-030]\",error:\"Nao foi possivel carregar o audio. Por favor, verifique sua conexao a internet\"},31:{message:\"Conex&atilde;o interrompida pelo usu&aacute;rio [Erro UV-031]\",error:\"Conexao interrompida pelo usuario\"},32:{message:\"N&atilde;o foi poss&iacute;vel carregar o&nbsp;&aacute;udio. Por favor, verifique sua cone&atilde;o &agrave; internet [Erro UV-032]\",error:\"Nao foi possivel carregar o audio. Por favor, verifique sua conexao a internet\"},33:{message:\"O formato deste &aacute;udio n&atilde;o &eacute; suportado pelo seu navegador [Erro UV-033]\",error:\"O formato deste audio nao e suportado pelo seu navegador\"},34:{message:\"Execu&ccedil;&atilde;o do&nbsp;&aacute;udio interrompida por falha de conex&atilde;o&nbsp;&agrave; internet [Erro UV-034]\",error:\"Execucao do audio interrompida por falha de conexao internet\"},35:{message:\"N&atilde;o foi poss&iacute;vel descriptografar o &aacute;udio [Erro UV-035]\",error:\"Nao foi possivel descriptografar o audio\"},36:{message:\"N&atilde;o foi poss&iacute;vel carregar o v&iacute;deo. Por favor, verifique sua conex&atilde;o &agrave; internet [Erro UV-036]\",error:\"Erro de conexao com o servidor ou resposta invalida\"},40:{message:\"Execu&ccedil;&atilde;o do v&iacute;deo interrompida por falha&nbsp;na interna [Erro UV-040]\",error:\"Erro interno no HLS\"},41:{message:\"Execu&ccedil;&atilde;o do v&iacute;deo interrompida por falha&nbsp;na conex&atilde;o&nbsp;&agrave; internet [Erro UV-041]\",error:\"Error de internet no HLS\"},42:{message:\"O formato deste v&iacute;deo n&atilde;o &eacute; suportado pelo seu navegador [Erro UV-042]\",error:\"Erro de media no HLS\"},43:{message:\"Erro no HLS causado por perda de escopo [Erro UV-043]\",error:\"Erro no HLS causado pelo RequireJS\"},44:{message:\"Por favor, para reproduzir esta m&iacute;dia, &eacute; preciso liberar espa&ccedil;o para cookies em seu browser. [Erro UV-044]<br />{href}\",error:\"Erro causado por cookie cheio\"},55:{message:\"Execu&ccedil;&atilde;o do v&iacute;deo interrompida por falha&nbsp;na interna [Erro UV-055]\",\nerror:\"Erro interno no DASH\"},56:{message:\"Execu&ccedil;&atilde;o do v&iacute;deo interrompida por falha&nbsp;na conex&atilde;o&nbsp;&agrave; internet [Erro UV-056]\",error:\"Error de internet no DASH\"},57:{message:\"O formato deste v&iacute;deo n&atilde;o &eacute; suportado pelo seu navegador [Erro UV-057]\",error:\"Erro de media no DASH\"},58:{message:\"Erro no DASH causado por perda de escopo [Erro UV-058]\",error:\"Erro no DASH causado pelo RequireJS\"},510:{message:\"Erro durante a leitura do arquivo de manifesto do v&iacute;deo [Erro UV-510]\",error:\"DASH_MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE\"},511:{message:\"Erro durante o carregamento do arquivo de manifesto do v&iacute;deo [Erro UV-511]\",error:\"MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE\"},512:{message:\"Erro durante o carregamento do xlink [Erro UV-512]\",error:\"DASH_XLINK_LOADER_LOADING_FAILURE_ERROR_CODE\"},513:{message:\"Erro no carregamento dos segmentos do v&iacute;deo [Erro UV-513]\",error:\"DASH_SEGMENTS_UPDATE_FAILED_ERROR_CODE\"},514:{message:\"Erro no carregamento dos segmentos do v&iacute;deo [Erro UV-514]\",error:\"DASH_SEGMENTS_UNAVAILABLE_ERROR_CODE\"},515:{message:\"Erro no carregamento dos segmentos do v&iacute;deo [Erro UV-515]\",error:\"DASH_SEGMENT_BASE_LOADER_ERROR_CODE\"},516:{message:\"Erro de sincronia o v&iacute;deo [Erro UV-516]\",error:\"DASH_TIME_SYNC_FAILED_ERROR_CODE\"},517:{message:\"Erro no carregamento dos fragmentos do v&iacute;deo [Erro UV-517]\",error:\"DASH_FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE\"},518:{message:\"Erro no carregamento dos fragmentos do v&iacute;deo [Erro UV-518]\",error:\"DASH_FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE\"},519:{message:\"Erro na resolução da URL do v&iacute;deo [Erro UV-519]\",error:\"DASH_URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE\"},520:{message:\"Erro ao criar dash [Erro UV-520]\",error:\"DASH_APPEND_ERROR_CODE\"},521:{message:\"Erro ao remover dash [Erro UV-521]\",error:\"DASH_REMOVE_ERROR_CODE\"},522:{message:\"Erro no carregamento dos dados [Erro UV-522]\",error:\"DASH_DATA_UPDATE_FAILED_ERROR_CODE\"},523:{message:\"Formato n&atilde;o suportado pelo navegador [Erro UV-523]\",error:\"DASH_CAPABILITY_MEDIASOURCE_ERROR_CODE\"},524:{message:\"Formato protegido n&atilde;o suportado pelo navegador [Erro UV-524]\",error:\"DASH_CAPABILITY_MEDIAKEYS_ERROR_CODE\"},525:{message:\"Erro durante o download do v&iacute;deo [Erro UV-525]\",error:\"DASH_DOWNLOAD_ERROR_ID_MANIFEST_CODE\"},526:{message:\"Erro durante o download do v&iacute;deo [Erro UV-526]\",error:\"DASH_DOWNLOAD_ERROR_ID_SIDX_CODE\"},527:{message:\"Erro durante o download do v&iacute;deo [Erro UV-527]\",error:\"DASH_DOWNLOAD_ERROR_ID_CONTENT_CODE\"},528:{message:\"Erro durante o download do v&iacute;deo [Erro UV-528]\",error:\"DASH_DOWNLOAD_ERROR_ID_INITIALIZATION_CODE\"},529:{message:\"Erro durante o download do v&iacute;deo [Erro UV-529]\",error:\"DASH_DOWNLOAD_ERROR_ID_XLINK_CODE\"},530:{message:\"Codec n&atilde;o suportado [Erro UV-530]\",error:\"DASH_MANIFEST_ERROR_ID_CODEC_CODE\"},531:{message:\"Erro durante o carregamento do arquivo de manifesto do v&iacute;deo [Erro UV-531]\",error:\"DASH_MANIFEST_ERROR_ID_PARSE_CODE\"},532:{message:\"Erro durante o carregamento do arquivo de manifesto do v&iacute;deo [Erro UV-532]\",error:\"DASH_MANIFEST_ERROR_ID_NOSTREAMS_CODE\"},533:{message:\"Erro durante carregamento de legendas [Erro UV-533]\",error:\"DASH_TIMED_TEXT_ERROR_ID_PARSE_CODE\"},534:{message:\"Formato MUXED n&atilde;o suportado  [Erro UV-534]\",error:\"DASH_MANIFEST_ERROR_ID_MULTIPLEXED_CODE\"},535:{message:\"Formato de m&iacute;dia n&atilde;o suportado [Erro UV-535]\",error:\"DASH_MEDIASOURCE_TYPE_UNSUPPORTED_CODE\"},900:{message:\"Desculpe, n&atilde;o &eacute; poss&iacute;vel exibir o v&iacute;deo desejado [Erro UV-900]\",error:\"VIDEO_NO_PERMISSION_UNTRACKED\"},901:{message:\"Desculpe, este v&iacute;deo s&oacute; pode ser visualizado por seu autor [Erro UV-901]\",error:\"VIDEO_NO_PERMISSION_JUST_OWNER\"},902:{message:\"Desculpe, este v&iacute;deo n&atilde;o est&aacute; dispon&iacute;vel no momento [Erro UV-902]\",error:\"VIDEO_NO_PERMISSION_BY_DAT_SCHEDULING\"},903:{message:\"Desculpe, este v&iacute;deo s&oacute; pode ser visualizado por amigos do autor [Erro UV-903]\",error:\"VIDEO_NO_PERMISSION_JUST_FRIENDS_UOLK\"},904:{message:\"Desculpe, por motivo de direitos autorais, este v&iacute;deo s&oacute; pode ser visto em territ&oacute;rio brasileiro [Erro UV-904]\",error:\"VIDEO_NO_PERMISSION_FOR_THIS_COUNTRY\"},905:{message:\"Este v&iacute;deo &eacute; exclusivo para assinantes UOL [Erro UV-905]\",error:\"VIDEO_NO_PERMISSION_BY_PRODUCT\"},906:{message:\"Desculpe, n&atilde;o &eacute; poss&iacute;vel exibir o v&iacute;deo desejado [Erro UV-906]\",error:\"VIDEO_NO_PERMISSION_ANONYMOUS\"},907:{message:\"Este v&iacute;deo &eacute; exclusivo para assinantes UOL [Erro UV-907]\",error:\"VIDEO_NO_PERMISSION_SUBSCRIBER\"},908:{message:\"Desculpe, n&atilde;o &eacute; poss&iacute;vel exibir o v&iacute;deo desejado [Erro UV-908]\",error:\"VIDEO_NO_PERMISSION_BY_COD_STATUS\"},909:{message:\"Desculpe, n&atilde;o &eacute; poss&iacute;vel exibir o v&iacute;deo desejado [Erro UV-909]\",error:\"VIDEO_NO_PERMISSION_BY_EDITORIAL_STATUS\"},910:{message:\"Esta m&iacute;dia n&atilde;o existe em nosso acervo [Erro UV-910]\",error:\"VIDEO_REMOVED\"},930:{message:\"Desculpe, n&atilde;o &eacute; poss&iacute;vel executar o &aacute;udio desejado [Erro UV-930]\",error:\"AUDIO_NO_PERMISSION_UNTRACKED\"},931:{message:\"Desculpe, este &aacute;udio s&oacute; pode ser executado por seu autor [Erro UV-931]\",error:\"AUDIO_NO_PERMISSION_JUST_OWNER\"},932:{message:\"Desculpe, este &aacute;udio n&atilde;o est&aacute; dispon&iacute;vel no momento [Erro UV-932]\",error:\"AUDIO_NO_PERMISSION_BY_DAT_SCHEDULING\"},933:{message:\"Desculpe, este &aacute;udio s&oacute; pode ser executado por amigos do autor [Erro UV-933]\",error:\"AUDIO_NO_PERMISSION_JUST_FRIENDS_UOLK\"},934:{message:\"Desculpe, este &aacute;udio s&oacute; pode ser executado por internautas no Brasil [Erro UV-934]\",error:\"AUDIO_NO_PERMISSION_FOR_THIS_COUNTRY\"},935:{message:\"Este &aacute;udio &eacute; exclusivo para assinantes UOL [Erro UV-935]\",error:\"AUDIO_NO_PERMISSION_BY_PRODUCT\"},936:{message:\"Desculpe, n&atilde;o &eacute; poss&iacute;vel executar o &aacute;udio desejado [Erro UV-936]\",error:\"AUDIO_NO_PERMISSION_ANONYMOUS\"},937:{message:\"Este &aacute;udio &eacute; exclusivo para assinantes UOL [Erro UV-937]\",error:\"AUDIO_NO_PERMISSION_SUBSCRIBER\"},938:{message:\"Desculpe, n&atilde;o &eacute; poss&iacute;vel executar o &aacute;udio desejado [Erro UV-938]\",error:\"AUDIO_NO_PERMISSION_BY_COD_STATUS\"},939:{message:\"Desculpe, n&atilde;o &eacute; poss&iacute;vel executar o &aacute;udio desejado [Erro UV-939]\",error:\"AUDIO_NO_PERMISSION_BY_EDITORIAL_STATUS\"},940:{message:\"Este &aacute;udio n&atilde;o existe em nosso acervo [Erro UV-940]\",error:\"AUDIO_REMOVED\"}}}(),UOLPlayer.ElementErrorHandler.logMessage=function(e){var t=UOLPlayer.ElementErrorHandler.errorTypes[e];return{typeError:e,enumError:UOLPlayer.ElementErrorHandler.codeErros[e],mensagem:t.message,erro:t.error}},UOLPlayer.ElementErrorHandler.getSample=function(e,t){UOLPlayer.ajax({url:UOLPlayer[\"const\"].urls.SAMPLES+\"file.\"+e,data:\"__rand=\"+Math.random(),success:t,timeout:t,error:t,corsFallback:!1,withCredentials:!1})},UOLPlayer.ElementErrorHandler.requestFirstBytes=function(e,t){UOLPlayer.ajax({url:e,headers:{Range:\"bytes=0-2\"},corsFallback:!1,success:t,timeout:t,error:t})},UOLPlayer.ElementErrorHandler.resolveFallbackURL=function(e,t,a){var r=function(i,s){t.indexOf(\"video.m.mais.uol.com.br\")!==-1&&(e.externalCDN=null!==i.match(/cdn=true/i)),\"function\"==typeof a&&(a(i,s),r=function(){})},i=new UOLPlayer.Chronometer(t);if(i.start(),t.indexOf(\"video.m.mais.uol.com.br\")===-1)return r(t);var s=function(a,s,o){if(413===s)return void e.setError(UOLPlayer.ElementErrorHandler.errorCodes.PAYLOAD_TOO_LARGE);if(UOLPlayer.Profiler.trackServer(\"videom\",i.stop().elapsedTime.time,s),!o||!o.headers||!o.headers[\"x-urlredir-header\"])return r(t);var n=encodeURI((o.headers[\"x-access-token\"]+\"\").trim()),l=encodeURI((o.headers[\"x-access-sign\"]+\"\").trim());t=(o.headers[\"x-urlredir-header\"]+\"\").trim(),t+=t.indexOf(\"?\")===-1?\"?\":\"&\",t+=\"token=\"+n+\"&sign=\"+l,r(t,{token:n,sign:l})};UOLPlayer.ajax({url:t,method:\"head\",success:s,timeout:s,error:s})},UOLPlayer.ElementErrorHandler.checkNetworkBlocking=function(e){var t=[\"bmp\",\"mp3\",\"mp4\",\"pdf\",\"png\",\"svg\",\"swf\",\"wav\",\"zip\"],a={},r=3,i=function(t){i=function(){},e(t)},s=function(e){var o=t.shift();o?UOLPlayer.ElementErrorHandler.getSample(o,function(i,n,l){return 200!==n&&e>=0?(t.unshift(o),s(--e)):(a[o]=n,void s(r))}):i(a)};s(r)},UOLPlayer.ElementErrorHandler.logHeaders=function(e,t,a,r){for(var i in r)e.headers[i]=r[i];e.headers.status=a,e.headers.server=t;for(var s=0,o=e.logHeaders.length;s<o;++s)e.headers[e.logHeaders[s]]},UOLPlayer.ElementErrorHandler.extractServerFromUrl=function(e){var t=/^(?:https?:)?(?:\\/\\/)?(.+?(?:\\.m)?)\\./,a=e.toString().match(t);return a=a?a.pop():\"unknown\",a.replace(/\\W/gi,\"\")},UOLPlayer.ElementErrorHandler.extractMediaHeaders=function(e,t){var a=UOLPlayer.ElementErrorHandler.extractServerFromUrl(t);UOLPlayer.ElementErrorHandler.requestHeaders(t,function(t,r,i){var s=0;i.loadedAt&&i.loadedAt.elapsedTime&&(s=i.loadedAt.elapsedTime.time),UOLPlayer.Profiler.trackServer(a,s,t),UOLPlayer.ElementErrorHandler.logHeaders(e,a,t,r)})},UOLPlayer.ElementErrorHandler.parseHeaders=function(e){var t={},a=\"\";try{a=e.getAllResponseHeaders()}catch(r){}return a&&a.trim().split(\"\\n\").forEach(function(e){e=e.split(\": \"),t[e[0].toLowerCase()]=e[1]}),t},UOLPlayer.ElementErrorHandler.requestHeaders=function(e,t){UOLPlayer.ElementErrorHandler.requestFirstBytes(e,function(e,a,r){var i=UOLPlayer.ElementErrorHandler.parseHeaders(r);t(a,i,r)})},UOLPlayer.ElementErrorHandler.logFetchedResult=function(e,t){for(var a in t)e.tracker.pushState(\"fetch_\"+a,t[a],0)},UOLPlayer.ElementErrorHandler.mediaElementErrorHanlder=function(e,t){var a=e,r=t,i=function(){var e=0;r&&r.error?e=r.error.code:void 0===r.maxReadyState&&(e=6),\"audio\"===r.nodeName.toLowerCase()?a.setError(UOLPlayer.ElementErrorHandler.errorCodes.AUDIO_SOURCE_UNKNOWN_ERROR+e):a.setError(UOLPlayer.ElementErrorHandler.errorCodes.VIDEO_SOURCE_UNKNOWN_ERROR+e)},s=function(e){return UOLPlayer.ElementErrorHandler.logFetchedResult(a,e),200!==e.mp4&&void 0===r.maxReadyState&&200===e.png&&200===e.svg&&200===e.bmp?a.setError(UOLPlayer.ElementErrorHandler.errorCodes.NETWORK_BLOCKING_MP4):void i()};UOLPlayer.ElementErrorHandler.requestFirstBytes(r.src,function(t,a){return 413===a||400===a?void e.setError(UOLPlayer.ElementErrorHandler.errorCodes.PAYLOAD_TOO_LARGE):void UOLPlayer.ElementErrorHandler.checkNetworkBlocking(s)})},UOLPlayer.ElementErrorHandler.supportUrls={cookies:{chrome:{desktop:\"https://support.google.com/chrome/answer/95647?co=GENIE.Platform%3DDesktop&hl=pt\",android:\"https://support.google.com/chrome/answer/95647?co=GENIE.Platform%3DAndroid&hl=pt&oco=1\",ios:\"https://support.google.com/chrome/answer/95647?co=GENIE.Platform%3DiOS&hl=pt&oco=1\"},firefox:{desktop:\"https://support.mozilla.org/pt-BR/kb/exclua-cookies-para-remover-info-armazenadas\"},safari:{desktop:\"https://support.apple.com/pt-br/guide/safari/manage-cookies-and-website-data-sfri11471/mac\",ios:\"https://support.apple.com/pt-br/HT201265\"}}},UOLPlayer.Backbone=function(e){this.app=e;var t={video:{start:function(){e.metrics&&e.metrics.video.start()},pause:function(){e.metrics&&e.metrics.video.pause()},resume:function(){e.metrics&&e.metrics.video.resume()},end:function(){e.metrics&&e.metrics.video.end()},seeking:function(){e.metrics&&e.metrics.video.seeking()},seeked:function(){e.metrics&&e.metrics.video.seeked()},rewind:function(e){},forward:function(e){}},ad:{start:function(){e.metrics&&e.metrics.ad.start()},pause:function(){e.metrics&&e.metrics.ad.pause()},skipped:function(){e.metrics&&e.metrics.ad.skipped()},ended:function(){e.metrics&&e.metrics.ad.ended()}}},a=function(t){var a=e.getFullState();if(t=window.event?window.event:t,e.keyboardState={key:t.key||t.keyCode,code:t.code||t.charCode,location:t.location,altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey,repeat:t.repeat},(a===UOLPlayer.PLAYINGVIDEO||a===UOLPlayer.PLAYINGAUDIO||a===UOLPlayer.VIDEOPAUSED)&&e.mediaPlayer)switch(t.keyCode){case 32:e.onClick();break;case 37:e.mediaPlayer&&e.mediaPlayer.rewind();break;case 38:e.mediaPlayer&&e.mediaPlayer.volumeUp();break;case 39:e.mediaPlayer&&e.mediaPlayer.forward();break;case 40:e.mediaPlayer&&e.mediaPlayer.volumeDown()}}.bind(this),r=function(t){this.inView=UOLPlayer.inView(e.wrapper,!0),e.autoplay=!0,e.onDemandClicked=!1,this.inView&&!e.wrapper.hasClass(\"_clicked\")&&(e.init(),document.removeEventListener(\"scroll\",r))}.bind(this);return document.addEventListener(\"keydown\",a),e.wrapper.getData(\"autoplayscroll\")&&!UOLPlayer.isMobile&&document.addEventListener(\"scroll\",r),t},UOLPlayer.customEvents=function(){var e=this;this._bindings=[];var t=function(t){a(t),e._bindings.push(t)},a=function(t){UOLPlayer.each(e._bindings,function(a,r){t===a&&e._bindings.splice(r,1)})},r=function(t){UOLPlayer.each(e._bindings,function(e,a){e.call(this,t)})};return{add:t,remove:a,dispatch:r}},UOLPlayer.eventsControl=function(){this.events={},this.registerEventListener=function(e,t){this.events[e]?this.events[e].add(t):UOLPlayer.w(\"Evento inexistente: \"+e)},this.removeEventListener=function(e,t){this.events[e].remove(t)}},\"function\"!=typeof UOLPlayer.decycle&&(UOLPlayer.decycle=function(e,t){\"use strict\";var a=new WeakMap;return function r(e,i){var s,o;return void 0!==t&&(e=t(e)),\"object\"!=typeof e||null===e||e instanceof Boolean||e instanceof Date||e instanceof Number||e instanceof RegExp||e instanceof String?e:(s=a.get(e),void 0!==s?{$ref:s}:(a.set(e,i),Array.isArray(e)?(o=[],e.forEach(function(e,t){o[t]=r(e,i+\"[\"+t+\"]\")})):(o={},Object.keys(e).forEach(function(t){o[t]=r(e[t],i+\"[\"+JSON.stringify(t)+\"]\")})),o))}(e,\"$\")}),\"function\"!=typeof UOLPlayer.retrocycle&&(UOLPlayer.retrocycle=function retrocycle($){\"use strict\";var px=/^\\$(?:\\[(?:\\d+|\"(?:[^\\\\\"\\u0000-\\u001f]|\\\\([\\\\\"\\/bfnrt]|u[0-9a-zA-Z]{4}))*\")\\])*$/;return function rez(value){value&&\"object\"==typeof value&&(Array.isArray(value)?value.forEach(function(element,i){if(\"object\"==typeof element&&null!==element){var path=element.$ref;\"string\"==typeof path&&px.test(path)?value[i]=eval(path):rez(element)}}):Object.keys(value).forEach(function(name){var item=value[name];if(\"object\"==typeof item&&null!==item){var path=item.$ref;\"string\"==typeof path&&px.test(path)?value[name]=eval(path):rez(item)}}))}($),$}),UOLPlayer.Filter=function(e,t){if(void 0===e||null===e)throw new TypeError;var a=Object(e),r=a.length>>>0;if(\"function\"!=typeof t)throw new TypeError;for(var i=[],s=arguments.length>=2?arguments[1]:void 0,o=0;o<r;o++)if(o in a){var n=a[o];t.call(s,n,o,a)&&i.push(n)}return i},UOLPlayer.events={sendEvent:function(e,t){t=t||\"*\",parent.postMessage(e,t)},onInit:function(){UOLPlayer.events.sendEvent(\"UOLPlayer.onInit\")},onPlay:function(){UOLPlayer.events.sendEvent(\"UOLPlayer.onPlay\")},onPause:function(){UOLPlayer.events.sendEvent(\"UOLPlayer.onPause\")},onResume:function(){UOLPlayer.events.sendEvent(\"UOLPlayer.onResume\")},onSeeking:function(){UOLPlayer.events.sendEvent(\"UOLPlayer.onSeeking\")},onSeeked:function(){UOLPlayer.events.sendEvent(\"UOLPlayer.onSeeked\")},onRewind:function(){UOLPlayer.events.sendEvent(\"UOLPlayer.onRewind\")},onForward:function(){UOLPlayer.events.sendEvent(\"UOLPlayer.onForward\")},onEnd:function(){UOLPlayer.events.sendEvent(\"UOLPlayer.onEnd\")},onFullscreen:function(){UOLPlayer.events.sendEvent(\"UOLPlayer.onFullscreen\")},onDetach:function(e){UOLPlayer.events.sendEvent('{\"UOLPlayer.onDetach\":'+e+\"}\")}},UOLPlayer.onInit=\"function\"==typeof UOLPlayer.onInit?UOLPlayer.onInit:UOLPlayer.events.onInit,UOLPlayer.onPlay=\"function\"==typeof UOLPlayer.onPlay?UOLPlayer.onPlay:UOLPlayer.events.onPlay,UOLPlayer.onPause=\"function\"==typeof UOLPlayer.onPause?UOLPlayer.onPause:UOLPlayer.events.onPause,UOLPlayer.onResume=\"function\"==typeof UOLPlayer.onResume?UOLPlayer.onResume:UOLPlayer.events.onResume,UOLPlayer.onSeeking=\"function\"==typeof UOLPlayer.onSeeking?UOLPlayer.onSeeking:UOLPlayer.events.onSeeking,UOLPlayer.onSeeked=\"function\"==typeof UOLPlayer.onSeeked?UOLPlayer.onSeeked:UOLPlayer.events.onSeeked,UOLPlayer.onRewind=\"function\"==typeof UOLPlayer.onRewind?UOLPlayer.onRewind:UOLPlayer.events.onRewind,UOLPlayer.onForward=\"function\"==typeof UOLPlayer.onForward?UOLPlayer.onForward:UOLPlayer.events.onForward,UOLPlayer.onResize=\"function\"==typeof UOLPlayer.onResize?UOLPlayer.onResize:UOLPlayer.events.onResize,UOLPlayer.onEnd=\"function\"==typeof UOLPlayer.onEnd?UOLPlayer.onEnd:UOLPlayer.events.onEnd,UOLPlayer.onDetach=\"function\"==typeof UOLPlayer.onDetach?UOLPlayer.onDetach:UOLPlayer.events.onDetach,UOLPlayer.onFullscreen=\"function\"==typeof UOLPlayer.onFullscreen?UOLPlayer.onFullscreen:UOLPlayer.events.onFullscreen,UOLPlayer.receiveMessage=function(e){UOLPlayer.isIframe&&\"object\"==typeof e.data&&e.data.event&&UOLPlayer[UOLPlayer.mediaId][e.data.event]&&(void 0!==e.data.data?UOLPlayer[UOLPlayer.mediaId][e.data.event](e.data.data):UOLPlayer[UOLPlayer.mediaId][e.data.event]())},window.addEventListener(\"message\",UOLPlayer.receiveMessage),UOLPlayer.inView=function(e,t){var a=e.getBoundingClientRect(),r=document.documentElement,i=e.offsetHeight-e.offsetHeight/4;return a.top>=0&&a.left>=0&&a.bottom<=window.innerHeight+(t?0:i)&&a.right<=(window.innerWidth||r.clientWidth)},UOLPlayer.loadCSS=function(e,t){if(!document.getElementById(\"uolplayer-\"+t)){var a=window.document.createElement(\"link\");window.document.getElementsByTagName(\"style\")[0];a.rel=\"stylesheet\",a.type=\"text/css\",a.href=e+\"?v=\"+UOLPlayer.version,a.media=\"all\",a.setAttribute(\"id\",\"uolplayer-\"+t),(document.head||doc.getElementsByTagName(\"head\")[0]).appendChild(a)}},UOLPlayer.loadFonts=function(){var e=window.navigator.userAgent;UOLPlayer.supportsWoff2?(UOLPlayer.Cache.require({url:UOLPlayer.cssPath+\"fonts/uolplayer-icons-woff2.css\",key:\"icons\",type:UOLPlayer.Cache.type.CSS,checksum:UOLPlayer.isLocal?\"icons_woff2_dev\":\"icons_woff2\"}),UOLPlayer.Cache.require({url:\"//stc.uol.com/c/webfont/projeto-grafico/uol-font/uol-text-light.woff2?v5\",key:\"font\",type:UOLPlayer.Cache.type.CSS,checksum:UOLPlayer.isLocal?\"font_woff2_dev\":\"font_woff2\",skip:!0})):e.indexOf(\"Android 4.\")>-1&&e.indexOf(\"like Gecko\")>-1&&e.indexOf(\"Chrome\")===-1?(UOLPlayer.Cache.require({url:UOLPlayer.cssPath+\"fonts/uolplayer-icons-ttf.css\",key:\"icons\",type:UOLPlayer.Cache.type.CSS,checksum:UOLPlayer.isLocal?\"icons_ttf_dev\":\"icons_ttf\"}),UOLPlayer.Cache.require({url:UOLPlayer.cssPath+\"fonts/uolplayer-font-ttf.css\",key:\"font\",type:UOLPlayer.Cache.type.CSS,checksum:UOLPlayer.isLocal?\"font_ttf_dev\":\"font_ttf\"})):(UOLPlayer.Cache.require({url:UOLPlayer.cssPath+\"fonts/uolplayer-icons-woff.css\",key:\"icons\",type:UOLPlayer.Cache.type.CSS,checksum:UOLPlayer.isLocal?\"icons_woff_dev\":\"icons_woff\"}),UOLPlayer.Cache.require({url:UOLPlayer.cssPath+\"fonts/uolplayer-font-woff.css\",key:\"font\",type:UOLPlayer.Cache.type.CSS,checksum:UOLPlayer.isLocal?\"font_woff_dev\":\"font_woff\"}))},UOLPlayer.supportsWoff2=function(e){if(!(\"FontFace\"in e))return!1;var t=new FontFace(\"t\",'url( \"data:application/font-woff2;base64,d09GMgABAAAAAAIkAAoAAAAABVwAAAHcAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABlYAgloKLEoBNgIkAxgLDgAEIAWDcgc1G7IEyB6SJAFID5YA3nAHC6h4+H7s27nP1kTyOoQkGuJWtNGIJKYznRI3VEL7IaHq985ZUuKryZKcAtJsi5eULwUybm9KzajBBhywZ5ZwoJNuwDX5C/xBjvz5DbsoNsvG1NGQiqp0NMLZ7JlnW+5MaM3HwcHheUQeiVokekHkn/FRdefvJaTp2PczN+I1Sc3k9VuX51Tb0Tqqf1deVXGdJsDOhz0/EffMOPOzHNH06pYkDDjs+P8fb/z/8n9Iq8ITzWywkP6PBMMN9L/O7vY2FNoTAkp5PpD6g1nV9WmyQnM5uPpAMHR2fe06jbfvzPriekVTQxC6lpKr43oDtRZfCATl5OVAUKykqwm9o8R/kg37cxa6eZikS7cjK4aIwoyh6jOFplhFrz2b833G3Jii9AjDUiAZ9AxZtxdEYV6imvRF0+0Nej3wu6nPZrTLh81AVcV3kmMVdQj6Qbe9qetzbuDZ7vXOlRrqooFSxCv6SfrDICA6rnHZXQPVcUHJYGcoqa3jVH7ATrjWBNYYkEqF3RFpVIl0q2JvMOJd7/TyjXHw2NyAuJpNaEbz8RTEVtCbSH7JrwQQOqwGl7sTUOtdBZIY2DKqKlvOmPvUxJaURAZZcviTT0SKHCXqzwc=\" ) format( \"woff2\" )',{});return t.load()[\"catch\"](function(){}),\"loading\"==t.status||\"loaded\"==t.status}(this),UOLPlayer.loadImage=function(e,t,a){var r=new Image;r.onload=function(){t&&t()},r.onerror=function(){a&&a(),delete r},r.src=e},UOLPlayer.loadJs=function(e){var t,a=e.src,r=e.name,i=e.success,s=e.timeout,o=e.error,n=(e.cache===!0,!1),l=document,d=function(){if(!this.readyState||\"loaded\"===this.readyState||\"complete\"===this.readyState){var e=this.readyState;e&&!/ded|te/.test(e)||!i||n||(t.removeEventListener(\"load\",d),t.removeEventListener(\"readystatechange\",d),t.removeEventListener(\"error\",p),i()),u()}},p=function(){u(),n=!0,o&&o()},u=function(){clearTimeout(h),t&&t.parentNode&&t.parentNode.removeChild(t),t.removeEventListener(\"load\",d),t.removeEventListener(\"readystatechange\",d),t.removeEventListener(\"error\",p)},h=setTimeout(function(){s&&s(),n=!0,u()},5e3);document.getElementById(\"uolplayer-\"+r)?t=document.getElementById(\"uolplayer-\"+r):(t=l.createElement(\"script\"),t.src=a,t.type=\"text/javascript\",t.async=\"async\",t.setAttribute(\"id\",\"uolplayer-\"+r),(l.head||l.getElementsByTagName(\"head\")[0]).appendChild(t)),t.addEventListener(\"load\",d),t.addEventListener(\"readystatechange\",d),t.addEventListener(\"error\",p)},UOLPlayer.loadThumb=function(e,t){var a,r=[\"-xlarge\",\"-wlarge\",\"-wmedium\",\"-large\",\"-medium\",\"-small\"],i=function(){t&&t(e)},s=function(){r=UOLPlayer.Filter(r,function(t){return e.indexOf(t)!==-1&&(a=t),e.indexOf(t)===-1});var t=a;a=r.splice(0,1),e=e.replace(t,a),a.length>0&&UOLPlayer.loadImage(e,i,s)};UOLPlayer.loadImage(e,i,s)},UOLPlayer.observeDOM=function(){var e,t,a,r=window.MutationObserver||window.WebKitMutationObserver,i=window.addEventListener;return{observe:function(s,o){return t=s,a=function(){return o(t)},r?(e=new r(function(e,t){(e[0].addedNodes.length||e[0].removedNodes.length)&&a()}),e.observe(t,{childList:!0,subtree:!0})):i&&(t.addEventListener(\"DOMNodeInserted\",a,!1),t.addEventListener(\"DOMNodeRemoved\",a,!1)),this},disconnect:function(){r?e.disconnect():i&&(t.removeEventListener(\"DOMNodeInserted\",a,!1),t.removeEventListener(\"DOMNodeRemoved\",a,!1))}}},UOLPlayer.Reduce=function(e,t){if(null==e)throw new TypeError(\"Array.prototype.reduce chamado é nulo (null) ou indefinido (undefined)\");if(\"function\"!=typeof t)throw new TypeError(t+\" não é uma função\");var a,r=Object(e),i=r.length>>>0,s=0;if(2==arguments.length)a=arguments[1];else{for(;s<i&&!(s in r);)s++;if(s>=i)throw new TypeError(\"Reduce possui um array vazio sem um valor inicial\");a=r[s++]}for(;s<i;s++)s in r&&(a=t(a,r[s],s,r));return a},UOLPlayer.Data=function(e,t){this.promises={dataParsed:new UOLPlayer.Promise},this.action=t,this.app=e,this.app.apiError=[],this.ajaxConfig={corsFallback:!1,withCredentials:!0,maxTimeout:4e3}},UOLPlayer.Data.prototype.dataParsedPromise=function(){return this.promises.dataParsed},UOLPlayer.Data.prototype.metadataPromise=function(){return this.promises.metadata=this.promises.metadata||UOLPlayer.Promise.get(UOLPlayer[\"const\"].urls.data.METADATA.replace(\"{mediaId}\",this.app.mediaId)+(this.app.wrapper.getData(\"changeVideo\")?\"?withChange=true\":\"\"),this.ajaxConfig),this.promises.metadata},UOLPlayer.Data.prototype.formatsPromise=function(){return void 0!==this.app.forceCDN?this.promises.formats=this.promises.formats||UOLPlayer.Promise.get(UOLPlayer[\"const\"].urls.data.FORMATS.replace(\"{mediaId}\",this.app.mediaId)+\"?cdn=\"+this.app.forceCDN,this.ajaxConfig):this.promises.formats=this.promises.formats||UOLPlayer.Promise.get(UOLPlayer[\"const\"].urls.data.FORMATS.replace(\"{mediaId}\",this.app.mediaId),this.ajaxConfig),this.promises.formats},UOLPlayer.Data.prototype.formatsRetryPromise=function(){return void 0!==this.app.forceCDN?this.promises.formatsRetry=this.promises.formatsRetry||UOLPlayer.Promise.get(UOLPlayer[\"const\"].urls.data.FORMATS.replace(\"{mediaId}\",this.app.mediaId)+\"?cdn=\"+this.app.forceCDN+\"&retry=true\",this.ajaxConfig):this.promises.formatsRetry=this.promises.formatsRetry||UOLPlayer.Promise.get(UOLPlayer[\"const\"].urls.data.FORMATS.replace(\"{mediaId}\",this.app.mediaId)+\"?retry=true\",this.ajaxConfig),this.promises.formatsRetry},UOLPlayer.Data.prototype.configPromise=function(){var e=UOLPlayer[\"const\"].urls.data.CONFIG.replace(\"{mediaId}\",this.app.mediaId);return UOLPlayer.isIE&&!UOLPlayer.isEdge&&(e=e.replace(/^(https?:)?\\/\\//,\"https://\")),this.promises.config=this.promises.config||UOLPlayer.Promise.get(e,this.ajaxConfig),this.promises.config},UOLPlayer.Data.prototype.configClosedPromise=function(){var e={withCredentials:!1,corsFallback:this.ajaxConfig.corsFallback,maxTimeout:this.ajaxConfig.maxTimeout};return this.promises.configClosed=this.promises.configClosed||UOLPlayer.Promise.get(UOLPlayer[\"const\"].urls.data.CONFIG.replace(\"{mediaId}\",this.app.mediaId)+\"?noauth=true\",e),this.promises.configClosed},UOLPlayer.Data.prototype.metadataFallbackPromise=function(){return this.promises.metadataFallback=this.promises.metadataFallback||UOLPlayer.Promise.get(UOLPlayer[\"const\"].urls.CROUPIER.replace(\"{mediaId}\",this.app.mediaId),this.ajaxConfig),this.promises.metadataFallback},UOLPlayer.Data.prototype.metadataFailurePromise=function(){return this.promises.metadataFailure=this.promises.metadataFailure||new UOLPlayer.Promise(function(e){var t=window.location.href.indexOf(\"https://\")===-1?\"http:\":\"https:\";e({thumbnail:t+\"//thumb.mais.uol.com.br/\"+self.app.mediaId+\".jpg\",title:\"\",author:\"\",generatedThumbs:1,mediaId:self.app.mediaId,type:payload.MP3.available?\"P\":\"V\",revision:0,url:t+\"//mais.uol.com.br/view/\"+self.app.mediaId,shareUrl:t+\"//mais.uol.com.br/view/\"+self.app.mediaId,duration:{seconds:0,formatted:\"0:00\"},formats:formats,payload:payload})}.bind(this)),this.promises.metadataFailure},UOLPlayer.Data.prototype.criticalFailurePromise=function(){if(this.promises.criticalFailure)return this.promises.criticalFailure;var e=new UOLPlayer.Chronometer(\"criticalFailure\");e.start();var t=this.promises.criticalFailure=new UOLPlayer.Promise,a=this,r=\"video.m.mais.uol.com.br\",i={},s=function(e,t,s){var o=a.app.mediaId;\"DASH\"===e?o=a.app.mediaId+\"-12\":\"HLS\"===e?o=a.app.mediaId+\"-10\":\"WEBM\"===e?o=a.app.mediaId+\"-11\":\"mobile\"===e&&(o=a.app.mediaId+\"-9\");var n=function(a,n){i[e]={available:a.indexOf(r)===-1&&a.indexOf(o+\".\"+t)!==-1,mediaType:\"MP3\"===e?\"audio\":\"video\",filename:o,format:e,url:a,token:n?n.token:void 0,sign:n?n.sign:void 0},s(i)};UOLPlayer.ElementErrorHandler.resolveFallbackURL(a.app,UOLPlayer.mediaSourceFallbackURL(o,0,t,a.app.hashId),n)},o=function(e){var t={},r=function(t){return{filename:e[t].filename+\"\",externalCDN:!1,url:e[t].url.split(\"?\").shift(),token:e[t].token,sign:e[t].sign,alternatives:[e[t].url.split(\"?\").shift().split(\"//\").pop()]}};if(e.MP3.available)t.MP3=r(\"MP3\");else for(var i in e)e[i].available&&(t[i]=r(i));var s=window.location.href.indexOf(\"https://\")===-1?\"http:\":\"https:\";if(0===Object.keys(t).length||1===Object.keys(t).length&&t.mobile){var o=UOLPlayer.hashCode(a.app.mediaId.toString());t={\"360p\":{filename:a.app.mediaId+\"\",externalCDN:!1,url:s+\"//storage.mais.uol.com.br/\"+a.app.mediaId+\".mp4?hash=\"+o,alternatives:[\"storage.mais.uol.com.br/\"+a.app.mediaId+\".mp4?hash=\"+o]},mobile:{filename:a.app.mediaId+\"-9\",externalCDN:!1,url:s+\"//storage.mais.uol.com.br/\"+a.app.mediaId+\"-9.mp4?hash=\"+o,alternatives:[\"storage.mais.uol.com.br/\"+a.app.mediaId+\"-9.mp4?hash=\"+o]}}}return{thumbnail:s+\"//thumb.mais.uol.com.br/\"+a.app.mediaId+\".jpg\",title:\"\",author:\"\",generatedThumbs:1,mediaId:a.app.mediaId,type:e.MP3.available?\"P\":\"V\",revision:0,url:s+\"//mais.uol.com.br/view/\"+a.app.mediaId,shareUrl:s+\"//mais.uol.com.br/view/\"+a.app.mediaId,duration:{seconds:0,formatted:\"0:00\"},formats:t,payload:e}},n=new UOLPlayer.Promise(function(e){s(\"DASH\",\"mpd\",e)}),l=new UOLPlayer.Promise(function(e){s(\"HLS\",\"m3u8\",e)}),d=new UOLPlayer.Promise(function(e){s(\"360p\",\"mp4\",e)}),p=new UOLPlayer.Promise(function(e){s(\"WEBM\",\"webm\",e)}),u=new UOLPlayer.Promise(function(e){s(\"mobile\",\"mp4\",e)}),h=new UOLPlayer.Promise(function(e){s(\"MP3\",\"mp3\",e)});return h.then(function(){return d}).then(function(){return n}).then(function(){return l}).then(function(){return u}).then(function(){return p}).then(function(a){var r=-1,i={loadedAt:e.stop()};t.resolve(o(a),r,i)}),this.promises.criticalFailure},UOLPlayer.Data.prototype.loadApi=function(e){e=e||{};var t={},a=this,r=this.app,i=this.action;return this.configClosedPromise(),this.metadataPromise(),this.configPromise(),this.metadataPromise().then(function(e,t,i){return UOLPlayer.Profiler.trackApi(\"metadata\",i.loadedAt.elapsedTime.time,t),r.tracker.pushState(\"apiDrakkarStatus\",t),a.metadataPromise()},function(e,t,i){return UOLPlayer.Profiler.trackApi(\"metadata\",i.loadedAt.elapsedTime.time,t),t>-1&&r.apiError.push(\"data:\"+t),r.tracker.pushState(\"apiDrakkarStatus\",t),400===t?(r.setError(UOLPlayer.ElementErrorHandler.errorCodes.INVALID_MEDIA_ID),UOLPlayer.Promise[\"break\"]):404===t?(r.setError(UOLPlayer.ElementErrorHandler.errorCodes.MEDIA_NOT_FOUND),UOLPlayer.Promise[\"break\"]):413===t?(r.setError(UOLPlayer.ElementErrorHandler.errorCodes.PAYLOAD_TOO_LARGE),UOLPlayer.Promise[\"break\"]):a.metadataFallbackPromise()}).then(function(e,s,o){return a.promises.metadataFallback&&r.tracker.pushState(\"apiCroupierStatus\",s),t.metadata=e.item?e.item:e,t.metadata.mediaId?(i.metadata&&i.metadata.call(null,t.metadata),a.promises.metadataFallback?a.metadataFallbackPromise():a.metadataPromise()):(r.setError(UOLPlayer.ElementErrorHandler.errorCodes.API_EMPTY_RESPONSE),UOLPlayer.Promise[\"break\"])},function(e,t,i){return r.tracker.pushState(\"apiCroupierStatus\",t),UOLPlayer.i(\"ERRO FATAL: METADATA COM ERRO\"),r.apiError.push(\"metadataCroupier:\"+t),r.chronoLoadApi&&r.chronoLoadApi.stop(),413===t?(r.setError(UOLPlayer.ElementErrorHandler.errorCodes.PAYLOAD_TOO_LARGE),UOLPlayer.Promise[\"break\"]):(r.tracker.pushState(\"apiCroupierStatus\",t),a.criticalFailurePromise())}).then(function(e,s,o){return a.promises.criticalFailure&&(t.metadata=e.item?e.item:e,i.metadata.call(null,t.metadata),i.critical.call(null,e.payload)),413===s?(r.setError(UOLPlayer.ElementErrorHandler.errorCodes.PAYLOAD_TOO_LARGE),UOLPlayer.Promise[\"break\"]):a.formatsPromise()}).then(function(e,t,i){return\"object\"==typeof e&&\"undefined\"==typeof e.code?(r.tracker.pushState(\"api_formats_retry\",!1),a.formatsPromise()):(r.tracker.pushState(\"api_formats_retry\",!0),a.formatsRetryPromise())},function(e,t,i){return r.tracker.pushState(\"api_formats_retry\",!0),a.formatsRetryPromise()}).then(function(e,t,s){if(\"object\"==typeof e&&\"undefined\"==typeof e.code){UOLPlayer.Profiler.trackApi(\"formats\",s.loadedAt.elapsedTime.time,t);var o=s&&s.getAllResponseHeaders?s.getAllResponseHeaders():\"\",n=o.match(/^x-cache-type: (.+)$/im);return n?r.tracker.pushState(\"api_formats_cache_type\",n.pop()):r.tracker.pushState(\"api_formats_cache_type\",\"cors_error\"),i.formats&&i.formats.call(null,e),a.promises.formatsRetry?a.formatsRetryPromise():a.formatsPromise()}return a.criticalFailurePromise()},function(e,t,r){return a.criticalFailurePromise()}).then(function(e,t,s){return a.promises.formatsRetry&&a.promises.criticalFailure&&i.formats&&(i.formats.call(null,e.formats),i.critical.call(null,e.payload),UOLPlayer.Profiler.trackApi(\"formats\",s.loadedAt.elapsedTime.time,t),r.tracker.pushState(\"api_formats_cache_type\",\"criticalFailure\")),a.configPromise()}).then(function(e,t,a){return UOLPlayer.Profiler.trackApi(\"config\",a.loadedAt.elapsedTime.time,t),e.item},function(e,t,a){if(UOLPlayer.Profiler.trackApi(\"config\",a.loadedAt.elapsedTime.time,t),t>-1&&r.apiError.push(\"config:\"+t),401===t){e=JSON.parse(e);var i,s;return\"audio\"===r.mediaType||r.data&&\"P\"===r.data.type?(i=\"AUDIO_\",s=UOLPlayer.ElementErrorHandler.errorCodes.AUDIO_NO_PERMISSION_UNTRACKED):(i=\"VIDEO_\",s=UOLPlayer.ElementErrorHandler.errorCodes.VIDEO_NO_PERMISSION_UNTRACKED),e&&e.item&&e.item.permission&&UOLPlayer.ElementErrorHandler.errorCodes[i+e.item.permission]&&(s=UOLPlayer.ElementErrorHandler.errorCodes[i+e.item.permission]),r.setError(s),UOLPlayer.Promise[\"break\"]}var o={};return o.userIp=\"\",o.playerParameters={iu:!1,dfp_on:!1,dfp_native_timeout_on:!1,dfp_native_timeout_time:void 0,dfp_custom_timeout_on:!1,\ndfp_custom_timeout_buffer_time:void 0,dfp_custom_timeout_request_time:void 0,range_request:!0,hls_enabled:!0,hls_maisuol_enabled:!0,hls_allow_domain_regexp:\"\",hls_max_buffer_length:30},o}).then(function(e,r,i){return t.config=e,a.configClosedPromise()}).then(function(e,t,r){return a.configPromise()},function(e,r,s){var o=!1;try{o=JSON.parse(e)}catch(n){o=!1}var l=[\"NO_PERMISSION_JUST_OWNER\",\"NO_PERMISSION_BY_DAT_SCHEDULING\"],d=o&&o.response&&o.response.description&&l.indexOf(o.response.description)>-1;return d&&200!==r&&\"HAS_PERMISSION\"===t.config.permission&&i.closedMedia&&i.closedMedia.call(),t.config.playerParameters.dfp_on=!1,a.configPromise()}).then(function(e,r,s){if(i.config)return i.config.call(null,t.config,a.promises.dataParsed.resolve)})},UOLPlayer.Timeout=function(e){this.app=e;var t={};this.app.customTimeout=UOLPlayer.urlParameter.timeout!==!1&&this.app.customTimeout,\"V\"==this.app.data.item.type&&(t.REQUEST_ADS={type:\"dfpRequestAds\",active:this.app.customTimeout,time:UOLPlayer.safariMultiplier(this.app.data.item.playerParameters.dfp_custom_timeout_request_time,e)},t.LOAD_AD={type:\"dfpLoadAds\",active:this.app.customTimeout,time:UOLPlayer.safariMultiplier(this.app.data.item.playerParameters.dfp_custom_timeout_adload_time,e)},t.PLAYING_AD={type:\"dfpPlayAd\",active:this.app.customTimeout,time:UOLPlayer.safariMultiplier(2*this.app.data.item.playerParameters.dfp_custom_timeout_buffer_time,e)},t.HLS_SWITCH_LEVEL={type:\"hlsSwitchLevel\",active:!0,time:UOLPlayer.safariMultiplier(this.app.data.item.playerParameters.hls_switch_level_wait||10,e)},t.DASH_SWITCH_LEVEL={type:\"dashSwitchLevel\",active:!0,time:UOLPlayer.safariMultiplier(this.app.data.item.playerParameters.hls_switch_level_wait||10,e)}),t.TEST={type:\"test\",active:!0,time:1},t.RETRY_BALAIO={type:\"retryBalaio\",active:!0,time:15};var a,r,i,s,o=function(e,t,a){var r,i,s,o=!1;return i=function(){this.app.logger.logError(\"timeout: \"+e),n.status=e,o=!0,s&&s.call(this)}.bind(this),a?{start:function(e){s=e,o=!1,r&&clearTimeout(r),r=setTimeout(i,1e3*t)},abort:function(t){this.app.logger.logTimeout(\"timeout cancelado: \"+e),r&&clearTimeout(r),t&&t.call(this)}.bind(this),execute:i,time:1e3*t,getStatus:function(){return o}}:{start:function(){},abort:function(){},execute:function(){},getStatus:function(){return!1}}}.bind(this),n={type:{},time:{}};for(a in t)r=t[a].type,i=t[a].time,s=t[a].active,n.type[a]=r,n.time[a]=i,n[r]=o(r,i,s);return n},UOLPlayer.Tracker=function(e,t){this.start=new Date,this.states=t||{},this.timeout=null,this.debug=e},UOLPlayer.Tracker.prototype.current=function(){return(new Date).toUnixTimestamp()-this.start.toUnixTimestamp()},UOLPlayer.Tracker.prototype.pushState=function(e,t,a){this.current();return a=isNaN(a)?20:a,this.states[e]!==t&&void(this.states[e]=t)},UOLPlayer.Tracker.prototype.pushStates=function(){var e=this;Array.prototype.forEach.call(arguments,function(t){e.pushState.apply(e,t)})},UOLPlayer.Tracker.prototype.pushStateDelayed=function(e,t,a){var r=\"timeout\"+e;clearTimeout(r),setTimeout(this.pushState.bind(this),400,e,t,a)},UOLPlayer.Tracker.prototype.getData=function(e){return this.states},UOLPlayer.Configuration=function(e){var t={subPanel:e.wrapper.getElementsByClassName(\"up-ctrlbar-tools\")[0].getElementsByClassName(\"up-ctrlbar-tools-subpanel\")[0],subPanelNodes:e.wrapper.getElementsByClassName(\"up-ctrlbar-tools\")[0].getElementsByClassName(\"up-ctrlbar-tools-subpanel-item\"),tools:e.wrapper.getElementsByClassName(\"up-ctrlbar-tools\")[0]};this.openPanel=function(e){for(var a=0,r=t.subPanelNodes.length;a<r;++a)t.subPanelNodes[a].hide();e.show(),t.tools.addClass(\"_open\")},this.closePanel=function(){t.tools.removeClass(\"_open\")}},UOLPlayer.DragBar=function(e){var t,a=e.control;e.bar,Math.floor(e.handlebar.offsetWidth/2);UOLPlayer.eventsControl.call(this),this.events={update:new UOLPlayer.customEvents,navigate:new UOLPlayer.customEvents,press:new UOLPlayer.customEvents,release:new UOLPlayer.customEvents};var r=function(e){t=i(UOLPlayer.mousePosition(e).x),this.update(t),this.events.update.dispatch(t)}.bind(this),i=function(e){var t=e/(a.offsetWidth-5)*100;return Math.min(100,Math.max(0,t))};this.update=function(t){e.bar.style.width=Math.floor(t)+\"%\",e.handlebar.style.left=Math.floor(t)+\"%\"};var s={down:UOLPlayer.isMobile?\"touchstart\":\"mousedown\",up:UOLPlayer.isMobile?\"touchend\":\"mouseup\",move:UOLPlayer.isMobile?\"touchmove\":\"mousemove\"};a.addEventListener(s.down,function(e){r(e),a.dragging=!0,a.addEventListener(s.move,r,UOLPlayer.supportsPassive),a.addClass(\"_active\"),this.events.press.dispatch()}.bind(this),UOLPlayer.supportsPassive),a.addEventListener(s.up,function(e){a.removeEventListener(s.move,r),t=i(UOLPlayer.mousePosition(e).x),a.removeClass(\"_active\"),this.events.release.dispatch(t),a.dragging=!1}.bind(this),UOLPlayer.supportsPassive),a.addEventListener(s.move,function(e){var a=UOLPlayer.mousePosition(e).x;t=Math.floor(i(a)),this.events.navigate.dispatch({perc:t,x:a})}.bind(this),UOLPlayer.supportsPassive);var o=function(e){a.dragging&&(a.removeEventListener(s.move,r,UOLPlayer.supportsPassive),this.events.release.dispatch(t)),a.dragging=!1}.bind(this);document.addEventListener(s.up,o,UOLPlayer.supportsPassive);try{window.parent!==window&&window.parent.addEventListener(s.up,o,UOLPlayer.supportsPassive)}catch(n){}return this},UOLPlayer.ChangePlaybackRate=function(e){function t(e){var t=e.currentTarget.getData(\"playbackrate\");this.events.change.dispatch(t)}function a(e){return(e/100).toString().replace(\".\",\",\")+\"x\"}function r(e){s.group.getElementsByClassName(\"_active\")[0]&&s.group.getElementsByClassName(\"_active\")[0].removeClass(\"_active\"),s.group.getElementsByClassName(\"playbackrate-\"+e)[0].addClass(\"_active\"),s.currentLabel.innerHTML=100==e?\"Normal\":a(e)}UOLPlayer.eventsControl.call(this),UOLPlayer.Configuration.call(this,e),this.events.change=new UOLPlayer.customEvents;var i=this,s={change:e.wrapper.getElementsByClassName(\"up-ctrlbar-tools\")[0].getElementsByClassName(\"up-playbackrate\")[0],open:e.wrapper.getElementsByClassName(\"up-ctrlbar-openplaybackrate\")[0],close:e.wrapper.getElementsByClassName(\"up-ctrlbar-closeplaybackrate\")[0],group:e.wrapper.getElementsByClassName(\"up-playbackrate\")[0].getElementsByClassName(\"up-playbackrate-type-group\")[0],currentLabel:e.wrapper.getElementsByClassName(\"up-ctrlbar-openplaybackrate\")[0].getElementsByClassName(\"up-ctrlbar-tools-content\")[0]},o=function(){i.openPanel(s.change)};s.close.addEventListener(\"click\",function(){i.closePanel()});var n=function(){s.open.addEventListener(\"click\",o);for(var e=25,r=200;e<=r;e+=25)if(175!=e){var i='<div class=\"up-ctrlbar-tools-item up-playbackrate-item playbackrate-'+e+'\"><div class=\"up-ctrlbar-tools-content\">'+(100==e?\"Normal\":a(e))+\"</div></div>\";i=s.group.appendHtmlText(i).getElementsByClassName(\"playbackrate-\"+e)[0],i.setData(\"playbackrate\",e/100),i.addEventListener(\"click\",t.bind(this)),100==e&&(s.current=i,s.current.addClass(\"_active\"))}}.bind(this);n(),this.setActive=r},UOLPlayer.ChangeQuality=function(e,t){function a(e){var t=e.currentTarget.getData(\"type\");this.events.change.dispatch(t)}function r(e){return\"WEBM\"==e?\"360p\":e}function s(e){return void 0===e.format?(l.currentType.innerHTML=r(e),l.isAuto.innerHTML=\"\",l.typeGroup.getElementsByClassName(\"_active\")[0]&&l.typeGroup.getElementsByClassName(\"_active\")[0].removeClass(\"_active\"),void(l.typeGroup.getElementsByClassName(\"quality-\"+e)[0]&&l.typeGroup.getElementsByClassName(\"quality-\"+e)[0].addClass(\"_active\"))):(l.isAuto.innerHTML=e.auto?\"Auto\":\"\",l.currentType.innerHTML=e.format,l.typeGroup.getElementsByClassName(\"_waiting\")[0]&&l.typeGroup.getElementsByClassName(\"_waiting\")[0].removeClass(\"_waiting\"),void(e.auto===!1&&l.typeGroup.getElementsByClassName(\"quality-\"+e.format)[0].addClass(\"_waiting\")))}function o(e){l.isAuto.innerHTML=e.auto?\"Auto\":\"\",l.currentType.innerHTML=e.format,l.typeGroup.getElementsByClassName(\"_active\")[0]&&l.typeGroup.getElementsByClassName(\"_active\")[0].removeClass(\"_active\"),l.typeGroup.getElementsByClassName(\"_waiting\")[0]&&l.typeGroup.getElementsByClassName(\"_waiting\")[0].removeClass(\"_waiting\"),e.auto===!1?l.typeGroup.getElementsByClassName(\"quality-\"+e.format)[0].removeClass(\"_waiting\").addClass(\"_active\"):l.typeGroup.getElementsByClassName(\"quality-auto\")[0]&&l.typeGroup.getElementsByClassName(\"quality-auto\")[0].removeClass(\"_waiting\").addClass(\"_active\")}UOLPlayer.eventsControl.call(this),UOLPlayer.Configuration.call(this,e);var n=this;this.events.change=new UOLPlayer.customEvents;var l=(e.wrapper.getElementsByClassName(\"up-ctrlbar\")[0],{changeQuality:e.wrapper.getElementsByClassName(\"up-ctrlbar-tools\")[0].getElementsByClassName(\"up-quality\")[0],quality:e.wrapper.getElementsByClassName(\"up-quality\")[0].getElementsByClassName(\"up-quality-item\"),typeGroup:e.wrapper.getElementsByClassName(\"up-quality\")[0].getElementsByClassName(\"up-quality-type-group\")[0],isAuto:e.wrapper.getElementsByClassName(\"up-ctrlbar-tools\")[0].getElementsByClassName(\"quality-isauto\")[0],currentType:e.wrapper.getElementsByClassName(\"up-ctrlbar-tools\")[0].getElementsByClassName(\"quality-type\")[0],currentQualityLabel:e.wrapper.getElementsByClassName(\"up-ctrlbar-tools\")[0].getElementsByClassName(\"up-ctrlbar-tools-content\")[0],openQuality:e.wrapper.getElementsByClassName(\"up-ctrlbar-openquality\")[0],closeQuality:e.wrapper.getElementsByClassName(\"up-ctrlbar-closequality\")[0]}),d=function(){n.openPanel(l.changeQuality)};for(l.closeQuality.addEventListener(\"click\",function(){n.closePanel()}),i=0;i<l.quality.length;i++)l.quality[i].addEventListener(\"click\",function(){l.currentQuality&&l.currentQuality.removeClass(\"_active\"),this.hasClass(\"_active\")?this.removeClass(\"_active\"):(this.addClass(\"_active\"),l.currentQuality=this)});var p=function(t){if(t=UOLPlayer.cloneJSON(t),delete t.flv,\"HLS\"!==e.data.formats[\"default\"].type&&\"DASH\"!==e.data.formats[\"default\"].type&&(delete t.mobile,delete t.HLS,delete t.DASH,\"WEBM\"===e.data.formats[\"default\"].type?(delete t.mobile,delete t.HLS,delete t.DASH,delete t[\"360p\"],delete t[\"720p\"],delete t[\"1080p\"]):delete t.WEBM),UOLPlayer.isSafari&&UOLPlayer.mobile||UOLPlayer.isIpad||Object.keys(t).length<2)l.currentType.innerHTML=r(Object.keys(t)[0]),l.isAuto.innerHTML=\"\",l.openQuality.removeEventListener(\"click\",d),l.currentQualityLabel.removeClass(\"up-next-element\");else{l.openQuality.addEventListener(\"click\",d),l.currentQualityLabel.addClass(\"up-next-element\"),l.typeGroup.innerHTML=\"\";for(var i in t){format=t[i];var o='<div class=\"up-ctrlbar-tools-item up-quality-item quality-'+format.type+'\"><div class=\"up-ctrlbar-tools-content\">'+r(format.type)+\"</div></div>\";o=l.typeGroup.appendHtmlText(o).getElementsByClassName(\"quality-\"+format.type)[0],o.setData(\"type\",format.type),void 0!=format.index&&o.setData(\"index\",format.index),o.addEventListener(\"click\",a.bind(this))}s(e.data.formats[\"default\"].type)}}.bind(this);p(e.data.formats.available),this.updateList=p,this.setFormat=s,this.setActive=o},UOLPlayer.ControlBar=function(e,t){function r(){P.hasClass(\"_active\")?(P.removeClass(\"_active\"),clearTimeout(g)):P.addClass(\"_active\")}function i(){P.removeClass(\"_active\"),P.removeClass(\"_open\")}function s(){clearTimeout(g),g=setTimeout(function(){i()}.bind(this),4e3)}UOLPlayer.eventsControl.call(this),this.events.volumeChange=new UOLPlayer.customEvents,this.events.toggleMute=new UOLPlayer.customEvents,this.events.changeQuality=new UOLPlayer.customEvents,this.events.changePlaybackRate=new UOLPlayer.customEvents,this.currentTime=0;var o,n,l,d,p,u,h={duration:e.data.item.duration},m=UOLPlayer.perc2time(e.mediaPlayer.getDuration);o=e.wrapper.getElementsByClassName(\"up-ctrlbar\")[0],this.timelineBar=l=new UOLPlayer.Timeline(e,o,h.duration),l.registerEventListener(\"press\",function(e){}.bind(this)),l.registerEventListener(\"seeking\",function(t){u=t,e.backbone.video.seeking()}.bind(this)),l.registerEventListener(\"seeked\",function(t){if(e.isPlayingAd()===!1){var a=m(t);e.mediaPlayer.seek(a),e.backbone.video.seeked(a)}}.bind(this));var c=!1;n=new UOLPlayer.Volume(e,o),n.registerEventListener(\"volumeChange\",function(t){e.mediaPlayer.volume(t),UOLPlayer.isSafariMacOS&&!e.isPlayingAd()&&e.mediaPlayer.play(),this.events.volumeChange.dispatch(t),c=!0,e.tracker.pushStateDelayed(\"volume\",Math.ceil(100*t))}.bind(this)),n.registerEventListener(\"toggleMute\",function(e){this.events.toggleMute.dispatch(e)}.bind(this)),e.mediaPlayer.registerEventListener(\"volumeChange\",function(e){c||n.updateVolume(e),c=!1}.bind(this));var y=function(t){n.isMute()&&(e.toggleMute(),e.clearMute()),e.wrapper.removeEventListener(\"click\",y)}.bind(this);if(e.wrapper.addEventListener(\"click\",y),e.data.item.generatedThumbs>0&&(d=new UOLPlayer.ThumbPreview(e,o,{total:e.data.item.generatedThumbs,mediaId:e.data.item.mediaId,duration:e.data.item.duration.seconds}),l.registerEventListener(\"navigate\",function(e){d.navigate(e)}.bind(this))),!UOLPlayer.isMobile&&\"V\"==e.data.item.type){var g,v=o.getElementsByClassName(\"up-bt-tools\")[0],P=e.wrapper.getElementsByClassName(\"up-ctrlbar-tools\")[0];v.addEventListener(\"click\",function(e){e.target===v&&r()}),v.addEventListener(\"mouseout\",s),P.addEventListener(\"mouseover\",function(){clearTimeout(g)}),P.addEventListener(\"mousemove\",s),UOLPlayerAutoRep.activateInControlbar(e,P),changePlaybackrate=new UOLPlayer.ChangePlaybackRate(e),changePlaybackrate.registerEventListener(\"change\",function(t){e.mediaPlayer.playbackRate(t),this.events.changePlaybackRate.dispatch(t),e.tracker.pushState(\"playbackRate\",t)}.bind(this)),e.mediaPlayer.registerEventListener(\"onChangedPlaybackRate\",changePlaybackrate.setActive),p=new UOLPlayer.ChangeQuality(e,e.data.formats),p.registerEventListener(\"change\",function(t){e.mediaPlayer.changeQuality(t),this.events.changeQuality.dispatch(t),e.tracker.pushState(\"quality\",t)}.bind(this)),e.data.formats.current&&(p.setFormat(e.data.formats.current.type),e.tracker.pushState(\"quality\",e.data.formats.current.type)),e.mediaPlayer.registerEventListener(\"ready\",function(t){p.updateList(e.data.formats.HLS||e.data.formats.DASH)}),e.mediaPlayer.registerEventListener(\"onChangingQuality\",function(e){p.setFormat(e)}),e.mediaPlayer.registerEventListener(\"onChangedQuality\",p.setActive),e.data.formats&&(e.data.formats.HLS||e.data.formats.DASH)&&p.updateList(e.data.formats.HLS||e.data.formats.DASH)}e.mediaPlayer.registerEventListener(\"progress\",function(t){var a=e.mediaPlayer.mediaElement;a.maxReadyState=Math.max(a.readyState,a.maxReadyState||0),t.target.buffered.length>0&&!e.isPlayingAd()&&(a.maxBuffered=Math.max(t.target.buffered.end(0),a.maxBuffered||0),l.updateBuffer(e.startTime+t.target.buffered.end(0)),e.tracker.pushState(\"bufferizedPercentage\",Math.ceil(a.maxBuffered/t.target.duration*100),0),e.tracker.pushState(\"bufferized\",a.maxBuffered,10))}.bind(this)),e.mediaPlayer.registerEventListener(\"timeupdate\",function(t){UOLPlayer.isIOS&&e.wrapper.hasClass(\"_waiting\")&&e.wrapper.removeClass(\"_waiting\");var a=Math.floor(e.startTime),r=Math.floor(t.target.currentTime),i=Math.floor(h.duration.seconds),s=Math.floor(t.target.duration);e.mediaPlayer.mediaElement;this.currentTime=0===a?r:r+(i-s),UOLPlayer.isNumeric(this.currentTime)&&(l.updateProgress(this.currentTime),e.wrapper.removeClass(\"_error\"),e.tracker.pushState(\"currentTime\",this.currentTime),e.tracker.pushState(\"currentTimePercentage\",Math.ceil(r/i*100)))}.bind(this)),this.update=function(){p&&(p.updateList(e.data.formats.available),e.mediaPlayer.registerEventListener(\"onChangingQuality\",function(e){p.setFormat(e)}),e.mediaPlayer.registerEventListener(\"onChangedQuality\",p.setActive))},this.updateProgress=l.updateProgress,this.progress=l.progress,this.toggleMute=n.toggleMute,this.updateVolume=n.updateVolume,this.isMute=n.isMute,this.mute=n.mute,this.clearMute=y,p&&(this.updateList=p.updateList);try{if(UOLPlayer.getURL().indexOf(\"simulateBug=controlbar\")>-1){var f;setTimeout(function(){a+b},null!==(f=UOLPlayer.getURL().match(/simulateBugTime=(\\d+)/))?parseInt(f.pop()):7e3)}}catch(L){}},UOLPlayer.ThumbPreview=function(e,t,a){var r,i,s,o,n,l,d,p,u,h,m,c,y='<div class=\"up-thumbpreview\"><div class=\"up-current\">0:00</div><div class=\"up-preload-spinner\"></div><span class=\"up-thumbpreview_img\"></span></div>',g=25,v=-142,P=-80,f=a.mediaId,L=a.total-1,O=100/L,E=-1,U=UOLPlayer.perc2time(a.duration),b=0,C=142,_=.9,A=1.3;o=t.getElementsByClassName(\"up-seek\")[0],o.appendHtmlText(y),r=t.getElementsByClassName(\"up-thumbpreview\")[0],n=r.getElementsByClassName(\"up-current\")[0],i=r.getElementsByClassName(\"up-thumbpreview_img\")[0],this.navigate=function(t){if(0===a.duration&&e.mediaPlayer&&e.mediaPlayer.mediaElement&&!isNaN(e.mediaPlayer.mediaElement.duration)){e.data.item.duration.seconds=a.duration=Math.ceil(e.mediaPlayer.mediaElement.duration),U=UOLPlayer.perc2time(a.duration);var y=Math.floor(a.duration/60),L=a.duration%60;L<10?e.data.item.duration.formatted=y+\":0\"+L:e.data.item.duration.formatted=y+\":\"+L}s=o.offsetWidth,l=Math.floor((t.perc+2)/O),d=Math.floor(l%g),p=Math.floor(l/g),u=Math.floor(d/5)*v,h=Math.floor(d%5)*P,p!=E&&(E=p,i.style.backgroundImage=\"url(//thumb.mais.uol.com.br/\"+f+\"-grid-\"+p+\".jpg)\"),i.style.backgroundPosition=u+\"px \"+h+\"px\",n.innerText=U(t.perc).toString().formatTime(),m=t.x,UOLPlayer.isMobile?(b=(C-C*_)/2,width=C*_):UOLPlayer.isFullscreen?(b=(C-C*A)/2,width=C*A):width=C,c=Math.floor(m-m*(width/o.offsetWidth))-b,r.style.left=c+\"px\"}},UOLPlayer.Timeline=function(e,t,a){function r(){if(0==a.seconds&&e.mediaPlayer&&e.mediaPlayer.mediaElement&&!isNaN(e.mediaPlayer.mediaElement.duration)){a.seconds=Math.ceil(e.mediaPlayer.mediaElement.duration),d=UOLPlayer.time2perc(a.seconds);var t=Math.floor(a.seconds/60),r=a.seconds%60;r<10?a.formatted=t+\":0\"+r:a.formatted=t+\":\"+r}}function i(e){e=UOLPlayer.isNumeric(e)?e:0,l.currentTime.innerHTML=e.toString().formatTime()}var s,o=a,n=t.getElementsByClassName(\"up-seek\")[0],l={control:n.getElementsByClassName(\"up-dragbar-control\")[0],handlebar:n.getElementsByClassName(\"up-dragbar-handle\")[0],bar:n.getElementsByClassName(\"up-dragbar-bar\")[0],buffer:n.getElementsByClassName(\"up-dragbar-buffered\")[0],currentTime:t.getElementsByClassName(\"up-time-current\")[0],totalTime:t.getElementsByClassName(\"up-time-duration\")[0]},d=UOLPlayer.time2perc(a.seconds),p=0;UOLPlayer.DragBar.call(this,l),this.events.seeking=new UOLPlayer.customEvents,this.events.seeked=new UOLPlayer.customEvents,this.registerEventListener(\"press\",function(e){this.pressed=!0,n.addClass(\"_active\"),this.events.seeking.dispatch(e)}.bind(this)),this.registerEventListener(\"release\",function(e){this.pressed=!1,n.removeClass(\"_active\"),this.events.seeked.dispatch(Math.floor(e))}.bind(this));var u=function(e,t){p=d(e),s=t?100*e/t:d(e),this.pressed||this.update(s)}.bind(this);l.totalTime.innerHTML=a.formatted,this.updateBuffer=function(e){r(),l.buffer.style.width=d(e)+\"%\"},this.updateProgress=function(e,t){r(),l.totalTime.innerHTML=t?t.toString().formatTime():o.formatted,u(e,t),i(e)},this.progress=function(){return p}},UOLPlayer.Volume=function(e,t){function a(e){var t=100*e;o.bar.style.width=t+\"%\",o.handlebar.style.left=t+\"%\",r(t)}function r(e){0==e?o.bt.addClass(\"up-bt-volume-mute\").removeClass(\"up-bt-volume-high\").removeClass(\"up-bt-volume-low\"):e>0&&e<51?o.bt.addClass(\"up-bt-volume-low\").removeClass(\"up-bt-volume-mute\").removeClass(\"up-bt-volume-high\"):e>51&&o.bt.addClass(\"up-bt-volume-high\").removeClass(\"up-bt-volume-mute\").removeClass(\"up-bt-volume-low\")}this.muted=!1;var i=t.getElementsByClassName(\"up-volume\")[0],s=e.wrapper.getElementsByClassName(\"up-startmute\")[0],o={control:i.getElementsByClassName(\"up-dragbar-control\")[0],panel:i.getElementsByClassName(\"up-volume-panel\")[0],handlebar:i.getElementsByClassName(\"up-dragbar-handle\")[0],bar:i.getElementsByClassName(\"up-dragbar-bar\")[0],group:t.getElementsByClassName(\"up-volume-group\")[0],bt:t.getElementsByClassName(\"up-bt-volume\")[0]};UOLPlayer.DragBar.call(this,o),this.events.volumeChange=new UOLPlayer.customEvents,this.events.toggleMute=new UOLPlayer.customEvents,this.registerEventListener(\"update\",function(e){this.muted=!1,r(e),this.events.volumeChange.dispatch(e/100)}.bind(this)),o.bt.addEventListener(\"click\",function(){this.events.toggleMute.dispatch(this.muted)}.bind(this)),a(UOLPlayer.getCookie(\"lplr_vlm\")||1),this.updateVolume=a,this.toggleMute=function(){this.muted=!this.muted,a(this.muted?0:UOLPlayer.getCookie(\"lplr_vlm\")),this.muted&&!s.style.left&&(s.style.left=o.group.offsetLeft+\"px\")}.bind(this),this.mute=function(){return this.muted=!0,a(0),this.muted&&!s.style.left&&(s.style.left=o.group.offsetLeft+\"px\"),this.muted}.bind(this),this.isMute=function(){return this.muted}.bind(this)},UOLPlayer.MediaElement=function(){this.events={formatsChanged:new UOLPlayer.customEvents,onChangedPlaybackRate:new UOLPlayer.customEvents,onChangedQuality:new UOLPlayer.customEvents,onChangingQuality:new UOLPlayer.customEvents,onCheckpoint:new UOLPlayer.customEvents,onEnd:new UOLPlayer.customEvents,onPause:new UOLPlayer.customEvents,onPlaying:new UOLPlayer.customEvents,onReject:new UOLPlayer.customEvents,reload:new UOLPlayer.customEvents,toggleMute:new UOLPlayer.customEvents,volumeChange:new UOLPlayer.customEvents},this.currentSrc=\"\",this.autoplayRejected=!1,this.mute=function(){this.isMute=!0,this.mediaElement.muted=this.isMute},this.toggleMute=function(){this.isMute=!this.isMute,this.mediaElement.muted=this.isMute},this.play=function(){this.app.logger.startTime(\"mediaLoad\"),this.app.dfp||!this.app.autoplay||this.app.onDemandClicked?this.mediaElement.play():this.checkAutoplay()},this.checkAutoplay=function(e,t){this.app.isAutoplayOk=!1,this.autoplayRejected=!1;var a=function(){var r=this.mediaElement.play();return void 0!==r?(r.then(function(){this.app.logger.log(\"Play OK\"),this.app.isAutoplayOk=this.autoplayRejected===!1,e&&e()}.bind(this))[\"catch\"](function(e){this.app.isAutoplayOk?(this.app.logger.logError(\"Play rejeitado pela segunda vez, aguardando clique do usuário\"),this.app.isAutoplayOk=!1,this.app.isAutoplayMuted=!1,this.autoplayRejected=!0,t?t():this.events.onReject.dispatch(),this.mediaElement.pause()):(this.app.logger.logError(\"Play rejeitado, tentando iniciar mudo...\"),this.app.isAutoplayOk=!0,this.app.isAutoplayMuted=!0,this.app.startMute=!0,this.app.mute(),a())}.bind(this)),r):(this.app.isAutoplayOk=!0,this.app.isAutoplayMuted=!1,e&&e(),void 0)}.bind(this);a()},this.preloadContent=function(e){this.app.isAutoplayOk=!1,this.videoURL=this.mediaElement.src,UOLPlayer.isMobile||this.app.autoplay&&!this.app.onDemandClicked?this.checkAutoplay(e):e()},this.mediaElement&&(this.mediaElement.addEventListener(\"pause\",function(){this.events.onPause.dispatch()}.bind(this)),this.mediaElement.addEventListener(\"playing\",function(){this.events.onPlaying.dispatch()}.bind(this)),this.mediaElement.addEventListener(\"volumechange\",function(){this.mediaElement.muted||this.events.volumeChange.dispatch(this.mediaElement.volume)}.bind(this))),this.pause=function(){this.mediaElement.pause()},this.togglePause=function(){this.mediaElement.paused&&this.app.hasClass(\"_clicked\")&&!this.app.hasClass(\"_paused\")?this.mediaElement.play():this.mediaElement.pause()},this.isMobilePlatform=function(){return this.mediaElement.paused&&UOLPlayer.isMobile},this.setSrc=function(e,t){t=isNaN(t)?0:t,UOLPlayer.ElementErrorHandler.resolveFallbackURL(this.app,e,function(a){this.lastUrl=this.currentSrc=e=a,UOLPlayer.ElementErrorHandler.extractMediaHeaders(this.app,e),this.mediaElement.paused&&!this.app.autoplay?this.mediaElement.src=e:(this.mediaElement.pause(),this.mediaElement.src=e,this.play()),this.seek(t),this.app.logger.log(e)}.bind(this))},this.setPreload=function(e){this.mediaElement.preload=e},this.bufferedTime=function(){return this.mediaElement.buffered.length>0?this.mediaElement.buffered.end(0):0},this.getCurrentTime=function(){return Math.floor(this.mediaElement.currentTime)},this.saveCurrentTime=function(){this.lastPauseTime=this.mediaElement.currentTime},this.getCurrentPerc=function(){return Math.floor(100*((this.getCurrentTime()+1)/this.mediaElement.duration))},this.getRemainingTime=function(){return Math.ceil(this.mediaElement.duration-this.getCurrentTime())},this.getDuration=function(){return Math.max(this.app.data.item.duration.seconds,this.mediaElement.duration||0)}.bind(this),this.seek=function(){var e,t;return UOLPlayer.isSafari||UOLPlayer.isIE||UOLPlayer.isAndroidOld?(this.mediaNotLoadedTimeout=this.mediaNotLoadedTimeout||null,e=function(a){clearTimeout(this.mediaNotLoadedTimeout),this.mediaElement&&!this.mediaElement.error&&(isNaN(this.mediaElement.duration)?(null===this.mediaNotLoadedTimeout&&UOLPlayer.i(\"Trying to seek media before it loaded retrying...\"),this.mediaNotLoadedTimeout=setTimeout(e,0,a)):(clearInterval(t),t=setInterval(function(){this.lastCurrentTime=this.mediaElement.currentTime=Math.floor(a),clearInterval(t)}.bind(this),500),this.app.isPlaying()&&this.mediaElement.play(),this.mediaNotLoadedTimeout=null))}.bind(this)):e=function(e){this.lastCurrentTime=this.mediaElement.currentTime=Math.floor(e),this.app.isPlaying()&&this.mediaElement.play()},e}.bind(this)(),this.forward=function(e){this.seek(this.mediaElement.currentTime+(e||5))}.bind(this),this.rewind=function(e){this.seek(this.mediaElement.currentTime-(e||5))}.bind(this),this.volume=function(e){return e=e===!1?1:e,void 0===e?this.mediaElement.volume:(e=Math.min(1,Math.max(0,e)),e>0&&UOLPlayer.setCookie(\"lplr_vlm\",e,365),this.mediaElement.volume=e,void 0)},this.volumeUp=function(){this.volume(this.mediaElement.volume+.1)}.bind(this),this.volumeDown=function(){this.volume(this.mediaElement.volume-.1)}.bind(this),this.registerEventListener=function(e,t){if(this.events[e])this.events[e].add(t);else switch(e){case\"fullscreenchange\":UOLPlayer.each([\"webkitfullscreenchange\",\"mozfullscreenchange\",\"fullscreenchange\",\"MSFullscreenChange\"],function(e){document.addEventListener(e,t,!1)}.bind(this));break;default:this.mediaElement.addEventListener(e,t,!1)}},this.removeEventListener=function(e,t){if(this.events[e])this.events[e].remove(t);else switch(e){case\"fullscreenchange\":[\"webkitfullscreenchange\",\"mozfullscreenchange\",\"fullscreenChange\"].each(function(e){document.removeEventListener(e,t,!1)});break;default:this.mediaElement.removeEventListener(e,t,!1)}},this.playbackRate=function(e){e=+e,clearTimeout(this.mediaNotLoadedPlaybackRateTimeout),isNaN(this.mediaElement.duration)?this.mediaNotLoadedTimeout=setTimeout(this.playbackRate.bind(this),100,e):(this.mediaElement.playbackRate=e,UOLPlayer.setCookie(\"lplr_pbr\",e,1))},this.mediaElement&&this.mediaElement.addEventListener(\"ratechange\",function(){this.events.onChangedPlaybackRate.dispatch(100*this.mediaElement.playbackRate)}.bind(this)),UOLPlayer.getCookie(\"lplr_vlm\")!==!1&&0!==UOLPlayer.getCookie(\"lplr_vlm\")&&this.volume(UOLPlayer.getCookie(\"lplr_vlm\")),UOLPlayer.getCookie(\"lplr_pbr\")!==!1&&0!==UOLPlayer.getCookie(\"lplr_pbr\")&&this.playbackRate(UOLPlayer.getCookie(\"lplr_pbr\"));try{if(UOLPlayer.getURL().indexOf(\"simulateBug=mediaplayer\")>-1){var e;setTimeout(function(){a+b},null!==(e=UOLPlayer.getURL().match(/simulateBugTime=(\\d+)/))?parseInt(e.pop()):7e3)}}catch(t){}},UOLPlayer.AudioPlayer=function(e,t){e.currentFormat=UOLPlayer.currentFormatLog(e,e.mediaId,\"AUDIO\");this.app=e,this.wrapper=t,this.mediaElement=this.wrapper.getElementsByClassName(\"audio-element\")[0],this.currentTime=0,this.audioUrl=e.data.item.audioUrl,e.data.formats?(e.data.formats.alternatives=UOLPlayer.sortRandom(e.data.formats.alternatives||[]),e.externalCDN=e.data.formats.externalCDN):e.externalCDN=!1,this.app.startMute=!1,this.wrapper.addClass(\"_audio\").removeClass(\"_video\"),UOLPlayer.MediaElement.call(this);try{this.wrapper.getElementsByClassName(\"up-for-ad\")[0].remove(),this.wrapper.getElementsByClassName(\"video-element\")[0].remove(),this.wrapper.getElementsByClassName(\"up-toolbar\")[0].remove()}catch(a){UOLPlayer.i(a.message)}this.setAudio=function(){var t;if(e.data.formats){var a=e.data.formats.alternatives;a.length>0?t=UOLPlayer.mediaSourceURL(a.shift(),e.data.item.revision,e.hashId):void 0!==this.audioUrl?(t=UOLPlayer.mediaSourceURL(this.audioUrl,e.data.item.revision,e.hashId),this.audioUrl=void 0):t=UOLPlayer.mediaSourceFallbackURL(e.data.item.mediaId,e.data.item.revision,\"mp3\",e.hashId);var r=t.indexOf(\"?\")===-1?\"?\":\"&\";t+=r+\"token=\"+encodeURI(e.data.formats.token)+\"&sign=\"+encodeURI(e.data.formats.sign)}else t=UOLPlayer.mediaSourceURL(this.audioUrl,e.data.item.revision,e.hashId);this.setSrc(t)}.bind(this),this.reloadContent=function(){this.app.logger.log(\"reloadContent\"),this.setAudio(),this.mediaElement.load(),this.app.hasClass(\"_clicked\")&&this.play()}},UOLPlayer.DASH=function(e,t){e.currentFormat=UOLPlayer.currentFormatLog(e,e.mediaId,\"DASH\");var a={},r={},s={},o=this;this.app=e,this.app.externalCDN=e.data.formats.available.DASH.externalCDN,this.wrapper=t,this.mediaElement=this.wrapper.getElementsByClassName(\"video-element\")[0],this.adContainer=this.wrapper.getElementsByClassName(\"ad-container\")[0],this.currentMedia=null,this.attached=!1,this.lastUrl=\"\",e.forceCDN!==!1&&void 0!==e.forceCDN?this.mpd=e.data.formats.available.DASH.alternatives[0]:e.data.formats.available.DASH.url.indexOf(\"video.m.mais.uol.com.br\")===-1?this.mpd=UOLPlayer.sortRandom(e.data.formats.available.DASH.alternatives.concat(e.data.formats.available.DASH.url))[0]:this.mpd=\"//video.m.mais.uol.com.br/\"+e.mediaId+\"-12.mpd\",this.mpd=UOLPlayer.mediaSourceURL(this.mpd,e.data.item.revision,e.hashId),this.minimumQualityVisible=void 0!==e.data.item.playerParameters.dash_minimum_quality_visible?parseInt(e.data.item.playerParameters.dash_minimum_quality_visible):0,this.wrapper.addClass(\"_video\").removeClass(\"_audio\"),this.app.logger.logDASH(this.mpd),this.waitNextLevelInterval=null,UOLPlayer.MediaElement.call(this),this.events.ready=new UOLPlayer.customEvents,this.events.qualityChanged=new UOLPlayer.customEvents,this.wrapper.getElementsByClassName(\"audio-element\")[0]&&this.wrapper.getElementsByClassName(\"audio-element\")[0].remove();var n=null,l=null;o.currentServer=0;var d=function(t,a){var r=UOLPlayer.getStaticParameter(a);r.token&&r.sign||!e.data.formats.available.DASH.token||!e.data.formats.available.DASH.sign||(a+=\"?token=\"+encodeURI(e.data.formats.available.DASH.token)+\"&sign=\"+encodeURI(e.data.formats.available.DASH.sign)),UOLPlayer.ElementErrorHandler.resolveFallbackURL(e,a,function(r){if(!t)return UOLPlayer.e(\"XHR already destroy\");o.lastUrl=a=r,l=t,t.chrono=new UOLPlayer.Chronometer(\"URL: \"+a),t.chrono.start();var i=function(r){if(t.readyState>=t.HEADERS_RECEIVED&&!t.dns&&(t.dns=!0,UOLPlayer.Profiler.trackDNS(o.lastUrl.extractDomain(),t.chrono.getCurrentTime().elapsedTime.time)),t.readyState>=t.LOADING&&!t.elapsedTime){var i=UOLPlayer.ElementErrorHandler.extractServerFromUrl(a);t.elapsedTime=t.chrono.stop().elapsedTime,UOLPlayer.Profiler.trackServer(i,t.elapsedTime.time,t.status)}if(t.readyState==t.DONE)try{var s=t.getAllResponseHeaders().toString(),n=s.match(/content-length:\\s*(\\d+)/).pop(),l=t.chrono.stop().elapsedTime,i=UOLPlayer.ElementErrorHandler.extractServerFromUrl(a);if(s&&n){n=parseFloat(n),e.statistic.time+=l.time,e.statistic.size+=n,e.statistic.amountTime+=l.time,e.statistic.amountSize+=n,e.statistic.requests?e.statistic.requests.push({url:a,size:n,time:l.time}):e.statistic.requests=[{url:a,size:n,time:l.time}];var d=e.statistic.time>0?1e3*e.statistic.size/e.statistic.time:0,p=e.statistic.amountTime>0?1e3*e.statistic.amountSize/e.statistic.amountTime:0;e.statistic.data={groupingMap:{server:i,log:\"download\",dna:UOLPlayer.DNA()},measureMap:{size:e.statistic.size,sizeMB:e.statistic.size/1024/1024,time:e.statistic.time,velocity:d,amountedVelocity:p,amountedVelocityKB:p/1024}}}}catch(u){}},s=function(a){413===t.status&&(n.destroy(),e.setError(UOLPlayer.ElementErrorHandler.errorCodes.PAYLOAD_TOO_LARGE))},d=function(e){s(\"payload error: XHR Complete\")},p=function(e){s(\"payload error: XHR Error\")};t.addEventListener(\"readystatechange\",i,!1),t.addEventListener(\"load\",d,!1),t.addEventListener(\"error\",p,!1);var u=t.open.bind(t);t.open=function(a,i,s){\nvar o=UOLPlayer.getStaticParameter(r);i=r,i=i.replace(/[\\/]\\d+/,\"/\"+e.mediaId).split(\"?\").shift(),o.token&&o.sign&&(i+=\"?token=\"+o.token+\"&sign=\"+o.sign),i=UOLPlayer.mediaSourceURL(i,e.data.item.revision,e.hashId),i=\"https:\"+i,u(a,i,s),t.withCredentials=!0}.bind(t)}.bind(this))},p=function(t){function a(t){var a=new Date,r=t.request,i=UOLPlayer.getStaticParameter(t.url);i.token&&i.sign||!e.data.formats.available.DASH.token||!e.data.formats.available.DASH.sign||(t.url+=\"?token=\"+encodeURI(e.data.formats.available.DASH.token)+\"&sign=\"+encodeURI(e.data.formats.available.DASH.sign));var o=new XMLHttpRequest,n=t.url.match(/https:\\/\\/|http:\\/\\//);if(n&&0===n.index)var l=t.url.replace(/^http:/,\"https:\");else var l=\"https:\"+t.url;o.open(t.method,l,!0),r.responseType&&(o.responseType=r.responseType),r.range&&o.setRequestHeader(\"Range\",\"bytes=\"+r.range),r.requestStartDate||(r.requestStartDate=a),s&&(o=s.modifyRequestHeader(o)),o.withCredentials=t.withCredentials,o.onload=t.onload,o.onloadend=t.onend,o.onerror=t.onerror,o.onprogress=t.progress,o.onabort=t.onabort,d(o,t.url),o.send(),t.response=o}function r(e){var t=e.response;t.onloadend=t.onerror=t.onprogress=void 0,t.abort()}t=t||{};var i,s=t.requestModifier;return i={load:a,abort:r}};if(this.xhrMockeyPatch=d,this.xhrMockeyDash=p,this.mediaLoad=function(){e.logger.send(\"mediaLoad\",{time:e.logger.stopTime(\"mediaLoad\")}),this.mediaElement.removeEventListener(\"playing\",this.mediaLoadEvent,!1)},this.mediaLoadEvent=this.mediaLoad.bind(this),this.registerEventListener(\"playing\",this.mediaLoadEvent),this.trackRequest=function(){if(l&&4===l.readyState){var e=UOLPlayer.ElementErrorHandler.extractServerFromUrl(this.lastUrl),t=UOLPlayer.ElementErrorHandler.parseHeaders(l);UOLPlayer.ElementErrorHandler.logHeaders(this.app,e,l.status,t),this.app.tracker.pushState(\"dashLastRequest\",this.lastUrl.split(\"?\").shift().split(\"/\").pop()),this.app.tracker.pushState(\"dashCORS\",l.status>0)}}.bind(this),this.changeQuality=function(t){var i=a[t],s=i.index===-1,o=e.startTime+this.getCurrentTime(),l=r[n.getQualityFor(\"video\")];e.qualityChanged=!0,e.startTime=o,e.data.formats.current=a[t],i.index===-1?this.setAutoLevel(\"video\",!0):n.getQualityFor(\"video\")!==i.index&&(this.setAutoLevel(\"video\",!1),this.dashSwitchTimeout.abort(),n.setQualityFor(\"video\",i.index)),i.index===l||s?this.events.onChangedQuality.dispatch({format:i.type,auto:s}):this.events.onChangingQuality.dispatch({format:t,auto:s})}.bind(this),this.currentQuality=function(t){format=a[t];var r=e.startTime+this.getCurrentTime();e.qualityChanged=!0,e.startTime=r,e.data.formats.current=format,currFormat=\"auto\"===t?\"\":t,format.index>=0&&n.setInitialBitrateFor(\"video\",format.index),this.events.onChangingQuality.dispatch({format:currFormat,auto:n.autoLevelEnabled})}.bind(this),this.setDefault=function(){this.changeQuality(\"auto\")},this.reloadContent=function(){this.app.logger.logDASH(\"ReloadContent\"),UOLPlayer.isMobile&&this.attachMedia(),this.play()},this.removePreloadListener=function(){this.app.logger.logDASH(\"removePreloadListener - \"+this.preloadListener),this.preloadListener&&(this.mediaElement.removeEventListener(\"loadedmetadata\",this.preloadListener,!1),this.preloadListener=null)},this.fallback=function(){return console.log(\"dash fallback\"),this.app.data.formats.retry[0]?(this.sendError(),this.app.dashEnabled=!1,this.app.data.formats[\"default\"]=this.app.data.formats.retry[0],this.app.mediaPlayer=new UOLPlayer.VideoPlayer(this.app,this.app.wrapper)):void this.app.setError(UOLPlayer.ElementErrorHandler.errorCodes.VIDEO_SOURCE_WITHOUT_FALLBACK)}.bind(this),this.sendError=function(e,t){var a=UOLPlayer.ElementErrorHandler.errorCodes.DASH_UNKNOWN_ERROR;if(\"undefined\"==typeof dashjs?(UOLPlayer.l(\"dashjs is undefined\"),a=UOLPlayer.ElementErrorHandler.errorCodes.DASH_UNDEFINED_ON_INITIALIZE):e===dashjs.MediaPlayer.errors.DOWNLOAD_ERROR_ID_CONTENT_CODE?a=UOLPlayer.ElementErrorHandler.errorCodes.DASH_NETWORK_UNSTABLE:e===dashjs.MediaPlayer.errors.CAPABILITY_MEDIASOURCE_ERROR_CODE&&(a=UOLPlayer.ElementErrorHandler.errorCodes.DASH_MEDIA_ERROR),\"number\"==typeof e&&UOLPlayer.ElementErrorHandler.errorTypes[parseInt(\"5\"+e)]){var r=UOLPlayer.ElementErrorHandler.errorTypes[parseInt(\"5\"+e)].error;a=UOLPlayer.ElementErrorHandler.errorCodes[r]}a?UOLPlayerLog.send(this.app,\"error\",UOLPlayer.ElementErrorHandler.logMessage(a)):UOLPlayer.l(\"DASH - Undefined error\")},this.destroy=function(e){this.app.onVideoError({error:e})}.bind(this),this.setInitialQuality=function(){if(e.data.formats.DASH){var t=UOLPlayer.isMobile&&void 0!=e.data.item.playerParameters.dash_start_quality_mobile&&void 0!=s[e.data.item.playerParameters.dash_start_quality_mobile]&&e.data.item.playerParameters.dash_start_quality_mobile,r=void 0!=e.data.item.playerParameters.dash_start_quality_desktop&&void 0!=s[e.data.item.playerParameters.dash_start_quality_desktop]&&e.data.item.playerParameters.dash_start_quality_desktop;a[e.startHd]?this.currentQuality(e.startHd):t!==!1?this.currentQuality(t):r!==!1?this.currentQuality(r):(e.startHd!==!1&&UOLPlayer.w(\"Formato \"+e.startHd+\" indisponível\"),this.setDefault())}}.bind(this),this.onDASHError=function(e){this.lastError=Array.prototype.slice.call(arguments),e.error&&e.error.code&&this.sendError(e.error.code),this.destroy()}.bind(this),this.setAutoLevel=function(e,t){this.dash.setAutoSwitchQualityFor(e,t),this.dash.autoLevelEnabled=t},\"undefined\"==typeof dashjs)return this.fallback();n=this.dash=dashjs.MediaPlayer().create(),n.currentLevel=-1,n.on(dashjs.MediaPlayer.events.MANIFEST_LOADED,function(t){data=t.data,data.levels=data.Period.AdaptationSet[0].Representation_asArray,this.trackRequest(),this.app.logger.logDASH(\"Manifest Parsed - \"+t);var o,n,l,d=data.levels.length-1;for(i=0;i<=d;i++)o=d-i,n=data.levels[o],l=n.height+\"p\",n.height>this.minimumQualityVisible&&(a[l]={type:l,index:o}),s[l]={type:l,index:o};s.auto=a.auto={type:\"auto\",index:-1},e.data.formats.DASH=a,this.setInitialQuality();for(f in a)r[a[f].index]=a[f].type;this.events.ready.dispatch()}.bind(this)),n.on(dashjs.MediaPlayer.events.QUALITY_CHANGE_REQUESTED,function(e,t){if(\"video\"===e.mediaType){var a=e.newQuality,r=n.getBitrateInfoListFor(\"video\");r[a].height+\"p\";this.trackRequest()}}.bind(this)),n.on(dashjs.MediaPlayer.events.QUALITY_CHANGE_RENDERED,function(e,t){if(\"video\"===e.mediaType){var a=e.newQuality,r=n.getBitrateInfoListFor(\"video\"),i=(r[a],r[a].height+\"p\");r.sort(function(e,t){return e.bitrate<t.bitrate?-1:e.bitrate>t.bitrate?1:0});for(var s=0;s<r.length;s++)r[s].id=s;n.currentLevel=a,this.trackRequest(),this.app.tracker.pushState(\"dashLevel\",i),this.app.logger.logDASH(\"Qualidade: \"+i),this.events.onChangedQuality.dispatch({format:i,auto:n.autoLevelEnabled})}}.bind(this)),n.on(dashjs.MediaPlayer.events.ERROR,this.onDASHError);var u=function(){n.nextLevel=-1,this.removeEventListener(\"progress\",u,!1)}.bind(this);this.registerEventListener(\"progress\",u)},UOLPlayer.DASH.isSupported=function(){return window.MediaSource=window.MediaSource||window.WebKitMediaSource,!UOLPlayer.isChromeOld&&void 0!==window.MediaSource&&\"function\"==typeof window.MediaSource.isTypeSupported&&window.MediaSource.isTypeSupported('video/webm; codecs=\"vp9\"')},UOLPlayer.DASH.prototype.attachMedia=function(){this.app.initTimeouts(),this.dashSwitchTimeout=this.app.timeouts[this.app.timeouts.type.DASH_SWITCH_LEVEL],this.setInitialQuality(),this.attached=!0,this.dash&&(a=this.dash,this.dash.extend(\"XHRLoader\",this.xhrMockeyDash,!0),this.dash.initialize(this.mediaElement,this.mpd,!1),UOLPlayer.urlParameter.initialQuality&&this.changeQuality(UOLPlayer.urlParameter.initialQuality),UOLPlayer.urlParameter.bufferPruningInterval&&this.dash.setBufferPruningInterval(UOLPlayer.urlParameter.bufferPruningInterval),UOLPlayer.urlParameter.bufferAheadToKeep&&this.dash.setBufferAheadToKeep(UOLPlayer.urlParameter.bufferAheadToKeep),UOLPlayer.urlParameter.bufferToKeep&&this.dash.setBufferToKeep(UOLPlayer.urlParameter.bufferToKeep),UOLPlayer.urlParameter.cacheLoadThresholdForType&&this.dash.setCacheLoadThresholdForType(\"video\",UOLPlayer.urlParameter.cacheLoadThresholdForType),UOLPlayer.urlParameter.ABRStrategy&&this.dash.setABRStrategy(UOLPlayer.urlParameter.ABRStrategy))},UOLPlayer.DASH.prototype.detachMedia=function(){this.attached=!1,this.dash.detachMedia()},UOLPlayer.DASH.prototype.formatsReloaded=function(){this.currentServer=0,this.app.externalCDN=this.app.data.formats.available.DASH.externalCDN,this.app.forceCDN!==!1&&void 0!==this.app.forceCDN?this.mpd=this.app.data.formats.available.DASH.alternatives[0]:this.app.data.formats.available.DASH.url.indexOf(\"video.m.mais.uol.com.br\")===-1?this.mpd=UOLPlayer.sortRandom(this.app.data.formats.available.DASH.alternatives.concat(this.app.data.formats.available.DASH.url))[0]:this.mpd=\"//video.m.mais.uol.com.br/\"+this.app.mediaId+\"-12.mpd\",this.mpd=UOLPlayer.mediaSourceURL(this.mpd,this.app.data.item.revision,this.app.hashId),this.onDASHError.apply(this,this.lastError)},UOLPlayer.HLS=function(e,t){e.currentFormat=UOLPlayer.currentFormatLog(e,e.mediaId,\"HLS\");var a={},r={},s={},o=this;this.app=e,this.app.externalCDN=e.data.formats.available.HLS.externalCDN,this.wrapper=t,this.mediaElement=this.wrapper.getElementsByClassName(\"video-element\")[0],this.adContainer=this.wrapper.getElementsByClassName(\"ad-container\")[0],this.currentMedia=null,this.attached=!1,this.lastUrl=\"\",e.forceCDN!==!1&&void 0!==e.forceCDN?this.m3u8=e.data.formats.available.HLS.alternatives[0]:e.data.formats.available.HLS.url.indexOf(\"video.m.mais.uol.com.br\")===-1?this.m3u8=UOLPlayer.sortRandom(e.data.formats.available.HLS.alternatives.concat(e.data.formats.available.HLS.url))[0]:this.m3u8=\"//video.m.mais.uol.com.br/\"+e.mediaId+\"-10.m3u8\",this.m3u8=UOLPlayer.mediaSourceURL(this.m3u8,e.data.item.revision,e.hashId),this.minimumQualityVisible=void 0!==e.data.item.playerParameters.hls_minimum_quality_visible?parseInt(e.data.item.playerParameters.hls_minimum_quality_visible):300,this.wrapper.addClass(\"_video\").removeClass(\"_audio\"),this.app.logger.logHLS(this.m3u8),this.waitNextLevelInterval=null,UOLPlayer.MediaElement.call(this),this.events.ready=new UOLPlayer.customEvents,this.events.qualityChanged=new UOLPlayer.customEvents,this.wrapper.getElementsByClassName(\"audio-element\")[0]&&this.wrapper.getElementsByClassName(\"audio-element\")[0].remove();var n=null,l=null;o.currentServer=0;var d=function(){var t=e.data.formats.available.HLS;return!!(t&&t.alternatives&&t.alternatives.length>=o.currentServer+1)},p=function(t){var a=\"video.m.mais.uol.com.br\";return e.data.formats.available.HLS.alternatives.length>o.currentServer&&(a=e.data.formats.available.HLS.alternatives[o.currentServer].extractDomain()),t.replace(/^(https?:)?(\\/\\/)?(.+?)\\//im,\"//\"+a+\"/\")},u=function(){return UOLPlayer.isVideoM(o.lastUrl)||null!==o.lastUrl.match(new RegExp(e.mediaId+\".mp4\"))},h=function(t,a){var r=UOLPlayer.getStaticParameter(a);r.token&&r.sign||!e.data.formats.available.HLS.token||!e.data.formats.available.HLS.sign||(a+=\"?token=\"+encodeURI(e.data.formats.available.HLS.token)+\"&sign=\"+encodeURI(e.data.formats.available.HLS.sign)),UOLPlayer.ElementErrorHandler.resolveFallbackURL(e,a,function(r){if(!t)return UOLPlayer.e(\"XHR already destroy\");o.lastUrl=a=r,l=t,t.chrono=new UOLPlayer.Chronometer(\"URL: \"+a),t.chrono.start();var i=function(r){if(t.readyState>=t.HEADERS_RECEIVED&&!t.dns&&(t.dns=!0,UOLPlayer.Profiler.trackDNS(o.lastUrl.extractDomain(),t.chrono.getCurrentTime().elapsedTime.time)),t.readyState>=t.LOADING&&!t.elapsedTime){var i=UOLPlayer.ElementErrorHandler.extractServerFromUrl(a);t.elapsedTime=t.chrono.stop().elapsedTime,UOLPlayer.Profiler.trackServer(i,t.elapsedTime.time,t.status)}if(t.readyState==t.DONE)try{var s=t.getAllResponseHeaders().toString(),n=s.match(/content-length:\\s*(\\d+)/).pop(),l=t.chrono.stop().elapsedTime,i=UOLPlayer.ElementErrorHandler.extractServerFromUrl(a);if(s&&n){n=parseFloat(n),e.statistic.time+=l.time,e.statistic.size+=n,e.statistic.amountTime+=l.time,e.statistic.amountSize+=n,e.statistic.requests?e.statistic.requests.push({url:a,size:n,time:l.time}):e.statistic.requests=[{url:a,size:n,time:l.time}];var d=e.statistic.time>0?1e3*e.statistic.size/e.statistic.time:0,p=e.statistic.amountTime>0?1e3*e.statistic.amountSize/e.statistic.amountTime:0;e.statistic.data={groupingMap:{server:i,log:\"download\",dna:UOLPlayer.DNA()},measureMap:{size:e.statistic.size,sizeMB:e.statistic.size/1024/1024,time:e.statistic.time,velocity:d,amountedVelocity:p,amountedVelocityKB:p/1024}}}}catch(u){}},s=function(a){413===t.status&&(n.destroy(),e.setError(UOLPlayer.ElementErrorHandler.errorCodes.PAYLOAD_TOO_LARGE))},d=function(e){s(\"payload error: XHR Complete\")},p=function(e){s(\"payload error: XHR Error\")};t.addEventListener(\"readystatechange\",i,!1),t.addEventListener(\"load\",d,!1),t.addEventListener(\"error\",p,!1);var u=t.open.bind(t);t.open=function(a,i,s){var o=UOLPlayer.getStaticParameter(r);i=r,i=i.replace(/[\\/]\\d+/,\"/\"+e.mediaId).split(\"?\").shift(),o.token&&o.sign&&(i+=\"?token=\"+o.token+\"&sign=\"+o.sign),i=UOLPlayer.mediaSourceURL(i,e.data.item.revision,e.hashId),i=\"https:\"+i,u(a,i,s),t.withCredentials=!0}.bind(t)}.bind(this))};Hls.DefaultConfig.loader.abort=function(){l&&l.abort&&l.abort()};var m={maxBufferLength:UOLPlayer.urlParameter.hlsMaxBufferLength||e.data.item.playerParameters.hls_max_buffer_length,loader:Hls.DefaultConfig.loader,startPosition:e.startTime,xhrSetup:h,enableWorker:!UOLPlayer.isSafariMacOS,debug:UOLPlayer.toBoolean(UOLPlayer.urlParameter.debugHls)};if(this.mediaLoad=function(){e.logger.send(\"mediaLoad\",{time:e.logger.stopTime(\"mediaLoad\")}),this.mediaElement.removeEventListener(\"playing\",this.mediaLoadEvent,!1)},this.mediaLoadEvent=this.mediaLoad.bind(this),this.registerEventListener(\"playing\",this.mediaLoadEvent),this.trackRequest=function(){if(l&&4===l.readyState){var e=UOLPlayer.ElementErrorHandler.extractServerFromUrl(this.lastUrl),t=UOLPlayer.ElementErrorHandler.parseHeaders(l);UOLPlayer.ElementErrorHandler.logHeaders(this.app,e,l.status,t),this.app.tracker.pushState(\"hlsLastRequest\",this.lastUrl.split(\"?\").shift().split(\"/\").pop()),this.app.tracker.pushState(\"hlsCORS\",l.status>0)}}.bind(this),this.changeQuality=function(t){var i=a[t],s=i.index===-1,o=e.startTime+this.getCurrentTime(),l=r[n.currentLevel];e.qualityChanged=!0,e.startTime=o,e.data.formats.current=a[t],n.nextLevel!==i.index&&(this.hlsSwitchTimeout.abort(),e.isPlaying()?n.nextLevel=i.index:n.currentLevel=i.index),i.index===n.currentLevel||s?this.events.onChangedQuality.dispatch({format:l,auto:s}):this.events.onChangingQuality.dispatch({format:t,auto:s})}.bind(this),this.currentQuality=function(t){var a=s[t],r=e.startTime+this.getCurrentTime();currFormat=\"auto\"===t?\"\":t,e.qualityChanged=!0,e.startTime=r,e.data.formats.current=a,n.currentLevel!==a.index&&(n.currentLevel=a.index),a.index!==-1||UOLPlayer.isMobile||(n.startLevel=-1,n.nextLevel=-1),this.events.onChangingQuality.dispatch({format:currFormat,auto:n.autoLevelEnabled})}.bind(this),this.setDefault=function(){this.changeQuality(\"auto\")},this.reloadContent=function(){this.app.logger.logHLS(\"ReloadContent\"),UOLPlayer.isMobile&&this.attachMedia(),this.play()},this.removePreloadListener=function(){this.app.logger.logHLS(\"removePreloadListener - \"+this.preloadListener),this.preloadListener&&(this.mediaElement.removeEventListener(\"loadedmetadata\",this.preloadListener,!1),this.preloadListener=null)},this.fallback=function(){return this.app.data.formats.retry[0]?(this.sendError(),this.app.hlsEnabled=!1,this.app.data.formats[\"default\"]=this.app.data.formats.retry[0],this.app.mediaPlayer=new UOLPlayer.VideoPlayer(this.app,this.app.wrapper)):void this.app.setError(UOLPlayer.ElementErrorHandler.errorCodes.VIDEO_SOURCE_WITHOUT_FALLBACK)}.bind(this),this.sendError=function(e,t){var a=UOLPlayer.ElementErrorHandler.errorCodes.HLS_UNKNOWN_ERROR;\"undefined\"==typeof Hls?a=UOLPlayer.ElementErrorHandler.errorCodes.HLS_UNDEFINED_ON_INITIALIZE:e===Hls.ErrorTypes.NETWORK_ERROR?a=UOLPlayer.ElementErrorHandler.errorCodes.HLS_NETWORK_UNSTABLE:e===Hls.ErrorTypes.MEDIA_ERROR&&(a=UOLPlayer.ElementErrorHandler.errorCodes.HLS_MEDIA_ERROR),UOLPlayerLog.send(this.app,\"error\",UOLPlayer.ElementErrorHandler.logMessage(a))},this.destroy=function(e){this.app.onVideoError({error:e})},this.setInitialQuality=function(){if(e.data.formats.HLS){var t=UOLPlayer.isMobile&&void 0!=e.data.item.playerParameters.hls_start_quality_mobile&&void 0!=s[e.data.item.playerParameters.hls_start_quality_mobile]&&e.data.item.playerParameters.hls_start_quality_mobile,r=void 0!=e.data.item.playerParameters.hls_start_quality_desktop&&void 0!=s[e.data.item.playerParameters.hls_start_quality_desktop]&&e.data.item.playerParameters.hls_start_quality_desktop;a[e.startHd]?this.currentQuality(e.startHd):t!==!1?this.currentQuality(t):r!==!1?this.currentQuality(r):(e.startHd!==!1&&UOLPlayer.w(\"Formato \"+e.startHd+\" indisponível\"),this.setDefault())}}.bind(this),this.onHLSError=function(t,a){if(this.lastError=Array.prototype.slice.call(arguments),a&&a.fatal)if(this.trackRequest(),this.app.tracker.pushState(\"hlsFatalError\",[t,a.type,a.details].join(\" - \")),this.app.logger.logError('HLS Fatal Error \"'+t+'\" of type \"'+a.type+'\" with details \"'+a.details+'\"'),!d()||u())this.destroy(a.type);else if(a.type===Hls.ErrorTypes.NETWORK_ERROR){this.app.retryAttempts=this.app.retryAttempts||0,this.app.retryAttempts++,this.previousM3u8=e.data.formats.available.HLS.alternatives[o.currentServer],a.details.indexOf(\"manifest\")>-1?(o.currentServer+=1,UOLPlayer.ElementErrorHandler.resolveFallbackURL(e,p(this.m3u8),function(e){this.m3u8=e,this.app.logger.logHLS(\"ReloadSource: \"+this.m3u8),UOLPlayer.l(\"ReloadSource: \"+this.m3u8),n.loadSource(this.m3u8)}.bind(this))):(o.currentServer+=1,this.app.logger.logHLS(\"Start loadSource: \"+this.m3u8),UOLPlayer.l(\"Start loadSource: \"+this.m3u8),n.startLoad()),this.currentM3u8=d()?e.data.formats.available.HLS.alternatives[o.currentServer]:this.m3u8.replace(/^(https?:)?(\\/\\/)?(.+?)\\//im,\"video.m.mais.uol.com.br/\").split(\"?\")[0];var r={retryPreviousFormat:\"hls\",retryPreviousServer:this.previousM3u8,retryCurrentFormat:\"hls\",retryCurrentServer:this.currentM3u8,retryAttempt:this.app.retryAttempts};this.app.logger.send(\"retry\",{payload:r})}else a.type===Hls.ErrorTypes.MEDIA_ERROR?UOLPlayer.ElementErrorHandler.resolveFallbackURL(e,p(this.lastUrl),function(e){this.currentTime=this.mediaElement.currentTime,n.swapAudioCodec(),n.recoverMediaError(),this.mediaErrorRecovery=!0}.bind(this)):this.destroy(a.type);else void 0!==a&&this.app.logger.logHLS('Error event: \"'+t+'\" type:\"'+a.type+'\" details: \"'+a.details+'\" fatal: \"'+a.fatal+'\"')}.bind(this),\"undefined\"==typeof Hls)return console.log(\"Hls is undefined\"),this.fallback();n=this.hls=new Hls(m),n.on(Hls.Events.MEDIA_ATTACHED,function(){this.app.logger.logHLS(\"Hls attached on video tag\"),this.mediaErrorRecovery&&e.playing&&(this.mediaElement.currentTime=this.currentTime,this.mediaElement.play())}.bind(this)),n.on(Hls.Events.ERROR,this.onHLSError),n.on(Hls.Events.MANIFEST_PARSED,function(t,o){this.trackRequest(),this.app.logger.logHLS(\"Manifest Parsed - \"+t);var n,l,d,p=o.levels.length-1;for(i=0;i<=p;i++)n=p-i,l=o.levels[n],d=l.name,l.height>this.minimumQualityVisible&&(a[d]={type:d,index:n}),s[d]={type:d,index:n};s.auto=a.auto={type:\"auto\",index:-1},e.data.formats.HLS=a,this.setInitialQuality();for(f in a)r[a[f].index]=a[f].type;this.events.ready.dispatch()}.bind(this)),n.on(Hls.Events.LEVEL_SWITCHING,function(e,t){this.trackRequest()}.bind(this)),n.on(Hls.Events.LEVEL_SWITCHED,function(e,t){this.trackRequest();var a=n.levels[t.level].name;this.app.tracker.pushState(\"hlsLevel\",a),this.app.logger.logHLS(\"Qualidade: \"+a),this.events.onChangedQuality.dispatch({format:a,auto:n.autoLevelEnabled})}.bind(this)),UOLPlayer.ElementErrorHandler.resolveFallbackURL(e,this.m3u8,function(e,t,a){this.m3u8=e,n.loadSource(this.m3u8)}.bind(this));var c=function(){n.nextLevel=-1,this.removeEventListener(\"progress\",c,!1)}.bind(this);this.registerEventListener(\"progress\",c)},UOLPlayer.HLS.isSupported=function(){return window.MediaSource=window.MediaSource||window.WebKitMediaSource,!UOLPlayer.isChromeOld&&void 0!==window.MediaSource&&\"function\"==typeof window.MediaSource.isTypeSupported&&window.MediaSource.isTypeSupported('video/mp4; codecs=\"avc1.42E01E,mp4a.40.2\"')},UOLPlayer.HLS.checkAllowedDomain=function(e){var t=new RegExp(\"^(\"+e+\")$\");return t.test(UOLPlayer.hostName)},UOLPlayer.HLS.prototype.attachMedia=function(){this.app.initTimeouts(),this.hlsSwitchTimeout=this.app.timeouts[this.app.timeouts.type.HLS_SWITCH_LEVEL],this.setInitialQuality(),this.attached=!0,this.hls&&this.hls.attachMedia(this.mediaElement)},UOLPlayer.HLS.prototype.detachMedia=function(){this.attached=!1,this.hls.detachMedia()},UOLPlayer.HLS.prototype.formatsReloaded=function(){this.currentServer=0,this.app.externalCDN=this.app.data.formats.available.HLS.externalCDN,this.app.forceCDN!==!1&&void 0!==this.app.forceCDN?this.m3u8=this.app.data.formats.available.HLS.alternatives[0]:this.app.data.formats.available.HLS.url.indexOf(\"video.m.mais.uol.com.br\")===-1?this.m3u8=UOLPlayer.sortRandom(this.app.data.formats.available.HLS.alternatives.concat(this.app.data.formats.available.HLS.url))[0]:this.m3u8=\"//video.m.mais.uol.com.br/\"+this.app.mediaId+\"-10.m3u8\",this.m3u8=UOLPlayer.mediaSourceURL(this.m3u8,this.app.data.item.revision,this.app.hashId),this.onHLSError.apply(this,this.lastError)},UOLPlayer.VideoPlayer=function(e,t){\"HLS\"===e.data.formats[\"default\"].type?(e.currentFormat=UOLPlayer.currentFormatLog(e,e.mediaId,\"NATIVE HLS\"),e.hlsNative=!0,this.mediaType=\"hls\"):\"WEBM\"===e.data.formats[\"default\"].type?(e.currentFormat=UOLPlayer.currentFormatLog(e,e.mediaId,\"WEBM\"),this.mediaType=\"webm\"):(e.currentFormat=UOLPlayer.currentFormatLog(e,e.mediaId,\"MP4\"),this.mediaType=\"mp4\"),this.app=e,this.wrapper=t,this.mediaElement=this.wrapper.getElementsByClassName(\"video-element\")[0],this.adContainer=this.wrapper.getElementsByClassName(\"ad-container\")[0],this.lastUrl=\"\",this.wrapper.addClass(\"_video\").removeClass(\"_audio\"),UOLPlayer.MediaElement.call(this),this.mediaLoad=function(){e.logger.send(\"mediaLoad\",{time:e.logger.stopTime(\"mediaLoad\")}),this.mediaElement.removeEventListener(\"playing\",this.mediaLoadEvent,!1)},this.mediaLoadEvent=this.mediaLoad.bind(this),this.reloadCallback_=this.reloadCallback.bind(this),this.registerEventListener(\"playing\",this.mediaLoadEvent),this.changeQuality=function(t){e.data.formats.available[t].alternatives=UOLPlayer.sortRandom(e.data.formats.available[t].alternatives);var a,r,i=e.data.formats.available[t],s=e.data.formats.available[t].alternatives,o=e.startTime+this.getCurrentTime();a=s.length>0?s.shift():i.url,r=UOLPlayer.mediaSourceURL(a,e.data.item.revision,e.hashId),e.externalCDN=i.externalCDN,e.qualityChanged=!0,e.data.formats.current=i,this.lastCurrentTime=this.lastCurrentTime||o;!this.mediaElement.paused;this.setSrc(r,Math.max(o,this.lastCurrentTime)),this.events.onChangingQuality.dispatch(t)}.bind(this),this.setDefault=function(){this.changeQuality(e.data.formats[\"default\"].type)}.bind(this),this.setInitialQuality=function(){e.data.formats.available[e.startHd]?this.changeQuality(e.startHd):(0!=e.startHd&&UOLPlayer.w(\"Formato \"+e.startHd+\" indisponível\"),this.setDefault())}.bind(this)},UOLPlayer.VideoPlayer.prototype.attachMedia=function(){this.setDefault()},UOLPlayer.VideoPlayer.prototype.removePreloadListener=function(){this.preloadListener&&(this.mediaElement.removeEventListener(\"loadedmetadata\",this.preloadListener,!1),this.preloadListener=null)},UOLPlayer.VideoPlayer.prototype.reloadContent=function(e){this.app.logger.log(\"reloadContent: \"+e),e=e||this.lastPauseTime,this.app.data.formats.current=this.app.data.formats[\"default\"],this.setSrc(this.videoURL,e),this.mediaElement.removeEventListener(\"loadedmetadata\",this.reloadCallback_),this.mediaElement.addEventListener(\"loadedmetadata\",this.reloadCallback_)},UOLPlayer.VideoPlayer.prototype.reloadCallback=function(){function e(e){e.app.hasClass(\"_clicked\")?e.play():e.app.ui&&e.app.ui.setState(\"stop\"),e.events.reload.dispatch()}this.app.logger.log(\"reloadCallback\"),e(this)},UOLPlayer.VideoPlayer.prototype.resize=function(e,t,a,r,i){return e===!1?(this.wrapper&&this.wrapper.setAttribute(\"style\",\"\"),void(this.mediaElement&&this.mediaElement.setAttribute(\"style\",\"\"))):(this.wrapper.style.position=e,this.wrapper.style.top=t,this.wrapper.style.left=a,this.wrapper.style.width=r+\"px\",this.wrapper.style.height=i+\"px\",this.mediaElement.style.width=r+\"px\",void(this.mediaElement.style.height=i+\"px\"))};var UOLPlayerAutoRep=function(e,t){var a=e.wrapper.getElementsByClassName(\"ui\")[0],r=e.wrapper.getElementsByClassName(\"up-ctrlbar-autorep\")[0].getElementsByClassName(\"up-switch\")[0];this.autorep=a.getElementsByClassName(\"up-autorep\")[0],this.time=this.autorep.getElementsByClassName(\"up-time\")[0],this.btSwitch=this.autorep.getElementsByClassName(\"up-switch\")[0],this.switchCountdown=this.autorep.getElementsByClassName(\"up-switch-countdown\")[0],this.app=e,this.mediaId=e.mediaId,this.data=t.list[0],UOLPlayer.getCookie(\"lplr_autorep_id\")==this.data.mediaId&&(this.data=t.list[1]),UOLPlayer.setCookie(\"lplr_autorep_id\",this.mediaId,365),(UOLPlayer.isTVUOL||UOLPlayer.isUOLMais)&&this.app.wrapper.addClass(\"_autorep\"),UOLPlayer.toBoolean(UOLPlayer.getCookie(\"lplr_autorep\"))?(this.autorep.addClass(\"_on\"),this.btSwitch.removeClass(\"up-switch-off\").addClass(\"up-switch-on\"),r.removeClass(\"up-switch-off\").addClass(\"up-switch-on\")):(this.autorep.addClass(\"_off\"),this.btSwitch.removeClass(\"up-switch-on\").addClass(\"up-switch-off\"),r.removeClass(\"up-switch-on\").addClass(\"up-switch-off\")),this.switchAutorep=function(e){this.btSwitch.hasClass(\"up-switch-on\")?(autorepEnabled=!1,this.autorep.removeClass(\"_on\").addClass(\"_off\"),this.btSwitch.addClass(\"up-switch-off\").removeClass(\"up-switch-on\"),r.addClass(\"up-switch-off\").removeClass(\"up-switch-on\"),this.stop()):(autorepEnabled=!0,this.autorep.removeClass(\"_off\").addClass(\"_on\"),this.btSwitch.addClass(\"up-switch-on\").removeClass(\"up-switch-off\"),r.addClass(\"up-switch-on\").removeClass(\"up-switch-off\"),this.countdown())},this.btSwitch.addEventListener(\"click\",function(){var e=!this.btSwitch.hasClass(\"up-switch-on\");this.switchAutorep(e),UOLPlayer.setCookie(\"lplr_autorep\",e,365)}.bind(this)),this.app.wrapper.hasClass(\"_end\")&&this.countdown()};UOLPlayerAutoRep.prototype.countdown=function(){var e=5;this.time.innerHTML=\"em \"+e+\"s\",setTimeout(function(){this.switchCountdown.addClass(\"count\")}.bind(this),200);var t=function(){e--,this.time.innerHTML=\"em \"+e+\"s\",e<1&&(clearInterval(this.interval),UOLPlayer.isTVUOL?window.location.href=UOLPlayer.HTTP+\"tvuol.uol.com.br/video/\"+this.data.urlHash:UOLPlayer.isUOLMais&&(window.location.href=UOLPlayer.HTTP+\"mais.uol.com.br/view/\"+this.data.mediaId))};this.autorep.hasClass(\"_on\")&&(this.interval=setInterval(t.bind(this),1e3))},UOLPlayerAutoRep.prototype.stop=function(){this.switchCountdown.removeClass(\"count\"),clearInterval(this.interval)},UOLPlayerAutoRep.activateInControlbar=function(e,t){if(e.autorep){var a=t.getElementsByClassName(\"up-ctrlbar-autorep\")[0],r=t.getElementsByClassName(\"up-ctrlbar-autorep\")[0].getElementsByClassName(\"up-switch\")[0];a.show(),r.addEventListener(\"click\",function(){var t;r.hasClass(\"up-switch-on\")?(t=!1,r.addClass(\"up-switch-off\").removeClass(\"up-switch-on\")):(t=!0,r.addClass(\"up-switch-on\").removeClass(\"up-switch-off\")),e.repro&&e.repro.switchAutorep(t),UOLPlayer.setCookie(\"lplr_autorep\",t,365)}),UOLPlayer.toBoolean(UOLPlayer.getCookie(\"lplr_autorep\"))||r.addClass(\"up-switch-off\").removeClass(\"up-switch-on\")}},UOLPlayer.Detach=function(e,t){if(!UOLPlayer.isTVUOL&&!UOLPlayer.isUOLMais){this.destroyed=!1;var a,r,i=UOLPlayer.domNode(\"div\").addClass(\"up-detach-cover\"),s=t.getElementsByClassName(\"up-bt-detach\")[0],o=UOLPlayer.domNode(\"I\").addClass(\"up-bt up-bt-detach-close\"),n=t.getElementsByClassName(\"uolplayer-container\")[0],l=\"up-detach-LB\",d=100,p=UOLPlayer.Detach.states.ATTACHED,u=t.getData(\"detachstate\")===UOLPlayer.Detach.states.DISABLED?UOLPlayer.Detach.states.DISABLED:UOLPlayer.Detach.states.AUTO;if(s.show(),n){t.getData(\"detachPosition\")?l=\"up-detach-\"+t.getData(\"detachPosition\"):\"string\"==typeof e._detach&&(l=\"up-detach-\"+e._detach),n.addClass(l).appendChild(o),t.appendChild(i);var h=function(){var e=document.getElementsByClassName(\"up-detach\")[0];e&&UOLPlayer.getInstance(e.getData(\"hashId\")).detach.detachPlayer(!1)},m=function(r){e.detachOnce===!1&&(e.detachOnce=!0,e.logger.send(\"detached\")),i.hasClass(\"_mounted\")||(UOLPlayer.setPoster(e,i),i.addClass(\"_mounted\")),r===!0&&p===UOLPlayer.Detach.states.ATTACHED&&(h(),n.addClass(\"up-detach-hide\"),UOLPlayer.onDetach(!0),clearTimeout(a),a=setTimeout(function(){t.addClass(\"_small\").addClass(\"up-detach\"),n.addClass(\"up-detach-active\").removeClass(\"up-detach-hide\").addClass(\"up-detach-show\"),p=UOLPlayer.Detach.states.DETACHED,this.destroyed||u===UOLPlayer.Detach.states.DISABLED||(this.state=p,t.setData(\"detachstate\",p)),c()}.bind(this),d)),r===!1&&p===UOLPlayer.Detach.states.DETACHED&&(n.addClass(\"up-detach-hide\"),UOLPlayer.onDetach(!1),clearTimeout(a),a=setTimeout(function(){t.removeClass(\"_small\").removeClass(\"up-detach\"),n.removeClass(\"up-detach-active\").removeClass(\"up-detach-hide\").addClass(\"up-detach-show\"),p=UOLPlayer.Detach.states.ATTACHED,this.destroyed||u===UOLPlayer.Detach.states.DISABLED||(this.state=p,t.setData(\"detachstate\",p)),c()}.bind(this),d))}.bind(this),c=function(){if(e.ads){var t=e.getSize();e.ads.resize(t.width,t.height,\"NORMAL\")}},y=function(){this.inView=UOLPlayer.inView(t),e.isStarted()&&UOLPlayer.getCurrentMedia()===e&&u!==UOLPlayer.Detach.states.DISABLED&&(clearTimeout(r),r=setTimeout(function(){clearTimeout(r),m(!this.inView)}.bind(this),200))}.bind(this),g=function(){p===UOLPlayer.Detach.states.ATTACHED?(u=UOLPlayer.Detach.states.ENABLED,s.removeClass(\"_disable\"),document.addEventListener(\"scroll\",y),m(!0),e.getState()!==UOLPlayer.READY&&e.getState()!==UOLPlayer.PAUSED||e.play()):p===UOLPlayer.Detach.states.DETACHED&&(this.state=u=UOLPlayer.Detach.states.DISABLED,s.addClass(\"_disable\"),t.setData(\"detachstate\",u),document.removeEventListener(\"scroll\",y),m(!1),this.inView||e.deactivate())}.bind(this);s.addEventListener(\"click\",g),o.addEventListener(\"click\",g),e.detachPlayer=function(e){m(e)}.bind(this),this.init=function(){u===UOLPlayer.Detach.states.DISABLED&&s.addClass(\"_disable\"),document.addEventListener(\"scroll\",y)},this.destroy=function(){this.destroyed=!0,t.removeClass(\"up-detach\")},this.detachPlayer=m,this.checkPosition=y}}},UOLPlayer.Detach.setWidth=function(e){var t=document.head||document.getElementsByTagName(\"head\")[0],a=document.createElement(\"style\");a.type=\"text/css\",a.id=\"uolplayer-detach-size\",css=\".uolplayer .up-detach-active{ width: \"+e+\"px; }\",a.styleSheet?a.styleSheet.cssText=css:a.appendChild(document.createTextNode(css)),t.appendChild(a)},UOLPlayer.Detach.states={ATTACHED:\"attached\",DETACHED:\"detached\",AUTO:\"auto\",ENABLED:\"enabled\",DISABLED:\"disabled\"},UOLPlayer.prototype.storeIntance=function(){window.UOLPlayer[this.mediaId]=this,window.UOLPlayer[this.hashId]=this,this.wrapper.setData(\"hashId\",this.hashId)},UOLPlayer.getInstance=function(e){return window.UOLPlayer[e]},UOLPlayer.getCurrentMedia=function(){var e=void 0;return 1===document.getElementsByClassName(\"up-detach\").length&&(e=document.getElementsByClassName(\"up-detach\")[0]),1===document.getElementsByClassName(\"_playing-video\").length?e=document.getElementsByClassName(\"_playing-video\")[0]:1===document.getElementsByClassName(\"_playing-ad\").length&&(e=document.getElementsByClassName(\"_playing-ad\")[0]),void 0!==e&&(e=UOLPlayer.getInstance(e.getData(\"hashId\"))),e};var UOLPlayerRelated=function(e){var t=e.wrapper.getElementsByClassName(\"ui\")[0],a=UOLPlayer.createToolsWrapper(t);this.app=e,this.limit=9,this.mediaId=e.mediaId,this.mounted=!1,this.currentVideo=this.app.data.item.mediaId+\" \"+this.app.data.item.title,this.relatedData={relatedCurrentTitle:this.app.data.item.title,\nrelatedCurrentMediaId:this.app.data.item.mediaId.toString()},this.app.related&&(relatedButton=t.getElementsByClassName(\"up-bt-related\")[0],this.app.recommended&&relatedButton.addClass(\"up-bt-recommended\"),relatedButton.show(),relatedButton.addEventListener(\"click\",this.setRelated.bind(this))),this.init=function(e,t){this.app.ui.loading(!1),this.app.related&&this.mount(e,t),this.app.autorep&&!this.app.repro&&(this.app.repro=new UOLPlayerAutoRep(this.app,e)),this.mounted=!0}.bind(this),this.mount=function(t,r){t=t.list;var i,s,o,n,l,d=UOLPlayer.domNode(\"ul\"),p=this;d.addClass(\"up-ul\"),i=UOLPlayer.domNode(\"div\"),i.className=\"up-related\",i.appendChild(d);for(var u=0,h=t.length<9?t.length:9;u<h;u++)s=UOLPlayer.domNode(\"li\"),s.addClass(\"up-li\"),n=t[u],o=UOLPlayer.domNode(\"div\"),l=UOLPlayer.domNode(\"span\"),o.addClass(\"up-related-bg\"),UOLPlayer.setThumb(o,n.thumbWlarge.replace(\"http://\",\"//\")),l.addClass(\"up-related-info\").innerHTML='<span class=\"up-related-title\">'+n.title+'</span><span class=\"up-related-duration\">'+n.duration+\"</span>\",s.setData(\"mediaId\",n.mediaId),s.setData(\"urltvuol\",UOLPlayer.HTTP+\"tvuol.uol.com.br/video/\"+n.urlHash),s.setData(\"title\",n.title),s.setData(\"pos\",u+1),s.addEventListener(\"click\",function(t){p.app.metrics=p.app.metrics||new UOLPlayer.Metrics(p.app),p.relatedData.relatedClickedTitle=this.getData(\"title\"),p.relatedData.relatedClickedMediaId=this.getData(\"mediaid\"),p.relatedData.relatedClickedPos=this.getData(\"pos\"),p.relatedData.recommended=p.app.recommended,p.relatedData.lastState=p.app.getFullState(),p.app.metrics.click(\"relacionados clique\",this.getData(\"mediaid\")+\" \"+this.getData(\"title\"),p.currentVideo),UOLPlayerLog.send(p.app,\"related\",{payload:p.relatedData,time:r}),UOLPlayer.isUOLMais&&!UOLPlayer.isIframe?window.location.href=UOLPlayer.HTTP+\"mais.uol.com.br/view/\"+this.getData(\"mediaid\"):UOLPlayer.isVideosUOL?window.location.href=\"https://videos.uol.com.br/v/\"+this.getData(\"mediaid\"):UOLPlayer.isTVUOL?window.location.href=this.getData(\"urltvuol\"):e.changeVideo(this.getData(\"mediaid\"))}),s.appendChild(l),s.appendChild(o),d.appendChild(s);a.appendChild(i),setTimeout(function(){i.addClass(\"_mounted\")},200)}.bind(this),this.onTimeout=function(){var e;e=UOLPlayer.domNode(\"div\"),e.className=\"up-related up-error _mounted\",e.innerHTML=\"Desculpe, houve um problema no carregamento dos vídeos relacionados\",a.appendChild(e),this.mounted=!0,this.app.ui.loading(!1),this.app.wrapper.hasClass(\"_end\")&&this.app.wrapper.removeClass(\"_tools\").removeClass(\"_related\")}.bind(this),this.startWatch=function(){if(e){if(e.mediaPlayer&&e.mediaPlayer.mediaElement&&e.mediaPlayer.mediaElement.currentTime>1&&e.mediaPlayer.mediaElement.duration>0&&e.mediaPlayer.mediaElement.duration-e.mediaPlayer.mediaElement.currentTime<Math.min(30,.75*e.mediaPlayer.mediaElement.duration))return clearTimeout(this.timeoutWatch),this.preLoadData(e,this.mediaId);setTimeout(this.startWatch.bind(this),400)}}.bind(this),this.startWatch()};UOLPlayerRelated.prototype.setRelated=function(){this.mounted||(this.app.ui.loading(!0),this.preLoadData(this.app,this.mediaId).then(this.init,this.onTimeout)),this.app.ui.setState(\"related\"),this.app.hasClass(\"_clicked\")&&!this.app.hasClass(\"_paused\")&&(this.app.hasClass(\"_related\")?this.app.mediaPlayer.pause():this.app.mediaPlayer.play())},UOLPlayerRelated.prototype.preLoadData=function(e,t){if(this.promise)return this.promise;this.promise=new UOLPlayer.Promise;var a=function(t,a,r){var i=r&&r.loadedAt?r.loadedAt.elapsedTime:void 0,s={server_status:a,timeout:408==a};e.recommended===!0&&(s.server_response=t),UOLPlayerLog.send(e,\"relatedTime\",{time:i,payload:s}),this.promise.resolve(t,i)}.bind(this),r=function(){UOLPlayer.jsonp({url:UOLPlayer[\"const\"].urls.RELATED+t,success:a,timeout:this.promise.reject,error:this.promise.reject})}.bind(this),i=function(t,a,i){e.recommended=\"error\",e.wrapper.getElementsByClassName(\"ui\")[0].getElementsByClassName(\"up-bt-related\")[0].removeClass(\"up-bt-recommended\");var s={payload:{server_status:a,server_response:t,timeout:408==a}};i&&i.loadedAt&&(s.time=i.loadedAt.elapsedTime),UOLPlayerLog.send(e,\"recommendedTime\",s),r()},s=function(e,t,r){return 200==e.response.code?a(e,t,r):i(e,e.response.code,r)};if(e.recommended){var o=UOLPlayer[\"const\"].urls.RECOMMENDED.replace(\"{mediaId}\",t).replace(\"{ss}\",void 0===UOLPlayer.urlParameter.recommended_ss?\"2001\":UOLPlayer.urlParameter.recommended_ss).replace(\"{c}\",void 0===UOLPlayer.urlParameter.recommended_c?\"3\":UOLPlayer.urlParameter.recommended_c).replace(\"{h}\",void 0===UOLPlayer.urlParameter.recommended_h?\"6\":UOLPlayer.urlParameter.recommended_h).replace(\"{s}\",void 0===UOLPlayer.urlParameter.recommended_s?\"true\":UOLPlayer.urlParameter.recommended_s).replace(\"{d}\",void 0===UOLPlayer.urlParameter.recommended_d?\"1\":UOLPlayer.urlParameter.recommended_d);UOLPlayer.ajax({url:o,success:s,timeout:i,error:i,maxTimeout:6e4})}else r();return this.promise};var UOLPlayerShare=function(e){if(e.share){this.app=e,this.app.initMetrics();var t,a,r=e.wrapper.getElementsByClassName(\"ui\")[0],i=UOLPlayer.createToolsWrapper(r),s=this,o=\"\";t=e.data.item.shareUrl?e.data.item.shareUrl:UOLPlayer.HTTP+(UOLPlayer.isTVUOL?\"tvuol.uol.com.br/video/\":\"mais.uol.com.br/view/\")+e.data.item.mediaId,e.isMobile&&(o='<a href=\"whatsapp://send?text='+t+'\" data-action=\"share/whatsapp/share\" class=\"up-share-button up-bt-share up-bt-whatsapp\"></a><a href=\"fb-messenger://share/?link='+t+'\" class=\"up-share-button up-bt-share up-bt-messenger\"></a>');var n=\"https://twitter.com/share?url=\"+t+\"&text=\"+s.app.data.item.title,l=\"https://www.facebook.com/sharer/sharer.php?u=\"+t,d='<div class=\"up-share\"><div class=\"up-bt-container\"><a class=\"up-share-button up-bt-share up-bt-facebook\" href=\"'+l+'\" target=\"_blank\"></a><a class=\"up-share-button up-bt-share up-bt-twitter\" href=\"'+n+'\" target=\"_blank\"></a>'+o+'<div class=\"up-share-button up-shorturl-wrapper\"><div class=\"up-bt-share up-bt-link\"></div><div class=\"up-share-url-wrapper\"><input class=\"up-share-url\" onClick=\"this.setSelectionRange(0, this.value.length)\"></input><div class=\"up-bt-copy\"></div></div></div></div></div>';a=r.getElementsByClassName(\"up-bt-share\")[0],shareButtonMobile=r.getElementsByClassName(\"up-bt-share-mobile\")[0],a.show(),a.addEventListener(\"click\",this.setShare.bind(this)),shareButtonMobile.addEventListener(\"click\",this.setShare.bind(this)),i.appendHtmlText(d),this.container=i.getElementsByClassName(\"up-bt-container\")[0],this.shortUrlWrapper=i.getElementsByClassName(\"up-shorturl-wrapper\")[0];var p=i.getElementsByClassName(\"up-bt-facebook\")[0],u=i.getElementsByClassName(\"up-bt-twitter\")[0],h=i.getElementsByClassName(\"up-bt-link\")[0],m=i.getElementsByClassName(\"up-bt-copy\")[0],c=i.getElementsByClassName(\"up-share-url\")[0],y=i.getElementsByClassName(\"up-bt-share\");c.value=t,h.addEventListener(\"click\",function(t){if(this.shortUrlWrapper.hasClass(\"_opened\")){this.container.addClass(\"_closed\").removeClass(\"_opened\"),this.shortUrlWrapper.addClass(\"_closed\").removeClass(\"_opened\");for(var a=0;a<y.length;a++)y[a].removeClass(\"fadeOut\").removeClass(\"fadeHalf\")}else{this.container.addClass(\"_opened\").removeClass(\"_closed\"),this.shortUrlWrapper.addClass(\"_opened\").removeClass(\"_closed\");for(var a=0;a<y.length;a++)!y[a].hasClass(\"up-bt-link\")&&e.isMobile&&y[a].addClass(\"fadeOut\")}}.bind(this)),m.addEventListener(\"click\",function(e){m.addClass(\"_ok\"),c.select();try{document.execCommand(\"copy\")&&m.addClass(\"_ok\"),c.setSelectionRange(1,0),setTimeout(function(){m.removeClass(\"_ok\")},3e3)}catch(t){}});for(var g=0;g<y.length;g++)y[g].addEventListener(\"mouseover\",function(e){for(var t=0;t<y.length;t++)y[t]!==e.currentTarget&&y[t].addClass(\"fadeHalf\")}),y[g].addEventListener(\"mouseout\",function(e){for(var t=0;t<y.length;t++)y[t].removeClass(\"fadeHalf\")});p.addEventListener(\"click\",function(e){s.app.metrics.click(\"compartilhe clique\",\"facebook\",s.app.mediaId+\" \"+s.app.data.item.title)}),u.addEventListener(\"click\",function(e){s.app.metrics.click(\"compartilhe clique\",\"twitter\",s.app.mediaId+\" \"+s.app.data.item.title)})}};UOLPlayerShare.prototype.setShare=function(){this.app.ui.setState(\"share\"),this.app.hasClass(\"_clicked\")&&!this.app.hasClass(\"_paused\")&&(this.app.hasClass(\"_share\")?this.app.mediaPlayer.pause():this.app.mediaPlayer.play()),this.container.removeClass(\"_closed\").removeClass(\"_opened\"),this.shortUrlWrapper.removeClass(\"_closed\").removeClass(\"_opened\")},UOLPlayer.BBC=function(e){if(UOLPlayer.isBBC||e.data.item.author&&e.data.item.author.toLowerCase().indexOf(\"bbc\")!=-1){var t={},a=function(){e.logger.log(\"Tracking BBC: OK\"),this.bbcLoaded=!0,t={media_name:e.data.item.title,media_id:e.mediaId,media_length:e.data.item.duration.seconds,media_player:\"UOLPlayer\",media_type:\"video\"},window.s_bbcws&&(window.s_bbcws.noPageview=!0),window.mtrack.init_media(t)}.bind(this);window.mtrack?(UOLPlayer.i(\"BBC already loading...\"),a()):UOLPlayer.loadJs({src:UOLPlayer[\"const\"].urls.BBC,name:\"bbc\",success:a,error:function(){UOLPlayer.e(\"BBC Load error\")}})}var r=function(t){if(this.bbcLoaded)switch(t){case\"play\":window.mtrack.media_play(e.mediaPlayer.getCurrentTime());break;case\"pause\":window.mtrack.media_pause(e.mediaPlayer.getCurrentTime());break;case\"end\":window.mtrack.media_end()}}.bind(this);return{clickCount:r}},UOLPlayer.Comscore=function(e){var t=void 0;if(\"object\"==typeof UOLPD&&UOLPD.Audience&&UOLPD.Audience.hasOwnProperty(\"Player\"))try{t=new UOLPD.Audience.Player}catch(a){UOLPlayer.e(\"[ COMSCORE ] \"+a.message)}var r=(e.mediaPlayer,e.data.item),i=(e.data.formats,r.mediaId+\" \"+r.title),s=(e.autoplay,e.audio?\"audio\":\"video\",{video:{action:null,metadata:{clipId:\"\",clipLength:\"\",stationTitle:\"\",publisherBrandName:\"\",programTitle:\"\",episodeTitle:\"\",episodeSeasonNumber:\"\",episodeNumber:\"\",contentGenre:\"\",tmsId:\"\",adLoadFlag:\"\",completeEpisodeFlag:\"\",digitalAirdate:\"\",tvAirdate:\"\"},mediaType:\"Other\",url:UOLPlayer.getURL()},ad:{action:null,metadata:{clipId:\"\",clipLength:\"\",stationTitle:\"\",publisherBrandName:\"\",programTitle:\"\",episodeTitle:\"\",episodeSeasonNumber:\"\",episodeNumber:\"\",contentGenre:\"\",tmsId:\"\",adLoadFlag:\"\",completeEpisodeFlag:\"\",digitalAirdate:\"\",tvAirdate:\"\"},mediaType:\"Other\",url:UOLPlayer.getURL()}}),o=function(e){if(void 0!==t&&t.hasOwnProperty(\"comScore\"))try{t.comScore.countMetrics(e)}catch(a){UOLPlayer.e(\"[ COMSCORE ] \"+a.message)}},n=function(e){s.video.action=e,s.video.metadata.clipId=r.mediaId,s.video.metadata.clipLength=1e3*r.duration.seconds,s.video.metadata.episodeTitle=i,o(s.video)},l=function(t){s.ad.action=t,e.ads&&(s.ad.metadata.clipId=e.ads.getAdId(),s.ad.metadata.clipLength=1e3*e.ads.getDuration(),s.ad.metadata.episodeTitle=e.ads.getAdTitle()),o(s.ad)};return{video:{clickCount:n},ad:{clickCount:l}}},UOLPlayer.GA=function(e){var t=(e.mediaPlayer,e.ads||null,e.data.item),a=e.data.formats,r=t.mediaId+\" \"+t.title,i=e.autoplay===!0?\"true\":\"false\",s=e.audio?\"audio\":\"video\",o=UOLPlayer.environment();currPec=0,cleanList=function(e){return e=e||\"\",e=e.split(\",\"),e=e.map(function(e){return e.trim()}),e=e.filter(function(e){return!!e}),e.join(\",\")};var n={video:{mediaName:r,mediaLength:t.duration.formatted,mediaType:s,mediaMode:\"ondemand\",mediaQuality:e.hlsEnabled?\"hls\":e.audio?\"128kbps\":a&&a.current?a.current.type:\"360p\",playerType:\"html5\",playerSize:e.getSize().formatted,typePublication:o,author:t.codProfile+\" \"+t.author,url:UOLPlayer.getURL(),autoplay:i,error:\"\",currentTime:null,action:null,tagId:cleanList(t.tags),tagName:cleanList(t.tagsDescription),tagSrv:cleanList(t.tagSrv),title:t.title},ad:{mediaName:r,adMediaName:null,mediaType:\"video-ad\",mediaMode:\"ondemand\",playerType:\"html5\",typePublication:o,autoplay:i,error:\"\",currentTime:null,action:null,tagId:cleanList(t.tags),tagName:cleanList(t.tagsDescription),tagSrv:cleanList(t.tagSrv)},click:{mediaName:r,mediaType:s,typePublication:o,action:null,reference:null,tagId:cleanList(t.tags),tagName:cleanList(t.tagsDescription),tagSrv:cleanList(t.tagSrv)}},l=function(t,a,r){var i={type:\"ErroGA\",method:t,event:a};r=r||{},i=UOLPlayer.mergeObject(i,r),UOLPlayerLog.send(e,\"metrics\",{payload:i}),UOLPlayer.e(\"GA throw error \"+t+'(\"'+a+'\")',r)},d=function(t){var r=void 0,i=void 0;if(\"object\"==typeof UOLPD&&UOLPD.Audience&&UOLPD.Audience.hasOwnProperty(\"Player\"))try{r=new UOLPD.Audience.Player,r.lastTimePlayed=0}catch(s){UOLPlayer.e(\"[ GA MILESTONE ] \"+s.message),l(\"milestonesCount\",\"fail on initialize _ga\",{message:s.message,erro:JSON.stringify(s)})}else l(\"milestonesCount\",\"try initialize but script not loaded yet\",{UOLPD:typeof UOLPD,UOLPD_Audience:\"object\"==typeof UOLPD&&typeof UOLPD.Audience||\"undefined\",UOLPD_Audience_Player:\"object\"==typeof UOLPD&&UOLPD.Audience&&UOLPD.Audience.hasOwnProperty(\"Player\")});i=new UOLPlayer.milestones;var o={0:\"start\",25:25,50:50,75:75,100:\"complete\"},d=function(t){if(currPerc=t.perc||this.getCurrentPerc(),currMilestone=i.get(currPerc),currMilestone!==!1){var s;if(this.ad?(n.ad.adMediaName=this.getAdTitle(),n.ad.action=\"ad\"+o[currMilestone],n.ad.currentTime=this.getCurrentTime(),n.ad.adPosition=this.getAdPosition(),n.ad.playerType=e.isDetached()?\"html5-detach\":\"html5\",s=n.ad):(n.video.mediaQuality=e.hlsEnabled?\"hls\":e.audio?\"128kbps\":a&&a.current?a.current.type:\"360p\",n.video.action=o[currMilestone],n.video.currentTime=this.getCurrentTime(),n.video.playerType=e.isDetached()?\"html5-detach\":\"html5\",s=n.video),r)try{r.countMetrics(s)}catch(d){UOLPlayer.e(\"[ GA MILESTONE \"+currMilestone+\" ] \"+d.message),s.message=d.message,s.error=JSON.stringify(d),l(\"milestonesCount\",\"_ga call exception\",s)}else s.currMilestone=currMilestone,l(\"milestonesCount\",\"_ga called but not initialized\",s);s.currMilestone=currMilestone,isNaN(s.action)||(s.action=\"video\"+s.action),e.logger.send(\"GA\",s)}}.bind(t);return this.mounted||t.registerEventListener(\"timeupdate\",d),this.mounted=!0,this},p=function(e,t){var a=void 0;if(\"object\"==typeof UOLPD&&UOLPD.Audience&&UOLPD.Audience.hasOwnProperty(\"Player\"))try{a=a||new UOLPD.Audience.Player}catch(r){UOLPlayer.e(\"[ GA CLICK ] \"+r.message),l(\"clickCount\",\"fail on initialize _ga\",{message:r.message,erro:JSON.stringify(r)})}else l(\"clickCount\",\"try initialize but script not loaded yet\",{UOLPD:typeof UOLPD,UOLPD_Audience:\"object\"==typeof UOLPD&&typeof UOLPD.Audience||\"undefined\",UOLPD_Audience_Player:\"object\"==typeof UOLPD&&UOLPD.Audience&&UOLPD.Audience.hasOwnProperty(\"Player\")});if(n.click.action=e,n.click.reference=t,a)try{a.countClick(n.click)}catch(r){UOLPlayer.e(\"[ GA CLICK ] \"+r.message),l(\"clickCount\",\"_ga call exception\",{message:r.message,error:JSON.stringify(r)})}else l(\"clickCount\",\"_ga called but not initialized\",n.click)}.bind(this);return{video:{milestones:d},ad:{milestones:d},clickCount:p}},UOLPlayer.Metrics=function(e){this.app=e,this.ga=new UOLPlayer.GA(e),this.comscore=new UOLPlayer.Comscore(e),this.bbc=new UOLPlayer.BBC(e);var t={};return t={video:{start:function(){this.app.logger.logMetrics(\"video started\"),this.bbc.clickCount(\"play\"),this.comscore.video.clickCount(\"play\"),this.ga.video.milestones(e.mediaPlayer)}.bind(this),pause:function(){this.app.logger.logMetrics(\"video paused\"),this.bbc.clickCount(\"pause\"),this.comscore.video.clickCount(\"stop\")}.bind(this),resume:function(){this.app.logger.logMetrics(\"video resume\"),this.bbc.clickCount(\"play\"),this.comscore.video.clickCount(\"play\")}.bind(this),end:function(){this.app.logger.logMetrics(\"video end\"),this.bbc.clickCount(\"end\"),this.comscore.video.clickCount(\"stop\")}.bind(this),seeking:function(){this.app.logger.logMetrics(\"video seeking\")}.bind(this),seeked:function(){this.app.logger.logMetrics(\"video seeked\")}.bind(this)},ad:{start:function(){this.app.logger.logMetrics(\"dfp start\"),this.comscore.ad.clickCount(\"playAd\"),this.ga.ad.milestones(e.ads)}.bind(this),pause:function(){this.comscore.ad.clickCount(\"stop\")}.bind(this),skipped:function(){this.app.logger.logMetrics(\"dfp skipped\"),this.comscore.ad.clickCount(\"stop\")}.bind(this),ended:function(){this.app.logger.logMetrics(\"dfp ended\"),this.comscore.ad.clickCount(\"stop\")}.bind(this)},click:function(e,t,a){this.app.logger.logMetrics(\"click metric - \"+e),this.ga.clickCount(e,t)}.bind(this)},{ga:this.ga,bbc:this.bbc,comscore:this.comscore,video:t.video,ad:t.ad,click:t.click}},UOLPlayer.Omniture=function(e){var t=void 0;\"object\"==typeof UOLPD&&UOLPD.Audience&&UOLPD.Audience.hasOwnProperty(\"Player\")&&(t=UOLPD.Audience.Player);var a=(e.mediaPlayer,e.data.item),r=e.data.formats,i=a.mediaId+\" \"+a.title,s=(e.autoplay,e.audio?\"audio\":\"video\"),o={video:{video:i,tpvideo:\"ondemand\",author:a.codProfile+\" \"+a.author,tags:a.videoTags,url:UOLPlayer.getURL(),domain:UOLPlayer.hostName,quality:e.hlsEnabled?\"hls\":e.audio?\"128kbps\":r.current.type,tpplayer:\"html5-v2\",error:\"\",events:\"\",ctime:0,ttime:a.duration.seconds,dimension:e.getSize().formatted,mediatype:s},ad:{ad_video:\"\",ad_pod:\"\",ad_player:\"html5-v2\",ad_error:\"\",ad_events:\"\",ad_ctime:0,ad_ttime:0,ad_primary:i},click:{action:\"\",reference:\"\",source:i}},n=function(a){if(o.video.events=a,o.video.ctime=\"play\"===a&&e.mediaPlayer.getCurrentTime()<=2?0:e.mediaPlayer.getCurrentTime(),o.video.quality=e.audio?\"128kbps\":r.current.type,t)try{t.countMetrics(o.video)}catch(i){UOLPlayer.e(\"[ OMNITURE VIDEO ] \"+i.message)}}.bind(this),l=function(a){if(o.ad.ad_events=a,o.ad.ad_video=e.ads.getAdTitle(),o.ad.ad_pod=e.ads.getAdPosition(),o.ad.ad_ttime=e.ads.getDuration(),o.ad.ad_ctime=e.ads.getCurrentTime(),t)try{t.countMetricsAd(o.ad)}catch(r){UOLPlayer.e(\"[ OMNITURE AD ] \"+r.message)}},d=function(e,a){if(o.click.action=e,o.click.reference=a,t)try{t.countClick(o.click)}catch(r){UOLPlayer.e(\"[ OMNITURE CLICK ] \"+r.message)}}.bind(this);return{video:{clickCount:n},ad:{clickCount:l},clickCount:d}},UOLPlayer.toBoolean=function(e){return\"true\"===(e+\"\").toLowerCase()},UOLPlayer.getTimestamp=function(){return(new Date).getTime()},UOLPlayer.getStaticParameter=function(e,t){var a=e.split(\"?\"),r={},i=0,s=0;if(a.length>1&&(a=a[1].split(\"&\"),s=a.length),!t){for(;i<s;i++){var o=a[i].split(\"=\");r[o[0]]=\"true\"==o[1]||\"false\"==o[1]?UOLPlayer.toBoolean(o[1]):o[1]}return r}for(;i<s;i++){var o=a[i].split(\"=\");if(o[0]==t)return\"true\"==o[1]||\"false\"==o[1]?UOLPlayer.toBoolean(o[1]):o[1]}},UOLPlayer.getUrlParameter=function(e){return UOLPlayer.getStaticParameter(window.location.search,e)},UOLPlayer.setCookie=function(e,t,a){var r,i=new Date;i.setTime(i.getTime()+24*a*60*60*1e3),r=\"expires=\"+i.toUTCString(),document.cookie=e+\"=\"+t+\"; \"+r},UOLPlayer.getCookie=function(e){for(var t=e+\"=\",a=document.cookie.split(\";\"),r=0,i=a.length;r<i;r++){for(var s=a[r];\" \"==s.charAt(0);)s=s.substring(1);if(0==s.indexOf(t))return\"false\"!==s.substring(t.length,s.length)&&s.substring(t.length,s.length)}return!1},UOLPlayer.isCookieEnabled=function(){var e=!!navigator.cookieEnabled;return\"undefined\"!=typeof navigator.cookieEnabled||e||(document.cookie=\"lplr_testcookie\",e=document.cookie.indexOf(\"lplr_testcookie\")!=-1,document.cookie=\"lplr_testcookie; expires=Thu, 01-Jan-1970 00:00:01 GMT\"),e}(),UOLPlayer.domNode=function(e){return document.createElement(e)},UOLPlayer.mousePosition=function(e){function t(e){return e.currentTarget}function a(e){var t=0,a=0;if(!e)var e=window.event;return e.changedTouches?(t=e.changedTouches[0].pageX,a=e.changedTouches[0].pageY):e.pageX||e.pageY?(t=e.pageX,a=e.pageY):(e.clientX||e.clientY)&&(t=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,a=e.clientY+document.body.scrollTop+document.documentElement.scrollTop),{x:t,y:a}}function r(e){var t=curtop=0;if(\"object\"==typeof e.getBoundingClientRect())t=e.getBoundingClientRect().left,curtop=e.getBoundingClientRect().top;else if(e.offsetParent)do t+=e.offsetLeft,curtop+=e.offsetTop;while(e=e.offsetParent);return{left:t,top:curtop}}function i(e){var i=a(e),s=t(e),o=r(s),n=i.x-o.left,l=i.y-o.top;return n=Math.min(s.offsetWidth,Math.max(0,n)),{x:n,y:l}}return i(e)},UOLPlayer.each=function(e,t,a){for(var r=0,i=e.length;r<i;++r)t.call(a,e[r],r,e)},UOLPlayer.createToolsWrapper=function(e){var t;return 0==e.getElementsByClassName(\"up-tools\").length?(t=UOLPlayer.domNode(\"div\"),t.addClass(\"up-tools\"),e.appendChild(t)):t=e.getElementsByClassName(\"up-tools\")[0],t},\"undefined\"!=typeof document.hidden?(UOLPlayer.hidden=\"hidden\",UOLPlayer.visibilityChange=\"visibilitychange\"):\"undefined\"!=typeof document.mozHidden?(UOLPlayer.hidden=\"mozHidden\",UOLPlayer.visibilityChange=\"mozvisibilitychange\"):\"undefined\"!=typeof document.msHidden?(UOLPlayer.hidden=\"msHidden\",UOLPlayer.visibilityChange=\"msvisibilitychange\"):\"undefined\"!=typeof document.webkitHidden&&(UOLPlayer.hidden=\"webkitHidden\",UOLPlayer.visibilityChange=\"webkitvisibilitychange\"),UOLPlayer.isHidden=function(){return document[UOLPlayer.hidden]},UOLPlayer.isNumeric=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},UOLPlayer.parseInt=function(e){return parseInt(decodeURIComponent(e+\"\").replace(/\\D/g,\"\"))},UOLPlayer.time2perc=function(e){return function(t){return 100*t/e}},UOLPlayer.perc2time=function(e){return function(t){return Math.floor(t*(\"function\"==typeof e?e():e)/100)}},UOLPlayer.sortRandom=function(e){return e&&e.sort?e.sort(function(e,t){return.5-Math.random()}):e},UOLPlayer.ping=function(e,t,a){var r;e=e||function(){},t=t||function(){};var i=function(){clearTimeout(r),e(),n.abort()},s=function(){clearTimeout(r),t(),n.abort()},o=function(){n.readyState==XMLHttpRequest.DONE&&i()};a=a||window.location.href.replace(/#.*/,\"\"),a+=a.indexOf(\"?\")>-1?\"&\":\"?\",a+=\"___rnd___=\"+Math.random();var n=new XMLHttpRequest;n.open(\"GET\",a,!0),n.onload=o,n.ontimeout=s,n.onerror=s;try{r=setTimeout(s,5e3),n.send()}catch(l){s()}},UOLPlayer.getURL=function(){return void 0!==UOLPlayer.urlParameter.ia_shareURL?decodeURIComponent(UOLPlayer.urlParameter.ia_shareURL):UOLPlayer.isIframe?document.referrer:window.location.href},UOLPlayer.supportedMediaTypesList=UOLPlayer.Fingerprint.mediaTypeSupported,UOLPlayer.supportedMediaTypes=function(){supportedTypes={};for(var e in UOLPlayer.supportedMediaTypesList)supportedTypes[e+\"Ok\"]=UOLPlayer.supportedMediaTypesList[e];return supportedTypes}(),UOLPlayer.milestones=function(){var e,t=25,a=-t,r=0,i=-1,s=0;return this.get=function(o){return s=o,r=Math.floor(o/t)*t,a=0==r&&a>0?-t:a,e=(a!==r||i<s)&&(r==a+t&&r),a=r,i=s,e},this},UOLPlayer.mediaSourceURL=function(e,t,a){var r=0===window.location.href.indexOf(\"http:\")?\"http:\":\"https:\",i=UOLPlayer.isIframe?\"//\"+window.location.host:\"//\"+UOLPlayer.hostName,s=UOLPlayer.isSafariMacOS?\"&view=desk\":\"\",o=e.indexOf(\"?\")===-1?\"?\":\"&\";return null===e.match(/httpvideo\\d+.mais.uol.com.br/)?UOLPlayer.stripProtocol(e)+o+\"ver=\"+t+\"&r=\"+r+i+\"&hashId=\"+a+s:UOLPlayer.stripProtocol(e)+o+\"ver=\"+t},UOLPlayer.mediaSourceFallbackURL=function(e,t,a,r){return UOLPlayer.mediaSourceURL(\"video.m.mais.uol.com.br/\"+e+\".\"+a,t,r)+\"&error=player\"},UOLPlayer.stripProtocol=function(e){return\"//\"+e.replace(/^(?:https?:)?\\/\\//,\"\")},UOLPlayer.mergeObject=function(e,t){for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a]);return e},UOLPlayer.parseResponse=function(e){var t;try{t=JSON.parse(e)}catch(a){t=e}return t},UOLPlayer.isVideoM=function(e){return/^(https?:)?(\\/\\/)?video\\.m\\.mais\\.uol\\.com\\.br/im.test(e)},UOLPlayer.checkAllowedDomain=function(e){var t=new RegExp(\"^(\"+e+\")$\");return t.test(UOLPlayer.hostName)},UOLPlayer.supportsPassive=function(){var e=!1;try{var t=Object.defineProperty({},\"passive\",{get:function(){e={passive:!0}}});window.addEventListener(\"test\",null,t)}catch(a){}return e}(),UOLPlayer.safariMultiplier=function(e,t){var a=t.data.item.playerParameters.dfp_custom_timeout_safari_desktop_multiplier||1;return UOLPlayer.isSafariMacOS?a*e:e},UOLPlayer.environment=function(){var e=\"\";if(UOLPlayer.isInstantArticle)e=\"instant-article\";else if(UOLPlayer.isAMP){var t=UOLPlayer.getStaticParameter(UOLPlayer.getURL(),\"app\");e=void 0!==t?\"app-amp_\"+t:\"chrome-amp\"}else e=UOLPlayer.isIframe?\"external-iframe\":UOLPlayer.urlParameter.app?\"app_\"+UOLPlayer.urlParameter.app:\"uol-template\";return e},UOLPlayer.createHashId=function(){return(new Date).getTime()+\"\"+Math.floor(1e4*Math.random())},UOLPlayer.setPoster=function(e,t){var a;void 0!==e.poster?a=e.poster:(revision=void 0!==e.revision?\"?ver=\"+e.revision:\"\",a=UOLPlayer[\"const\"].urls.THUMB+e.mediaId,a+=UOLPlayer.isIpad||!UOLPlayer.isMobile?\"-xlarge\":\"-wlarge\",a+=\".jpg\"+revision),UOLPlayer.setThumb(t,a)},UOLPlayer.setThumb=function(e,t){e.addClass(\"hideElement\"),UOLPlayer.loadThumb(t,function(t){e.style.backgroundImage=\"url(\"+t+\")\",e.style.backgroundRepeat=\"no-repeat\",e.removeClass(\"hideElement\").addClass(\"showElement\")})},UOLPlayer.DNA=function(){var e=UOLPlayer.getCookie(\"DNA\")||\"\";return e.split(\"|\").shift()},UOLPlayer.cloneJSON=function(e){return JSON.parse(JSON.stringify(e))},UOLPlayer.hashCode=function(e){var t=0;if(0==e.length)return t;for(i=0;i<e.length;i++)char=e.charCodeAt(i),t=(t<<5)-t+char,t&=t;return Math.abs(t)},UOLPlayer.instancesAutoLoaded=0,UOLPlayer.init=function(){UOLPlayer.i(\"UOLPlayer - ver: \"+UOLPlayer.version);var e,t,a=document.getElementsByClassName(\"uolplayer-link\");if(a.length>0){var r=0,i=a.length;for(a[0].parentNode.innerHTML+='<div class=\"up-lightbox display-none\"><div class=\"up-close\"></div><div class=\"up-container\"></div></div>',e=a[0].parentNode.getElementsByClassName(\"up-container\")[0],document.getElementsByClassName(\"up-close\")[0].addEventListener(\"click\",function(){t.destroy(!0),this.parentNode.addClass(\"display-none\"),t=null});r<i;r++)a[r].addEventListener(\"click\",function(a){a.preventDefault();var r=UOLPlayer.domNode(\"div\");r.addClass(\"uolplayer\"),r.setData(\"mediaid\",this.getData(\"mediaid\")),r.setData(\"autoplay\",!0),e.appendChild(r),e.parentNode.removeClass(\"display-none\"),t=new UOLPlayer(r)})}var a=document.getElementsByClassName(\"uolplayer\");if(UOLPlayer.setConfig(),UOLPlayer.setCookie(\"lplr_vlm\",UOLPlayer.getCookie(\"lplr_vlm\")||1),UOLPlayer.setCookie(\"lplr_pbr\",UOLPlayer.getCookie(\"lplr_pbr\")||1),UOLPlayerInjected||UOLPlayer.Cache.require({url:UOLPlayer.cssPath+\"uolplayer.min.css\",key:\"style\",type:UOLPlayer.Cache.type.CSS,checksum:UOLPlayer.isLocal?\"style_dev\":\"style\"}),UOLPlayer.loadJs({src:UOLPlayer[\"const\"].urls.GA,name:\"ga\",error:function(){var e={type:\"ErroGA\",method:\"loadJS\",event:\"load error\"};UOLPlayerLog.send({},\"metrics\",{payload:e}),UOLPlayer.e(\"[ GA ] Load error\")}}),UOLPlayer.instancesAutoLoaded=a.length,a.length>0&&!UOLPlayer.isTesting)for(var s,o,r=0,i=a.length;r<i;r++)o=a[r],s=o.getData(\"automount\")!==!1,s===!0?(o.setData(\"id\",\"uolplayer\"+(r+1)),new UOLPlayer(o)):UOLPlayer.i(\"[UOLPLAYER] automount desligado para o mediaId: \"+o.getData(\"mediaid\"))},UOLPlayer.init();","skip":false,"stamp":1557584307281,"expire":1575584307281,"updatedAt":1557584307301}


