text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-026864dc"],{13683:function(e,t,i){(function(t,i){
  /*!
   * @overview es6-promise - a tiny implementation of Promises/A+.
   * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
   * @license   Licensed under MIT license
   *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
   * @version   v4.2.8+1e68dce6
   */
  (function(t,i){e.exports=i()})(0,(function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function n(e){return"function"===typeof e}var s=void 0;s=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var a=s,r=0,o=void 0,l=void 0,d=function(e,t){w[r]=e,w[r+1]=t,r+=2,2===r&&(l?l(S):L())};function h(e){l=e}function u(e){d=e}var c="undefined"!==typeof window?window:void 0,p=c||{},m=p.MutationObserver||p.WebKitMutationObserver,f="undefined"===typeof self&&"undefined"!==typeof t&&"[object process]"==={}.toString.call(t),_="undefined"!==typeof Uint8ClampedArray&&"undefined"!==typeof importScripts&&"undefined"!==typeof MessageChannel;function y(){return function(){return t.nextTick(S)}}function g(){return"undefined"!==typeof o?function(){o(S)}:E()}function v(){var e=0,t=new m(S),i=document.createTextNode("");return t.observe(i,{characterData:!0}),function(){i.data=e=++e%2}}function b(){var e=new MessageChannel;return e.port1.onmessage=S,function(){return e.port2.postMessage(0)}}function E(){var e=setTimeout;return function(){return e(S,1)}}var w=new Array(1e3);function S(){for(var e=0;e<r;e+=2){var t=w[e],i=w[e+1];t(i),w[e]=void 0,w[e+1]=void 0}r=0}function k(){try{var e=Function("return this")().require("vertx");return o=e.runOnLoop||e.runOnContext,g()}catch(t){return E()}}var L=void 0;function A(e,t){var i=this,n=new this.constructor(C);void 0===n[R]&&X(n);var s=i._state;if(s){var a=arguments[s-1];d((function(){return H(s,n,a,i._result)}))}else j(i,n,e,t);return n}function T(e){var t=this;if(e&&"object"===typeof e&&e.constructor===t)return e;var i=new t(C);return F(i,e),i}L=f?y():m?v():_?b():void 0===c?k():E();var R=Math.random().toString(36).substring(2);function C(){}var x=void 0,M=1,I=2;function D(){return new TypeError("You cannot resolve a promise with itself")}function O(){return new TypeError("A promises callback cannot return that same promise.")}function B(e,t,i,n){try{e.call(t,i,n)}catch(s){return s}}function P(e,t,i){d((function(e){var n=!1,s=B(i,t,(function(i){n||(n=!0,t!==i?F(e,i):V(e,i))}),(function(t){n||(n=!0,z(e,t))}),"Settle: "+(e._label||" unknown promise"));!n&&s&&(n=!0,z(e,s))}),e)}function U(e,t){t._state===M?V(e,t._result):t._state===I?z(e,t._result):j(t,void 0,(function(t){return F(e,t)}),(function(t){return z(e,t)}))}function N(e,t,i){t.constructor===e.constructor&&i===A&&t.constructor.resolve===T?U(e,t):void 0===i?V(e,t):n(i)?P(e,t,i):V(e,t)}function F(t,i){if(t===i)z(t,D());else if(e(i)){var n=void 0;try{n=i.then}catch(s){return void z(t,s)}N(t,i,n)}else V(t,i)}function q(e){e._onerror&&e._onerror(e._result),G(e)}function V(e,t){e._state===x&&(e._result=t,e._state=M,0!==e._subscribers.length&&d(G,e))}function z(e,t){e._state===x&&(e._state=I,e._result=t,d(q,e))}function j(e,t,i,n){var s=e._subscribers,a=s.length;e._onerror=null,s[a]=t,s[a+M]=i,s[a+I]=n,0===a&&e._state&&d(G,e)}function G(e){var t=e._subscribers,i=e._state;if(0!==t.length){for(var n=void 0,s=void 0,a=e._result,r=0;r<t.length;r+=3)n=t[r],s=t[r+i],n?H(i,n,s,a):s(a);e._subscribers.length=0}}function H(e,t,i,s){var a=n(i),r=void 0,o=void 0,l=!0;if(a){try{r=i(s)}catch(d){l=!1,o=d}if(t===r)return void z(t,O())}else r=s;t._state!==x||(a&&l?F(t,r):!1===l?z(t,o):e===M?V(t,r):e===I&&z(t,r))}function W(e,t){try{t((function(t){F(e,t)}),(function(t){z(e,t)}))}catch(i){z(e,i)}}var $=0;function K(){return $++}function X(e){e[R]=$++,e._state=void 0,e._result=void 0,e._subscribers=[]}function Y(){return new Error("Array Methods must be provided an Array")}var Q=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(C),this.promise[R]||X(this.promise),a(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?V(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&V(this.promise,this._result))):z(this.promise,Y())}return e.prototype._enumerate=function(e){for(var t=0;this._state===x&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var i=this._instanceConstructor,n=i.resolve;if(n===T){var s=void 0,a=void 0,r=!1;try{s=e.then}catch(l){r=!0,a=l}if(s===A&&e._state!==x)this._settledAt(e._state,t,e._result);else if("function"!==typeof s)this._remaining--,this._result[t]=e;else if(i===ne){var o=new i(C);r?z(o,a):N(o,e,s),this._willSettleAt(o,t)}else this._willSettleAt(new i((function(t){return t(e)})),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,i){var n=this.promise;n._state===x&&(this._remaining--,e===I?z(n,i):this._result[t]=i),0===this._remaining&&V(n,this._result)},e.prototype._willSettleAt=function(e,t){var i=this;j(e,void 0,(function(e){return i._settledAt(M,t,e)}),(function(e){return i._settledAt(I,t,e)}))},e}();function J(e){return new Q(this,e).promise}function Z(e){var t=this;return a(e)?new t((function(i,n){for(var s=e.length,a=0;a<s;a++)t.resolve(e[a]).then(i,n)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))}function ee(e){var t=this,i=new t(C);return z(i,e),i}function te(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function ie(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var ne=function(){function e(t){this[R]=K(),this._result=this._state=void 0,this._subscribers=[],C!==t&&("function"!==typeof t&&te(),this instanceof e?W(this,t):ie())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var t=this,i=t.constructor;return n(e)?t.then((function(t){return i.resolve(e()).then((function(){return t}))}),(function(t){return i.resolve(e()).then((function(){throw t}))})):t.then(e,e)},e}();function se(){var e=void 0;if("undefined"!==typeof i)e=i;else if("undefined"!==typeof self)e=self;else try{e=Function("return this")()}catch(s){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(s){}if("[object Promise]"===n&&!t.cast)return}e.Promise=ne}return ne.prototype.then=A,ne.all=J,ne.race=Z,ne.resolve=T,ne.reject=ee,ne._setScheduler=h,ne._setAsap=u,ne._asap=d,ne.polyfill=se,ne.Promise=ne,ne}))}).call(this,i("4362"),i("c8ba"))},"4da9":function(e,t,i){},"5bcf":function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("a-drawer",{attrs:{title:"附件详情",width:e.isMobile()?"100%":"480",closable:"",visible:e.visible,destroyOnClose:""},on:{close:e.onClose}},[i("a-row",{attrs:{type:"flex",align:"middle"}},[i("a-col",{attrs:{span:24}},[i("div",{staticClass:"attach-detail-img"},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.nonsupportPreviewVisible,expression:"nonsupportPreviewVisible"}]},[e._v("此文件不支持预览")]),i("a",{attrs:{href:e.attachment.path,target:"_blank"}},[i("img",{directives:[{name:"show",rawName:"v-show",value:e.photoPreviewVisible,expression:"photoPreviewVisible"}],staticClass:"w-full",attrs:{src:e.attachment.path,loading:"lazy"}})]),i("d-player",{directives:[{name:"show",rawName:"v-show",value:e.videoPreviewVisible,expression:"videoPreviewVisible"}],ref:"player",staticClass:"w-full video-player-box",attrs:{options:e.videoOptions}})],1)]),i("a-divider"),i("a-col",{attrs:{span:24}},[i("a-list",{attrs:{itemLayout:"horizontal"}},[i("a-list-item",[i("a-list-item-meta",[e.editable?i("template",{slot:"description"},[i("a-input",{ref:"nameInput",on:{blur:e.doUpdateAttachment},model:{value:e.attachment.name,callback:function(t){e.$set(e.attachment,"name",t)},expression:"attachment.name"}})],1):i("template",{slot:"description"},[e._v(e._s(e.attachment.name))]),i("span",{attrs:{slot:"title"},slot:"title"},[e._v(" 附件名： "),i("a",{attrs:{href:"javascript:void(0);"}},[i("a-icon",{attrs:{type:"edit"},on:{click:e.handleEditName}})],1)])],2)],1),i("a-list-item",[i("a-list-item-meta",{attrs:{description:e.attachment.mediaType}},[i("span",{attrs:{slot:"title"},slot:"title"},[e._v("附件类型：")])])],1),i("a-list-item",[i("a-list-item-meta",{attrs:{description:e.attachment.typeProperty}},[i("span",{attrs:{slot:"title"},slot:"title"},[e._v("存储位置：")])])],1),i("a-list-item",[i("a-list-item-meta",[i("template",{slot:"description"},[e._v(" "+e._s(e._f("fileSizeFormat")(e.attachment.size))+" ")]),i("span",{attrs:{slot:"title"},slot:"title"},[e._v("附件大小：")])],2)],1),e.photoPreviewVisible?i("a-list-item",[i("a-list-item-meta",{attrs:{description:e.attachment.height+"x"+e.attachment.width}},[i("span",{attrs:{slot:"title"},slot:"title"},[e._v("图片尺寸：")])])],1):e._e(),i("a-list-item",[i("a-list-item-meta",[i("template",{slot:"description"},[e._v(" "+e._s(e._f("moment")(e.attachment.createTime))+" ")]),i("span",{attrs:{slot:"title"},slot:"title"},[e._v("上传日期：")])],2)],1),i("a-list-item",[i("a-list-item-meta",{attrs:{description:e.attachment.path}},[i("span",{attrs:{slot:"title"},slot:"title"},[e._v(" 普通链接： "),i("a",{attrs:{href:"javascript:void(0);"},on:{click:e.handleCopyNormalLink}},[i("a-icon",{attrs:{type:"copy"}})],1)])])],1),i("a-list-item",[i("a-list-item-meta",{attrs:{description:'<img class="myPic" src="'+e.attachment.path+'" alt="图裂啦"/>'}},[i("span",{attrs:{slot:"title"},slot:"title"},[e._v(" html-img标签： "),i("a",{attrs:{href:"javascript:void(0);"},on:{click:e.handleCopyImgLink}},[i("a-icon",{attrs:{type:"copy"}})],1)])])],1),e.photoPreviewVisible?i("a-list-item",[i("a-list-item-meta",[i("span",{attrs:{slot:"description"},slot:"description"},[e._v("!["+e._s(e.attachment.name)+"]("+e._s(e.attachment.path)+")")]),i("span",{attrs:{slot:"title"},slot:"title"},[e._v(" Markdown 格式： "),i("a",{attrs:{href:"javascript:void(0);"},on:{click:e.handleCopyMarkdownLink}},[i("a-icon",{attrs:{type:"copy"}})],1)])])],1):e._e()],1)],1)],1),i("a-divider",{staticClass:"divider-transparent"}),i("div",{staticClass:"bottom-control"},[i("a-space",[e.addToPhoto?i("a-popconfirm",{attrs:{title:"你确定要添加到图库？",okText:"确定",cancelText:"取消"},on:{confirm:e.handleAddToPhoto}},[i("a-button",{attrs:{type:"dashed"}},[e._v("添加到图库")])],1):e._e(),i("a-popconfirm",{attrs:{title:"你确定要删除该附件？",okText:"确定",cancelText:"取消"},on:{confirm:e.handleDeleteAttachment}},[i("ReactiveButton",{attrs:{type:"danger",loading:e.deleting,errored:e.deleteErrored,text:"删除",loadedText:"删除成功",erroredText:"删除失败"},on:{callback:e.handleDeletedCallback}})],1)],1)],1)],1)},s=[],a=(i("28a5"),i("7f7f"),i("1a86")),r=i("a796"),o=i("975e"),l=(i("4da9"),i("71ee")),d=i.n(l);class h{static install(){Object.setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Object.assign=Object.assign||function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");let t=Object(e);for(let i=1;i<arguments.length;i++){let e=arguments[i];if(void 0!==e&&null!==e)for(let i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}return t},"function"!==typeof self.Promise&&i("13683").polyfill()}}h.install();var u=h,c=i("faa1"),p=i.n(c);class m{static e(e,t){e&&!m.FORCE_GLOBAL_TAG||(e=m.GLOBAL_TAG);let i=`[${e}] > ${t}`;m.ENABLE_CALLBACK&&m.emitter.emit("log","error",i),m.ENABLE_ERROR&&(console.error?console.error(i):console.warn?console.warn(i):console.log(i))}static i(e,t){e&&!m.FORCE_GLOBAL_TAG||(e=m.GLOBAL_TAG);let i=`[${e}] > ${t}`;m.ENABLE_CALLBACK&&m.emitter.emit("log","info",i),m.ENABLE_INFO&&(console.info?console.info(i):console.log(i))}static w(e,t){e&&!m.FORCE_GLOBAL_TAG||(e=m.GLOBAL_TAG);let i=`[${e}] > ${t}`;m.ENABLE_CALLBACK&&m.emitter.emit("log","warn",i),m.ENABLE_WARN&&(console.warn?console.warn(i):console.log(i))}static d(e,t){e&&!m.FORCE_GLOBAL_TAG||(e=m.GLOBAL_TAG);let i=`[${e}] > ${t}`;m.ENABLE_CALLBACK&&m.emitter.emit("log","debug",i),m.ENABLE_DEBUG&&(console.debug?console.debug(i):console.log(i))}static v(e,t){e&&!m.FORCE_GLOBAL_TAG||(e=m.GLOBAL_TAG);let i=`[${e}] > ${t}`;m.ENABLE_CALLBACK&&m.emitter.emit("log","verbose",i),m.ENABLE_VERBOSE&&console.log(i)}}m.GLOBAL_TAG="flv.js",m.FORCE_GLOBAL_TAG=!1,m.ENABLE_ERROR=!0,m.ENABLE_INFO=!0,m.ENABLE_WARN=!0,m.ENABLE_DEBUG=!0,m.ENABLE_VERBOSE=!0,m.ENABLE_CALLBACK=!1,m.emitter=new p.a;var f=m;class _{constructor(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}reset(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}addBytes(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())}get currentKBps(){this.addBytes(0);let e=(this._now()-this._lastCheckpoint)/1e3;return 0==e&&(e=1),this._intervalBytes/e/1024}get lastSecondKBps(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}get averageKBps(){let e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024}}var y=_;class g{constructor(e){this._message=e}get name(){return"RuntimeException"}get message(){return this._message}toString(){return this.name+": "+this.message}}class v extends g{constructor(e){super(e)}get name(){return"IllegalStateException"}}class b extends g{constructor(e){super(e)}get name(){return"InvalidArgumentException"}}class E extends g{constructor(e){super(e)}get name(){return"NotImplementedException"}}const w={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},S={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"};class k{constructor(e){this._type=e||"undefined",this._status=w.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}destroy(){this._status=w.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}isWorking(){return this._status===w.kConnecting||this._status===w.kBuffering}get type(){return this._type}get status(){return this._status}get needStashBuffer(){return this._needStash}get onContentLengthKnown(){return this._onContentLengthKnown}set onContentLengthKnown(e){this._onContentLengthKnown=e}get onURLRedirect(){return this._onURLRedirect}set onURLRedirect(e){this._onURLRedirect=e}get onDataArrival(){return this._onDataArrival}set onDataArrival(e){this._onDataArrival=e}get onError(){return this._onError}set onError(e){this._onError=e}get onComplete(){return this._onComplete}set onComplete(e){this._onComplete=e}open(e,t){throw new E("Unimplemented abstract function!")}abort(){throw new E("Unimplemented abstract function!")}}let L={};function A(){let e=self.navigator.userAgent.toLowerCase(),t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],i=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],n={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:i[0]||""},s={};if(n.browser){s[n.browser]=!0;let e=n.majorVersion.split(".");s.version={major:parseInt(n.majorVersion,10),string:n.version},e.length>1&&(s.version.minor=parseInt(e[1],10)),e.length>2&&(s.version.build=parseInt(e[2],10))}if(n.platform&&(s[n.platform]=!0),(s.chrome||s.opr||s.safari)&&(s.webkit=!0),s.rv||s.iemobile){s.rv&&delete s.rv;let e="msie";n.browser=e,s[e]=!0}if(s.edge){delete s.edge;let e="msedge";n.browser=e,s[e]=!0}if(s.opr){let e="opera";n.browser=e,s[e]=!0}if(s.safari&&s.android){let e="android";n.browser=e,s[e]=!0}s.name=n.browser,s.platform=n.platform;for(let a in L)L.hasOwnProperty(a)&&delete L[a];Object.assign(L,s)}A();var T=L;class R extends k{static isSupported(){try{let e=T.msedge&&T.version.minor>=15048,t=!T.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(e){return!1}}constructor(e,t){super("fetch-stream-loader"),this.TAG="FetchStreamLoader",this._seekHandler=e,this._config=t,this._needStash=!0,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),super.destroy()}open(e,t){this._dataSource=e,this._range=t;let i=e.url;this._config.reuseRedirectedURL&&void 0!=e.redirectedURL&&(i=e.redirectedURL);let n=this._seekHandler.getConfig(i,t),s=new self.Headers;if("object"===typeof n.headers){let e=n.headers;for(let t in e)e.hasOwnProperty(t)&&s.append(t,e[t])}let a={method:"GET",headers:s,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"===typeof this._config.headers)for(let r in this._config.headers)s.append(r,this._config.headers[r]);!1===e.cors&&(a.mode="same-origin"),e.withCredentials&&(a.credentials="include"),e.referrerPolicy&&(a.referrerPolicy=e.referrerPolicy),this._status=w.kConnecting,self.fetch(n.url,a).then(e=>{if(this._requestAbort)return this._requestAbort=!1,void(this._status=w.kIdle);if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==n.url&&this._onURLRedirect){let t=this._seekHandler.removeURLParameters(e.url);this._onURLRedirect(t)}let t=e.headers.get("Content-Length");return null!=t&&(this._contentLength=parseInt(t),0!==this._contentLength&&this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)),this._pump.call(this,e.body.getReader())}if(this._status=w.kError,!this._onError)throw new g("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);this._onError(S.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})}).catch(e=>{if(this._status=w.kError,!this._onError)throw e;this._onError(S.EXCEPTION,{code:-1,msg:e.message})})}abort(){this._requestAbort=!0}_pump(e){return e.read().then(t=>{if(t.done)if(null!==this._contentLength&&this._receivedLength<this._contentLength){this._status=w.kError;let e=S.EARLY_EOF,t={code:-1,msg:"Fetch stream meet Early-EOF"};if(!this._onError)throw new g(t.msg);this._onError(e,t)}else this._status=w.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1);else{if(!0===this._requestAbort)return this._requestAbort=!1,this._status=w.kComplete,e.cancel();this._status=w.kBuffering;let i=t.value.buffer,n=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength,this._onDataArrival&&this._onDataArrival(i,n,this._receivedLength),this._pump(e)}}).catch(e=>{if(11===e.code&&T.msedge)return;this._status=w.kError;let t=0,i=null;if(19!==e.code&&"network error"!==e.message||!(null===this._contentLength||null!==this._contentLength&&this._receivedLength<this._contentLength)?(t=S.EXCEPTION,i={code:e.code,msg:e.message}):(t=S.EARLY_EOF,i={code:e.code,msg:"Fetch stream meet Early-EOF"}),!this._onError)throw new g(i.msg);this._onError(t,i)})}}var C=R;class x extends k{static isSupported(){try{let e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch(e){return f.w("MozChunkedLoader",e.message),!1}}constructor(e,t){super("xhr-moz-chunked-loader"),this.TAG="MozChunkedLoader",this._seekHandler=e,this._config=t,this._needStash=!0,this._xhr=null,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}open(e,t){this._dataSource=e,this._range=t;let i=e.url;this._config.reuseRedirectedURL&&void 0!=e.redirectedURL&&(i=e.redirectedURL);let n=this._seekHandler.getConfig(i,t);this._requestURL=n.url;let s=this._xhr=new XMLHttpRequest;if(s.open("GET",n.url,!0),s.responseType="moz-chunked-arraybuffer",s.onreadystatechange=this._onReadyStateChange.bind(this),s.onprogress=this._onProgress.bind(this),s.onloadend=this._onLoadEnd.bind(this),s.onerror=this._onXhrError.bind(this),e.withCredentials&&(s.withCredentials=!0),"object"===typeof n.headers){let e=n.headers;for(let t in e)e.hasOwnProperty(t)&&s.setRequestHeader(t,e[t])}if("object"===typeof this._config.headers){let e=this._config.headers;for(let t in e)e.hasOwnProperty(t)&&s.setRequestHeader(t,e[t])}this._status=w.kConnecting,s.send()}abort(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=w.kComplete}_onReadyStateChange(e){let t=e.target;if(2===t.readyState){if(void 0!=t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){let e=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(e)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=w.kError,!this._onError)throw new g("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(S.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=w.kBuffering}}_onProgress(e){if(this._status===w.kError)return;null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));let t=e.target.response,i=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)}_onLoadEnd(e){!0!==this._requestAbort?this._status!==w.kError&&(this._status=w.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1}_onXhrError(e){this._status=w.kError;let t=0,i=null;if(this._contentLength&&e.loaded<this._contentLength?(t=S.EARLY_EOF,i={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(t=S.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new g(i.msg);this._onError(t,i)}}var M=x;class I extends k{static isSupported(){try{let e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="arraybuffer","arraybuffer"===e.responseType}catch(e){return f.w("RangeLoader",e.message),!1}}constructor(e,t){super("xhr-range-loader"),this.TAG="RangeLoader",this._seekHandler=e,this._config=t,this._needStash=!1,this._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],this._currentChunkSizeKB=384,this._currentSpeedNormalized=0,this._zeroSpeedChunkCount=0,this._xhr=null,this._speedSampler=new y,this._requestAbort=!1,this._waitForTotalLength=!1,this._totalLengthReceived=!1,this._currentRequestURL=null,this._currentRedirectedURL=null,this._currentRequestRange=null,this._totalLength=null,this._contentLength=null,this._receivedLength=0,this._lastTimeLoaded=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}get currentSpeed(){return this._speedSampler.lastSecondKBps}open(e,t){this._dataSource=e,this._range=t,this._status=w.kConnecting;let i=!1;void 0!=this._dataSource.filesize&&0!==this._dataSource.filesize&&(i=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||i?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))}_openSubRange(){let e=1024*this._currentChunkSizeKB,t=this._range.from+this._receivedLength,i=t+e;null!=this._contentLength&&i-this._range.from>=this._contentLength&&(i=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:i},this._internalOpen(this._dataSource,this._currentRequestRange)}_internalOpen(e,t){this._lastTimeLoaded=0;let i=e.url;this._config.reuseRedirectedURL&&(void 0!=this._currentRedirectedURL?i=this._currentRedirectedURL:void 0!=e.redirectedURL&&(i=e.redirectedURL));let n=this._seekHandler.getConfig(i,t);this._currentRequestURL=n.url;let s=this._xhr=new XMLHttpRequest;if(s.open("GET",n.url,!0),s.responseType="arraybuffer",s.onreadystatechange=this._onReadyStateChange.bind(this),s.onprogress=this._onProgress.bind(this),s.onload=this._onLoad.bind(this),s.onerror=this._onXhrError.bind(this),e.withCredentials&&(s.withCredentials=!0),"object"===typeof n.headers){let e=n.headers;for(let t in e)e.hasOwnProperty(t)&&s.setRequestHeader(t,e[t])}if("object"===typeof this._config.headers){let e=this._config.headers;for(let t in e)e.hasOwnProperty(t)&&s.setRequestHeader(t,e[t])}s.send()}abort(){this._requestAbort=!0,this._internalAbort(),this._status=w.kComplete}_internalAbort(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}_onReadyStateChange(e){let t=e.target;if(2===t.readyState){if(void 0!=t.responseURL){let e=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&e!==this._currentRedirectedURL&&(this._currentRedirectedURL=e,this._onURLRedirect&&this._onURLRedirect(e))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=w.kBuffering}else{if(this._status=w.kError,!this._onError)throw new g("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(S.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}}_onProgress(e){if(this._status===w.kError)return;if(null===this._contentLength){let t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;let i=e.total;this._internalAbort(),null!=i&0!==i&&(this._totalLength=i)}if(-1===this._range.to?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}let t=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(t)}_normalizeSpeed(e){let t=this._chunkSizeKBList,i=t.length-1,n=0,s=0,a=i;if(e<t[0])return t[0];while(s<=a){if(n=s+Math.floor((a-s)/2),n===i||e>=t[n]&&e<t[n+1])return t[n];t[n]<e?s=n+1:a=n-1}}_onLoad(e){if(this._status===w.kError)return;if(this._waitForTotalLength)return void(this._waitForTotalLength=!1);this._lastTimeLoaded=0;let t=this._speedSampler.lastSecondKBps;if(0===t&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(t=this._speedSampler.currentKBps)),0!==t){let e=this._normalizeSpeed(t);this._currentSpeedNormalized!==e&&(this._currentSpeedNormalized=e,this._currentChunkSizeKB=e)}let i=e.target.response,n=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength;let s=!1;null!=this._contentLength&&this._receivedLength<this._contentLength?this._openSubRange():s=!0,this._onDataArrival&&this._onDataArrival(i,n,this._receivedLength),s&&(this._status=w.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}_onXhrError(e){this._status=w.kError;let t=0,i=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(t=S.EARLY_EOF,i={code:-1,msg:"RangeLoader meet Early-Eof"}):(t=S.EXCEPTION,i={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new g(i.msg);this._onError(t,i)}}var D=I;class O extends k{static isSupported(){try{return"undefined"!==typeof self.WebSocket}catch(e){return!1}}constructor(){super("websocket-loader"),this.TAG="WebSocketLoader",this._needStash=!0,this._ws=null,this._requestAbort=!1,this._receivedLength=0}destroy(){this._ws&&this.abort(),super.destroy()}open(e){try{let t=this._ws=new self.WebSocket(e.url);t.binaryType="arraybuffer",t.onopen=this._onWebSocketOpen.bind(this),t.onclose=this._onWebSocketClose.bind(this),t.onmessage=this._onWebSocketMessage.bind(this),t.onerror=this._onWebSocketError.bind(this),this._status=w.kConnecting}catch(t){this._status=w.kError;let e={code:t.code,msg:t.message};if(!this._onError)throw new g(e.msg);this._onError(S.EXCEPTION,e)}}abort(){let e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=w.kComplete}_onWebSocketOpen(e){this._status=w.kBuffering}_onWebSocketClose(e){!0!==this._requestAbort?(this._status=w.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)):this._requestAbort=!1}_onWebSocketMessage(e){if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){let t=new FileReader;t.onload=()=>{this._dispatchArrayBuffer(t.result)},t.readAsArrayBuffer(e.data)}else{this._status=w.kError;let t={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new g(t.msg);this._onError(S.EXCEPTION,t)}}_dispatchArrayBuffer(e){let t=e,i=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)}_onWebSocketError(e){this._status=w.kError;let t={code:e.code,msg:e.message};if(!this._onError)throw new g(t.msg);this._onError(S.EXCEPTION,t)}}var B=O;class P{constructor(e){this._zeroStart=e||!1}getConfig(e,t){let i={};if(0!==t.from||-1!==t.to){let e;e=-1!==t.to?`bytes=${t.from.toString()}-${t.to.toString()}`:`bytes=${t.from.toString()}-`,i["Range"]=e}else this._zeroStart&&(i["Range"]="bytes=0-");return{url:e,headers:i}}removeURLParameters(e){return e}}var U=P;class N{constructor(e,t){this._startName=e,this._endName=t}getConfig(e,t){let i=e;if(0!==t.from||-1!==t.to){let e=!0;-1===i.indexOf("?")&&(i+="?",e=!1),e&&(i+="&"),i+=`${this._startName}=${t.from.toString()}`,-1!==t.to&&(i+=`&${this._endName}=${t.to.toString()}`)}return{url:i,headers:{}}}removeURLParameters(e){let t=e.split("?")[0],i=void 0,n=e.indexOf("?");-1!==n&&(i=e.substring(n+1));let s="";if(void 0!=i&&i.length>0){let e=i.split("&");for(let t=0;t<e.length;t++){let i=e[t].split("="),n=t>0;i[0]!==this._startName&&i[0]!==this._endName&&(n&&(s+="&"),s+=e[t])}}return 0===s.length?t:t+"?"+s}}var F=N;class q{constructor(e,t,i){this.TAG="IOController",this._config=t,this._extraData=i,this._stashInitialSize=393216,void 0!=t.stashInitialSize&&t.stashInitialSize>0&&(this._stashInitialSize=t.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===t.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new y,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}destroy(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}isWorking(){return this._loader&&this._loader.isWorking()&&!this._paused}isPaused(){return this._paused}get status(){return this._loader.status}get extraData(){return this._extraData}set extraData(e){this._extraData=e}get onDataArrival(){return this._onDataArrival}set onDataArrival(e){this._onDataArrival=e}get onSeeked(){return this._onSeeked}set onSeeked(e){this._onSeeked=e}get onError(){return this._onError}set onError(e){this._onError=e}get onComplete(){return this._onComplete}set onComplete(e){this._onComplete=e}get onRedirect(){return this._onRedirect}set onRedirect(e){this._onRedirect=e}get onRecoveredEarlyEof(){return this._onRecoveredEarlyEof}set onRecoveredEarlyEof(e){this._onRecoveredEarlyEof=e}get currentURL(){return this._dataSource.url}get hasRedirect(){return null!=this._redirectedURL||void 0!=this._dataSource.redirectedURL}get currentRedirectedURL(){return this._redirectedURL||this._dataSource.redirectedURL}get currentSpeed(){return this._loaderClass===D?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}get loaderType(){return this._loader.type}_selectSeekHandler(){let e=this._config;if("range"===e.seekType)this._seekHandler=new U(this._config.rangeLoadZeroStart);else if("param"===e.seekType){let t=e.seekParamStart||"bstart",i=e.seekParamEnd||"bend";this._seekHandler=new F(t,i)}else{if("custom"!==e.seekType)throw new b("Invalid seekType in config: "+e.seekType);if("function"!==typeof e.customSeekHandler)throw new b("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}}_selectLoader(){if(null!=this._config.customLoader)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=B;else if(C.isSupported())this._loaderClass=C;else if(M.isSupported())this._loaderClass=M;else{if(!D.isSupported())throw new g("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=D}}_createLoader(){this._loader=new this._loaderClass(this._seekHandler,this._config),!1===this._loader.needStashBuffer&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}open(e){this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),this._speedSampler.reset(),e||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}abort(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}pause(){this.isWorking()&&(this._loader.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}resume(){if(this._paused){this._paused=!1;let e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}}seek(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)}_internalSeek(e,t){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(t),this._loader.destroy(),this._loader=null;let i={from:e,to:-1};this._currentRange={from:i.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,i),this._onSeeked&&this._onSeeked()}updateUrl(e){if(!e||"string"!==typeof e||0===e.length)throw new b("Url must be a non-empty string!");this._dataSource.url=e}_expandBuffer(e){let t=this._stashSize;while(t+1048576<e)t*=2;if(t+=1048576,t===this._bufferSize)return;let i=new ArrayBuffer(t);if(this._stashUsed>0){let e=new Uint8Array(this._stashBuffer,0,this._stashUsed),n=new Uint8Array(i,0,t);n.set(e,0)}this._stashBuffer=i,this._bufferSize=t}_normalizeSpeed(e){let t=this._speedNormalizeList,i=t.length-1,n=0,s=0,a=i;if(e<t[0])return t[0];while(s<=a){if(n=s+Math.floor((a-s)/2),n===i||e>=t[n]&&e<t[n+1])return t[n];t[n]<e?s=n+1:a=n-1}}_adjustStashSize(e){let t=0;t=this._config.isLive||e<512?e:e>=512&&e<=1024?Math.floor(1.5*e):2*e,t>8192&&(t=8192);let i=1024*t+1048576;this._bufferSize<i&&this._expandBuffer(i),this._stashSize=1024*t}_dispatchChunks(e,t){return this._currentRange.to=t+e.byteLength-1,this._onDataArrival(e,t)}_onURLRedirect(e){this._redirectedURL=e,this._onRedirect&&this._onRedirect(e)}_onContentLengthKnown(e){e&&this._fullRequestFlag&&(this._totalLength=e,this._fullRequestFlag=!1)}_onLoaderChunkArrival(e,t,i){if(!this._onDataArrival)throw new v("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(e.byteLength);let n=this._speedSampler.lastSecondKBps;if(0!==n){let e=this._normalizeSpeed(n);this._speedNormalized!==e&&(this._speedNormalized=e,this._adjustStashSize(e))}if(this._enableStash)if(0===this._stashUsed&&0===this._stashByteStart&&(this._stashByteStart=t),this._stashUsed+e.byteLength<=this._stashSize){let t=new Uint8Array(this._stashBuffer,0,this._stashSize);t.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{let i=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){let t=this._stashBuffer.slice(0,this._stashUsed),n=this._dispatchChunks(t,this._stashByteStart);if(n<t.byteLength){if(n>0){let e=new Uint8Array(t,n);i.set(e,0),this._stashUsed=e.byteLength,this._stashByteStart+=n}}else this._stashUsed=0,this._stashByteStart+=n;this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),i=new Uint8Array(this._stashBuffer,0,this._bufferSize)),i.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{let n=this._dispatchChunks(e,t);if(n<e.byteLength){let s=e.byteLength-n;s>this._bufferSize&&(this._expandBuffer(s),i=new Uint8Array(this._stashBuffer,0,this._bufferSize)),i.set(new Uint8Array(e,n),0),this._stashUsed+=s,this._stashByteStart=t+n}}}else if(0===this._stashUsed){let i=this._dispatchChunks(e,t);if(i<e.byteLength){let n=e.byteLength-i;n>this._bufferSize&&this._expandBuffer(n);let s=new Uint8Array(this._stashBuffer,0,this._bufferSize);s.set(new Uint8Array(e,i),0),this._stashUsed+=n,this._stashByteStart=t+i}}else{this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength);let t=new Uint8Array(this._stashBuffer,0,this._bufferSize);t.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;let i=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(i<this._stashUsed&&i>0){let e=new Uint8Array(this._stashBuffer,i);t.set(e,0)}this._stashUsed-=i,this._stashByteStart+=i}}_flushStashBuffer(e){if(this._stashUsed>0){let t=this._stashBuffer.slice(0,this._stashUsed),i=this._dispatchChunks(t,this._stashByteStart),n=t.byteLength-i;if(i<t.byteLength){if(!e){if(i>0){let e=new Uint8Array(this._stashBuffer,0,this._bufferSize),n=new Uint8Array(t,i);e.set(n,0),this._stashUsed=n.byteLength,this._stashByteStart+=i}return 0}f.w(this.TAG,n+" bytes unconsumed data remain when flush buffer, dropped")}return this._stashUsed=0,this._stashByteStart=0,n}return 0}_onLoaderComplete(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}_onLoaderError(e,t){switch(f.e(this.TAG,`Loader error, code = ${t.code}, msg = ${t.msg}`),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=S.UNRECOVERABLE_EARLY_EOF),e){case S.EARLY_EOF:if(!this._config.isLive&&this._totalLength){let e=this._currentRange.to+1;return void(e<this._totalLength&&(f.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(e,!1)))}e=S.UNRECOVERABLE_EARLY_EOF;break;case S.UNRECOVERABLE_EARLY_EOF:case S.CONNECTING_TIMEOUT:case S.HTTP_STATUS_CODE_INVALID:case S.EXCEPTION:break}if(!this._onError)throw new g("IOException: "+t.msg);this._onError(e,t)}}var V=q;const z={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function j(){return Object.assign({},z)}class G{static supportMSEH264Playback(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}static supportNetworkStreamIO(){let e=new V({},j()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"==t||"xhr-moz-chunked-loader"==t}static getNetworkLoaderTypeName(){let e=new V({},j()),t=e.loaderType;return e.destroy(),t}static supportNativeMediaPlayback(e){void 0==G.videoElement&&(G.videoElement=window.document.createElement("video"));let t=G.videoElement.canPlayType(e);return"probably"===t||"maybe"==t}static getFeatureList(){let e={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return e.mseFlvPlayback=G.supportMSEH264Playback(),e.networkStreamIO=G.supportNetworkStreamIO(),e.networkLoaderName=G.getNetworkLoaderTypeName(),e.mseLiveFlvPlayback=e.mseFlvPlayback&&e.networkStreamIO,e.nativeMP4H264Playback=G.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),e.nativeWebmVP8Playback=G.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),e.nativeWebmVP9Playback=G.supportNativeMediaPlayback('video/webm; codecs="vp9"'),e}}var H=G;const W={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"};var $=W;class K{static get forceGlobalTag(){return f.FORCE_GLOBAL_TAG}static set forceGlobalTag(e){f.FORCE_GLOBAL_TAG=e,K._notifyChange()}static get globalTag(){return f.GLOBAL_TAG}static set globalTag(e){f.GLOBAL_TAG=e,K._notifyChange()}static get enableAll(){return f.ENABLE_VERBOSE&&f.ENABLE_DEBUG&&f.ENABLE_INFO&&f.ENABLE_WARN&&f.ENABLE_ERROR}static set enableAll(e){f.ENABLE_VERBOSE=e,f.ENABLE_DEBUG=e,f.ENABLE_INFO=e,f.ENABLE_WARN=e,f.ENABLE_ERROR=e,K._notifyChange()}static get enableDebug(){return f.ENABLE_DEBUG}static set enableDebug(e){f.ENABLE_DEBUG=e,K._notifyChange()}static get enableVerbose(){return f.ENABLE_VERBOSE}static set enableVerbose(e){f.ENABLE_VERBOSE=e,K._notifyChange()}static get enableInfo(){return f.ENABLE_INFO}static set enableInfo(e){f.ENABLE_INFO=e,K._notifyChange()}static get enableWarn(){return f.ENABLE_WARN}static set enableWarn(e){f.ENABLE_WARN=e,K._notifyChange()}static get enableError(){return f.ENABLE_ERROR}static set enableError(e){f.ENABLE_ERROR=e,K._notifyChange()}static getConfig(){return{globalTag:f.GLOBAL_TAG,forceGlobalTag:f.FORCE_GLOBAL_TAG,enableVerbose:f.ENABLE_VERBOSE,enableDebug:f.ENABLE_DEBUG,enableInfo:f.ENABLE_INFO,enableWarn:f.ENABLE_WARN,enableError:f.ENABLE_ERROR,enableCallback:f.ENABLE_CALLBACK}}static applyConfig(e){f.GLOBAL_TAG=e.globalTag,f.FORCE_GLOBAL_TAG=e.forceGlobalTag,f.ENABLE_VERBOSE=e.enableVerbose,f.ENABLE_DEBUG=e.enableDebug,f.ENABLE_INFO=e.enableInfo,f.ENABLE_WARN=e.enableWarn,f.ENABLE_ERROR=e.enableError,f.ENABLE_CALLBACK=e.enableCallback}static _notifyChange(){let e=K.emitter;if(e.listenerCount("change")>0){let t=K.getConfig();e.emit("change",t)}}static registerListener(e){K.emitter.addListener("change",e)}static removeListener(e){K.emitter.removeListener("change",e)}static addLogListener(e){f.emitter.addListener("log",e),f.emitter.listenerCount("log")>0&&(f.ENABLE_CALLBACK=!0,K._notifyChange())}static removeLogListener(e){f.emitter.removeListener("log",e),0===f.emitter.listenerCount("log")&&(f.ENABLE_CALLBACK=!1,K._notifyChange())}}K.emitter=new p.a;var X=K;class Y{constructor(){this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}isComplete(){let e=!1===this.hasAudio||!0===this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&null!=this.audioChannelCount,t=!1===this.hasVideo||!0===this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&null!=this.sarDen;return null!=this.mimeType&&null!=this.duration&&null!=this.metadata&&null!=this.hasKeyframesIndex&&e&&t}isSeekable(){return!0===this.hasKeyframesIndex}getNearestKeyframe(e){if(null==this.keyframesIndex)return null;let t=this.keyframesIndex,i=this._search(t.times,e);return{index:i,milliseconds:t.times[i],fileposition:t.filepositions[i]}}_search(e,t){let i=0,n=e.length-1,s=0,a=0,r=n;t<e[0]&&(i=0,a=r+1);while(a<=r){if(s=a+Math.floor((r-a)/2),s===n||t>=e[s]&&t<e[s+1]){i=s;break}e[s]<t?a=s+1:r=s-1}return i}}var Q=Y;function J(e,t,i){let n=e;if(t+i<n.length){while(i--)if(128!==(192&n[++t]))return!1;return!0}return!1}function Z(e){let t=[],i=e,n=0,s=e.length;while(n<s)if(i[n]<128)t.push(String.fromCharCode(i[n])),++n;else{if(i[n]<192);else if(i[n]<224){if(J(i,n,1)){let e=(31&i[n])<<6|63&i[n+1];if(e>=128){t.push(String.fromCharCode(65535&e)),n+=2;continue}}}else if(i[n]<240){if(J(i,n,2)){let e=(15&i[n])<<12|(63&i[n+1])<<6|63&i[n+2];if(e>=2048&&55296!==(63488&e)){t.push(String.fromCharCode(65535&e)),n+=3;continue}}}else if(i[n]<248&&J(i,n,3)){let e=(7&i[n])<<18|(63&i[n+1])<<12|(63&i[n+2])<<6|63&i[n+3];if(e>65536&&e<1114112){e-=65536,t.push(String.fromCharCode(e>>>10|55296)),t.push(String.fromCharCode(1023&e|56320)),n+=4;continue}}t.push(String.fromCharCode(65533)),++n}return t.join("")}var ee=Z;let te=function(){let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}();class ie{static parseScriptData(e,t,i){let n={};try{let s=ie.parseValue(e,t,i),a=ie.parseValue(e,t+s.size,i-s.size);n[s.data]=a.data}catch(s){f.e("AMF",s.toString())}return n}static parseObject(e,t,i){if(i<3)throw new v("Data not enough when parse ScriptDataObject");let n=ie.parseString(e,t,i),s=ie.parseValue(e,t+n.size,i-n.size),a=s.objectEnd;return{data:{name:n.data,value:s.data},size:n.size+s.size,objectEnd:a}}static parseVariable(e,t,i){return ie.parseObject(e,t,i)}static parseString(e,t,i){if(i<2)throw new v("Data not enough when parse String");let n,s=new DataView(e,t,i),a=s.getUint16(0,!te);return n=a>0?ee(new Uint8Array(e,t+2,a)):"",{data:n,size:2+a}}static parseLongString(e,t,i){if(i<4)throw new v("Data not enough when parse LongString");let n,s=new DataView(e,t,i),a=s.getUint32(0,!te);return n=a>0?ee(new Uint8Array(e,t+4,a)):"",{data:n,size:4+a}}static parseDate(e,t,i){if(i<10)throw new v("Data size invalid when parse Date");let n=new DataView(e,t,i),s=n.getFloat64(0,!te),a=n.getInt16(8,!te);return s+=60*a*1e3,{data:new Date(s),size:10}}static parseValue(e,t,i){if(i<1)throw new v("Data not enough when parse Value");let n,s=new DataView(e,t,i),a=1,r=s.getUint8(0),o=!1;try{switch(r){case 0:n=s.getFloat64(1,!te),a+=8;break;case 1:{let e=s.getUint8(1);n=!!e,a+=1;break}case 2:{let s=ie.parseString(e,t+1,i-1);n=s.data,a+=s.size;break}case 3:{n={};let r=0;9===(16777215&s.getUint32(i-4,!te))&&(r=3);while(a<i-4){let s=ie.parseObject(e,t+a,i-a-r);if(s.objectEnd)break;n[s.data.name]=s.data.value,a+=s.size}if(a<=i-3){let e=16777215&s.getUint32(a-1,!te);9===e&&(a+=3)}break}case 8:{n={},a+=4;let r=0;9===(16777215&s.getUint32(i-4,!te))&&(r=3);while(a<i-8){let s=ie.parseVariable(e,t+a,i-a-r);if(s.objectEnd)break;n[s.data.name]=s.data.value,a+=s.size}if(a<=i-3){let e=16777215&s.getUint32(a-1,!te);9===e&&(a+=3)}break}case 9:n=void 0,a=1,o=!0;break;case 10:{n=[];let r=s.getUint32(1,!te);a+=4;for(let s=0;s<r;s++){let s=ie.parseValue(e,t+a,i-a);n.push(s.data),a+=s.size}break}case 11:{let s=ie.parseDate(e,t+1,i-1);n=s.data,a+=s.size;break}case 12:{let s=ie.parseString(e,t+1,i-1);n=s.data,a+=s.size;break}default:a=i,f.w("AMF","Unsupported AMF value type "+r)}}catch(l){f.e("AMF",l.toString())}return{data:n,size:a,objectEnd:o}}}var ne=ie;class se{constructor(e){this.TAG="ExpGolomb",this._buffer=e,this._buffer_index=0,this._total_bytes=e.byteLength,this._total_bits=8*e.byteLength,this._current_word=0,this._current_word_bits_left=0}destroy(){this._buffer=null}_fillCurrentWord(){let e=this._total_bytes-this._buffer_index;if(e<=0)throw new v("ExpGolomb: _fillCurrentWord() but no bytes available");let t=Math.min(4,e),i=new Uint8Array(4);i.set(this._buffer.subarray(this._buffer_index,this._buffer_index+t)),this._current_word=new DataView(i.buffer).getUint32(0,!1),this._buffer_index+=t,this._current_word_bits_left=8*t}readBits(e){if(e>32)throw new b("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){let t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}let t=this._current_word_bits_left?this._current_word:0;t>>>=32-this._current_word_bits_left;let i=e-this._current_word_bits_left;this._fillCurrentWord();let n=Math.min(i,this._current_word_bits_left),s=this._current_word>>>32-n;return this._current_word<<=n,this._current_word_bits_left-=n,t=t<<n|s,t}readBool(){return 1===this.readBits(1)}readByte(){return this.readBits(8)}_skipLeadingZero(){let e;for(e=0;e<this._current_word_bits_left;e++)if(0!==(this._current_word&2147483648>>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()}readUEG(){let e=this._skipLeadingZero();return this.readBits(e+1)-1}readSEG(){let e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)}}var ae=se;class re{static _ebsp2rbsp(e){let t=e,i=t.byteLength,n=new Uint8Array(i),s=0;for(let a=0;a<i;a++)a>=2&&3===t[a]&&0===t[a-1]&&0===t[a-2]||(n[s]=t[a],s++);return new Uint8Array(n.buffer,0,s)}static parseSPS(e){let t=re._ebsp2rbsp(e),i=new ae(t);i.readByte();let n=i.readByte();i.readByte();let s=i.readByte();i.readUEG();let a=re.getProfileString(n),r=re.getLevelString(s),o=1,l=420,d=[0,420,422,444],h=8;if((100===n||110===n||122===n||244===n||44===n||83===n||86===n||118===n||128===n||138===n||144===n)&&(o=i.readUEG(),3===o&&i.readBits(1),o<=3&&(l=d[o]),h=i.readUEG()+8,i.readUEG(),i.readBits(1),i.readBool())){let e=3!==o?8:12;for(let t=0;t<e;t++)i.readBool()&&(t<6?re._skipScalingList(i,16):re._skipScalingList(i,64))}i.readUEG();let u=i.readUEG();if(0===u)i.readUEG();else if(1===u){i.readBits(1),i.readSEG(),i.readSEG();let e=i.readUEG();for(let t=0;t<e;t++)i.readSEG()}let c=i.readUEG();i.readBits(1);let p=i.readUEG(),m=i.readUEG(),f=i.readBits(1);0===f&&i.readBits(1),i.readBits(1);let _=0,y=0,g=0,v=0,b=i.readBool();b&&(_=i.readUEG(),y=i.readUEG(),g=i.readUEG(),v=i.readUEG());let E=1,w=1,S=0,k=!0,L=0,A=0,T=i.readBool();if(T){if(i.readBool()){let e=i.readByte(),t=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],n=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];e>0&&e<16?(E=t[e-1],w=n[e-1]):255===e&&(E=i.readByte()<<8|i.readByte(),w=i.readByte()<<8|i.readByte())}if(i.readBool()&&i.readBool(),i.readBool()&&(i.readBits(4),i.readBool()&&i.readBits(24)),i.readBool()&&(i.readUEG(),i.readUEG()),i.readBool()){let e=i.readBits(32),t=i.readBits(32);k=i.readBool(),L=t,A=2*e,S=L/A}}let R=1;1===E&&1===w||(R=E/w);let C=0,x=0;if(0===o)C=1,x=2-f;else{let e=3===o?1:2,t=1===o?2:1;C=e,x=t*(2-f)}let M=16*(p+1),I=16*(m+1)*(2-f);M-=(_+y)*C,I-=(g+v)*x;let D=Math.ceil(M*R);return i.destroy(),i=null,{profile_string:a,level_string:r,bit_depth:h,ref_frames:c,chroma_format:l,chroma_format_string:re.getChromaFormatString(l),frame_rate:{fixed:k,fps:S,fps_den:A,fps_num:L},sar_ratio:{width:E,height:w},codec_size:{width:M,height:I},present_size:{width:D,height:I}}}static _skipScalingList(e,t){let i=8,n=8,s=0;for(let a=0;a<t;a++)0!==n&&(s=e.readSEG(),n=(i+s+256)%256),i=0===n?i:n}static getProfileString(e){switch(e){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}static getLevelString(e){return(e/10).toFixed(1)}static getChromaFormatString(e){switch(e){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}var oe=re;const le={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};var de=le;function he(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}class ue{constructor(e,t){this.TAG="FLVDemuxer",this._config=t,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=e.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=e.hasAudioTrack,this._hasVideo=e.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new Q,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}()}destroy(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}static probe(e){let t=new Uint8Array(e),i={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return i;let n=(4&t[4])>>>2!==0,s=0!==(1&t[4]),a=he(t,5);return a<9?i:{match:!0,consumed:a,dataOffset:a,hasAudioTrack:n,hasVideoTrack:s}}bindDataSource(e){return e.onDataArrival=this.parseChunks.bind(this),this}get onTrackMetadata(){return this._onTrackMetadata}set onTrackMetadata(e){this._onTrackMetadata=e}get onMediaInfo(){return this._onMediaInfo}set onMediaInfo(e){this._onMediaInfo=e}get onMetaDataArrived(){return this._onMetaDataArrived}set onMetaDataArrived(e){this._onMetaDataArrived=e}get onScriptDataArrived(){return this._onScriptDataArrived}set onScriptDataArrived(e){this._onScriptDataArrived=e}get onError(){return this._onError}set onError(e){this._onError=e}get onDataAvailable(){return this._onDataAvailable}set onDataAvailable(e){this._onDataAvailable=e}get timestampBase(){return this._timestampBase}set timestampBase(e){this._timestampBase=e}get overridedDuration(){return this._duration}set overridedDuration(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e}set overridedHasAudio(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e}set overridedHasVideo(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e}resetMediaInfo(){this._mediaInfo=new Q}_isInitialMetadataDispatched(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched}parseChunks(e,t){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new v("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");let i=0,n=this._littleEndian;if(0===t){if(!(e.byteLength>13))return 0;{let t=ue.probe(e);i=t.dataOffset}}if(this._firstParse){this._firstParse=!1,t+i!==this._dataOffset&&f.w(this.TAG,"First time parsing but chunk byteStart invalid!");let s=new DataView(e,i),a=s.getUint32(0,!n);0!==a&&f.w(this.TAG,"PrevTagSize0 !== 0 !!!"),i+=4}while(i<e.byteLength){this._dispatch=!0;let s=new DataView(e,i);if(i+11+4>e.byteLength)break;let a=s.getUint8(0),r=16777215&s.getUint32(0,!n);if(i+11+r+4>e.byteLength)break;if(8!==a&&9!==a&&18!==a){f.w(this.TAG,`Unsupported tag type ${a}, skipped`),i+=11+r+4;continue}let o=s.getUint8(4),l=s.getUint8(5),d=s.getUint8(6),h=s.getUint8(7),u=d|l<<8|o<<16|h<<24,c=16777215&s.getUint32(7,!n);0!==c&&f.w(this.TAG,"Meet tag which has StreamID != 0!");let p=i+11;switch(a){case 8:this._parseAudioData(e,p,r,u);break;case 9:this._parseVideoData(e,p,r,u,t+i);break;case 18:this._parseScriptData(e,p,r);break}let m=s.getUint32(11+r,!n);m!==11+r&&f.w(this.TAG,"Invalid PrevTagSize "+m),i+=11+r+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),i}_parseScriptData(e,t,i){let n=ne.parseScriptData(e,t,i);if(n.hasOwnProperty("onMetaData")){if(null==n.onMetaData||"object"!==typeof n.onMetaData)return void f.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&f.w(this.TAG,"Found another onMetaData tag!"),this._metadata=n;let e=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},e)),"boolean"===typeof e.hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=e.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"===typeof e.hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=e.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"===typeof e.audiodatarate&&(this._mediaInfo.audioDataRate=e.audiodatarate),"number"===typeof e.videodatarate&&(this._mediaInfo.videoDataRate=e.videodatarate),"number"===typeof e.width&&(this._mediaInfo.width=e.width),"number"===typeof e.height&&(this._mediaInfo.height=e.height),"number"===typeof e.duration){if(!this._durationOverrided){let t=Math.floor(e.duration*this._timescale);this._duration=t,this._mediaInfo.duration=t}}else this._mediaInfo.duration=0;if("number"===typeof e.framerate){let t=Math.floor(1e3*e.framerate);if(t>0){let e=t/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=e,this._referenceFrameRate.fps_num=t,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=e}}if("object"===typeof e.keyframes){this._mediaInfo.hasKeyframesIndex=!0;let t=e.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(t),e.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=e,f.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(n).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},n))}_parseKeyframesIndex(e){let t=[],i=[];for(let n=1;n<e.times.length;n++){let s=this._timestampBase+Math.floor(1e3*e.times[n]);t.push(s),i.push(e.filepositions[n])}return{times:t,filepositions:i}}_parseAudioData(e,t,i,n){if(i<=1)return void f.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");if(!0===this._hasAudioFlagOverrided&&!1===this._hasAudio)return;this._littleEndian;let s=new DataView(e,t,i),a=s.getUint8(0),r=a>>>4;if(2!==r&&10!==r)return void this._onError(de.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+r);let o=0,l=(12&a)>>>2;if(!(l>=0&&l<=4))return void this._onError(de.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+l);o=this._flvSoundRateTable[l];let d=1&a,h=this._audioMetadata,u=this._audioTrack;if(h||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),h=this._audioMetadata={},h.type="audio",h.id=u.id,h.timescale=this._timescale,h.duration=this._duration,h.audioSampleRate=o,h.channelCount=0===d?1:2),10===r){let s=this._parseAACAudioData(e,t+1,i-1);if(void 0==s)return;if(0===s.packetType){h.config&&f.w(this.TAG,"Found another AudioSpecificConfig!");let e=s.data;h.audioSampleRate=e.samplingRate,h.channelCount=e.channelCount,h.codec=e.codec,h.originalCodec=e.originalCodec,h.config=e.config,h.refSampleDuration=1024/h.audioSampleRate*h.timescale,f.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",h);let t=this._mediaInfo;t.audioCodec=h.originalCodec,t.audioSampleRate=h.audioSampleRate,t.audioChannelCount=h.channelCount,t.hasVideo?null!=t.videoCodec&&(t.mimeType='video/x-flv; codecs="'+t.videoCodec+","+t.audioCodec+'"'):t.mimeType='video/x-flv; codecs="'+t.audioCodec+'"',t.isComplete()&&this._onMediaInfo(t)}else if(1===s.packetType){let e=this._timestampBase+n,t={unit:s.data,length:s.data.byteLength,dts:e,pts:e};u.samples.push(t),u.length+=s.data.length}else f.e(this.TAG,"Flv: Unsupported AAC data type "+s.packetType)}else if(2===r){if(!h.codec){let n=this._parseMP3AudioData(e,t+1,i-1,!0);if(void 0==n)return;h.audioSampleRate=n.samplingRate,h.channelCount=n.channelCount,h.codec=n.codec,h.originalCodec=n.originalCodec,h.refSampleDuration=1152/h.audioSampleRate*h.timescale,f.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",h);let s=this._mediaInfo;s.audioCodec=h.codec,s.audioSampleRate=h.audioSampleRate,s.audioChannelCount=h.channelCount,s.audioDataRate=n.bitRate,s.hasVideo?null!=s.videoCodec&&(s.mimeType='video/x-flv; codecs="'+s.videoCodec+","+s.audioCodec+'"'):s.mimeType='video/x-flv; codecs="'+s.audioCodec+'"',s.isComplete()&&this._onMediaInfo(s)}let s=this._parseMP3AudioData(e,t+1,i-1,!1);if(void 0==s)return;let a=this._timestampBase+n,r={unit:s,length:s.byteLength,dts:a,pts:a};u.samples.push(r),u.length+=s.length}}_parseAACAudioData(e,t,i){if(i<=1)return void f.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");let n={},s=new Uint8Array(e,t,i);return n.packetType=s[0],0===s[0]?n.data=this._parseAACAudioSpecificConfig(e,t+1,i-1):n.data=s.subarray(1),n}_parseAACAudioSpecificConfig(e,t,i){let n=new Uint8Array(e,t,i),s=null,a=0,r=0,o=null,l=0,d=null;if(a=r=n[0]>>>3,l=(7&n[0])<<1|n[1]>>>7,l<0||l>=this._mpegSamplingRates.length)return void this._onError(de.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");let h=this._mpegSamplingRates[l],u=(120&n[1])>>>3;if(u<0||u>=8)return void this._onError(de.FORMAT_ERROR,"Flv: AAC invalid channel configuration");5===a&&(d=(7&n[1])<<1|n[2]>>>7,o=(124&n[2])>>>2);let c=self.navigator.userAgent.toLowerCase();return-1!==c.indexOf("firefox")?l>=6?(a=5,s=new Array(4),d=l-3):(a=2,s=new Array(2),d=l):-1!==c.indexOf("android")?(a=2,s=new Array(2),d=l):(a=5,d=l,s=new Array(4),l>=6?d=l-3:1===u&&(a=2,s=new Array(2),d=l)),s[0]=a<<3,s[0]|=(15&l)>>>1,s[1]=(15&l)<<7,s[1]|=(15&u)<<3,5===a&&(s[1]|=(15&d)>>>1,s[2]=(1&d)<<7,s[2]|=8,s[3]=0),{config:s,samplingRate:h,channelCount:u,codec:"mp4a.40."+a,originalCodec:"mp4a.40."+r}}_parseMP3AudioData(e,t,i,n){if(i<4)return void f.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");this._littleEndian;let s=new Uint8Array(e,t,i),a=null;if(n){if(255!==s[0])return;let e=s[1]>>>3&3,t=(6&s[1])>>1,i=(240&s[2])>>>4,n=(12&s[2])>>>2,r=s[3]>>>6&3,o=3!==r?2:1,l=0,d=0,h=34,u="mp3";switch(e){case 0:l=this._mpegAudioV25SampleRateTable[n];break;case 2:l=this._mpegAudioV20SampleRateTable[n];break;case 3:l=this._mpegAudioV10SampleRateTable[n];break}switch(t){case 1:h=34,i<this._mpegAudioL3BitRateTable.length&&(d=this._mpegAudioL3BitRateTable[i]);break;case 2:h=33,i<this._mpegAudioL2BitRateTable.length&&(d=this._mpegAudioL2BitRateTable[i]);break;case 3:h=32,i<this._mpegAudioL1BitRateTable.length&&(d=this._mpegAudioL1BitRateTable[i]);break}a={bitRate:d,samplingRate:l,channelCount:o,codec:u,originalCodec:u}}else a=s;return a}_parseVideoData(e,t,i,n,s){if(i<=1)return void f.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");if(!0===this._hasVideoFlagOverrided&&!1===this._hasVideo)return;let a=new Uint8Array(e,t,i)[0],r=(240&a)>>>4,o=15&a;7===o?this._parseAVCVideoPacket(e,t+1,i-1,n,s,r):this._onError(de.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+o)}_parseAVCVideoPacket(e,t,i,n,s,a){if(i<4)return void f.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");let r=this._littleEndian,o=new DataView(e,t,i),l=o.getUint8(0),d=16777215&o.getUint32(0,!r),h=d<<8>>8;if(0===l)this._parseAVCDecoderConfigurationRecord(e,t+4,i-4);else if(1===l)this._parseAVCVideoData(e,t+4,i-4,n,s,a,h);else if(2!==l)return void this._onError(de.FORMAT_ERROR,"Flv: Invalid video packet type "+l)}_parseAVCDecoderConfigurationRecord(e,t,i){if(i<7)return void f.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");let n=this._videoMetadata,s=this._videoTrack,a=this._littleEndian,r=new DataView(e,t,i);n?"undefined"!==typeof n.avcc&&f.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),n=this._videoMetadata={},n.type="video",n.id=s.id,n.timescale=this._timescale,n.duration=this._duration);let o=r.getUint8(0),l=r.getUint8(1);r.getUint8(2),r.getUint8(3);if(1!==o||0===l)return void this._onError(de.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");if(this._naluLengthSize=1+(3&r.getUint8(4)),3!==this._naluLengthSize&&4!==this._naluLengthSize)return void this._onError(de.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: "+(this._naluLengthSize-1));let d=31&r.getUint8(5);if(0===d)return void this._onError(de.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");d>1&&f.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = "+d);let h=6;for(let c=0;c<d;c++){let i=r.getUint16(h,!a);if(h+=2,0===i)continue;let s=new Uint8Array(e,t+h,i);h+=i;let o=oe.parseSPS(s);if(0!==c)continue;n.codecWidth=o.codec_size.width,n.codecHeight=o.codec_size.height,n.presentWidth=o.present_size.width,n.presentHeight=o.present_size.height,n.profile=o.profile_string,n.level=o.level_string,n.bitDepth=o.bit_depth,n.chromaFormat=o.chroma_format,n.sarRatio=o.sar_ratio,n.frameRate=o.frame_rate,!1!==o.frame_rate.fixed&&0!==o.frame_rate.fps_num&&0!==o.frame_rate.fps_den||(n.frameRate=this._referenceFrameRate);let l=n.frameRate.fps_den,d=n.frameRate.fps_num;n.refSampleDuration=n.timescale*(l/d);let u=s.subarray(1,4),p="avc1.";for(let e=0;e<3;e++){let t=u[e].toString(16);t.length<2&&(t="0"+t),p+=t}n.codec=p;let m=this._mediaInfo;m.width=n.codecWidth,m.height=n.codecHeight,m.fps=n.frameRate.fps,m.profile=n.profile,m.level=n.level,m.refFrames=o.ref_frames,m.chromaFormat=o.chroma_format_string,m.sarNum=n.sarRatio.width,m.sarDen=n.sarRatio.height,m.videoCodec=p,m.hasAudio?null!=m.audioCodec&&(m.mimeType='video/x-flv; codecs="'+m.videoCodec+","+m.audioCodec+'"'):m.mimeType='video/x-flv; codecs="'+m.videoCodec+'"',m.isComplete()&&this._onMediaInfo(m)}let u=r.getUint8(h);if(0!==u){u>1&&f.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+u),h++;for(let e=0;e<u;e++){let e=r.getUint16(h,!a);h+=2,0!==e&&(h+=e)}n.avcc=new Uint8Array(i),n.avcc.set(new Uint8Array(e,t,i),0),f.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",n)}else this._onError(de.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}_parseAVCVideoData(e,t,i,n,s,a,r){let o=this._littleEndian,l=new DataView(e,t,i),d=[],h=0,u=0;const c=this._naluLengthSize;let p=this._timestampBase+n,m=1===a;while(u<i){if(u+4>=i){f.w(this.TAG,`Malformed Nalu near timestamp ${p}, offset = ${u}, dataSize = ${i}`);break}let n=l.getUint32(u,!o);if(3===c&&(n>>>=8),n>i-c)return void f.w(this.TAG,`Malformed Nalus near timestamp ${p}, NaluSize > DataSize!`);let s=31&l.getUint8(u+c);5===s&&(m=!0);let a=new Uint8Array(e,t+u,c+n),r={type:s,data:a};d.push(r),h+=a.byteLength,u+=c+n}if(d.length){let e=this._videoTrack,t={units:d,length:h,isKeyframe:m,dts:p,cts:r,pts:p+r};m&&(t.fileposition=s),e.samples.push(t),e.length+=h}}}var ce=ue;class pe{static init(){pe.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(let t in pe.types)pe.types.hasOwnProperty(t)&&(pe.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);let e=pe.constants={};e.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),e.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),e.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSC=e.STCO=e.STTS,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.HDLR_VIDEO=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]),e.HDLR_AUDIO=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]),e.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}static box(e){let t=8,i=null,n=Array.prototype.slice.call(arguments,1),s=n.length;for(let r=0;r<s;r++)t+=n[r].byteLength;i=new Uint8Array(t),i[0]=t>>>24&255,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i.set(e,4);let a=8;for(let r=0;r<s;r++)i.set(n[r],a),a+=n[r].byteLength;return i}static generateInitSegment(e){let t=pe.box(pe.types.ftyp,pe.constants.FTYP),i=pe.moov(e),n=new Uint8Array(t.byteLength+i.byteLength);return n.set(t,0),n.set(i,t.byteLength),n}static moov(e){let t=pe.mvhd(e.timescale,e.duration),i=pe.trak(e),n=pe.mvex(e);return pe.box(pe.types.moov,t,i,n)}static mvhd(e,t){return pe.box(pe.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,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]))}static trak(e){return pe.box(pe.types.trak,pe.tkhd(e),pe.mdia(e))}static tkhd(e){let t=e.id,i=e.duration,n=e.presentWidth,s=e.presentHeight;return pe.box(pe.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>>8&255,255&n,0,0,s>>>8&255,255&s,0,0]))}static mdia(e){return pe.box(pe.types.mdia,pe.mdhd(e),pe.hdlr(e),pe.minf(e))}static mdhd(e){let t=e.timescale,i=e.duration;return pe.box(pe.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,i>>>24&255,i>>>16&255,i>>>8&255,255&i,85,196,0,0]))}static hdlr(e){let t=null;return t="audio"===e.type?pe.constants.HDLR_AUDIO:pe.constants.HDLR_VIDEO,pe.box(pe.types.hdlr,t)}static minf(e){let t=null;return t="audio"===e.type?pe.box(pe.types.smhd,pe.constants.SMHD):pe.box(pe.types.vmhd,pe.constants.VMHD),pe.box(pe.types.minf,t,pe.dinf(),pe.stbl(e))}static dinf(){let e=pe.box(pe.types.dinf,pe.box(pe.types.dref,pe.constants.DREF));return e}static stbl(e){let t=pe.box(pe.types.stbl,pe.stsd(e),pe.box(pe.types.stts,pe.constants.STTS),pe.box(pe.types.stsc,pe.constants.STSC),pe.box(pe.types.stsz,pe.constants.STSZ),pe.box(pe.types.stco,pe.constants.STCO));return t}static stsd(e){return"audio"===e.type?"mp3"===e.codec?pe.box(pe.types.stsd,pe.constants.STSD_PREFIX,pe.mp3(e)):pe.box(pe.types.stsd,pe.constants.STSD_PREFIX,pe.mp4a(e)):pe.box(pe.types.stsd,pe.constants.STSD_PREFIX,pe.avc1(e))}static mp3(e){let t=e.channelCount,i=e.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return pe.box(pe.types[".mp3"],n)}static mp4a(e){let t=e.channelCount,i=e.audioSampleRate,n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return pe.box(pe.types.mp4a,n,pe.esds(e))}static esds(e){let t=e.config||[],i=t.length,n=new Uint8Array([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([i]).concat(t).concat([6,1,2]));return pe.box(pe.types.esds,n)}static avc1(e){let t=e.avcc,i=e.codecWidth,n=e.codecHeight,s=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,i>>>8&255,255&i,n>>>8&255,255&n,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return pe.box(pe.types.avc1,s,pe.box(pe.types.avcC,t))}static mvex(e){return pe.box(pe.types.mvex,pe.trex(e))}static trex(e){let t=e.id,i=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return pe.box(pe.types.trex,i)}static moof(e,t){return pe.box(pe.types.moof,pe.mfhd(e.sequenceNumber),pe.traf(e,t))}static mfhd(e){let t=new Uint8Array([0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e]);return pe.box(pe.types.mfhd,t)}static traf(e,t){let i=e.id,n=pe.box(pe.types.tfhd,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),s=pe.box(pe.types.tfdt,new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t])),a=pe.sdtp(e),r=pe.trun(e,a.byteLength+16+16+8+16+8+8);return pe.box(pe.types.traf,n,s,r,a)}static sdtp(e){let t=e.samples||[],i=t.length,n=new Uint8Array(4+i);for(let s=0;s<i;s++){let e=t[s].flags;n[s+4]=e.isLeading<<6|e.dependsOn<<4|e.isDependedOn<<2|e.hasRedundancy}return pe.box(pe.types.sdtp,n)}static trun(e,t){let i=e.samples||[],n=i.length,s=12+16*n,a=new Uint8Array(s);t+=8+s,a.set([0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0);for(let r=0;r<n;r++){let e=i[r].duration,t=i[r].size,n=i[r].flags,s=i[r].cts;a.set([e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.isNonSync,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s],12+16*r)}return pe.box(pe.types.trun,a)}static mdat(e){return pe.box(pe.types.mdat,e)}}pe.init();var me=pe;class fe{static getSilentFrame(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)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===t)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])}else{if(1===t)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===t)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===t)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}}var _e=fe;class ye{constructor(e,t,i,n,s){this.dts=e,this.pts=t,this.duration=i,this.originalDts=n,this.isSyncPoint=s,this.fileposition=null}}class ge{constructor(){this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}appendSyncPoint(e){e.isSyncPoint=!0,this.syncPoints.push(e)}}class ve{constructor(){this._list=[]}clear(){this._list=[]}appendArray(e){let t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts<t[t.length-1].originalDts&&this.clear(),Array.prototype.push.apply(t,e))}getLastSyncPointBeforeDts(e){if(0==this._list.length)return null;let t=this._list,i=0,n=t.length-1,s=0,a=0,r=n;e<t[0].dts&&(i=0,a=r+1);while(a<=r){if(s=a+Math.floor((r-a)/2),s===n||e>=t[s].dts&&e<t[s+1].dts){i=s;break}t[s].dts<e?a=s+1:r=s-1}return this._list[i]}}class be{constructor(e){this._type=e,this._list=[],this._lastAppendLocation=-1}get type(){return this._type}get length(){return this._list.length}isEmpty(){return 0===this._list.length}clear(){this._list=[],this._lastAppendLocation=-1}_searchNearestSegmentBefore(e){let t=this._list;if(0===t.length)return-2;let i=t.length-1,n=0,s=0,a=i,r=0;if(e<t[0].originalBeginDts)return r=-1,r;while(s<=a){if(n=s+Math.floor((a-s)/2),n===i||e>t[n].lastSample.originalDts&&e<t[n+1].originalBeginDts){r=n;break}t[n].originalBeginDts<e?s=n+1:a=n-1}return r}_searchNearestSegmentAfter(e){return this._searchNearestSegmentBefore(e)+1}append(e){let t=this._list,i=e,n=this._lastAppendLocation,s=0;-1!==n&&n<t.length&&i.originalBeginDts>=t[n].lastSample.originalDts&&(n===t.length-1||n<t.length-1&&i.originalBeginDts<t[n+1].originalBeginDts)?s=n+1:t.length>0&&(s=this._searchNearestSegmentBefore(i.originalBeginDts)+1),this._lastAppendLocation=s,this._list.splice(s,0,i)}getLastSegmentBefore(e){let t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null}getLastSampleBefore(e){let t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null}getLastSyncPointBefore(e){let t=this._searchNearestSegmentBefore(e),i=this._list[t].syncPoints;while(0===i.length&&t>0)t--,i=this._list[t].syncPoints;return i.length>0?i[i.length-1]:null}}class Ee{constructor(e){this.TAG="MP4Remuxer",this._config=e,this._isLive=!0===e.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new be("audio"),this._videoSegmentInfoList=new be("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!T.chrome||!(T.version.major<50||50===T.version.major&&T.version.build<2661)),this._fillSilentAfterSeek=T.msedge||T.msie,this._mp3UseMpegAudio=!T.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}destroy(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}bindDataSource(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}get onInitSegment(){return this._onInitSegment}set onInitSegment(e){this._onInitSegment=e}get onMediaSegment(){return this._onMediaSegment}set onMediaSegment(e){this._onMediaSegment=e}insertDiscontinuity(){this._audioNextDts=this._videoNextDts=void 0}seek(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}remux(e,t){if(!this._onMediaSegment)throw new v("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),this._remuxVideo(t),this._remuxAudio(e)}_onTrackMetadataReceived(e,t){let i=null,n="mp4",s=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(n="mpeg",s="",i=new Uint8Array):i=me.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,i=me.generateInitSegment(t)}if(!this._onInitSegment)throw new v("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:i.buffer,codec:s,container:`${e}/${n}`,mediaDuration:t.duration})}_calculateDtsBase(e,t){this._dtsBaseInited||(e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}flushStashedSamples(){let e=this._videoStashedLastSample,t=this._audioStashedLastSample,i={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(i.samples.push(e),i.length=e.length);let n={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(n.samples.push(t),n.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(i,!0),this._remuxAudio(n,!0)}_remuxAudio(e,t){if(null==this._audioMeta)return;let i=e,n=i.samples,s=void 0,a=-1,r=-1,o=this._audioMeta.refSampleDuration,l="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,d=this._dtsBaseInited&&void 0===this._audioNextDts,h=!1;if(!n||0===n.length)return;if(1===n.length&&!t)return;let u=0,c=null,p=0;l?(u=0,p=i.length):(u=8,p=8+i.length);let m=null;if(n.length>1&&(m=n.pop(),p-=m.length),null!=this._audioStashedLastSample){let e=this._audioStashedLastSample;this._audioStashedLastSample=null,n.unshift(e),p+=e.length}null!=m&&(this._audioStashedLastSample=m);let _=n[0].dts-this._dtsBase;if(this._audioNextDts)s=_-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())s=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(h=!0);else{let e=this._audioSegmentInfoList.getLastSampleBefore(_);if(null!=e){let t=_-(e.originalDts+e.duration);t<=3&&(t=0);let i=e.dts+e.duration+t;s=_-i}else s=0}if(h){let e=_-s,t=this._videoSegmentInfoList.getLastSegmentBefore(_);if(null!=t&&t.beginDts<e){let i=_e.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(i){let s=t.beginDts,a=e-t.beginDts;f.v(this.TAG,`InsertPrefixSilentAudio: dts: ${s}, duration: ${a}`),n.unshift({unit:i,dts:s,pts:s}),p+=i.byteLength}}else h=!1}let y=[];for(let w=0;w<n.length;w++){let e=n[w],t=e.unit,i=e.dts-this._dtsBase,r=i-s;-1===a&&(a=r);let l=0;if(w!==n.length-1){let e=n[w+1].dts-this._dtsBase-s;l=e-r}else if(null!=m){let e=m.dts-this._dtsBase-s;l=e-r}else l=y.length>=1?y[y.length-1].duration:Math.floor(o);let d=!1,h=null;if(l>1.5*o&&"mp3"!==this._audioMeta.codec&&this._fillAudioTimestampGap&&!T.safari){d=!0;let e=Math.abs(l-o),n=Math.ceil(e/o),s=r+o;f.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\ndts: ${r+l} ms, expected: ${r+Math.round(o)} ms, delta: ${Math.round(e)} ms, generate: ${n} frames`);let a=_e.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);null==a&&(f.w(this.TAG,`Unable to generate silent frame for ${this._audioMeta.originalCodec} with ${this._audioMeta.channelCount} channels, repeat last frame`),a=t),h=[];for(let t=0;t<n;t++){let e=Math.round(s);if(h.length>0){let t=h[h.length-1];t.duration=e-t.dts}let t={dts:e,pts:e,cts:0,unit:a,size:a.byteLength,duration:0,originalDts:i,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};h.push(t),p+=t.size,s+=o}let u=h[h.length-1];u.duration=r+l-u.dts,l=Math.round(o)}y.push({dts:r,pts:r,cts:0,unit:e.unit,size:e.unit.byteLength,duration:l,originalDts:i,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),d&&y.push.apply(y,h)}l?c=new Uint8Array(p):(c=new Uint8Array(p),c[0]=p>>>24&255,c[1]=p>>>16&255,c[2]=p>>>8&255,c[3]=255&p,c.set(me.types.mdat,4));for(let f=0;f<y.length;f++){let e=y[f].unit;c.set(e,u),u+=e.byteLength}let g=y[y.length-1];r=g.dts+g.duration,this._audioNextDts=r;let v=new ge;v.beginDts=a,v.endDts=r,v.beginPts=a,v.endPts=r,v.originalBeginDts=y[0].originalDts,v.originalEndDts=g.originalDts+g.duration,v.firstSample=new ye(y[0].dts,y[0].pts,y[0].duration,y[0].originalDts,!1),v.lastSample=new ye(g.dts,g.pts,g.duration,g.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(v),i.samples=y,i.sequenceNumber++;let b=null;b=l?new Uint8Array:me.moof(i,a),i.samples=[],i.length=0;let E={type:"audio",data:this._mergeBoxes(b,c).buffer,sampleCount:y.length,info:v};l&&d&&(E.timestampOffset=a),this._onMediaSegment("audio",E)}_remuxVideo(e,t){if(null==this._videoMeta)return;let i=e,n=i.samples,s=void 0,a=-1,r=-1,o=-1,l=-1;if(!n||0===n.length)return;if(1===n.length&&!t)return;let d=8,h=null,u=8+e.length,c=null;if(n.length>1&&(c=n.pop(),u-=c.length),null!=this._videoStashedLastSample){let e=this._videoStashedLastSample;this._videoStashedLastSample=null,n.unshift(e),u+=e.length}null!=c&&(this._videoStashedLastSample=c);let p=n[0].dts-this._dtsBase;if(this._videoNextDts)s=p-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())s=0;else{let e=this._videoSegmentInfoList.getLastSampleBefore(p);if(null!=e){let t=p-(e.originalDts+e.duration);t<=3&&(t=0);let i=e.dts+e.duration+t;s=p-i}else s=0}let m=new ge,f=[];for(let g=0;g<n.length;g++){let e=n[g],t=e.dts-this._dtsBase,i=e.isKeyframe,r=t-s,l=e.cts,d=r+l;-1===a&&(a=r,o=d);let h=0;if(g!==n.length-1){let e=n[g+1].dts-this._dtsBase-s;h=e-r}else if(null!=c){let e=c.dts-this._dtsBase-s;h=e-r}else h=f.length>=1?f[f.length-1].duration:Math.floor(this._videoMeta.refSampleDuration);if(i){let t=new ye(r,d,h,e.dts,!0);t.fileposition=e.fileposition,m.appendSyncPoint(t)}f.push({dts:r,pts:d,cts:l,units:e.units,size:e.length,isKeyframe:i,duration:h,originalDts:t,flags:{isLeading:0,dependsOn:i?2:1,isDependedOn:i?1:0,hasRedundancy:0,isNonSync:i?0:1}})}h=new Uint8Array(u),h[0]=u>>>24&255,h[1]=u>>>16&255,h[2]=u>>>8&255,h[3]=255&u,h.set(me.types.mdat,4);for(let g=0;g<f.length;g++){let e=f[g].units;while(e.length){let t=e.shift(),i=t.data;h.set(i,d),d+=i.byteLength}}let _=f[f.length-1];if(r=_.dts+_.duration,l=_.pts+_.duration,this._videoNextDts=r,m.beginDts=a,m.endDts=r,m.beginPts=o,m.endPts=l,m.originalBeginDts=f[0].originalDts,m.originalEndDts=_.originalDts+_.duration,m.firstSample=new ye(f[0].dts,f[0].pts,f[0].duration,f[0].originalDts,f[0].isKeyframe),m.lastSample=new ye(_.dts,_.pts,_.duration,_.originalDts,_.isKeyframe),this._isLive||this._videoSegmentInfoList.append(m),i.samples=f,i.sequenceNumber++,this._forceFirstIDR){let e=f[0].flags;e.dependsOn=2,e.isNonSync=0}let y=me.moof(i,a);i.samples=[],i.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(y,h).buffer,sampleCount:f.length,info:m})}_mergeBoxes(e,t){let i=new Uint8Array(e.byteLength+t.byteLength);return i.set(e,0),i.set(t,e.byteLength),i}}var we=Ee;const Se={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"};var ke=Se;class Le{constructor(e,t){this.TAG="TransmuxingController",this._emitter=new p.a,this._config=t,e.segments||(e.segments=[{duration:e.duration,filesize:e.filesize,url:e.url}]),"boolean"!==typeof e.cors&&(e.cors=!0),"boolean"!==typeof e.withCredentials&&(e.withCredentials=!1),this._mediaDataSource=e,this._currentSegmentIndex=0;let i=0;this._mediaDataSource.segments.forEach(n=>{n.timestampBase=i,i+=n.duration,n.cors=e.cors,n.withCredentials=e.withCredentials,t.referrerPolicy&&(n.referrerPolicy=t.referrerPolicy)}),isNaN(i)||this._mediaDataSource.duration===i||(this._mediaDataSource.duration=i),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}destroy(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}on(e,t){this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}start(){this._loadSegment(0),this._enableStatisticsReporter()}_loadSegment(e,t){this._currentSegmentIndex=e;let i=this._mediaDataSource.segments[e],n=this._ioctl=new V(i,this._config,e);n.onError=this._onIOException.bind(this),n.onSeeked=this._onIOSeeked.bind(this),n.onComplete=this._onIOComplete.bind(this),n.onRedirect=this._onIORedirect.bind(this),n.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?this._demuxer.bindDataSource(this._ioctl):n.onDataArrival=this._onInitChunkArrival.bind(this),n.open(t)}stop(){this._internalAbort(),this._disableStatisticsReporter()}_internalAbort(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}pause(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}resume(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}seek(e){if(null==this._mediaInfo||!this._mediaInfo.isSeekable())return;let t=this._searchSegmentIndexContains(e);if(t===this._currentSegmentIndex){let i=this._mediaInfo.segments[t];if(void 0==i)this._pendingSeekTime=e;else{let t=i.getNearestKeyframe(e);this._remuxer.seek(t.milliseconds),this._ioctl.seek(t.fileposition),this._pendingResolveSeekPoint=t.milliseconds}}else{let i=this._mediaInfo.segments[t];if(void 0==i)this._pendingSeekTime=e,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(t);else{let n=i.getNearestKeyframe(e);this._internalAbort(),this._remuxer.seek(e),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[t].timestampBase,this._loadSegment(t,n.fileposition),this._pendingResolveSeekPoint=n.milliseconds,this._reportSegmentMediaInfo(t)}}this._enableStatisticsReporter()}_searchSegmentIndexContains(e){let t=this._mediaDataSource.segments,i=t.length-1;for(let n=0;n<t.length;n++)if(e<t[n].timestampBase){i=n-1;break}return i}_onInitChunkArrival(e,t){let i=null,n=0;if(t>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,n=this._demuxer.parseChunks(e,t);else if((i=ce.probe(e)).match){this._demuxer=new ce(i,this._config),this._remuxer||(this._remuxer=new we(this._config));let s=this._mediaDataSource;void 0==s.duration||isNaN(s.duration)||(this._demuxer.overridedDuration=s.duration),"boolean"===typeof s.hasAudio&&(this._demuxer.overridedHasAudio=s.hasAudio),"boolean"===typeof s.hasVideo&&(this._demuxer.overridedHasVideo=s.hasVideo),this._demuxer.timestampBase=s.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),n=this._demuxer.parseChunks(e,t)}else i=null,f.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(()=>{this._internalAbort()}),this._emitter.emit(ke.DEMUX_ERROR,de.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),n=0;return n}_onMediaInfo(e){null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,Q.prototype));let t=Object.assign({},e);Object.setPrototypeOf(t,Q.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=t,this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then(()=>{let e=this._pendingSeekTime;this._pendingSeekTime=null,this.seek(e)})}_onMetaDataArrived(e){this._emitter.emit(ke.METADATA_ARRIVED,e)}_onScriptDataArrived(e){this._emitter.emit(ke.SCRIPTDATA_ARRIVED,e)}_onIOSeeked(){this._remuxer.insertDiscontinuity()}_onIOComplete(e){let t=e,i=t+1;i<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(i)):(this._remuxer.flushStashedSamples(),this._emitter.emit(ke.LOADING_COMPLETE),this._disableStatisticsReporter())}_onIORedirect(e){let t=this._ioctl.extraData;this._mediaDataSource.segments[t].redirectedURL=e}_onIORecoveredEarlyEof(){this._emitter.emit(ke.RECOVERED_EARLY_EOF)}_onIOException(e,t){f.e(this.TAG,`IOException: type = ${e}, code = ${t.code}, msg = ${t.msg}`),this._emitter.emit(ke.IO_ERROR,e,t),this._disableStatisticsReporter()}_onDemuxException(e,t){f.e(this.TAG,`DemuxException: type = ${e}, info = ${t}`),this._emitter.emit(ke.DEMUX_ERROR,e,t)}_onRemuxerInitSegmentArrival(e,t){this._emitter.emit(ke.INIT_SEGMENT,e,t)}_onRemuxerMediaSegmentArrival(e,t){if(null==this._pendingSeekTime&&(this._emitter.emit(ke.MEDIA_SEGMENT,e,t),null!=this._pendingResolveSeekPoint&&"video"===e)){let e=t.info.syncPoints,i=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,T.safari&&e.length>0&&e[0].originalDts===i&&(i=e[0].pts),this._emitter.emit(ke.RECOMMEND_SEEKPOINT,i)}}_enableStatisticsReporter(){null==this._statisticsReporter&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}_disableStatisticsReporter(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}_reportSegmentMediaInfo(e){let t=this._mediaInfo.segments[e],i=Object.assign({},t);i.duration=this._mediaInfo.duration,i.segmentCount=this._mediaInfo.segmentCount,delete i.segments,delete i.keyframesIndex,this._emitter.emit(ke.MEDIA_INFO,i)}_reportStatisticsInfo(){let e={};e.url=this._ioctl.currentURL,e.hasRedirect=this._ioctl.hasRedirect,e.hasRedirect&&(e.redirectedURL=this._ioctl.currentRedirectedURL),e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(ke.STATISTICS_INFO,e)}}var Ae=Le;let Te=function(e){let t=null,i=f.bind(this);function n(t,i){let n={msg:ke.INIT_SEGMENT,data:{type:t,data:i}};e.postMessage(n,[i.data])}function s(t,i){let n={msg:ke.MEDIA_SEGMENT,data:{type:t,data:i}};e.postMessage(n,[i.data])}function a(){let t={msg:ke.LOADING_COMPLETE};e.postMessage(t)}function r(){let t={msg:ke.RECOVERED_EARLY_EOF};e.postMessage(t)}function o(t){let i={msg:ke.MEDIA_INFO,data:t};e.postMessage(i)}function l(t){let i={msg:ke.METADATA_ARRIVED,data:t};e.postMessage(i)}function d(t){let i={msg:ke.SCRIPTDATA_ARRIVED,data:t};e.postMessage(i)}function h(t){let i={msg:ke.STATISTICS_INFO,data:t};e.postMessage(i)}function c(t,i){e.postMessage({msg:ke.IO_ERROR,data:{type:t,info:i}})}function p(t,i){e.postMessage({msg:ke.DEMUX_ERROR,data:{type:t,info:i}})}function m(t){e.postMessage({msg:ke.RECOMMEND_SEEKPOINT,data:t})}function f(t,i){e.postMessage({msg:"logcat_callback",data:{type:t,logcat:i}})}u.install(),e.addEventListener("message",(function(u){switch(u.data.cmd){case"init":t=new Ae(u.data.param[0],u.data.param[1]),t.on(ke.IO_ERROR,c.bind(this)),t.on(ke.DEMUX_ERROR,p.bind(this)),t.on(ke.INIT_SEGMENT,n.bind(this)),t.on(ke.MEDIA_SEGMENT,s.bind(this)),t.on(ke.LOADING_COMPLETE,a.bind(this)),t.on(ke.RECOVERED_EARLY_EOF,r.bind(this)),t.on(ke.MEDIA_INFO,o.bind(this)),t.on(ke.METADATA_ARRIVED,l.bind(this)),t.on(ke.SCRIPTDATA_ARRIVED,d.bind(this)),t.on(ke.STATISTICS_INFO,h.bind(this)),t.on(ke.RECOMMEND_SEEKPOINT,m.bind(this));break;case"destroy":t&&(t.destroy(),t=null),e.postMessage({msg:"destroyed"});break;case"start":t.start();break;case"stop":t.stop();break;case"seek":t.seek(u.data.param);break;case"pause":t.pause();break;case"resume":t.resume();break;case"logging_config":{let e=u.data.param;X.applyConfig(e),!0===e.enableCallback?X.addLogListener(i):X.removeLogListener(i);break}}}))};var Re=Te;class Ce{constructor(e,t){if(this.TAG="Transmuxer",this._emitter=new p.a,t.enableWorker&&"undefined"!==typeof Worker)try{let n=i("d2be");this._worker=n(Re),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[e,t]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},X.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:X.getConfig()})}catch(n){f.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new Ae(e,t)}else this._controller=new Ae(e,t);if(this._controller){let e=this._controller;e.on(ke.IO_ERROR,this._onIOError.bind(this)),e.on(ke.DEMUX_ERROR,this._onDemuxError.bind(this)),e.on(ke.INIT_SEGMENT,this._onInitSegment.bind(this)),e.on(ke.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),e.on(ke.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),e.on(ke.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),e.on(ke.MEDIA_INFO,this._onMediaInfo.bind(this)),e.on(ke.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),e.on(ke.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),e.on(ke.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),e.on(ke.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}destroy(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),X.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}on(e,t){this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}hasWorker(){return null!=this._worker}open(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}close(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}seek(e){this._worker?this._worker.postMessage({cmd:"seek",param:e}):this._controller.seek(e)}pause(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}resume(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}_onInitSegment(e,t){Promise.resolve().then(()=>{this._emitter.emit(ke.INIT_SEGMENT,e,t)})}_onMediaSegment(e,t){Promise.resolve().then(()=>{this._emitter.emit(ke.MEDIA_SEGMENT,e,t)})}_onLoadingComplete(){Promise.resolve().then(()=>{this._emitter.emit(ke.LOADING_COMPLETE)})}_onRecoveredEarlyEof(){Promise.resolve().then(()=>{this._emitter.emit(ke.RECOVERED_EARLY_EOF)})}_onMediaInfo(e){Promise.resolve().then(()=>{this._emitter.emit(ke.MEDIA_INFO,e)})}_onMetaDataArrived(e){Promise.resolve().then(()=>{this._emitter.emit(ke.METADATA_ARRIVED,e)})}_onScriptDataArrived(e){Promise.resolve().then(()=>{this._emitter.emit(ke.SCRIPTDATA_ARRIVED,e)})}_onStatisticsInfo(e){Promise.resolve().then(()=>{this._emitter.emit(ke.STATISTICS_INFO,e)})}_onIOError(e,t){Promise.resolve().then(()=>{this._emitter.emit(ke.IO_ERROR,e,t)})}_onDemuxError(e,t){Promise.resolve().then(()=>{this._emitter.emit(ke.DEMUX_ERROR,e,t)})}_onRecommendSeekpoint(e){Promise.resolve().then(()=>{this._emitter.emit(ke.RECOMMEND_SEEKPOINT,e)})}_onLoggingConfigChanged(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})}_onWorkerMessage(e){let t=e.data,i=t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case ke.INIT_SEGMENT:case ke.MEDIA_SEGMENT:this._emitter.emit(t.msg,i.type,i.data);break;case ke.LOADING_COMPLETE:case ke.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case ke.MEDIA_INFO:Object.setPrototypeOf(i,Q.prototype),this._emitter.emit(t.msg,i);break;case ke.METADATA_ARRIVED:case ke.SCRIPTDATA_ARRIVED:case ke.STATISTICS_INFO:this._emitter.emit(t.msg,i);break;case ke.IO_ERROR:case ke.DEMUX_ERROR:this._emitter.emit(t.msg,i.type,i.info);break;case ke.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,i);break;case"logcat_callback":f.emitter.emit("log",i.type,i.logcat);break;default:break}}}var xe=Ce;const Me={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};var Ie=Me;class De{constructor(e){this.TAG="MSEController",this._config=e,this._emitter=new p.a,this._config.isLive&&void 0==this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new ve}destroy(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}on(e,t){this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}attachMediaElement(e){if(this._mediaSource)throw new v("MediaSource has been attached to an HTMLMediaElement!");let t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL}detachMediaElement(){if(this._mediaSource){let t=this._mediaSource;for(let i in this._sourceBuffers){let n=this._pendingSegments[i];n.splice(0,n.length),this._pendingSegments[i]=null,this._pendingRemoveRanges[i]=null,this._lastInitSegments[i]=null;let s=this._sourceBuffers[i];if(s){if("closed"!==t.readyState){try{t.removeSourceBuffer(s)}catch(e){f.e(this.TAG,e.message)}s.removeEventListener("error",this.e.onSourceBufferError),s.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[i]=null,this._sourceBuffers[i]=null}}if("open"===t.readyState)try{t.endOfStream()}catch(e){f.e(this.TAG,e.message)}t.removeEventListener("sourceopen",this.e.onSourceOpen),t.removeEventListener("sourceended",this.e.onSourceEnded),t.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}appendInitSegment(e,t){if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);let i=e,n=""+i.container;i.codec&&i.codec.length>0&&(n+=";codecs="+i.codec);let s=!1;if(f.v(this.TAG,"Received Initialization Segment, mimeType: "+n),this._lastInitSegments[i.type]=i,n!==this._mimeTypes[i.type]){if(this._mimeTypes[i.type])f.v(this.TAG,`Notice: ${i.type} mimeType changed, origin: ${this._mimeTypes[i.type]}, target: ${n}`);else{s=!0;try{let e=this._sourceBuffers[i.type]=this._mediaSource.addSourceBuffer(n);e.addEventListener("error",this.e.onSourceBufferError),e.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(a){return f.e(this.TAG,a.message),void this._emitter.emit(Ie.ERROR,{code:a.code,msg:a.message})}}this._mimeTypes[i.type]=n}t||this._pendingSegments[i.type].push(i),s||this._sourceBuffers[i.type]&&!this._sourceBuffers[i.type].updating&&this._doAppendSegments(),T.safari&&"audio/mpeg"===i.container&&i.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=i.mediaDuration/1e3,this._updateMediaSourceDuration())}appendMediaSegment(e){let t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();let i=this._sourceBuffers[t.type];!i||i.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()}seek(e){for(let i in this._sourceBuffers){if(!this._sourceBuffers[i])continue;let e=this._sourceBuffers[i];if("open"===this._mediaSource.readyState)try{e.abort()}catch(t){f.e(this.TAG,t.message)}this._idrList.clear();let n=this._pendingSegments[i];if(n.splice(0,n.length),"closed"!==this._mediaSource.readyState){for(let t=0;t<e.buffered.length;t++){let n=e.buffered.start(t),s=e.buffered.end(t);this._pendingRemoveRanges[i].push({start:n,end:s})}if(e.updating||this._doRemoveRanges(),T.safari){let t=this._lastInitSegments[i];t&&(this._pendingSegments[i].push(t),e.updating||this._doAppendSegments())}}}}endOfStream(){let e=this._mediaSource,t=this._sourceBuffers;e&&"open"===e.readyState?t.video&&t.video.updating||t.audio&&t.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,e.endOfStream()):e&&"closed"===e.readyState&&this._hasPendingSegments()&&(this._hasPendingEos=!0)}getNearestKeyframe(e){return this._idrList.getLastSyncPointBeforeDts(e)}_needCleanupSourceBuffer(){if(!this._config.autoCleanupSourceBuffer)return!1;let e=this._mediaElement.currentTime;for(let t in this._sourceBuffers){let i=this._sourceBuffers[t];if(i){let t=i.buffered;if(t.length>=1&&e-t.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}_doCleanupSourceBuffer(){let e=this._mediaElement.currentTime;for(let t in this._sourceBuffers){let i=this._sourceBuffers[t];if(i){let n=i.buffered,s=!1;for(let i=0;i<n.length;i++){let a=n.start(i),r=n.end(i);if(a<=e&&e<r+3){if(e-a>=this._config.autoCleanupMaxBackwardDuration){s=!0;let i=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:a,end:i})}}else r<e&&(s=!0,this._pendingRemoveRanges[t].push({start:a,end:r}))}s&&!i.updating&&this._doRemoveRanges()}}}_updateMediaSourceDuration(){let e=this._sourceBuffers;if(0===this._mediaElement.readyState||"open"!==this._mediaSource.readyState)return;if(e.video&&e.video.updating||e.audio&&e.audio.updating)return;let t=this._mediaSource.duration,i=this._pendingMediaDuration;i>0&&(isNaN(t)||i>t)&&(f.v(this.TAG,`Update MediaSource duration from ${t} to ${i}`),this._mediaSource.duration=i),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}_doRemoveRanges(){for(let e in this._pendingRemoveRanges){if(!this._sourceBuffers[e]||this._sourceBuffers[e].updating)continue;let t=this._sourceBuffers[e],i=this._pendingRemoveRanges[e];while(i.length&&!t.updating){let e=i.shift();t.remove(e.start,e.end)}}}_doAppendSegments(){let e=this._pendingSegments;for(let i in e)if(this._sourceBuffers[i]&&!this._sourceBuffers[i].updating&&e[i].length>0){let n=e[i].shift();if(n.timestampOffset){let e=this._sourceBuffers[i].timestampOffset,t=n.timestampOffset/1e3,s=Math.abs(e-t);s>.1&&(f.v(this.TAG,`Update MPEG audio timestampOffset from ${e} to ${t}`),this._sourceBuffers[i].timestampOffset=t),delete n.timestampOffset}if(!n.data||0===n.data.byteLength)continue;try{this._sourceBuffers[i].appendBuffer(n.data),this._isBufferFull=!1,"video"===i&&n.hasOwnProperty("info")&&this._idrList.appendArray(n.info.syncPoints)}catch(t){this._pendingSegments[i].unshift(n),22===t.code?(this._isBufferFull||this._emitter.emit(Ie.BUFFER_FULL),this._isBufferFull=!0):(f.e(this.TAG,t.message),this._emitter.emit(Ie.ERROR,{code:t.code,msg:t.message}))}}}_onSourceOpen(){if(f.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0){let e=this._pendingSourceBufferInit;while(e.length){let t=e.shift();this.appendInitSegment(t,!0)}}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(Ie.SOURCE_OPEN)}_onSourceEnded(){f.v(this.TAG,"MediaSource onSourceEnded")}_onSourceClose(){f.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}_hasPendingSegments(){let e=this._pendingSegments;return e.video.length>0||e.audio.length>0}_hasPendingRemoveRanges(){let e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0}_onSourceBufferUpdateEnd(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(Ie.UPDATE_END)}_onSourceBufferError(e){f.e(this.TAG,"SourceBuffer Error: "+e)}}var Oe=De;const Be={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Pe={NETWORK_EXCEPTION:S.EXCEPTION,NETWORK_STATUS_CODE_INVALID:S.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:S.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:S.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:de.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:de.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:de.CODEC_UNSUPPORTED};class Ue{constructor(e,t){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new p.a,this._config=j(),"object"===typeof t&&Object.assign(this._config,t),"flv"!==e.type.toLowerCase())throw new b("FlvPlayer requires an flv MediaDataSource input!");!0===e.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=e,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;let i=T.chrome&&(T.version.major<50||50===T.version.major&&T.version.build<2661);this._alwaysSeekKeyframe=!!(i||T.msedge||T.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}destroy(){null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(e,t){e===$.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then(()=>{this._emitter.emit($.MEDIA_INFO,this.mediaInfo)}):e===$.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then(()=>{this._emitter.emit($.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}attachMediaElement(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),e.addEventListener("seeking",this.e.onvSeeking),e.addEventListener("canplay",this.e.onvCanPlay),e.addEventListener("stalled",this.e.onvStalled),e.addEventListener("progress",this.e.onvProgress),this._msectl=new Oe(this._config),this._msectl.on(Ie.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(Ie.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(Ie.SOURCE_OPEN,()=>{this._mseSourceOpened=!0,this._hasPendingLoad&&(this._hasPendingLoad=!1,this.load())}),this._msectl.on(Ie.ERROR,e=>{this._emitter.emit($.ERROR,Be.MEDIA_ERROR,Pe.MEDIA_MSE_ERROR,e)}),this._msectl.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(t){}}detachMediaElement(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}load(){if(!this._mediaElement)throw new v("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new v("FlvPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(this._config.deferLoadAfterSourceOpen&&!1===this._mseSourceOpened?this._hasPendingLoad=!0:(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new xe(this._mediaDataSource,this._config),this._transmuxer.on(ke.INIT_SEGMENT,(e,t)=>{this._msectl.appendInitSegment(t)}),this._transmuxer.on(ke.MEDIA_SEGMENT,(e,t)=>{if(this._msectl.appendMediaSegment(t),this._config.lazyLoad&&!this._config.isLive){let e=this._mediaElement.currentTime;t.info.endDts>=1e3*(e+this._config.lazyLoadMaxDuration)&&null==this._progressChecker&&(f.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}),this._transmuxer.on(ke.LOADING_COMPLETE,()=>{this._msectl.endOfStream(),this._emitter.emit($.LOADING_COMPLETE)}),this._transmuxer.on(ke.RECOVERED_EARLY_EOF,()=>{this._emitter.emit($.RECOVERED_EARLY_EOF)}),this._transmuxer.on(ke.IO_ERROR,(e,t)=>{this._emitter.emit($.ERROR,Be.NETWORK_ERROR,e,t)}),this._transmuxer.on(ke.DEMUX_ERROR,(e,t)=>{this._emitter.emit($.ERROR,Be.MEDIA_ERROR,e,{code:-1,msg:t})}),this._transmuxer.on(ke.MEDIA_INFO,e=>{this._mediaInfo=e,this._emitter.emit($.MEDIA_INFO,Object.assign({},e))}),this._transmuxer.on(ke.METADATA_ARRIVED,e=>{this._emitter.emit($.METADATA_ARRIVED,e)}),this._transmuxer.on(ke.SCRIPTDATA_ARRIVED,e=>{this._emitter.emit($.SCRIPTDATA_ARRIVED,e)}),this._transmuxer.on(ke.STATISTICS_INFO,e=>{this._statisticsInfo=this._fillStatisticsInfo(e),this._emitter.emit($.STATISTICS_INFO,Object.assign({},this._statisticsInfo))}),this._transmuxer.on(ke.RECOMMEND_SEEKPOINT,e=>{this._mediaElement&&!this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=e/1e3)}),this._transmuxer.open()))}unload(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(e){this._mediaElement.volume=e}get muted(){return this._mediaElement.muted}set muted(e){this._mediaElement.muted=e}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e}get mediaInfo(){return Object.assign({},this._mediaInfo)}get statisticsInfo(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}_fillStatisticsInfo(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;let t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){let e=this._mediaElement.getVideoPlaybackQuality();i=e.totalVideoFrames,n=e.droppedVideoFrames}else void 0!=this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e}_onmseUpdateEnd(){if(!this._config.lazyLoad||this._config.isLive)return;let e=this._mediaElement.buffered,t=this._mediaElement.currentTime,i=0,n=0;for(let s=0;s<e.length;s++){let a=e.start(s),r=e.end(s);if(a<=t&&t<r){i=a,n=r;break}}n>=t+this._config.lazyLoadMaxDuration&&null==this._progressChecker&&(f.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}_onmseBufferFull(){f.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()}_suspendTransmuxer(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}_checkProgressAndResume(){let e=this._mediaElement.currentTime,t=this._mediaElement.buffered,i=!1;for(let n=0;n<t.length;n++){let s=t.start(n),a=t.end(n);if(e>=s&&e<a){e>=a-this._config.lazyLoadRecoverDuration&&(i=!0);break}}i&&(window.clearInterval(this._progressChecker),this._progressChecker=null,i&&(f.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}_isTimepointBuffered(e){let t=this._mediaElement.buffered;for(let i=0;i<t.length;i++){let n=t.start(i),s=t.end(i);if(e>=n&&e<s)return!0}return!1}_internalSeek(e){let t=this._isTimepointBuffered(e),i=!1,n=0;if(e<1&&this._mediaElement.buffered.length>0){let t=this._mediaElement.buffered.start(0);(t<1&&e<t||T.safari)&&(i=!0,n=T.safari?.1:t)}if(i)this._requestSetTime=!0,this._mediaElement.currentTime=n;else if(t){if(this._alwaysSeekKeyframe){let t=this._msectl.getNearestKeyframe(Math.floor(1e3*e));this._requestSetTime=!0,this._mediaElement.currentTime=null!=t?t.dts/1e3:e}else this._requestSetTime=!0,this._mediaElement.currentTime=e;null!=this._progressChecker&&this._checkProgressAndResume()}else null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(e),this._transmuxer.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=e)}_checkAndApplyUnbufferedSeekpoint(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){let e=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(e)||(null!=this._progressChecker&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(e),this._transmuxer.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=e))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_checkAndResumeStuckPlayback(e){let t=this._mediaElement;if(e||!this._receivedCanPlay||t.readyState<2){let e=t.buffered;e.length>0&&t.currentTime<e.start(0)&&(f.w(this.TAG,`Playback seems stuck at ${t.currentTime}, seek to ${e.start(0)}`),this._requestSetTime=!0,this._mediaElement.currentTime=e.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}_onvLoadedMetadata(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}_onvSeeking(e){let t=this._mediaElement.currentTime,i=this._mediaElement.buffered;if(this._requestSetTime)this._requestSetTime=!1;else{if(t<1&&i.length>0){let e=i.start(0);if(e<1&&t<e||T.safari)return this._requestSetTime=!0,void(this._mediaElement.currentTime=T.safari?.1:e)}if(this._isTimepointBuffered(t)){if(this._alwaysSeekKeyframe){let e=this._msectl.getNearestKeyframe(Math.floor(1e3*t));null!=e&&(this._requestSetTime=!0,this._mediaElement.currentTime=e.dts/1e3)}null!=this._progressChecker&&this._checkProgressAndResume()}else this._seekpointRecord={seekPoint:t,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}}_onvCanPlay(e){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}_onvStalled(e){this._checkAndResumeStuckPlayback(!0)}_onvProgress(e){this._checkAndResumeStuckPlayback()}}var Ne=Ue;class Fe{constructor(e,t){if(this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new p.a,this._config=j(),"object"===typeof t&&Object.assign(this._config,t),"flv"===e.type.toLowerCase())throw new b("NativePlayer does't support flv MediaDataSource input!");if(e.hasOwnProperty("segments"))throw new b(`NativePlayer(${e.type}) doesn't support multipart playback!`);this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=e,this._mediaElement=null}destroy(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(e,t){e===$.MEDIA_INFO?null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then(()=>{this._emitter.emit($.MEDIA_INFO,this.mediaInfo)}):e===$.STATISTICS_INFO&&null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then(()=>{this._emitter.emit($.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(e,t)}off(e,t){this._emitter.removeListener(e,t)}attachMediaElement(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(t){}}detachMediaElement(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}load(){if(!this._mediaElement)throw new v("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}unload(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}play(){return this._mediaElement.play()}pause(){this._mediaElement.pause()}get type(){return this._type}get buffered(){return this._mediaElement.buffered}get duration(){return this._mediaElement.duration}get volume(){return this._mediaElement.volume}set volume(e){this._mediaElement.volume=e}get muted(){return this._mediaElement.muted}set muted(e){this._mediaElement.muted=e}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e}get mediaInfo(){let e=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",t={mimeType:e+this._mediaDataSource.type};return this._mediaElement&&(t.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(t.width=this._mediaElement.videoWidth,t.height=this._mediaElement.videoHeight)),t}get statisticsInfo(){let e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;let t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){let e=this._mediaElement.getVideoPlaybackQuality();i=e.totalVideoFrames,n=e.droppedVideoFrames}else void 0!=this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e}_onvLoadedMetadata(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit($.MEDIA_INFO,this.mediaInfo)}_reportStatisticsInfo(){this._emitter.emit($.STATISTICS_INFO,this.statisticsInfo)}}var qe=Fe;function Ve(e,t){let i=e;if(null==i||"object"!==typeof i)throw new b("MediaDataSource must be an javascript object!");if(!i.hasOwnProperty("type"))throw new b("MediaDataSource must has type field to indicate video file type!");switch(i.type){case"flv":return new Ne(i,t);default:return new qe(i,t)}}function ze(){return H.supportMSEH264Playback()}function je(){return H.getFeatureList()}u.install();let Ge={};Ge.createPlayer=Ve,Ge.isSupported=ze,Ge.getFeatureList=je,Ge.BaseLoader=k,Ge.LoaderStatus=w,Ge.LoaderErrors=S,Ge.Events=$,Ge.ErrorTypes=Be,Ge.ErrorDetails=Pe,Ge.FlvPlayer=Ne,Ge.NativePlayer=qe,Ge.LoggingControl=X,Object.defineProperty(Ge,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var He=Ge;window.flvjs=He;var We={name:"AttachmentDetailDrawer",mixins:[a["a"],a["b"]],components:{"d-player":d.a},data:function(){return{editable:!1,photo:{},photoPreviewVisible:!1,videoPreviewVisible:!1,nonsupportPreviewVisible:!1,player:{},deleting:!1,deleteErrored:!1,videoOptions:{lang:"zh-cn",video:{url:"",type:"auto"}}}},model:{prop:"visible",event:"close"},props:{attachment:{type:Object,required:!0},addToPhoto:{type:Boolean,required:!1,default:!1},visible:{type:Boolean,required:!1,default:!0}},mounted:function(){this.player=this.$refs.player},watch:{attachment:function(e){e&&this.handleJudgeMediaType(e)}},methods:{handleDeleteAttachment:function(){var e=this;this.deleting=!0,r["a"].delete(this.attachment.id).catch((function(){e.deleteErrored=!0})).finally((function(){setTimeout((function(){e.deleting=!1}),400)}))},handleDeletedCallback:function(){this.$emit("delete",this.attachment),this.deleteErrored=!1,this.onClose()},handleEditName:function(){var e=this;this.editable=!this.editable,this.editable&&this.$nextTick((function(){e.$refs.nameInput.focus()}))},doUpdateAttachment:function(){var e=this;this.attachment.name?(r["a"].update(this.attachment.id,this.attachment).then((function(t){e.$log.debug("Updated attachment",t.data.data)})),this.editable=!1):this.$notification["error"]({message:"提示",description:"附件名称不能为空！"})},handleCopyNormalLink:function(){var e=this,t="".concat(encodeURI(this.attachment.path));this.$copyText(t).then((function(t){e.$log.debug("copy",t),e.$message.success("复制成功！")})).catch((function(t){e.$log.debug("copy.err",t),e.$message.error("复制失败！")}))},handleCopyImgLink:function(){var e=this,t='<img class="myPic" src="'.concat(encodeURI(this.attachment.path),'" alt="图裂啦"/>');this.$copyText(t).then((function(t){e.$log.debug("copy",t),e.$message.success("复制成功！")})).catch((function(t){e.$log.debug("copy.err",t),e.$message.error("复制失败！")}))},handleCopyMarkdownLink:function(){var e=this,t="![".concat(this.attachment.name,"](").concat(encodeURI(this.attachment.path),")");this.$copyText(t).then((function(t){e.$log.debug("copy",t),e.$message.success("复制成功！")})).catch((function(t){e.$log.debug("copy.err",t),e.$message.error("复制失败！")}))},handleAddToPhoto:function(){var e=this;this.photo["name"]=this.attachment.name,this.photo["thumbnail"]=encodeURI(this.attachment.thumbPath),this.photo["url"]=encodeURI(this.attachment.path),this.photo["takeTime"]=(new Date).getTime(),o["a"].create(this.photo).then((function(){e.$message.success("添加成功！"),e.photo={}}))},onClose:function(){this.$emit("close",!1)},handleJudgeMediaType:function(e){var t=e.mediaType;if(t){var i=t.split("/")[0];if("video"===i||"flv"===i){this.handlePreviewVisible(!1,!0,!1);var n=e.path.lastIndexOf("?"),s=e.path.substring(0,n);this.$set(this.videoOptions.video,"url",s),this.$log.debug("video url",s)}else"image"===i?this.handlePreviewVisible(!0,!1,!1):this.handlePreviewVisible(!1,!1,!0)}},handlePreviewVisible:function(e,t,i){this.$set(this,"photoPreviewVisible",e),this.$set(this,"videoPreviewVisible",t),this.$set(this,"nonsupportPreviewVisible",i)}}},$e=We,Ke=i("2877"),Xe=Object(Ke["a"])($e,n,s,!1,null,null,null);t["a"]=Xe.exports},"71ee":function(module,exports,__webpack_require__){(function(global){
  /*!
   * vue-dplayer v0.0.10
   * (c) 2017-present sinchang <sinchangwen@gmail.com>
   * Released under the MIT License.
   */
  (function(e,t){module.exports=t()})(0,(function(){"use strict";var commonjsGlobal="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function createCommonjsModule(e,t){return t={exports:{}},e(t,t.exports),t.exports}var DPlayer_min=createCommonjsModule((function(module,exports){!function(e,t){module.exports=t()}("undefined"!=typeof self&&self,(function(){return function(e){function t(n){if(i[n])return i[n].exports;var s=i[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,n){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=5)}([function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var n=/mobile/i.test(window.navigator.userAgent),s={secondToTime:function(e){var t=function(e){return e<10?"0"+e:""+e},i=Math.floor(e/3600),n=Math.floor((e-3600*i)/60),s=Math.floor(e-3600*i-60*n);return(i>0?[i,n,s]:[n,s]).map(t).join(":")},getElementViewLeft:function(e){var t=e.offsetLeft,i=e.offsetParent,n=document.body.scrollLeft+document.documentElement.scrollLeft;if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement)for(;null!==i&&i!==e;)t+=i.offsetLeft,i=i.offsetParent;else for(;null!==i;)t+=i.offsetLeft,i=i.offsetParent;return t-n},getScrollPosition:function(){return{left:window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0,top:window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}},setScrollPosition:function(e){var t=e.left,i=void 0===t?0:t,n=e.top,s=void 0===n?0:n;this.isFirefox?(document.documentElement.scrollLeft=i,document.documentElement.scrollTop=s):window.scrollTo(i,s)},isMobile:n,isFirefox:/firefox/i.test(window.navigator.userAgent),isChrome:/chrome/i.test(window.navigator.userAgent),storage:{set:function(e,t){localStorage.setItem(e,t)},get:function(e){return localStorage.getItem(e)}},cumulativeOffset:function(e){var t=0,i=0;do{t+=e.offsetTop||0,i+=e.offsetLeft||0,e=e.offsetParent}while(e);return{top:t,left:i}},nameMap:{dragStart:n?"touchstart":"mousedown",dragMove:n?"touchmove":"mousemove",dragEnd:n?"touchend":"mouseup"}};t.default=s},function(e,t,n){var i,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i=function(){return this}();try{i=i||Function("return this")()||eval("this")}catch(e){"object"===("undefined"==typeof window?"undefined":a(window))&&(i=window)}e.exports=i},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(16),a=n(s),r=i(17),o=n(r),l=i(18),d=n(l),h=i(19),u=n(h),c=i(20),p=n(c),m=i(21),f=n(m),_=i(22),y=n(_),g=i(23),v=n(g),b=i(24),E=n(b),w=i(25),S=n(w),k=i(26),L=n(k),A=i(27),T=n(A),R=i(28),C=n(R),x=i(29),M=n(x),I=i(30),D=n(I),O=i(31),B=n(O),P={play:a.default,pause:o.default,volumeUp:d.default,volumeDown:u.default,volumeOff:p.default,full:f.default,fullWeb:y.default,setting:v.default,right:E.default,comment:S.default,commentOff:L.default,send:T.default,pallette:C.default,camera:M.default,subtitle:D.default,loading:B.default};t.default=P},function(e,t,i){e.exports=i(33)},function(e,t,i){var n=i(3);e.exports=function(e){e=e||{};var t="",i=e.enableSubtitle,s=e.subtitle,a=e.current,r=e.pic,o=n.$escape,l=e.screenshot,d=e.preload,h=e.url;i=s&&"webvtt"===s.type;return t+='\n<video\n    class="dplayer-video ',a&&(t+="dplayer-video-current"),t+='"\n    webkit-playsinline\n    playsinline\n    ',r&&(t+='poster="',t+=o(r),t+='"'),t+="\n    ",(l||i)&&(t+='crossorigin="anonymous"'),t+="\n    ",d&&(t+='preload="',t+=o(d),t+='"'),t+="\n    ",h&&(t+='src="',t+=o(h),t+='"'),t+="\n    >\n    ",i&&(t+='\n    <track kind="metadata" default src="',t+=o(s.url),t+='"></track>\n    '),t+"\n</video>"}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),i(6);var n=i(7),s=function(e){return e&&e.__esModule?e:{default:e}}(n);console.log("\n %c DPlayer v1.22.2 d3847a3 %c http://dplayer.js.org \n\n","color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;"),t.default=s.default},function(e,t){},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=i(8),o=n(r),l=i(0),d=n(l),h=i(12),u=n(h),c=i(14),p=n(c),m=i(15),f=n(m),_=i(2),y=n(_),g=i(35),v=n(g),b=i(36),E=n(b),w=i(37),S=n(w),k=i(38),L=n(k),A=i(39),T=n(A),R=i(40),C=n(R),x=i(41),M=n(x),I=i(42),D=n(I),O=i(43),B=n(O),P=i(45),U=n(P),N=i(46),F=n(N),q=i(47),V=n(q),z=i(48),j=n(z),G=i(49),H=n(G),W=i(4),$=n(W),K=0,X=[],Y=function(){function e(t){var i=this;s(this,e),this.options=(0,u.default)(t),this.options.video.quality&&(this.qualityIndex=this.options.video.defaultQuality,this.quality=this.options.video.quality[this.options.video.defaultQuality]),this.tran=new p.default(this.options.lang).tran,this.events=new E.default,this.user=new L.default(this),this.container=this.options.container,this.container.classList.add("dplayer"),this.options.danmaku||this.container.classList.add("dplayer-no-danmaku"),this.options.live&&this.container.classList.add("dplayer-live"),d.default.isMobile&&this.container.classList.add("dplayer-mobile"),this.arrow=this.container.offsetWidth<=500,this.arrow&&this.container.classList.add("dplayer-arrow"),this.template=new f.default({container:this.container,options:this.options,index:K,tran:this.tran}),this.video=this.template.video,this.bar=new C.default(this.template),this.bezel=new D.default(this.template.bezel),this.fullScreen=new S.default(this),this.controller=new B.default(this),this.options.danmaku&&(this.danmaku=new v.default({container:this.template.danmaku,opacity:this.user.get("opacity"),callback:function(){setTimeout((function(){i.template.danmakuLoading.style.display="none",i.options.autoplay&&i.play()}),0)},error:function(e){i.notice(e)},apiBackend:this.options.apiBackend,borderColor:this.options.theme,height:this.arrow?24:30,time:function(){return i.video.currentTime},unlimited:this.user.get("unlimited"),api:{id:this.options.danmaku.id,address:this.options.danmaku.api,token:this.options.danmaku.token,maximum:this.options.danmaku.maximum,addition:this.options.danmaku.addition,user:this.options.danmaku.user},events:this.events}),this.comment=new F.default(this)),this.setting=new U.default(this),document.addEventListener("click",(function(){i.focus=!1}),!0),this.container.addEventListener("click",(function(){i.focus=!0}),!0),this.paused=!0,this.time=new M.default(this),this.hotkey=new V.default(this),this.contextmenu=new j.default(this),this.initVideo(this.video,this.quality&&this.quality.type||this.options.video.type),this.infoPanel=new H.default(this),!this.danmaku&&this.options.autoplay&&this.play(),K++,X.push(this)}return a(e,[{key:"seek",value:function(e){e=Math.max(e,0),this.video.duration&&(e=Math.min(e,this.video.duration)),this.video.currentTime<e?this.notice(this.tran("FF")+" "+(e-this.video.currentTime).toFixed(0)+" "+this.tran("s")):this.video.currentTime>e&&this.notice(this.tran("REW")+" "+(this.video.currentTime-e).toFixed(0)+" "+this.tran("s")),this.video.currentTime=e,this.danmaku&&this.danmaku.seek(),this.bar.set("played",e/this.video.duration,"width")}},{key:"play",value:function(){var e=this;if(this.paused=!1,this.video.paused&&this.bezel.switch(y.default.play),this.template.playButton.innerHTML=y.default.pause,o.default.resolve(this.video.play()).catch((function(){e.pause()})).then((function(){})),this.time.enable("loading"),this.time.enable("progress"),this.container.classList.remove("dplayer-paused"),this.container.classList.add("dplayer-playing"),this.danmaku&&this.danmaku.play(),this.options.mutex)for(var t=0;t<X.length;t++)this!==X[t]&&X[t].pause()}},{key:"pause",value:function(){this.paused=!0,this.container.classList.remove("dplayer-loading"),this.video.paused||this.bezel.switch(y.default.pause),this.ended=!1,this.template.playButton.innerHTML=y.default.play,this.video.pause(),this.time.disable("loading"),this.time.disable("progress"),this.container.classList.remove("dplayer-playing"),this.container.classList.add("dplayer-paused"),this.danmaku&&this.danmaku.pause()}},{key:"switchVolumeIcon",value:function(){this.volume()>=.95?this.template.volumeIcon.innerHTML=y.default.volumeUp:this.volume()>0?this.template.volumeIcon.innerHTML=y.default.volumeDown:this.template.volumeIcon.innerHTML=y.default.volumeOff}},{key:"volume",value:function(e,t,i){if(e=parseFloat(e),!isNaN(e)){e=Math.max(e,0),e=Math.min(e,1),this.bar.set("volume",e,"width");var n=(100*e).toFixed(0)+"%";this.template.volumeBarWrapWrap.dataset.balloon=n,t||this.user.set("volume",e),i||this.notice(this.tran("Volume")+" "+(100*e).toFixed(0)+"%"),this.video.volume=e,this.video.muted&&(this.video.muted=!1),this.switchVolumeIcon()}return this.video.volume}},{key:"toggle",value:function(){this.video.paused?this.play():this.pause()}},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"switchVideo",value:function(e,t){this.pause(),this.video.poster=e.pic?e.pic:"",this.video.src=e.url,this.initMSE(this.video,e.type||"auto"),t&&(this.template.danmakuLoading.style.display="block",this.bar.set("played",0,"width"),this.bar.set("loaded",0,"width"),this.template.ptime.innerHTML="00:00",this.template.danmaku.innerHTML="",this.danmaku&&this.danmaku.reload({id:t.id,address:t.api,token:t.token,maximum:t.maximum,addition:t.addition,user:t.user}))}},{key:"initMSE",value:function(e,t){var i=this;if(this.type=t,this.options.video.customType&&this.options.video.customType[t])"[object Function]"===Object.prototype.toString.call(this.options.video.customType[t])?this.options.video.customType[t](this.video,this):console.error("Illegal customType: "+t);else switch("auto"===this.type&&(/m3u8(#|\?|$)/i.exec(e.src)?this.type="hls":/.flv(#|\?|$)/i.exec(e.src)?this.type="flv":/.mpd(#|\?|$)/i.exec(e.src)?this.type="dash":this.type="normal"),this.type){case"hls":if(Hls)if(Hls.isSupported()){var n=new Hls;n.loadSource(e.src),n.attachMedia(e)}else this.notice("Error: Hls is not supported.");else this.notice("Error: Can't find Hls.");break;case"flv":if(flvjs&&flvjs.isSupported())if(flvjs.isSupported()){var s=flvjs.createPlayer({type:"flv",url:e.src});s.attachMediaElement(e),s.load()}else this.notice("Error: flvjs is not supported.");else this.notice("Error: Can't find flvjs.");break;case"dash":dashjs?dashjs.MediaPlayer().create().initialize(e,e.src,!1):this.notice("Error: Can't find dashjs.");break;case"webtorrent":if(WebTorrent)if(WebTorrent.WEBRTC_SUPPORT){this.container.classList.add("dplayer-loading");var a=new WebTorrent,r=e.src;a.add(r,(function(e){e.files.find((function(e){return e.name.endsWith(".mp4")})).renderTo(i.video,{autoplay:i.options.autoplay},(function(){i.container.classList.remove("dplayer-loading")}))}))}else this.notice("Error: Webtorrent is not supported.");else this.notice("Error: Can't find Webtorrent.")}}},{key:"initVideo",value:function(e,t){var i=this;this.initMSE(e,t),this.on("durationchange",(function(){1!==e.duration&&(i.template.dtime.innerHTML=d.default.secondToTime(e.duration))})),this.on("progress",(function(){var t=e.buffered.length?e.buffered.end(e.buffered.length-1)/e.duration:0;i.bar.set("loaded",t,"width")})),this.on("error",(function(){i.tran&&i.notice&&(i.type,i.notice(i.tran("This video fails to load"),-1))})),this.ended=!1,this.on("ended",(function(){i.bar.set("played",1,"width"),i.setting.loop?(i.seek(0),e.play()):(i.ended=!0,i.pause()),i.danmaku&&(i.danmaku.danIndex=0)})),this.on("play",(function(){i.paused&&i.play()})),this.on("pause",(function(){i.paused||i.pause()}));for(var n=0;n<this.events.videoEvents.length;n++)!function(t){e.addEventListener(i.events.videoEvents[t],(function(){i.events.trigger(i.events.videoEvents[t])}))}(n);this.volume(this.user.get("volume"),!0,!0),this.options.subtitle&&(this.subtitle=new T.default(this.template.subtitle,this.video,this.options.subtitle,this.events),this.user.get("subtitle")||this.subtitle.hide())}},{key:"switchQuality",value:function(e){var t=this;if(this.qualityIndex!==e&&!this.switchingQuality){this.qualityIndex=e,this.switchingQuality=!0,this.quality=this.options.video.quality[e],this.template.qualityButton.innerHTML=this.quality.name;var i=this.video.paused;this.video.pause();var n=(0,$.default)({current:!1,pic:null,screenshot:this.options.screenshot,preload:"auto",url:this.quality.url,subtitle:this.options.subtitle}),s=(new DOMParser).parseFromString(n,"text/html").body.firstChild;this.template.videoWrap.insertBefore(s,this.template.videoWrap.getElementsByTagName("div")[0]),this.prevVideo=this.video,this.video=s,this.initVideo(this.video,this.quality.type||this.options.video.type),this.seek(this.prevVideo.currentTime),this.notice(this.tran("Switching to")+" "+this.quality.name+" "+this.tran("quality"),-1),this.events.trigger("quality_start",this.quality),this.on("canplay",(function(){if(t.prevVideo){if(t.video.currentTime!==t.prevVideo.currentTime)return void t.seek(t.prevVideo.currentTime);t.template.videoWrap.removeChild(t.prevVideo),t.video.classList.add("dplayer-video-current"),i||t.video.play(),t.prevVideo=null,t.notice(t.tran("Switched to")+" "+t.quality.name+" "+t.tran("quality")),t.switchingQuality=!1,t.events.trigger("quality_end")}}))}}},{key:"notice",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;this.template.notice.innerHTML=e,this.template.notice.style.opacity=n,this.noticeTime&&clearTimeout(this.noticeTime),this.events.trigger("notice_show",e),this.noticeTime=setTimeout((function(){t.template.notice.style.opacity=0,t.events.trigger("notice_hide")}),i)}},{key:"resize",value:function(){this.danmaku&&this.danmaku.resize(),this.events.trigger("resize")}},{key:"speed",value:function(e){this.video.playbackRate=e}},{key:"destroy",value:function(){for(var e in X.splice(X.indexOf(this),1),this.pause(),this.controller.destroy(),this.time.destroy(),this.video.src="",this.container.innerHTML="",this.events.trigger("destroy"),this)this.hasOwnProperty(e)&&"paused"!==e&&delete this[e]}}]),e}();t.default=Y},function(e,t,i){(function(t){function i(){}function n(e,t){return function(){e.apply(t,arguments)}}function s(e){if(!(this instanceof s))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],h(e,this)}function a(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,s._immediateFn((function(){var i=1===e._state?t.onFulfilled:t.onRejected;if(null!==i){var n;try{n=i(e._value)}catch(e){return void o(t.promise,e)}r(t.promise,n)}else(1===e._state?r:o)(t.promise,e._value)}))):e._deferreds.push(t)}function r(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===(void 0===t?"undefined":u(t))||"function"==typeof t)){var i=t.then;if(t instanceof s)return e._state=3,e._value=t,void l(e);if("function"==typeof i)return void h(n(i,t),e)}e._state=1,e._value=t,l(e)}catch(t){o(e,t)}}function o(e,t){e._state=2,e._value=t,l(e)}function l(e){2===e._state&&0===e._deferreds.length&&s._immediateFn((function(){e._handled||s._unhandledRejectionFn(e._value)}));for(var t=0,i=e._deferreds.length;t<i;t++)a(e,e._deferreds[t]);e._deferreds=null}function d(e,t,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=i}function h(e,t){var i=!1;try{e((function(e){i||(i=!0,r(t,e))}),(function(e){i||(i=!0,o(t,e))}))}catch(e){if(i)return;i=!0,o(t,e)}}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=setTimeout;s.prototype.catch=function(e){return this.then(null,e)},s.prototype.then=function(e,t){var n=new this.constructor(i);return a(this,new d(e,t,n)),n},s.prototype.finally=function(e){var t=this.constructor;return this.then((function(i){return t.resolve(e()).then((function(){return i}))}),(function(i){return t.resolve(e()).then((function(){return t.reject(i)}))}))},s.all=function(e){return new s((function(t,i){function n(e,r){try{if(r&&("object"===(void 0===r?"undefined":u(r))||"function"==typeof r)){var o=r.then;if("function"==typeof o)return void o.call(r,(function(t){n(e,t)}),i)}s[e]=r,0==--a&&t(s)}catch(e){i(e)}}if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var s=Array.prototype.slice.call(e);if(0===s.length)return t([]);for(var a=s.length,r=0;r<s.length;r++)n(r,s[r])}))},s.resolve=function(e){return e&&"object"===(void 0===e?"undefined":u(e))&&e.constructor===s?e:new s((function(t){t(e)}))},s.reject=function(e){return new s((function(t,i){i(e)}))},s.race=function(e){return new s((function(t,i){for(var n=0,s=e.length;n<s;n++)e[n].then(t,i)}))},s._immediateFn="function"==typeof t&&function(e){t(e)}||function(e){c(e,0)},s._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},e.exports=s}).call(t,i(9).setImmediate)},function(e,t,i){function n(e,t){this._id=e,this._clearFn=t}var s=Function.prototype.apply;t.setTimeout=function(){return new n(s.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new n(s.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},n.prototype.unref=n.prototype.ref=function(){},n.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},i(10),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,i){(function(e,t){!function(e,i){function n(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),i=0;i<t.length;i++)t[i]=arguments[i+1];var n={callback:e,args:t};return d[l]=n,o(l),l++}function s(e){delete d[e]}function a(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(i,n)}}function r(e){if(h)setTimeout(r,0,e);else{var t=d[e];if(t){h=!0;try{a(t)}finally{s(e),h=!1}}}}if(!e.setImmediate){var o,l=1,d={},h=!1,u=e.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(e);c=c&&c.setTimeout?c:e,"[object process]"==={}.toString.call(e.process)?function(){o=function(e){t.nextTick((function(){r(e)}))}}():function(){if(e.postMessage&&!e.importScripts){var t=!0,i=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=i,t}}()?function(){var t="setImmediate$"+Math.random()+"$",i=function(i){i.source===e&&"string"==typeof i.data&&0===i.data.indexOf(t)&&r(+i.data.slice(t.length))};e.addEventListener?e.addEventListener("message",i,!1):e.attachEvent("onmessage",i),o=function(i){e.postMessage(t+i,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){r(e.data)},o=function(t){e.port2.postMessage(t)}}():u&&"onreadystatechange"in u.createElement("script")?function(){var e=u.documentElement;o=function(t){var i=u.createElement("script");i.onreadystatechange=function(){r(t),i.onreadystatechange=null,e.removeChild(i),i=null},e.appendChild(i)}}():function(){o=function(e){setTimeout(r,0,e)}}(),c.setImmediate=n,c.clearImmediate=s}}("undefined"==typeof self?void 0===e?void 0:e:self)}).call(t,i(1),i(11))},function(e,t,i){function n(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(u===setTimeout)return setTimeout(e,0);if((u===n||!u)&&setTimeout)return u=setTimeout,setTimeout(e,0);try{return u(e,0)}catch(t){try{return u.call(null,e,0)}catch(t){return u.call(this,e,0)}}}function r(e){if(c===clearTimeout)return clearTimeout(e);if((c===s||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(e);try{return c(e)}catch(t){try{return c.call(null,e)}catch(t){return c.call(this,e)}}}function o(){_&&m&&(_=!1,m.length?f=m.concat(f):y=-1,f.length&&l())}function l(){if(!_){var e=a(o);_=!0;for(var t=f.length;t;){for(m=f,f=[];++y<t;)m&&m[y].run();y=-1,t=f.length}m=null,_=!1,r(e)}}function d(e,t){this.fun=e,this.array=t}function h(){}var u,c,p=e.exports={};!function(){try{u="function"==typeof setTimeout?setTimeout:n}catch(e){u=n}try{c="function"==typeof clearTimeout?clearTimeout:s}catch(e){c=s}}();var m,f=[],_=!1,y=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];f.push(new d(e,t)),1!==f.length||_||a(l)},d.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=h,p.addListener=h,p.once=h,p.off=h,p.removeListener=h,p.removeAllListeners=h,p.emit=h,p.prependListener=h,p.prependOnceListener=h,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=i(13),a=function(e){return e&&e.__esModule?e:{default:e}}(s);t.default=function(e){var t={container:e.element||document.getElementsByClassName("dplayer")[0],live:!1,autoplay:!1,theme:"#b7daff",loop:!1,lang:(navigator.language||navigator.browserLanguage).toLowerCase(),screenshot:!1,hotkey:!0,preload:"auto",volume:.7,apiBackend:a.default,video:{},contextmenu:[],mutex:!0};for(var i in t)t.hasOwnProperty(i)&&!e.hasOwnProperty(i)&&(e[i]=t[i]);return e.video&&!e.video.type&&(e.video.type="auto"),"object"===n(e.danmaku)&&e.danmaku&&!e.danmaku.user&&(e.danmaku.user="DIYgod"),e.subtitle&&(!e.subtitle.type&&(e.subtitle.type="webvtt"),!e.subtitle.fontSize&&(e.subtitle.fontSize="20px"),!e.subtitle.bottom&&(e.subtitle.bottom="40px"),!e.subtitle.color&&(e.subtitle.color="#fff")),e.video.quality&&(e.video.url=e.video.quality[e.video.defaultQuality].url),e.lang&&(e.lang=e.lang.toLowerCase()),e.contextmenu=e.contextmenu.concat([{text:"Video info",click:function(e){e.infoPanel.triggle()}},{text:"About author",link:"https://diygod.me"},{text:"DPlayer v1.22.2",link:"https://github.com/MoePlayer/DPlayer"}]),e}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,i,n,s){var a=new XMLHttpRequest;a.onreadystatechange=function(){if(4===a.readyState){if(a.status>=200&&a.status<300||304===a.status){var e=JSON.parse(a.responseText);return 0!==e.code?n(a,e):i(a,e)}s(a)}},a.open(null!==t?"POST":"GET",e,!0),a.setRequestHeader("Content-type","application/json; charset=UTF-8"),a.send(null!==t?JSON.stringify(t):null)};t.default={send:function(e,t,i){n(e,t,(function(e,t){console.log("Post danmaku: ",t),i&&i()}),(function(e,t){alert(t.msg)}),(function(e){console.log("Request was unsuccessful: "+e.status)}))},read:function(e,t){n(e,null,(function(e,i){t(null,i.danmaku)}),(function(e,i){t({status:e.status,response:i})}),(function(e){t({status:e.status,response:null})}))}}},function(e,t,i){function n(e){var t=this;this.lang=e,this.tran=function(e){return s[t.lang]&&s[t.lang][e]?s[t.lang][e]:e}}Object.defineProperty(t,"__esModule",{value:!0});var s={"zh-cn":{"Danmaku is loading":"弹幕加载中",Top:"顶部",Bottom:"底部",Rolling:"滚动","Input danmaku, hit Enter":"输入弹幕，回车发送","About author":"关于作者","DPlayer feedback":"播放器意见反馈","About DPlayer":"关于 DPlayer 播放器",Loop:"洗脑循环",Speed:"速度","Opacity for danmaku":"弹幕透明度",Normal:"正常","Please input danmaku content!":"要输入弹幕内容啊喂！","Set danmaku color":"设置弹幕颜色","Set danmaku type":"设置弹幕类型","Show danmaku":"显示弹幕","This video fails to load":"视频加载失败","Switching to":"正在切换至","Switched to":"已经切换至",quality:"画质",FF:"快进",REW:"快退","Unlimited danmaku":"海量弹幕","Send danmaku":"发送弹幕",Setting:"设置","Full screen":"全屏","Web full screen":"页面全屏",Send:"发送",Screenshot:"截图",s:"秒","Show subtitle":"显示字幕","Hide subtitle":"隐藏字幕",Volume:"音量",Live:"直播","Video info":"视频统计信息"},"zh-tw":{"Danmaku is loading":"彈幕加載中",Top:"頂部",Bottom:"底部",Rolling:"滾動","Input danmaku, hit Enter":"輸入彈幕，Enter 發送","About author":"關於作者","DPlayer feedback":"播放器意見反饋","About DPlayer":"關於 DPlayer 播放器",Loop:"循環播放",Speed:"速度","Opacity for danmaku":"彈幕透明度",Normal:"正常","Please input danmaku content!":"請輸入彈幕内容啊！","Set danmaku color":"設置彈幕顏色","Set danmaku type":"設置彈幕類型","Show danmaku":"顯示彈幕","This video fails to load":"視頻加載失敗","Switching to":"正在切換至","Switched to":"已經切換至",quality:"畫質",FF:"快進",REW:"快退","Unlimited danmaku":"海量彈幕","Send danmaku":"發送彈幕",Setting:"設置","Full screen":"全屏","Web full screen":"頁面全屏",Send:"發送",Screenshot:"截圖",s:"秒","Show subtitle":"顯示字幕","Hide subtitle":"隱藏字幕",Volume:"音量",Live:"直播","Video info":"視頻統計信息"}};t.default=n},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=i(2),o=n(r),l=i(32),d=n(l),h=function(){function e(t){s(this,e),this.container=t.container,this.options=t.options,this.index=t.index,this.tran=t.tran,this.init()}return a(e,[{key:"init",value:function(){this.container.innerHTML=(0,d.default)({options:this.options,index:this.index,tran:this.tran,icons:o.default,video:{current:!0,pic:this.options.video.pic,screenshot:this.options.screenshot,preload:this.options.preload,url:this.options.video.url,subtitle:this.options.subtitle}}),this.volumeBar=this.container.querySelector(".dplayer-volume-bar-inner"),this.volumeBarWrap=this.container.querySelector(".dplayer-volume-bar"),this.volumeBarWrapWrap=this.container.querySelector(".dplayer-volume-bar-wrap"),this.volumeButton=this.container.querySelector(".dplayer-volume"),this.volumeIcon=this.container.querySelector(".dplayer-volume-icon .dplayer-icon-content"),this.playedBar=this.container.querySelector(".dplayer-played"),this.loadedBar=this.container.querySelector(".dplayer-loaded"),this.playedBarWrap=this.container.querySelector(".dplayer-bar-wrap"),this.playedBarTime=this.container.querySelector(".dplayer-bar-time"),this.danmaku=this.container.querySelector(".dplayer-danmaku"),this.danmakuLoading=this.container.querySelector(".dplayer-danloading"),this.video=this.container.querySelector(".dplayer-video-current"),this.bezel=this.container.querySelector(".dplayer-bezel-icon"),this.playButton=this.container.querySelector(".dplayer-play-icon"),this.videoWrap=this.container.querySelector(".dplayer-video-wrap"),this.controllerMask=this.container.querySelector(".dplayer-controller-mask"),this.ptime=this.container.querySelector(".dplayer-ptime"),this.settingButton=this.container.querySelector(".dplayer-setting-icon"),this.settingBox=this.container.querySelector(".dplayer-setting-box"),this.mask=this.container.querySelector(".dplayer-mask"),this.loop=this.container.querySelector(".dplayer-setting-loop"),this.loopToggle=this.container.querySelector(".dplayer-setting-loop .dplayer-toggle-setting-input"),this.showDanmaku=this.container.querySelector(".dplayer-setting-showdan"),this.showDanmakuToggle=this.container.querySelector(".dplayer-showdan-setting-input"),this.unlimitDanmaku=this.container.querySelector(".dplayer-setting-danunlimit"),this.unlimitDanmakuToggle=this.container.querySelector(".dplayer-danunlimit-setting-input"),this.speed=this.container.querySelector(".dplayer-setting-speed"),this.speedItem=this.container.querySelectorAll(".dplayer-setting-speed-item"),this.danmakuOpacityBar=this.container.querySelector(".dplayer-danmaku-bar-inner"),this.danmakuOpacityBarWrap=this.container.querySelector(".dplayer-danmaku-bar"),this.danmakuOpacityBarWrapWrap=this.container.querySelector(".dplayer-danmaku-bar-wrap"),this.danmakuOpacityBox=this.container.querySelector(".dplayer-setting-danmaku"),this.dtime=this.container.querySelector(".dplayer-dtime"),this.controller=this.container.querySelector(".dplayer-controller"),this.commentInput=this.container.querySelector(".dplayer-comment-input"),this.commentButton=this.container.querySelector(".dplayer-comment-icon"),this.commentSettingBox=this.container.querySelector(".dplayer-comment-setting-box"),this.commentSettingButton=this.container.querySelector(".dplayer-comment-setting-icon"),this.commentSettingFill=this.container.querySelector(".dplayer-comment-setting-icon path"),this.commentSendButton=this.container.querySelector(".dplayer-send-icon"),this.commentSendFill=this.container.querySelector(".dplayer-send-icon path"),this.commentColorSettingBox=this.container.querySelector(".dplayer-comment-setting-color"),this.browserFullButton=this.container.querySelector(".dplayer-full-icon"),this.webFullButton=this.container.querySelector(".dplayer-full-in-icon"),this.menu=this.container.querySelector(".dplayer-menu"),this.menuItem=this.container.querySelectorAll(".dplayer-menu-item"),this.qualityList=this.container.querySelector(".dplayer-quality-list"),this.camareButton=this.container.querySelector(".dplayer-camera-icon"),this.subtitleButton=this.container.querySelector(".dplayer-subtitle-icon"),this.subtitleButtonInner=this.container.querySelector(".dplayer-subtitle-icon .dplayer-icon-content"),this.subtitle=this.container.querySelector(".dplayer-subtitle"),this.qualityButton=this.container.querySelector(".dplayer-quality-icon"),this.barPreview=this.container.querySelector(".dplayer-bar-preview"),this.barWrap=this.container.querySelector(".dplayer-bar-wrap"),this.notice=this.container.querySelector(".dplayer-notice"),this.infoPanel=this.container.querySelector(".dplayer-info-panel"),this.infoPanelClose=this.container.querySelector(".dplayer-info-panel-close"),this.infoVersion=this.container.querySelector(".dplayer-info-panel-item-version .dplayer-info-panel-item-data"),this.infoFPS=this.container.querySelector(".dplayer-info-panel-item-fps .dplayer-info-panel-item-data"),this.infoType=this.container.querySelector(".dplayer-info-panel-item-type .dplayer-info-panel-item-data"),this.infoUrl=this.container.querySelector(".dplayer-info-panel-item-url .dplayer-info-panel-item-data"),this.infoResolution=this.container.querySelector(".dplayer-info-panel-item-resolution .dplayer-info-panel-item-data"),this.infoDuration=this.container.querySelector(".dplayer-info-panel-item-duration .dplayer-info-panel-item-data"),this.infoDanmakuId=this.container.querySelector(".dplayer-info-panel-item-danmaku-id .dplayer-info-panel-item-data"),this.infoDanmakuApi=this.container.querySelector(".dplayer-info-panel-item-danmaku-api .dplayer-info-panel-item-data"),this.infoDanmakuAmount=this.container.querySelector(".dplayer-info-panel-item-danmaku-amount .dplayer-info-panel-item-data")}}]),e}();t.default=h},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 16 32"><path d="M15.552 15.168q0.448 0.32 0.448 0.832 0 0.448-0.448 0.768l-13.696 8.512q-0.768 0.512-1.312 0.192t-0.544-1.28v-16.448q0-0.96 0.544-1.28t1.312 0.192z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 17 32"><path d="M14.080 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048zM2.88 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 21 32"><path d="M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528zM25.152 16q0 2.72-1.536 5.056t-4 3.36q-0.256 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.704 0.672-1.056 1.024-0.512 1.376-0.8 1.312-0.96 2.048-2.4t0.736-3.104-0.736-3.104-2.048-2.4q-0.352-0.288-1.376-0.8-0.672-0.352-0.672-1.056 0-0.448 0.32-0.8t0.8-0.352q0.224 0 0.48 0.096 2.496 1.056 4 3.36t1.536 5.056z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 21 32"><path d="M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 21 32"><path d="M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 33"><path d="M6.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v4h4c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333zM30.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h4v-4c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM30.667 12c-0.8 0-1.333-0.533-1.333-1.333v-4h-4c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM1.333 12c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333h-4v4c0 0.8-0.533 1.333-1.333 1.333z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 33"><path d="M24.965 24.38h-18.132c-1.366 0-2.478-1.113-2.478-2.478v-11.806c0-1.364 1.111-2.478 2.478-2.478h18.132c1.366 0 2.478 1.113 2.478 2.478v11.806c0 1.364-1.11 2.478-2.478 2.478zM6.833 10.097v11.806h18.134l-0.002-11.806h-18.132zM2.478 28.928h5.952c0.684 0 1.238-0.554 1.238-1.239 0-0.684-0.554-1.238-1.238-1.238h-5.952v-5.802c0-0.684-0.554-1.239-1.238-1.239s-1.239 0.556-1.239 1.239v5.802c0 1.365 1.111 2.478 2.478 2.478zM30.761 19.412c-0.684 0-1.238 0.554-1.238 1.238v5.801h-5.951c-0.686 0-1.239 0.554-1.239 1.238 0 0.686 0.554 1.239 1.239 1.239h5.951c1.366 0 2.478-1.111 2.478-2.478v-5.801c0-0.683-0.554-1.238-1.239-1.238zM0 5.55v5.802c0 0.683 0.554 1.238 1.238 1.238s1.238-0.555 1.238-1.238v-5.802h5.952c0.684 0 1.238-0.554 1.238-1.238s-0.554-1.238-1.238-1.238h-5.951c-1.366-0.001-2.478 1.111-2.478 2.476zM32 11.35v-5.801c0-1.365-1.11-2.478-2.478-2.478h-5.951c-0.686 0-1.239 0.554-1.239 1.238s0.554 1.238 1.239 1.238h5.951v5.801c0 0.683 0.554 1.237 1.238 1.237 0.686 0.002 1.239-0.553 1.239-1.236z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 28"><path d="M28.633 17.104c0.035 0.21 0.026 0.463-0.026 0.76s-0.14 0.598-0.262 0.904c-0.122 0.306-0.271 0.581-0.445 0.825s-0.367 0.419-0.576 0.524c-0.209 0.105-0.393 0.157-0.55 0.157s-0.332-0.035-0.524-0.105c-0.175-0.052-0.393-0.1-0.655-0.144s-0.528-0.052-0.799-0.026c-0.271 0.026-0.541 0.083-0.812 0.17s-0.502 0.236-0.694 0.445c-0.419 0.437-0.664 0.934-0.734 1.493s0.009 1.092 0.236 1.598c0.175 0.349 0.148 0.699-0.079 1.048-0.105 0.14-0.271 0.284-0.498 0.432s-0.476 0.284-0.747 0.406-0.555 0.218-0.851 0.288c-0.297 0.070-0.559 0.105-0.786 0.105-0.157 0-0.306-0.061-0.445-0.183s-0.236-0.253-0.288-0.393h-0.026c-0.192-0.541-0.52-1.009-0.982-1.402s-1-0.589-1.611-0.589c-0.594 0-1.131 0.197-1.611 0.589s-0.816 0.851-1.009 1.375c-0.087 0.21-0.218 0.362-0.393 0.458s-0.367 0.144-0.576 0.144c-0.244 0-0.52-0.044-0.825-0.131s-0.611-0.197-0.917-0.327c-0.306-0.131-0.581-0.284-0.825-0.458s-0.428-0.349-0.55-0.524c-0.087-0.122-0.135-0.266-0.144-0.432s0.057-0.397 0.197-0.694c0.192-0.402 0.266-0.86 0.223-1.375s-0.266-0.991-0.668-1.428c-0.244-0.262-0.541-0.432-0.891-0.511s-0.681-0.109-0.995-0.092c-0.367 0.017-0.742 0.087-1.127 0.21-0.244 0.070-0.489 0.052-0.734-0.052-0.192-0.070-0.371-0.231-0.537-0.485s-0.314-0.533-0.445-0.838c-0.131-0.306-0.231-0.62-0.301-0.943s-0.087-0.59-0.052-0.799c0.052-0.384 0.227-0.629 0.524-0.734 0.524-0.21 0.995-0.555 1.415-1.035s0.629-1.017 0.629-1.611c0-0.611-0.21-1.144-0.629-1.598s-0.891-0.786-1.415-0.996c-0.157-0.052-0.288-0.179-0.393-0.38s-0.157-0.406-0.157-0.616c0-0.227 0.035-0.48 0.105-0.76s0.162-0.55 0.275-0.812 0.244-0.502 0.393-0.72c0.148-0.218 0.31-0.38 0.485-0.485 0.14-0.087 0.275-0.122 0.406-0.105s0.275 0.052 0.432 0.105c0.524 0.21 1.070 0.275 1.637 0.197s1.070-0.327 1.506-0.747c0.21-0.209 0.362-0.467 0.458-0.773s0.157-0.607 0.183-0.904c0.026-0.297 0.026-0.568 0-0.812s-0.048-0.419-0.065-0.524c-0.035-0.105-0.066-0.227-0.092-0.367s-0.013-0.262 0.039-0.367c0.105-0.244 0.293-0.458 0.563-0.642s0.563-0.336 0.878-0.458c0.314-0.122 0.62-0.214 0.917-0.275s0.533-0.092 0.707-0.092c0.227 0 0.406 0.074 0.537 0.223s0.223 0.301 0.275 0.458c0.192 0.471 0.507 0.886 0.943 1.244s0.952 0.537 1.546 0.537c0.611 0 1.153-0.17 1.624-0.511s0.803-0.773 0.996-1.297c0.070-0.14 0.179-0.284 0.327-0.432s0.301-0.223 0.458-0.223c0.244 0 0.511 0.035 0.799 0.105s0.572 0.166 0.851 0.288c0.279 0.122 0.537 0.279 0.773 0.472s0.423 0.402 0.563 0.629c0.087 0.14 0.113 0.293 0.079 0.458s-0.070 0.284-0.105 0.354c-0.227 0.506-0.297 1.039-0.21 1.598s0.341 1.048 0.76 1.467c0.419 0.419 0.934 0.651 1.546 0.694s1.179-0.057 1.703-0.301c0.14-0.087 0.31-0.122 0.511-0.105s0.371 0.096 0.511 0.236c0.262 0.244 0.493 0.616 0.694 1.113s0.336 1 0.406 1.506c0.035 0.297-0.013 0.528-0.144 0.694s-0.266 0.275-0.406 0.327c-0.542 0.192-1.004 0.528-1.388 1.009s-0.576 1.026-0.576 1.637c0 0.594 0.162 1.113 0.485 1.559s0.747 0.764 1.27 0.956c0.122 0.070 0.227 0.14 0.314 0.21 0.192 0.157 0.323 0.358 0.393 0.602v0zM16.451 19.462c0.786 0 1.528-0.149 2.227-0.445s1.305-0.707 1.821-1.231c0.515-0.524 0.921-1.131 1.218-1.821s0.445-1.428 0.445-2.214c0-0.786-0.148-1.524-0.445-2.214s-0.703-1.292-1.218-1.808c-0.515-0.515-1.122-0.921-1.821-1.218s-1.441-0.445-2.227-0.445c-0.786 0-1.524 0.148-2.214 0.445s-1.292 0.703-1.808 1.218c-0.515 0.515-0.921 1.118-1.218 1.808s-0.445 1.428-0.445 2.214c0 0.786 0.149 1.524 0.445 2.214s0.703 1.297 1.218 1.821c0.515 0.524 1.118 0.934 1.808 1.231s1.428 0.445 2.214 0.445v0z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M22 16l-10.105-10.6-1.895 1.987 8.211 8.613-8.211 8.612 1.895 1.988 8.211-8.613z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M27.128 0.38h-22.553c-2.336 0-4.229 1.825-4.229 4.076v16.273c0 2.251 1.893 4.076 4.229 4.076h4.229v-2.685h8.403l-8.784 8.072 1.566 1.44 7.429-6.827h9.71c2.335 0 4.229-1.825 4.229-4.076v-16.273c0-2.252-1.894-4.076-4.229-4.076zM28.538 19.403c0 1.5-1.262 2.717-2.819 2.717h-8.36l-0.076-0.070-0.076 0.070h-11.223c-1.557 0-2.819-1.217-2.819-2.717v-13.589c0-1.501 1.262-2.718 2.819-2.718h19.734c1.557 0 2.819-0.141 2.819 1.359v14.947zM9.206 10.557c-1.222 0-2.215 0.911-2.215 2.036s0.992 2.035 2.215 2.035c1.224 0 2.216-0.911 2.216-2.035s-0.992-2.036-2.216-2.036zM22.496 10.557c-1.224 0-2.215 0.911-2.215 2.036s0.991 2.035 2.215 2.035c1.224 0 2.215-0.911 2.215-2.035s-0.991-2.036-2.215-2.036zM15.852 10.557c-1.224 0-2.215 0.911-2.215 2.036s0.991 2.035 2.215 2.035c1.222 0 2.215-0.911 2.215-2.035s-0.992-2.036-2.215-2.036z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M27.090 0.131h-22.731c-2.354 0-4.262 1.839-4.262 4.109v16.401c0 2.269 1.908 4.109 4.262 4.109h4.262v-2.706h8.469l-8.853 8.135 1.579 1.451 7.487-6.88h9.787c2.353 0 4.262-1.84 4.262-4.109v-16.401c0-2.27-1.909-4.109-4.262-4.109v0zM28.511 19.304c0 1.512-1.272 2.738-2.841 2.738h-8.425l-0.076-0.070-0.076 0.070h-11.311c-1.569 0-2.841-1.226-2.841-2.738v-13.696c0-1.513 1.272-2.739 2.841-2.739h19.889c1.569 0 2.841-0.142 2.841 1.37v15.064z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M13.725 30l3.9-5.325-3.9-1.125v6.45zM0 17.5l11.050 3.35 13.6-11.55-10.55 12.425 11.8 3.65 6.1-23.375-32 15.5z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M19.357 2.88c1.749 0 3.366 0.316 4.851 0.946 1.485 0.632 2.768 1.474 3.845 2.533s1.922 2.279 2.532 3.661c0.611 1.383 0.915 2.829 0.915 4.334 0 1.425-0.304 2.847-0.915 4.271-0.611 1.425-1.587 2.767-2.928 4.028-0.855 0.813-1.811 1.607-2.869 2.38s-2.136 1.465-3.233 2.075c-1.099 0.61-2.198 1.098-3.296 1.465-1.098 0.366-2.115 0.549-3.051 0.549-1.343 0-2.441-0.438-3.296-1.311-0.854-0.876-1.281-2.41-1.281-4.608 0-0.366 0.020-0.773 0.060-1.221s0.062-0.895 0.062-1.343c0-0.773-0.183-1.353-0.55-1.738-0.366-0.387-0.793-0.58-1.281-0.58-0.652 0-1.21 0.295-1.678 0.886s-0.926 1.23-1.373 1.921c-0.447 0.693-0.905 1.334-1.372 1.923s-1.028 0.886-1.679 0.886c-0.529 0-1.048-0.427-1.556-1.282s-0.763-2.259-0.763-4.212c0-2.197 0.529-4.241 1.587-6.133s2.462-3.529 4.21-4.912c1.75-1.383 3.762-2.471 6.041-3.264 2.277-0.796 4.617-1.212 7.018-1.253zM7.334 15.817c0.569 0 1.047-0.204 1.434-0.611s0.579-0.875 0.579-1.404c0-0.569-0.193-1.047-0.579-1.434s-0.864-0.579-1.434-0.579c-0.529 0-0.987 0.193-1.373 0.579s-0.58 0.864-0.58 1.434c0 0.53 0.194 0.998 0.58 1.404 0.388 0.407 0.845 0.611 1.373 0.611zM12.216 11.79c0.691 0 1.292-0.254 1.8-0.763s0.762-1.107 0.762-1.8c0-0.732-0.255-1.343-0.762-1.831-0.509-0.489-1.109-0.732-1.8-0.732-0.732 0-1.342 0.244-1.831 0.732-0.488 0.488-0.732 1.098-0.732 1.831 0 0.693 0.244 1.292 0.732 1.8s1.099 0.763 1.831 0.763zM16.366 25.947c0.692 0 1.282-0.214 1.77-0.64s0.732-0.987 0.732-1.678-0.244-1.261-0.732-1.709c-0.489-0.448-1.078-0.671-1.77-0.671-0.65 0-1.21 0.223-1.678 0.671s-0.702 1.018-0.702 1.709c0 0.692 0.234 1.25 0.702 1.678s1.027 0.64 1.678 0.64zM19.113 9.592c0.651 0 1.129-0.203 1.433-0.611 0.305-0.406 0.459-0.874 0.459-1.404 0-0.488-0.154-0.947-0.459-1.373-0.304-0.427-0.782-0.641-1.433-0.641-0.529 0-1.008 0.193-1.434 0.58s-0.64 0.865-0.64 1.434c0 0.571 0.213 1.049 0.64 1.434 0.427 0.389 0.905 0.581 1.434 0.581zM24.848 12.826c0.57 0 1.067-0.213 1.495-0.64 0.427-0.427 0.64-0.947 0.64-1.556 0-0.57-0.214-1.068-0.64-1.495-0.428-0.427-0.927-0.64-1.495-0.64-0.611 0-1.129 0.213-1.555 0.64-0.428 0.427-0.642 0.926-0.642 1.495 0 0.611 0.213 1.129 0.642 1.556s0.947 0.64 1.555 0.64z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M16 23c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6zM16 13c-2.206 0-4 1.794-4 4s1.794 4 4 4c2.206 0 4-1.794 4-4s-1.794-4-4-4zM27 28h-22c-1.654 0-3-1.346-3-3v-16c0-1.654 1.346-3 3-3h3c0.552 0 1 0.448 1 1s-0.448 1-1 1h-3c-0.551 0-1 0.449-1 1v16c0 0.552 0.449 1 1 1h22c0.552 0 1-0.448 1-1v-16c0-0.551-0.448-1-1-1h-11c-0.552 0-1-0.448-1-1s0.448-1 1-1h11c1.654 0 3 1.346 3 3v16c0 1.654-1.346 3-3 3zM24 10.5c0 0.828 0.672 1.5 1.5 1.5s1.5-0.672 1.5-1.5c0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5zM15 4c0 0.552-0.448 1-1 1h-4c-0.552 0-1-0.448-1-1v0c0-0.552 0.448-1 1-1h4c0.552 0 1 0.448 1 1v0z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M26.667 5.333h-21.333c-0 0-0.001 0-0.001 0-1.472 0-2.666 1.194-2.666 2.666 0 0 0 0.001 0 0.001v-0 16c0 0 0 0.001 0 0.001 0 1.472 1.194 2.666 2.666 2.666 0 0 0.001 0 0.001 0h21.333c0 0 0.001 0 0.001 0 1.472 0 2.666-1.194 2.666-2.666 0-0 0-0.001 0-0.001v0-16c0-0 0-0.001 0-0.001 0-1.472-1.194-2.666-2.666-2.666-0 0-0.001 0-0.001 0h0zM5.333 16h5.333v2.667h-5.333v-2.667zM18.667 24h-13.333v-2.667h13.333v2.667zM26.667 24h-5.333v-2.667h5.333v2.667zM26.667 18.667h-13.333v-2.667h13.333v2.667z"></path></svg>'},function(e,t){e.exports='<svg version="1.1" viewBox="0 0 22 22"><svg x="7" y="1"><circle class="diplayer-loading-dot diplayer-loading-dot-0" cx="4" cy="4" r="2"></circle></svg><svg x="11" y="3"><circle class="diplayer-loading-dot diplayer-loading-dot-1" cx="4" cy="4" r="2"></circle></svg><svg x="13" y="7"><circle class="diplayer-loading-dot diplayer-loading-dot-2" cx="4" cy="4" r="2"></circle></svg><svg x="11" y="11"><circle class="diplayer-loading-dot diplayer-loading-dot-3" cx="4" cy="4" r="2"></circle></svg><svg x="7" y="13"><circle class="diplayer-loading-dot diplayer-loading-dot-4" cx="4" cy="4" r="2"></circle></svg><svg x="3" y="11"><circle class="diplayer-loading-dot diplayer-loading-dot-5" cx="4" cy="4" r="2"></circle></svg><svg x="1" y="7"><circle class="diplayer-loading-dot diplayer-loading-dot-6" cx="4" cy="4" r="2"></circle></svg><svg x="3" y="3"><circle class="diplayer-loading-dot diplayer-loading-dot-7" cx="4" cy="4" r="2"></circle></svg></svg>'},function(e,t,i){var n=i(3);e.exports=function(e){e=e||{};var t="",s=e.video,a=e.options,r=n.$escape,o=e.tran,l=e.icons,d=e.index,h=n.$each;return e.$value,e.$index,t+='<div class="dplayer-mask"></div>\n<div class="dplayer-video-wrap">\n    ',function(e){t+=e}(i(4)(s)),t+="\n    ",a.logo&&(t+='\n    <div class="dplayer-logo">\n        <img src="',t+=r(a.logo),t+='">\n    </div>\n    '),t+='\n    <div class="dplayer-danmaku"',a.danmaku&&a.danmaku.bottm&&(t+=' style="margin-bottom:',t+=r(a.danmaku.bottm),t+='"'),t+='>\n        <div class="dplayer-danmaku-item dplayer-danmaku-item--demo"></div>\n    </div>\n    <div class="dplayer-subtitle"></div>\n    <div class="dplayer-bezel">\n        <span class="dplayer-bezel-icon"></span>\n        ',a.danmaku&&(t+='\n        <span class="dplayer-danloading">',t+=r(o("Danmaku is loading")),t+="</span>\n        "),t+='\n        <span class="diplayer-loading-icon">',t+=l.loading,t+='</span>\n    </div>\n</div>\n<div class="dplayer-controller-mask"></div>\n<div class="dplayer-controller">\n    <div class="dplayer-icons dplayer-comment-box">\n        <button class="dplayer-icon dplayer-comment-setting-icon" data-balloon="',t+=r(o("Setting")),t+='" data-balloon-pos="up">\n            <span class="dplayer-icon-content">',t+=l.pallette,t+='</span>\n        </button>\n        <div class="dplayer-comment-setting-box">\n            <div class="dplayer-comment-setting-color">\n                <div class="dplayer-comment-setting-title">',t+=r(o("Set danmaku color")),t+='</div>\n                <label>\n                    <input type="radio" name="dplayer-danmaku-color-',t+=r(d),t+='" value="#fff" checked>\n                    <span style="background: #fff;"></span>\n                </label>\n                <label>\n                    <input type="radio" name="dplayer-danmaku-color-',t+=r(d),t+='" value="#e54256">\n                    <span style="background: #e54256"></span>\n                </label>\n                <label>\n                    <input type="radio" name="dplayer-danmaku-color-',t+=r(d),t+='" value="#ffe133">\n                    <span style="background: #ffe133"></span>\n                </label>\n                <label>\n                    <input type="radio" name="dplayer-danmaku-color-',t+=r(d),t+='" value="#64DD17">\n                    <span style="background: #64DD17"></span>\n                </label>\n                <label>\n                    <input type="radio" name="dplayer-danmaku-color-',t+=r(d),t+='" value="#39ccff">\n                    <span style="background: #39ccff"></span>\n                </label>\n                <label>\n                    <input type="radio" name="dplayer-danmaku-color-',t+=r(d),t+='" value="#D500F9">\n                    <span style="background: #D500F9"></span>\n                </label>\n            </div>\n            <div class="dplayer-comment-setting-type">\n                <div class="dplayer-comment-setting-title">',t+=r(o("Set danmaku type")),t+='</div>\n                <label>\n                    <input type="radio" name="dplayer-danmaku-type-',t+=r(d),t+='" value="top">\n                    <span>',t+=r(o("Top")),t+='</span>\n                </label>\n                <label>\n                    <input type="radio" name="dplayer-danmaku-type-',t+=r(d),t+='" value="right" checked>\n                    <span>',t+=r(o("Rolling")),t+='</span>\n                </label>\n                <label>\n                    <input type="radio" name="dplayer-danmaku-type-',t+=r(d),t+='" value="bottom">\n                    <span>',t+=r(o("Bottom")),t+='</span>\n                </label>\n            </div>\n        </div>\n        <input class="dplayer-comment-input" type="text" placeholder="',t+=r(o("Input danmaku, hit Enter")),t+='" maxlength="30">\n        <button class="dplayer-icon dplayer-send-icon" data-balloon="',t+=r(o("Send")),t+='" data-balloon-pos="up">\n            <span class="dplayer-icon-content">',t+=l.send,t+='</span>\n        </button>\n    </div>\n    <div class="dplayer-icons dplayer-icons-left">\n        <button class="dplayer-icon dplayer-play-icon">\n            <span class="dplayer-icon-content">',t+=l.play,t+='</span>\n        </button>\n        <div class="dplayer-volume">\n            <button class="dplayer-icon dplayer-volume-icon">\n                <span class="dplayer-icon-content">',t+=l.volumeDown,t+='</span>\n            </button>\n            <div class="dplayer-volume-bar-wrap" data-balloon-pos="up">\n                <div class="dplayer-volume-bar">\n                    <div class="dplayer-volume-bar-inner" style="background: ',t+=r(a.theme),t+=';">\n                        <span class="dplayer-thumb" style="background: ',t+=r(a.theme),t+='"></span>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <span class="dplayer-time">\n            <span class="dplayer-ptime">0:00</span> /\n            <span class="dplayer-dtime">0:00</span>\n        </span>\n        ',a.live&&(t+='\n        <span class="dplayer-live-badge"><span class="dplayer-live-dot" style="background: ',t+=r(a.theme),t+=';"></span>',t+=r(o("Live")),t+="</span>\n        "),t+='\n    </div>\n    <div class="dplayer-icons dplayer-icons-right">\n        ',a.video.quality&&(t+='\n        <div class="dplayer-quality">\n            <button class="dplayer-icon dplayer-quality-icon">',t+=r(a.video.quality[a.video.defaultQuality].name),t+='</button>\n            <div class="dplayer-quality-mask">\n                <div class="dplayer-quality-list">\n                ',h(a.video.quality,(function(e,i){t+='\n                    <div class="dplayer-quality-item" data-index="',t+=r(i),t+='">',t+=r(e.name),t+="</div>\n                "})),t+="\n                </div>\n            </div>\n        </div>\n        "),t+="\n        ",a.screenshot&&(t+='\n        <div class="dplayer-icon dplayer-camera-icon" data-balloon="',t+=r(o("Screenshot")),t+='" data-balloon-pos="up">\n            <span class="dplayer-icon-content">',t+=l.camera,t+="</span>\n        </div>\n        "),t+='\n        <div class="dplayer-comment">\n            <button class="dplayer-icon dplayer-comment-icon" data-balloon="',t+=r(o("Send danmaku")),t+='" data-balloon-pos="up">\n                <span class="dplayer-icon-content">',t+=l.comment,t+="</span>\n            </button>\n        </div>\n        ",a.subtitle&&(t+='\n        <div class="dplayer-subtitle-btn">\n            <button class="dplayer-icon dplayer-subtitle-icon" data-balloon="',t+=r(o("Hide subtitle")),t+='" data-balloon-pos="up">\n                <span class="dplayer-icon-content">',t+=l.subtitle,t+="</span>\n            </button>\n        </div>\n        "),t+='\n        <div class="dplayer-setting">\n            <button class="dplayer-icon dplayer-setting-icon" data-balloon="',t+=r(o("Setting")),t+='" data-balloon-pos="up">\n                <span class="dplayer-icon-content">',t+=l.setting,t+='</span>\n            </button>\n            <div class="dplayer-setting-box">\n                <div class="dplayer-setting-origin-panel">\n                    <div class="dplayer-setting-item dplayer-setting-speed">\n                        <span class="dplayer-label">',t+=r(o("Speed")),t+='</span>\n                        <div class="dplayer-toggle">',t+=l.right,t+='</div>\n                    </div>\n                    <div class="dplayer-setting-item dplayer-setting-loop">\n                        <span class="dplayer-label">',t+=r(o("Loop")),t+='</span>\n                        <div class="dplayer-toggle">\n                            <input class="dplayer-toggle-setting-input" type="checkbox" name="dplayer-toggle">\n                            <label for="dplayer-toggle"></label>\n                        </div>\n                    </div>\n                    <div class="dplayer-setting-item dplayer-setting-showdan">\n                        <span class="dplayer-label">',t+=r(o("Show danmaku")),t+='</span>\n                        <div class="dplayer-toggle">\n                            <input class="dplayer-showdan-setting-input" type="checkbox" name="dplayer-toggle-dan">\n                            <label for="dplayer-toggle-dan"></label>\n                        </div>\n                    </div>\n                    <div class="dplayer-setting-item dplayer-setting-danunlimit">\n                        <span class="dplayer-label">',t+=r(o("Unlimited danmaku")),t+='</span>\n                        <div class="dplayer-toggle">\n                            <input class="dplayer-danunlimit-setting-input" type="checkbox" name="dplayer-toggle-danunlimit">\n                            <label for="dplayer-toggle-danunlimit"></label>\n                        </div>\n                    </div>\n                    <div class="dplayer-setting-item dplayer-setting-danmaku">\n                        <span class="dplayer-label">',t+=r(o("Opacity for danmaku")),t+='</span>\n                        <div class="dplayer-danmaku-bar-wrap">\n                            <div class="dplayer-danmaku-bar">\n                                <div class="dplayer-danmaku-bar-inner">\n                                    <span class="dplayer-thumb"></span>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n                <div class="dplayer-setting-speed-panel">\n                    <div class="dplayer-setting-speed-item" data-speed="0.5">\n                        <span class="dplayer-label">0.5</span>\n                    </div>\n                    <div class="dplayer-setting-speed-item" data-speed="0.75">\n                        <span class="dplayer-label">0.75</span>\n                    </div>\n                    <div class="dplayer-setting-speed-item" data-speed="1">\n                        <span class="dplayer-label">',t+=r(o("Normal")),t+='</span>\n                    </div>\n                    <div class="dplayer-setting-speed-item" data-speed="1.25">\n                        <span class="dplayer-label">1.25</span>\n                    </div>\n                    <div class="dplayer-setting-speed-item" data-speed="1.5">\n                        <span class="dplayer-label">1.5</span>\n                    </div>\n                    <div class="dplayer-setting-speed-item" data-speed="2">\n                        <span class="dplayer-label">2</span>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="dplayer-full">\n            <button class="dplayer-icon dplayer-full-in-icon" data-balloon="',t+=r(o("Web full screen")),t+='" data-balloon-pos="up">\n                <span class="dplayer-icon-content">',t+=l.fullWeb,t+='</span>\n            </button>\n            <button class="dplayer-icon dplayer-full-icon" data-balloon="',t+=r(o("Full screen")),t+='" data-balloon-pos="up">\n                <span class="dplayer-icon-content">',t+=l.full,t+='</span>\n            </button>\n        </div>\n    </div>\n    <div class="dplayer-bar-wrap">\n        <div class="dplayer-bar-time hidden">00:00</div>\n        <div class="dplayer-bar-preview"></div>\n        <div class="dplayer-bar">\n            <div class="dplayer-loaded" style="width: 0;"></div>\n            <div class="dplayer-played" style="width: 0; background: ',t+=r(a.theme),t+='">\n                <span class="dplayer-thumb" style="background: ',t+=r(a.theme),t+='"></span>\n            </div>\n        </div>\n    </div>\n</div>\n<div class="dplayer-info-panel dplayer-info-panel-hide">\n    <div class="dplayer-info-panel-close">[x]</div>\n    <div class="dplayer-info-panel-item dplayer-info-panel-item-version">\n        <span class="dplayer-info-panel-item-title">Player version</span>\n        <span class="dplayer-info-panel-item-data"></span>\n    </div>\n    <div class="dplayer-info-panel-item dplayer-info-panel-item-fps">\n        <span class="dplayer-info-panel-item-title">Player FPS</span>\n        <span class="dplayer-info-panel-item-data"></span>\n    </div>\n    <div class="dplayer-info-panel-item dplayer-info-panel-item-type">\n        <span class="dplayer-info-panel-item-title">Video type</span>\n        <span class="dplayer-info-panel-item-data"></span>\n    </div>\n    <div class="dplayer-info-panel-item dplayer-info-panel-item-url">\n        <span class="dplayer-info-panel-item-title">Video url</span>\n        <span class="dplayer-info-panel-item-data"></span>\n    </div>\n    <div class="dplayer-info-panel-item dplayer-info-panel-item-resolution">\n        <span class="dplayer-info-panel-item-title">Video resolution</span>\n        <span class="dplayer-info-panel-item-data"></span>\n    </div>\n    <div class="dplayer-info-panel-item dplayer-info-panel-item-duration">\n        <span class="dplayer-info-panel-item-title">Video duration</span>\n        <span class="dplayer-info-panel-item-data"></span>\n    </div>\n    ',a.danmaku&&(t+='\n    <div class="dplayer-info-panel-item dplayer-info-panel-item-danmaku-id">\n        <span class="dplayer-info-panel-item-title">Danamku id</span>\n        <span class="dplayer-info-panel-item-data"></span>\n    </div>\n    <div class="dplayer-info-panel-item dplayer-info-panel-item-danmaku-api">\n        <span class="dplayer-info-panel-item-title">Danamku api</span>\n        <span class="dplayer-info-panel-item-data"></span>\n    </div>\n    <div class="dplayer-info-panel-item dplayer-info-panel-item-danmaku-amount">\n        <span class="dplayer-info-panel-item-title">Danamku amount</span>\n        <span class="dplayer-info-panel-item-data"></span>\n    </div>\n    '),t+='\n</div>\n<div class="dplayer-menu">\n    ',h(a.contextmenu,(function(e,i){t+='\n        <div class="dplayer-menu-item">\n            <a target="_blank" href="',t+=r(e.link||"javascript:void(0);"),t+='">',t+=r(o(e.text)),t+="</a>\n        </div>\n    "})),t+='\n</div>\n<div class="dplayer-notice"></div>'}},function(e,t,i){(function(t){function n(e){return"string"!=typeof e&&(e=void 0===e||null===e?"":"function"==typeof e?n(e.call(e)):JSON.stringify(e)),e}function s(e){var t=""+e,i=o.exec(t);if(!i)return e;var n="",s=void 0,a=void 0,r=void 0;for(s=i.index,a=0;s<t.length;s++){switch(t.charCodeAt(s)){case 34:r="&#34;";break;case 38:r="&#38;";break;case 39:r="&#39;";break;case 60:r="&#60;";break;case 62:r="&#62;";break;default:continue}a!==s&&(n+=t.substring(a,s)),a=s+1,n+=r}return a!==s?n+t.substring(a,s):n}var a=i(34),r=Object.create(a?t:window),o=/["&'<>]/;r.$escape=function(e){return s(n(e))},r.$each=function(e,t){if(Array.isArray(e))for(var i=0,n=e.length;i<n;i++)t(e[i],i);else for(var s in e)t(e[s],s)},e.exports=r}).call(t,i(1))},function(e,t,i){(function(t){e.exports=!1;try{e.exports="[object process]"===Object.prototype.toString.call(t.process)}catch(e){}}).call(t,i(1))},function(e,t,i){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(){function e(t){n(this,e),this.options=t,this.container=this.options.container,this.danTunnel={right:{},top:{},bottom:{}},this.danIndex=0,this.dan=[],this.showing=!0,this._opacity=this.options.opacity,this.events=this.options.events,this.unlimited=this.options.unlimited,this._measure(""),this.load()}return a(e,[{key:"load",value:function(){var e=this,t=void 0;t=this.options.api.maximum?this.options.api.address+"v2/?id="+this.options.api.id+"&max="+this.options.api.maximum:this.options.api.address+"v2/?id="+this.options.api.id;var i=(this.options.api.addition||[]).slice(0);i.push(t),this.events&&this.events.trigger("danmaku_load_start",i),this._readAllEndpoints(i,(function(t){e.dan=[].concat.apply([],t).sort((function(e,t){return e.time-t.time})),window.requestAnimationFrame((function(){e.frame()})),e.options.callback(),e.events&&e.events.trigger("danmaku_load_end")}))}},{key:"reload",value:function(e){this.options.api=e,this.dan=[],this.clear(),this.load()}},{key:"_readAllEndpoints",value:function(e,t){for(var i=this,n=[],s=0,a=0;a<e.length;++a)this.options.apiBackend.read(e[a],function(a){return function(r,o){if(++s,r)r.response?i.options.error(r.response.msg):i.options.error("Request was unsuccessful: "+r.status),n[a]=[];else{var l=["right","top","bottom"];n[a]=o?o.map((function(e){return{time:e[0],type:l[e[1]],color:e[2],author:e[3],text:e[4]}})):[]}if(s===e.length)return t(n)}}(a))}},{key:"send",value:function(e,t){var i={token:this.options.api.token,player:this.options.api.id,author:this.options.api.user,time:this.options.time(),text:e.text,color:e.color,type:e.type};this.options.apiBackend.send(this.options.api.address+"v2/",i,t),this.dan.splice(this.danIndex,0,i),this.danIndex++;var n={text:this.htmlEncode(i.text),color:i.color,type:i.type,border:"2px solid "+this.options.borderColor};this.draw(n),this.events&&this.events.trigger("danmaku_send",i)}},{key:"frame",value:function(){var e=this;if(this.dan.length&&!this.paused&&this.showing){for(var t=this.dan[this.danIndex],i=[];t&&this.options.time()>parseFloat(t.time);)i.push(t),t=this.dan[++this.danIndex];this.draw(i)}window.requestAnimationFrame((function(){e.frame()}))}},{key:"opacity",value:function(e){if(void 0!==e){for(var t=this.container.getElementsByClassName("dplayer-danmaku-item"),i=0;i<t.length;i++)t[i].style.opacity=e;this._opacity=e,this.events&&this.events.trigger("danmaku_opacity",this._opacity)}return this._opacity}},{key:"draw",value:function(e){var t=this;if(this.showing){var i=this.options.height,n=this.container.offsetWidth,a=this.container.offsetHeight,r=parseInt(a/i),o=function(e){var i=e.offsetWidth||parseInt(e.style.width),n=e.getBoundingClientRect().right||t.container.getBoundingClientRect().right+i;return t.container.getBoundingClientRect().right-n},l=function(e){return(n+e)/5},d=function(e,i,a){for(var d=n/l(a),h=0;t.unlimited||h<r;h++){var u=function(s){var a=t.danTunnel[i][s+""];if(!a||!a.length)return t.danTunnel[i][s+""]=[e],e.addEventListener("animationend",(function(){t.danTunnel[i][s+""].splice(0,1)})),{v:s%r};if("right"!==i)return"continue";for(var h=0;h<a.length;h++){var u=o(a[h])-10;if(u<=n-d*l(parseInt(a[h].style.width))||u<=0)break;if(h===a.length-1)return t.danTunnel[i][s+""].push(e),e.addEventListener("animationend",(function(){t.danTunnel[i][s+""].splice(0,1)})),{v:s%r}}}(h);switch(u){case"continue":continue;default:if("object"===(void 0===u?"undefined":s(u)))return u.v}}return-1};"[object Array]"!==Object.prototype.toString.call(e)&&(e=[e]);for(var h=document.createDocumentFragment(),u=0;u<e.length;u++)!function(s){e[s].type||(e[s].type="right"),e[s].color||(e[s].color="#fff");var a=document.createElement("div");a.classList.add("dplayer-danmaku-item"),a.classList.add("dplayer-danmaku-"+e[s].type),e[s].border?a.innerHTML='<span style="border:'+e[s].border+'">'+e[s].text+"</span>":a.innerHTML=e[s].text,a.style.opacity=t._opacity,a.style.color=e[s].color,a.addEventListener("animationend",(function(){t.container.removeChild(a)}));var r=t._measure(e[s].text),o=void 0;switch(e[s].type){case"right":o=d(a,e[s].type,r),o>=0&&(a.style.width=r+1+"px",a.style.top=i*o+"px",a.style.transform="translateX(-"+n+"px)");break;case"top":o=d(a,e[s].type),o>=0&&(a.style.top=i*o+"px");break;case"bottom":o=d(a,e[s].type),o>=0&&(a.style.bottom=i*o+"px");break;default:console.error("Can't handled danmaku type: "+e[s].type)}o>=0&&(a.classList.add("dplayer-danmaku-move"),h.appendChild(a))}(u);return this.container.appendChild(h),h}}},{key:"play",value:function(){this.paused=!1}},{key:"pause",value:function(){this.paused=!0}},{key:"_measure",value:function(e){if(!this.context){var t=getComputedStyle(this.container.getElementsByClassName("dplayer-danmaku-item")[0],null);this.context=document.createElement("canvas").getContext("2d"),this.context.font=t.getPropertyValue("font")}return this.context.measureText(e).width}},{key:"seek",value:function(){this.clear();for(var e=0;e<this.dan.length;e++){if(this.dan[e].time>=this.options.time()){this.danIndex=e;break}this.danIndex=this.dan.length}}},{key:"clear",value:function(){this.danTunnel={right:{},top:{},bottom:{}},this.danIndex=0,this.options.container.innerHTML="",this.events&&this.events.trigger("danmaku_clear")}},{key:"htmlEncode",value:function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2f;")}},{key:"resize",value:function(){for(var e=this.container.offsetWidth,t=this.container.getElementsByClassName("dplayer-danmaku-item"),i=0;i<t.length;i++)t[i].style.transform="translateX(-"+e+"px)"}},{key:"hide",value:function(){this.showing=!1,this.pause(),this.clear(),this.events&&this.events.trigger("danmaku_hide")}},{key:"show",value:function(){this.seek(),this.showing=!0,this.play(),this.events&&this.events.trigger("danmaku_show")}},{key:"unlimit",value:function(e){this.unlimited=e}}]),e}();t.default=r},function(e,t,i){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),a=function(){function e(){n(this,e),this.events={},this.videoEvents=["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","mozaudioavailable","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],this.playerEvents=["screenshot","thumbnails_show","thumbnails_hide","danmaku_show","danmaku_hide","danmaku_clear","danmaku_loaded","danmaku_send","danmaku_opacity","contextmenu_show","contextmenu_hide","notice_show","notice_hide","quality_start","quality_end","destroy","resize","fullscreen","fullscreen_cancel","webfullscreen","webfullscreen_cancel","subtitle_show","subtitle_hide","subtitle_change"]}return s(e,[{key:"on",value:function(e,t){this.type(e)&&"function"==typeof t&&(this.events[e]||(this.events[e]=[]),this.events[e].push(t))}},{key:"trigger",value:function(e,t){if(this.events[e]&&this.events[e].length)for(var i=0;i<this.events[e].length;i++)this.events[e][i](t)}},{key:"type",value:function(e){return-1!==this.playerEvents.indexOf(e)?"player":-1!==this.videoEvents.indexOf(e)?"video":(console.error("Unknown event name: "+e),null)}}]),e}();t.default=a},function(e,t,i){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),a=i(0),r=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(){function e(t){var i=this;n(this,e),this.player=t,this.player.events.on("webfullscreen",(function(){i.player.resize()})),this.player.events.on("webfullscreen_cancel",(function(){i.player.resize(),r.default.setScrollPosition(i.lastScrollPosition)}));var s=function(){i.player.resize(),i.isFullScreen("browser")?i.player.events.trigger("fullscreen"):(r.default.setScrollPosition(i.lastScrollPosition),i.player.events.trigger("fullscreen_cancel"))};this.player.container.addEventListener("fullscreenchange",s),this.player.container.addEventListener("mozfullscreenchange",s),this.player.container.addEventListener("webkitfullscreenchange",s)}return s(e,[{key:"isFullScreen",value:function(){switch(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"browser"){case"browser":return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;case"web":return this.player.container.classList.contains("dplayer-fulled")}}},{key:"request",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"browser",t="browser"===e?"web":"browser",i=this.isFullScreen(t);switch(i||(this.lastScrollPosition=r.default.getScrollPosition()),e){case"browser":this.player.container.requestFullscreen?this.player.container.requestFullscreen():this.player.container.mozRequestFullScreen?this.player.container.mozRequestFullScreen():this.player.container.webkitRequestFullscreen?this.player.container.webkitRequestFullscreen():this.player.video.webkitEnterFullscreen&&this.player.video.webkitEnterFullscreen();break;case"web":this.player.container.classList.add("dplayer-fulled"),document.body.classList.add("dplayer-web-fullscreen-fix"),this.player.events.trigger("webfullscreen")}i&&this.cancel(t)}},{key:"cancel",value:function(){switch(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"browser"){case"browser":document.cancelFullScreen?document.cancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen();break;case"web":this.player.container.classList.remove("dplayer-fulled"),document.body.classList.remove("dplayer-web-fullscreen-fix"),this.player.events.trigger("webfullscreen_cancel")}}},{key:"toggle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"browser";this.isFullScreen(e)?this.cancel(e):this.request(e)}}]),e}();t.default=o},function(e,t,i){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),a=i(0),r=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(){function e(t){n(this,e),this.storageName={opacity:"dplayer-danmaku-opacity",volume:"dplayer-volume",unlimited:"dplayer-danmaku-unlimited",danmaku:"dplayer-danmaku-show",subtitle:"dplayer-subtitle-show"},this.default={opacity:.7,volume:t.options.volume||.7,unlimited:(t.options.danmaku&&t.options.danmaku.unlimited?1:0)||0,danmaku:1,subtitle:1},this.data={},this.init()}return s(e,[{key:"init",value:function(){for(var e in this.storageName){var t=this.storageName[e];this.data[e]=parseFloat(r.default.storage.get(t)||this.default[e])}}},{key:"get",value:function(e){return this.data[e]}},{key:"set",value:function(e,t){this.data[e]=t,r.default.storage.set(this.storageName[e],t)}}]),e}();t.default=o},function(e,t,i){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),a=function(){function e(t,i,s,a){n(this,e),this.container=t,this.video=i,this.options=s,this.events=a,this.init()}return s(e,[{key:"init",value:function(){var e=this;if(this.container.style.fontSize=this.options.fontSize,this.container.style.bottom=this.options.bottom,this.container.style.color=this.options.color,this.video.textTracks&&this.video.textTracks[0]){var t=this.video.textTracks[0];t.oncuechange=function(){var i=t.activeCues[0];if(i){e.container.innerHTML="";var n=document.createElement("p");n.appendChild(i.getCueAsHTML()),e.container.appendChild(n)}else e.container.innerHTML="";e.events.trigger("subtitle_change")}}}},{key:"show",value:function(){this.container.classList.remove("dplayer-subtitle-hide"),this.events.trigger("subtitle_show")}},{key:"hide",value:function(){this.container.classList.add("dplayer-subtitle-hide"),this.events.trigger("subtitle_hide")}},{key:"toggle",value:function(){this.container.classList.contains("dplayer-subtitle-hide")?this.show():this.hide()}}]),e}();t.default=a},function(e,t,i){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),a=function(){function e(t){n(this,e),this.elements={},this.elements.volume=t.volumeBar,this.elements.played=t.playedBar,this.elements.loaded=t.loadedBar,this.elements.danmaku=t.danmakuOpacityBar}return s(e,[{key:"set",value:function(e,t,i){t=Math.max(t,0),t=Math.min(t,1),this.elements[e].style[i]=100*t+"%"}},{key:"get",value:function(e){return parseFloat(this.elements[e].style.width)/100}}]),e}();t.default=a},function(e,t,i){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),a=i(0),r=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(){function e(t){n(this,e),this.player=t,window.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}(),this.types=["loading","progress","info","fps"],this.init()}return s(e,[{key:"init",value:function(){for(var e=0;e<this.types.length;e++){var t=this.types[e];"fps"!==t&&this["init"+t+"Checker"]()}}},{key:"initloadingChecker",value:function(){var e=this,t=0,i=0,n=!1;this.loadingChecker=setInterval((function(){e.enableloadingChecker&&(i=e.player.video.currentTime,n||i!==t||e.player.video.paused||(e.player.container.classList.add("dplayer-loading"),n=!0),n&&i>t&&!e.player.video.paused&&(e.player.container.classList.remove("dplayer-loading"),n=!1),t=i)}),100)}},{key:"initprogressChecker",value:function(){var e=this;this.progressChecker=setInterval((function(){if(e.enableprogressChecker){e.player.bar.set("played",e.player.video.currentTime/e.player.video.duration,"width");var t=r.default.secondToTime(e.player.video.currentTime);e.player.template.ptime.innerHTML!==t&&(e.player.template.ptime.innerHTML=r.default.secondToTime(e.player.video.currentTime))}}),100)}},{key:"initfpsChecker",value:function(){var e=this;window.requestAnimationFrame((function(){if(e.enablefpsChecker)if(e.initfpsChecker(),e.fpsStart){e.fpsIndex++;var t=new Date;t-e.fpsStart>1e3&&(e.player.infoPanel.fps(e.fpsIndex/(t-e.fpsStart)*1e3),e.fpsStart=new Date,e.fpsIndex=0)}else e.fpsStart=new Date,e.fpsIndex=0;else e.fpsStart=0,e.fpsIndex=0}))}},{key:"initinfoChecker",value:function(){var e=this;this.infoChecker=setInterval((function(){e.enableinfoChecker&&e.player.infoPanel.update()}),1e3)}},{key:"enable",value:function(e){this["enable"+e+"Checker"]=!0,"fps"===e&&this.initfpsChecker()}},{key:"disable",value:function(e){this["enable"+e+"Checker"]=!1}},{key:"destroy",value:function(e){this[e+"Checker"]&&clearInterval(this[e+"Checker"])}}]),e}();t.default=o},function(e,t,i){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),a=function(){function e(t){var i=this;n(this,e),this.container=t,this.container.addEventListener("animationend",(function(){i.container.classList.remove("dplayer-bezel-transition")}))}return s(e,[{key:"switch",value:function(e){this.container.innerHTML=e,this.container.classList.add("dplayer-bezel-transition")}}]),e}();t.default=a},function(e,t,i){function n(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=i(0),o=n(r),l=i(44),d=n(l),h=i(2),u=n(h),c=function(){function e(t){var i=this;s(this,e),this.player=t,this.autoHideTimer=0,o.default.isMobile||(this.player.container.addEventListener("mousemove",(function(){i.setAutoHide()})),this.player.container.addEventListener("click",(function(){i.setAutoHide()})),this.player.on("play",(function(){i.setAutoHide()})),this.player.on("pause",(function(){i.setAutoHide()}))),this.initPlayButton(),this.initThumbnails(),this.initPlayedBar(),this.initFullButton(),this.initQualityButton(),this.initScreenshotButton(),this.initSubtitleButton(),o.default.isMobile||this.initVolumeButton()}return a(e,[{key:"initPlayButton",value:function(){var e=this;this.player.template.playButton.addEventListener("click",(function(){e.player.toggle()})),o.default.isMobile?(this.player.template.videoWrap.addEventListener("click",(function(){e.toggle()})),this.player.template.controllerMask.addEventListener("click",(function(){e.toggle()}))):(this.player.template.videoWrap.addEventListener("click",(function(){e.player.toggle()})),this.player.template.controllerMask.addEventListener("click",(function(){e.player.toggle()})))}},{key:"initThumbnails",value:function(){var e=this;this.player.options.video.thumbnails&&(this.thumbnails=new d.default({container:this.player.template.barPreview,barWidth:this.player.template.barWrap.offsetWidth,url:this.player.options.video.thumbnails,events:this.player.events}),this.player.on("loadedmetadata",(function(){e.thumbnails.resize(160,e.player.video.videoHeight/e.player.video.videoWidth*160)})))}},{key:"initPlayedBar",value:function(){var e=this,t=function(t){var i=((t.clientX||t.changedTouches[0].clientX)-o.default.getElementViewLeft(e.player.template.playedBarWrap))/e.player.template.playedBarWrap.clientWidth;i=Math.max(i,0),i=Math.min(i,1),e.player.bar.set("played",i,"width"),e.player.template.ptime.innerHTML=o.default.secondToTime(i*e.player.video.duration)},i=function i(n){document.removeEventListener(o.default.nameMap.dragEnd,i),document.removeEventListener(o.default.nameMap.dragMove,t);var s=((n.clientX||n.changedTouches[0].clientX)-o.default.getElementViewLeft(e.player.template.playedBarWrap))/e.player.template.playedBarWrap.clientWidth;s=Math.max(s,0),s=Math.min(s,1),e.player.bar.set("played",s,"width"),e.player.seek(e.player.bar.get("played")*e.player.video.duration),e.player.time.enable("progress")};this.player.template.playedBarWrap.addEventListener(o.default.nameMap.dragStart,(function(){e.player.time.disable("progress"),document.addEventListener(o.default.nameMap.dragMove,t),document.addEventListener(o.default.nameMap.dragEnd,i)})),this.player.template.playedBarWrap.addEventListener(o.default.nameMap.dragMove,(function(t){if(e.player.video.duration){var i=o.default.cumulativeOffset(e.player.template.playedBarWrap).left,n=(t.clientX||t.changedTouches[0].clientX)-i;if(n<0||n>e.player.template.playedBarWrap.offsetWidth)return;var s=e.player.video.duration*(n/e.player.template.playedBarWrap.offsetWidth);o.default.isMobile&&e.thumbnails&&e.thumbnails.show(),e.thumbnails&&e.thumbnails.move(n),e.player.template.playedBarTime.style.left=n-20+"px",e.player.template.playedBarTime.innerText=o.default.secondToTime(s),e.player.template.playedBarTime.classList.remove("hidden")}})),this.player.template.playedBarWrap.addEventListener(o.default.nameMap.dragEnd,(function(){o.default.isMobile&&e.thumbnails&&e.thumbnails.hide()})),o.default.isMobile||(this.player.template.playedBarWrap.addEventListener("mouseenter",(function(){e.player.video.duration&&(e.thumbnails&&e.thumbnails.show(),e.player.template.playedBarTime.classList.remove("hidden"))})),this.player.template.playedBarWrap.addEventListener("mouseleave",(function(){e.player.video.duration&&(e.thumbnails&&e.thumbnails.hide(),e.player.template.playedBarTime.classList.add("hidden"))})))}},{key:"initFullButton",value:function(){var e=this;this.player.template.browserFullButton.addEventListener("click",(function(){e.player.fullScreen.toggle("browser")})),this.player.template.webFullButton.addEventListener("click",(function(){e.player.fullScreen.toggle("web")}))}},{key:"initVolumeButton",value:function(){var e=this,t=function(t){var i=t||window.event,n=((i.clientX||i.changedTouches[0].clientX)-o.default.getElementViewLeft(e.player.template.volumeBarWrap)-5.5)/35;e.player.volume(n)},i=function i(){document.removeEventListener(o.default.nameMap.dragEnd,i),document.removeEventListener(o.default.nameMap.dragMove,t),e.player.template.volumeButton.classList.remove("dplayer-volume-active")};this.player.template.volumeBarWrapWrap.addEventListener("click",(function(t){var i=t||window.event,n=((i.clientX||i.changedTouches[0].clientX)-o.default.getElementViewLeft(e.player.template.volumeBarWrap)-5.5)/35;e.player.volume(n)})),this.player.template.volumeBarWrapWrap.addEventListener(o.default.nameMap.dragStart,(function(){document.addEventListener(o.default.nameMap.dragMove,t),document.addEventListener(o.default.nameMap.dragEnd,i),e.player.template.volumeButton.classList.add("dplayer-volume-active")})),this.player.template.volumeIcon.addEventListener("click",(function(){e.player.video.muted?(e.player.video.muted=!1,e.player.switchVolumeIcon(),e.player.bar.set("volume",e.player.volume(),"width")):(e.player.video.muted=!0,e.player.template.volumeIcon.innerHTML=u.default.volumeOff,e.player.bar.set("volume",0,"width"))}))}},{key:"initQualityButton",value:function(){var e=this;this.player.options.video.quality&&this.player.template.qualityList.addEventListener("click",(function(t){t.target.classList.contains("dplayer-quality-item")&&e.player.switchQuality(t.target.dataset.index)}))}},{key:"initScreenshotButton",value:function(){var e=this;this.player.options.screenshot&&this.player.template.camareButton.addEventListener("click",(function(){var t=document.createElement("canvas");t.width=e.player.video.videoWidth,t.height=e.player.video.videoHeight,t.getContext("2d").drawImage(e.player.video,0,0,t.width,t.height);var i=void 0;t.toBlob((function(e){i=URL.createObjectURL(e);var t=document.createElement("a");t.href=i,t.download="DPlayer.png",t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(i)})),e.player.events.trigger("screenshot",i)}))}},{key:"initSubtitleButton",value:function(){var e=this;this.player.options.subtitle&&(this.player.events.on("subtitle_show",(function(){e.player.template.subtitleButton.dataset.balloon=e.player.tran("Hide subtitle"),e.player.template.subtitleButtonInner.style.opacity="",e.player.user.set("subtitle",1)})),this.player.events.on("subtitle_hide",(function(){e.player.template.subtitleButton.dataset.balloon=e.player.tran("Show subtitle"),e.player.template.subtitleButtonInner.style.opacity="0.4",e.player.user.set("subtitle",0)})),this.player.template.subtitleButton.addEventListener("click",(function(){e.player.subtitle.toggle()})))}},{key:"setAutoHide",value:function(){var e=this;this.show(),clearTimeout(this.autoHideTimer),this.autoHideTimer=setTimeout((function(){!e.player.video.played.length||e.player.paused||e.disableAutoHide||e.hide()}),3e3)}},{key:"show",value:function(){this.player.container.classList.remove("dplayer-hide-controller")}},{key:"hide",value:function(){this.player.container.classList.add("dplayer-hide-controller"),this.player.setting.hide(),this.player.comment&&this.player.comment.hide()}},{key:"isShow",value:function(){return!this.player.container.classList.contains("dplayer-hide-controller")}},{key:"toggle",value:function(){this.isShow()?this.hide():this.show()}},{key:"destroy",value:function(){clearTimeout(this.autoHideTimer)}}]),e}();t.default=c},function(e,t,i){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),a=function(){function e(t){n(this,e),this.container=t.container,this.barWidth=t.barWidth,this.container.style.backgroundImage="url('"+t.url+"')",this.events=t.events}return s(e,[{key:"resize",value:function(e,t){this.container.style.width=e+"px",this.container.style.height=t+"px",this.container.style.top=2-t+"px"}},{key:"show",value:function(){this.container.style.display="block",this.events&&this.events.trigger("thumbnails_show")}},{key:"move",value:function(e){this.container.style.backgroundPosition="-"+160*(Math.ceil(e/this.barWidth*100)-1)+"px 0",this.container.style.left=e-this.container.offsetWidth/2+"px"}},{key:"hide",value:function(){this.container.style.display="none",this.events&&this.events.trigger("thumbnails_hide")}}]),e}();t.default=a},function(e,t,i){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),a=i(0),r=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(){function e(t){var i=this;n(this,e),this.player=t,this.player.template.mask.addEventListener("click",(function(){i.hide()})),this.player.template.settingButton.addEventListener("click",(function(){i.show()})),this.loop=this.player.options.loop,this.player.template.loopToggle.checked=this.loop,this.player.template.loop.addEventListener("click",(function(){i.player.template.loopToggle.checked=!i.player.template.loopToggle.checked,i.player.template.loopToggle.checked?i.loop=!0:i.loop=!1,i.hide()})),this.showDanmaku=this.player.user.get("danmaku"),this.showDanmaku||this.player.danmaku&&this.player.danmaku.hide(),this.player.template.showDanmakuToggle.checked=this.showDanmaku,this.player.template.showDanmaku.addEventListener("click",(function(){i.player.template.showDanmakuToggle.checked=!i.player.template.showDanmakuToggle.checked,i.player.template.showDanmakuToggle.checked?(i.showDanmaku=!0,i.player.danmaku.show()):(i.showDanmaku=!1,i.player.danmaku.hide()),i.player.user.set("danmaku",i.showDanmaku?1:0),i.hide()})),this.unlimitDanmaku=this.player.user.get("unlimited"),this.player.template.unlimitDanmakuToggle.checked=this.unlimitDanmaku,this.player.template.unlimitDanmaku.addEventListener("click",(function(){i.player.template.unlimitDanmakuToggle.checked=!i.player.template.unlimitDanmakuToggle.checked,i.player.template.unlimitDanmakuToggle.checked?(i.unlimitDanmaku=!0,i.player.danmaku.unlimit(!0)):(i.unlimitDanmaku=!1,i.player.danmaku.unlimit(!1)),i.player.user.set("unlimited",i.unlimitDanmaku?1:0),i.hide()})),this.player.template.speed.addEventListener("click",(function(){i.player.template.settingBox.classList.add("dplayer-setting-box-narrow"),i.player.template.settingBox.classList.add("dplayer-setting-box-speed")}));for(var s=0;s<this.player.template.speedItem.length;s++)!function(e){i.player.template.speedItem[e].addEventListener("click",(function(){i.player.speed(i.player.template.speedItem[e].dataset.speed),i.hide()}))}(s);if(this.player.danmaku){this.player.on("danmaku_opacity",(function(e){i.player.bar.set("danmaku",e,"width"),i.player.user.set("opacity",e)})),this.player.danmaku.opacity(this.player.user.get("opacity"));var a=function(e){var t=e||window.event,n=((t.clientX||t.changedTouches[0].clientX)-r.default.getElementViewLeft(i.player.template.danmakuOpacityBarWrap))/130;n=Math.max(n,0),n=Math.min(n,1),i.player.danmaku.opacity(n)},o=function e(){document.removeEventListener(r.default.nameMap.dragEnd,e),document.removeEventListener(r.default.nameMap.dragMove,a),i.player.template.danmakuOpacityBox.classList.remove("dplayer-setting-danmaku-active")};this.player.template.danmakuOpacityBarWrapWrap.addEventListener("click",(function(e){var t=e||window.event,n=((t.clientX||t.changedTouches[0].clientX)-r.default.getElementViewLeft(i.player.template.danmakuOpacityBarWrap))/130;n=Math.max(n,0),n=Math.min(n,1),i.player.danmaku.opacity(n)})),this.player.template.danmakuOpacityBarWrapWrap.addEventListener(r.default.nameMap.dragStart,(function(){document.addEventListener(r.default.nameMap.dragMove,a),document.addEventListener(r.default.nameMap.dragEnd,o),i.player.template.danmakuOpacityBox.classList.add("dplayer-setting-danmaku-active")}))}}return s(e,[{key:"hide",value:function(){var e=this;this.player.template.settingBox.classList.remove("dplayer-setting-box-open"),this.player.template.mask.classList.remove("dplayer-mask-show"),setTimeout((function(){e.player.template.settingBox.classList.remove("dplayer-setting-box-narrow"),e.player.template.settingBox.classList.remove("dplayer-setting-box-speed")}),300),this.player.controller.disableAutoHide=!1}},{key:"show",value:function(){this.player.template.settingBox.classList.add("dplayer-setting-box-open"),this.player.template.mask.classList.add("dplayer-mask-show"),this.player.controller.disableAutoHide=!0}}]),e}();t.default=o},function(e,t,i){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),a=function(){function e(t){var i=this;n(this,e),this.player=t,this.player.template.mask.addEventListener("click",(function(){i.hide()})),this.player.template.commentButton.addEventListener("click",(function(){i.show()})),this.player.template.commentSettingButton.addEventListener("click",(function(){i.toggleSetting()})),this.player.template.commentColorSettingBox.addEventListener("click",(function(){if(i.player.template.commentColorSettingBox.querySelector("input:checked+span")){var e=i.player.template.commentColorSettingBox.querySelector("input:checked").value;i.player.template.commentSettingFill.style.fill=e,i.player.template.commentInput.style.color=e,i.player.template.commentSendFill.style.fill=e}})),this.player.template.commentInput.addEventListener("click",(function(){i.hideSetting()})),this.player.template.commentInput.addEventListener("keydown",(function(e){13===(e||window.event).keyCode&&i.send()})),this.player.template.commentSendButton.addEventListener("click",(function(){i.send()}))}return s(e,[{key:"show",value:function(){this.player.controller.disableAutoHide=!0,this.player.template.controller.classList.add("dplayer-controller-comment"),this.player.template.mask.classList.add("dplayer-mask-show"),this.player.container.classList.add("dplayer-show-controller"),this.player.template.commentInput.focus()}},{key:"hide",value:function(){this.player.template.controller.classList.remove("dplayer-controller-comment"),this.player.template.mask.classList.remove("dplayer-mask-show"),this.player.container.classList.remove("dplayer-show-controller"),this.player.controller.disableAutoHide=!1,this.hideSetting()}},{key:"showSetting",value:function(){this.player.template.commentSettingBox.classList.add("dplayer-comment-setting-open")}},{key:"hideSetting",value:function(){this.player.template.commentSettingBox.classList.remove("dplayer-comment-setting-open")}},{key:"toggleSetting",value:function(){this.player.template.commentSettingBox.classList.contains("dplayer-comment-setting-open")?this.hideSetting():this.showSetting()}},{key:"send",value:function(){var e=this;this.player.template.commentInput.blur(),this.player.template.commentInput.value.replace(/^\s+|\s+$/g,"")?this.player.danmaku.send({text:this.player.template.commentInput.value,color:this.player.container.querySelector(".dplayer-comment-setting-color input:checked").value,type:this.player.container.querySelector(".dplayer-comment-setting-type input:checked").value},(function(){e.player.template.commentInput.value="",e.hide()})):this.player.notice(this.player.tran("Please input danmaku content!"))}}]),e}();t.default=a},function(e,t,i){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function e(t){n(this,e),t.options.hotkey&&document.addEventListener("keydown",(function(e){if(t.focus){var i=document.activeElement.tagName.toUpperCase(),n=document.activeElement.getAttribute("contenteditable");if("INPUT"!==i&&"TEXTAREA"!==i&&""!==n&&"true"!==n){var s=e||window.event,a=void 0;switch(s.keyCode){case 32:s.preventDefault(),t.toggle();break;case 37:s.preventDefault(),t.seek(t.video.currentTime-5),t.controller.setAutoHide();break;case 39:s.preventDefault(),t.seek(t.video.currentTime+5),t.controller.setAutoHide();break;case 38:s.preventDefault(),a=t.volume()+.1,t.volume(a);break;case 40:s.preventDefault(),a=t.volume()-.1,t.volume(a)}}}})),document.addEventListener("keydown",(function(e){switch((e||window.event).keyCode){case 27:t.fullScreen.isFullScreen("web")&&t.fullScreen.cancel("web")}}))};t.default=s},function(e,t,i){function n(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(){function e(t){var i=this;s(this,e),this.player=t,[].concat(n(this.player.template.menuItem)).map((function(e,t){return i.player.options.contextmenu[t].click&&e.addEventListener("click",(function(){i.player.options.contextmenu[t].click(i.player),i.hide()})),e})),this.player.container.addEventListener("contextmenu",(function(e){var t=e||window.event;t.preventDefault();var n=i.player.container.getBoundingClientRect();i.show(t.clientX-n.left,t.clientY-n.top),i.player.template.mask.addEventListener("click",(function(){i.hide()}))}))}return a(e,[{key:"show",value:function(e,t){this.player.template.menu.classList.add("dplayer-menu-show");var i=this.player.container.getBoundingClientRect();e+this.player.template.menu.offsetWidth>=i.width?(this.player.template.menu.style.right=i.width-e+"px",this.player.template.menu.style.left="initial"):(this.player.template.menu.style.left=e+"px",this.player.template.menu.style.right="initial"),t+this.player.template.menu.offsetHeight>=i.height?(this.player.template.menu.style.bottom=i.height-t+"px",this.player.template.menu.style.top="initial"):(this.player.template.menu.style.top=t+"px",this.player.template.menu.style.bottom="initial"),this.player.template.mask.classList.add("dplayer-mask-show"),this.player.events.trigger("contextmenu_show")}},{key:"hide",value:function(){this.player.template.mask.classList.remove("dplayer-mask-show"),this.player.template.menu.classList.remove("dplayer-menu-show"),this.player.events.trigger("contextmenu_hide")}}]),e}();t.default=r},function(e,t,i){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),a=function(){function e(t){var i=this;n(this,e),this.container=t.template.infoPanel,this.template=t.template,this.video=t.video,this.player=t,this.template.infoPanelClose.addEventListener("click",(function(){i.hide()}))}return s(e,[{key:"show",value:function(){this.beginTime=Date.now(),this.update(),this.player.time.enable("info"),this.player.time.enable("fps"),this.container.classList.remove("dplayer-info-panel-hide")}},{key:"hide",value:function(){this.player.time.disable("info"),this.player.time.disable("fps"),this.container.classList.add("dplayer-info-panel-hide")}},{key:"triggle",value:function(){this.container.classList.contains("dplayer-info-panel-hide")?this.show():this.hide()}},{key:"update",value:function(){this.template.infoVersion.innerHTML="v1.22.2 d3847a3",this.template.infoType.innerHTML=this.player.type,this.template.infoUrl.innerHTML=this.player.options.video.url,this.template.infoResolution.innerHTML=this.player.video.videoWidth+" x "+this.player.video.videoHeight,this.template.infoDuration.innerHTML=this.player.video.duration,this.player.options.danmaku&&(this.template.infoDanmakuId.innerHTML=this.player.options.danmaku.id,this.template.infoDanmakuApi.innerHTML=this.player.options.danmaku.api,this.template.infoDanmakuAmount.innerHTML=this.player.danmaku.dan.length)}},{key:"fps",value:function(e){this.template.infoFPS.innerHTML=""+e.toFixed(1)}}]),e}();t.default=a}]).default}))})),DPlayer=unwrapExports(DPlayer_min),DPlayer_min_1=DPlayer_min.DPlayer,VueDPlayer={props:{options:{type:Object}},data:function(){return{dp:null}},mounted:function(){var e=this;this.options.container=this.$el;var t=this.dp=new DPlayer(this.options),i=t.events;Object.keys(i).forEach((function(n){if("events"===n)return!1;i[n].forEach((function(i){t.on(i,(function(){return e.$emit(i)}))}))}))},install:function(e,t){void 0===t&&(t={});var i=t.name;void 0===i&&(i="d-player"),e.component(i,this)},render:function(e){return e("div",{class:"dplayer"},[])}};return"undefined"!==typeof window&&window.Vue&&(window.VueDPlayer=VueDPlayer),VueDPlayer}))}).call(this,__webpack_require__("c8ba"))},"975e":function(e,t,i){"use strict";var n=i("9efd"),s="/api/admin/photos",a={query:function(e){return Object(n["a"])({url:s,params:e,method:"get"})},create:function(e){return Object(n["a"])({url:s,data:e,method:"post"})},update:function(e,t){return Object(n["a"])({url:"".concat(s,"/").concat(e),method:"put",data:t})},delete:function(e){return Object(n["a"])({url:"".concat(s,"/").concat(e),method:"delete"})},listTeams:function(){return Object(n["a"])({url:"".concat(s,"/teams"),method:"get"})}};t["a"]=a},d2be:function(e,t){var i=arguments[3],n=arguments[4],s=arguments[5],a=JSON.stringify;e.exports=function(e,t){for(var r,o=Object.keys(s),l=0,d=o.length;l<d;l++){var h=o[l],u=s[h].exports;if(u===e||u&&u.default===e){r=h;break}}if(!r){r=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var c={};for(l=0,d=o.length;l<d;l++){h=o[l];c[h]=h}n[r]=["function(require,module,exports){"+e+"(self); }",c]}var p=Math.floor(Math.pow(16,8)*Math.random()).toString(16),m={};m[r]=r,n[p]=["function(require,module,exports){var f = require("+a(r)+");(f.default ? f.default : f)(self);}",m];var f={};function _(e){for(var t in f[e]=!0,n[e][1]){var i=n[e][1][t];f[i]||_(i)}}_(p);var y="("+i+")({"+Object.keys(f).map((function(e){return a(e)+":["+n[e][0]+","+a(n[e][1])+"]"})).join(",")+"},{},["+a(p)+"])",g=window.URL||window.webkitURL||window.mozURL||window.msURL,v=new Blob([y],{type:"text/javascript"});if(t&&t.bare)return v;var b=g.createObjectURL(v),E=new Worker(b);return E.objectURL=b,E}},faa1:function(e,t,i){"use strict";var n,s="object"===typeof Reflect?Reflect:null,a=s&&"function"===typeof s.apply?s.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};function r(e){console&&console.warn&&console.warn(e)}n=s&&"function"===typeof s.ownKeys?s.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!==e};function l(){l.init.call(this)}e.exports=l,l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var d=10;function h(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?l.defaultMaxListeners:e._maxListeners}function c(e,t,i,n){var s,a,o;if(h(i),a=e._events,void 0===a?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),a=e._events),o=a[t]),void 0===o)o=a[t]=i,++e._eventsCount;else if("function"===typeof o?o=a[t]=n?[i,o]:[o,i]:n?o.unshift(i):o.push(i),s=u(e),s>0&&o.length>s&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,r(l)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},s=p.bind(n);return s.listener=i,n.wrapFn=s,s}function f(e,t,i){var n=e._events;if(void 0===n)return[];var s=n[t];return void 0===s?[]:"function"===typeof s?i?[s.listener||s]:[s]:i?v(s):y(s,s.length)}function _(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"===typeof i)return 1;if(void 0!==i)return i.length}return 0}function y(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}function g(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(e){if("number"!==typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");d=e}}),l.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(e){if("number"!==typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},l.prototype.getMaxListeners=function(){return u(this)},l.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){var r;if(t.length>0&&(r=t[0]),r instanceof Error)throw r;var o=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw o.context=r,o}var l=s[e];if(void 0===l)return!1;if("function"===typeof l)a(l,this,t);else{var d=l.length,h=y(l,d);for(i=0;i<d;++i)a(h[i],this,t)}return!0},l.prototype.addListener=function(e,t){return c(this,e,t,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(e,t){return c(this,e,t,!0)},l.prototype.once=function(e,t){return h(t),this.on(e,m(this,e,t)),this},l.prototype.prependOnceListener=function(e,t){return h(t),this.prependListener(e,m(this,e,t)),this},l.prototype.removeListener=function(e,t){var i,n,s,a,r;if(h(t),n=this._events,void 0===n)return this;if(i=n[e],void 0===i)return this;if(i===t||i.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!==typeof i){for(s=-1,a=i.length-1;a>=0;a--)if(i[a]===t||i[a].listener===t){r=i[a].listener,s=a;break}if(s<0)return this;0===s?i.shift():g(i,s),1===i.length&&(n[e]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",e,r||t)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(e){var t,i,n;if(i=this._events,void 0===i)return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var s,a=Object.keys(i);for(n=0;n<a.length;++n)s=a[n],"removeListener"!==s&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=i[e],"function"===typeof t)this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},l.prototype.listeners=function(e){return f(this,e,!0)},l.prototype.rawListeners=function(e){return f(this,e,!1)},l.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):_.call(e,t)},l.prototype.listenerCount=_,l.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}}}]);