@byteplus/veplayer 1.18.0-rc.9 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lite.cjs CHANGED
@@ -1,2 +1,2 @@
1
- // @byteplus/veplayer@1.18.0-rc.9 Built @8/27/2026, 11:49:39 AM
2
- "use strict";var e,t=Object.defineProperty,i=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,s=Math.pow,l=(e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n,c=(e,t)=>{for(var i in t||(t={}))o.call(t,i)&&l(e,i,t[i]);if(r)for(var i of r(t))a.call(t,i)&&l(e,i,t[i]);return e},u=(e,t)=>i(e,n(t)),h=(e,t)=>{var i={};for(var n in e)o.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&r)for(var n of r(e))t.indexOf(n)<0&&a.call(e,n)&&(i[n]=e[n]);return i},d=(e,t,i)=>new Promise(((n,r)=>{var o=e=>{try{s(i.next(e))}catch(hs){r(hs)}},a=e=>{try{s(i.throw(e))}catch(hs){r(hs)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(o,a);s((i=i.apply(e,t)).next())}));function f(e,t){return e===t||e!=e&&t!=t}function p(e,t){for(var i=e.length;i--;)if(f(e[i][0],t))return i;return-1}Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var g=Array.prototype.splice;function y(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}y.prototype.clear=function(){this.__data__=[],this.size=0},y.prototype.delete=function(e){var t=this.__data__,i=p(t,e);return!(i<0)&&(i==t.length-1?t.pop():g.call(t,i,1),--this.size,!0)},y.prototype.get=function(e){var t=this.__data__,i=p(t,e);return i<0?void 0:t[i][1]},y.prototype.has=function(e){return p(this.__data__,e)>-1},y.prototype.set=function(e,t){var i=this.__data__,n=p(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};const v="object"==typeof global&&global&&global.Object===Object&&global;var m="object"==typeof self&&self&&self.Object===Object&&self;const _=v||m||Function("return this")();const E=_.Symbol;var T=Object.prototype,S=T.hasOwnProperty,b=T.toString,C=E?E.toStringTag:void 0;var k=Object.prototype.toString;var I="[object Null]",P="[object Undefined]",D=E?E.toStringTag:void 0;function w(e){return null==e?void 0===e?P:I:D&&D in Object(e)?function(e){var t=S.call(e,C),i=e[C];try{e[C]=void 0;var n=!0}catch(hs){}var r=b.call(e);return n&&(t?e[C]=i:delete e[C]),r}(e):function(e){return k.call(e)}(e)}function A(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var R="[object AsyncFunction]",x="[object Function]",O="[object GeneratorFunction]",L="[object Proxy]";function N(e){if(!A(e))return!1;var t=w(e);return t==x||t==O||t==R||t==L}const M=_["__core-js_shared__"];var U,B=(U=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"";var F=Function.prototype.toString;function H(e){if(null!=e){try{return F.call(e)}catch(hs){}try{return e+""}catch(hs){}}return""}var j=/^\[object .+?Constructor\]$/,V=Function.prototype,K=Object.prototype,W=V.toString,G=K.hasOwnProperty,Y=RegExp("^"+W.call(G).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function z(e){return!(!A(e)||(t=e,B&&B in t))&&(N(e)?Y:j).test(H(e));var t}function $(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return z(i)?i:void 0}const X=$(_,"Map");const q=$(Object,"create");var Z=Object.prototype.hasOwnProperty;var Q=Object.prototype.hasOwnProperty;function J(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function ee(e,t){var i,n,r=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof t?"string":"hash"]:r.map}function te(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}J.prototype.clear=function(){this.__data__=q?q(null):{},this.size=0},J.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},J.prototype.get=function(e){var t=this.__data__;if(q){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return Z.call(t,e)?t[e]:void 0},J.prototype.has=function(e){var t=this.__data__;return q?void 0!==t[e]:Q.call(t,e)},J.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=q&&void 0===t?"__lodash_hash_undefined__":t,this},te.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(X||y),string:new J}},te.prototype.delete=function(e){var t=ee(this,e).delete(e);return this.size-=t?1:0,t},te.prototype.get=function(e){return ee(this,e).get(e)},te.prototype.has=function(e){return ee(this,e).has(e)},te.prototype.set=function(e,t){var i=ee(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function ie(e){var t=this.__data__=new y(e);this.size=t.size}ie.prototype.clear=function(){this.__data__=new y,this.size=0},ie.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},ie.prototype.get=function(e){return this.__data__.get(e)},ie.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.set=function(e,t){var i=this.__data__;if(i instanceof y){var n=i.__data__;if(!X||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new te(n)}return i.set(e,t),this.size=i.size,this};var ne=function(){try{var e=$(Object,"defineProperty");return e({},"",{}),e}catch(hs){}}();const re=ne;function oe(e,t,i){"__proto__"==t&&re?re(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}var ae=Object.prototype.hasOwnProperty;function se(e,t,i){var n=e[t];ae.call(e,t)&&f(n,i)&&(void 0!==i||t in e)||oe(e,t,i)}function le(e,t,i,n){var r=!i;i||(i={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=n?n(i[s],e[s],s,i,e):void 0;void 0===l&&(l=e[s]),r?oe(i,s,l):se(i,s,l)}return i}function ce(e){return null!=e&&"object"==typeof e}function ue(e){return ce(e)&&"[object Arguments]"==w(e)}var he=Object.prototype,de=he.hasOwnProperty,fe=he.propertyIsEnumerable;const pe=ue(function(){return arguments}())?ue:function(e){return ce(e)&&de.call(e,"callee")&&!fe.call(e,"callee")};const ge=Array.isArray;var ye="object"==typeof exports&&exports&&!exports.nodeType&&exports,ve=ye&&"object"==typeof module&&module&&!module.nodeType&&module,me=ve&&ve.exports===ye?_.Buffer:void 0;const _e=(me?me.isBuffer:void 0)||function(){return!1};var Ee=9007199254740991,Te=/^(?:0|[1-9]\d*)$/;function Se(e,t){var i=typeof e;return!!(t=null==t?Ee:t)&&("number"==i||"symbol"!=i&&Te.test(e))&&e>-1&&e%1==0&&e<t}var be=9007199254740991;function Ce(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=be}var ke={};function Ie(e){return function(t){return e(t)}}ke["[object Float32Array]"]=ke["[object Float64Array]"]=ke["[object Int8Array]"]=ke["[object Int16Array]"]=ke["[object Int32Array]"]=ke["[object Uint8Array]"]=ke["[object Uint8ClampedArray]"]=ke["[object Uint16Array]"]=ke["[object Uint32Array]"]=!0,ke["[object Arguments]"]=ke["[object Array]"]=ke["[object ArrayBuffer]"]=ke["[object Boolean]"]=ke["[object DataView]"]=ke["[object Date]"]=ke["[object Error]"]=ke["[object Function]"]=ke["[object Map]"]=ke["[object Number]"]=ke["[object Object]"]=ke["[object RegExp]"]=ke["[object Set]"]=ke["[object String]"]=ke["[object WeakMap]"]=!1;var Pe="object"==typeof exports&&exports&&!exports.nodeType&&exports,De=Pe&&"object"==typeof module&&module&&!module.nodeType&&module,we=De&&De.exports===Pe&&v.process;const Ae=function(){try{var e=De&&De.require&&De.require("util").types;return e||we&&we.binding&&we.binding("util")}catch(hs){}}();var Re=Ae&&Ae.isTypedArray;const xe=Re?Ie(Re):function(e){return ce(e)&&Ce(e.length)&&!!ke[w(e)]};var Oe=Object.prototype.hasOwnProperty;function Le(e,t){var i=ge(e),n=!i&&pe(e),r=!i&&!n&&_e(e),o=!i&&!n&&!r&&xe(e),a=i||n||r||o,s=a?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(e.length,String):[],l=s.length;for(var c in e)!t&&!Oe.call(e,c)||a&&("length"==c||r&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Se(c,l))||s.push(c);return s}var Ne=Object.prototype;function Me(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ne)}function Ue(e,t){return function(i){return e(t(i))}}const Be=Ue(Object.keys,Object);var Fe=Object.prototype.hasOwnProperty;function He(e){return null!=e&&Ce(e.length)&&!N(e)}function je(e){return He(e)?Le(e):function(e){if(!Me(e))return Be(e);var t=[];for(var i in Object(e))Fe.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e)}var Ve=Object.prototype.hasOwnProperty;function Ke(e){if(!A(e))return function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}(e);var t=Me(e),i=[];for(var n in e)("constructor"!=n||!t&&Ve.call(e,n))&&i.push(n);return i}function We(e){return He(e)?Le(e,!0):Ke(e)}var Ge="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ye=Ge&&"object"==typeof module&&module&&!module.nodeType&&module,ze=Ye&&Ye.exports===Ge?_.Buffer:void 0,$e=ze?ze.allocUnsafe:void 0;function Xe(e,t){if(t)return e.slice();var i=e.length,n=$e?$e(i):new e.constructor(i);return e.copy(n),n}function qe(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t}function Ze(){return[]}var Qe=Object.prototype.propertyIsEnumerable,Je=Object.getOwnPropertySymbols;const et=Je?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var i=-1,n=null==e?0:e.length,r=0,o=[];++i<n;){var a=e[i];t(a,i,e)&&(o[r++]=a)}return o}(Je(e),(function(t){return Qe.call(e,t)})))}:Ze;function tt(e,t){for(var i=-1,n=t.length,r=e.length;++i<n;)e[r+i]=t[i];return e}const it=Ue(Object.getPrototypeOf,Object);const nt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)tt(t,et(e)),e=it(e);return t}:Ze;function rt(e,t,i){var n=t(e);return ge(e)?n:tt(n,i(e))}function ot(e){return rt(e,je,et)}function at(e){return rt(e,We,nt)}const st=$(_,"DataView");const lt=$(_,"Promise");const ct=$(_,"Set");const ut=$(_,"WeakMap");var ht="[object Map]",dt="[object Promise]",ft="[object Set]",pt="[object WeakMap]",gt="[object DataView]",yt=H(st),vt=H(X),mt=H(lt),_t=H(ct),Et=H(ut),Tt=w;(st&&Tt(new st(new ArrayBuffer(1)))!=gt||X&&Tt(new X)!=ht||lt&&Tt(lt.resolve())!=dt||ct&&Tt(new ct)!=ft||ut&&Tt(new ut)!=pt)&&(Tt=function(e){var t=w(e),i="[object Object]"==t?e.constructor:void 0,n=i?H(i):"";if(n)switch(n){case yt:return gt;case vt:return ht;case mt:return dt;case _t:return ft;case Et:return pt}return t});const St=Tt;var bt=Object.prototype.hasOwnProperty;const Ct=_.Uint8Array;function kt(e){var t=new e.constructor(e.byteLength);return new Ct(t).set(new Ct(e)),t}var It=/\w*$/;var Pt=E?E.prototype:void 0,Dt=Pt?Pt.valueOf:void 0;function wt(e,t){var i=t?kt(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}var At="[object Boolean]",Rt="[object Date]",xt="[object Map]",Ot="[object Number]",Lt="[object RegExp]",Nt="[object Set]",Mt="[object String]",Ut="[object Symbol]",Bt="[object ArrayBuffer]",Ft="[object DataView]",Ht="[object Float32Array]",jt="[object Float64Array]",Vt="[object Int8Array]",Kt="[object Int16Array]",Wt="[object Int32Array]",Gt="[object Uint8Array]",Yt="[object Uint8ClampedArray]",zt="[object Uint16Array]",$t="[object Uint32Array]";function Xt(e,t,i){var n,r=e.constructor;switch(t){case Bt:return kt(e);case At:case Rt:return new r(+e);case Ft:return function(e,t){var i=t?kt(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,i);case Ht:case jt:case Vt:case Kt:case Wt:case Gt:case Yt:case zt:case $t:return wt(e,i);case xt:return new r;case Ot:case Mt:return new r(e);case Lt:return function(e){var t=new e.constructor(e.source,It.exec(e));return t.lastIndex=e.lastIndex,t}(e);case Nt:return new r;case Ut:return n=e,Dt?Object(Dt.call(n)):{}}}var qt=Object.create,Zt=function(){function e(){}return function(t){if(!A(t))return{};if(qt)return qt(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();const Qt=Zt;function Jt(e){return"function"!=typeof e.constructor||Me(e)?{}:Qt(it(e))}var ei=Ae&&Ae.isMap;const ti=ei?Ie(ei):function(e){return ce(e)&&"[object Map]"==St(e)};var ii=Ae&&Ae.isSet;const ni=ii?Ie(ii):function(e){return ce(e)&&"[object Set]"==St(e)};var ri=1,oi=2,ai=4,si="[object Arguments]",li="[object Function]",ci="[object GeneratorFunction]",ui="[object Object]",hi={};function di(e,t,i,n,r,o){var a,s=t&ri,l=t&oi,c=t&ai;if(i&&(a=r?i(e,n,r,o):i(e)),void 0!==a)return a;if(!A(e))return e;var u=ge(e);if(u){if(a=function(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&bt.call(e,"index")&&(i.index=e.index,i.input=e.input),i}(e),!s)return qe(e,a)}else{var h=St(e),d=h==li||h==ci;if(_e(e))return Xe(e,s);if(h==ui||h==si||d&&!r){if(a=l||d?{}:Jt(e),!s)return l?function(e,t){return le(e,nt(e),t)}(e,function(e,t){return e&&le(t,We(t),e)}(a,e)):function(e,t){return le(e,et(e),t)}(e,function(e,t){return e&&le(t,je(t),e)}(a,e))}else{if(!hi[h])return r?e:{};a=Xt(e,h,s)}}o||(o=new ie);var f=o.get(e);if(f)return f;o.set(e,a),ni(e)?e.forEach((function(n){a.add(di(n,t,i,n,e,o))})):ti(e)&&e.forEach((function(n,r){a.set(r,di(n,t,i,r,e,o))}));var p=u?void 0:(c?l?at:ot:l?We:je)(e);return function(e,t){for(var i=-1,n=null==e?0:e.length;++i<n&&!1!==t(e[i],i,e););}(p||e,(function(n,r){p&&(n=e[r=n]),se(a,r,di(n,t,i,r,e,o))})),a}hi[si]=hi["[object Array]"]=hi["[object ArrayBuffer]"]=hi["[object DataView]"]=hi["[object Boolean]"]=hi["[object Date]"]=hi["[object Float32Array]"]=hi["[object Float64Array]"]=hi["[object Int8Array]"]=hi["[object Int16Array]"]=hi["[object Int32Array]"]=hi["[object Map]"]=hi["[object Number]"]=hi[ui]=hi["[object RegExp]"]=hi["[object Set]"]=hi["[object String]"]=hi["[object Symbol]"]=hi["[object Uint8Array]"]=hi["[object Uint8ClampedArray]"]=hi["[object Uint16Array]"]=hi["[object Uint32Array]"]=!0,hi["[object Error]"]=hi[li]=hi["[object WeakMap]"]=!1;function fi(e){return di(e,5)}function pi(e,t,i){(void 0!==i&&!f(e[t],i)||void 0===i&&!(t in e))&&oe(e,t,i)}var gi,yi=function(e,t,i){for(var n=-1,r=Object(e),o=i(e),a=o.length;a--;){var s=o[gi?a:++n];if(!1===t(r[s],s,r))break}return e};const vi=yi;var mi="[object Object]",_i=Function.prototype,Ei=Object.prototype,Ti=_i.toString,Si=Ei.hasOwnProperty,bi=Ti.call(Object);function Ci(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function ki(e,t,i,n,r,o,a){var s=Ci(e,i),l=Ci(t,i),c=a.get(l);if(c)pi(e,i,c);else{var u,h=o?o(s,l,i+"",e,t,a):void 0,d=void 0===h;if(d){var f=ge(l),p=!f&&_e(l),g=!f&&!p&&xe(l);h=l,f||p||g?ge(s)?h=s:ce(u=s)&&He(u)?h=qe(s):p?(d=!1,h=Xe(l,!0)):g?(d=!1,h=wt(l,!0)):h=[]:function(e){if(!ce(e)||w(e)!=mi)return!1;var t=it(e);if(null===t)return!0;var i=Si.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&Ti.call(i)==bi}(l)||pe(l)?(h=s,pe(s)?h=function(e){return le(e,We(e))}(s):A(s)&&!N(s)||(h=Jt(l))):d=!1}d&&(a.set(l,h),r(h,l,n,o,a),a.delete(l)),pi(e,i,h)}}function Ii(e,t,i,n,r){e!==t&&vi(t,(function(o,a){if(r||(r=new ie),A(o))ki(e,t,a,i,Ii,n,r);else{var s=n?n(Ci(e,a),o,a+"",e,t,r):void 0;void 0===s&&(s=o),pi(e,a,s)}}),We)}function Pi(e){return e}var Di=Math.max;var wi=re?function(e,t){return re(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:Pi;const Ai=wi;var Ri,xi,Oi,Li=Date.now;const Ni=(Ri=Ai,xi=0,Oi=0,function(){var e=Li(),t=16-(e-Oi);if(Oi=e,t>0){if(++xi>=800)return arguments[0]}else xi=0;return Ri.apply(void 0,arguments)});function Mi(e,t){return Ni(function(e,t,i){return t=Di(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,o=Di(n.length-t,0),a=Array(o);++r<o;)a[r]=n[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=n[r];return s[t]=i(a),function(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}(e,this,s)}}(e,t,Pi),e+"")}function Ui(e){return Mi((function(t,i){var n=-1,r=i.length,o=r>1?i[r-1]:void 0,a=r>2?i[2]:void 0;for(o=e.length>3&&"function"==typeof o?(r--,o):void 0,a&&function(e,t,i){if(!A(i))return!1;var n=typeof t;return!!("number"==n?He(i)&&Se(t,i.length):"string"==n&&t in i)&&f(i[t],e)}(i[0],i[1],a)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var s=i[n];s&&e(t,s,n,o)}return t}))}const Bi=Ui((function(e,t,i,n){Ii(e,t,i,n)}));function Fi(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new te;++t<i;)this.add(e[t])}function Hi(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1}function ji(e,t){return e.has(t)}Fi.prototype.add=Fi.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Fi.prototype.has=function(e){return this.__data__.has(e)};var Vi=1,Ki=2;function Wi(e,t,i,n,r,o){var a=i&Vi,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(e),u=o.get(t);if(c&&u)return c==t&&u==e;var h=-1,d=!0,f=i&Ki?new Fi:void 0;for(o.set(e,t),o.set(t,e);++h<s;){var p=e[h],g=t[h];if(n)var y=a?n(g,p,h,t,e,o):n(p,g,h,e,t,o);if(void 0!==y){if(y)continue;d=!1;break}if(f){if(!Hi(t,(function(e,t){if(!ji(f,t)&&(p===e||r(p,e,i,n,o)))return f.push(t)}))){d=!1;break}}else if(p!==g&&!r(p,g,i,n,o)){d=!1;break}}return o.delete(e),o.delete(t),d}function Gi(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i}function Yi(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i}var zi=1,$i=2,Xi="[object Boolean]",qi="[object Date]",Zi="[object Error]",Qi="[object Map]",Ji="[object Number]",en="[object RegExp]",tn="[object Set]",nn="[object String]",rn="[object Symbol]",on="[object ArrayBuffer]",an="[object DataView]",sn=E?E.prototype:void 0,ln=sn?sn.valueOf:void 0;var cn=1,un=Object.prototype.hasOwnProperty;var hn=1,dn="[object Arguments]",fn="[object Array]",pn="[object Object]",gn=Object.prototype.hasOwnProperty;function yn(e,t,i,n,r,o){var a=ge(e),s=ge(t),l=a?fn:St(e),c=s?fn:St(t),u=(l=l==dn?pn:l)==pn,h=(c=c==dn?pn:c)==pn,d=l==c;if(d&&_e(e)){if(!_e(t))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new ie),a||xe(e)?Wi(e,t,i,n,r,o):function(e,t,i,n,r,o,a){switch(i){case an:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case on:return!(e.byteLength!=t.byteLength||!o(new Ct(e),new Ct(t)));case Xi:case qi:case Ji:return f(+e,+t);case Zi:return e.name==t.name&&e.message==t.message;case en:case nn:return e==t+"";case Qi:var s=Gi;case tn:var l=n&zi;if(s||(s=Yi),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;n|=$i,a.set(e,t);var u=Wi(s(e),s(t),n,r,o,a);return a.delete(e),u;case rn:if(ln)return ln.call(e)==ln.call(t)}return!1}(e,t,l,i,n,r,o);if(!(i&hn)){var p=u&&gn.call(e,"__wrapped__"),g=h&&gn.call(t,"__wrapped__");if(p||g){var y=p?e.value():e,v=g?t.value():t;return o||(o=new ie),r(y,v,i,n,o)}}return!!d&&(o||(o=new ie),function(e,t,i,n,r,o){var a=i&cn,s=ot(e),l=s.length;if(l!=ot(t).length&&!a)return!1;for(var c=l;c--;){var u=s[c];if(!(a?u in t:un.call(t,u)))return!1}var h=o.get(e),d=o.get(t);if(h&&d)return h==t&&d==e;var f=!0;o.set(e,t),o.set(t,e);for(var p=a;++c<l;){var g=e[u=s[c]],y=t[u];if(n)var v=a?n(y,g,u,t,e,o):n(g,y,u,e,t,o);if(!(void 0===v?g===y||r(g,y,i,n,o):v)){f=!1;break}p||(p="constructor"==u)}if(f&&!p){var m=e.constructor,_=t.constructor;m==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _||(f=!1)}return o.delete(e),o.delete(t),f}(e,t,i,n,r,o))}function vn(e,t,i,n,r){return e===t||(null==e||null==t||!ce(e)&&!ce(t)?e!=e&&t!=t:yn(e,t,i,n,vn,r))}var mn=1,_n=2;function En(e){return e==e&&!A(e)}function Tn(e,t){return function(i){return null!=i&&(i[e]===t&&(void 0!==t||e in Object(i)))}}function Sn(e){var t=function(e){for(var t=je(e),i=t.length;i--;){var n=t[i],r=e[n];t[i]=[n,r,En(r)]}return t}(e);return 1==t.length&&t[0][2]?Tn(t[0][0],t[0][1]):function(i){return i===e||function(e,t,i,n){var r=i.length,o=r,a=!n;if(null==e)return!o;for(e=Object(e);r--;){var s=i[r];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++r<o;){var l=(s=i[r])[0],c=e[l],u=s[1];if(a&&s[2]){if(void 0===c&&!(l in e))return!1}else{var h=new ie;if(n)var d=n(c,u,l,e,t,h);if(!(void 0===d?vn(u,c,mn|_n,n,h):d))return!1}}return!0}(i,e,t)}}var bn="[object Symbol]";function Cn(e){return"symbol"==typeof e||ce(e)&&w(e)==bn}var kn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,In=/^\w*$/;function Pn(e,t){if(ge(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!Cn(e))||(In.test(e)||!kn.test(e)||null!=t&&e in Object(t))}var Dn="Expected a function";function wn(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Dn);var i=function(){var n=arguments,r=t?t.apply(this,n):n[0],o=i.cache;if(o.has(r))return o.get(r);var a=e.apply(this,n);return i.cache=o.set(r,a)||o,a};return i.cache=new(wn.Cache||te),i}wn.Cache=te;var An=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Rn=/\\(\\)?/g,xn=function(e){var t=wn(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(An,(function(e,i,n,r){t.push(n?r.replace(Rn,"$1"):i||e)})),t}));const On=xn;var Ln=1/0,Nn=E?E.prototype:void 0,Mn=Nn?Nn.toString:void 0;function Un(e){if("string"==typeof e)return e;if(ge(e))return function(e,t){for(var i=-1,n=null==e?0:e.length,r=Array(n);++i<n;)r[i]=t(e[i],i,e);return r}(e,Un)+"";if(Cn(e))return Mn?Mn.call(e):"";var t=e+"";return"0"==t&&1/e==-Ln?"-0":t}function Bn(e,t){return ge(e)?e:Pn(e,t)?[e]:On(function(e){return null==e?"":Un(e)}(e))}var Fn=1/0;function Hn(e){if("string"==typeof e||Cn(e))return e;var t=e+"";return"0"==t&&1/e==-Fn?"-0":t}function jn(e,t){for(var i=0,n=(t=Bn(t,e)).length;null!=e&&i<n;)e=e[Hn(t[i++])];return i&&i==n?e:void 0}function Vn(e,t,i){var n=null==e?void 0:jn(e,t);return void 0===n?i:n}function Kn(e,t){return null!=e&&t in Object(e)}function Wn(e,t){return null!=e&&function(e,t,i){for(var n=-1,r=(t=Bn(t,e)).length,o=!1;++n<r;){var a=Hn(t[n]);if(!(o=null!=e&&i(e,a)))break;e=e[a]}return o||++n!=r?o:!!(r=null==e?0:e.length)&&Ce(r)&&Se(a,r)&&(ge(e)||pe(e))}(e,t,Kn)}var Gn=1,Yn=2;function zn(e){return Pn(e)?function(e){return function(t){return null==t?void 0:t[e]}}(Hn(e)):function(e){return function(t){return jn(t,e)}}(e)}function $n(e){return"function"==typeof e?e:null==e?Pi:"object"==typeof e?ge(e)?(t=e[0],i=e[1],Pn(t)&&En(i)?Tn(Hn(t),i):function(e){var n=Vn(e,t);return void 0===n&&n===i?Wn(e,t):vn(i,n,Gn|Yn)}):Sn(e):zn(e);var t,i}function Xn(e){return e!=e}function qn(e,t){return!!(null==e?0:e.length)&&function(e,t,i){return t==t?function(e,t,i){for(var n=i-1,r=e.length;++n<r;)if(e[n]===t)return n;return-1}(e,t,i):function(e,t,i,n){for(var r=e.length,o=i+(n?1:-1);n?o--:++o<r;)if(t(e[o],o,e))return o;return-1}(e,Xn,i)}(e,t,0)>-1}function Zn(e,t,i){for(var n=-1,r=null==e?0:e.length;++n<r;)if(i(t,e[n]))return!0;return!1}const Qn=ct&&1/Yi(new ct([,-0]))[1]==1/0?function(e){return new ct(e)}:function(){};var Jn=200;function er(e,t){return e&&e.length?function(e,t,i){var n=-1,r=qn,o=e.length,a=!0,s=[],l=s;if(i)a=!1,r=Zn;else if(o>=Jn){var c=t?null:Qn(e);if(c)return Yi(c);a=!1,r=ji,l=new Fi}else l=t?[]:s;e:for(;++n<o;){var u=e[n],h=t?t(u):u;if(u=i||0!==u?u:0,a&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),s.push(u)}else r(l,h,i)||(l!==s&&l.push(h),s.push(u))}return s}(e,$n(t)):[]}const tr={H264:"h264",H265:"h265",H266:"h266",AAC:"aac",MP3:"mp3",OPUS:"opus",UNKNOWN:"unknown"},ir={[tr.H265]:'video/mp4; codecs="hev1.1.6.L120.90"',[tr.H264]:'video/mp4; codecs="avc1.42c01e"'};var nr=(e=>(e.MP4="mp4",e.DASH="dash",e.HLS="hls",e))(nr||{}),rr=(e=>(e.M4A="m4a",e.MP4="mp4",e.MP3="mp3",e.DASH="dash",e.HLS="hls",e.OGG="ogg",e))(rr||{}),or=(e=>(e.DRM_ENCRYPT="drm_encrypt",e.PRIVATE_ENCRYPT="private_encrypt",e.PRIVATE_ENCRYPT_UPGRADE="private_encrypt_upgrade",e.STANDARD_ENCRYPT="standard_encrypt",e))(or||{}),ar=(e=>(e.ROOT="root",e.ROOT_LEFT="rootLeft",e.ROOT_RIGHT="rootRight",e.ROOT_TOP="rootTop",e.CONTROLS_LEFT="controlsLeft",e.CONTROLS_RIGTH="controlsRight",e.CONTROLS_RIGHT="controlsRight",e.CONTROLS_CENTER="controlsCenter",e.CONTROLS="controls",e))(ar||{}),sr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function lr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cr=function(){let e,t=null;function i(e){return!!e&&("object"==typeof e||"function"==typeof e)}function n(e){if(null!==e&&!i(e))throw new TypeError("Object prototype may only be an Object or null: "+e)}const r=Object,o=Boolean(r.create)||!({__proto__:null}instanceof r),a=r.create||(o?function(e){return n(e),{__proto__:e}}:function(e){if(n(e),null===e)throw new SyntaxError("Native Object.create is required to create objects with null prototype");var t=function(){};return t.prototype=e,new t}),s=function(){return null},l=r.getPrototypeOf||([].__proto__===Array.prototype?function(e){const t=e.__proto__;return i(t)?t:null}:s);return e=function(c,u){if(void 0===(this&&this instanceof e?this.constructor:void 0))throw new TypeError("Constructor Proxy requires 'new'");if(!i(c)||!i(u))throw new TypeError("Cannot create proxy with a non-object as target or handler");let h=function(){};t=function(){c=null,h=function(e){throw new TypeError(`Cannot perform '${e}' on a proxy that has been revoked`)}},setTimeout((function(){t=null}),0);const d=u;u={get:null,set:null,apply:null,construct:null};for(let e in d){if(!(e in u))throw new TypeError(`Proxy polyfill does not support trap '${e}'`);u[e]=d[e]}"function"==typeof d&&(u.apply=d.apply.bind(d));const f=l(c);let p,g=!1,y=!1;"function"==typeof c?(p=function(){const e=this&&this.constructor===p,t=Array.prototype.slice.call(arguments);if(h(e?"construct":"apply"),e&&u.construct)return u.construct.call(this,c,t);if(!e&&u.apply)return u.apply(c,this,t);if(e){t.unshift(c);return new(c.bind.apply(c,t))}return c.apply(this,t)},g=!0):c instanceof Array?(p=[],y=!0):p=o||null!==f?a(f):{};const v=u.get?function(e){return h("get"),u.get(this,e,p)}:function(e){return h("get"),this[e]},m=u.set?function(e,t){h("set"),u.set(this,e,t,p)}:function(e,t){h("set"),this[e]=t},_=r.getOwnPropertyNames(c),E={};_.forEach((function(e){if((g||y)&&e in p)return;const t=r.getOwnPropertyDescriptor(c,e),i={enumerable:Boolean(t.enumerable),get:v.bind(c,e),set:m.bind(c,e)};r.defineProperty(p,e,i),E[e]=!0}));let T=!0;if(g||y){const e=r.setPrototypeOf||([].__proto__===Array.prototype?function(e,t){return n(t),e.__proto__=t,e}:s);f&&e(p,f)||(T=!1)}if(u.get||!T)for(let e in c)E[e]||r.defineProperty(p,e,{get:v.bind(c,e)});return r.seal(c),r.seal(p),p},e.revocable=function(i,n){return{proxy:new e(i,n),revoke:t}},e};const ur=lr(cr)();const hr=new class{constructor(){this.subscribeId=0,this.watcherMap=new Map}observe(e){const t=new ur(e,{set:(e,i,n)=>{const r=Reflect.get(e,i);Reflect.set(e,i,n);const o=this.watcherMap.get(t);return o&&(this.flushCallback(o),this.flushPropertyCallback(o,i,r,n)),!0}});return this.watcherMap.set(t,{pending:!1,queue:[],property:{}}),t}subscribe(e,t){const i=this.watcherMap.get(e);if(!i)return;this.subscribeId++;return i.queue.push({id:this.subscribeId,callback:t}),this.subscribeId}unsubscribe(e,t){const i=this.watcherMap.get(e);if(!i)return;const n=i.queue,r=n.findIndex((e=>e.id===t));void 0!==r&&r>-1&&n.splice(r,1)}subscribeProperty(e,t,i){const n=this.watcherMap.get(e);if(n){this.subscribeId++,n.property[t]||(n.property[t]={pending:!1,timer:0,pre:null,queue:[]});return n.property[t].queue.push({id:this.subscribeId,callback:i}),this.subscribeId}}unsubscribeProperty(e,t,i){const n=this.watcherMap.get(e);if(n){const e=n.property[t];if(e){const t=e.queue,n=t.findIndex((e=>e.id===i));void 0!==n&&n>-1&&t.splice(n,1)}}}flushCallback(e){e.pending||(e.pending=!0,setTimeout((()=>{e.queue.forEach((e=>e.callback())),e.pending=!1}),0))}flushPropertyCallback(e,t,i,n){const r=e.property[t];r&&(clearTimeout(r.timer),!1===r.pending&&(r.pending=!0,r.pre=i),r.timer=setTimeout((()=>{r.queue.forEach((e=>e.callback(r.pre,n))),r.pending=!1}),0))}};function dr(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function fr(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?dr(Object(i),!0).forEach((function(t){mr(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):dr(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function pr(e){return(pr="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})(e)}function gr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yr(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,Dr(n.key),n)}}function vr(e,t,i){return t&&yr(e.prototype,t),i&&yr(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function mr(e,t,i){return(t=Dr(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tr(e,t)}function Er(e){return(Er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Tr(e,t){return(Tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Sr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function br(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Sr(e)}function Cr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(hs){return!1}}();return function(){var i,n=Er(e);if(t){var r=Er(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return br(this,i)}}function kr(){return kr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Er(e)););return e}(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},kr.apply(this,arguments)}function Ir(e){return function(e){if(Array.isArray(e))return Pr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Pr(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Pr(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pr(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function Dr(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var wr={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new r(n,o||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,r,o,a){var s=i?i+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,o),!0;case 6:return u.fn.call(u.context,t,n,r,o,a),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,r);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(e,t,i){return o(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return o(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,n,r){var o=i?i+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||r&&!s.once||n&&s.context!==n||a(this,o);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||r&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s}(wr);var Ar=wr.exports;const Rr=lr(Ar);var xr="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,Or={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},Lr="%c[xgplayer]",Nr={config:{debug:xr?3:0},logInfo:function(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];this.config.debug>=3&&(t=console).log.apply(t,[Lr,Or.info,e].concat(n))},logWarn:function(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];this.config.debug>=1&&(t=console).warn.apply(t,[Lr,Or.warn,e].concat(n))},logError:function(e){var t;if(!(this.config.debug<1)){for(var i=this.config.debug>=2?"trace":"error",n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=console)[i].apply(t,[Lr,Or.error,e].concat(r))}}};var Mr=function(){function e(t){gr(this,e),this.bufferedList=t}return vr(e,[{key:"start",value:function(e){return this.bufferedList[e].start}},{key:"end",value:function(e){return this.bufferedList[e].end}},{key:"length",get:function(){return this.bufferedList.length}}]),e}(),Ur={};function Br(e){var t=pr(e);return null!==e&&("object"===t||"function"===t)}function Fr(e,t,i){var n,r,o,a,s,l,c=0,u=!1,h=!1,d=!0,f=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var i=n,o=r;return n=r=void 0,c=t,a=e.apply(o,i)}function g(e,t){return f?(window.cancelAnimationFrame(s),window.requestAnimationFrame(e)):setTimeout(e,t)}function y(e){var i=e-l;return void 0===l||i>=t||i<0||h&&e-c>=o}function v(){var e=Date.now();if(y(e))return m(e);s=g(v,function(e){var i=e-c,n=t-(e-l);return h?Math.min(n,o-i):n}(e))}function m(e){return s=void 0,d&&n?p(e):(n=r=void 0,a)}function _(){for(var e=Date.now(),i=y(e),o=arguments.length,d=new Array(o),f=0;f<o;f++)d[f]=arguments[f];if(n=d,r=this,l=e,i){if(void 0===s)return function(e){return c=e,s=g(v,t),u?p(e):a}(l);if(h)return s=g(v,t),p(l)}return void 0===s&&(s=g(v,t)),a}return t=+t||0,Br(i)&&(u=!!i.leading,o=(h="maxWait"in i)?Math.max(+i.maxWait||0,t):o,d="trailing"in i?!!i.trailing:d),_.cancel=function(){void 0!==s&&function(e){if(f)return window.cancelAnimationFrame(e);clearTimeout(e)}(s),c=0,n=l=r=s=void 0},_.flush=function(){return void 0===s?a:m(Date.now())},_.pending=function(){return void 0!==s},_}Ur.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=n,r.innerHTML=t,Object.keys(i).forEach((function(t){var n=t,o=i[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(n,o):r.setAttribute(n,o)})),r},Ur.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var n=document.createElement("div");n.innerHTML=e;var r=n.children;return n=null,r.length>0?(r=r[0],i&&Ur.addClass(r,i),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(o){return Nr.logError("util.createDomFromHtml",o),null}},Ur.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(hs){var i=e.className&&"object"===pr(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},Ur.addClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)}))}catch(hs){Ur.hasClass(e,t)||(e.className&&"object"===pr(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},Ur.removeClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.remove(t)}))}catch(hs){Ur.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===pr(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))}},Ur.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){Ur.hasClass(e,t)?Ur.removeClass(e,t):Ur.addClass(e,t)}))},Ur.classNames=function(){for(var e=arguments,t=[],i=function(i){"String"===Ur.typeOf(e[i])?t.push(e[i]):"Object"===Ur.typeOf(e[i])&&Object.keys(e[i]).map((function(n){e[i][n]&&t.push(n)}))},n=0;n<arguments.length;n++)i(n);return t.join(" ")},Ur.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,i=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(i)}catch(hs){Nr.logError("util.findDom",hs),0===i.indexOf("#")&&(e=t.getElementById(i.slice(1)))}return e},Ur.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},Ur.padStart=function(e,t,i){for(var n=String(i),r=t>>0,o=Math.ceil(r/n.length),a=[],s=String(e);o--;)a.push(n);return a.join("").substring(0,r-s.length)+s},Ur.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=Ur.padStart(Math.floor(e/3600),2,0),i=Ur.padStart(Math.floor((e-3600*t)/60),2,0),n=Ur.padStart(Math.floor(e-3600*t-60*i),2,0);return("00"===t?[i,n]:[t,i,n]).join(":")},Ur.event=function(e){if(e.touches){var t=e.touches[0]||e.changedTouches[0];e.clientX=t.clientX||0,e.clientY=t.clientY||0,e.offsetX=t.pageX-t.target.offsetLeft,e.offsetY=t.pageY-t.target.offsetTop}e._target=e.target||e.srcElement},Ur.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},Ur.deepCopy=function(e,t){if("Object"===Ur.typeOf(t)&&"Object"===Ur.typeOf(e))return Object.keys(t).forEach((function(i){"Object"!==Ur.typeOf(t[i])||t[i]instanceof Node?"Array"===Ur.typeOf(t[i])?e[i]="Array"===Ur.typeOf(e[i])?e[i].concat(t[i]):t[i]:e[i]=t[i]:void 0===e[i]||void 0===e[i]?e[i]=t[i]:Ur.deepCopy(e[i],t[i])})),e},Ur.deepMerge=function(e,t){return Object.keys(t).map((function(i){var n;"Array"===Ur.typeOf(t[i])&&"Array"===Ur.typeOf(e[i])?"Array"===Ur.typeOf(e[i])&&(n=e[i]).push.apply(n,Ir(t[i])):Ur.typeOf(e[i])!==Ur.typeOf(t[i])||null===e[i]||"Object"!==Ur.typeOf(e[i])||t[i]instanceof window.Node?null!==t[i]&&(e[i]=t[i]):Ur.deepMerge(e[i],t[i])})),e},Ur.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var i=document.createElement("a");return i.href=t.replace(/url\("|"\)/g,""),i.href},Ur.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},Ur.setInterval=function(e,t,i,n){e._interval[t]||(e._interval[t]=window.setInterval(i.bind(e),n))},Ur.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},Ur.setTimeout=function(e,t,i){e._timers||(e._timers=[]);var n=setTimeout((function(){t(),Ur.clearTimeout(e,n)}),i);return e._timers.push(n),n},Ur.clearTimeout=function(e,t){var i=e._timers;if("Array"===Ur.typeOf(i)){for(var n=0;n<i.length;n++)if(i[n]===t){i.splice(n,1),clearTimeout(t);break}}else clearTimeout(t)},Ur.clearAllTimers=function(e){var t=e._timers;"Array"===Ur.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},Ur.createImgBtn=function(e,t,i,n){var r,o,a,s=Ur.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(s.style.backgroundImage='url("'.concat(t,'")'),i&&n)&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){return!(i.indexOf(e)>-1&&n.indexOf(e)>-1)||(r=parseFloat(i.slice(0,i.indexOf(e)).trim()),o=parseFloat(n.slice(0,n.indexOf(e)).trim()),a=e,!1)})),s.style.width="".concat(r).concat(a),s.style.height="".concat(o).concat(a),s.style.backgroundSize="".concat(r).concat(a," ").concat(o).concat(a),s.style.margin="start"===e?"-".concat(o/2).concat(a," auto auto -").concat(r/2).concat(a):"auto 5px auto 5px");return s},Ur.Hex2RGBA=function(e,t){var i=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var n="#";e.replace(/[0-9A-F]/gi,(function(e){n+=e+e})),e=n}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){i.push(parseInt(e,16))})),"rgba(".concat(i.join(","),", ").concat(t,")")):"rgba(255, 255, 255, 0.1)"},Ur.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},Ur.checkIsFunction=function(e){return e&&"function"==typeof e},Ur.checkIsObject=function(e){return null!==e&&"object"===pr(e)},Ur.hide=function(e){e.style.display="none"},Ur.show=function(e,t){e.style.display=t||"block"},Ur.isUndefined=function(e){if(null==e)return!0},Ur.isNotNull=function(e){return!(null==e)},Ur.setStyleFromCsstext=function(e,t){t&&("String"===Ur.typeOf(t)?t.replace(/\s+/g,"").split(";").map((function(t){if(t){var i=t.split(":");i.length>1&&(e.style[i[0]]=i[1])}})):Object.keys(t).map((function(i){e.style[i]=t[i]})))},Ur.filterStyleFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],i=e.style.cssText;if(!i)return{};var n=i.replace(/\s+/g,"").split(";"),r={},o={};return n.map((function(e){if(e){var i=e.split(":");i.length>1&&(!function(e,t){for(var i=0,n=t.length;i<n;i++)if(e.indexOf(t[i])>-1)return!0;return!1}(i[0],t)?o[i[0]]=i[1]:r[i[0]]=i[1])}})),e.setAttribute("style",""),Object.keys(o).map((function(t){e.style[t]=o[t]})),r},Ur.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var i=t.replace(/\s+/g,"").split(";"),n={};return i.map((function(e){if(e){var t=e.split(":");t.length>1&&(n[t[0]]=t[1])}})),n},Ur.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var n=new window.Image;n.onload=function(e){n=null,t&&t(e)},n.onerror=function(e){n=null,i&&i(e)},n.src=e}},Ur.stopPropagation=function(e){e&&e.stopPropagation()},Ur.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},Ur.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},Ur.checkTouchSupport=function(){return"ontouchstart"in window},Ur.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=[],n=0;n<e.length;n++)i.push({start:e.start(n)<.5?0:e.start(n),end:e.end(n)});i.sort((function(e,t){var i=e.start-t.start;return i||t.end-e.end}));var r=[];if(t)for(var o=0;o<i.length;o++){var a=r.length;if(a){var s=r[a-1].end;i[o].start-s<t?i[o].end>s&&(r[a-1].end=i[o].end):r.push(i[o])}else r.push(i[o])}else r=i;return new Mr(r)},Ur.getEventPos=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.touches&&e.touches.length>0&&(e=e.touches[0]),{x:e.x/t,y:e.y/t,clientX:e.clientX/t,clientY:e.clientY/t,offsetX:e.offsetX/t,offsetY:e.offsetY/t,pageX:e.pageX/t,pageY:e.pageY/t}},Ur.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},Ur.getHostFromUrl=function(e){if("String"!==Ur.typeOf(e))return"";var t=e.split("/"),i="";return t.length>3&&t[2]&&(i=t[2]),i},Ur.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},Ur.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},Ur.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},Ur.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(hs){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(window.performance.now())),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?i:3&i|8).toString(16)}))},Ur.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},Ur.adjustTimeByDuration=function(e,t,i){return t&&e&&(e>t||i&&e<t)?t:e},Ur.createPositionBar=function(e,t){var i=Ur.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(i),i},Ur.getTransformStyle=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i={scale:"".concat(e.scale||1),translate:"".concat(e.x||0,"%, ").concat(e.y||0,"%"),rotate:"".concat(e.rotate||0,"deg")};return Object.keys(i).forEach((function(e){var n=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),r="".concat(e,"(").concat(i[e],")");n.test(t)?(n.lastIndex=-1,t=t.replace(n,r)):t+="".concat(r," ")})),t},Ur.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},Ur.getIndexByTime=function(e,t){var i=t.length,n=-1;if(i<1)return n;if(e<=t[0].end||i<2)n=0;else if(e>t[i-1].end)n=i-1;else for(var r=1;r<i;r++)if(e>t[r-1].end&&e<=t[r].end){n=r;break}return n},Ur.getOffsetCurrentTime=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,n=-1;if((n=i>=0&&i<t.length?i:Ur.getIndexByTime(e,t))<0)return-1;var r=t.length,o=t[n],a=o.start,s=o.end,l=o.cTime,c=o.offset;return e<a?l:e>=a&&e<=s?e-c:e>s&&n>=r-1?s:-1},Ur.getCurrentTimeByOffset=function(e,t){var i=-1;if(!t||t.length<0)return e;for(var n=0;n<t.length;n++)if(e<=t[n].duration){i=n;break}if(-1!==i){var r=t[i].start;return i-1<0?r+e:r+(e-t[i-1].duration)}return e};var Hr=/(Android)\s([\d.]+)/,jr=/(Version)\/([\d.]+)/,Vr=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],Kr={get device(){return Kr.os.isPc?"pc":"mobile"},get browser(){if("undefined"==typeof navigator)return"";var e=navigator.userAgent.toLowerCase(),t={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(t).filter((function(i){return t[i].test(e)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),i=/(?:SymbianOS)/.test(e)||t,n=/(?:Tizen)/gi.test(e),r=/(?:Web0S)/gi.test(e),o=/(?:Android)/.test(e),a=/(?:Firefox)/.test(e),s=/(?:iPad|PlayBook)/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,l=s||o&&!/(?:Mobile)/.test(e)||a&&/(?:Tablet)/.test(e),c=/(?:iPhone)/.test(e)&&!l;return{isTablet:l,isPhone:c,isIpad:s,isIos:c||s,isAndroid:o,isPc:!(c||o||i||l),isSymbian:i,isWindowsPhone:t,isFireFox:a,isTizen:n,isWebOS:r}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",i=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?jr:Hr)?t.exec(e):[];if(i&&i.length>=3){var n=i[2].split(".");return n.length>0?parseInt(n[0]):0}return 0},get isWeixin(){if("undefined"==typeof navigator)return!1;return!!/(micromessenger)\/([\d.]+)/.exec(navigator.userAgent.toLocaleLowerCase())},isSupportMP4:function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;if(this.supportResult)return this.supportResult;var t=document.createElement("video");return"function"==typeof t.canPlayType&&Vr.map((function(i){"probably"===t.canPlayType('video/mp4; codecs="'.concat(i,'"'))&&(e.isSupport=!0,e.mime+="||".concat(i))})),this.supportResult=e,t=null,e},isMSESupport:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if("undefined"==typeof MediaSource||!MediaSource)return!1;try{return MediaSource.isTypeSupported(e)}catch(t){return this._logger.error(e,t),!1}},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var i=e.video||{},n=e.audio||{};try{var r=MediaSource.isTypeSupported(i.contentType),o=MediaSource.isTypeSupported(n.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(hs){return Promise.resolve(t)}}},Wr="3.0.23-rc.3",Gr={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},Yr={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},zr=vr((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};gr(this,e);var n=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.media){var r=i.mediaError?i.mediaError:t.media.error||{},o=t.duration,a=t.currentTime,s=t.ended,l=t.src,c=t.currentSrc,u=t.media,h=u.readyState,d=u.networkState,f=i.errorCode||r.code;Yr[f]&&(f=Yr[f]);var p={playerVersion:Wr,currentTime:a,duration:o,ended:s,readyState:h,networkState:d,src:l||c,errorType:i.errorType,errorCode:f,message:i.errorMessage||r.message,mediaError:r,originError:i.originError?i.originError.stack:"",host:Ur.getHostFromUrl(l||c)};return i.ext&&Object.keys(i.ext).map((function(e){p[e]=i.ext[e]})),p}if(arguments.length>1){for(var g={playerVersion:Wr,domain:document.domain},y=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],v=0;v<arguments.length;v++)g[y[v]]=arguments[v];return g.ex=n?(n[arguments[0]]||{}).msg:"",g}})),$r="play",Xr="playing",qr="ended",Zr="pause",Qr="error",Jr="seeking",eo="seeked",to="timeupdate",io="waiting",no="canplay",ro="durationchange",oo="volumechange",ao="loadeddata",so="ratechange",lo="progress",co="loadstart",uo="emptied",ho="focus",fo="blur",po="ready",go="urlNull",yo="autoplay_started",vo="autoplay_was_prevented",mo="complete",_o="replay",Eo="destroy",To="urlchange",So="download_speed_change",bo="leaveplayer",Co="enterplayer",ko="loading",Io="fullscreen_change",Po="cssFullscreen_change",Do="mini_state_change",wo="definition_change",Ao="after_definition_change",Ro="video_resize",xo="pip_change",Oo="rotate",Lo="screenShot",No="playnext",Mo="shortcut",Uo="xglog",Bo="user_action",Fo="reset",Ho="source_error",jo="source_success",Vo=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],Ko={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},Wo="fps_stuck";const Go=Object.freeze(Object.defineProperty({__proto__:null,ABORT:"abort",AFTER_DEFINITION_CHANGE:Ao,AUTOPLAY_PREVENTED:vo,AUTOPLAY_STARTED:yo,BEFORE_DEFINITION_CHANGE:"before_definition_change",BUFFER_CHANGE:"bufferedChange",CANPLAY:no,CANPLAY_THROUGH:"canplaythrough",COMPLETE:mo,CSS_FULLSCREEN_CHANGE:Po,DEFINITION_CHANGE:wo,DESTROY:Eo,DOWNLOAD_SPEED_CHANGE:So,DURATION_CHANGE:ro,EMPTIED:uo,ENDED:qr,ENTER_PLAYER:Co,ERROR:Qr,FPS_STUCK:Wo,FULLSCREEN_CHANGE:Io,LEAVE_PLAYER:bo,LOADED_DATA:ao,LOADED_METADATA:"loadedmetadata",LOADING:ko,LOAD_START:co,MINI_STATE_CHANGE:Do,PAUSE:Zr,PIP_CHANGE:xo,PLAY:$r,PLAYER_BLUR:fo,PLAYER_FOCUS:ho,PLAYING:Xr,PLAYNEXT:No,PROGRESS:lo,RATE_CHANGE:so,READY:po,REPLAY:_o,RESET:Fo,RETRY:"retry",ROTATE:Oo,SCREEN_SHOT:Lo,SEEKED:eo,SEEKING:Jr,SEI_PARSED:"SEI_PARSED",SHORTCUT:Mo,SOURCE_ERROR:Ho,SOURCE_SUCCESS:jo,STALLED:"stalled",STATS_EVENTS:Ko,SUSPEND:"suspend",SWITCH_SUBTITLE:"switch_subtitle",TIME_UPDATE:to,URL_CHANGE:To,URL_NULL:go,USER_ACTION:Bo,VIDEO_EVENTS:Vo,VIDEO_RESIZE:Ro,VOLUME_CHANGE:oo,WAITING:io,XGLOG:Uo},Symbol.toStringTag,{value:"Module"}));function Yo(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}var zo=function(e){_r(i,Rr);var t=Cr(i);function i(e){var n;gr(this,i),(n=t.call(this,e))._hasStart=!1,n._currentTime=0,n._duration=0,n._internalOp={},n._lastMuted=!1,n.vtype="MP4",n._rate=-1,n.mediaConfig=Object.assign({},{controls:!1,autoplay:e.autoplay,playsinline:e.playsinline,"x5-playsinline":e.playsinline,"webkit-playsinline":e.playsinline,"x5-video-player-fullscreen":e["x5-video-player-fullscreen"]||e.x5VideoPlayerFullscreen,"x5-video-orientation":e["x5-video-orientation"]||e.x5VideoOrientation,airplay:e.airplay,"webkit-airplay":e.airplay,tabindex:0|e.tabindex,mediaType:e.mediaType||"video","data-index":-1},e.videoConfig,e.videoAttributes);var r=e["x5-video-player-type"]||e.x5VideoPlayerType;return Kr.isWeixin&&Kr.os.isAndroid&&r&&(n.mediaConfig["x5-video-player-type"]=r,delete n.mediaConfig.playsinline,delete n.mediaConfig["webkit-playsinline"],delete n.mediaConfig["x5-playsinline"]),e.loop&&(n.mediaConfig.loop="loop"),e.autoplayMuted&&!Object.prototype.hasOwnProperty.call(n.mediaConfig,"muted")&&(n.mediaConfig.muted=!0),n.media=e.mediaEl instanceof HTMLMediaElement?e.mediaEl:"function"==typeof e.mediaEl?e.mediaEl(n.mediaConfig):Ur.createDom(n.mediaConfig.mediaType,"",n.mediaConfig,""),e.defaultPlaybackRate&&(n.media.defaultPlaybackRate=n.media.playbackRate=e.defaultPlaybackRate),"Number"===Ur.typeOf(e.volume)&&(n.volume=e.volume),e.autoplayMuted&&(n.media.muted=!0,n._lastMuted=!0),e.autoplay&&(n.media.autoplay=!0),e.playsinline&&(n.media.playsinline=!0),n._interval={},n.mediaEventMiddleware={},n.attachVideoEvents(),n}return vr(i,[{key:"setEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(i){t.mediaEventMiddleware[i]=e[i]}))}},{key:"removeEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(e){delete t.mediaEventMiddleware[e]}))}},{key:"attachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.media;this._evHandlers||(this._evHandlers=Vo.map((function(t){var i="on".concat(t.charAt(0).toUpperCase()).concat(t.slice(1));return"function"==typeof e[i]&&e.on(t,e[i]),mr({},t,function(e,t){return function(i,n){var r={player:t,eventName:e,originalEvent:i,detail:i.detail||{},timeStamp:i.timeStamp,currentTime:t.currentTime,duration:t.duration,paused:t.paused,ended:t.ended,isInternalOp:!!t._internalOp[i.type],muted:t.muted,volume:t.volume,host:Ur.getHostFromUrl(t.currentSrc),vtype:t.vtype};if(t.removeInnerOP(i.type),"timeupdate"===e&&(t._currentTime=t.media&&t.media.currentTime),"ratechange"===e){var o=t.media?t.media.playbackRate:0;if(o&&t._rate===o)return;t._rate=t.media&&t.media.playbackRate}if("durationchange"===e&&(t._duration=t.media.duration),"volumechange"===e&&(r.isMutedChange=t._lastMuted!==t.muted,t._lastMuted=t.muted),"error"===e&&(r.error=n||t.video.error),t.mediaEventMiddleware[e]){var a=Yo.bind(t,e,r);try{t.mediaEventMiddleware[e].call(t,r,a)}catch(s){throw Yo.call(t,e,r),s}}else Yo.call(t,e,r)}}(t,e))}))),this._evHandlers.forEach((function(e){var i=Object.keys(e)[0];t.addEventListener(i,e[i],!1)}))}},{key:"detachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.media;this._evHandlers.forEach((function(e){var i=Object.keys(e)[0];t.removeEventListener(i,e[i],!1)})),this._evHandlers.forEach((function(t){var i=Object.keys(t)[0],n="on".concat(i.charAt(0).toUpperCase()).concat(i.slice(1));"function"==typeof e[n]&&e.off(i,e[n])})),this._evHandlers=null}},{key:"_attachSourceEvents",value:function(e,t){var i=this;e.removeAttribute("src"),e.load(),t.forEach((function(e,t){i.media.appendChild(Ur.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||""),"data-index":t+1}))}));var n=e.children;if(n){this._videoSourceCount=n.length,this._videoSourceIndex=n.length,this._vLoadeddata=function(e){i.emit(jo,{src:e.target.currentSrc,host:Ur.getHostFromUrl(e.target.currentSrc)})};for(var r=null,o=0;o<this._evHandlers.length;o++)if("error"===Object.keys(this._evHandlers[o])[0]){r=this._evHandlers[o];break}!this._sourceError&&(this._sourceError=function(e){var t=parseInt(e.target.getAttribute("data-index"),10);if(i._videoSourceIndex--,0===i._videoSourceIndex||t>=i._videoSourceCount){var n={code:4,message:"sources_load_error"};r?r.error(e,n):i.errorHandler("error",n)}var o=Gr[4];i.emit(Ho,new zr(i,{errorType:o,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var a=0;a<n.length;a++)n[a].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var t=e.children;if(t&&0!==t.length&&this._sourceError){for(var i=0;i<t.length;i++)t[i].removeEventListener("error",this._sourceError);for(;t.length>0;)e.removeChild(t[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.media&&(this.media.error||t)){var i=this.media.error||t,n=i.code?Gr[i.code]:"other";i.message;this.media.currentSrc||this.media.srcObject||(i={code:6,message:"empty_src"}),this.emit(e,new zr(this,{errorType:n,errorCode:i.code,errorMessage:i.message||"",mediaError:i}))}}},{key:"destroy",value:function(){for(var e in this.media&&(this.media.pause&&(this.media.pause(),this.media.muted=!0),this.media.removeAttribute("src"),this.media.load()),this._currentTime=0,this._duration=0,this.mediaConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,e)&&(clearInterval(this._interval[e]),this._interval[e]=null);this.detachVideoEvents(),this.media=null,this.mediaEventMiddleware={},this.removeAllListeners()}},{key:"video",get:function(){return this.media},set:function(e){this.media=e}},{key:"play",value:function(){return this.media?this.media.play():null}},{key:"pause",value:function(){this.media&&this.media.pause()}},{key:"load",value:function(){this.media&&this.media.load()}},{key:"canPlayType",value:function(e){return!!this.media&&this.media.canPlayType(e)}},{key:"getBufferedRange",value:function(e){var t=[0,0];if(!this.media)return t;e||(e=this.media.buffered);var i=this.media.currentTime;if(e)for(var n=0,r=e.length;n<r&&(t[0]=e.start(n),t[1]=e.end(n),!(t[0]<=i&&i<=t[1]));n++);return t[0]-i<=0&&i-t[1]<=0?t:[0,0]}},{key:"autoplay",get:function(){return!!this.media&&this.media.autoplay},set:function(e){this.media&&(this.media.autoplay=e)}},{key:"buffered",get:function(){return this.media?this.media.buffered:null}},{key:"buffered2",get:function(){return this.media&&this.media.buffered?Ur.getBuffered2(this.media.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.media)return e;var t=this.media.buffered;if(!t||0===t.length)return e;for(var i=0;i<t.length;i++)if((t.start(i)<=this.currentTime||t.start(i)<.1)&&t.end(i)>=this.currentTime)return{start:t.start(i),end:t.end(i)};return e}},{key:"crossOrigin",get:function(){return this.media?this.media.crossOrigin:""},set:function(e){this.media&&(this.media.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.media?this.media.currentSrc:""},set:function(e){this.media&&(this.media.currentSrc=e)}},{key:"currentTime",get:function(){return this.media?void 0!==this.media.currentTime?this.media.currentTime:this._currentTime:0},set:function(e){this.media&&(this.media.currentTime=e)}},{key:"defaultMuted",get:function(){return!!this.media&&this.media.defaultMuted},set:function(e){this.media&&(this.media.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return!!this.media&&this.media.ended}},{key:"error",get:function(){return this.media.error}},{key:"errorNote",get:function(){if(!this.media.error)return"";return["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][this.media.error.code-1]}},{key:"loop",get:function(){return!!this.media&&this.media.loop},set:function(e){this.media&&(this.media.loop=e)}},{key:"muted",get:function(){return!!this.media&&this.media.muted},set:function(e){this.media&&this.media.muted!==e&&(this._lastMuted=this.media.muted,this.media.muted=e)}},{key:"networkState",get:function(){return this.media.networkState}},{key:"paused",get:function(){return!this.media||this.media.paused}},{key:"playbackRate",get:function(){return this.media?this.media.playbackRate:0},set:function(e){this.media&&e!==1/0&&(this.media.defaultPlaybackRate=e,this.media.playbackRate=e)}},{key:"played",get:function(){return this.media?this.media.played:null}},{key:"preload",get:function(){return!!this.media&&this.media.preload},set:function(e){this.media&&(this.media.preload=e)}},{key:"readyState",get:function(){return this.media.readyState}},{key:"seekable",get:function(){return!!this.media&&this.media.seekable}},{key:"seeking",get:function(){return!!this.media&&this.media.seeking}},{key:"src",get:function(){return this.media?this.media.src:""},set:function(e){this.media&&(this.emit(To,e),this.emit(io),this._currentTime=0,this._duration=0,Ur.isMSE(this.media)?this.onWaiting():(this._detachSourceEvents(this.media),"Array"===Ur.typeOf(e)?this._attachSourceEvents(this.media,e):e?this.media.src=e:this.media.removeAttribute("src"),this.load()))}},{key:"volume",get:function(){return this.media?this.media.volume:0},set:function(e){e!==1/0&&this.media&&(this.media.volume=e)}},{key:"aspectRatio",get:function(){return this.media?this.media.videoWidth/this.media.videoHeight:0}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=kr(Er(i.prototype),"emit",this)).call.apply(n,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=kr(Er(i.prototype),"on",this)).call.apply(n,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=kr(Er(i.prototype),"once",this)).call.apply(n,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=kr(Er(i.prototype),"off",this)).call.apply(n,[this,e,t].concat(o))}},{key:"offAll",value:function(){kr(Er(i.prototype),"removeAllListeners",this).call(this)}}]),i}(),$o=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};gr(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return vr(e,[{key:"openDB",value:function(e){var t=this,i=this,n=this.myDB.version||1,r=i.indexedDB.open(i.myDB.name,n);r.onerror=function(e){},r.onsuccess=function(n){t.myDB.db=n.target.result,e.call(i)},r.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(i.myDB.ojstore.name)||t.createObjectStore(i.myDB.ojstore.name,{keyPath:i.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){this.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(e,t){for(var i,n=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(i=n.add(t[r])).onerror=function(){},i.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var i,n=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(i=n.put(t[r])).onerror=function(){},i.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,i){var n=this,r=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);r.onerror=function(){i.call(n,null)},r.onsuccess=function(e){var t=e.target.result;i.call(n,t)}}},{key:"deleteData",value:function(e,t){this.myDB.db.transaction(e,"readwrite").objectStore(e).delete(t)}},{key:"clearData",value:function(e){this.myDB.db.transaction(e,"readwrite").objectStore(e).clear()}}]),e}(),Xo=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],qo=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],Zo=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],Qo="data-xgplayerid";function Jo(e,t,i){for(var n=arguments.length,r=new Array(n>3?n-3:0),o=3;o<n;o++)r[o-3]=arguments[o];var a=t.call.apply(t,[e].concat(r));i&&"function"==typeof i&&(a&&a.then?a.then((function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];i.call.apply(i,[e].concat(n))})):i.call.apply(i,[e].concat(r)))}function ea(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[e]&&(this.__hooks[e]=null),function(){var n=arguments,r=this;if(i.pre)try{var o;(o=i.pre).call.apply(o,[this].concat(Array.prototype.slice.call(arguments)))}catch(hs){throw hs.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(hs.message),hs}if(this.__hooks&&this.__hooks[e])try{var a=la.apply(void 0,[this,e,t].concat(Array.prototype.slice.call(arguments)));a?a.then?a.then((function(e){!1!==e&&Jo.apply(void 0,[r,t,i.next].concat(Ir(n)))})).catch((function(e){throw e})):Jo.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments))):void 0===a&&Jo.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}catch(hs){throw hs.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(hs.message),hs}else Jo.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function ta(e,t){var i=this.__hooks;if(!i||!Array.isArray(i[e]))return-1;for(var n=i[e],r=0;r<n.length;r++)if(n[r]===t)return r;return-1}function ia(e,t){var i=this.__hooks;if(i)return i.hasOwnProperty(e)?(Array.isArray(i[e])||(i[e]=[]),-1===ta.call(this,e,t)&&i[e].push(t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function na(e,t){var i=this.__hooks;if(i)if(Array.isArray(i[e])){var n=i[e],r=ta.call(this,e,t);-1!==r&&n.splice(r,1)}else i[e]&&(i[e]=null)}function ra(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return t.useHooks&&t.useHooks.apply(t,n)}}function oa(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return t.removeHooks&&t.removeHooks.apply(t,n)}}}function aa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&t.map((function(t){e.__hooks[t]=null})),Object.defineProperty(e,"hooks",{get:function(){return e.__hooks&&Object.keys(e.__hooks).map((function(t){if(e.__hooks[t])return t}))}})}function sa(e){e.__hooks=null}function la(e,t,i){for(var n=arguments.length,r=new Array(n>3?n-3:0),o=3;o<n;o++)r[o-3]=arguments[o];if(e.__hooks&&Array.isArray(e.__hooks[t])){var a=e.__hooks[t],s=-1;return function e(t,i,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),l=3;l<r;l++)o[l-3]=arguments[l];if(s++,0===a.length||s===a.length)return n.call.apply(n,[t,t].concat(o));var c=a[s],u=c.call.apply(c,[t,t].concat(o));return u&&u.then?u.then((function(r){return!1===r?null:e.apply(void 0,[t,i,n].concat(o))})).catch((function(e){console.warn("[runHooks]".concat(i," reject"),e.message)})):!1!==u?e.apply(void 0,[t,i,n].concat(o)):void 0}.apply(void 0,[e,t,i].concat(r))}return i.call.apply(i,[e,e].concat(r))}function ca(e,t){Nr.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}var ua=function(){function e(t){gr(this,e),Ur.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),aa(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return vr(e,[{key:"beforeCreate",value:function(e){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(e){this.player=e.player,this.playerConfig=e.player&&e.player.config,this.pluginName=e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=e.player&&e.player.logger}},{key:"updateLang",value:function(e){e||(e=this.lang)}},{key:"lang",get:function(){return this.player.lang}},{key:"i18n",get:function(){return this.player.i18n}},{key:"i18nKeys",get:function(){return this.player.i18nKeys}},{key:"domEventType",get:function(){var e=Ur.checkTouchSupport()?"touch":"mouse";return!this.playerConfig||"touch"!==this.playerConfig.domEventType&&"mouse"!==this.playerConfig.domEventType||(e=this.playerConfig.domEventType),e}},{key:"on",value:function(e,t){var i=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):Array.isArray(e)&&e.forEach((function(e){i.__events[e]=t,i.player.on(e,t)})):ca(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var i=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):Array.isArray(e)&&e.forEach((function(n){i.__onceEvents[n]=t,i.player.once(e,t)})):ca(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var i=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):Array.isArray(e)&&e.forEach((function(n){delete i.__events[e],i.player.off(n,t)})):ca(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e=this;["__events","__onceEvents"].forEach((function(t){Object.keys(e[t]).forEach((function(i){e[t][i]&&e.off(i,e[t][i]),i&&delete e[t][i]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t;if(this.player){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];(t=this.player).emit.apply(t,[e].concat(n))}}},{key:"emitUserAction",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var n=fr(fr({},i),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,n)}}},{key:"hook",value:function(e,t){return ea.call.apply(ea,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return ia.call.apply(ia,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return na.call.apply(na,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return i&&(t.pluginName=i),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e=this,t=this.player,i=this.pluginName;this.offAll(),Ur.clearAllTimers(this),Ur.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(i),sa(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&Object.defineProperty(e,i,t[i])}},{key:"defineMethod",value:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&"function"==typeof t[i]&&Object.defineProperty(e,i,{configurable:!0,value:t[i]})}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}();if("undefined"!=typeof Element&&!Element.prototype.matches){var ha=Element.prototype;ha.matches=ha.matchesSelector||ha.mozMatchesSelector||ha.msMatchesSelector||ha.oMatchesSelector||ha.webkitMatchesSelector}var da=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function fa(e,t,i,n,r){var o=pa.apply(this,arguments);return e.addEventListener(i,o,r),{destroy:function(){e.removeEventListener(i,o,r)}}}function pa(e,t,i,n){return function(i){i.delegateTarget=da(i.target,t),i.delegateTarget&&n.call(e,i)}}var ga=function(e,t,i,n,r){return"function"==typeof e.addEventListener?fa.apply(null,arguments):"function"==typeof i?fa.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return fa(e,t,i,n,r)})))};const ya=lr(ga);var va={CONTROLS:"controls",ROOT:"root"},ma={ROOT:"root",ROOT_LEFT:"rootLeft",ROOT_RIGHT:"rootRight",ROOT_TOP:"rootTop",CONTROLS_LEFT:"controlsLeft",CONTROLS_RIGTH:"controlsRight",CONTROLS_RIGHT:"controlsRight",CONTROLS_CENTER:"controlsCenter",CONTROLS:"controls"},_a="xg-icon-disable";function Ea(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function Ta(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=null;if(e instanceof window.Element)return Ur.addClass(e,i),Object.keys(n).map((function(t){e.setAttribute(t,n[t])})),e;if(Ea(e)||Ea(e.url))return n.src=Ea(e)?e:e.url||"",o=Ur.createDom(e.tag||"img","",n,"xg-img ".concat(i));if("function"==typeof e)try{return(o=e())instanceof window.Element?(Ur.addClass(o,i),Object.keys(n).map((function(e){o.setAttribute(e,n[e])})),o):(Nr.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(hs){return Nr.logError("Plugin named [".concat(r,"]:createIcon"),hs),null}return"string"==typeof e?Ur.createDomFromHtml(e,n,i):(Nr.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function Sa(e,t){var i=t.config.icons||t.playerConfig.icons;Object.keys(e).map((function(n){var r=e[n],o=r&&r.class?r.class:"",a=r&&r.attr?r.attr:{},s=null;i&&i[n]&&(o=function(e,t){return"object"===pr(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(i[n],o),a=function(e,t){return"object"===pr(e)&&e.attr&&"object"===pr(e.attr)&&Object.keys(e.attr).map((function(i){t[i]=e.attr[i]})),t}(i[n],a),s=Ta(i[n],n,o,a,t.pluginName)),!s&&r&&(s=Ta(r.icon?r.icon:r,a,o,{},t.pluginName)),t.icons[n]=s}))}var ba=function(e){_r(i,ua);var t=Cr(i);function i(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return gr(this,i),(e=t.call(this,n)).__delegates=[],e}return vr(i,[{key:"__init",value:function(e){if(kr(Er(i.prototype),"__init",this).call(this,e),e.root){var t=e.root,n=null;this.icons={},this.root=null,this.parent=null,this.extraEls=[],Sa(this.registerIcons()||{},this),this.langText={};var r,o,a=this.registerLanguageTexts()||{};r=a,o=this,Object.keys(r).map((function(e){Object.defineProperty(o.langText,e,{get:function(){var t=o.lang,i=o.i18n;return i[e]?i[e]:r[e]&&r[e][t]||""}})}));var s="";try{s=this.render()}catch(hs){throw Nr.logError("Plugin:".concat(this.pluginName,":render"),hs),new Error("Plugin:".concat(this.pluginName,":render:").concat(hs.message))}if(s)(n=i.insert(s,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(n=Ur.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(n)}this.root=n,this.parent=t;var l=this.config.attr||{},c=this.config.style||{};this.setAttr(l),this.setStyle(c),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var t=this.children();t&&"object"===pr(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(i){var n,r,o=i,a=t[o],s={root:e.root};"function"==typeof a?(n=e.config[o]||{},r=a):"object"===pr(a)&&"function"==typeof a.plugin&&(n=a.options?Ur.deepCopy(e.config[o]||{},a.options):e.config[o]||{},r=a.plugin),s.config=n,void 0!==n.index&&(s.index=n.index),n.root&&(s.root=n.root),e.registerPlugin(r,s,o)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,i=this.i18n,n=this.langText;t&&function e(t,i){for(var n=0;n<t.children.length;n++)t.children[n].children.length>0?e(t.children[n],i):i(t.children[n])}(t,(function(t){var r=t.getAttribute&&t.getAttribute("lang-key");if(r){var o=i[r.toUpperCase()]||n[r];o&&(t.innerHTML="function"==typeof o?o(e):o)}}))}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=this.i18n||{},n=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var r=i[t]||n[t]||"";r&&(e.innerHTML=r)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,Ur.addClass(this.find(".xgplayer-icon"),_a)}},{key:"enable",value:function(){this.config.disable=!1,Ur.removeClass(this.find(".xgplayer-icon"),_a)}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var r=kr(Er(i.prototype),"registerPlugin",this).call(this,e,t,n);return this._children.push(r),r}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,t,n){var r=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){r.bindEL(e,t)})):this.bindEL(e,t);else{var o=i.delegate.call(this,this.root,e,t,n);this.__delegates=this.__delegates.concat(o)}}},{key:"unbind",value:function(e,t){var i=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){i.unbindEL(e,t)})):this.unbindEL(e,t);else for(var n="".concat(e,"_").concat(t),r=0;r<this.__delegates.length;r++)if(this.__delegates[r].key===n){this.__delegates[r].destroy(),this.__delegates.splice(r,1);break}}},{key:"setStyle",value:function(e,t){var i=this;if(this.root)return"String"===Ur.typeOf(e)?this.root.style[e]=t:void("Object"===Ur.typeOf(e)&&Object.keys(e).map((function(t){i.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var i=this;if(this.root)return"String"===Ur.typeOf(e)?this.root.setAttribute(e,t):void("Object"===Ur.typeOf(e)&&Object.keys(e).map((function(t){i.root.setAttribute(t,e[t])})))}},{key:"setHtml",value:function(e,t){this.root&&(this.root.innerHTML=e,"function"==typeof t&&t())}},{key:"bindEL",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,i)}},{key:"unbindEL",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.removeEventListener(e,t,i)}},{key:"show",value:function(e){if(this.root)return this.root.style.display=void 0!==e?e:"block","none"===window.getComputedStyle(this.root,null).getPropertyValue("display")?this.root.style.display="block":void 0}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,t){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!(t&&t instanceof window.Element))return null;try{return"string"==typeof e?this.find(e).appendChild(t):e.appendChild(t)}catch(i){return Nr.logError("Plugin:appendChild",i),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e=this,t=this.player;this.__delegates.map((function(e){e.destroy()})),this.__delegates=[],this._children instanceof Array&&(this._children.map((function(e){t.unRegisterPlugin(e.pluginName)})),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),kr(Er(i.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null})),this.extraEls=[]}}],[{key:"insert",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.children.length,r=Number(i),o=e instanceof window.Node;if(n){for(var a=0,s=null,l="";a<n;a++){s=t.children[a];var c=Number(s.getAttribute("data-index"));if(c>=r){l="beforebegin";break}c<r&&(l="afterend")}return o?"afterend"===l?t.appendChild(e):t.insertBefore(e,s):s.insertAdjacentHTML(l,e),"afterend"===l?t.children[t.children.length-1]:t.children[a]}return o?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.children[t.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,t,i,n){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(e instanceof window.Node&&"function"==typeof n)if(Array.isArray(i))i.forEach((function(i){var a=ya(e,t,i,n,r);a.key="".concat(t,"_").concat(i),o.push(a)}));else{var a=ya(e,t,i,n,r);a.key="".concat(t,"_").concat(i),o.push(a)}return o}},{key:"ROOT_TYPES",get:function(){return va}},{key:"POSITIONS",get:function(){return ma}}]),i}(),Ca=function(){function e(){var t=this;if(gr(this,e),mr(this,"__trigger",(function(e){var i=(new Date).getTime();t.timeStamp=i;for(var n=0;n<e.length;n++)t.__runHandler(e[n].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver(function(e,t,i){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Br(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),Fr(e,t,{leading:n,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(hs){console.error(hs)}}return vr(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer.observe(e);for(var i=e.getAttribute(Qo),n=this.__handlers,r=-1,o=0;o<n.length;o++)n[o]&&e===n[o].target&&(r=o);r>-1?this.__handlers[r].handler=t:this.__handlers.push({target:e,handler:t,playerId:i})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(i,n){e===i.target&&(t=n)}));try{var i;null===(i=this.observer)||void 0===i||i.unobserve(e)}catch(hs){}t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){var e;null===(e=this.observer)||void 0===e||e.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,i=0;i<t.length;i++)if(t[i]&&e===t[i].target){try{t[i].handler(e)}catch(n){console.error(n)}return!0}return!1}}]),e}(),ka=null;var Ia={pluginGroup:{},init:function(e){var t,i,n=e._pluginInfoId;n||(n=(new Date).getTime(),e._pluginInfoId=n),!e.config.closeResizeObserver&&(t=e.root,i=function(){e.resize()},ka||(ka=new Ca),ka.addObserver(t,i)),this.pluginGroup[n]={_originalOptions:e.config||{},_plugins:{}}},formatPluginInfo:function(e,t){var i=null,n=null;return e.plugin&&"function"==typeof e.plugin?(i=e.plugin,n=e.options):(i=e,n={}),t&&(n.config=t||{}),{PLUFGIN:i,options:n}},checkPluginIfExits:function(e,t){for(var i=0;i<t.length;i++)if(e.toLowerCase()===t[i].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(e,t){for(var i=Object.keys(t),n=null,r=0;r<i.length;r++)if(e.toLowerCase()===i[r].toLowerCase()){n=t[i[r]];break}return"Object"===Ur.typeOf(n)?{root:n.root,position:n.position}:{}},lazyRegister:function(e,t){var i=this,n=t.timeout||1500;return Promise.race([t.loader().then((function(t){var n;n=t&&t.__esModule?t.default:t,i.register(e,n,t.options)})),new Promise((function(e,t){setTimeout((function(){t(new Error("timeout"))}),n)}))])},register:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var n=e._pluginInfoId;if(n&&this.pluginGroup[n]){this.pluginGroup[n]._plugins||(this.pluginGroup[n]._plugins={});var r=this.pluginGroup[n]._plugins,o=this.pluginGroup[n]._originalOptions;i.player=e;var a=i.pluginName||t.pluginName;if(!a)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported(e.config.mediaType,e.config.codecType)){i.config||(i.config={});for(var s=Object.keys(o),l=0;l<s.length;l++)if(a.toLowerCase()===s[l].toLowerCase()){var c=o[s[l]];"Object"===Ur.typeOf(c)?i.config=Object.assign({},i.config,o[s[l]]):"Boolean"===Ur.typeOf(c)&&(i.config.disable=!c);break}t.defaultConfig&&Object.keys(t.defaultConfig).forEach((function(e){void 0===i.config[e]&&(i.config[e]=t.defaultConfig[e])})),i.root?"string"==typeof i.root&&(i.root=e[i.root]):i.root=e.root,i.index=i.config.index||0;try{r[a.toLowerCase()]&&(this.unRegister(n,a.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(a,"] exist, destroy the old instance")));var u=new t(i);return r[a.toLowerCase()]=u,r[a.toLowerCase()].func=t,u&&"function"==typeof u.afterCreate&&u.afterCreate(),u}catch(h){throw console.error(h),h}}else console.warn("not supported plugin [".concat(a,"]"))}}},unRegister:function(e,t){e._pluginInfoId&&(e=e._pluginInfoId),t=t.toLowerCase();try{var i=this.pluginGroup[e]._plugins[t];i&&(i.pluginName&&i.__destroy(),delete this.pluginGroup[e]._plugins[t])}catch(hs){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),hs)}},deletePlugin:function(e,t){var i=e._pluginInfoId;i&&this.pluginGroup[i]&&this.pluginGroup[i]._plugins&&delete this.pluginGroup[i]._plugins[t]},getPlugins:function(e){var t=e._pluginInfoId;return t&&this.pluginGroup[t]?this.pluginGroup[t]._plugins:{}},findPlugin:function(e,t){var i=e._pluginInfoId;if(!i||!this.pluginGroup[i])return null;var n=t.toLowerCase();return this.pluginGroup[i]._plugins[n]},beforeInit:function(e){var t=this;function i(e){return e&&e.then?e:new Promise((function(e){e()}))}return new Promise((function(n){if(t.pluginGroup)return(e._loadingPlugins&&e._loadingPlugins.length?Promise.all(e._loadingPlugins):Promise.resolve()).then((function(){var r=e._pluginInfoId;if(t.pluginGroup[r]){var o=t.pluginGroup[r]._plugins,a=[];Object.keys(o).forEach((function(e){if(o[e]&&o[e].beforePlayerInit)try{var t=o[e].beforePlayerInit();a.push(i(t))}catch(hs){throw a.push(i(null)),hs}})),Promise.all([].concat(a)).then((function(){n()})).catch((function(e){console.error(e),n()}))}else n()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var i=this.pluginGroup[t]._plugins;Object.keys(i).forEach((function(e){i[e]&&i[e].afterPlayerInit&&i[e].afterPlayerInit()}))}},setLang:function(e,t){var i=t._pluginInfoId;if(i&&this.pluginGroup[i]){var n=this.pluginGroup[i]._plugins;Object.keys(n).forEach((function(t){if(n[t].updateLang)n[t].updateLang(e);else try{n[t].lang=e}catch(i){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,i=e._pluginInfoId;if(i&&this.pluginGroup[i]){var n=[],r=this.pluginGroup[i]._plugins;Object.keys(r).forEach((function(e){"controls"!==e&&r[e]&&(n.push({plugin:r[e].func,options:r[e].__args}),t.unRegister(i,e))})),n.forEach((function(i){t.register(e,i.plugin,i.options)}))}},onPluginsReady:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var i=this.pluginGroup[t]._plugins||{};Object.keys(i).forEach((function(e){i[e].onPluginsReady&&"function"==typeof i[e].onPluginsReady&&i[e].onPluginsReady()}))}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){var i,n,r;i=e.root,null===(r=ka)||void 0===r||r.unObserver(i,n);for(var o=this.pluginGroup[t]._plugins,a=0,s=Object.keys(o);a<s.length;a++){var l=s[a];this.unRegister(t,l)}delete this.pluginGroup[t],delete e._pluginInfoId}}},Pa={DEFAULT:"xgplayer",DEFAULT_SKIN:"xgplayer-skin-default",ENTER:"xgplayer-is-enter",PAUSED:"xgplayer-pause",PLAYING:"xgplayer-playing",ENDED:"xgplayer-ended",CANPLAY:"xgplayer-canplay",LOADING:"xgplayer-isloading",ERROR:"xgplayer-is-error",REPLAY:"xgplayer-replay",NO_START:"xgplayer-nostart",ACTIVE:"xgplayer-active",INACTIVE:"xgplayer-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",INNER_FULLSCREEN:"xgplayer-fullscreen-inner",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",CONTROLS_AUTOHIDE:"controls-autohide",TOP_BAR_AUTOHIDE:"top-bar-autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};function Da(){return{id:"",el:null,url:"",domEventType:"default",nullUrlStart:!1,width:600,height:337.5,fluid:!1,fitVideoSize:"fixed",videoFillMode:"auto",volume:.6,autoplay:!1,autoplayMuted:!1,loop:!1,isLive:!1,zoom:1,videoInit:!0,poster:"",isMobileSimulateMode:!1,defaultPlaybackRate:1,execBeforePluginsCall:null,allowSeekAfterEnded:!0,enableContextmenu:!0,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!0,closeControlsBlur:!0,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},preProcessUrl:null,ignores:[],whitelist:[],inactive:3e3,lang:(e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase(),"zh-cn"===e&&(e="zh"),e),controls:!0,marginControls:!1,fullscreenTarget:null,screenShot:!1,rotate:!1,pip:!1,download:!1,mini:!1,cssFullscreen:!0,keyShortcut:!0,presets:[],plugins:[],playbackRate:1,definition:{list:[]},playsinline:!0,customDuration:0,timeOffset:0,icons:{},i18n:[],tabindex:0,thumbnail:null,videoConfig:{},isHideTips:!1,minWaitDelay:200,commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}};var e}var wa=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var i=Sr(e),n=i.player;i.playerConfig.closeControlsBlur&&n.focus({autoHide:!1})})),mr(Sr(e),"onMouseLeave",(function(t){Sr(e).player.focus()})),e}return vr(i,[{key:"beforeCreate",value:function(e){e.config.mode||"mobile"!==Kr.device||(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,t=this.config,i=t.disable,n=t.height,r=t.mode;if(!i){"flex"===r&&this.player.addClass(Pa.FLEX_CONTROLS);var o={height:"".concat(n,"px")};Object.keys(o).map((function(t){e.root.style[t]=o[t]})),this.left=this.find("xg-left-grid"),this.center=this.find("xg-center-grid"),this.right=this.find("xg-right-grid"),this.innerRoot=this.find("xg-inner-controls"),this.on(Do,(function(t){t?Ur.addClass(e.root,"mini-controls"):Ur.removeClass(e.root,"mini-controls")}));var a=this.playerConfig.isMobileSimulateMode;"mobile"!==Kr.device&&"mobile"!==a&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"focusAwhile",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&Ur.addClass(this.root,Pa.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){Ur.removeClass(this.root,Pa.CONTROLS_AUTOHIDE)}},{key:"show",value:function(e){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(this.root){var r=e.defaultConfig||{};if(!t.root){switch(t.position?t.position:t.config&&t.config.position?t.config.position:r.position){case ma.CONTROLS_LEFT:t.root=this.left;break;case ma.CONTROLS_RIGHT:t.root=this.right;break;case ma.CONTROLS_CENTER:t.root=this.center;break;case ma.CONTROLS:t.root=this.root;break;default:t.root=this.left}return kr(Er(i.prototype),"registerPlugin",this).call(this,e,t,n)}}}},{key:"destroy",value:function(){"mobile"!==Kr.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave)),this.left=null,this.center=null,this.right=null,this.innerRoot=null}},{key:"render",value:function(){var e=this.config,t=e.mode,i=e.autoHide,n=e.initShow;if(!e.disable){var r=Ur.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},mr({},Pa.CONTROLS_AUTOHIDE,i),{"xgplayer-controls-initshow":n||!i});return'<xg-controls class="'.concat(r,'" unselectable="on">\n <xg-inner-controls class="xg-inner-controls xg-pos">\n <xg-left-grid class="xg-left-grid">\n </xg-left-grid>\n <xg-center-grid class="xg-center-grid"></xg-center-grid>\n <xg-right-grid class="xg-right-grid">\n </xg-right-grid>\n </xg-inner-controls>\n </xg-controls>')}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),i}(),Aa={lang:{},langKeys:[],textKeys:[]};function Ra(e,t){return Object.keys(t).forEach((function(i){var n,r=Ur.typeOf(t[i]),o=Ur.typeOf(e[i]);"Array"===r?("Array"!==o&&(e[i]=[]),(n=e[i]).push.apply(n,Ir(t[i]))):"Object"===r?("Object"!==o&&(e[i]={}),Ra(e[i],t[i])):e[i]=t[i]})),e}function xa(){Object.keys(Aa.lang.en).map((function(e){Aa.textKeys[e]=e}))}function Oa(e,t){var i=e.LANG;if(t||(t=Aa),t.lang){var n=e.TEXT||{};"zh"===i&&(i="zh-cn"),t.lang[i]?Ra(t.lang[i],n):(t.langKeys.push(i),t.lang[i]=n),xa()}}Oa({LANG:"en",TEXT:{ERROR_TYPES:{network:{code:1,msg:"video download error"},mse:{code:2,msg:"stream append error"},parse:{code:3,msg:"parsing error"},format:{code:4,msg:"wrong format"},decoder:{code:5,msg:"decoding error"},runtime:{code:6,msg:"grammatical errors"},timeout:{code:7,msg:"play timeout"},other:{code:8,msg:"other errors"}},HAVE_NOTHING:"There is no information on whether audio/video is ready",HAVE_METADATA:"Audio/video metadata is ready ",HAVE_CURRENT_DATA:"Data about the current play location is available, but there is not enough data to play the next frame/millisecond",HAVE_FUTURE_DATA:"Current and at least one frame of data is available",HAVE_ENOUGH_DATA:"The available data is sufficient to start playing",NETWORK_EMPTY:"Audio/video has not been initialized",NETWORK_IDLE:"Audio/video is active and has been selected for resources, but no network is used",NETWORK_LOADING:"The browser is downloading the data",NETWORK_NO_SOURCE:"No audio/video source was found",MEDIA_ERR_ABORTED:"The fetch process is aborted by the user",MEDIA_ERR_NETWORK:"An error occurred while downloading",MEDIA_ERR_DECODE:"An error occurred while decoding",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported",REPLAY:"Replay",ERROR:"Network is offline",PLAY_TIPS:"Play",PAUSE_TIPS:"Pause",PLAYNEXT_TIPS:"Play next",DOWNLOAD_TIPS:"Download",ROTATE_TIPS:"Rotate",RELOAD_TIPS:"Reload",FULLSCREEN_TIPS:"Fullscreen",EXITFULLSCREEN_TIPS:"Exit fullscreen",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Exit cssfullscreen",TEXTTRACK:"Caption",PIP:"PIP",SCREENSHOT:"Screenshot",LIVE:"LIVE",OFF:"Off",OPEN:"Open",MINI_DRAG:"Click and hold to drag",MINISCREEN:"Miniscreen",REFRESH_TIPS:"Please Try",REFRESH:"Refresh",FORWARD:"forward",LIVE_TIP:"Live"}});var La={get textKeys(){return Aa.textKeys},get langKeys(){return Aa.langKeys},get lang(){var e={};return Aa.langKeys.map((function(t){e[t]=Aa.lang[t]})),Aa.lang["zh-cn"]&&(e.zh=Aa.lang["zh-cn"]||{}),e},extend:function(e,t){var i=[];if(t||(t=Aa),t.lang){i="Array"!==Ur.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e;var n=t.lang;i.map((function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),n[e.LANG]?Ra(n[e.LANG]||{},e.TEXT||{}):Oa(e,t)})),xa()}},use:Oa,init:function(e){var t,i={lang:{},langKeys:[],textKeys:{},pId:e};return Ra(i.lang,Aa.lang),(t=i.langKeys).push.apply(t,Ir(Aa.langKeys)),Ra(i.textKeys,Aa.textKeys),i}},Na={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7,DESTROYED:8},Ma=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],Ua={},Ba=null,Fa=function(e){_r(i,Ar.EventEmitter);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"add",value:function(e){e&&(Ua[e.playerId]=e,1===Object.keys(Ua).length&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete Ua[e.playerId])}},{key:"_iterate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var i in Ua)if(Object.prototype.hasOwnProperty.call(Ua,i)){var n=Ua[i];if(t){if(e(n))break}else e(n)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var t=null;return this._iterate((function(i){var n=e(i);return n&&(t=i),n}),!0),t}},{key:"findAll",value:function(e){var t=[];return this._iterate((function(i){e(i)&&t.push(i)})),t}},{key:"setActive",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Ua[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!0,t.isInstNext=!1):t.isUserActive=!1})):Ua[e].isUserActive=t,e}},{key:"getActiveId",value:function(){for(var e=Object.keys(Ua),t=0;t<e.length;t++){var i=Ua[e[t]];if(i&&i.isUserActive)return e[t]}return null}},{key:"setNext",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Ua[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!1,t.isInstNext=!0):t.isInstNext=!1})):Ua[e].isInstNext=t,e}}],[{key:"getInstance",value:function(){return Ba||(Ba=new i),Ba}}]),i}();var Ha=["play","pause","replay","retry"],ja=0,Va=0,Ka=null,Wa=function(e){_r(i,zo);var t=Cr(i);function i(e){var n;gr(this,i);var r,o=Ur.deepMerge(Da(),e);mr(Sr(n=t.call(this,o)),"canPlayFunc",(function(){if(n.config){var e=n.config,t=e.autoplay,i=e.defaultPlaybackRate;Nr.logInfo("player","canPlayFunc, startTime",n.__startTime),n._seekToStartTime(),n.playbackRate=i,(t||n._useAutoplay)&&n.mediaPlay(),n.off(no,n.canPlayFunc),n.removeClass(Pa.ENTER)}})),mr(Sr(n),"onFullscreenChange",(function(e,t){var i=function(){Ur.setTimeout(Sr(n),(function(){n.resize()}),100)},r=Ur.getFullScreenEl();n._fullActionFrom?n._fullActionFrom="":n.emit(Bo,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:n.currentTime,duration:n.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=function(e,t,i){if(e){var n=e.getAttribute(i);return!(!n||n!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}}(r,n.playerId,Qo);if(t||r&&(r===n._fullscreenEl||o))i(),!n.config.closeFocusVideoFocus&&n.media.focus(),n.fullscreen=!0,n.changeFullStyle(n.root,r,Pa.FULLSCREEN),n.emit(Io,!0,n._fullScreenOffset),n.cssfullscreen&&n.exitCssFullscreen();else if(n.fullscreen){i();var a=Sr(n),s=a._fullScreenOffset;if(a.config.needFullscreenScroll?(window.scrollTo(s.left,s.top),Ur.setTimeout(Sr(n),(function(){n.fullscreen=!1,n._fullScreenOffset=null}),100)):(!n.config.closeFocusVideoFocus&&n.media.focus(),n.fullscreen=!1,n._fullScreenOffset=null),n.cssfullscreen)n.removeClass(Pa.FULLSCREEN);else{var l=n._fullscreenEl;l||!n.root.contains(e.target)&&e.target!==n.root||(l=e.target),n.recoverFullStyle(n.root,l,Pa.FULLSCREEN)}n._fullscreenEl=null,n.emit(Io,!1)}})),mr(Sr(n),"_onWebkitbeginfullscreen",(function(e){n._fullscreenEl=n.media,n.onFullscreenChange(e,!0)})),mr(Sr(n),"_onWebkitendfullscreen",(function(e){n.onFullscreenChange(e,!1)})),aa(Sr(n),Ha),n.config=o,n._pluginInfoId=Ur.generateSessionId(),(r=Sr(n)).logInfo=Nr.logInfo.bind(r),r.logWarn=Nr.logWarn.bind(r),r.logError=Nr.logError.bind(r);var a=n.constructor.defaultPreset;if(n.config.presets.length){var s=n.config.presets.indexOf("default");s>=0&&a&&(n.config.presets[s]=a)}else a&&n.config.presets.push(a);if(n.userTimer=null,n.waitTimer=null,n.handleSource=!0,n._state=Na.INITIAL,n.isAd=!1,n.isError=!1,n._hasStart=!1,n.isSeeking=!1,n.isCanplay=!1,n._useAutoplay=!1,n.__startTime=-1,n.rotateDeg=0,n.isActive=!1,n.fullscreen=!1,n.cssfullscreen=!1,n.isRotateFullscreen=!1,n._fullscreenEl=null,n.timeSegments=[],n._cssfullscreenEl=null,n.curDefinition=null,n._orgCss="",n._fullScreenOffset=null,n._videoHeight=0,n._videoWidth=0,n.videoPos={pi:1,scale:0,rotate:-1,x:0,y:0,h:-1,w:-1,vy:0,vx:0},n.sizeInfo={width:0,height:0,left:0,top:0},n._accPlayed={t:0,acc:0,loopAcc:0},n._offsetInfo={currentTime:-1,duration:0},n.innerContainer=null,n.controls=null,n.topBar=null,n.root=null,n.__i18n=La.init(n._pluginInfoId),Kr.os.isAndroid&&Kr.osVersion>0&&Kr.osVersion<6&&(n.config.autoplay=!1),n.database=new $o,n.isUserActive=!1,n._onceSeekCanplay=null,n._isPauseBeforeSeek=0,n.innerStates={isActiveLocked:!1},n.instManager=Ka,!n._initDOM())return console.error(new Error("can't find the dom which id is ".concat(n.config.id," or this.config.el does not exist"))),br(n);var l=n.config,c=l.definition,u=void 0===c?{}:c;if(!l.url&&u.list&&u.list.length>0){var h=u.list.find((function(e){return e.definition&&e.definition===u.defaultDefinition}));h||(u.defaultDefinition=u.list[0].definition,h=u.list[0]),n.config.url=h.url,n.curDefinition=h}return n._bindEvents(),n._registerPresets(),n._registerPlugins(),Ia.onPluginsReady(Sr(n)),n.getInitDefinition(),n.setState(Na.READY),Ur.setTimeout(Sr(n),(function(){n.emit(po)}),0),n.onReady&&n.onReady(),(n.config.videoInit||n.config.autoplay)&&(!n.hasStart||n.state<Na.ATTACHED)&&n.start(),n}return vr(i,[{key:"_initDOM",value:function(){var e,t=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var i=this.config.el;if(!i||1!==i.nodeType)return this.emit(Qr,new zr("use",this.config.vid,{line:32,handle:"Constructor",msg:"container id can't be empty"})),console.error("this.confg.id or this.config.el can't be empty"),!1;this.root=i}var n=function(e){for(var t=Object.keys(Ua),i=0;i<t.length;i++){var n=Ua[t[i]];if(n.root===e)return n}return null}(this.root);if(n&&(Nr.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),n.destroy()),this.root.setAttribute(Qo,this.playerId),this.media.setAttribute(Qo,this.playerId),null===(e=Ka)||void 0===e||e.add(this),Ia.init(this),this._initBaseDoms(),this.config.controls){var r=this.config.controls.root||null,o=Ia.register(this,wa,{root:r});this.controls=o}var a="mobile"===this.config.isMobileSimulateMode?"mobile":Kr.device;if(this.addClass("".concat(Pa.DEFAULT," ").concat(Pa.INACTIVE," xgplayer-").concat(a," ").concat(this.config.controls?"":Pa.NO_CONTROLS)),this.config.autoplay?this.addClass(Pa.ENTER):this.addClass(Pa.NO_START),this.config.fluid){var s=this.config,l=s.width,c=s.height;"number"==typeof l&&"number"==typeof c||(l=600,c=337.5);var u={width:"100%",height:"0","max-width":"100%","padding-top":"".concat(100*c/l,"%")};Object.keys(u).forEach((function(e){t.root.style[e]=u[e]}))}else["width","height"].forEach((function(e){t.config[e]&&("number"!=typeof t.config[e]?t.root.style[e]=t.config[e]:t.root.style[e]="".concat(t.config[e],"px"))}));var h=this.root.getBoundingClientRect(),d=h.width,f=h.height,p=h.left,g=h.top;return this.sizeInfo.width=d,this.sizeInfo.height=f,this.sizeInfo.left=p,this.sizeInfo.top=g,!0}},{key:"_initBaseDoms",value:function(){this.topBar=null,this.leftBar=null,this.rightBar=null,this.config.marginControls&&(this.innerContainer=Ur.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer))}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),Xo.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),Kr.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(ao,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once($r,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),Xo.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off($r,this.playFunc),this.off(no,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_clearUserTimer",value:function(){this.userTimer&&(Ur.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"_startInit",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.media&&(e&&""!==e&&("Array"!==Ur.typeOf(e)||0!==e.length)||(e="",this.emit(go),Nr.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){Ur.isNotNull(i.playSessionId)&&(this._playSessionId=i.playSessionId),this.handleSource&&(this._detachSourceEvents(this.media),"Array"===Ur.typeOf(e)&&e.length>0?this._attachSourceEvents(this.media,e):this.media.src&&this.media.src===e?e||this.media.removeAttribute("src"):this.media.src=e),"Number"===Ur.typeOf(this.config.volume)&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root;this.media instanceof window.Element&&!n.contains(this.media)&&n.insertBefore(this.media,n.firstChild);var r=this.media.readyState;Nr.logInfo("_startInit readyState",r),this.config.autoplay&&(!Ur.isMSE(this.media)&&this.load(),(Kr.os.isIpad||Kr.os.isPhone)&&this.mediaPlay());var o=this.config.startTime;this.__startTime=o>0?o:-1,this.config.startTime=0,r>=2&&this.duration>0?this.canPlayFunc():this.on(no,this.canPlayFunc),(!this.hasStart||this.state<Na.ATTACHED)&&Ia.afterInit(this),this.hasStart=!0,this.setState(Na.ATTACHED),Ur.setTimeout(this,(function(){t.emit(mo)}),0)}}},{key:"_registerPlugins",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._loadingPlugins=[];var i=this.config.ignores||[],n=this.config.plugins||[],r=this.config.i18n||[];t&&La.extend(r,this.__i18n);var o=i.join("||").toLowerCase().split("||"),a=this.plugins;n.forEach((function(i){try{var n=i.plugin?i.plugin.pluginName:i.pluginName;if(n&&o.indexOf(n.toLowerCase())>-1)return null;if(!t&&a[n.toLowerCase()])return;if(i.lazy&&i.loader){var r=Ia.lazyRegister(e,i);return void(i.forceBeforeInit&&(r.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})).catch((function(t){Nr.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})),e._loadingPlugins.push(r)))}return e.registerPlugin(i)}catch(s){Nr.logError("_registerPlugins:",s)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var i,n,r=t.preset&&t.options?new t.preset(t.options,e.config):new t({},e.config),o=r.plugins,a=void 0===o?[]:o,s=r.ignores,l=void 0===s?[]:s,c=r.icons,u=void 0===c?{}:c,h=r.i18n,d=void 0===h?[]:h;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(i=e.config.plugins).push.apply(i,Ir(a)),(n=e.config.ignores).push.apply(n,Ir(l)),Object.keys(u).map((function(t){e.config.icons[t]||(e.config.icons[t]=u[t])}));var f=e.config.i18n||[];d.push.apply(d,Ir(f)),e.config.i18n=d}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case ma.ROOT_RIGHT:this.rightBar||(this.rightBar=Ur.createPositionBar("xg-right-bar",this.root)),t=this.rightBar;break;case ma.ROOT_LEFT:this.leftBar||(this.leftBar=Ur.createPositionBar("xg-left-bar",this.root)),t=this.leftBar;break;case ma.ROOT_TOP:this.topBar||(this.topBar=Ur.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&Ur.addClass(this.topBar,Pa.TOP_BAR_AUTOHIDE)),t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var i=Ia.formatPluginInfo(e,t),n=i.PLUFGIN,r=i.options,o=this.config.plugins;!Ia.checkPluginIfExits(n.pluginName,o)&&o.push(n);var a=Ia.getRootByConfig(n.pluginName,this.config);a.root&&(r.root=a.root),a.position&&(r.position=a.position);var s,l=r.position?r.position:r.config&&r.config.position||n.defaultConfig&&n.defaultConfig.position;return!r.root&&"string"==typeof l&&l.indexOf("controls")>-1?null===(s=this.controls)||void 0===s?void 0:s.registerPlugin(n,r,n.pluginName):(r.root||(r.root=this._getRootByPosition(l)),Ia.register(this,n,r))}},{key:"deregister",value:function(e){"string"==typeof e?Ia.unRegister(this,e):e instanceof ua&&Ia.unRegister(this,e.pluginName)}},{key:"unRegisterPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.deregister(e),t&&this.removePluginFromConfig(e)}},{key:"removePluginFromConfig",value:function(e){var t;if("string"==typeof e?t=e:e instanceof ua&&(t=e.pluginName),t)for(var i=this.config.plugins.length-1;i>-1;i--){if(this.config.plugins[i].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(i,1);break}}}},{key:"plugins",get:function(){return Ia.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=Ia.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(Ur.hasClass(this.root,e)||Ur.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&Ur.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return Ur.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,t){this.root&&this.root.setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){this.root&&this.root.removeAttribute(e,t)}},{key:"start",value:function(e){var t=this;if(!(this.state>Na.ATTACHING)){var i=this._playSessionId;return Ur.isNotNull(i)&&(this._playSessionId=void 0),e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this.setState(Na.ATTACHING),this._registerPlugins(!1),Ia.beforeInit(this).then((function(){if(t.config){e||(e=t.url||t.config.url);var n=t.preProcessUrl(e);return t._startInit(n.url,{playSessionId:i})}})).catch((function(e){throw e.fileName="player",e.lineNumber="236",Nr.logError("start:beforeInit:",e),e}))}}},{key:"switchURL",value:function(e,t){var i=this,n=e;"Object"===Ur.typeOf(e)&&(n=e.url),n=this.preProcessUrl(n).url;var r=this.currentTime;this.__startTime=r;var o=this.paused&&!this.isError;return this.src=n,new Promise((function(e,t){var r=function(e){i.off("timeupdate",a),i.off("canplay",a),t(e)},a=function(){i._seekToStartTime(),o&&i.pause(),i.off("error",r),e(!0)};i.once("error",r),n?(Kr.os.isAndroid?i.once("timeupdate",a):i.once("canplay",a),i.play()):i.errorHandler("error",{code:6,message:"empty_src"})}))}},{key:"videoPlay",value:function(){this.mediaPlay()}},{key:"mediaPlay",value:function(){var e=this;if(!this.hasStart&&this.state<Na.ATTACHED)return this.removeClass(Pa.NO_START),this.addClass(Pa.ENTER),this.start(),void(this._useAutoplay=!0);this.state<Na.RUNNING&&(this.removeClass(Pa.NO_START),!this.isCanplay&&this.addClass(Pa.ENTER));var t=kr(Er(i.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(Pa.NOT_ALLOW_AUTOPLAY),e.addClass(Pa.PLAYING),e.state<Na.RUNNING&&(Nr.logInfo(">>>>playPromise.then"),e.setState(Na.RUNNING),e.emit(yo))})).catch((function(t){if(Nr.logWarn(">>>>playPromise.catch",t.name),e.media&&e.media.error)return e.onError(),void e.removeClass(Pa.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=Ur.setTimeout(e,(function(){e._errorTimer=null,e.emit(vo),e.addClass(Pa.NOT_ALLOW_AUTOPLAY),e.removeClass(Pa.ENTER),e.pause(),e.setState(Na.NOTALLOW)}),0))})):(Nr.logWarn("video.play not return promise"),this.state<Na.RUNNING&&(this.setState(Na.RUNNING),this.removeClass(Pa.NOT_ALLOW_AUTOPLAY),this.removeClass(Pa.NO_START),this.removeClass(Pa.ENTER),this.addClass(Pa.PLAYING),this.emit(yo))),t}},{key:"mediaPause",value:function(){kr(Er(i.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){kr(Er(i.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(Pa.PAUSED),la(this,"play",(function(){return e.mediaPlay()}))}},{key:"pause",value:function(){var e=this;la(this,"pause",(function(){kr(Er(i.prototype),"pause",e).call(e)}))}},{key:"seek",value:function(e,t){var i=this;if(this.media&&!Number.isNaN(Number(e))&&this.hasStart){var n=this.config,r=n.isSeekedPlay,o=n.seekedStatus,a=t||(r?"play":o);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(eo,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(i.removeClass(Pa.ENTER),i.isSeeking=!1,a){case"play":i.play();break;case"pause":i.pause();break;default:i._isPauseBeforeSeek>1||i.paused?i.pause():i.play()}i._isPauseBeforeSeek=0,i._onceSeekCanplay=null},this.once(eo,this._onceSeekCanplay),this.state<Na.RUNNING?(this.removeClass(Pa.NO_START),this.currentTime=e,this.play()):this.currentTime=e}}},{key:"getInitDefinition",value:function(){var e=this,t=this.config,i=t.definition;!t.url&&i&&i.list&&i.list.length>0&&i.defaultDefinition&&i.list.map((function(t){t.definition===i.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t)}))}},{key:"changeDefinition",value:function(e,t){var i=this,n=this.config.definition;if(Array.isArray(null==n?void 0:n.list)&&n.list.forEach((function(t){(null==e?void 0:e.definition)===t.definition&&(i.curDefinition=t)})),null!=e&&e.bitrate&&"number"!=typeof e.bitrate&&(e.bitrate=parseInt(e.bitrate,10)||0),this.emit(wo,{from:t,to:e}),this.hasStart){var r=this.switchURL(e.url,fr({seamless:!1!==n.seamless&&"undefined"!=typeof MediaSource&&"function"==typeof MediaSource.isTypeSupported},e));r&&r.then?r.then((function(){i.emit(Ao,{from:t,to:e})})):this.emit(Ao,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(ao,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[Pa.NOT_ALLOW_AUTOPLAY,Pa.PLAYING,Pa.NO_START,Pa.PAUSED,Pa.REPLAY,Pa.ENTER,Pa.ENDED,Pa.ERROR,Pa.LOADING];this.hasStart=!1,this.isError=!1,this._useAutoplay=!1,this.mediaPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,t.forEach((function(t){e.removeClass(t)})),this.addClass(Pa.NO_START),this.emit(Fo)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1?arguments[1]:void 0;if(this.resetState(),this.plugins&&(t.map((function(t){e.deregister(t)})),i)){var n=Da();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=n[t])}))}}},{key:"destroy",value:function(){var e,t=this,n=this.innerContainer,r=this.root,o=this.media;if(r&&o){if(this.hasStart=!1,this._useAutoplay=!1,r.removeAttribute(Qo),o.removeAttribute(Qo),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),Ur.clearAllTimers(this),this.emit(Eo),null===(e=Ka)||void 0===e||e.remove(this),Ia.destroy(this),sa(this),kr(Er(i.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),n)for(var a=n.children,s=0;s<a.length;s++)n.removeChild(a[s]);!n&&o instanceof window.Node&&r.contains(o)&&!this.config.remainMediaAfterDestroy&&r.removeChild(o),["topBar","leftBar","rightBar","innerContainer"].map((function(e){t[e]&&r.removeChild(t[e]),t[e]=null}));var l=r.className.split(" ");l.length>0?r.className=l.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):r.className="",this.removeAttribute("data-xgfill"),["isSeeking","isCanplay","isActive","cssfullscreen","fullscreen"].forEach((function(e){t[e]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(Pa.ENDED),this.currentTime=0,this.isSeeking=!1,la(this,"replay",(function(){e.once(eo,(function(){var t=e.mediaPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.emit(_o),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(Pa.ERROR),this.addClass(Pa.LOADING),la(this,"retry",(function(){var t=e.currentTime,i=e.config.url,n=Ur.isMSE(e.media)?{url:i}:e.preProcessUrl(i);e.src=n.url,!e.config.isLive&&(e.currentTime=t),e.once(no,(function(){e.mediaPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,i,n){e&&(n||(n=Pa.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=Ur.filterStyleFromText(e)),Ur.addClass(e,i),t&&t!==e&&!this._orgPCss&&(this._orgPCss=Ur.filterStyleFromText(t),Ur.addClass(t,n),t.setAttribute(Qo,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,i,n){n||(n=Pa.PARENT_FULLSCREEN),this._orgCss&&(Ur.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),Ur.removeClass(e,i),t&&t!==e&&this._orgPCss&&(Ur.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",Ur.removeClass(t,n),t.removeAttribute(Qo))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,i=this.media;if("video"!==e&&"media"!==e||(e=this[e]),e||(e=t),this._fullScreenOffset={top:Ur.scrollTop(),left:Ur.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get",Ur.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var n=0;n<qo.length;n++){var r=qo[n];if(e[r]){var o="webkitRequestFullscreen"===r?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[r]();return o&&o.then?o:Promise.resolve()}}return i.fullscreenEnabled||i.webkitSupportsFullscreen?(i.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(a){return Promise.reject(new Error("call getFullscreen fail"))}}},{key:"exitFullscreen",value:function(e){if(this.isRotateFullscreen&&this.exitRotateFullscreen(),this._fullscreenEl||Ur.getFullScreenEl()){this.root;var t=this.media;this._fullActionFrom="exit";try{for(var i=0;i<Zo.length;i++){var n=Zo[i];if(document[n]){var r=document[n]();return r&&r.then?r:Promise.resolve()}}return t&&t.webkitSupportsFullscreen?(t.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}catch(o){return Promise.reject(new Error("call exitFullscreen fail"))}}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.isRotateFullscreen?this.exitRotateFullscreen():this.fullscreen&&this.exitFullscreen();var t=e?"".concat(Pa.INNER_FULLSCREEN," ").concat(Pa.CSS_FULLSCREEN):Pa.CSS_FULLSCREEN;this.changeFullStyle(this.root,e,t);var i=this.config.fullscreen,n=void 0===i?{}:i;(!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen())&&(this.fullscreen=!0,this.emit(Io,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(Po,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(Pa.INNER_FULLSCREEN," ").concat(Pa.CSS_FULLSCREEN):Pa.CSS_FULLSCREEN;if(this.fullscreen){var t=this.config.fullscreen,i=void 0===t?{}:t;!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.useCssFullscreen()?(this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this.fullscreen=!1,this.emit(Io,!1)):this.removeClass(e)}else this.recoverFullStyle(this.root,this._cssfullscreenEl,e);this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(Po,!1)}},{key:"getRotateFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.cssfullscreen&&this.exitCssFullscreen(e);var t=e?"".concat(Pa.INNER_FULLSCREEN," ").concat(Pa.ROTATE_FULLSCREEN):Pa.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,t,Pa.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!0,this.fullscreen=!0,this.setRotateDeg(90),this._rootStyle=this.root.getAttribute("style");var i=90===Math.abs(window.orientation)||90===Math.abs(screen.orientation.angle);this.root.style.width="".concat(i?window.innerWidth:window.innerHeight,"px"),this.emit(Io,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this._fullscreenEl!==this.root?"".concat(Pa.INNER_FULLSCREEN," ").concat(Pa.ROTATE_FULLSCREEN):Pa.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,t,Pa.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(Io,!1),this._rootStyle&&(this.root.style.style=this._rootStyle,this._rootStyle=!1)}},{key:"setRotateDeg",value:function(e){90===window.orientation||-90===window.orientation?this.rotateDeg=0:this.rotateDeg=e}},{key:"focus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};this.isActive?this.onFocus(e):this.emit(ho,fr({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};this.isActive?(this._clearUserTimer(),this.emit(fo,fr({paused:this.paused,ended:this.ended},e))):this.onBlur(e)}},{key:"onFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!0,delay:3e3},i=this.innerStates;if(this.isActive=!0,this.removeClass(Pa.INACTIVE),this._clearUserTimer(),void 0!==t.isLock&&(i.isActiveLocked=t.isLock),!1===t.autoHide||!0===t.isLock||i.isActiveLocked)this._clearUserTimer();else{var n=t&&t.delay?t.delay:this.config.inactive;this.userTimer=Ur.setTimeout(this,(function(){e.userTimer=null,e.blur()}),n)}}},{key:"onBlur",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).ignorePaused,t=void 0!==e&&e;if(!this.innerStates.isActiveLocked){var i=this.config.closePauseVideoFocus;this.isActive=!1,(t||i||!this.paused&&!this.ended)&&this.addClass(Pa.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(Pa.ENTER),this.removeClass(Pa.ERROR),this.removeClass(Pa.LOADING),this.isCanplay=!0,this.waitTimer&&Ur.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){var e=this;this.isError=!1,this.isSeeking=!1,this.__startTime>0&&(this.duration>0?this._seekToStartTime():this.once(ro,(function(){e._seekToStartTime()})))}},{key:"onLoadstart",value:function(){this.removeClass(Pa.ERROR),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===Na.ENDED&&this.setState(Na.RUNNING),this.removeClass(Pa.PAUSED),this.ended&&this.removeClass(Pa.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(Pa.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this._clearUserTimer(),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(Pa.ENDED),this.setState(Na.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(Pa.NOT_ALLOW_AUTOPLAY),this.removeClass(Pa.NO_START),this.removeClass(Pa.ENTER),this.removeClass(Pa.LOADING),this.addClass(Pa.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(Pa.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&Ur.clearTimeout(this,this.waitTimer),this.removeClass(Pa.LOADING),this.removeClass(Pa.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&Ur.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=Ur.setTimeout(this,(function(){e.addClass(Pa.LOADING),e.emit(ko),Ur.clearTimeout(e,e.waitTimer),e.waitTimer=null}),this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[Pa.NO_START,Pa.PAUSED,Pa.ENDED,Pa.ERROR,Pa.REPLAY,Pa.LOADING].forEach((function(t){e.removeClass(t)})),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.media.videoHeight&&this.resize(),(this.waitTimer||this.hasClass(Pa.LOADING))&&this.media.readyState>2&&(this.removeClass(Pa.LOADING),Ur.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state===Na.NOTALLOW&&this.duration&&(this.setState(Na.RUNNING),this.emit(yo)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===Ur.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"emitUserAction",value:function(e,t,i){if(this.media&&t&&e){var n="String"===Ur.typeOf(e)?e:e.type||"";i.props&&"Array"!==Ur.typeOf(i.props)&&(i.props=[i.props]),this.emit(Bo,fr({eventType:n,action:t,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},i))}}},{key:"updateAcc",value:function(e){if(this._accPlayed.t){var t=(new Date).getTime()-this._accPlayed.t;this._accPlayed.acc+=t,this._accPlayed.t=0,("ended"===e||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{startDiff:0,endDiff:0})||{},i=t.startDiff,n=void 0===i?0:i,r=t.endDiff,o=void 0===r?0:r,a=this.media.buffered;if(!a||0===a.length||!this.duration)return!0;for(var s=e||this.media.currentTime||.2,l=a.length,c=0;c<l;c++)if(a.start(c)+n<=s&&a.end(c)-o>s)return!0;return!1}},{key:"resizePosition",value:function(){var e=this,t=this.videoPos,i=t.vy,n=t.vx,r=t.h,o=t.w,a=this.videoPos.rotate;if(!(a<0&&r<0&&o<0)){var s=this.videoPos._pi;if(!s&&this.media.videoHeight&&(s=this.media.videoWidth/this.media.videoHeight*100),s){this.videoPos.pi=s;var l={rotate:a=a<0?0:a},c=0,u=0,h=1,d=Math.abs(a/90),f=this.root,p=this.innerContainer,g=f.offsetWidth,y=p?p.offsetHeight:f.offsetHeight,v={},m=y,_=g;if(d%2==0)h=r>0?100/r:o>0?100/o:1,l.scale=h,c=i>0?(100-r)/2-i:0,l.y=2===d?0-c:c,u=n>0?(100-o)/2-n:0,l.x=2===d?0-u:u,v.width="".concat(_,"px"),v.height="".concat(m,"px"),v.maxWidth="",v.maxHeight="";else if(d%2==1){m=g;var E=y-g;u=-E/2/(_=y)*100,l.x=3===d?u+i/2:u-i/2,c=E/2/m*100,l.y=3===d?c+n/2:c-n/2,l.scale=h,v.width="".concat(_,"px"),v.maxWidth="".concat(_,"px"),v.height="".concat(m,"px"),v.maxHeight="".concat(m,"px")}var T=Ur.getTransformStyle(l,this.media.style.transform||this.media.style.webkitTransform);v.transform=T,v.webkitTransform=T,Object.keys(v).map((function(t){e.media.style[t]=v[t]}))}}}},{key:"position",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{h:0,y:0,x:0,w:0};if(this.media&&e&&e.h){var t=this.videoPos;t.h=100*e.h||0,t.w=100*e.w||0,t.vx=100*e.x||0,t.vy=100*e.y||0,this.resizePosition()}}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(i){if("plugins"!==i){t.config[i]=e[i];var n=t.plugins[i.toLowerCase()];n&&"Function"===Ur.typeOf(n.setConfig)&&n.setConfig(e[i])}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this.setConfig(e),this._currentTime=0,this._duration=0,la(this,"playnext",(function(){t.start(),t.emit(No,e)}))}},{key:"resize",value:function(){var e=this;if(this.media&&this.root){var t=this.root.getBoundingClientRect();this.sizeInfo.width=t.width,this.sizeInfo.height=t.height,this.sizeInfo.left=t.left,this.sizeInfo.top=t.top;var i=this.media,n=i.videoWidth,r=i.videoHeight,o=this.config,a=o.fitVideoSize,s=o.videoFillMode;if("fill"!==s&&"cover"!==s&&"contain"!==s||this.setAttribute("data-xgfill",s),r&&n){this._videoHeight=r,this._videoWidth=n;var l=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,c=t.width,u=t.height-l,h=parseInt(n/r*1e3,10),d=parseInt(c/u*1e3,10),f=c,p=u,g={};"auto"===a&&d>h||"fixWidth"===a?(p=c/h*1e3,this.config.fluid?g.paddingTop="".concat(100*p/f,"%"):g.height="".concat(p+l,"px")):("auto"===a&&d<h||"fixHeight"===a)&&(f=h*u/1e3,g.width="".concat(f,"px")),this.fullscreen||this.cssfullscreen||Object.keys(g).forEach((function(t){e.root.style[t]=g[t]})),("fillHeight"===s&&d<h||"fillWidth"===s&&d>h)&&this.setAttribute("data-xgfill","cover");var y={videoScale:h,vWidth:f,vHeight:p,cWidth:f,cHeight:p+l};this.resizePosition(),this.emit(Ro,y)}}}},{key:"updateObjectPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.media.updateObjectPosition?this.media.updateObjectPosition(e,t):this.media.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%")}},{key:"setState",value:function(e){Nr.logInfo("setState","state from:".concat(Ma[this.state]," to:").concat(Ma[e])),this._state=e}},{key:"preProcessUrl",value:function(e,t){var i=this.config,n=i.preProcessUrl,r=i.preProcessUrlOptions,o=Object.assign({},r,t);return Ur.isBlob(e)||"function"!=typeof n?{url:e}:n(e,o)}},{key:"_seekToStartTime",value:function(){this.__startTime>0&&this.duration>0&&(this.currentTime=this.__startTime>this.duration?this.duration:this.__startTime,this.__startTime=-1)}},{key:"state",get:function(){return this._state}},{key:"isFullscreen",get:function(){return this.fullscreen}},{key:"isCssfullScreen",get:function(){return this.cssfullscreen}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"==typeof e&&(this._hasStart=e,!1===e&&this.setState(Na.READY),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===Na.RUNNING||this._state===Na.ENDED},set:function(e){e?this.setState(Na.RUNNING):this._state>=Na.RUNNING&&this.setState(Na.ATTACHED)}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,i=this.config.definition,n=null,r=null;i.list=e,this.emit("resourceReady",e),e.forEach((function(e){var o;(null===(o=t.curDefinition)||void 0===o?void 0:o.definition)===e.definition&&(n=e),i.defaultDefinition===e.definition&&(r=e)})),!r&&e.length>0&&(r=e[0]),n?this.changeDefinition(n):r&&this.changeDefinition(r)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.media||!this.media.getVideoPlaybackQuality)return e;var t=this.media.getVideoPlaybackQuality();return e.dropped=t.droppedVideoFrames||0,e.total=t.totalVideoFrames||0,e.corrupted=t.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){var t=La.langKeys.filter((function(t){return t===e}));0!==t.length||"zh"===e?(this.config.lang=e,Ia.setLang(e,this)):console.error("Sorry, set lang fail, because the language [".concat(e,"] is not supported now, list of all supported languages is [").concat(La.langKeys.join(),"] "))}},{key:"i18n",get:function(){var e=this.config.lang;return"zh"===e&&(e="zh-cn"),this.__i18n.lang[e]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return Wr}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(e){this.__url=e}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(e){this.plugins.poster&&this.plugins.poster.update(e)}},{key:"readyState",get:function(){return kr(Er(i.prototype),"readyState",this)}},{key:"error",get:function(){var e=kr(Er(i.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return kr(Er(i.prototype),"networkState",this)}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed,t=e.acc,i=e.t;return i?(new Date).getTime()-i+t:t}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(e){(e=Ur.convertDeg(e))%90==0&&e!==this.videoPos.rotate&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return Va},set:function(e){Va=e}},{key:"realTimeSpeed",get:function(){return ja},set:function(e){ja=e}},{key:"offsetCurrentTime",get:function(){return this._offsetInfo.currentTime||0},set:function(e){this._offsetInfo.currentTime=e}},{key:"offsetDuration",get:function(){return this._offsetInfo.duration||0},set:function(e){this._offsetInfo.duration=e||0}},{key:"hook",value:function(e,t){return ea.call.apply(ea,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return ia.call.apply(ia,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return na.call.apply(na,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,t,i){for(var n=arguments.length,r=new Array(n>3?n-3:0),o=3;o<n;o++)r[o-3]=arguments[o];return ra.call.apply(ra,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,t,i){for(var n=arguments.length,r=new Array(n>3?n-3:0),o=3;o<n;o++)r[o-3]=arguments[o];return oa.call.apply(oa,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){var i;"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),Ur.typeOf(t)===Boolean&&(this.muted=t)),null===(i=Ka)||void 0===i||i.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return Nr.config.debug},set:function(e){Nr.config.debug=e}},{key:"instManager",get:function(){return Ka},set:function(e){Ka=e}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return null===(e=Ka)||void 0===e?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,t){var i;null===(i=Ka)||void 0===i||i.setActive(e,t)}},{key:"isHevcSupported",value:function(){return Kr.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return Kr.probeConfigSupported(e)}},{key:"install",value:function(e,t){i.plugins||(i.plugins={}),i.plugins[e]||(i.plugins[e]=t)}},{key:"use",value:function(e,t){i.plugins||(i.plugins={}),i.plugins[e]=t}}]),i}();mr(Wa,"defaultPreset",null),mr(Wa,"XgVideoProxy",null),Wa.instManager=Fa.getInstance();const Ga={origin:{index:1,next:"uhd",prev:null},uhd:{index:2,next:"hd",prev:"origin"},hd:{index:3,next:"sd",prev:"uhd"},sd:{index:4,next:"ld",prev:"hd"},ld:{index:5,next:"ao",prev:"sd"},ao:{index:6,next:null,prev:"ld"}},Ya=["zh","en","jp","zh-hk"],za={NORMAL:0,INNER:1,FULLSCREEN:2};var $a=(e=>(e[e.VALID=10]="VALID",e[e.TRANSCODING=30]="TRANSCODING",e[e.NO_SET_AUDIT=1e3]="NO_SET_AUDIT",e[e.OFFLINE=1002]="OFFLINE",e[e.NO_AUTH=2001]="NO_AUTH",e[e.UN_AUTH=2002]="UN_AUTH",e))($a||{});const Xa=5e9,qa={jp:"キャンセル",en:"Cancel",zh:"取消","zh-hk":"取消"};var Za=(e=>(e.WIDEVINE="widevine",e.FAIRPLAY="fairplay",e.PLAYREADY="playready",e))(Za||{}),Qa={LANG:"jp",TEXT:{ERROR_TYPES:{network:{code:1,msg:"ビデオダウンロードエラー"},mse:{code:2,msg:"ストリーム追加エラー"},parse:{code:3,msg:"解析エラー"},format:{code:4,msg:"間違ったフォーマット"},decoder:{code:5,msg:"デコードエラー"},runtime:{code:6,msg:"文法エラー"},timeout:{code:7,msg:"再生タイムアウト"},other:{code:8,msg:"その他のエラー"}},HAVE_NOTHING:"オーディオ/ビデオが準備できているか情報がありません",HAVE_METADATA:"オーディオ/ビデオのメタデータは準備できています",HAVE_CURRENT_DATA:"現在の再生位置に関するデータは利用可能ですが、次のフレーム/ミリ秒を再生するのに十分なデータがありません",HAVE_FUTURE_DATA:"現在、少なくとも次のフレームのデータが利用可能です",HAVE_ENOUGH_DATA:"利用可能なデータは再生を開始するのに十分です",NETWORK_EMPTY:"オーディオ/ビデオが初期化されていません",NETWORK_IDLE:"オーディオ/ビデオはアクティブでリソースが選択されていますが、ネットワークが使用されていません",NETWORK_LOADING:"ブラウザーはデータをダウンロードしています",NETWORK_NO_SOURCE:"オーディオ/ビデオ のソースが見つかりません",MEDIA_ERR_ABORTED:"ユーザーによってフェッチプロセスが中止されました",MEDIA_ERR_NETWORK:"ダウンロード中にエラーが発生しました",MEDIA_ERR_DECODE:"デコード中にエラーが発生しました",MEDIA_ERR_SRC_NOT_SUPPORTED:"オーディオ/ビデオ の形式がサポートされていません",REPLAY:"リプレイ",ERROR:"ネットワークの接続に問題が発生しました",PLAY_TIPS:"プレイ",PAUSE_TIPS:"一時停止",PLAYNEXT_TIPS:"次をプレイ",DOWNLOAD_TIPS:"ダウンロード",ROTATE_TIPS:"回転",RELOAD_TIPS:"再読み込み",FULLSCREEN_TIPS:"フルスクリーン",EXITFULLSCREEN_TIPS:"フルスクリーンを終了",CSSFULLSCREEN_TIPS:"シアターモード",EXITCSSFULLSCREEN_TIPS:"シアターモードを終了",TEXTTRACK:"字幕",PIP:"ミニプレーヤー",SCREENSHOT:"スクリーンショット",LIVE:"生放送",OFF:"オフ",OPEN:"開いた",MINI_DRAG:"ボタンを押して働画をドラッグする",MINISCREEN:"小さな画面",REFRESH:"リフレッシュ",REFRESH_TIPS:"してみてください",FORWARD:"早送り",LIVE_TIP:"生放送"}},Ja={LANG:"zh-hk",TEXT:{ERROR_TYPES:{network:{code:1,msg:"視頻下載錯誤"},mse:{code:2,msg:"流追加錯誤"},parse:{code:3,msg:"解析錯誤"},format:{code:4,msg:"格式錯誤"},decoder:{code:5,msg:"解碼錯誤"},runtime:{code:6,msg:"語法錯誤"},timeout:{code:7,msg:"播放超時"},other:{code:8,msg:"其他錯誤"}},HAVE_NOTHING:"沒有關於音頻/視頻是否就緒的信息",HAVE_METADATA:"音頻/視頻的元數據已就緒",HAVE_CURRENT_DATA:"關於當前播放位置的數據是可用的,但沒有足夠的數據來播放下壹幀/毫秒",HAVE_FUTURE_DATA:"當前及至少下壹幀的數據是可用的",HAVE_ENOUGH_DATA:"可用數據足以開始播放",NETWORK_EMPTY:"音頻/視頻尚未初始化",NETWORK_IDLE:"音頻/視頻是活動的且已選取資源,但並未使用網絡",NETWORK_LOADING:"瀏覽器正在下載數據",NETWORK_NO_SOURCE:"未找到音頻/視頻來源",MEDIA_ERR_ABORTED:"取回過程被用戶中止",MEDIA_ERR_NETWORK:"下載錯誤",MEDIA_ERR_DECODE:"解碼錯誤",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音頻/視頻格式",REPLAY:"重播",ERROR:"網絡連接似乎出現了問題",PLAY_TIPS:"播放",PAUSE_TIPS:"暫停",PLAYNEXT_TIPS:"下壹集",DOWNLOAD_TIPS:"下載",ROTATE_TIPS:"旋轉",RELOAD_TIPS:"重新載入",FULLSCREEN_TIPS:"進入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"進入樣式全屏",EXITCSSFULLSCREEN_TIPS:"退出樣式全屏",TEXTTRACK:"字幕",PIP:"畫中畫",SCREENSHOT:"截圖",LIVE:"正在直播",OFF:"關閉",OPEN:"開啟",MINI_DRAG:"點擊按住可拖動視頻",MINISCREEN:"小屏幕",REFRESH_TIPS:"請試試",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}};const es="undefined"!=typeof window&&window.location&&window.location.href.indexOf("veplayerdebugger=1")>-1,ts="color: #fff; background-color: #5f5f5f;",is="color: #fff; background-color: #f53f3f;",ns="color: #fff; background-color: #ff7d00;",rs="color: #fff; background: #4281ff",os="%c VePlayer %c 1.18.0-rc.9 ",as={config:{debug:es?3:1},log:function(e,...t){this.config.debug>=3&&console.log(os,ts,rs,e,...t)},warn:function(e,...t){this.config.debug>=1&&console.warn(os,ns,rs,e,...t)},error:function(e,...t){if(this.config.debug<1)return;const i=this.config.debug>=2?"trace":"error";console[i](os,is,rs,e,...t)}};localStorage.getItem("velog")&&(as.config.debug=3);var ss={exports:{}};ss.exports=function(){var e=1e3,t=6e4,i=36e5,n="millisecond",r="second",o="minute",a="hour",s="day",l="week",c="month",u="quarter",h="year",d="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},v=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},m={s:v,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+v(n,2,"0")+":"+v(r,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),r=t.clone().add(n,c),o=i-r<0,a=t.clone().add(n+(o?-1:1),c);return+(-(n+(i-r)/(o?r-a:a-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:h,w:l,d:s,D:d,h:a,m:o,s:r,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},_="en",E={};E[_]=y;var T=function(e){return e instanceof k},S=function e(t,i,n){var r;if(!t)return _;if("string"==typeof t){var o=t.toLowerCase();E[o]&&(r=o),i&&(E[o]=i,r=o);var a=t.split("-");if(!r&&a.length>1)return e(a[0])}else{var s=t.name;E[s]=t,r=s}return!n&&r&&(_=r),r||!n&&_},b=function(e,t){if(T(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new k(i)},C=m;C.l=S,C.i=T,C.w=function(e,t){return b(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var k=function(){function y(e){this.$L=S(e.locale,null,!0),this.parse(e)}var v=y.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(C.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(p);if(n){var r=n[2]-1||0,o=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},v.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},v.$utils=function(){return C},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(e,t){var i=b(e);return this.startOf(t)<=i&&i<=this.endOf(t)},v.isAfter=function(e,t){return b(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<b(e)},v.$g=function(e,t,i){return C.u(e)?this[t]:this.set(i,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var i=this,n=!!C.u(t)||t,u=C.p(e),f=function(e,t){var r=C.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return n?r:r.endOf(s)},p=function(e,t){return C.w(i.toDate()[e].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},g=this.$W,y=this.$M,v=this.$D,m="set"+(this.$u?"UTC":"");switch(u){case h:return n?f(1,0):f(31,11);case c:return n?f(1,y):f(0,y+1);case l:var _=this.$locale().weekStart||0,E=(g<_?g+7:g)-_;return f(n?v-E:v+(6-E),y);case s:case d:return p(m+"Hours",0);case a:return p(m+"Minutes",1);case o:return p(m+"Seconds",2);case r:return p(m+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var i,l=C.p(e),u="set"+(this.$u?"UTC":""),f=(i={},i[s]=u+"Date",i[d]=u+"Date",i[c]=u+"Month",i[h]=u+"FullYear",i[a]=u+"Hours",i[o]=u+"Minutes",i[r]=u+"Seconds",i[n]=u+"Milliseconds",i)[l],p=l===s?this.$D+(t-this.$W):t;if(l===c||l===h){var g=this.clone().set(d,1);g.$d[f](p),g.init(),this.$d=g.set(d,Math.min(this.$D,g.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[C.p(e)]()},v.add=function(n,u){var d,f=this;n=Number(n);var p=C.p(u),g=function(e){var t=b(f);return C.w(t.date(t.date()+Math.round(e*n)),f)};if(p===c)return this.set(c,this.$M+n);if(p===h)return this.set(h,this.$y+n);if(p===s)return g(1);if(p===l)return g(7);var y=(d={},d[o]=t,d[a]=i,d[r]=e,d)[p]||1,v=this.$d.getTime()+n*y;return C.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||f;var n=e||"YYYY-MM-DDTHH:mm:ssZ",r=C.z(this),o=this.$H,a=this.$m,s=this.$M,l=i.weekdays,c=i.months,u=function(e,i,r,o){return e&&(e[i]||e(t,n))||r[i].slice(0,o)},h=function(e){return C.s(o%12||12,e,"0")},d=i.meridiem||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n},p={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:C.s(s+1,2,"0"),MMM:u(i.monthsShort,s,c,3),MMMM:u(c,s),D:this.$D,DD:C.s(this.$D,2,"0"),d:String(this.$W),dd:u(i.weekdaysMin,this.$W,l,2),ddd:u(i.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(o),HH:C.s(o,2,"0"),h:h(1),hh:h(2),a:d(o,a,!0),A:d(o,a,!1),m:String(a),mm:C.s(a,2,"0"),s:String(this.$s),ss:C.s(this.$s,2,"0"),SSS:C.s(this.$ms,3,"0"),Z:r};return n.replace(g,(function(e,t){return t||p[e]||r.replace(":","")}))},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(n,d,f){var p,g=C.p(d),y=b(n),v=(y.utcOffset()-this.utcOffset())*t,m=this-y,_=C.m(this,y);return _=(p={},p[h]=_/12,p[c]=_,p[u]=_/3,p[l]=(m-v)/6048e5,p[s]=(m-v)/864e5,p[a]=m/i,p[o]=m/t,p[r]=m/e,p)[g]||m,f?_:C.a(_)},v.daysInMonth=function(){return this.endOf(c).$D},v.$locale=function(){return E[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=S(e,t,!0);return n&&(i.$L=n),i},v.clone=function(){return C.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},y}(),I=k.prototype;return b.prototype=I,[["$ms",n],["$s",r],["$m",o],["$H",a],["$W",s],["$M",c],["$y",h],["$D",d]].forEach((function(e){I[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),b.extend=function(e,t){return e.$i||(e(t,k,b),e.$i=!0),b},b.locale=S,b.isDayjs=T,b.unix=function(e){return b(1e3*e)},b.en=E[_],b.Ls=E,b.p={},b}();const ls=lr(ss.exports);var cs,us,hs,ds={exports:{}};const fs=lr(ds.exports=(cs="minute",us=/[+-]\d\d(?::?\d\d)?/g,hs=/([+-]|\d\d)/g,function(e,t,i){var n=t.prototype;i.utc=function(e){return new t({date:e,utc:!0,args:arguments})},n.utc=function(e){var t=i(this.toDate(),{locale:this.$L,utc:!0});return e?t.add(this.utcOffset(),cs):t},n.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var r=n.parse;n.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),r.call(this,e)};var o=n.init;n.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else o.call(this)};var a=n.utcOffset;n.utcOffset=function(e,t){var i=this.$utils().u;if(i(e))return this.$u?0:i(this.$offset)?a.call(this):this.$offset;if("string"==typeof e&&null===(e=function(e){void 0===e&&(e="");var t=e.match(us);if(!t)return null;var i=(""+t[0]).match(hs)||["-",0,0],n=i[0],r=60*+i[1]+ +i[2];return 0===r?0:"+"===n?r:-r}(e)))return this;var n=Math.abs(e)<=16?60*e:e,r=this;if(t)return r.$offset=n,r.$u=0===e,r;if(0!==e){var o=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(r=this.local().add(n+o,cs)).$offset=n,r.$x.$localOffset=o}else r=this.utc();return r};var s=n.format;n.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return s.call(this,t)},n.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},n.isUTC=function(){return!!this.$u},n.toISOString=function(){return this.toDate().toISOString()},n.toString=function(){return this.toDate().toUTCString()};var l=n.toDate;n.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var c=n.diff;n.diff=function(e,t,n){if(e&&this.$u===e.$u)return c.call(this,e,t,n);var r=this.local(),o=i(e).local();return c.call(r,o,t,n)}}));var ps=function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=22)}([function(e,t,i){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,i){var n=i(12)("wks"),r=i(13),o=i(0).Symbol,a="function"==typeof o;(e.exports=function(e){return n[e]||(n[e]=a&&o[e]||(a?o:r)("Symbol."+e))}).store=n},function(e,t,i){var n=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},function(e,t,i){var n=i(4);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,i){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};e.exports=function(e){return"object"===(void 0===e?"undefined":n(e))?null!==e:"function"==typeof e}},function(e,t,i){var n=i(6);e.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,r){return e.call(t,i,n,r)}}return function(){return e.apply(t,arguments)}}},function(e,t,i){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,i){e.exports=!i(15)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,i){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,i){var n=i(3),r=i(26),o=i(27),a=Object.defineProperty;t.f=i(7)?Object.defineProperty:function(e,t,i){if(n(e),t=o(t,!0),n(i),r)try{return a(e,t,i)}catch(s){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},function(e,t,i){e.exports=!1},function(e,t,i){var n=i(8),r=i(1)("toStringTag"),o="Arguments"==n(function(){return arguments}());e.exports=function(e){var t,i,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(i){}}(t=Object(e),r))?i:o?n(t):"Object"==(a=n(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,i){var n=i(2),r=i(0),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:i(10)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,i){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,i){var n=i(9),r=i(28);e.exports=i(7)?function(e,t,i){return n.f(e,t,r(1,i))}:function(e,t,i){return e[t]=i,e}},function(e,t,i){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t,i){var n=i(4),r=i(0).document,o=n(r)&&n(r.createElement);e.exports=function(e){return o?r.createElement(e):{}}},function(e,t,i){var n=i(0),r=i(14),o=i(18),a=i(13)("src"),s=i(29),l=(""+s).split("toString");i(2).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,i,s){var c="function"==typeof i;c&&(o(i,"name")||r(i,"name",t)),e[t]!==i&&(c&&(o(i,a)||r(i,a,e[t]?""+e[t]:l.join(String(t)))),e===n?e[t]=i:s?e[t]?e[t]=i:r(e,t,i):(delete e[t],r(e,t,i)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},function(e,t,i){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,i){e.exports={}},function(e,t,i){var n,r,o,a=i(5),s=i(38),l=i(39),c=i(16),u=i(0),h=u.process,d=u.setImmediate,f=u.clearImmediate,p=u.MessageChannel,g=u.Dispatch,y=0,v={},m=function(){var e=+this;if(v.hasOwnProperty(e)){var t=v[e];delete v[e],t()}},_=function(e){m.call(e.data)};d&&f||(d=function(e){for(var t=[],i=1;arguments.length>i;)t.push(arguments[i++]);return v[++y]=function(){s("function"==typeof e?e:Function(e),t)},n(y),y},f=function(e){delete v[e]},"process"==i(8)(h)?n=function(e){h.nextTick(a(m,e,1))}:g&&g.now?n=function(e){g.now(a(m,e,1))}:p?(o=(r=new p).port2,r.port1.onmessage=_,n=a(o.postMessage,o,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(n=function(e){u.postMessage(e+"","*")},u.addEventListener("message",_,!1)):n="onreadystatechange"in c("script")?function(e){l.appendChild(c("script")).onreadystatechange=function(){l.removeChild(this),m.call(e)}}:function(e){setTimeout(a(m,e,1),0)}),e.exports={set:d,clear:f}},function(e,t,i){var n=i(6);function r(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=n})),this.resolve=n(t),this.reject=n(i)}e.exports.f=function(e){return new r(e)}},function(e,t,i){e.exports=i(23)},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),i(24);var n,r=(n=i(48))&&n.__esModule?n:{default:n};t.default={url:r.default},e.exports=t.default},function(e,t,i){var n,r,o,a,s=i(10),l=i(0),c=i(5),u=i(11),h=i(25),d=i(4),f=i(6),p=i(30),g=i(31),y=i(37),v=i(20).set,m=i(40)(),_=i(21),E=i(41),T=i(42),S=i(43),b=l.TypeError,C=l.process,k=C&&C.versions,I=k&&k.v8||"",P=l.Promise,D="process"==u(C),w=function(){},A=r=_.f,R=!!function(){try{var e=P.resolve(1),t=(e.constructor={})[i(1)("species")]=function(e){e(w,w)};return(D||"function"==typeof PromiseRejectionEvent)&&e.then(w)instanceof t&&0!==I.indexOf("6.6")&&-1===T.indexOf("Chrome/66")}catch(n){}}(),x=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},O=function(e,t){if(!e._n){e._n=!0;var i=e._c;m((function(){for(var n=e._v,r=1==e._s,o=0,a=function(t){var i,o,a,s=r?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{s?(r||(2==e._h&&M(e),e._h=1),!0===s?i=n:(u&&u.enter(),i=s(n),u&&(u.exit(),a=!0)),i===t.promise?c(b("Promise-chain cycle")):(o=x(i))?o.call(i,l,c):l(i)):c(n)}catch(h){u&&!a&&u.exit(),c(h)}};i.length>o;)a(i[o++]);e._c=[],e._n=!1,t&&!e._h&&L(e)}))}},L=function(e){v.call(l,(function(){var t,i,n,r=e._v,o=N(e);if(o&&(t=E((function(){D?C.emit("unhandledRejection",r,e):(i=l.onunhandledrejection)?i({promise:e,reason:r}):(n=l.console)&&n.error&&n.error("Unhandled promise rejection",r)})),e._h=D||N(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},N=function(e){return 1!==e._h&&0===(e._a||e._c).length},M=function(e){v.call(l,(function(){var t;D?C.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})}))},U=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),O(t,!0))},B=function e(t){var i,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw b("Promise can't be resolved itself");(i=x(t))?m((function(){var r={_w:n,_d:!1};try{i.call(t,c(e,r,1),c(U,r,1))}catch(o){U.call(r,o)}})):(n._v=t,n._s=1,O(n,!1))}catch(r){U.call({_w:n,_d:!1},r)}}};R||(P=function(e){p(this,P,"Promise","_h"),f(e),n.call(this);try{e(c(B,this,1),c(U,this,1))}catch(t){U.call(this,t)}},(n=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=i(44)(P.prototype,{then:function(e,t){var i=A(y(this,P));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=D?C.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&O(this,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new n;this.promise=e,this.resolve=c(B,e,1),this.reject=c(U,e,1)},_.f=A=function(e){return e===P||e===a?new o(e):r(e)}),h(h.G+h.W+h.F*!R,{Promise:P}),i(45)(P,"Promise"),i(46)("Promise"),a=i(2).Promise,h(h.S+h.F*!R,"Promise",{reject:function(e){var t=A(this);return(0,t.reject)(e),t.promise}}),h(h.S+h.F*(s||!R),"Promise",{resolve:function(e){return S(s&&this===a?P:this,e)}}),h(h.S+h.F*!(R&&i(47)((function(e){P.all(e).catch(w)}))),"Promise",{all:function(e){var t=this,i=A(t),n=i.resolve,r=i.reject,o=E((function(){var i=[],o=0,a=1;g(e,!1,(function(e){var s=o++,l=!1;i.push(void 0),a++,t.resolve(e).then((function(e){l||(l=!0,i[s]=e,--a||n(i))}),r)})),--a||n(i)}));return o.e&&r(o.v),i.promise},race:function(e){var t=this,i=A(t),n=i.reject,r=E((function(){g(e,!1,(function(e){t.resolve(e).then(i.resolve,n)}))}));return r.e&&n(r.v),i.promise}})},function(e,t,i){var n=i(0),r=i(2),o=i(14),a=i(17),s=i(5),l=function e(t,i,l){var c,u,h,d,f=t&e.F,p=t&e.G,g=t&e.P,y=t&e.B,v=p?n:t&e.S?n[i]||(n[i]={}):(n[i]||{}).prototype,m=p?r:r[i]||(r[i]={}),_=m.prototype||(m.prototype={});for(c in p&&(l=i),l)h=((u=!f&&v&&void 0!==v[c])?v:l)[c],d=y&&u?s(h,n):g&&"function"==typeof h?s(Function.call,h):h,v&&a(v,c,h,t&e.U),m[c]!=h&&o(m,c,d),g&&_[c]!=h&&(_[c]=h)};n.core=r,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,i){e.exports=!i(7)&&!i(15)((function(){return 7!=Object.defineProperty(i(16)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,i){var n=i(4);e.exports=function(e,t){if(!n(e))return e;var i,r;if(t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;if("function"==typeof(i=e.valueOf)&&!n(r=i.call(e)))return r;if(!t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},function(e,t,i){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,i){e.exports=i(12)("native-function-to-string",Function.toString)},function(e,t,i){e.exports=function(e,t,i,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(i+": incorrect invocation!");return e}},function(e,t,i){var n=i(5),r=i(32),o=i(33),a=i(3),s=i(34),l=i(36),c={},u={},h=e.exports=function(e,t,i,h,d){var f,p,g,y,v=d?function(){return e}:l(e),m=n(i,h,t?2:1),_=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(o(v)){for(f=s(e.length);f>_;_++)if((y=t?m(a(p=e[_])[0],p[1]):m(e[_]))===c||y===u)return y}else for(g=v.call(e);!(p=g.next()).done;)if((y=r(g,m,p.value,t))===c||y===u)return y};h.BREAK=c,h.RETURN=u},function(e,t,i){var n=i(3);e.exports=function(e,t,i,r){try{return r?t(n(i)[0],i[1]):t(i)}catch(a){var o=e.return;throw void 0!==o&&n(o.call(e)),a}}},function(e,t,i){var n=i(19),r=i(1)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||o[r]===e)}},function(e,t,i){var n=i(35),r=Math.min;e.exports=function(e){return e>0?r(n(e),9007199254740991):0}},function(e,t,i){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,i){var n=i(11),r=i(1)("iterator"),o=i(19);e.exports=i(2).getIteratorMethod=function(e){if(null!=e)return e[r]||e["@@iterator"]||o[n(e)]}},function(e,t,i){var n=i(3),r=i(6),o=i(1)("species");e.exports=function(e,t){var i,a=n(e).constructor;return void 0===a||null==(i=n(a)[o])?t:r(i)}},function(e,t,i){e.exports=function(e,t,i){var n=void 0===i;switch(t.length){case 0:return n?e():e.call(i);case 1:return n?e(t[0]):e.call(i,t[0]);case 2:return n?e(t[0],t[1]):e.call(i,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(i,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(i,t[0],t[1],t[2],t[3])}return e.apply(i,t)}},function(e,t,i){var n=i(0).document;e.exports=n&&n.documentElement},function(e,t,i){var n=i(0),r=i(20).set,o=n.MutationObserver||n.WebKitMutationObserver,a=n.process,s=n.Promise,l="process"==i(8)(a);e.exports=function(){var e,t,i,c=function(){var n,r;for(l&&(n=a.domain)&&n.exit();e;){r=e.fn,e=e.next;try{r()}catch(o){throw e?i():t=void 0,o}}t=void 0,n&&n.enter()};if(l)i=function(){a.nextTick(c)};else if(!o||n.navigator&&n.navigator.standalone)if(s&&s.resolve){var u=s.resolve(void 0);i=function(){u.then(c)}}else i=function(){r.call(n,c)};else{var h=!0,d=document.createTextNode("");new o(c).observe(d,{characterData:!0}),i=function(){d.data=h=!h}}return function(n){var r={fn:n,next:void 0};t&&(t.next=r),e||(e=r,i()),t=r}}},function(e,t,i){e.exports=function(e){try{return{e:!1,v:e()}}catch(t){return{e:!0,v:t}}}},function(e,t,i){var n=i(0).navigator;e.exports=n&&n.userAgent||""},function(e,t,i){var n=i(3),r=i(4),o=i(21);e.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var i=o.f(e);return(0,i.resolve)(t),i.promise}},function(e,t,i){var n=i(17);e.exports=function(e,t,i){for(var r in t)n(e,r,t[r],i);return e}},function(e,t,i){var n=i(9).f,r=i(18),o=i(1)("toStringTag");e.exports=function(e,t,i){e&&!r(e=i?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},function(e,t,i){var n=i(0),r=i(9),o=i(7),a=i(1)("species");e.exports=function(e){var t=n[e];o&&t&&!t[a]&&r.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,i){var n=i(1)("iterator"),r=!1;try{var o=[7][n]();o.return=function(){r=!0},Array.from(o,(function(){throw 2}))}catch(a){}e.exports=function(e,t){if(!t&&!r)return!1;var i=!1;try{var o=[7],a=o[n]();a.next=function(){return{done:i=!0}},o[n]=function(){return a},e(o)}catch(s){}return i}},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};t.default=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!e||!t)return Promise.reject("vid, host and token can't be empty");var s=void 0;try{s=(0,o.getUri)(e,t,i,r)}catch(l){return Promise.reject(l.message)}return new a.default({type:"json",method:"GET",url:s}).then((function(e){var t=void 0;if(e&&e.response)switch(n(e.response)){case"string":t=JSON.parse(e.response).Result;break;case"object":t=e.response.Result;break;default:t=e.response}else t=e;return t}))};var r,o=i(49),a=(r=i(51))&&r.__esModule?r:{default:r};e.exports=t.default},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.getUri=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments[3];try{e=JSON.parse((0,n.decode)(e))}catch(s){throw new Error("base64 decode error: "+s.message)}!1===o.jointSsl||r(i,"ssl")||r(i,"Ssl")||(i.Ssl=1);var a=(/^http/.test(t)?t:"//"+t)+"?"+e.GetPlayInfoToken+function(e){var t=[];for(var i in e)r(e,i)&&t.push(i+"="+e[i]);return t.length>0?"&"+t.join("&"):""}(i);return a};var n=i(50),r=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){var t=void 0,i=void 0,n=void 0,r=void 0,o=void 0,a=void 0,s=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1],l=e.length;for(o=0,a="";o<l;){do{t=s[255&e.charCodeAt(o++)]}while(o<l&&-1===t);if(-1===t)break;do{i=s[255&e.charCodeAt(o++)]}while(o<l&&-1===i);if(-1===i)break;a+=String.fromCharCode(t<<2|(48&i)>>4);do{if(61==(n=255&e.charCodeAt(o++)))return a;n=s[n]}while(o<l&&-1===n);if(-1===n)break;a+=String.fromCharCode((15&i)<<4|(60&n)>>2);do{if(61==(r=255&e.charCodeAt(o++)))return a;r=s[r]}while(o<l&&-1===r);if(-1===r)break;a+=String.fromCharCode((3&n)<<6|r)}return a}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=t.url,n=t.method,r=void 0===n?"GET":n,o=t.data,a=void 0===o?{}:o,s=t.headers,l=void 0===s?{}:s;return new Promise((function(e,t){var n=new window.XMLHttpRequest,o=r.toUpperCase(),s=[];if("GET"!==o)throw new Error("xhr "+o+" is not supported");for(var c in a)s.push(c+"="+a[c]);for(var u in n.open(o,""+i,!0),n.responseType="",l)Object.prototype.hasOwnProperty.call(l,u)&&n.setRequestHeader(u,""+l[u]);n.onload=function(){200===n.status||206===n.status?e(n):t(n)},n.onerror=n.ontimeout=function(){return t(n)},n.send()}))},e.exports=t.default}]);const gs=lr(ps);ls.extend(fs);var ys=(e=>(e.VIDEO="video",e.EVIDEO="evideo",e.DRM_EVIDEO="drm_evideo",e))(ys||{});function vs(e){try{return JSON.parse(e)}catch(hs){return as.warn(`[utils/json] decode fail: ${e}`,hs),null}}function ms(e,t="GetPlayInfoToken"){if(!e)return;const i={},n=vs(window.atob(e));if(n&&"string"==typeof n[t]){n[t].split("&").map((e=>{const t=e.split("=");t[0]&&t[1]&&(i[t[0]]=t[1])}))}return i}function _s(e){const t={};return decodeURIComponent(e).split("&").map((e=>{const i=e.split("=");i[0]&&i[1]&&(t[decodeURIComponent(i[0])]=decodeURIComponent(i[1]))})),t}const Es=e=>{var t,i,n;if(!(null==e?void 0:e.playAuthToken))return;const r=ms(null==e?void 0:e.playAuthToken),o=null!=(i=null==(t=null==r?void 0:r.FileType)?void 0:t.toLowerCase())?i:"video",a=null==(n=null==r?void 0:r.Format)?void 0:n.toLowerCase();return a||(Object.values(ys).includes(o)?nr.MP4:rr.M4A)},Ts=function(e){if(!e["X-Expires"]||!e["X-Date"])return!1;const t=parseInt(e["X-Expires"]);if(isNaN(t))return!1;const i=e["X-Date"].replace(/T/g," ").replace(/Z/g,""),n=ls.utc(i,"YYYYMMDD hhmmss");if(!n.isValid())return!1;return n.add(t,"seconds").isBefore(ls())};function Ss(e,t){const i=["240p","360p","480p","540p","720p","1080p","2k","4k","od","oe"],n=e.Definition,r=t.Definition;if(i.includes(n)&&i.includes(r)){const e=i.findIndex((e=>e.toLocaleLowerCase()===n.toLocaleLowerCase()));return i.findIndex((e=>e.toLocaleLowerCase()===r.toLocaleLowerCase()))-e}return t.Bitrate&&e.Bitrate?t.Bitrate-e.Bitrate:-1}function bs(e){const{playAuthToken:t,playDomain:i,reqParams:n={},definitionMap:r,needThumbs:o=!1,needBarrageMask:a=!1,autoDemoteDefinition:s,autoDemoteDefinitionTextKey:l,urlQueryParams:h}=e;if(t){const e=u(c({},n),{NeedThumbs:o?1:0,NeedBarrageMask:a?1:0});return new Promise(((n,o)=>{gs.url(t,i,e).then((e=>{var t;const{Status:i,PlayInfoList:o=[],PosterUrl:a,Vid:d,Duration:f,BarrageMaskUrl:p,ThumbInfoList:g=[],EnableAdaptive:y,AdaptiveBitrateStreamingInfo:v}=e.Data||e;if(i===$a.VALID&&o.length){const i=o.map((e=>{var t;const i=h?Ys(e.MainPlayUrl,h):e.MainPlayUrl,n=h?Ys(e.BackupPlayUrl,h):e.BackupPlayUrl;return c(c({vid:d,url:i,_mainURL:i,_backupURL:n,streamType:e.Format,backupUrl:n,backUrlList:[n],fileType:e.FileType,format:e.Format,bitrate:e.Bitrate,size:e.Size,kid:e.PlayAuthId,playAuthId:e.PlayAuthId,playAuth:e.PlayAuth,secretKey:e.PlayAuth,vwidth:e.Width,vheight:e.Height,vtype:null==(t=e.Format)?void 0:t.toLocaleUpperCase(),codec:e.Codec,urlExpireTimestamp:ol(e.MainUrlExpire,10,Xa),drmType:e.DrmType},e),Fs(e,{definitionMap:r,autoDemoteDefinition:s,autoDemoteDefinitionTextKey:l}))})).sort(Ss);n({playList:i,type:null==(t=i[0])?void 0:t.Format,poster:a,vid:d,duration:f,dashOpts:e.Data?e:{Data:u(c({},e),{VideoID:d})},thumbs:g,barrageMaskUrl:p,enableAdaptive:y,adaptiveBitrateStreamingInfo:v})}else n({playList:[],poster:a,vid:d,duration:f,dashOpts:e.Data?e:{Data:e},thumbs:g,barrageMaskUrl:p,enableAdaptive:y,adaptiveBitrateStreamingInfo:v}),as.error("HAS NO VIDEO INFORMATION CORRECTLY, PLEASE CHECK THE TOKEN.")})).catch((e=>{as.log("err",e),o(e)}))}))}return Promise.resolve(void 0)}function Cs(e,t,i,n){return d(this,null,(function*(){try{return yield e()}catch(r){if(--t&&i(r))return Cs(e,t,i,n);if(n&&"function"==typeof n)return yield n(r);throw r}}))}function ks(e,t,i,n){return i+"/?"+n+"&"+nl({ThirdPartyDrmType:e,Kid:t})}const Is="__veplayer_";function Ps(e,t="",i){if(!e)return;const n=Is+t+"_"+e;localStorage.setItem(n,i+"")}function Ds(e,t=""){if(!e)return;const i=Is+t+"_"+e;return localStorage.getItem(i)}function ws(){var e,t;try{const i=null==(t=null==(e=globalThis.crypto)?void 0:e.randomUUID)?void 0:t.call(e);if("string"==typeof i&&i.length>0)return i}catch(hs){}return`ve_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,14)}`}function As(e){if(!e)return ws();const t=`line_user_${encodeURIComponent(e)}`;try{const e=Ds(t,"ttdrama");if(e)return e;const i=ws();return Ps(t,"ttdrama",i),i}catch(hs){return ws()}}function Rs(){try{return Math.round(window.performance.now())}catch(e){return(new Date).getTime()}}var xs=(e=>(e[e.DEFAULT=0]="DEFAULT",e[e.ERROR=-1]="ERROR",e[e.TIMEOUT=-2]="TIMEOUT",e))(xs||{});function Os(e,t){return new Promise(((i,n)=>{try{e||n(new Error("url is undefined"));let r=Rs();const o=r,a=new window.XMLHttpRequest,s={status:0,statusText:"",connectTime:0,raw:a};a.open("get",e),a.onreadystatechange=()=>{2===a.readyState&&(s.headers=function(e){const t={};if(e instanceof window.XMLHttpRequest)try{e.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){const i=e.split(": "),n=i.shift();t[n]=i.join(": ")}))}catch(i){return t}return t}(a),s.connectTime=Rs()-o,s.status=a.status,s.statusText=a.statusText,r=Rs())},a.onload=()=>{s.response=a.response,i(s)},a.onprogress=e=>{const t=Rs()-r;let i=0;i=parseInt(""+e.loaded/1e3/(t/1e3),10),s.speed=0|i,s.costTime=t},a.onerror=()=>{s.status||(s.status=-1,s.costTime=Rs()-r),n(s)},a.ontimeout=()=>{s.status||(s.status=-2,s.costTime=Rs()-r),i(s)},a.onabort=()=>{i(s)},(null==t?void 0:t.type)&&(a.responseType=t.type),a.timeout=(null==t?void 0:t.timeout)||1e4,a.setRequestHeader("Range",`bytes=${(null==t?void 0:t.range)||"0-1048576"}`),a.send()}catch(hs){n(hs)}}))}function Ls(e){var t,i,n;if(e.url)return(null==(i=null==(t=null==e?void 0:e.plugins)?void 0:t.encrypthlsplugin)?void 0:i.hls)||(null==(n=null==e?void 0:e.plugins)?void 0:n.mp4encryptplayer)?1:+Ur.isMSE(e.media)}function Ns(e){return Number.isFinite(e)?Math.max(0,Math.round(e)):0}class Ms{constructor(){this.timings=[],this.timingMap={},this.now=function(){const e=globalThis.performance;return(null==e?void 0:e.now)&&"function"==typeof e.now?()=>e.now():()=>Date.now()}(),this.startAt=this.now()}markDuration(e,t){const i=Ns(t);this.timings.push({name:e,duration:i}),this.timingMap[e]=i}measure(e,t){const i=this.now();try{return t()}finally{this.markDuration(e,this.now()-i)}}measureAsync(e,t){return d(this,null,(function*(){const i=this.now();try{return yield t()}finally{this.markDuration(e,this.now()-i)}}))}finish(){return{totalDuration:Ns(this.now()-this.startAt),timings:[...this.timings],timingMap:c({},this.timingMap)}}}let Us;const Bs=()=>Us,Fs=function(e,t){var i;const{definitionMap:n,autoDemoteDefinition:r,autoDemoteDefinitionTextKey:o}=t||{},a=e,s=a.Definition||a.Quality||a.definition||a.quality;if(!e||!s)return{definition:"240P"};if(n){let e={definition:s};const t=n[s];return e=t?"string"==typeof t?{definition:t}:c({definition:s},t||{}):{definition:s},r&&r.toLocaleLowerCase()===(null==(i=null==e?void 0:e.definition)?void 0:i.toLocaleLowerCase())&&(e={definition:"auto",definitionTextKey:o,mapDefinition:e.definition}),e}return{definition:s}};const Hs=class{constructor(){this.timeID=null,this.func=null}repeat(e,t){this.timeID=1,this.repeatInterval(e,t)}repeatInterval(e,t){this.timeID&&(null===this.func&&(this.func=e),this.func===e&&(this.timeID&&clearTimeout(this.timeID),this.timeID=null,this.timeID=setTimeout((()=>{e(),this.repeatInterval(e,t)}),t)))}clear(){clearTimeout(this.timeID),this.timeID=null}},js='video/mp4; codecs="avc1.42E01E,mp4a.40.2"',Vs=['video/mp4;codecs="hev1.1.6.L120.90"','video/mp4;codecs="hev1.2.4.L120.90"','video/mp4;codecs="hev1.3.E.L120.90"','video/mp4;codecs="hev1.4.10.L120.90"'],Ks={mp4:["video/mp4","audio/mp4"],hls:["application/vnd.apple.mpegurl","application/x-mpegurl","audio/mpegurl"],webm:["audio/webm","video/webm"],mov:["video/quicktime"]};function Ws(e){var t;let i;if(Array.isArray(e)&&e.length){if(e[0].type){let e="";for(const t of Object.entries(Ks)){const[i,n]=t;if(n.includes(i)){e=i;break}}if(e)return e}i=null==(t=e[0])?void 0:t.src}else i="string"==typeof e?e:"";return function(e){return e&&0<e.toLowerCase().indexOf(".m3u8")}(i)?"hls":function(e){return e&&0<e.toLowerCase().indexOf(".flv")}(i)?"flv":function(e){return e&&0<e.toLowerCase().indexOf(".mp4")}(i)?"mp4":function(e){return e&&0<e.toLowerCase().indexOf(".mpd")}(i)?"dash":"mp4"}function Gs(e){return e&&e.then?e:Promise.resolve(e)}const Ys=(e,t)=>t?e+=(-1===e.indexOf("?")?"?":"&")+nl(t):e,zs=(e,t)=>{if(!t||!e)return;let i;return Object.keys(e).map((n=>{n.toLowerCase()===t.toLowerCase()&&(i=e[n])})),i};function $s(){let e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return"zh-cn"!==e&&"cn"!==e||(e="zh"),e}function Xs(e,t=200,i=""){let n=setTimeout((()=>{i&&as.warn(i),n=null}),t);return e.then?e.then((()=>clearTimeout(n))):(clearTimeout(n),n=null),e}function qs(e,t=1,i=0){return new Promise(((n,r)=>{e().then(n).catch((o=>{setTimeout((()=>{1!==t?qs(e,t-1,i).then(n,r):r(o)}),i)}))}))}function Zs(e='video/mp4; codecs="avc1.42E01E,mp4a.40.2"'){if(!window.MediaSource)return!1;try{return window.MediaSource.isTypeSupported(e)}catch(t){return as.error("mse error",t),!1}}function Qs(e="h264"){return void 0!==window.ManagedMediaSource&&("h264"===e?window.ManagedMediaSource.isTypeSupported(js):"h265"===e?Vs.some((e=>window.ManagedMediaSource.isTypeSupported(e))):window.ManagedMediaSource.isTypeSupported(e))}const Js="undefined"!=typeof window,el=Js&&navigator.userAgent.toLocaleLowerCase(),tl=Js&&/^((?!chrome|android).)*safari/.test(el);function il(e,t){const i={sg:{__LOG_TEA_ID__:323254,__LOG_CHANNEL__:"sg",__LOG_CUSTOM_REGION__:"byteplus",__LOG_CHANNEL_DOMAIN__:"https://mcs-nontt.byteintlapi.com",__UMD_PRE_PATH__:"https://sf-unpkg.bytepluscdn.com/obj/byteplusfe-sg/sdk/@byteplus/veplayer/1.18.0-rc.9/plugin"}},n=t||"sg";return e&&i[e]||i[n]}function nl(e){return Object.entries(e).map((([e,t])=>Array.isArray(t)?t.map((t=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&"):`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&")}function rl(e){var t;return"string"==typeof e?e:null==(t=null==e?void 0:e[0])?void 0:t.src}function ol(e,t=10,i=0){const n=parseInt(e,t);return Number.isNaN(n)?i:n}function al(e){var t,i,n,r,o,a,s;const l=e.getPlugin("drm"),c=e.getPlugin("EncryptHlsPlugin"),u=e.getPlugin("Mp4EncryptPlayer"),h=e.getPlugin("DASHPlugin"),d=(null==(t=null==c?void 0:c.config)?void 0:t.drmKeyToken)||(null==(i=null==u?void 0:u.config)?void 0:i.drmKeyToken)||(null==(n=null==h?void 0:h.config)?void 0:n.drmKeyToken),f=((null==(r=null==c?void 0:c.config)?void 0:r.drmType)||(null==(o=null==u?void 0:u.config)?void 0:o.drmType)||(null==(a=null==h?void 0:h.config)?void 0:a.drmType))===or.PRIVATE_ENCRYPT_UPGRADE,p=null==(s=null==c?void 0:c.config)?void 0:s.keyToken;return l?or.DRM_ENCRYPT:d?or.PRIVATE_ENCRYPT:p?or.STANDARD_ENCRYPT:f?or.PRIVATE_ENCRYPT_UPGRADE:void 0}function sl(e){var t,i,n,r;const o=null==(i=null==(t=null==e?void 0:e.plugins)?void 0:t.encrypthlsplugin)?void 0:i._playOriginalUrl,a=null==(n=null==e?void 0:e.curDefinition)?void 0:n.main_url;return o||a||(null==(r=e.curDefinition)?void 0:r.url)||e.config.url}const ll=/["'&<>]/;function cl(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ul(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?cl(Object(i),!0).forEach((function(t){gl(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):cl(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function hl(e){return(hl="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})(e)}function dl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fl(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,vl(n.key),n)}}function pl(e,t,i){return t&&fl(e.prototype,t),i&&fl(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function gl(e,t,i){return(t=vl(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function yl(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i,n,r={},o=Object.keys(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}function vl(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var ml=function(e){return e&&e.Math==Math&&e},_l=ml("object"==typeof globalThis&&globalThis)||ml("object"==typeof window&&window)||ml("object"==typeof self&&self)||ml("object"==typeof sr&&sr)||function(){return this}()||Function("return this")(),El={},Tl=function(e){try{return!!e()}catch(t){return!0}},Sl=!Tl((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),bl=!Tl((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),Cl=bl,kl=Function.prototype.call,Il=Cl?kl.bind(kl):function(){return kl.apply(kl,arguments)},Pl={},Dl={}.propertyIsEnumerable,wl=Object.getOwnPropertyDescriptor,Al=wl&&!Dl.call({1:2},1);Pl.f=Al?function(e){var t=wl(this,e);return!!t&&t.enumerable}:Dl;var Rl,xl,Ol=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Ll=bl,Nl=Function.prototype,Ml=Nl.call,Ul=Ll&&Nl.bind.bind(Ml,Ml),Bl=Ll?Ul:function(e){return function(){return Ml.apply(e,arguments)}},Fl=Bl,Hl=Fl({}.toString),jl=Fl("".slice),Vl=function(e){return jl(Hl(e),8,-1)},Kl=Tl,Wl=Vl,Gl=Object,Yl=Bl("".split),zl=Kl((function(){return!Gl("z").propertyIsEnumerable(0)}))?function(e){return"String"==Wl(e)?Yl(e,""):Gl(e)}:Gl,$l=function(e){return null==e},Xl=$l,ql=TypeError,Zl=function(e){if(Xl(e))throw ql("Can't call method on "+e);return e},Ql=zl,Jl=Zl,ec=function(e){return Ql(Jl(e))},tc="object"==typeof document&&document.all,ic={all:tc,IS_HTMLDDA:void 0===tc&&void 0!==tc},nc=ic.all,rc=ic.IS_HTMLDDA?function(e){return"function"==typeof e||e===nc}:function(e){return"function"==typeof e},oc=rc,ac=ic.all,sc=ic.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:oc(e)||e===ac}:function(e){return"object"==typeof e?null!==e:oc(e)},lc=_l,cc=rc,uc=function(e,t){return arguments.length<2?(i=lc[e],cc(i)?i:void 0):lc[e]&&lc[e][t];var i},hc=Bl({}.isPrototypeOf),dc=uc("navigator","userAgent")||"",fc=_l,pc=dc,gc=fc.process,yc=fc.Deno,vc=gc&&gc.versions||yc&&yc.version,mc=vc&&vc.v8;mc&&(xl=(Rl=mc.split("."))[0]>0&&Rl[0]<4?1:+(Rl[0]+Rl[1])),!xl&&pc&&(!(Rl=pc.match(/Edge\/(\d+)/))||Rl[1]>=74)&&(Rl=pc.match(/Chrome\/(\d+)/))&&(xl=+Rl[1]);var _c=xl,Ec=_c,Tc=Tl,Sc=!!Object.getOwnPropertySymbols&&!Tc((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ec&&Ec<41})),bc=Sc&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Cc=uc,kc=rc,Ic=hc,Pc=Object,Dc=bc?function(e){return"symbol"==typeof e}:function(e){var t=Cc("Symbol");return kc(t)&&Ic(t.prototype,Pc(e))},wc=String,Ac=function(e){try{return wc(e)}catch(t){return"Object"}},Rc=rc,xc=Ac,Oc=TypeError,Lc=function(e){if(Rc(e))return e;throw Oc(xc(e)+" is not a function")},Nc=Lc,Mc=$l,Uc=function(e,t){var i=e[t];return Mc(i)?void 0:Nc(i)},Bc=Il,Fc=rc,Hc=sc,jc=TypeError,Vc={exports:{}},Kc=_l,Wc=Object.defineProperty,Gc=function(e,t){try{Wc(Kc,e,{value:t,configurable:!0,writable:!0})}catch(i){Kc[e]=t}return t},Yc=Gc,zc="__core-js_shared__",$c=_l[zc]||Yc(zc,{}),Xc=$c;(Vc.exports=function(e,t){return Xc[e]||(Xc[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"});var qc=Vc.exports,Zc=Zl,Qc=Object,Jc=function(e){return Qc(Zc(e))},eu=Jc,tu=Bl({}.hasOwnProperty),iu=Object.hasOwn||function(e,t){return tu(eu(e),t)},nu=Bl,ru=0,ou=Math.random(),au=nu(1..toString),su=function(e){return"Symbol("+(void 0===e?"":e)+")_"+au(++ru+ou,36)},lu=_l,cu=iu,uu=su,hu=Sc,du=bc,fu=qc("wks"),pu=lu.Symbol,gu=pu&&pu.for,yu=du?pu:pu&&pu.withoutSetter||uu,vu=function(e){if(!cu(fu,e)||!hu&&"string"!=typeof fu[e]){var t="Symbol."+e;hu&&cu(pu,e)?fu[e]=pu[e]:fu[e]=du&&gu?gu(t):yu(t)}return fu[e]},mu=Il,_u=sc,Eu=Dc,Tu=Uc,Su=function(e,t){var i,n;if("string"===t&&Fc(i=e.toString)&&!Hc(n=Bc(i,e)))return n;if(Fc(i=e.valueOf)&&!Hc(n=Bc(i,e)))return n;if("string"!==t&&Fc(i=e.toString)&&!Hc(n=Bc(i,e)))return n;throw jc("Can't convert object to primitive value")},bu=TypeError,Cu=vu("toPrimitive"),ku=function(e,t){if(!_u(e)||Eu(e))return e;var i,n=Tu(e,Cu);if(n){if(void 0===t&&(t="default"),i=mu(n,e,t),!_u(i)||Eu(i))return i;throw bu("Can't convert object to primitive value")}return void 0===t&&(t="number"),Su(e,t)},Iu=ku,Pu=Dc,Du=function(e){var t=Iu(e,"string");return Pu(t)?t:t+""},wu=sc,Au=_l.document,Ru=wu(Au)&&wu(Au.createElement),xu=function(e){return Ru?Au.createElement(e):{}},Ou=xu,Lu=!Sl&&!Tl((function(){return 7!=Object.defineProperty(Ou("div"),"a",{get:function(){return 7}}).a})),Nu=Sl,Mu=Il,Uu=Pl,Bu=Ol,Fu=ec,Hu=Du,ju=iu,Vu=Lu,Ku=Object.getOwnPropertyDescriptor;El.f=Nu?Ku:function(e,t){if(e=Fu(e),t=Hu(t),Vu)try{return Ku(e,t)}catch(i){}if(ju(e,t))return Bu(!Mu(Uu.f,e,t),e[t])};var Wu={},Gu=Sl&&Tl((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Yu=sc,zu=String,$u=TypeError,Xu=function(e){if(Yu(e))return e;throw $u(zu(e)+" is not an object")},qu=Sl,Zu=Lu,Qu=Gu,Ju=Xu,eh=Du,th=TypeError,ih=Object.defineProperty,nh=Object.getOwnPropertyDescriptor,rh="enumerable",oh="configurable",ah="writable";Wu.f=qu?Qu?function(e,t,i){if(Ju(e),t=eh(t),Ju(i),"function"==typeof e&&"prototype"===t&&"value"in i&&ah in i&&!i[ah]){var n=nh(e,t);n&&n[ah]&&(e[t]=i.value,i={configurable:oh in i?i[oh]:n[oh],enumerable:rh in i?i[rh]:n[rh],writable:!1})}return ih(e,t,i)}:ih:function(e,t,i){if(Ju(e),t=eh(t),Ju(i),Zu)try{return ih(e,t,i)}catch(n){}if("get"in i||"set"in i)throw th("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var sh=Wu,lh=Ol,ch=Sl?function(e,t,i){return sh.f(e,t,lh(1,i))}:function(e,t,i){return e[t]=i,e},uh={exports:{}},hh=Sl,dh=iu,fh=Function.prototype,ph=hh&&Object.getOwnPropertyDescriptor,gh=dh(fh,"name"),yh={EXISTS:gh,PROPER:gh&&"something"===function(){}.name,CONFIGURABLE:gh&&(!hh||hh&&ph(fh,"name").configurable)},vh=rc,mh=$c,_h=Bl(Function.toString);vh(mh.inspectSource)||(mh.inspectSource=function(e){return _h(e)});var Eh,Th,Sh,bh=mh.inspectSource,Ch=rc,kh=_l.WeakMap,Ih=Ch(kh)&&/native code/.test(String(kh)),Ph=su,Dh=qc("keys"),wh=function(e){return Dh[e]||(Dh[e]=Ph(e))},Ah={},Rh=Ih,xh=_l,Oh=sc,Lh=ch,Nh=iu,Mh=$c,Uh=wh,Bh=Ah,Fh="Object already initialized",Hh=xh.TypeError,jh=xh.WeakMap;if(Rh||Mh.state){var Vh=Mh.state||(Mh.state=new jh);Vh.get=Vh.get,Vh.has=Vh.has,Vh.set=Vh.set,Eh=function(e,t){if(Vh.has(e))throw Hh(Fh);return t.facade=e,Vh.set(e,t),t},Th=function(e){return Vh.get(e)||{}},Sh=function(e){return Vh.has(e)}}else{var Kh=Uh("state");Bh[Kh]=!0,Eh=function(e,t){if(Nh(e,Kh))throw Hh(Fh);return t.facade=e,Lh(e,Kh,t),t},Th=function(e){return Nh(e,Kh)?e[Kh]:{}},Sh=function(e){return Nh(e,Kh)}}var Wh={set:Eh,get:Th,has:Sh,enforce:function(e){return Sh(e)?Th(e):Eh(e,{})},getterFor:function(e){return function(t){var i;if(!Oh(t)||(i=Th(t)).type!==e)throw Hh("Incompatible receiver, "+e+" required");return i}}},Gh=Tl,Yh=rc,zh=iu,$h=Sl,Xh=yh.CONFIGURABLE,qh=bh,Zh=Wh.enforce,Qh=Wh.get,Jh=Object.defineProperty,ed=$h&&!Gh((function(){return 8!==Jh((function(){}),"length",{value:8}).length})),td=String(String).split("String"),id=uh.exports=function(e,t,i){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!zh(e,"name")||Xh&&e.name!==t)&&($h?Jh(e,"name",{value:t,configurable:!0}):e.name=t),ed&&i&&zh(i,"arity")&&e.length!==i.arity&&Jh(e,"length",{value:i.arity});try{i&&zh(i,"constructor")&&i.constructor?$h&&Jh(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(r){}var n=Zh(e);return zh(n,"source")||(n.source=td.join("string"==typeof t?t:"")),e};Function.prototype.toString=id((function(){return Yh(this)&&Qh(this).source||qh(this)}),"toString");var nd=uh.exports,rd=rc,od=Wu,ad=nd,sd=Gc,ld=function(e,t,i,n){n||(n={});var r=n.enumerable,o=void 0!==n.name?n.name:t;if(rd(i)&&ad(i,o,n),n.global)r?e[t]=i:sd(t,i);else{try{n.unsafe?e[t]&&(r=!0):delete e[t]}catch(a){}r?e[t]=i:od.f(e,t,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},cd={},ud=Math.ceil,hd=Math.floor,dd=Math.trunc||function(e){var t=+e;return(t>0?hd:ud)(t)},fd=function(e){var t=+e;return t!=t||0===t?0:dd(t)},pd=fd,gd=Math.max,yd=Math.min,vd=function(e,t){var i=pd(e);return i<0?gd(i+t,0):yd(i,t)},md=fd,_d=Math.min,Ed=function(e){return e>0?_d(md(e),9007199254740991):0},Td=Ed,Sd=function(e){return Td(e.length)},bd=ec,Cd=vd,kd=Sd,Id=function(e){return function(t,i,n){var r,o=bd(t),a=kd(o),s=Cd(n,a);if(e&&i!=i){for(;a>s;)if((r=o[s++])!=r)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===i)return e||s||0;return!e&&-1}},Pd={includes:Id(!0),indexOf:Id(!1)},Dd=iu,wd=ec,Ad=Pd.indexOf,Rd=Ah,xd=Bl([].push),Od=function(e,t){var i,n=wd(e),r=0,o=[];for(i in n)!Dd(Rd,i)&&Dd(n,i)&&xd(o,i);for(;t.length>r;)Dd(n,i=t[r++])&&(~Ad(o,i)||xd(o,i));return o},Ld=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Nd=Od,Md=Ld.concat("length","prototype");cd.f=Object.getOwnPropertyNames||function(e){return Nd(e,Md)};var Ud={};Ud.f=Object.getOwnPropertySymbols;var Bd=uc,Fd=cd,Hd=Ud,jd=Xu,Vd=Bl([].concat),Kd=Bd("Reflect","ownKeys")||function(e){var t=Fd.f(jd(e)),i=Hd.f;return i?Vd(t,i(e)):t},Wd=iu,Gd=Kd,Yd=El,zd=Wu,$d=function(e,t,i){for(var n=Gd(t),r=zd.f,o=Yd.f,a=0;a<n.length;a++){var s=n[a];Wd(e,s)||i&&Wd(i,s)||r(e,s,o(t,s))}},Xd=Tl,qd=rc,Zd=/#|\.prototype\./,Qd=function(e,t){var i=ef[Jd(e)];return i==nf||i!=tf&&(qd(t)?Xd(t):!!t)},Jd=Qd.normalize=function(e){return String(e).replace(Zd,".").toLowerCase()},ef=Qd.data={},tf=Qd.NATIVE="N",nf=Qd.POLYFILL="P",rf=Qd,of=_l,af=El.f,sf=ch,lf=ld,cf=Gc,uf=$d,hf=rf,df=function(e,t){var i,n,r,o,a,s=e.target,l=e.global,c=e.stat;if(i=l?of:c?of[s]||cf(s,{}):(of[s]||{}).prototype)for(n in t){if(o=t[n],r=e.dontCallGetSet?(a=af(i,n))&&a.value:i[n],!hf(l?n:s+(c?".":"#")+n,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;uf(o,r)}(e.sham||r&&r.sham)&&sf(o,"sham",!0),lf(i,n,o,e)}},ff=Vl,pf=Array.isArray||function(e){return"Array"==ff(e)},gf=TypeError,yf=function(e){if(e>9007199254740991)throw gf("Maximum allowed index exceeded");return e},vf=Du,mf=Wu,_f=Ol,Ef=function(e,t,i){var n=vf(t);n in e?mf.f(e,n,_f(0,i)):e[n]=i},Tf={};Tf[vu("toStringTag")]="z";var Sf="[object z]"===String(Tf),bf=Sf,Cf=rc,kf=Vl,If=vu("toStringTag"),Pf=Object,Df="Arguments"==kf(function(){return arguments}()),wf=bf?kf:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(i){}}(t=Pf(e),If))?i:Df?kf(t):"Object"==(n=kf(t))&&Cf(t.callee)?"Arguments":n},Af=Bl,Rf=Tl,xf=rc,Of=wf,Lf=bh,Nf=function(){},Mf=[],Uf=uc("Reflect","construct"),Bf=/^\s*(?:class|function)\b/,Ff=Af(Bf.exec),Hf=!Bf.exec(Nf),jf=function(e){if(!xf(e))return!1;try{return Uf(Nf,Mf,e),!0}catch(t){return!1}},Vf=function(e){if(!xf(e))return!1;switch(Of(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Hf||!!Ff(Bf,Lf(e))}catch(t){return!0}};Vf.sham=!0;var Kf=!Uf||Rf((function(){var e;return jf(jf.call)||!jf(Object)||!jf((function(){e=!0}))||e}))?Vf:jf,Wf=pf,Gf=Kf,Yf=sc,zf=vu("species"),$f=Array,Xf=function(e){var t;return Wf(e)&&(t=e.constructor,(Gf(t)&&(t===$f||Wf(t.prototype))||Yf(t)&&null===(t=t[zf]))&&(t=void 0)),void 0===t?$f:t},qf=function(e,t){return new(Xf(e))(0===t?0:t)},Zf=Tl,Qf=_c,Jf=vu("species"),ep=function(e){return Qf>=51||!Zf((function(){var t=[];return(t.constructor={})[Jf]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},tp=df,ip=Tl,np=pf,rp=sc,op=Jc,ap=Sd,sp=yf,lp=Ef,cp=qf,up=ep,hp=_c,dp=vu("isConcatSpreadable"),fp=hp>=51||!ip((function(){var e=[];return e[dp]=!1,e.concat()[0]!==e})),pp=up("concat"),gp=function(e){if(!rp(e))return!1;var t=e[dp];return void 0!==t?!!t:np(e)};tp({target:"Array",proto:!0,arity:1,forced:!fp||!pp},{concat:function(e){var t,i,n,r,o,a=op(this),s=cp(a,0),l=0;for(t=-1,n=arguments.length;t<n;t++)if(gp(o=-1===t?a:arguments[t]))for(r=ap(o),sp(l+r),i=0;i<r;i++,l++)i in o&&lp(s,l,o[i]);else sp(l+1),lp(s,l++,o);return s.length=l,s}});var yp=Vl,vp=Bl,mp=function(e){if("Function"===yp(e))return vp(e)},_p=Lc,Ep=bl,Tp=mp(mp.bind),Sp=function(e,t){return _p(e),void 0===t?e:Ep?Tp(e,t):function(){return e.apply(t,arguments)}},bp=Sp,Cp=zl,kp=Jc,Ip=Sd,Pp=qf,Dp=Bl([].push),wp=function(e){var t=1==e,i=2==e,n=3==e,r=4==e,o=6==e,a=7==e,s=5==e||o;return function(l,c,u,h){for(var d,f,p=kp(l),g=Cp(p),y=bp(c,u),v=Ip(g),m=0,_=h||Pp,E=t?_(l,v):i||a?_(l,0):void 0;v>m;m++)if((s||m in g)&&(f=y(d=g[m],m,p),e))if(t)E[m]=f;else if(f)switch(e){case 3:return!0;case 5:return d;case 6:return m;case 2:Dp(E,d)}else switch(e){case 4:return!1;case 7:Dp(E,d)}return o?-1:n||r?r:E}},Ap={forEach:wp(0),map:wp(1),filter:wp(2),some:wp(3),every:wp(4),find:wp(5),findIndex:wp(6),filterReject:wp(7)},Rp=Ap.map;df({target:"Array",proto:!0,forced:!ep("map")},{map:function(e){return Rp(this,e,arguments.length>1?arguments[1]:void 0)}});var xp=Od,Op=Ld,Lp=Object.keys||function(e){return xp(e,Op)},Np=Jc,Mp=Lp;df({target:"Object",stat:!0,forced:Tl((function(){Mp(1)}))},{keys:function(e){return Mp(Np(e))}});var Up=wf,Bp=String,Fp=function(e){if("Symbol"===Up(e))throw TypeError("Cannot convert a Symbol value to a string");return Bp(e)},Hp=Bl,jp=fd,Vp=Fp,Kp=Zl,Wp=Hp("".charAt),Gp=Hp("".charCodeAt),Yp=Hp("".slice),zp=function(e){return function(t,i){var n,r,o=Vp(Kp(t)),a=jp(i),s=o.length;return a<0||a>=s?e?"":void 0:(n=Gp(o,a))<55296||n>56319||a+1===s||(r=Gp(o,a+1))<56320||r>57343?e?Wp(o,a):n:e?Yp(o,a,a+2):r-56320+(n-55296<<10)+65536}},$p={codeAt:zp(!1),charAt:zp(!0)},Xp=$p.charAt,qp=Zl,Zp=fd,Qp=Fp;df({target:"String",proto:!0,forced:!0},{at:function(e){var t=Qp(qp(this)),i=t.length,n=Zp(e),r=n>=0?n:i+n;return r<0||r>=i?void 0:Xp(t,r)}});var Jp=wf,eg=Sf?{}.toString:function(){return"[object "+Jp(this)+"]"};Sf||ld(Object.prototype,"toString",eg,{unsafe:!0});var tg=Xu,ig=function(){var e=tg(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},ng=Il,rg=iu,og=hc,ag=ig,sg=RegExp.prototype,lg=function(e){var t=e.flags;return void 0!==t||"flags"in sg||rg(e,"flags")||!og(sg,e)?t:ng(ag,e)},cg=yh.PROPER,ug=ld,hg=Xu,dg=Fp,fg=Tl,pg=lg,gg="toString",yg=RegExp.prototype[gg],vg=fg((function(){return"/a/b"!=yg.call({source:"a",flags:"b"})})),mg=cg&&yg.name!=gg;(vg||mg)&&ug(RegExp.prototype,gg,(function(){var e=hg(this);return"/"+dg(e.source)+"/"+dg(pg(e))}),{unsafe:!0});var _g=xu("span").classList,Eg=_g&&_g.constructor&&_g.constructor.prototype,Tg=Eg===Object.prototype?void 0:Eg,Sg=Tl,bg=function(e,t){var i=[][e];return!!i&&Sg((function(){i.call(null,t||function(){return 1},1)}))},Cg=Ap.forEach,kg=_l,Ig={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Pg=Tg,Dg=bg("forEach")?[].forEach:function(e){return Cg(this,e,arguments.length>1?arguments[1]:void 0)},wg=ch,Ag=function(e){if(e&&e.forEach!==Dg)try{wg(e,"forEach",Dg)}catch(t){e.forEach=Dg}};for(var Rg in Ig)Ig[Rg]&&Ag(kg[Rg]&&kg[Rg].prototype);Ag(Pg);var xg=rc,Og=String,Lg=TypeError,Ng=Bl,Mg=Xu,Ug=function(e){if("object"==typeof e||xg(e))return e;throw Lg("Can't set "+Og(e)+" as a prototype")},Bg=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=Ng(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(n){}return function(i,n){return Mg(i),Ug(n),t?e(i,n):i.__proto__=n,i}}():void 0),Fg=rc,Hg=sc,jg=Bg,Vg=function(e,t,i){var n,r;return jg&&Fg(n=t.constructor)&&n!==i&&Hg(r=n.prototype)&&r!==i.prototype&&jg(e,r),e},Kg=Bl(1..valueOf),Wg="\t\n\v\f\r                 \u2028\u2029\ufeff",Gg=Zl,Yg=Fp,zg=Wg,$g=Bl("".replace),Xg="["+zg+"]",qg=RegExp("^"+Xg+Xg+"*"),Zg=RegExp(Xg+Xg+"*$"),Qg=function(e){return function(t){var i=Yg(Gg(t));return 1&e&&(i=$g(i,qg,"")),2&e&&(i=$g(i,Zg,"")),i}},Jg={start:Qg(1),end:Qg(2),trim:Qg(3)},ey=Sl,ty=_l,iy=Bl,ny=rf,ry=ld,oy=iu,ay=Vg,sy=hc,ly=Dc,cy=ku,uy=Tl,hy=cd.f,dy=El.f,fy=Wu.f,py=Kg,gy=Jg.trim,yy="Number",vy=ty[yy],my=vy.prototype,_y=ty.TypeError,Ey=iy("".slice),Ty=iy("".charCodeAt),Sy=function(e){var t,i,n,r,o,a,s,l,c=cy(e,"number");if(ly(c))throw _y("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=gy(c),43===(t=Ty(c,0))||45===t){if(88===(i=Ty(c,2))||120===i)return NaN}else if(48===t){switch(Ty(c,1)){case 66:case 98:n=2,r=49;break;case 79:case 111:n=8,r=55;break;default:return+c}for(a=(o=Ey(c,2)).length,s=0;s<a;s++)if((l=Ty(o,s))<48||l>r)return NaN;return parseInt(o,n)}return+c};if(ny(yy,!vy(" 0o1")||!vy("0b1")||vy("+0x1"))){for(var by,Cy=function(e){var t=arguments.length<1?0:vy(function(e){var t=cy(e,"number");return"bigint"==typeof t?t:Sy(t)}(e)),i=this;return sy(my,i)&&uy((function(){py(i)}))?ay(Object(t),i,Cy):t},ky=ey?hy(vy):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),Iy=0;ky.length>Iy;Iy++)oy(vy,by=ky[Iy])&&!oy(Cy,by)&&fy(Cy,by,dy(vy,by));Cy.prototype=my,my.constructor=Cy,ry(ty,yy,Cy,{constructor:!0})}var Py=Sl,Dy=yh.EXISTS,wy=Bl,Ay=Wu.f,Ry=Function.prototype,xy=wy(Ry.toString),Oy=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Ly=wy(Oy.exec);Py&&!Dy&&Ay(Ry,"name",{configurable:!0,get:function(){try{return Ly(Oy,xy(this))[1]}catch(e){return""}}});var Ny=df,My=zl,Uy=ec,By=bg,Fy=Bl([].join),Hy=My!=Object,jy=By("join",",");Ny({target:"Array",proto:!0,forced:Hy||!jy},{join:function(e){return Fy(Uy(this),void 0===e?",":e)}});var Vy,Ky,Wy,Gy,Yy="process"==Vl(_l.process),zy=Wu.f,$y=iu,Xy=vu("toStringTag"),qy=function(e,t,i){e&&!i&&(e=e.prototype),e&&!$y(e,Xy)&&zy(e,Xy,{configurable:!0,value:t})},Zy=uc,Qy=Wu,Jy=Sl,ev=vu("species"),tv=function(e){var t=Zy(e),i=Qy.f;Jy&&t&&!t[ev]&&i(t,ev,{configurable:!0,get:function(){return this}})},iv=hc,nv=TypeError,rv=Kf,ov=Ac,av=TypeError,sv=Xu,lv=function(e){if(rv(e))return e;throw av(ov(e)+" is not a constructor")},cv=$l,uv=vu("species"),hv=function(e,t){var i,n=sv(e).constructor;return void 0===n||cv(i=sv(n)[uv])?t:lv(i)},dv=bl,fv=Function.prototype,pv=fv.apply,gv=fv.call,yv="object"==typeof Reflect&&Reflect.apply||(dv?gv.bind(pv):function(){return gv.apply(pv,arguments)}),vv=uc("document","documentElement"),mv=Bl([].slice),_v=TypeError,Ev=/(?:ipad|iphone|ipod).*applewebkit/i.test(dc),Tv=_l,Sv=yv,bv=Sp,Cv=rc,kv=iu,Iv=Tl,Pv=vv,Dv=mv,wv=xu,Av=function(e,t){if(e<t)throw _v("Not enough arguments");return e},Rv=Ev,xv=Yy,Ov=Tv.setImmediate,Lv=Tv.clearImmediate,Nv=Tv.process,Mv=Tv.Dispatch,Uv=Tv.Function,Bv=Tv.MessageChannel,Fv=Tv.String,Hv=0,jv={},Vv="onreadystatechange";try{Vy=Tv.location}catch(QB){}var Kv=function(e){if(kv(jv,e)){var t=jv[e];delete jv[e],t()}},Wv=function(e){return function(){Kv(e)}},Gv=function(e){Kv(e.data)},Yv=function(e){Tv.postMessage(Fv(e),Vy.protocol+"//"+Vy.host)};Ov&&Lv||(Ov=function(e){Av(arguments.length,1);var t=Cv(e)?e:Uv(e),i=Dv(arguments,1);return jv[++Hv]=function(){Sv(t,void 0,i)},Ky(Hv),Hv},Lv=function(e){delete jv[e]},xv?Ky=function(e){Nv.nextTick(Wv(e))}:Mv&&Mv.now?Ky=function(e){Mv.now(Wv(e))}:Bv&&!Rv?(Gy=(Wy=new Bv).port2,Wy.port1.onmessage=Gv,Ky=bv(Gy.postMessage,Gy)):Tv.addEventListener&&Cv(Tv.postMessage)&&!Tv.importScripts&&Vy&&"file:"!==Vy.protocol&&!Iv(Yv)?(Ky=Yv,Tv.addEventListener("message",Gv,!1)):Ky=Vv in wv("script")?function(e){Pv.appendChild(wv("script"))[Vv]=function(){Pv.removeChild(this),Kv(e)}}:function(e){setTimeout(Wv(e),0)});var zv,$v,Xv,qv,Zv,Qv,Jv,em,tm={set:Ov,clear:Lv},im=_l,nm=/ipad|iphone|ipod/i.test(dc)&&void 0!==im.Pebble,rm=/web0s(?!.*chrome)/i.test(dc),om=_l,am=Sp,sm=El.f,lm=tm.set,cm=Ev,um=nm,hm=rm,dm=Yy,fm=om.MutationObserver||om.WebKitMutationObserver,pm=om.document,gm=om.process,ym=om.Promise,vm=sm(om,"queueMicrotask"),mm=vm&&vm.value;mm||(zv=function(){var e,t;for(dm&&(e=gm.domain)&&e.exit();$v;){t=$v.fn,$v=$v.next;try{t()}catch(QB){throw $v?qv():Xv=void 0,QB}}Xv=void 0,e&&e.enter()},cm||dm||hm||!fm||!pm?!um&&ym&&ym.resolve?((Jv=ym.resolve(void 0)).constructor=ym,em=am(Jv.then,Jv),qv=function(){em(zv)}):dm?qv=function(){gm.nextTick(zv)}:(lm=am(lm,om),qv=function(){lm(zv)}):(Zv=!0,Qv=pm.createTextNode(""),new fm(zv).observe(Qv,{characterData:!0}),qv=function(){Qv.data=Zv=!Zv}));var _m=mm||function(e){var t={fn:e,next:void 0};Xv&&(Xv.next=t),$v||($v=t,qv()),Xv=t},Em=_l,Tm=function(e){try{return{error:!1,value:e()}}catch(QB){return{error:!0,value:QB}}},Sm=function(){this.head=null,this.tail=null};Sm.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var bm=Sm,Cm=_l.Promise,km="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Im=!km&&!Yy&&"object"==typeof window&&"object"==typeof document,Pm=_l,Dm=Cm,wm=rc,Am=rf,Rm=bh,xm=vu,Om=Im,Lm=km,Nm=_c;Dm&&Dm.prototype;var Mm=xm("species"),Um=!1,Bm=wm(Pm.PromiseRejectionEvent),Fm={CONSTRUCTOR:Am("Promise",(function(){var e=Rm(Dm),t=e!==String(Dm);if(!t&&66===Nm)return!0;if(!Nm||Nm<51||!/native code/.test(e)){var i=new Dm((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((i.constructor={})[Mm]=n,!(Um=i.then((function(){}))instanceof n))return!0}return!t&&(Om||Lm)&&!Bm})),REJECTION_EVENT:Bm,SUBCLASSING:Um},Hm={},jm=Lc,Vm=TypeError,Km=function(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw Vm("Bad Promise constructor");t=e,i=n})),this.resolve=jm(t),this.reject=jm(i)};Hm.f=function(e){return new Km(e)};var Wm,Gm,Ym,zm=df,$m=Yy,Xm=_l,qm=Il,Zm=ld,Qm=Bg,Jm=qy,e_=tv,t_=Lc,i_=rc,n_=sc,r_=function(e,t){if(iv(t,e))return e;throw nv("Incorrect invocation")},o_=hv,a_=tm.set,s_=_m,l_=function(e,t){var i=Em.console;i&&i.error&&(1==arguments.length?i.error(e):i.error(e,t))},c_=Tm,u_=bm,h_=Wh,d_=Cm,f_=Hm,p_="Promise",g_=Fm.CONSTRUCTOR,y_=Fm.REJECTION_EVENT,v_=Fm.SUBCLASSING,m_=h_.getterFor(p_),__=h_.set,E_=d_&&d_.prototype,T_=d_,S_=E_,b_=Xm.TypeError,C_=Xm.document,k_=Xm.process,I_=f_.f,P_=I_,D_=!!(C_&&C_.createEvent&&Xm.dispatchEvent),w_="unhandledrejection",A_=function(e){var t;return!(!n_(e)||!i_(t=e.then))&&t},R_=function(e,t){var i,n,r,o=t.value,a=1==t.state,s=a?e.ok:e.fail,l=e.resolve,c=e.reject,u=e.domain;try{s?(a||(2===t.rejection&&M_(t),t.rejection=1),!0===s?i=o:(u&&u.enter(),i=s(o),u&&(u.exit(),r=!0)),i===e.promise?c(b_("Promise-chain cycle")):(n=A_(i))?qm(n,i,l,c):l(i)):c(o)}catch(QB){u&&!r&&u.exit(),c(QB)}},x_=function(e,t){e.notified||(e.notified=!0,s_((function(){for(var i,n=e.reactions;i=n.get();)R_(i,e);e.notified=!1,t&&!e.rejection&&L_(e)})))},O_=function(e,t,i){var n,r;D_?((n=C_.createEvent("Event")).promise=t,n.reason=i,n.initEvent(e,!1,!0),Xm.dispatchEvent(n)):n={promise:t,reason:i},!y_&&(r=Xm["on"+e])?r(n):e===w_&&l_("Unhandled promise rejection",i)},L_=function(e){qm(a_,Xm,(function(){var t,i=e.facade,n=e.value;if(N_(e)&&(t=c_((function(){$m?k_.emit("unhandledRejection",n,i):O_(w_,i,n)})),e.rejection=$m||N_(e)?2:1,t.error))throw t.value}))},N_=function(e){return 1!==e.rejection&&!e.parent},M_=function(e){qm(a_,Xm,(function(){var t=e.facade;$m?k_.emit("rejectionHandled",t):O_("rejectionhandled",t,e.value)}))},U_=function(e,t,i){return function(n){e(t,n,i)}},B_=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=2,x_(e,!0))},F_=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw b_("Promise can't be resolved itself");var n=A_(t);n?s_((function(){var i={done:!1};try{qm(n,t,U_(F_,i,e),U_(B_,i,e))}catch(QB){B_(i,QB,e)}})):(e.value=t,e.state=1,x_(e,!1))}catch(QB){B_({done:!1},QB,e)}}};if(g_&&(S_=(T_=function(e){r_(this,S_),t_(e),qm(Wm,this);var t=m_(this);try{e(U_(F_,t),U_(B_,t))}catch(QB){B_(t,QB)}}).prototype,(Wm=function(e){__(this,{type:p_,done:!1,notified:!1,parent:!1,reactions:new u_,rejection:!1,state:0,value:void 0})}).prototype=Zm(S_,"then",(function(e,t){var i=m_(this),n=I_(o_(this,T_));return i.parent=!0,n.ok=!i_(e)||e,n.fail=i_(t)&&t,n.domain=$m?k_.domain:void 0,0==i.state?i.reactions.add(n):s_((function(){R_(n,i)})),n.promise})),Gm=function(){var e=new Wm,t=m_(e);this.promise=e,this.resolve=U_(F_,t),this.reject=U_(B_,t)},f_.f=I_=function(e){return e===T_||undefined===e?new Gm(e):P_(e)},i_(d_)&&E_!==Object.prototype)){Ym=E_.then,v_||Zm(E_,"then",(function(e,t){var i=this;return new T_((function(e,t){qm(Ym,i,e,t)})).then(e,t)}),{unsafe:!0});try{delete E_.constructor}catch(QB){}Qm&&Qm(E_,S_)}zm({global:!0,constructor:!0,wrap:!0,forced:g_},{Promise:T_}),Jm(T_,p_,!1),e_(p_);var H_={},j_=H_,V_=vu("iterator"),K_=Array.prototype,W_=wf,G_=Uc,Y_=$l,z_=H_,$_=vu("iterator"),X_=function(e){if(!Y_(e))return G_(e,$_)||G_(e,"@@iterator")||z_[W_(e)]},q_=Il,Z_=Lc,Q_=Xu,J_=Ac,eE=X_,tE=TypeError,iE=Il,nE=Xu,rE=Uc,oE=Sp,aE=Il,sE=Xu,lE=Ac,cE=function(e){return void 0!==e&&(j_.Array===e||K_[V_]===e)},uE=Sd,hE=hc,dE=function(e,t){var i=arguments.length<2?eE(e):t;if(Z_(i))return Q_(q_(i,e));throw tE(J_(e)+" is not iterable")},fE=X_,pE=function(e,t,i){var n,r;nE(e);try{if(!(n=rE(e,"return"))){if("throw"===t)throw i;return i}n=iE(n,e)}catch(QB){r=!0,n=QB}if("throw"===t)throw i;if(r)throw n;return nE(n),i},gE=TypeError,yE=function(e,t){this.stopped=e,this.result=t},vE=yE.prototype,mE=function(e,t,i){var n,r,o,a,s,l,c,u=i&&i.that,h=!(!i||!i.AS_ENTRIES),d=!(!i||!i.IS_RECORD),f=!(!i||!i.IS_ITERATOR),p=!(!i||!i.INTERRUPTED),g=oE(t,u),y=function(e){return n&&pE(n,"normal",e),new yE(!0,e)},v=function(e){return h?(sE(e),p?g(e[0],e[1],y):g(e[0],e[1])):p?g(e,y):g(e)};if(d)n=e.iterator;else if(f)n=e;else{if(!(r=fE(e)))throw gE(lE(e)+" is not iterable");if(cE(r)){for(o=0,a=uE(e);a>o;o++)if((s=v(e[o]))&&hE(vE,s))return s;return new yE(!1)}n=dE(e,r)}for(l=d?e.next:n.next;!(c=aE(l,n)).done;){try{s=v(c.value)}catch(QB){pE(n,"throw",QB)}if("object"==typeof s&&s&&hE(vE,s))return s}return new yE(!1)},_E=vu("iterator"),EE=!1;try{var TE=0,SE={next:function(){return{done:!!TE++}},return:function(){EE=!0}};SE[_E]=function(){return this},Array.from(SE,(function(){throw 2}))}catch(QB){}var bE=Cm,CE=Fm.CONSTRUCTOR||!function(e,t){if(!t&&!EE)return!1;var i=!1;try{var n={};n[_E]=function(){return{next:function(){return{done:i=!0}}}},e(n)}catch(QB){}return i}((function(e){bE.all(e).then(void 0,(function(){}))})),kE=Il,IE=Lc,PE=Hm,DE=Tm,wE=mE;df({target:"Promise",stat:!0,forced:CE},{all:function(e){var t=this,i=PE.f(t),n=i.resolve,r=i.reject,o=DE((function(){var i=IE(t.resolve),o=[],a=0,s=1;wE(e,(function(e){var l=a++,c=!1;s++,kE(i,t,e).then((function(e){c||(c=!0,o[l]=e,--s||n(o))}),r)})),--s||n(o)}));return o.error&&r(o.value),i.promise}});var AE=df,RE=Fm.CONSTRUCTOR,xE=Cm,OE=uc,LE=rc,NE=ld,ME=xE&&xE.prototype;if(AE({target:"Promise",proto:!0,forced:RE,real:!0},{catch:function(e){return this.then(void 0,e)}}),LE(xE)){var UE=OE("Promise").prototype.catch;ME.catch!==UE&&NE(ME,"catch",UE,{unsafe:!0})}var BE=Il,FE=Lc,HE=Hm,jE=Tm,VE=mE;df({target:"Promise",stat:!0,forced:CE},{race:function(e){var t=this,i=HE.f(t),n=i.reject,r=jE((function(){var r=FE(t.resolve);VE(e,(function(e){BE(r,t,e).then(i.resolve,n)}))}));return r.error&&n(r.value),i.promise}});var KE=Il,WE=Hm;df({target:"Promise",stat:!0,forced:Fm.CONSTRUCTOR},{reject:function(e){var t=WE.f(this);return KE(t.reject,void 0,e),t.promise}});var GE=Xu,YE=sc,zE=Hm,$E=function(e,t){if(GE(e),YE(t)&&t.constructor===e)return t;var i=zE.f(e);return(0,i.resolve)(t),i.promise},XE=df,qE=Fm.CONSTRUCTOR,ZE=$E;uc("Promise"),XE({target:"Promise",stat:!0,forced:qE},{resolve:function(e){return ZE(this,e)}});var QE=df,JE=Cm,eT=Tl,tT=uc,iT=rc,nT=hv,rT=$E,oT=ld,aT=JE&&JE.prototype;if(QE({target:"Promise",proto:!0,real:!0,forced:!!JE&&eT((function(){aT.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=nT(this,tT("Promise")),i=iT(e);return this.then(i?function(i){return rT(t,e()).then((function(){return i}))}:e,i?function(i){return rT(t,e()).then((function(){throw i}))}:e)}}),iT(JE)){var sT=tT("Promise").prototype.finally;aT.finally!==sT&&oT(aT,"finally",sT,{unsafe:!0})}var lT=Sl,cT=pf,uT=TypeError,hT=Object.getOwnPropertyDescriptor,dT=lT&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(QB){return QB instanceof TypeError}}(),fT=Ac,pT=TypeError,gT=df,yT=Jc,vT=vd,mT=fd,_T=Sd,ET=dT?function(e,t){if(cT(e)&&!hT(e,"length").writable)throw uT("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},TT=yf,ST=qf,bT=Ef,CT=function(e,t){if(!delete e[t])throw pT("Cannot delete property "+fT(t)+" of "+fT(e))},kT=ep("splice"),IT=Math.max,PT=Math.min;gT({target:"Array",proto:!0,forced:!kT},{splice:function(e,t){var i,n,r,o,a,s,l=yT(this),c=_T(l),u=vT(e,c),h=arguments.length;for(0===h?i=n=0:1===h?(i=0,n=c-u):(i=h-2,n=PT(IT(mT(t),0),c-u)),TT(c+i-n),r=ST(l,n),o=0;o<n;o++)(a=u+o)in l&&bT(r,o,l[a]);if(r.length=n,i<n){for(o=u;o<c-n;o++)s=o+i,(a=o+n)in l?l[s]=l[a]:CT(l,s);for(o=c;o>c-n+i;o--)CT(l,o-1)}else if(i>n)for(o=c-n;o>u;o--)s=o+i-1,(a=o+n-1)in l?l[s]=l[a]:CT(l,s);for(o=0;o<i;o++)l[o+u]=arguments[o+2];return ET(l,c-n+i),r}});var DT=fd,wT=Fp,AT=Zl,RT=RangeError,xT=df,OT=Bl,LT=fd,NT=Kg,MT=function(e){var t=wT(AT(this)),i="",n=DT(e);if(n<0||n==1/0)throw RT("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(i+=t);return i},UT=Tl,BT=RangeError,FT=String,HT=Math.floor,jT=OT(MT),VT=OT("".slice),KT=OT(1..toFixed),WT=function(e,t,i){return 0===t?i:t%2==1?WT(e,t-1,i*e):WT(e*e,t/2,i)},GT=function(e,t,i){for(var n=-1,r=i;++n<6;)r+=t*e[n],e[n]=r%1e7,r=HT(r/1e7)},YT=function(e,t){for(var i=6,n=0;--i>=0;)n+=e[i],e[i]=HT(n/t),n=n%t*1e7},zT=function(e){for(var t=6,i="";--t>=0;)if(""!==i||0===t||0!==e[t]){var n=FT(e[t]);i=""===i?n:i+jT("0",7-n.length)+n}return i};xT({target:"Number",proto:!0,forced:UT((function(){return"0.000"!==KT(8e-5,3)||"1"!==KT(.9,0)||"1.25"!==KT(1.255,2)||"1000000000000000128"!==KT(0xde0b6b3a7640080,0)}))||!UT((function(){KT({})}))},{toFixed:function(e){var t,i,n,r,o=NT(this),a=LT(e),s=[0,0,0,0,0,0],l="",c="0";if(a<0||a>20)throw BT("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return FT(o);if(o<0&&(l="-",o=-o),o>1e-21)if(i=(t=function(e){for(var t=0,i=e;i>=4096;)t+=12,i/=4096;for(;i>=2;)t+=1,i/=2;return t}(o*WT(2,69,1))-69)<0?o*WT(2,-t,1):o/WT(2,t,1),i*=4503599627370496,(t=52-t)>0){for(GT(s,0,i),n=a;n>=7;)GT(s,1e7,0),n-=7;for(GT(s,WT(10,n,1),0),n=t-1;n>=23;)YT(s,1<<23),n-=23;YT(s,1<<n),GT(s,1,1),YT(s,2),c=zT(s)}else GT(s,0,i),GT(s,1<<-t,0),c=zT(s)+jT("0",a);return c=a>0?l+((r=c.length)<=a?"0."+jT("0",a-r)+c:VT(c,0,r-a)+"."+VT(c,r-a)):l+c}}),df({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var $T=Tl,XT=_l.RegExp,qT=$T((function(){var e=XT("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),ZT=qT||$T((function(){return!XT("a","y").sticky})),QT={BROKEN_CARET:qT||$T((function(){var e=XT("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:ZT,UNSUPPORTED_Y:qT},JT={},eS=Sl,tS=Gu,iS=Wu,nS=Xu,rS=ec,oS=Lp;JT.f=eS&&!tS?Object.defineProperties:function(e,t){nS(e);for(var i,n=rS(t),r=oS(t),o=r.length,a=0;o>a;)iS.f(e,i=r[a++],n[i]);return e};var aS,sS=Xu,lS=JT,cS=Ld,uS=Ah,hS=vv,dS=xu,fS="prototype",pS="script",gS=wh("IE_PROTO"),yS=function(){},vS=function(e){return"<"+pS+">"+e+"</"+pS+">"},mS=function(e){e.write(vS("")),e.close();var t=e.parentWindow.Object;return e=null,t},_S=function(){try{aS=new ActiveXObject("htmlfile")}catch(QB){}var e,t,i;_S="undefined"!=typeof document?document.domain&&aS?mS(aS):(t=dS("iframe"),i="java"+pS+":",t.style.display="none",hS.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(vS("document.F=Object")),e.close(),e.F):mS(aS);for(var n=cS.length;n--;)delete _S[fS][cS[n]];return _S()};uS[gS]=!0;var ES,TS,SS=Object.create||function(e,t){var i;return null!==e?(yS[fS]=sS(e),i=new yS,yS[fS]=null,i[gS]=e):i=_S(),void 0===t?i:lS.f(i,t)},bS=Tl,CS=_l.RegExp,kS=bS((function(){var e=CS(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),IS=Tl,PS=_l.RegExp,DS=IS((function(){var e=PS("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),wS=Il,AS=Bl,RS=Fp,xS=ig,OS=QT,LS=SS,NS=Wh.get,MS=kS,US=DS,BS=qc("native-string-replace",String.prototype.replace),FS=RegExp.prototype.exec,HS=FS,jS=AS("".charAt),VS=AS("".indexOf),KS=AS("".replace),WS=AS("".slice),GS=(TS=/b*/g,wS(FS,ES=/a/,"a"),wS(FS,TS,"a"),0!==ES.lastIndex||0!==TS.lastIndex),YS=OS.BROKEN_CARET,zS=void 0!==/()??/.exec("")[1];(GS||zS||YS||MS||US)&&(HS=function(e){var t,i,n,r,o,a,s,l=this,c=NS(l),u=RS(e),h=c.raw;if(h)return h.lastIndex=l.lastIndex,t=wS(HS,h,u),l.lastIndex=h.lastIndex,t;var d=c.groups,f=YS&&l.sticky,p=wS(xS,l),g=l.source,y=0,v=u;if(f&&(p=KS(p,"y",""),-1===VS(p,"g")&&(p+="g"),v=WS(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==jS(u,l.lastIndex-1))&&(g="(?: "+g+")",v=" "+v,y++),i=new RegExp("^(?:"+g+")",p)),zS&&(i=new RegExp("^"+g+"$(?!\\s)",p)),GS&&(n=l.lastIndex),r=wS(FS,f?i:l,v),f?r?(r.input=WS(r.input,y),r[0]=WS(r[0],y),r.index=l.lastIndex,l.lastIndex+=r[0].length):l.lastIndex=0:GS&&r&&(l.lastIndex=l.global?r.index+r[0].length:n),zS&&r&&r.length>1&&wS(BS,r[0],i,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&d)for(r.groups=a=LS(null),o=0;o<d.length;o++)a[(s=d[o])[0]]=r[s[1]];return r});var $S=HS;df({target:"RegExp",proto:!0,forced:/./.exec!==$S},{exec:$S});var XS=mp,qS=ld,ZS=$S,QS=Tl,JS=vu,eb=ch,tb=JS("species"),ib=RegExp.prototype,nb=function(e,t,i,n){var r=JS(e),o=!QS((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),a=o&&!QS((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[tb]=function(){return i},i.flags="",i[r]=/./[r]),i.exec=function(){return t=!0,null},i[r](""),!t}));if(!o||!a||i){var s=XS(/./[r]),l=t(r,""[e],(function(e,t,i,n,r){var a=XS(e),l=t.exec;return l===ZS||l===ib.exec?o&&!r?{done:!0,value:s(t,i,n)}:{done:!0,value:a(i,t,n)}:{done:!1}}));qS(String.prototype,e,l[0]),qS(ib,r,l[1])}n&&eb(ib[r],"sham",!0)},rb=$p.charAt,ob=function(e,t,i){return t+(i?rb(e,t).length:1)},ab=Bl,sb=Jc,lb=Math.floor,cb=ab("".charAt),ub=ab("".replace),hb=ab("".slice),db=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,fb=/\$([$&'`]|\d{1,2})/g,pb=Il,gb=Xu,yb=rc,vb=Vl,mb=$S,_b=TypeError,Eb=function(e,t){var i=e.exec;if(yb(i)){var n=pb(i,e,t);return null!==n&&gb(n),n}if("RegExp"===vb(e))return pb(mb,e,t);throw _b("RegExp#exec called on incompatible receiver")},Tb=yv,Sb=Il,bb=Bl,Cb=nb,kb=Tl,Ib=Xu,Pb=rc,Db=$l,wb=fd,Ab=Ed,Rb=Fp,xb=Zl,Ob=ob,Lb=Uc,Nb=function(e,t,i,n,r,o){var a=i+e.length,s=n.length,l=fb;return void 0!==r&&(r=sb(r),l=db),ub(o,l,(function(o,l){var c;switch(cb(l,0)){case"$":return"$";case"&":return e;case"`":return hb(t,0,i);case"'":return hb(t,a);case"<":c=r[hb(l,1,-1)];break;default:var u=+l;if(0===u)return o;if(u>s){var h=lb(u/10);return 0===h?o:h<=s?void 0===n[h-1]?cb(l,1):n[h-1]+cb(l,1):o}c=n[u-1]}return void 0===c?"":c}))},Mb=Eb,Ub=vu("replace"),Bb=Math.max,Fb=Math.min,Hb=bb([].concat),jb=bb([].push),Vb=bb("".indexOf),Kb=bb("".slice),Wb="$0"==="a".replace(/./,"$0"),Gb=!!/./[Ub]&&""===/./[Ub]("a","$0");Cb("replace",(function(e,t,i){var n=Gb?"$":"$0";return[function(e,i){var n=xb(this),r=Db(e)?void 0:Lb(e,Ub);return r?Sb(r,e,n,i):Sb(t,Rb(n),e,i)},function(e,r){var o=Ib(this),a=Rb(e);if("string"==typeof r&&-1===Vb(r,n)&&-1===Vb(r,"$<")){var s=i(t,o,a,r);if(s.done)return s.value}var l=Pb(r);l||(r=Rb(r));var c=o.global;if(c){var u=o.unicode;o.lastIndex=0}for(var h=[];;){var d=Mb(o,a);if(null===d)break;if(jb(h,d),!c)break;""===Rb(d[0])&&(o.lastIndex=Ob(a,Ab(o.lastIndex),u))}for(var f,p="",g=0,y=0;y<h.length;y++){for(var v=Rb((d=h[y])[0]),m=Bb(Fb(wb(d.index),a.length),0),_=[],E=1;E<d.length;E++)jb(_,void 0===(f=d[E])?f:String(f));var T=d.groups;if(l){var S=Hb([v],_,m,a);void 0!==T&&jb(S,T);var b=Rb(Tb(r,void 0,S))}else b=Nb(v,a,m,_,T,r);m>=g&&(p+=Kb(a,g,m)+b,g=m+v.length)}return p+Kb(a,g)}]}),!!kb((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!Wb||Gb);var Yb=sc,zb=Vl,$b=vu("match"),Xb=function(e){var t;return Yb(e)&&(void 0!==(t=e[$b])?!!t:"RegExp"==zb(e))},qb=vd,Zb=Sd,Qb=Ef,Jb=Array,eC=Math.max,tC=function(e,t,i){for(var n=Zb(e),r=qb(t,n),o=qb(void 0===i?n:i,n),a=Jb(eC(o-r,0)),s=0;r<o;r++,s++)Qb(a,s,e[r]);return a.length=s,a},iC=yv,nC=Il,rC=Bl,oC=nb,aC=Xu,sC=$l,lC=Xb,cC=Zl,uC=hv,hC=ob,dC=Ed,fC=Fp,pC=Uc,gC=tC,yC=Eb,vC=$S,mC=Tl,_C=QT.UNSUPPORTED_Y,EC=4294967295,TC=Math.min,SC=[].push,bC=rC(/./.exec),CC=rC(SC),kC=rC("".slice);oC("split",(function(e,t,i){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,i){var n=fC(cC(this)),r=void 0===i?EC:i>>>0;if(0===r)return[];if(void 0===e)return[n];if(!lC(e))return nC(t,n,e,r);for(var o,a,s,l=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,h=new RegExp(e.source,c+"g");(o=nC(vC,h,n))&&!((a=h.lastIndex)>u&&(CC(l,kC(n,u,o.index)),o.length>1&&o.index<n.length&&iC(SC,l,gC(o,1)),s=o[0].length,u=a,l.length>=r));)h.lastIndex===o.index&&h.lastIndex++;return u===n.length?!s&&bC(h,"")||CC(l,""):CC(l,kC(n,u)),l.length>r?gC(l,0,r):l}:"0".split(void 0,0).length?function(e,i){return void 0===e&&0===i?[]:nC(t,this,e,i)}:t,[function(t,i){var r=cC(this),o=sC(t)?void 0:pC(t,e);return o?nC(o,t,r,i):nC(n,fC(r),t,i)},function(e,r){var o=aC(this),a=fC(e),s=i(n,o,a,r,n!==t);if(s.done)return s.value;var l=uC(o,RegExp),c=o.unicode,u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(_C?"g":"y"),h=new l(_C?"^(?:"+o.source+")":o,u),d=void 0===r?EC:r>>>0;if(0===d)return[];if(0===a.length)return null===yC(h,a)?[a]:[];for(var f=0,p=0,g=[];p<a.length;){h.lastIndex=_C?0:p;var y,v=yC(h,_C?kC(a,p):a);if(null===v||(y=TC(dC(h.lastIndex+(_C?p:0)),a.length))===f)p=hC(a,p,c);else{if(CC(g,kC(a,f,p)),g.length===d)return g;for(var m=1;m<=v.length-1;m++)if(CC(g,v[m]),g.length===d)return g;p=f=y}}return CC(g,kC(a,f)),g}]}),!!mC((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var i="ab".split(e);return 2!==i.length||"a"!==i[0]||"b"!==i[1]})),_C);var IC=yh.PROPER,PC=Tl,DC=Wg,wC=Jg.trim;df({target:"String",proto:!0,forced:function(e){return PC((function(){return!!DC[e]()||"​…᠎"!=="​…᠎"[e]()||IC&&DC[e].name!==e}))}("trim")},{trim:function(){return wC(this)}});var AC=Ap.filter;df({target:"Array",proto:!0,forced:!ep("filter")},{filter:function(e){return AC(this,e,arguments.length>1?arguments[1]:void 0)}});var RC=Il,xC=Xu,OC=$l,LC=Ed,NC=Fp,MC=Zl,UC=Uc,BC=ob,FC=Eb;nb("match",(function(e,t,i){return[function(t){var i=MC(this),n=OC(t)?void 0:UC(t,e);return n?RC(n,t,i):new RegExp(t)[e](NC(i))},function(e){var n=xC(this),r=NC(e),o=i(t,n,r);if(o.done)return o.value;if(!n.global)return FC(n,r);var a=n.unicode;n.lastIndex=0;for(var s,l=[],c=0;null!==(s=FC(n,r));){var u=NC(s[0]);l[c]=u,""===u&&(n.lastIndex=BC(r,LC(n.lastIndex),a)),c++}return 0===c?null:l}]}));var HC=Wu.f,jC=Sl,VC=_l,KC=Bl,WC=rf,GC=Vg,YC=ch,zC=cd.f,$C=hc,XC=Xb,qC=Fp,ZC=lg,QC=QT,JC=function(e,t,i){i in e||HC(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})},ek=ld,tk=Tl,ik=iu,nk=Wh.enforce,rk=tv,ok=kS,ak=DS,sk=vu("match"),lk=VC.RegExp,ck=lk.prototype,uk=VC.SyntaxError,hk=KC(ck.exec),dk=KC("".charAt),fk=KC("".replace),pk=KC("".indexOf),gk=KC("".slice),yk=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,vk=/a/g,mk=/a/g,_k=new lk(vk)!==vk,Ek=QC.MISSED_STICKY,Tk=QC.UNSUPPORTED_Y,Sk=jC&&(!_k||Ek||ok||ak||tk((function(){return mk[sk]=!1,lk(vk)!=vk||lk(mk)==mk||"/a/i"!=lk(vk,"i")})));if(WC("RegExp",Sk)){for(var bk=function(e,t){var i,n,r,o,a,s,l=$C(ck,this),c=XC(e),u=void 0===t,h=[],d=e;if(!l&&c&&u&&e.constructor===bk)return e;if((c||$C(ck,e))&&(e=e.source,u&&(t=ZC(d))),e=void 0===e?"":qC(e),t=void 0===t?"":qC(t),d=e,ok&&"dotAll"in vk&&(n=!!t&&pk(t,"s")>-1)&&(t=fk(t,/s/g,"")),i=t,Ek&&"sticky"in vk&&(r=!!t&&pk(t,"y")>-1)&&Tk&&(t=fk(t,/y/g,"")),ak&&(o=function(e){for(var t,i=e.length,n=0,r="",o=[],a={},s=!1,l=!1,c=0,u="";n<=i;n++){if("\\"===(t=dk(e,n)))t+=dk(e,++n);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:hk(yk,gk(e,n+1))&&(n+=2,l=!0),r+=t,c++;continue;case">"===t&&l:if(""===u||ik(a,u))throw new uk("Invalid capture group name");a[u]=!0,o[o.length]=[u,c],l=!1,u="";continue}l?u+=t:r+=t}return[r,o]}(e),e=o[0],h=o[1]),a=GC(lk(e,t),l?this:ck,bk),(n||r||h.length)&&(s=nk(a),n&&(s.dotAll=!0,s.raw=bk(function(e){for(var t,i=e.length,n=0,r="",o=!1;n<=i;n++)"\\"!==(t=dk(e,n))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+dk(e,++n);return r}(e),i)),r&&(s.sticky=!0),h.length&&(s.groups=h)),e!==d)try{YC(a,"source",""===d?"(?:)":d)}catch(QB){}return a},Ck=zC(lk),kk=0;Ck.length>kk;)JC(bk,lk,Ck[kk++]);ck.constructor=bk,bk.prototype=ck,ek(VC,"RegExp",bk,{constructor:!0})}rk("RegExp");var Ik="undefined"!=typeof window&&window.location.href.indexOf("loggerdebug")>-1;function Pk(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=0,i=0;i<e.length;i++){var n=e[i].end,r=e[i].begin;Number.isNaN(Number(n))||Number.isNaN(Number(r))||r<0||n<0||n<r||(t+=e[i].end-e[i].begin)}return t=parseInt(1e3*t,10)}function Dk(e){if(null==e||""===e||"string"!=typeof e)return"";var t=e.split("/"),i="";return t.length>3&&t[2]&&(i=t[2]),i}function wk(e){var t={};if(e instanceof window.XMLHttpRequest)try{e.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var i=e.split(": "),n=i.shift(),r=i.join(": ");t[n]=r}))}catch(QB){return t}return t}function Ak(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];Ik&&(t=console).log.apply(t,["[logger]",e].concat(n))}function Rk(){try{return Math.round(window.performance.now())}catch(QB){return(new Date).getTime()}}function xk(){return(new Date).getTime()}function Ok(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(i,n){try{e||n(new Error("url is undefined"));var r=Rk(),o=r,a={},s=new window.XMLHttpRequest;s.open("get",e),s.onreadystatechange=function(){2===s.readyState&&(a.headers=wk(s),a.connectTime=Rk()-o,a.status=s.status,a.statusText=s.statusText,r=Rk())},s.onload=function(){i(a)},s.onprogress=function(e){var t,i=Rk()-r;t=parseInt(e.loaded/1e3/(i/1e3),10),a.speed=0|t,a.costTime=i},s.onerror=function(){a.status||(a.status=-1,a.costTime=Rk()-r),n(a)},s.ontimeout=function(){a.status||(a.status=-2,a.costTime=Rk()-r),i(a)},s.onabort=function(){i(a)},s.responseType="arraybuffer",s.timeout=t.timeout||1e4,s.setRequestHeader("Range","bytes=".concat(t.range||"0-1048576")),s.send()}catch(hs){n(hs)}}))}function Lk(e){return!e||window.location.href.indexOf(e)>-1}function Nk(e){return!!e&&/^blob:/.test(e)}var Mk={x_response_sinfo:"x-response-sinfo",x_response_cache:"x-response-cache",x_response_cinfo:"x-response-cinfo"};function Uk(e){if(!e)return{};var t={};return Object.keys(Mk).map((function(i){if(e[i]||"string"!=typeof Mk[i]){if(!e[i]&&Mk[i]instanceof Array){var n=Mk[i].filter((function(t){return void 0!==e[t]}));n.length>0?t[i]=e[n[0]]:t[i]=""}}else t[i]=e[Mk[i]]||""})),t}function Bk(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function Fk(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(hs){var i=e.className&&"object"===hl(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)".concat(t,"(\\s|$)")))}}function Hk(e){return"String"===Bk(e)?e.replace("P","p"):e?"Number"===Bk(e)?"".concat(e):void 0:""}function jk(e){try{return JSON.stringify(e)}catch(hs){return""}}var Vk=0,Kk=1,Wk=2;function Gk(e,t){return Math.round(t/e*1e3*100)}var Yk=[];"undefined"!=typeof window&&function(){try{var e=new window.PerformanceObserver((function(e){var t=e.getEntriesByType("resource");Yk.length>30&&Yk.splice(0,Yk.length-30);for(var i=0;i<t.length;i++)Yk.push(t[i])}));e.observe({entryTypes:["resource"]})}catch(hs){console.warn("PerformanceObserver not support",hs)}}();var zk="videoplayer_oneplay",$k="videoplayer_oneopera",Xk="videoplayer_oneerror",qk="videoplayer_oneevent",Zk="videoplayer_onetemp",Qk={data:1e3,runtime:1002,parse:1004,network:1003,no_error_handler:9997,custom_error:9998,other:9999,notSupport:1005},Jk={1:-499991,2:-499992,3:-499993,4:-499994,5:-499995},eI=0,tI=1,iI=2,nI=3,rI=4,oI=0,aI=1,sI=2,lI=3,cI=1,uI=2,hI=3,dI=4,fI=5,pI=6,gI=7,yI="error_retry",vI="oneerror",mI="oneevent",_I="onetemp",EI=0,TI=1,SI=864e5,bI=36e5,CI=["tag","subtag","device_type"],kI={NO_FULLSCREEN:0,FULLSCREEN:1,CSS:2};var II=function(){try{return"undefined"!=typeof localStorage&&"setItem"in window.localStorage&&!!window.localStorage.setItem}catch(hs){return!1}}()&&!function(){var e="_localstorage_support_test";try{return window.localStorage.setItem(e,!0),window.localStorage.removeItem(e),!1}catch(hs){return!0}}()?window.localStorage:{},PI="__xgplayerlogkey",DI={set:function(e){try{var t=this.get();t.push(e),II.setItem(PI,JSON.stringify(t))}catch(QB){}},get:function(){try{var e=II.getItem(PI);return e=e?JSON.parse(e):[]}catch(QB){return[]}},remove:function(){try{II.removeItem(PI)}catch(QB){}},clear:function(){try{II.clear()}catch(QB){}}},wI={},AI=Vl,RI=ec,xI=cd.f,OI=tC,LI="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];wI.f=function(e){return LI&&"Window"==AI(e)?function(e){try{return xI(e)}catch(QB){return OI(LI)}}(e):xI(RI(e))};var NI={},MI=vu;NI.f=MI;var UI=_l,BI=iu,FI=NI,HI=Wu.f,jI=Il,VI=uc,KI=vu,WI=ld,GI=df,YI=_l,zI=Il,$I=Bl,XI=Sl,qI=Sc,ZI=Tl,QI=iu,JI=hc,eP=Xu,tP=ec,iP=Du,nP=Fp,rP=Ol,oP=SS,aP=Lp,sP=cd,lP=wI,cP=Ud,uP=El,hP=Wu,dP=JT,fP=Pl,pP=ld,gP=qc,yP=Ah,vP=su,mP=vu,_P=NI,EP=function(e){var t=UI.Symbol||(UI.Symbol={});BI(t,e)||HI(t,e,{value:FI.f(e)})},TP=function(){var e=VI("Symbol"),t=e&&e.prototype,i=t&&t.valueOf,n=KI("toPrimitive");t&&!t[n]&&WI(t,n,(function(e){return jI(i,this)}),{arity:1})},SP=qy,bP=Wh,CP=Ap.forEach,kP=wh("hidden"),IP="Symbol",PP="prototype",DP=bP.set,wP=bP.getterFor(IP),AP=Object[PP],RP=YI.Symbol,xP=RP&&RP[PP],OP=YI.TypeError,LP=YI.QObject,NP=uP.f,MP=hP.f,UP=lP.f,BP=fP.f,FP=$I([].push),HP=gP("symbols"),jP=gP("op-symbols"),VP=gP("wks"),KP=!LP||!LP[PP]||!LP[PP].findChild,WP=XI&&ZI((function(){return 7!=oP(MP({},"a",{get:function(){return MP(this,"a",{value:7}).a}})).a}))?function(e,t,i){var n=NP(AP,t);n&&delete AP[t],MP(e,t,i),n&&e!==AP&&MP(AP,t,n)}:MP,GP=function(e,t){var i=HP[e]=oP(xP);return DP(i,{type:IP,tag:e,description:t}),XI||(i.description=t),i},YP=function(e,t,i){e===AP&&YP(jP,t,i),eP(e);var n=iP(t);return eP(i),QI(HP,n)?(i.enumerable?(QI(e,kP)&&e[kP][n]&&(e[kP][n]=!1),i=oP(i,{enumerable:rP(0,!1)})):(QI(e,kP)||MP(e,kP,rP(1,{})),e[kP][n]=!0),WP(e,n,i)):MP(e,n,i)},zP=function(e,t){eP(e);var i=tP(t),n=aP(i).concat(ZP(i));return CP(n,(function(t){XI&&!zI($P,i,t)||YP(e,t,i[t])})),e},$P=function(e){var t=iP(e),i=zI(BP,this,t);return!(this===AP&&QI(HP,t)&&!QI(jP,t))&&(!(i||!QI(this,t)||!QI(HP,t)||QI(this,kP)&&this[kP][t])||i)},XP=function(e,t){var i=tP(e),n=iP(t);if(i!==AP||!QI(HP,n)||QI(jP,n)){var r=NP(i,n);return!r||!QI(HP,n)||QI(i,kP)&&i[kP][n]||(r.enumerable=!0),r}},qP=function(e){var t=UP(tP(e)),i=[];return CP(t,(function(e){QI(HP,e)||QI(yP,e)||FP(i,e)})),i},ZP=function(e){var t=e===AP,i=UP(t?jP:tP(e)),n=[];return CP(i,(function(e){!QI(HP,e)||t&&!QI(AP,e)||FP(n,HP[e])})),n};qI||(pP(xP=(RP=function(){if(JI(xP,this))throw OP("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?nP(arguments[0]):void 0,t=vP(e),i=function(e){this===AP&&zI(i,jP,e),QI(this,kP)&&QI(this[kP],t)&&(this[kP][t]=!1),WP(this,t,rP(1,e))};return XI&&KP&&WP(AP,t,{configurable:!0,set:i}),GP(t,e)})[PP],"toString",(function(){return wP(this).tag})),pP(RP,"withoutSetter",(function(e){return GP(vP(e),e)})),fP.f=$P,hP.f=YP,dP.f=zP,uP.f=XP,sP.f=lP.f=qP,cP.f=ZP,_P.f=function(e){return GP(mP(e),e)},XI&&(MP(xP,"description",{configurable:!0,get:function(){return wP(this).description}}),pP(AP,"propertyIsEnumerable",$P,{unsafe:!0}))),GI({global:!0,constructor:!0,wrap:!0,forced:!qI,sham:!qI},{Symbol:RP}),CP(aP(VP),(function(e){EP(e)})),GI({target:IP,stat:!0,forced:!qI},{useSetter:function(){KP=!0},useSimple:function(){KP=!1}}),GI({target:"Object",stat:!0,forced:!qI,sham:!XI},{create:function(e,t){return void 0===t?oP(e):zP(oP(e),t)},defineProperty:YP,defineProperties:zP,getOwnPropertyDescriptor:XP}),GI({target:"Object",stat:!0,forced:!qI},{getOwnPropertyNames:qP}),TP(),SP(RP,IP),yP[kP]=!0;var QP=Sc&&!!Symbol.for&&!!Symbol.keyFor,JP=df,eD=uc,tD=iu,iD=Fp,nD=qc,rD=QP,oD=nD("string-to-symbol-registry"),aD=nD("symbol-to-string-registry");JP({target:"Symbol",stat:!0,forced:!rD},{for:function(e){var t=iD(e);if(tD(oD,t))return oD[t];var i=eD("Symbol")(t);return oD[t]=i,aD[i]=t,i}});var sD=df,lD=iu,cD=Dc,uD=Ac,hD=QP,dD=qc("symbol-to-string-registry");sD({target:"Symbol",stat:!0,forced:!hD},{keyFor:function(e){if(!cD(e))throw TypeError(uD(e)+" is not a symbol");if(lD(dD,e))return dD[e]}});var fD=df,pD=uc,gD=yv,yD=Il,vD=Bl,mD=Tl,_D=pf,ED=rc,TD=sc,SD=Dc,bD=mv,CD=Sc,kD=pD("JSON","stringify"),ID=vD(/./.exec),PD=vD("".charAt),DD=vD("".charCodeAt),wD=vD("".replace),AD=vD(1..toString),RD=/[\uD800-\uDFFF]/g,xD=/^[\uD800-\uDBFF]$/,OD=/^[\uDC00-\uDFFF]$/,LD=!CD||mD((function(){var e=pD("Symbol")();return"[null]"!=kD([e])||"{}"!=kD({a:e})||"{}"!=kD(Object(e))})),ND=mD((function(){return'"\\udf06\\ud834"'!==kD("\udf06\ud834")||'"\\udead"'!==kD("\udead")})),MD=function(e,t){var i=bD(arguments),n=t;if((TD(t)||void 0!==e)&&!SD(e))return _D(t)||(t=function(e,t){if(ED(n)&&(t=yD(n,this,e,t)),!SD(t))return t}),i[1]=t,gD(kD,null,i)},UD=function(e,t,i){var n=PD(i,t-1),r=PD(i,t+1);return ID(xD,e)&&!ID(OD,r)||ID(OD,e)&&!ID(xD,n)?"\\u"+AD(DD(e,0),16):e};kD&&fD({target:"JSON",stat:!0,arity:3,forced:LD||ND},{stringify:function(e,t,i){var n=bD(arguments),r=gD(LD?MD:kD,null,n);return ND&&"string"==typeof r?wD(r,RD,UD):r}});var BD=Ud,FD=Jc;df({target:"Object",stat:!0,forced:!Sc||Tl((function(){BD.f(1)}))},{getOwnPropertySymbols:function(e){var t=BD.f;return t?t(FD(e)):[]}});var HD=df,jD=Sl,VD=_l,KD=Bl,WD=iu,GD=rc,YD=hc,zD=Fp,$D=Wu.f,XD=$d,qD=VD.Symbol,ZD=qD&&qD.prototype;if(jD&&GD(qD)&&(!("description"in ZD)||void 0!==qD().description)){var QD={},JD=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:zD(arguments[0]),t=YD(ZD,this)?new qD(e):void 0===e?qD():qD(e);return""===e&&(QD[t]=!0),t};XD(JD,qD),JD.prototype=ZD,ZD.constructor=JD;var ew="Symbol(test)"==String(qD("test")),tw=KD(ZD.valueOf),iw=KD(ZD.toString),nw=/^Symbol\((.*)\)[^)]+$/,rw=KD("".replace),ow=KD("".slice);$D(ZD,"description",{configurable:!0,get:function(){var e=tw(this);if(WD(QD,e))return"";var t=iw(e),i=ew?ow(t,7,-1):rw(t,nw,"$1");return""===i?void 0:i}}),HD({global:!0,constructor:!0,forced:!0},{Symbol:JD})}var aw=[{key:"QQBrowser",reg:/(qqbrowser)\/([\d.]+)/},{key:"QIHU360EE",reg:/qihu 360ee/},{key:"QIHU360SE",reg:/qihu 360se/},{key:"2345Explorer",reg:/(2345explorer)\/([\d.]+)/},{key:"Sogou",reg:/(metasr)/},{key:"Wexin",reg:/(micromessenger)\/([\d.]+)/},{key:"Openlanguage",reg:/(openlanguage)\/([\d.]+)/},{key:"NewsArticle",reg:/(newsarticle)\/([\d.]+)/},{key:"VideoArticle",reg:/(videoarticle)\/([\d.]+)/},{key:"Hotsoon",reg:/(live_stream)_([\d.]+)/},{key:"Aweme",reg:/(aweme)_([\d.]+)/},{key:"Lark",reg:/(lark)\/([\d.]+)/},{key:"PlayStation",reg:/(playstation)/},{key:"BingPreview",reg:/(bingpreview)\/([\d.]+)/},{key:"Baiduspider",reg:/(baiduspider-render)\/([\d.]+)/},{key:"YandexBot",reg:/(yandexbot)\/([\d.]+)/},{key:"Chrome",reg:/(chrome)\/([\d.]+)/},{key:"Safari",reg:/(version)\/([\d.]+)\s*(safari)/}],sw=[{key:"Trident",reg:/(rv:)([\d.]+)/},{key:"Trident",reg:/(msie)\s*([\d.]+)/}],lw=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"];var cw=["Baiduspider","YandexBot"],uw=["Baiduspider","googlebot","360Spider","haosouspider","YoudaoBot","Sogou News Spider","Yisouspider","Googlebot","Headless","Applebot","Bingbot","PetalBot"];var hw="undefined"!=typeof navigator&&function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e=e.toLocaleLowerCase();var t=/(iphone)/.test(e)||/(ipad)/.test(e),i=/(android)/.test(e),n=/(windows phone)/.test(e),r=t||i||n,o={isIOS:t,isAndroid:i,isMobile:r,isPC:!r,isPad:/(ipad)/.test(e)},a=function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;var t=document.createElement("video");return"function"==typeof t.canPlayType?(lw.map((function(i){"probably"===t.canPlayType('video/mp4; codecs="'.concat(i,'"'))&&(e.isSupport=!0,e.mime+="||".concat(i))})),e):(t=null,e)}();o.isSupportMP4=a.isSupport,o.mime=a.mime;var s="",l=0,c=[],u=aw;/trident/.test(e)&&(u=sw);for(var h=0;h<u.length;h++)if(c=u[h].reg.exec(e)){s=u[h].key,l=c.length>2?c[2]:"";break}if(s)o["is".concat(s)]=!0,o.name=s,o.appVersion=l;else{var d=function(){var e=navigator.mimeTypes;if(e){for(var t=0;t<e.length;t++){if(e[t].type&&e[t].type.indexOf("360")>-1)return!0;if(e[t].type&&e[t].type.indexOf("application/vnd.chromium.remoting-viewer")>-1)return!0;if(e[t].description&&e[t].description.indexOf("360")>-1)return!0}return!1}}();d&&(o.name="360EE")}return o.name&&"Trident"!==o.name&&/(trident)/.exec(e)&&(o.name=o.name?"".concat(o.name,"_Trident"):"Trident"),o.isSpider=function(e,t){var i=!1;cw.map((function(t){t===e&&(i=!0)}));for(var n=0;n<uw.length;n++){var r=uw[n];if(-1!==t.indexOf(r)){i=!0;break}}return i}(o.name,e),o}(navigator.userAgent);function dw(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))}var fw=[1,1,1,1,1];function pw(){return parseInt(fw.join(""),10)}fw[0]=hw.isSupportMP4?fw[1]+1:fw[1],fw[1]=dw()?fw[1]+1:fw[1],function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var i=e.video||{},n=e.audio||{};try{var r=MediaSource.isTypeSupported(i.contentType),o=MediaSource.isTypeSupported(n.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(hs){return Promise.resolve(t)}}({type:"file",video:{contentType:'video/mp4;codecs="hev1.1.6.L120.90"',width:1920,height:1080,bitrate:1e4,framerate:30}}).then((function(e){e&&e.supported?fw[2]=fw[2]+1:fw[2]=1})).catch((function(){fw[2]=fw[2]-1}));var gw={range:"0-1048576",timer:6e4,timeout:15e3},yw=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};dl(this,e),Object.keys(gw).map((function(e){void 0!==t[e]&&null!==t[e]||(t[e]=gw[e])})),this.options=t,this._headers={},this.intervalId=null,this.ishangUp=!1,this._data={contentLength:0,statusText:"",status:-1,speed:0,costTime:0,connectTime:0,contentType:""},this.url=[]}return pl(e,[{key:"setData",value:function(e){var t=this;if(Object.keys(e).map((function(i){"headers"!==i&&(t._data[i]=e[i])})),e.headers&&Object.keys(e.headers).length>0){this._headers=Uk(e.headers),e.headers["content-type"]&&(this._data.contentType=e.headers["content-type"]);var i=(e.headers["content-range"]||"").split("/");i&&i.length>1&&(this._data.contentLength=parseInt(i[1]))}}},{key:"contentLength",get:function(){return this._data.length||0}},{key:"trigger",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start",n=this.options;this.url=e,!this.url||"start"!==i&&(this.ishangUp||this.intervalId)?Ak("task>>cant`t trigger url",this.ishangUp,this.intervalId):(Ak("task>>trigger url ",e),this.ishangUp=!0,this.intervalId&&this.clear(),this.intervalId=setTimeout((function(){t.clear()}),"start"===i?500:n.timer),Ok(this.url,{range:"start"===i?"0-1024":n.range,timeout:n.timeout}).then((function(e){Ak("getXhr>>check result ",e),t.setData(e||{}),t.ishangUp=!1})).catch((function(e){Ak("getXhr>>error ",e),t.ishangUp=!1,t._data.status=-1})))}},{key:"url",get:function(){return this.options.url},set:function(e){e&&(this.options.url=e)}},{key:"serverIp",get:function(){return this._headers.x_response_sinfo||""}},{key:"headers",get:function(){return this._headers||{}}},{key:"status",get:function(){return this._data.status||-1}},{key:"speed",get:function(){return this._data.speed}},{key:"clear",value:function(){clearTimeout(this.intervalId),this.intervalId=null}}]),e}(),vw="ProgressInfo";var mw=function(){function e(){dl(this,e),this._init()}return pl(e,[{key:"_init",value:function(){this.played=[],this.playedSize=0,this.cachedSize=0,this.pcdnCached=0,this.cachedVideoSize=0,this.pcdnVideoCached=0,this.file={audio:0,video:0},this.lastBitrate=null,this.curBitrate={vBitrate:0,aBitrate:0,cdnSize:0,pcdnSize:0,definition:"",fileid:""},this.nextBitrate={start:-1},this.currentTime=0,this.buffered=[],this.cachedTime=0,this.duration=0}},{key:"reset",value:function(){this._init()}},{key:"getFileSize",value:function(e){var t=this.curBitrate,i=t.vBitrate,n=t.aBitrate;return{audio:Math.round(e*n/8),video:Math.round(e*i/8),total:Math.round(e*(i+n)/8)}}},{key:"updatePlayed",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=this.played,n=i.length;if(0===t||n<1){var r=n>0?i[n-1]:null,o=this.curBitrate,a=o.vBitrate,s=o.aBitrate;r&&(r.end<0||r.end-r.start<1)?(r.end<0?r.start=e:r.end=e,r.vBitrate=a,r.aBitrate=s):i.push({start:e,end:-1,vBitrate:a,aBitrate:s})}else i[n-1].end=e}},{key:"calculatePlaySize",value:function(){var e=this.played,t=this.curBitrate,i=function(e){for(var t=0,i=0;i<e.length;i++){var n=e[i];n.end<0||(t+=n.end-n.start)}return t}(e),n=Math.round((t.aBitrate+t.vBitrate)*i/8);return this.playedSize+=n,Ak(vw,"calculatePlaySize","duration: ".concat(i," playedSize:").concat(this.playedSize),this.played),this.played=[],this.playedSize}},{key:"copyBitrateInfo",value:function(e,t){return["aBitrate","vBitrate","definition","fileid","cdnSize","pcdnSize"].forEach((function(i){e[i]&&(t[i]=e[i])})),t.cdnSize=e.cdnSize,t.pcdnSize=e.pcdnSize,t}},{key:"checkNextBitrate",value:function(e){var t=this.nextBitrate;if(t.start>-1&&e>=t.start){var i=this.curBitrate;this.calculatePlaySize(),Ak(vw,"checkNextBitrate",e,t.start,this.cachedSize),this.copyBitrateInfo(t,i),this.updatePlayed(e,0),t.start=-1,t.fileid="",["vBitrate","aBitrate","cdnSize","pcdnSize"].forEach((function(e){t[e]=0}))}}},{key:"updateLastDefInfo",value:function(){var e=this.curBitrate;if(e.vBitrate>0){var t={};this.copyBitrateInfo(e,t),this.lastBitrate=t}}},{key:"updateDefInfo",value:function(e,t){Ak(vw,"updateDefInfo",t,this.curBitrate.vBitrate,e);var i=e.mediaType,n=e.start,r=e.bitrate,o=e.definition,a=e.fileid,s={cdnSize:0,pcdnSize:0};"audio"===i?s.aBitrate=r:(s.vBitrate=r,s.definition=o,s.fileid=a,this.updateLastDefInfo()),s.start=n,this.nextBitrate=s,this.checkNextBitrate(t)}},{key:"upDateDownload",value:function(e){var t=e.cdn_size,i=e.pcdn_size,n=e.mediaType,r=this.curBitrate,o=this.nextBitrate,a=0,s=0;i?(a=1,s=i):t&&(s=t),this.cachedSize+=s,"video"===n&&(this.cachedVideoSize+=s,a>0&&(this.pcdnVideoCached+=s)),a>0&&(this.pcdnCached+=s);var l=o.start>=0?o:r;l.cdnSize+=s,a>0&&(l.pcdnSize+=s)}},{key:"updateBuffered",value:function(e){var t=function(e){var t=[];if(!e||e.length<1)return t;for(var i=0;i<e.length;i++){var n=parseInt(1e3*e.start(i),10)/1e3,r=parseInt(1e3*e.end(i),10)/1e3;t.push({start:n,end:r})}return t}(e),i=0;t.forEach((function(e){var t,n;i+=(t=e.end,n=e.start,parseInt(1e3*t-1e3*n,10)/1e3)})),this.buffered=t,this.cachedTime=i}},{key:"isDefInfoFirstChange",value:function(){return!(this.curBitrate&&this.curBitrate.vBitrate>0)}}]),e}();const _w="0.12.10";var Ew=["try_req_num","req_node_succ","conn_req_num","has_ret_node","conn_fail_num","conn_jump_num"];Ak("xgVodLogger version is ".concat(_w));var Tw,Sw=(Tw="Object",function(e){return Object.prototype.toString.call(e)==="[object ".concat(Tw,"]")}),bw=1300,Cw="__tea_cache_tokens_".concat(bw),kw="",Iw=null,Pw=function(){function e(t,i){var n=this;if(dl(this,e),gl(this,"initializeUrlLog",(function(e){var t=e&&e.url?e.url:"String"===Bk(e)?e:"";"String"!==Bk(t)&&(t=""),n.urlLog={initial_url:t,initial_host:Dk(t),initial_ip:""}})),gl(this,"onXgLogCache",(function(){var e,t=n._getLogCache();t&&(n._templog={vtype:null===(e=n.player)||void 0===e?void 0:e.vtype,log:t},n.onOneTemp())})),gl(this,"onPrfDataSize",(function(e){n._progressInfo.upDateDownload(e)})),gl(this,"onDegrade",(function(e){e&&(e.local_time=(new Date).getTime(),n.onOneEvent({end_type:"degrade"},e))})),gl(this,"onMediaFormatError",(function(e){n.onOneEvent({end_type:"".concat(e.error_type||"","Error")})})),gl(this,"onReplayBtnClick",(function(){n.resetLoggerParams()})),gl(this,"onBeforeDefinitionChange",(function(){n.resLogs.ldst=Rk(),n._endType="switch"})),gl(this,"onDefinitionChangeDetail",(function(e){var t=n._progressInfo;t.updateDefInfo(e,n.player.currentTime),t.lastBitrate&&"video"===e.mediaType&&n.sendSwitchOpera("changedetail")})),gl(this,"onDefinitionChange",(function(e){var t=e.from,i=e.to;n.changeResolution({from:t,to:i,startTime:n.resLogs.ldst,operaType:"switch"}),Ak("onDefinitionChange from:".concat(t,", to:").concat(i))})),gl(this,"onDefiChangeSuccess",(function(){Ak("onDefinitionChangeSuccess"),n.updateVideoSize(),n.triggerTask("start")})),gl(this,"onAbrChange",(function(e){var t=e.prev,i=e.cur,r=e.abrInfo;if(n.player.abrInstance){var o=n.player.abrInstance.eventInfo;Ak("abrChange",o),o.last_definition=t,o.now_definition=i,n.abrInfo.abr_event_info.video_switch.push(o),n.changeResolution({from:t,to:i,startTime:Rk(),operaType:"abr_switch",abrInfo:r})}})),gl(this,"onTimeUpdate",(function(){var e=n.playlogs,t=n.resLogs,i=n.player;if(n.errorLog.try_err_c=0,e.vt||1!==n.startStep||(e.vt=xk(),Ak("onTimeUpdate: first frame inited","currentTime11:".concat(i.currentTime," vt-pt:").concat(e.vt-e.pt," vt-nt:").concat(e.vt-e.nt," vt-rt:").concat(e.vt-e.rt)),n.startStep=2),!t.initial_resolution){var r=i.currentDefitionFromPlayer&&i.currentDefitionFromPlayer.definition?i.currentDefitionFromPlayer.definition:i.config.defaultDefinition||"".concat(i.video.videoHeight,"p")||"";r=Hk(r),t.initial_resolution=r}t.final_resolution||(t.final_resolution=t.initial_resolution);var o=e.played.length;o<1?e.played.push({begin:i.currentTime,end:-1}):e.played[o-1].end=i.currentTime,n._progressInfo.updatePlayed(i.currentTime),n._progressInfo.checkNextBitrate(i.currentTime);var a=t.played.length;a<1?t.played.push({begin:i.currentTime,end:-1}):t.played[a-1].end=i.currentTime,n.lastVideoTime=i.currentTime||0})),gl(this,"onVideoProgress",(function(){n.updateBuffers(),n._progressInfo.updateBuffered(n.player.buffered)})),gl(this,"onCanplay",(function(){Ak("onCanplay","this.startStep:".concat(n.startStep," ").concat(xk())),n.setVt()})),gl(this,"onLoadeddata",(function(){Ak("onLoadeddata","this.startStep:".concat(n.startStep," ").concat(xk())),n.setVt(),n.updateVideoSize()})),gl(this,"onLoadStart",(function(){n.commonParams.web_url=location.href;var e=Lk(n.player.currentSrc);n.triggerTask("start"),Ak("onLoadStart","this.startStep:".concat(n.startStep," ").concat(xk()," isSrcEmpty:").concat(e," player.src:").concat(n.player.src)),0!==n.startStep||e||"visible"!==document.visibilityState||n.setPt()})),gl(this,"onBufferedChange",(function(){var e=n.player.video&&n.player.video.buffered;if(e){var t=e.length;t>0&&e.end(t-1)+1>n.player.duration&&(n.bft=xk())}})),gl(this,"onPlayerInited",(function(){Ak("player init"),n._playerCreatedTime=xk(),n.playlogs.rt=xk()})),gl(this,"onNotAutoPlay",(function(){Ak("onNotAutoPlay","autoplay:".concat(n.isAutoplay)),0===n.isAutoplay?n.isAutoplay=2:1===n.isAutoplay&&(n.isAutoplay=3)})),gl(this,"onPlayerError",(function(e){e=e||{};var t=n.errorLog,i=n.player;if(Ak("onPlayerError","this.player.type:".concat(n.player.type," this.player.replayRunning:").concat(n.player.replayRunning," isSupportMP4:").concat(hw.isSupportMP4," isPC:").concat(hw.isPC)),Ak("onPlayerError",e),n.load_state=lI,n._endType="error",n.suspendWaitingStatus("onPlayerError"),n._progressInfo.calculatePlaySize(),"dash"!==i.type||!i.replayRunning){if(e.url||(e.url=n.player.currentSrc),hw.isPC&&!hw.isSupportMP4||hw.isSpider)return t.errc=Jk[5],t.errt=Qk.notSupport,n.onOneError({errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0),void(n._isOnePlayReport=!0);t.errt=e.errorTypeCode||(e.errorType&&Qk[e.errorType]?Qk[e.errorType]:9999),t.message=e.message||"",e.errorCode?t.errc=e.errorCode>0&&Jk[e.errorCode]?Jk[e.errorCode]:e.errorCode:e.code&&(t.errc=e.code>0&&Jk[e.code]?Jk[e.code]:e.code),t.last_errors.push(t.errc),0===t.fir_errc&&(t.fir_errc=t.errc),n.sendSwitchOpera(cI),n.onOnePlay(cI),n.onOneTemp(cI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade);var r=!1,o=e.mediaError;o&&n._options.needXhrCheck&&(4===o.code||2===o)&&(r=!0),n.onOneError({endState:gI,errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0,r),n.sendEventsQueue()}})),gl(this,"onPlayInterfaceInfo",(function(e){Ak("onPlayInterfaceInfo",e);var t=n.errorLog,i=n.apiLog,r=n.playlogs;if(e&&Object.keys(e).map((function(t){"code"===t?i.vsc=e[t]:"message"===t?i.vsc_message=e.message||"success,视频可正常播放":i[t]=e[t]})),r.at=e.timestamep||(new Date).getTime(),(!e.error||-9988!==e.error.errc)&&(i.vsc=e.code||10,i.vsc_message=e.message||"success,视频可正常播放",e.error)){var o=e.error;t.errt=1e3,t.errc=o.errc||-9998,t.last_errors.push(o.errc||-9998),0===t.fir_errc&&(t.fir_errc=o.errc||-9998),t.accu_errc++,1===t.accu_errc&&(t.fir_errt=Rk()),n.onOneError({errorType:1e3,code:o.errc||-9998,url:"",headers:{}})}})),gl(this,"onProgressEvent",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.netLog;if(e.speed){var i=e.speed>1e6?Math.floor(e.speed/1e3):e.speed;t.downloadSpeed=i,t.totalSpeed+=i,t.rqCount++}"oversize"!==e.type&&t.requestCount++,e.connectTime&&(t.connectCost=e.connectTime);var r=t.rqCount<7?100:e.costTime>=5e3?20:10;if(!("success"===e.type&&parseInt(100*Math.random(),10)<=r)){var o=function(e){var t={};try{e=e.replace(/^http:|^https:/,"");for(var i=Yk||[],n=function(n){if(i[n].name.replace(/^http:|^https:/,"")===e)return["domainLookupEnd","domainLookupStart","startTime","requestStart","responseEnd","responseStart","connectStart","connectEnd","fetchStart"].map((function(e){t[e]=Math.round(i[n][e])})),t.url=i[n].name,t.duration=Math.round(i[n].duration),t.domainDuration=t.domainLookupEnd-t.domainLookupStart,t.connectDuration=t.connectEnd-t.connectStart,"break"},r=i.length-1;r>=0&&"break"!==n(r);r--);return t}catch(hs){return t}}(e.cdnUrl),a=e.xhr||{},s=e.type?"progress_".concat(e.type):"progress",l=e.headers;l||(l=wk(a));var c=ul(ul({},l=Uk(l)),{},{download_speed:t.downloadSpeed,connect_cost:t.connectCost,c_dur:o.connectDuration||0,d_dur:o.domainDuration||0,r_dur:o.duration||0,rqtt:(new Date).getTime(),x_cache:l.x_response_cache||"",server_ip:l.x_response_sinfo});e.status?t.status=e.status:a&&a instanceof window.XMLHttpRequest&&(t.status=a.status||0),c.status=t.status;var u=e.cdnUrl||e.url;"error"===e.type&&n.merror.cdn.push(ul(ul({costTime:e.costTime,cur_play_pos:e.pos,cdn_url:u,cdn_host:Dk(u)},c),l)),n.onOneEvent({costTime:e.costTime,vid:e.vid,end_type:s,cur_play_pos:e.pos,cdn_url:u,cdn_host:Dk(u)},c,"error"===e.type?0:2)}})),gl(this,"onNext",(function(){if(Ak("onNext:startStep:",n.startStep),n.startStep>0){if(n._reportInvalidVV(uI))return;n.sendSwitchOpera(uI),n.onOnePlay(uI),n.onOneTemp(uI),n.sendEventsQueue()}n.vtype=null,n.playlogs.lc=0,n.resetLoggerParams()})),gl(this,"onNextEnded",(function(){var e=n.player,t=n.resLogs,i=Hk(e.config.defaultDefinition||"");t.initial_resolution=i,t.final_resolution=i})),gl(this,"onXgLogWaiting",(function(e){var t=n.playlogs,i=n.resLogs,r=n.stall;if(n._options.checkByInnerLog&&0===e.type){Ak("onXgLogWaiting",e);var o=e.endType,a=e.costTime,s=e.start,l={download_speed:n.realSpeed,avg_speed:n.avgSpeed,mse_op:n.mp4MseOpLength,mp4_load_range:n.mp4LoadSegmentTimeRange,bitrate:n.curBitrate};if("waitingStart"===e.eventType)return n.onOneEvent({costTime:a,end_type:"waitstart"},l,2),void n.appendStallInfo("start",s);if("waitingEnd"===e.eventType){var c=Rk();Ak("onXgLogWaiting>>".concat(o,"|costTime:").concat(a," vt:").concat(t.vt)),n.appendStallInfo("end",c,o),t.bc++,n.checkInBuffer(n.player.currentTime)?(t.de_bu_acu_t+=a,t.dbc++):(t.nbc++,t.n_bu_acu_t+=a),i.bc++,t.bu_acu_t+=a,i.bu_acu_t+=a,r.end=n.cur_play_pos,r.cost=a,r.acc+=r.cost,1===r.sc&&(r.endf=n.cur_play_pos),n.onOneEvent({costTime:a,end_type:"waitend"},l,2)}}})),gl(this,"onSeeking",(function(){if(!Lk(n.player.src)){var e=n.resLogs,t=n.playlogs,i=n.player,r=n.seekLog;Ak("onSeeking","currentTime:".concat(i.currentTime)),0===n.startStep&&n.setPt(),n.suspendWaitingStatus("seek"),n.isSeeking&&n.suspendSeekStatus("seek",!1),n.isSeeking=!0,t.played.push({begin:i.currentTime,end:-1}),e.played.push({begin:i.currentTime,end:-1}),n._progressInfo.updatePlayed(i.currentTime,0),r.lastSeekStartTime=Rk(),r.seekBefore=n.lastVideoTime.toString(),r.buf_include=n.checkInBuffer(n.player.currentTime)?1:0,r.intervalId=setTimeout((function(){n.isSeeking&&n.suspendSeekStatus("seekTimeout",!0)}),6e4)}})),gl(this,"onSeeked",(function(){Lk(n.player.src)||n.isSeeking&&n.suspendSeekStatus("seeked",!0)})),gl(this,"onPlaying",(function(){n.suspendWaitingStatus("play"),n.load_state=aI;var e=Rk();n.pauseLog.isPausing&&(n.pauseLog.isPausing=!1,n.pauseLog.pause_acu_t+=e-n.pauseLog.pause_start)})),gl(this,"onPlayCatch",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorTypeCode:0,errorCode:0,url:"",headers:{},status:0};if(Ak("onPlayCatch",e,t),e){switch(e){case"mp42dash":n.vtype="DASH_2";break;case"dash2mp4":n.vtype="MP4_2";break;case"dash1mp4":n.vtype="MP4_1";break;default:n.vtype=e}var i=n.errorLog,r=n.playlogs;n.merror.playCatch.push(ul({errc:t.errorCode,errt:t.errorType},t.headers)),n.setBr("playcatch"),i.accu_errc++,i.try_err_c++,i.fir_errc=t.errorCode,t.errorCode&&i.last_errors.push(t.errorCode),n.suspendWaitingStatus("playcatch"),n.suspendSeekStatus("playcatch"),n.sendDegradeLog("playCatch",r.degrade,{cdn_url:t.url}),r.degrade=e,n.onOneError({errorType:t.errorTypeCode,code:t.errorCode,url:t.url||"",status:t.httpCode||t.status,headers:t.headers||{},vid:t.vid||n.vid,preload_hit:t.preloadHit||0,preload_cached:t.preloadCached||0,endState:pI,costTime:t.costTime,message:t.errorMessage||t.message,interval_time:t.timerStep||0},0)}})),gl(this,"onMediaExpied",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{errorType:"",errorTypeCode:0,errorCode:0,url:"",headers:{},status:0},t=n.errorLog,i=n.playlogs;Ak("onMediaExpied",e),n.suspendWaitingStatus("expied"),n.setBr("expied"),t.accu_errc++,t.try_err_c++,t.last_errors.push(e.errorCode),i.at=(new Date).getTime(),n.merror.expied.push(ul({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status},Uk(e.headers||{}))),n.onOneError({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status,headers:e.headers||{}},0)})),gl(this,"onLog",(function(e){Ak("onLog",e);var t=e.type;if(delete e.type,t)switch(t){case yI:break;case _I:n._templog||(n._templog={}),n._templog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object.keys(t).map((function(n){var r,o;e[n]="append"===i?(r=e[n],o=t[n],!r||"string"!=typeof o&&"number"!=typeof o?o:"".concat(r," ").concat(o)):t[n]})),e}(n._templog,e.data,e.action),n._templog.preload_hit&&(n._cacheFile=TI);break;case vI:var i=n.errorLog;i.accu_errc++,i.try_err_c++,n.setBr("mp4error"),i.last_errors.push(e.code),n.onOneError(e,0);break;case mI:var r=function(e,t){var i={ext:e.ext||{},data:{}};return Object.keys(e).map((function(n){t[n]?i.data[t[n]]=e[n]:"ext"!==n&&(i.ext[n]=e[n])})),i}(e,{costTime:"costTime",vid:"vid",end_type:"end_type",pos:"cur_play_pos",cdnUrl:"cdn_url"});r.ext&&["start","end"].map((function(e){r.ext[e]&&(r.ext["ext_".concat(e)]=r.ext[e],delete r.ext[e])})),n.onOneEvent(r.data,r.ext,2)}})),gl(this,"onPlay",(function(){Ak("onPlay","this.startStep :".concat(n.startStep," this.isEnded:").concat(n.isEnded)),n.isEnded&&(n.resetLoggerParams(),n.setPt())})),gl(this,"onPause",(function(){Ak("onPause");var e=n.pauseLog;e.isPausing=!0,e.pause_start=Rk()})),gl(this,"onWaiting",(function(){var e=n._options;n.updateCurBuffer("onWaiting"),e.checkByInnerLog||(Ak("onWaiting>","isSeeking:".concat(n.isSeeking," startStep:").concat(n.startStep," intervalId:").concat(n.stallIntervalId)),n.wait_buf_include=n.checkInBuffer(n.player.currentTime,-1e3)?1:0,n.isSeeking||0===n.playlogs.vt||n.inWaitingStart>0||(n.stallIntervalId&&(window.clearTimeout(n.stallIntervalId),n.stallIntervalId=null),n.inWaitingStart=Rk(),n.waitStartTime=n.cur_play_pos,n.stallIntervalId=window.setTimeout((function(){var e=n.stall;Ak("this.stallIntervalId>>".concat(n.stallIntervalId," cost: ").concat(Rk()-n.inWaitingStart)),n._endType="wait",n.load_state=sI,n.vtype.indexOf("MP4")>-1&&n.player.currentTime>10&&n.task&&(n.triggerTask("waiting",n.initial_url),n.requestCount++),e.start=n.waitStartTime,e.bc++,1===e.bc&&(e.startf=n.waitStartTime),window.clearTimeout(n.stallIntervalId),n.stallIntervalId=null,n.startWaitingStatus(n.inWaitingStart,Rk()-n.inWaitingStart),n.stallIntervalId=setTimeout((function(){n.inWaitingStart>0&&n.suspendWaitingStatus("timeout")}),6e4)}),200)))})),gl(this,"onEnded",(function(){if(n.initial_url){Ak("onEnded","watchDur:".concat(n.watchDur," vt:").concat(n.vt," pt:").concat(n.pt)),n.isEnded=!0;var e=n.resLogs.df,t=n._progressInfo;t.calculatePlaySize(),t.cachedSize<1?n.changeResolution({from:e,to:e,startTime:Rk(),operaType:"leave_switch",endType:"ended"}):n.sendSwitchOpera(hI),n.onOnePlay(hI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade),n.onOneTemp(hI),n.sendEventsQueue(),n.playlogs.lc++}})),gl(this,"onUnload",(function(){0!==n.startStep&&n.initial_url&&(n.onOneTemp(dI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade),n._reportInvalidVV(dI)||(n.sendSwitchOpera(dI),n.onOnePlay(dI,!0)))})),gl(this,"onVisibilitychange",(function(){var e=n.playlogs.vt;"visible"===document.visibilityState&&(e||n.setPt())})),gl(this,"onDestroy",(function(){Ak("onDestroy:this.startStep:".concat(n.startStep," initial_url:").concat(n.initial_url," ").concat(!!n.initial_url)),n.onOnePlay(fI),n.startStep>0&&n.initial_url&&(n.onOneTemp(fI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade));var e=n.resLogs.df;n._progressInfo.cachedSize<1?n.changeResolution({from:e,to:e,startTime:Rk(),operaType:"leave_switch",endType:"destroy"}):n.sendSwitchOpera(hI),n.sendEventsQueue(),hw.isPC?window.removeEventListener("beforeunload",n.onUnload):(hw.isMobile||hw.isPad)&&window.removeEventListener("pagehide",n.onUnload),document.removeEventListener("visibilitychange",n.onVisibilitychange),n.listeners.forEach((function(e){n.player.off(e.evt,e.handler)})),n.clearTimers(),n.player.off("destroy",n.onDestroy),n.task&&n.task.clear()})),gl(this,"onOnePlay",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Ak("onOnePlay _isOnePlayReport:".concat(n._isOnePlayReport," isLeave: ").concat(t," endState:").concat(e)),!n._isOnePlayReport){var i=n.errorLog,r=n.playlogs,o=n.abrInfo,a=n.resLogs,s=n.player,l=n.apiLog,c=n.pauseLog,u=n.stall,h=n.netLog,d=n.watchDur;n._isOnePlayReport=!0;var f=xk();n.getBufferTime(s);var p=n.getFrameInfo(),g=n.getPerformance(),y=i.errc,v=n._progressInfo,m=v.playedSize,_=v.cachedSize,E=v.pcdnCached,T=v.cachedVideoSize,S=v.pcdnVideoCached,b=n._progressInfo.getFileSize(s.duration),C=n.seekLog,k=C.sc,I=C.sat,P={bc:Gk(d,n.bc),bu_acu_t:Gk(d,n.bu_acu_t),sc:Gk(d,k),sat:Gk(d,I)};n.setExt();var D=n._getCompatibilityInfo();n.setNovv(null,e);var w=ul(ul(ul(ul({local_time:(new Date).getTime(),log_type:"video_playq",plugin_exception:0,player_create_exception:"",v:n.vid,initial_url:n.initial_url,initial_host:n.initial_host,initial_ip:n.curHeaders.x_response_sinfo||0,initial_type:n.initial_type},n.curHeaders),{},{initial_resolution:a.initial_resolution,final_resolution:a.final_resolution,pt:n.pt,prepare_start_time:r.nt,prepare_end_time:r.rt||xk(),vt:n.vt,lt:n.lt,lpt:n.lpt,fvt:n.fvt,nvt:n.nvt,bft:n.bft,sc:k,sat:I,bc:n.bc,dbc:r.dbc||0,nbc:r.nbc||0,video_net_s:n.videoNetworkState,status:n.curStatus,first_buf_startt:u.startf,first_buf_endt:u.endf,lc:r.lc,bu_acu_t:n.bu_acu_t,de_bu_acu_t:r.de_bu_acu_t||0,n_bu_acu_t:r.n_bu_acu_t||0,pause_acu_t:c.pause_acu_t,cur_play_pos:n.cur_play_pos,load_state:n.load_state,play_speed:n.playbackRate,playback_state:n.playback_state,end_state:e,watch_dur:d,switch_resolution_c:n.switchResolutionCount,is_start_play_automatically:n.isAutoplay,start_time:n.start_time,finish:n.finish,errt:i.errt,errc:y,vsc:l.vsc,vsc_message:i.message||l.vsc_message,api_str:l.api_str,auth:l.auth||l.logid,width:n.videoWidth,height:n.videoHeight,vd:n.vd,video_length:b.video,audio_length:b.audio,df:n.resolution,lf:a.lf,play_c:0,player_created_t:n.player_created_t,fir_errt:i.fir_errt,fir_errc:i.fir_errc,lv_method:0,ldst:a.ldst,ldet:a.ldet,is_disable_short_seek:0,mute:n.mute,volume:n.volume,download_speed:n.realSpeed?n.realSpeed:n.task&&n.task.speed?n.task.speed:h.downloadSpeed,avg_speed:n.avgSpeed?n.avgSpeed:h.rqCount>0?parseInt(h.totalSpeed/h.rqCount,10):0,bitrate:n.curBitrate,preload_state:n.preloadState,preload_hit:n.preLoadData.hit||0,preload_cached:n.preLoadData.duration||n.preLoadData.byteLength||0,mdl_req_num:h.requestCount,watingcost:n.watingCost,br:r.br,fbrt:r.fbrt,try_err_c:i.try_err_c,accu_errc:i.accu_errc,merror:jk(n.merror),ex:jk(n.exInfo),perf:jk(g),bufs:jk(n.buffers.allBuffer),vds:_,pvds:E,vps:m,vvds:T,pvvds:S,pcdn:jk(n.getPCDNStat())},n.buffers.curBuffer),{},{degrade:r.degrade,cache_file:n._cacheFile},p),{},{fullScreen:n._getFullScreenType(),encryptedInfo:jk(n.encryptedInfo),per100_info:jk(P)},D);0!==n.vt&&(w.et=f);var A=n._logstrcache||n._getLogCache();0===w.fvt&&A&&(w.log=A,n._logstrcache=null),null!=s&&s.softDecoder&&(w.soft_decoder=s.softDecoder),s&&s.dashState&&(w.dash_state=s.dashState),null!=s&&s.softDecoder&&(w.soft_decoder=s.softDecoder),o.abr_init_opts=s.config.autoBitrateOpts||{},w.abr_info=jk(n.abrInfo);var R=D.is_support_mp4&&D.is_support_mse_mp4;if(D.is_spider||hw.isPC&&!R&&0===n.fvt)Ak("is_spider",D.is_spider,"is_support_mp4",D.is_support_mp4);else if(t){var x=!n._options.disableLocalCache;n.reportLog(zk,w,x?1:0)}else n.reportLog(zk,w)}})),gl(this,"onOneEvent",(function(e){var t=e.costTime,i=e.vid,r=e.end_type,o=e.cur_play_pos,a=e.cdn_url,s=e.cdn_host,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2?arguments[2]:void 0;Ak("onOneEvent",r);var u=n.buffers,h=u.curBuffer,d=u.allBuffer,f=n.getFrameInfo(),p=ul(ul({local_time:(new Date).getTime(),v:i||n.vid,cost_time:t,end_type:r||n.end_type,cdn_url:a||n.url,cdn_host:s||"",initial_type:n.initial_type,resolution:n.resolution,play_speed:n.playbackRate,first_frame_interval:Rk()-n.pt,last_switch_interval:n.getLastInterval("lastSwitchStartTime",n.resLogs,!1),last_seek_interval:n.updateSeekPt(!1),last_event_interval:n.getLastInterval("lastEventTime"),cur_play_pos:o||n.cur_play_pos,video_ready_s:n.videoReadyState,video_seeking:n.videoSeeking,video_paused:n.videoPaused,bufs:jk(d),retry_count:n._retryCount,at:n.playlogs.at,bc:n.stall.bc,stay_seconds:parseInt(((new Date).getTime()-n.playlogs.at)/1e3,10),preload_state:n.preloadState,preload_hit:n.preLoadData.hit,preload_cached:n.preLoadData.duration||n.preLoadData.byteLength},h),f);r.indexOf("waitend")>=0&&t>3e3&&(p.log=n._getLogCache());var g=n.player,y=g.currentTime,v=g.duration-y;if(r.indexOf("waitstart")>=0&&v<=1){var m=p.local_time,_=p.v,E=p.cost_time,T=p.cdn_url,S=p.first_frame_interval,b=p.cur_play_pos,C=p.video_ready_s,k=p.video_seeking,I=p.video_paused,P=p.bufs,D=p.bc,w=p.preload_hit;n.reportLog(qk,ul({end_type:"longwait",local_time:m,v:_,cost_time:E,cdn_url:T,first_frame_interval:S,cur_play_pos:b,video_ready_s:C,video_seeking:k,video_paused:I,bufs:P,bc:D,preload_hit:w},h),c)}if("waitstart"===r&&"function"==typeof n._options.getPageFPS){var A=n._options.getPageFPS();p.cur_fps=A.curFPS||0,p.avg_fps=A.avgFPS||0}r.indexOf("wait")>-1&&(p.buf_include=n.wait_buf_include),r.indexOf("timeout")>-1&&p.cost_time>bI&&(p.cost_time=bI);var R=n.player;R&&R.dashState&&(p.dash_state=n.player.dashState),Object.keys(l).forEach((function(e){p[e]=l[e]})),p.ex=jk(n.getPlayerExt()),n.addIfExist("drm_type",n._options,p),n.reportLog(qk,p,c)})),gl(this,"onOneTemp",(function(){if(Ak("onOneTemp>>",!n._templog),n._templog){var e=n.player,t=n.playlogs,i=n.pauseLog,r=n.errorLog,o=n.resLogs,a=n.watchDur,s=ul(ul(ul({local_time:(new Date).getTime()},n._templog),{},{v:n.vid,initial_type:n.initial_type,pt:n.pt,vt:n.vt,lt:n.lt,fvt:n.fvt,bc:n.bc,bu_acu_t:n.bu_acu_t>SI?0:n.bu_acu_t,pause_acu_t:i.pause_acu_t,cur_play_pos:n.cur_play_pos,watch_dur:a>SI?0:a,finish:n.finish,errt:r.errt,errc:r.errc,vd:n.vd,df:n.resolution,lf:o.lf,br:t.br,fbrt:t.fbrt,try_err_c:r.try_err_c,accu_errc:r.accu_errc,dash_break:2===e.dashBufferBreak?1:0,bufs:jk(n.buffers.allBuffer),vs:o.vs,vds:o.vds,vps:o.vps},n.buffers.curBuffer),{},{degrade:t.degrade});0!==n.vt&&(s.et=xk()),["drm_type","dynamic_type"].forEach((function(e){n.addIfExist(e,n._options,s)})),n.reportLog(Zk,s,0),n._templog=null}})),this.player=t,void 0===this.player||null===this.player)throw new Error("player is ".concat(this.player));if(i&&i.line_app_id){i.isTask&&(this.task=new yw),this.eventQueue=[],this._instanceCreateTime=(new Date).getTime(),i.codec_type=i.codec_type||"h264",this._envInfo=i.envInfo||{},this._options=i,!this._options.maxQueueCount&&(this._options.maxQueueCount=5),this.line_app_id=parseInt(i.line_app_id,10)||0,this.line_user_id=(i.line_user_id||"").toString(),this.playerCoreVersion=t.version,this.playerVersion=i.playerVersion,this.closeSeekLog=i.closeSeekLog||!1,this.start_time=1e3*(i.start_time||0),this._initial_resolution="",this.__vtype=null,this.__dt="",this._progressInfo=new mw,this.resetLoggerParams();try{this.initializeTracker(),this.sendLocalLog(),this.bindEvt(),Ak("logger constructor:".concat(this.player.video))}catch(hs){console.error(hs)}}else console.warn("player.config.vodLogOpts.line_app_id is necessary for plugin xgVodLogger")}return pl(e,[{key:"resetLoggerParams",value:function(){Ak("resetLoggerParams");var e=this.playlogs?this.playlogs.lc:0;this.playlogs={nt:xk(),vt:0,rt:this.isEnded?xk():0,at:0,pt:0,bu_acu_t:0,bc:0,br:0,fbrt:"",dbc:0,de_bu_acu_t:0,nbc:0,n_bu_acu_t:0,played:[{begin:0,end:-1}],degrade:"none",lc:e},this.degradeLog={bu_acu_t:0,bc:0,watch_dur:0,hasSendEnd:!1},this.buffers={allBuffer:[],curBuffer:{buf_diff:0,buf_s_pos:0,buf_e_pos:0,buf_include:0}},this.netLog={downloadSpeed:0,requestCount:0,connectCost:0,totalSpeed:0,rqCount:0,status:0},this.merror={cdn:[],player:[],playCatch:[],expied:[]},this.exInfo={stall:[]},this._templog=null,this._isOnePlayReport=!1,this.startStep=0,this.bft=0,this._progressInfo.reset(),this._novv={log_pt:xk()},this.initializeLogDatas(),this.initializeUrlLog()}},{key:"setNovv",value:function(e,t){!this._novv||this.fvt>0||(e&&(this._novv.errc=e.code,this._novv.errt=e.errorType,this._novv.errorMessage=e.message),this._novv.end_state=t,this._novv.novv_pt||(this._novv.novv_pt=xk(),this._novv.novv_lpt=xk()-this._novv.log_pt),this.player&&(this._novv.vtype=this.player.vtype,this.player.novv=this._novv))}},{key:"initializeLogDatas",value:function(){this.startStep=0,this.inWaitingStart=0,this.waitStartTime=0,this.lastVideoTime=0,this._endType="",this._retryCount=0,this.lastOperaTime=-1,this.lastEventTime=-1,this.stallIntervalId=null,this.seekLog={intervalId:0,lastSeekStartTime:Rk(),seekBefore:0,sat:0,sc:0,buf_include:0},this.resLogs={lastSwitchStartTime:-1,switch_count:0,abr_switch_count:0,initial_resolution:"",final_resolution:"",ldst:0,ldet:0,df:"",lf:"",played:[],bc:0,bu_acu_t:0,sc:0,sat:0,buf:0,lbuf:0,lplayed:0,vs:0,vds:0,vps:0,vis:0,bitrate:0},this.apiLog={code:0,message:"",logid:"",api:"",auth:"",error:{}},this.errorLog={accu_errc:0,try_err_c:0,errt:0,errc:0,fir_errt:0,fir_errc:hw.isSupportMP4?0:1005,last_errors:[],message:""},this.pauseLog={pause_acu_t:0,isPausing:!1,pause_start:0},this.stall={sc:0,startf:0,endf:0,start:0,end:0,cost:0,acc:0},this._playerCreatedTime=0,this.load_state=oI,this.lv_method=6,this.isSeeking=!1,this.isEnded=!1,this.startStep=0,this.isAutoplay=this.player.config&&this.player.config.autoplay?1:0,this.abrInfo={abr_general_info:{},abr_event_info:{video_switch:[],video_stall:[],video_exit:{}},abr_play_info:{start_play_time_ms:0,is_hint:0,playback_info:{internet_speed_record:[],play_bitrate_record:[],buffer_length_record:[],play_speed_record:[]}},abr_user_info:{cancel_abr:0},abr_init_opts:this.player.config.autoBitrateOpts||{}},this._cacheFile=EI}},{key:"initSessionId",value:function(){var e="0";try{e=window.localStorage.getItem(Cw).web_id||"0"}catch(QB){e="0"}this._sessionId=function(e){var t=(new Date).getTime();try{e=parseInt(e)}catch(hs){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=window.performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?i:3&i|8).toString(16)}))}(e),Ak("sessionId ".concat(this._sessionId))}},{key:"initializeTracker",value:function(){var e=this,t=this._options;if(window.__xgplayer_vod_log__)this.tracker=window.__xgplayer_vod_log__;else{this.tracker=window.__xgplayer_vod_log__=new Iw("tracker");var i=t.channel||"cn",n={app_id:"cn"===(i="va"===i||"sg"===i?i:"cn")?bw:1300===bw?323254:bw,channel:i,log:!1,disable_sdk_monitor:!0,disable_heartbeat:!0};t.channelDomain&&(n.channel_domain=t.channelDomain),n.enable_ab_test=!!t.enableAbTest,this.tracker.init(n)}this.initSessionId();var r=navigator?navigator.hardwareConcurrency:0,o=navigator?navigator.deviceMemory:0;this.commonParams={play_type:0,source_type:"vid",sdk_version:_w,pc:this.playerCoreVersion,pv:this.playerVersion,line_app_id:this.line_app_id,line_user_id:this.line_user_id,app_version:t.appVersion||"",platform:hw.isPad?"pad":hw.isMobile?"mobile":"pc",cpu_core:Number(r)||0,memory_size:Number(o)||0,support:pw(),webdriver:navigator&&navigator.webdriver?1:0,player_sessionid:this.sessionId,web_url:window.location.href,user_agent:navigator.userAgent};var a=t.trackerConfig||{};Ak("commonParams ",this.commonParams,a);var s=ul({evtParams:this.commonParams,disable_auto_pv:!0},a);!hw.name||hw.isChrome||hw.isSafari||(s.browser=hw.name,hw.appVersion&&(s.browser_version=hw.appVersion)),this.line_user_id&&(s.user_unique_id=this.line_user_id,!t.enableTeaWebId&&(s.web_id=this.line_user_id)),t.referrer&&(s.referrer=t.referrer,s.referrer_host=Dk(t.referrer)),t.ext&&Object.keys(t.ext).map((function(i){e.exInfo[i]=t.ext[i]})),Ak("trackConfig",s),this.tracker.config(s),this.tracker.start()}},{key:"resetDefiInfo",value:function(){var e=this.resLogs;e.played=[],e.bc=0,e.bu_acu_t=0,e.sc=0,e.sat=0}},{key:"sendLocalLog",value:function(){var e=this,t=DI.get();DI.remove(),t.map((function(t){Object.keys(t).map((function(i){if(Ak("sendLocalLog",i,t[i]),e.player){e.player.emit("abLog",i,t[i]);var n=e._options.sendLocalCallback;n&&"function"==typeof n&&n(i,t[i])}e._track(i,t[i])}))}))}},{key:"_track",value:function(e,t){"function"==typeof this.tracker?this.tracker(e,t):this._options.enableBeacon&&e===zk?this.tracker.beaconEvent(e,t):this.tracker.event(e,t)}},{key:"bindEvt",value:function(){var e=this;this.listeners=[{evt:"play",handler:this.onPlay},{evt:"playing",handler:this.onPlaying},{evt:"pause",handler:this.onPause},{evt:"waiting",handler:this.onWaiting},{evt:"playInterfaceInfo",handler:this.onPlayInterfaceInfo},{evt:"ended",handler:this.onEnded},{evt:"loadeddata",handler:this.onLoadeddata},{evt:"loadstart",handler:this.onLoadStart},{evt:"canplay",handler:this.onCanplay},{evt:"progress",handler:this.onVideoProgress},{evt:"autoplay_was_prevented",handler:this.onNotAutoPlay},{evt:"seeking",handler:this.onSeeking},{evt:"seeked",handler:this.onSeeked},{evt:"complete",handler:this.onPlayerInited},{evt:"timeupdate",handler:this.onTimeUpdate},{evt:"bufferedChange",handler:this.onBufferedChange},{evt:"beforeDefinitionChange",handler:this.onBeforeDefinitionChange},{evt:"definitionChange",handler:this.onDefinitionChange},{evt:"definitionChangeSuccess",handler:this.onDefiChangeSuccess},{evt:"replayBtnClick",handler:this.onReplayBtnClick},{evt:"initialUrl",handler:this.initializeUrlLog},{evt:"ABR_CHANGE",handler:this.onAbrChange},{evt:"playCatch",handler:this.onPlayCatch},{evt:"log",handler:this.onLog},{evt:"progress_event",handler:this.onProgressEvent},{evt:"logger_next",handler:this.onNext},{evt:"playnext",handler:this.onNext},{evt:"nextEnded",handler:this.onNextEnded},{evt:"media_format_error",handler:this.onMediaFormatError},{evt:"xglog",handler:this.onXgLogWaiting},{evt:"xglog_cache",handler:this.onXgLogCache},{evt:"degrade",handler:this.onDegrade},{evt:"definitionChangeDetail",handler:this.onDefinitionChangeDetail},{evt:"prf_data_size",handler:this.onPrfDataSize}];var t=this.player.config.errorKey;Ak(">>>errorKey",t);var i={evt:"error",handler:this.onPlayerError};t&&(i.evt=t),this.listeners.push(i),this.listeners.forEach((function(t){e.player.on(t.evt,t.handler)})),this.bindUnload()}},{key:"_getLogCache",value:function(){var e,t;return(null===(e=this.player)||void 0===e?void 0:e.logCache)||(null===(t=this.player)||void 0===t?void 0:t.getLogCache)}},{key:"addIfExist",value:function(e,t,i){if(Sw(t)){var n=t[e];!(null==n)&&(i[e]=n)}}},{key:"sendSwitchOpera",value:function(e){var t=this._progressInfo,i=t.lastBitrate,n=t.curBitrate,r=t.nextBitrate,o={costTime:0,operaType:"detail_switch",stateBefore:"",stateAfter:"",endType:e},a=null;if("changedetail"===e){if(!i)return;a=i,o.stateBefore=i.definition,o.stateAfter=r.definition}else a=n,o.stateBefore=n.definition,o.stateAfter="";var s={vds:a.cdnSize,pvds:a.pcdnSize,fileid:a.fileid};this.onOneOperator(o,s)}},{key:"changeResolution",value:function(e){var t=e.from,i=e.to,n=e.startTime,r=e.operaType,o=e.abrInfo,a=e.endType,s=void 0===a?"":a,l=this.resLogs;t=Hk(t),i=Hk(i),l.ldet=Rk(),l.df=i,l.lf=t,l.final_resolution=i,l.switch_count++;var c=l.ldet-n,u={bc:l.bc,bu_acu_t:l.bu_acu_t,sc:l.sc,sat:l.sat,watch_dur:Pk(l.played)};o&&(u.abrInfo=o),this.updateVds(),this.resetDefiInfo(),this._options.closeResolutionLog||this.onOneOperator({costTime:c,operaType:r,endType:s,stateBefore:t,stateAfter:i},u,0)}},{key:"getLastInterval",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=t[e],r=Rk(),o=-1===n?-1:r-n;return i&&(t[e]=r),o}},{key:"updateSeekPt",value:function(e){return this.getLastInterval("lastSeekStartTime",this.seekLog,e)}},{key:"_reportInvalidVV",value:function(e){return!!this._isInvaidVV()&&(this.onOneError({endState:e,errorType:9998,code:-1,url:this.player.currentSrc,headers:{}},0),this._isOnePlayReport=!0,!0)}},{key:"_isInvaidVV",value:function(){return 0===this.vt&&-1===this.curStatus}},{key:"bindUnload",value:function(){hw.isPC?window.addEventListener("beforeunload",this.onUnload):(hw.isMobile||hw.isPad)&&window.addEventListener("pagehide",this.onUnload),document.addEventListener("visibilitychange",this.onVisibilitychange),this.player.once("destroy",this.onDestroy)}},{key:"clearTimers",value:function(){var e=this.seekLog;e.intervalId&&window.clearTimeout(e.intervalId),this.stallIntervalId&&window.clearTimeout(this.stallIntervalId)}},{key:"sendDegradeLog",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"playCatch",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Ak("sendDegradeLog",e,t,i);var n=this.degradeLog;if(!(n.hasSendEnd||"playCatch_end"===e&&"none"===t)){"playCatch_end"===e&&(n.hasSendEnd=!0);var r=this.bu_acu_t-n.bu_acu_t;this.onOneEvent({costTime:this.vd,vid:this.vid,end_type:e,cur_play_pos:this.player.currentTime,cdn_url:i.url},ul({degrade:t,vt:this.vt,pt:this.pt,fvt:this.fvt,bc:this.bc-n.bc,bu_acu_t:r>SI?0:r,watch_dur:this.watchDur-n.watch_dur},i),0)}}},{key:"_getFullScreenType",value:function(){return this.player.isFullscreen?kI.FULLSCREEN_TYPE:this.player.isCssfullScreen?kI.CSS:kI.NO_FULLSCREEN}},{key:"getBufferTime",value:function(e){var t=0,i=0,n=e.video&&e.video.buffered;if(n){for(var r=n.length,o=0,a=0;a<r;a++)o+=n.end(a)-n.start(a);t=i=1e3*o}return{video:t,audio:i}}},{key:"updateAbrInfo",value:function(e,t,i){e.abr_general_info=t.generalInfo,e.abr_event_info.video_exit={local_time_ms:(new Date).getTime(),buffer_length:t.bufferLength,internet_speed:t.downloadSpeed,now_bitrate:t.nowBitrate,play_speed:i},t.getAbrPlayInfo&&(e.abr_play_info=t.getAbrPlayInfo())}},{key:"getPerformance",value:function(){return this.player.performance||{}}},{key:"setExt",value:function(){var e=this,t=this.player.ext||{};t.performance&&delete t.performance,Object.keys(t).map((function(i){"performance"!==i&&(e.exInfo[i]=t[i])}))}},{key:"onOneOperator",value:function(e){var t=e.costTime,i=e.operaType,n=e.stateBefore,r=e.stateAfter,o=e.endType,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,l=this.getLastInterval("lastOperaTime"),c={local_time:(new Date).getTime(),v:this.vid,opera_type:i,state_before:n,state_after:r,cost_time:t,end_type:o||this.end_type,cdn_url:this.url,resolution:this.resolution,last_interval:l,bufs:jk(this.buffers.allBuffer),cur_play_pos:this.cur_play_pos,retry_count:this._retryCount};"seek"===i&&(c.buf_include=this.seekLog.buf_include,this.seekLog.buf_include=0);var u=this.player;u&&u.dashState&&(c.dash_state=this.player.dashState),Object.keys(a).forEach((function(e){c[e]=a[e]})),this.addIfExist("drm_type",this._options,c),this.reportLog($k,c,s)}},{key:"onOneError",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{errorType:0,code:0,url:"",headers:{},costTime:0,vid:"",message:"",preload_hit:0,preload_cached:0,interval_time:0},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Ak("onOneError",t);var r=this.errorLog,o=this.apiLog,a=this.resLogs,s=this.player,l=this.playlogs,c=Uk(t.headers||{}),u=this.getPerformance(),h=t.code>0?0-t.code:t.code;this.setExt();var d=this._getCompatibilityInfo();this.setNovv(t,t.endState||cI);var f=ul(ul(ul({v:t.vid||this.vid,video_pos:this.cur_play_pos,local_time:(new Date).getTime(),cost_time:t&&t.costTime?t.costTime:0,errt:t.errorType,errc:h,es:this.es,cdn_url:t.url||this.url,bufs:jk(this.buffers.allBuffer),resolution:a.final_resolution,last_errors:r.last_errors.join(";"),vsc:o.vsc,vsc_message:t.message||o.vsc_message,server_ip:c.x_response_sinfo||0,initial_url:this.initial_url,initial_host:this.initial_host},c),{},{cur_play_pos:this.cur_play_pos},this.buffers.curBuffer),{},{degrade:l.degrade,end_state:t.endState||cI,preload_hit:t.preload_hit||0,preload_cached:t.preload_cached||0,ex:jk(this.exInfo),pref:jk(u),video_ready_s:this.videoReadyState,interval_time:t.interval_time||0},d);s&&s.dashState&&(f.dash_state=s.dashState);var p=this.player.currentSrc,g=Nk(p)?Nk(t.url)?this.initial_url:t.url:p,y={connectTime:0,status:0,statusText:"",isexpired:0,isBlob:Nk(p)?1:0};if(n&&"String"===Bk(g)){var v={};Ok(g,{range:"0-8",timeout:2e3}).then((function(e){Ak("getXhr>>check result ",e);var t=Uk(e.headers||{});f.server_ip=t.x_response_sinfo,v=ul(ul({},y),{},{statusText:e.statusText||"",status:e.status||0,connectTime:0|e.connectTime,sinfo:t.x_response_sinfo||"",cinfo:t.x_response_cinfo||""})})).catch((function(e){v=ul(ul({},y),{},{statusText:-2===e.status?"timeout":"error",status:e.status})})).finally((function(){var t=function(e){if(!e||"String"!==Bk(e))return 0;var t=0;try{var i=new RegExp("(\\?|&)x-tos-expires=([^&]*)(&|$)"),n=e.match(i);if(null!==n)t=parseInt(n[2],10);else{var r=e.split("/");r.length>5&&8===r[4].length&&(t=parseInt(r[4],16))}return t>0?t<parseInt((new Date).getTime()/1e3,10)?Kk:Wk:Vk}catch(hs){return Vk}}(g);v.isexpired=t,f.net=jk(v),e.reportLog(Xk,f,i)}))}else f.net=jk(y),this.reportLog(Xk,f,i)}},{key:"_getCompatibilityInfo",value:function(){var e=function(){if("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)return{support:!1,message:"MediaSource API not support"};for(var e=!1,t="",i=0;i<lw.length;i++){var n='video/mp4; codecs="'.concat(lw[i],'"'),r=MediaSource.isTypeSupported(n);t+="".concat(n," is ").concat(r," "),r&&(e=!0)}return{support:e,message:t}}();return{is_spider:hw.isSpider?1:0,is_support_mp4:hw.isSupportMP4?1:0,is_support_hevc:dw()?1:0,is_support_mse_mp4:e.support?1:0,support_mse_mp4:e.message}}},{key:"reportLog",value:function(t,i,n){var r=this,o=this._options,a=this.player.ABTestTag,s=this.commonParams;i.dynamic_type=this.dynamicType;var l="Array"===Bk(o.absdkVersion)?o.absdkVersion.join(","):o.absdkVersion;i.absdkVersion=l||e.AB_SDK_VERSION,null!=a&&(i.abtest_tag=a);var c=this._options;i.codec_type=this.codecType,Sw(c)&&(CI.forEach((function(e){r.addIfExist(e,c,i)})),Object.keys(s).forEach((function(e){r.addIfExist(e,s,i)})),i.vtype=this.vtype),i.env_info=jk(this._envInfo||{}),i.support=pw(),i.visible="undefined"==typeof document?0:"visible"===document.visibilityState?1:0;var u=function(){if(1===n){var e={};return e[t]=i,void DI.set(e)}2!==n?(r.player&&r.player.emit("abLog",t,i),r._track(t,i)):r.addEventsQueue(t,i)};if("function"==typeof o.onReportLog){var h=o.onReportLog(t,i);null!=h&&h.then?h.finally((function(){return u()})):u()}else u()}},{key:"addEventsQueue",value:function(e,t){this.eventQueue.push({event:e,params:t}),this.eventQueue.length>=this._options.maxQueueCount&&this.sendEventsQueue()}},{key:"sendEventsQueue",value:function(){for(;this.eventQueue.length>0;){var e=this.eventQueue.pop();this._track(e.event,e.params)}}},{key:"startWaitingStatus",value:function(e,t){this.appendStallInfo("start",e),this.updateCurBuffer("startWaitingStatus"),this.onOneEvent({costTime:t,end_type:"waitstart"},{},2)}},{key:"triggerTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"start",t=arguments.length>1?arguments[1]:void 0;Ak("triggerTask>>",e),!Lk(t=t||this.player.src)&&this.vtype.indexOf("MP4")>-1&&this.task&&this.task.trigger(t,e)}},{key:"appendStallInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"start",t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;this.exInfo.stall||(this.exInfo.stall=[]);var n=this.exInfo.stall;if("start"===e){n.length>6&&n.splice(0,n.length-6);var r=this.buffers.curBuffer;n.push({start:t,end:-1,endType:"waitstart",cost:0,cur:this.cur_play_pos,buf_s:r.buf_s_pos,buf_e:r.buf_e_pos,buf_i:r.buf_include})}else if("end"===e){var o=n.length-1;if(o<0)return;n[o].end<0&&(n[o].end=t,n[o].endType=i,n[o].cost=t-n[o].start)}Ak("appendStallInfo",n)}},{key:"suspendWaitingStatus",value:function(e){var t=Rk(),i=this.playlogs,n=this.resLogs,r=this.stall,o=this.inWaitingStart;if(!(o<=0||this.isSeeking||i.vt<=0)){if(Ak("suspendWaitingStatus>>".concat(e,"|costTime:").concat(t-o," isSeeking:").concat(this.isSeeking)),this.appendStallInfo("end",t,e),t-o>200){var a=t-this.inWaitingStart;if(i.bc++,this.checkInBuffer(this.player.currentTime)?(i.de_bu_acu_t+=a,i.dbc++):(i.nbc++,i.n_bu_acu_t+=a),n.bc++,i.bu_acu_t+=a,n.bu_acu_t+=a,r.end=this.cur_play_pos,r.cost=a,r.acc+=r.cost,1===r.sc&&(r.endf=this.cur_play_pos),this.player.abrInstance&&!this.isSeeking&&this.playlogs.vt){var s=this.player.abrInstance;this.abrInfo.abr_event_info.video_stall.push({local_time_ms:(new Date).getTime(),stall_duration:parseFloat((a/1e3).toFixed(2)),buffer_length:s.bufferLength,internet_speed:s.downloadSpeed,now_bitrate:s.nowBitrate,play_speed:this.player.playbackRate,is_abr:s.isCurrentInAbr?1:0})}this.onOneEvent({costTime:a,end_type:"waitend_".concat(e)||"waitend"},{},2)}this._endType="",this.load_state=aI,this.inWaitingStart=0,this.waitStartTime=0,window.clearTimeout(this.stallIntervalId),this.stallIntervalId=null}}},{key:"suspendSeekStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isSeeking){var i=this.seekLog,n=this.resLogs,r=this.player,o=Rk()-i.lastSeekStartTime;Ak("suspendSeekStatus>>","".concat(e," currentTime:").concat(r.currentTime," costTime:").concat(o," sat:").concat(i.sat," resLogs.sat:").concat(n.sat)),i.intervalId&&window.clearTimeout(i.intervalId),i.intervalId=null,this.isSeeking=!1;var a=this._endType="seek",s=i.seekBefore,l=(r.currentTime||0).toString();i.sc++,i.sat+=o>bI?0:o,n.sc++,n.sat+=o>bI?0:o,o>bI&&(o=bI),this.updateSeekPt(!0),!this.closeSeekLog&&t&&this.onOneOperator({costTime:o,operaType:a,stateBefore:s,stateAfter:l,endType:e})}}},{key:"setPt",value:function(){var e=this.playlogs;this.startStep=1,!e.pt&&this.player.currentTime&&(this.isSeeking=!0),e.pt||(e.pt=xk(),Ak("setPt","init pt :".concat(e.pt,", document.visibilityState:").concat(document.visibilityState)))}},{key:"setVt",value:function(){var e=this.playlogs;1===this.startStep&&(e.vt||(e.vt=xk(),Ak("setVt: first frame inited","vt-pt:".concat(e.vt-e.pt," vt-nt:").concat(e.vt-e.nt))),this.startStep=2)}},{key:"setBr",value:function(e){var t=this.playlogs;t.vt>0&&(0===t.br&&(t.fbrt=e||""),t.br++)}},{key:"codecType",get:function(){var e=this.player;return e&&e.config&&e.config.codecType?e.config.codecType:this._options.codec_type||"h264"}},{key:"url",get:function(){var e=this.player;return e&&e.config?e.config.url:""}},{key:"vid",get:function(){var e=this.player;return e&&e.config?e.config.vid:""}},{key:"bc",get:function(){return this.playlogs.bc}},{key:"bu_acu_t",get:function(){var e=this.playlogs.bu_acu_t;return e>SI?0:e}},{key:"pt",get:function(){return this.playlogs.pt||xk()}},{key:"vt",get:function(){var e=this.playlogs,t=e.vt;return e.pt>0?t:0}},{key:"fvt",get:function(){var e=this.playlogs,t=e.vt,i=e.pt,n=0;return t>0&&i>0&&(n=parseInt(t-i,10)),n>6e4?6e4:n}},{key:"nvt",get:function(){var e=this.playlogs,t=e.vt,i=e.nt;return t>0&&i>0?parseInt(t-i,10):0}},{key:"getFrameInfo",value:function(){if(this.player&&this.player.videoFrameInfo){var e=this.player.videoFrameInfo,t=e.dropped,i=e.corrupted,n=e.droppedRate;return{f_total:e.total,drop_count:t,drop_rate:n,corrupted:i}}return{f_total:0,drop_count:0,drop_rate:0,corrupted:0}}},{key:"vd",get:function(){var e=this.player;return e.duration&&"number"==typeof e.duration&&e.duration>0?parseInt(1e3*e.duration,10):e.config.duration&&"number"==typeof e.config.duration?parseInt(1e3*e.config.duration,10):0}},{key:"cur_play_pos",get:function(){return parseInt(1e3*this.player.currentTime,10)}},{key:"volume",get:function(){return this.player.volume}},{key:"buffer_time",get:function(){var e=0;try{var t=this.player.getBufferedRange();e=t[1]-t[0]}catch(hs){e=0}return e}},{key:"player_created_t",get:function(){return this._playerCreatedTime}},{key:"playbackRate",get:function(){return this.player.playbackRate}},{key:"mute",get:function(){return this.player.muted?0:1}},{key:"videoWidth",get:function(){var e=this.player;return e&&e.video?e.video.videoWidth:0}},{key:"videoHeight",get:function(){var e=this.player;return e&&e.video?e.video.videoHeight:0}},{key:"preload",get:function(){var e=this.player;return!(!e||!e.video)&&e.video.preload}},{key:"initial_url",get:function(){var e=this.player.currentSrc;return e.indexOf("blob:")>-1&&this.urlLog.initial_url?this.urlLog.initial_url:Lk(e)?"":e}},{key:"initial_host",get:function(){var e=this.player.currentSrc;return e.indexOf("blob:")>-1&&this.urlLog.initial_host?this.urlLog.initial_host:Dk(Lk(e)?"":e)}},{key:"curHeaders",get:function(){var e=this.player,t=this.task;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?Uk(e.__dash__.curReqVideoSegInfo.headers||{}):t?t.headers:{}}},{key:"curStatus",get:function(){var e=this.task,t=this.vtype,i=this.netLog;return t.indexOf("MP4")>-1?e?e.status:0:i.status}},{key:"play_type",get:function(){return 0}},{key:"resolution",get:function(){var e=this.player.curDefinition;return e?"".concat(e.definition):this.resLogs.df}},{key:"sessionId",get:function(){return this._sessionId}},{key:"finish",get:function(){return this.isEnded?1:0}},{key:"end_type",get:function(){return this._endType}},{key:"avgSpeed",get:function(){return this.player&&this.player.avgSpeed?this.player.avgSpeed:0}},{key:"realSpeed",get:function(){return this.player&&this.player.realTimeSpeed?this.player.realTimeSpeed:0}},{key:"mp4MseOpLength",get:function(){if(!this.player||!this.player.plugins)return-1;var e=this.player.plugins.mp4encryptplayer;return e?e.opQueueLen||0:-1}},{key:"mp4LoadSegmentTimeRange",get:function(){if(!this.player||!this.player.plugins)return"";var e=this.player.plugins.mp4encryptplayer;return e?e.loadSegmentTimeRange.join(","):""}},{key:"preLoadData",get:function(){if(!this.player||!this.player.plugins)return[];var e=this.player.plugins.mp4encryptplayer;if(e&&e.preLoadData)return{hit:1,duration:e.preLoadData.duration,length:e.preLoadData.byteLength};var t=this.player.stat||{};if(t.preLoadData){var i=t.preLoadData.length;return{hit:i>0,length:i}}return{hit:0,duration:0,length:0}}},{key:"preloadState",get:function(){if(!this.player||!this.player.plugins)return 0;if(void 0!==this.player.preloadState)return this.player.preloadState||0;var e=this.player.plugins.mp4encryptplayer;return e&&e.preloadState?e.preloadState:0}},{key:"curBitrate",get:function(){var e=this.player,t=e.config,i=e.curDefinition;return i&&i.bitrate?i.bitrate:t.defaultBitrate?t.defaultBitrate:0}},{key:"videoReadyState",get:function(){var e=this.player;return e&&e.video?e.video.readyState:-1}},{key:"videoSeeking",get:function(){var e=this.player;return e&&e.video&&e.video.seeking?1:0}},{key:"videoPaused",get:function(){var e=this.player;return e&&e.video&&e.video.paused?1:0}},{key:"switchResolutionCount",get:function(){return this.resLogs.switch_count}},{key:"isError",get:function(){return this.player._isError||this.player.video.error}},{key:"isPlaying",get:function(){return Fk(this.player.root,"xgplayer-playing")}},{key:"isStop",get:function(){return Fk(this.player.root,"xgplayer-ended")||Fk(this.player.root,"xgplayer-nostart")}},{key:"isPause",get:function(){return Fk(this.player.root,"xgplayer-pause")}},{key:"isLoading",get:function(){return Fk(this.player.root,"xgplayer-isloading")}},{key:"es",get:function(){return this.isPlaying?"playing":"beforePlay"}},{key:"lt",get:function(){var e=0;return 0===this.vt&&(Ak("lt init",this.playlogs.lt),e=xk()),e}},{key:"lpt",get:function(){return this.lt?this.lt-this.pt:0}},{key:"playback_state",get:function(){return this.isError?nI:this.isStop?eI:this.isPause?iI:this.isLoading?rI:tI}},{key:"is_start_play_automatically",get:function(){return"".concat(this.isAutoplay)}},{key:"watchDur",get:function(){var e=this.player,t=this.playlogs,i=e.cumulateTime?e.cumulateTime:Pk(t.played);return i>=0?i>SI?SI:i:0}},{key:"vtype",get:function(){if(this.__vtype)return this.__vtype;var e=this.player?this.player.vtype||this.player.config.vtype:"";return e||(this.player.dash?"DASH":this._options.vtype||"MP4")},set:function(e){this.__vtype=e}},{key:"envInfo",get:function(){return this._envInfo},set:function(e){e&&(this._envInfo=e)}},{key:"getPlayerExt",value:function(){var e=this.player.ext;if(e)return e}},{key:"watingCost",get:function(){if(this.inWaitingStart>0){var e=Rk()-this.inWaitingStart;return e>bI?0:e}return 0}},{key:"videoNetworkState",get:function(){var e=this.player;return e&&e.video?e.video.networkState:-1}},{key:"eagleid",get:function(){var e=this.player;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?(e.__dash__.curReqVideoSegInfo.headers||{}).eagleid:""}},{key:"initial_type",get:function(){var e=this.player.config||{};return e&&e.vodLogOpts&&void 0!==e.vodLogOpts.currentDashType?parseInt(e.vodLogOpts.currentDashType,10):-1}},{key:"dynamicType",get:function(){var e=this.player;return this.__dt?this.__dt:e&&e.__dash__&&e.__dash__.dash&&e.__dash__.dash.mpd?(this.__dt=e.__dash__.dash.mpd.dashType,this.__dt):""}},{key:"updateBuffers",value:function(){var e=this.player.buffered,t=[];if(!e||e.length<1)this.buffers.allBuffer=[];else{for(var i=0;i<e.length;i++){var n=parseInt(1e3*e.start(i),10),r=parseInt(1e3*e.end(i),10);t.push({s:n,e:r})}this.buffers.allBuffer=t}}},{key:"updateCurBuffer",value:function(e){var t=this.player,i=t.buffered,n=t.currentTime,r={buf_s_pos:0,buf_e_pos:0,buf_include:0,buf_diff:0};if(!i||i.length<1)return r;for(var o=-1,a=-1,s=parseInt(1e3*n,10),l=i.length-1;l>-1;l--){var c=parseInt(1e3*i.start(l),10),u=parseInt(1e3*i.end(l),10);if(s>=c&&s<=u){r.buf_include=1,r.buf_s_pos=c,r.buf_e_pos=u,r.buf_diff=u-s;break}s<c&&(o<0||c-s<o)?(o=c-s,a=l):s>u&&(o<0||s-u<o)&&(o=s-u,a=l)}1!==r.buf_include&&(a<0&&(a=i.length-1),r.buf_s_pos=parseInt(1e3*i.start(a),10),r.buf_e_pos=parseInt(1e3*i.end(a),10)),this.buffers.curBuffer=r}},{key:"checkInBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.player.buffered;if(!i)return!1;e=parseInt(1e3*e,10);for(var n=0;n<i.length;n++){var r=parseInt(1e3*i.start(n),10),o=parseInt(1e3*i.end(n),10)+t;if(e>r&&e<o)return!0}return!1}},{key:"getPCDNStat",value:function(){if(this.player&&this.player.pcdnVVStat){var e=this.player.pcdnVVStat,t=e.try_req_num,i=e.req_node_succ,n=e.conn_req_num;return ul({try_req:t,req_succ:i,has_ret:e.has_ret_node,conn_req:n,conn_fail:e.conn_fail_num,conn_jump:e.conn_jump_num},yl(e,Ew))}return{}}},{key:"updateVideoSize",value:function(){var e=this._options,t=this.player,i=this.resLogs,n=0,r=0;if(t.__dash__&&t.__dash__.dash&&t.__dash__.dash.mpd.mediaList){var o=t.__dash__.dash.mpd.mediaList.video,a=o[o.selectedIdx];Ak("updateVideoSize》》videoItem",a),r=a?a.bitrate||a.bandwidth:0,n=a?a.size:0}else{var s=this.player.curDefinition;s?(r=s.bitrate||t.config.bitrate||0,n=parseInt(s.bitrate*t.duration/8,10)):(n=e.videoSize||t.config.videoSize||0,r=e.bitrate||t.config.bitrate||0)}Ak("updateVideoSize","bitrate:".concat(r,", vs:").concat(n)),n&&(i.vs=n,i.vis=parseInt(n/t.duration,10),i.bitrate=r||i.vis)}},{key:"updateVds",value:function(){var e=this.resLogs,t=this.playlogs,i=this.player;if(0!==e.vis){for(var n=parseInt(Pk(t.played)/1e3,10),r=i.buffered,o=0,a=0;a<r.length;a++)o+=parseInt(r.end(a)-r.start(a),10);Ak("updateVds","pdur:".concat(n," bdur:").concat(o," \n lbuf:").concat(e.lbuf," lplayed:").concat(e.lplayed," bitrate: ").concat(e.bitrate," vis:").concat(e.vis," vs:").concat(e.vs)),e.lplayed=n,e.lbuf=o}else Ak("updateVds","vis:".concat(e.vis))}},{key:"encryptedInfo",get:function(){return this.player.encryptedInfo||{encryptedType:0}}}],[{key:"TEA_ID",get:function(){return bw},set:function(e){Cw="__tea_cache_tokens_".concat(bw=e)}},{key:"AB_SDK_VERSION",get:function(){return kw},set:function(e){kw="Array"===Bk(e)?e.join(","):e}},{key:"Collector",set:function(e){Iw=e}},{key:"defaultConfig",value:function(){return{line_app_id:"",line_user_id:"",isTask:!1,codec_type:"",playerCoreVersion:"",playerVersion:"",start_time:0,maxQueueCount:5,channel:"cn",channelDomain:"",absdkVersion:"",checkByInnerLog:!0,drm_type:0,vtype:"MP4",tag:"普通视频",subtag:"",dynamic_type:"",sendLocalCallback:function(){},disableLocalCache:!1,closeResolutionLog:!1,closeSeekLog:!1,needXhrCheck:!1,trackerConfig:{},envInfo:{},enableTeaWebId:!1,enableBeacon:!1}}}]),e}();const Dw=null==(e=il())?void 0:e.__LOG_TEA_ID__;function ww(e){let t={};const i=(i,n)=>{const r=(e=>Object.assign({},t,null!=e?e:{}))(n);as.log("veplayer sendLog",i,r),e(i,r)};function n(e,t){i(e,t)}return n.init=e=>{},n.config=e=>{const i=null==e?void 0:e.evtParams;i&&"object"==typeof i&&(t=c({},i))},n.start=()=>{},n.event=(e,t)=>{i(e,t)},n.beaconEvent=(e,t)=>{i(e,t)},n}function Aw(){var e;const t=null==(e=rB.ttDramaEnv)?void 0:e.sendLog;return"function"==typeof t?t:void 0}Pw.TEA_ID=Dw,Pw.Collector=function(e){const t=Aw();if(t)return ww(t);const i=Bs();return i?new i(e):void 0};const Rw="beforePlayerCreate.authtoken.getVideoInfo.getVideos",xw=`${Rw}.getDramaInfoViaJSB.perfInfo`,Ow={prepareCost:`${xw}.prepareCost`,requestCost:`${xw}.requestCost`,parseCost:`${xw}.parseCost`,totalCost:`${xw}.totalCost`};function Lw(e,t){var i;const n=null==(i=null==e?void 0:e.timingMap)?void 0:i[t];return Number.isFinite(n)?n:0}const Nw=function(e){if(e&&e.player){const t=(t,i)=>d(this,null,(function*(){var n,r,o;const a=e.player;i.player_sum_num=function(e){var t,i;let n=0;return null==(i=null==(t=null==e?void 0:e.instManager)?void 0:t.forEach)||i.call(t,(()=>(n++,!0))),n}(a),i.is_mse=Ls(a),i.drm_encrypt_type=al(a)||"",i.initial_url=Ur.isBlob(i.initial_url)&&a.config.url||i.initial_url,i.album_id=a.config.albumId||"",i.episode_id=a.config.episodeId||"",i.client_key=(null==(n=rB.ttDramaEnv)?void 0:n.clientKey)||"";const s=function(e){var t,i;return null==(i=null==(t=null==e?void 0:e.sdk)?void 0:t.getCreatePlayerPerfReport)?void 0:i.call(t)}(a),l=Lw(s,Rw);const c=function(e){const t=null==e?void 0:e.totalDuration;return Number.isFinite(t)?t:0}(s);if(i.server_fetch_duration=l,Object.assign(i,function(e){return{server_fetch_prepare_cost:Lw(e,Ow.prepareCost),server_fetch_request_cost:Lw(e,Ow.requestCost),server_fetch_parse_cost:Lw(e,Ow.parseCost),server_fetch_total_cost:Lw(e,Ow.totalCost)}}(s)),i.create_player_total_duration=c,i.prepare_play=c-l,i.is_preload_enabled=2===rB.preloaderStatus,t===zk||t===Xk){const e=null==a?void 0:a.veError;0!==i.errc&&e?(i.ve_error_code=(null==e?void 0:e.veErrorCode)||0,i.ve_error_type=(null==e?void 0:e.veErrorType)||"",i.ve_error_message=(null==e?void 0:e.veErrorMessage)||"",i.ve_error_ext=JSON.stringify((null==e?void 0:e.ext)||"")):(i.ve_error_code=0,i.ve_error_type="",i.ve_error_message="",i.ve_error_ext=""),i.licenseStatus=(null==(r=null==a?void 0:a.licenseLogInfo)?void 0:r.licenseStatus)||"",i.licenseType=(null==(o=null==a?void 0:a.licenseLogInfo)?void 0:o.licenseType)||""}})),i=Object.assign({onReportLog:t},e.player.config.vodLogOpts||{});e.player.vodLogger=new Pw(e.player,i),e.player.plugins.xgVodLogger=e.player.vodLogger}else this.vodLogger=new Pw(this,this.config.vodLogOpts||{})};Nw.pluginName="__xgVodLogger",Nw.playerConfig={},Nw.Collector=Pw.Collector,Nw.setABSdkVersion=e=>{Pw.AB_SDK_VERSION=e};const Mw=Ui((function(e,t,i){Ii(e,t,i)}));class Uw{constructor(e){this.isLive=e.configs.isLive,this.playerData=e.playerData,this.streamType=e.streamType}}const Bw={"@byted/streamprobe":"1.0.2","@byted/volcengine-vestrategy":"1.1.0-rc.71","@byted/volcengine-vestrategy-adapt-range":"1.1.0-rc.0","@byted/volcengine-vestrategy-h265":"1.1.0-rc.0","@byted/volcengine-vestrategy-preload":"1.1.0-rc.3","@byted/xgplayer-encrypt":"3.5.29-rc.1","@byted/xgplayer-encrypt-hls":"4.2.0","@byted/xgplayer-encrypt-mp4":"3.0.31-alpha.1","@byted/xgplayer-vod-abralgo":"1.0.5","@byted/xgplayer-vod-preload":"1.0.9-rc.3","@byted/xgplayer-xgvideo":"0.2.5-rc.3","xgplayer-flv":"3.0.23-rc.6","xgplayer-hls":"3.0.24-rc.18"};var Fw=(e=>(e.HLS="hls",e.HLSJS="hlsjs",e.FLV="flv",e.XGVideo="XGVideo",e.HLSEncrypt="hlsEncrypt",e.DASH="dash",e.MP4Encrypt="mp4Encrypt",e.DanmuJS="danmujs",e.DanmuMask="danmuMask",e.StreamProbe="streamprobe",e.VeStrategy="vestrategy",e.VeStrategyH265="vestrategy_h265",e.VeStrategyPreload="vestrategy_preload",e.VeStrategyAdaptRange="vestrategy_adapt_range",e.DashAbralgo="DashAbralgo",e.Preloader="preloader",e.HLSjsPro="hlsjsPro",e))(Fw||{});const Hw={[Fw.HLS]:{name:"HlsPlayer",pluginName:"hls",packageName:"xgplayer-hls",devPath:`xgplayer-hls@${Bw["xgplayer-hls"]}/dist/index.min.js`},[Fw.FLV]:{name:"FlvPlayer",pluginName:"flv",packageName:"xgplayer-flv",devPath:`xgplayer-flv@${Bw["xgplayer-flv"]}/dist/index.min.js`},[Fw.XGVideo]:{name:"XGVideo",packageName:"@byted/xgplayer-xgvideo",devPath:`@byted/xgplayer-xgvideo@${Bw["@byted/xgplayer-xgvideo"]}/dist/index.min.js`},[Fw.HLSEncrypt]:{name:"EncryptHlsPlugin",pluginName:"EncryptHlsPlugin",packageName:"@byted/xgplayer-encrypt-hls",devPath:`@byted/xgplayer-encrypt-hls@${Bw["@byted/xgplayer-encrypt-hls"]}/dist/index.min.js`},[Fw.DASH]:{name:"DashPlugin",pluginName:"DASHPlugin",packageName:"@byted/xgplayer-encrypt",devPath:`@byted/xgplayer-encrypt@${Bw["@byted/xgplayer-encrypt"]}/dist/index.min.js`},[Fw.MP4Encrypt]:{name:"Mp4EncryptPlayer",pluginName:"Mp4EncryptPlayer",packageName:"@byted/xgplayer-encrypt-mp4",devPath:`@byted/xgplayer-encrypt-mp4@${Bw["@byted/xgplayer-encrypt-mp4"]}/dist/index.min.js`},[Fw.StreamProbe]:{name:"StreamProbe",pluginName:"streamprobe",packageName:"@byted/streamprobe",devPath:`@byted/streamprobe@${Bw["@byted/streamprobe"]}/dist/index.min.js`},[Fw.VeStrategyH265]:{name:"__VESTRATEGY_STRATEGY_H265__",packageName:"@byted/volcengine-vestrategy-h265",devPath:`@byted/volcengine-vestrategy-h265@${Bw["@byted/volcengine-vestrategy-h265"]}/umd/vestrategy.strategy.h265.production.js`},[Fw.VeStrategy]:{name:"VeStrategy",packageName:"@byted/volcengine-vestrategy",devPath:`@byted/volcengine-vestrategy@${Bw["@byted/volcengine-vestrategy"]}/umd/vestrategy.production.js`},[Fw.VeStrategyPreload]:{name:"__VESTRATEGY_STRATEGY_PRELOAD__",packageName:"@byted/volcengine-vestrategy-preload",devPath:`@byted/volcengine-vestrategy-preload@${Bw["@byted/volcengine-vestrategy-preload"]}/umd/vestrategy.strategy.preload.production.js`},[Fw.VeStrategyAdaptRange]:{name:"__VESTRATEGY_STRATEGY_ADAPT_RANGE__",packageName:"@byted/volcengine-vestrategy-adapt-range",devPath:`@byted/volcengine-vestrategy-adapt-range@${Bw["@byted/volcengine-vestrategy-adapt-range"]}/umd/vestrategy.strategy.adapt-range.production.js`},[Fw.DashAbralgo]:{name:"DashAbralgo",packageName:"@byted/xgplayer-vod-abralgo",devPath:`@byted/xgplayer-vod-abralgo@${Bw["@byted/xgplayer-vod-abralgo"]}/dist/index.min.js`},[Fw.Preloader]:{name:"XGPlayerPreload",packageName:"@byted/xgplayer-vod-preload",devPath:`@byted/xgplayer-vod-preload@${Bw["@byted/xgplayer-vod-preload"]}/dist/index.min.js`}},jw={h265:Fw.VeStrategyH265,preload:Fw.VeStrategyPreload,adaptRange:Fw.VeStrategyAdaptRange},Vw={setImportedPlugins(e,t){e.importedPlugins=t},prepareStrategyLoad(e){"undefined"!=typeof window&&window.VeStrategy&&(window.__VESTRATEGY_BASE__||(window.__VESTRATEGY_BASE__=window.VeStrategy),window.__VESTRATEGY_STRATEGY_PRELOAD__||e.clearPluginCache(Fw.VeStrategyPreload))},loadVeStrategy(e){return d(this,null,(function*(){return e.loadPlugins(Fw.VeStrategy)}))},loadStrategy(e,t){return d(this,null,(function*(){return e.loadPlugins(jw[t])}))},loadPreloader(e){return d(this,null,(function*(){return e.loadPlugins(Fw.Preloader)}))},loadMp4Encrypt(e){return d(this,null,(function*(){return e.loadPlugins(Fw.MP4Encrypt)}))},loadHlsjsPro(e){return d(this,null,(function*(){return e.loadPlugins(Fw.HLSjsPro)}))}};let Kw=!1;class Ww extends Uw{constructor(e){super(e)}applyAbrPluginConfig(e,t){e.Mp4EncryptPlayer=u(c({},e.Mp4EncryptPlayer),{autoBitrateOpts:t})}prepareAbrModule(e,t){return d(this,null,(function*(){var i;const n=null==(i=e.configs)?void 0:i.autoBitrateOpts;e.isOpenABR()&&!(null==n?void 0:n.module)&&e.updateConfigs({autoBitrateOpts:u(c({},n),{module:yield t.loadPlugins(Fw.DashAbralgo)})})}))}needAbrAutoDefinition(){return!1}setAbrDefaultDefiWithAuto(){return!1}generatePlaylistFromServer(e){Kw=!0;const{playList:t=[]}=e||{};return[...t||[]]}useNativeAbr(){return!1}canOpenAbr(e){var t;if(this.playerData.isVidPlay()&&e){const{playList:t=[]}=e;if(!(t.length>1))return Kw&&as.warn("The obtained media information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether there are more than 1 video."),Kw=!1,!1}return!((null==(t=Kr.os)?void 0:t.isIos)&&!Qs())}canAdaptRangeEnable(){var e;return!((null==(e=Kr.os)?void 0:e.isIos)&&!Qs())}adaptRangeDefaultOptions(){return{maxTargetCacheDur:30,minTargetCacheDur:12,rangeMaxDuration:15,rangeMinDuration:5,cacheSafeFactor:2,estPTcontrol:!0,estPlayTime:12,minBandwidth:1e6,minDangerThreshold:3,rangeControl:!0,rangeMinSize:409600,safeFactor:.1,targetCacheControl:!0}}applyAdaptRangePluginConfig(e,t){e.Mp4EncryptPlayer=u(c({},e.Mp4EncryptPlayer),{adaptRange:t})}applyAdaptRangeStrategy(e,t){var i,n;e.Mp4EncryptPlayer=u(c({},e.Mp4EncryptPlayer),{adaptRange:c(c(c({},this.adaptRangeDefaultOptions()),null!=(n=null==(i=e.Mp4EncryptPlayer)?void 0:i.adaptRange)?n:{}),t)})}getPlugins(e){return d(this,null,(function*(){var t;const{configs:i,openSoftDecoding:n,isVidEncrypt:r,drmType:o}=this.playerData,a=[or.PRIVATE_ENCRYPT_UPGRADE,or.PRIVATE_ENCRYPT].includes(o);if(i.enableMp4MSE||r||(null==(t=null==i?void 0:i.autoBitrateOpts)?void 0:t.enable)||n||a){return[yield Vw.loadMp4Encrypt(e)]}return[]}))}setPluginConfigInVid(e,t){var i;const{vid:n,defaultDefinitionData:r}=e,{config:o,privateDrmAuthToken:a,sessionId:s,useUnionInfoDRM:l}=t,u=!!r.kid,{autoBitrateOpts:h,Mp4EncryptPlayer:d,enableMp4MSE:f}=this.playerData.configs,p=this.playerData.drmType===or.PRIVATE_ENCRYPT_UPGRADE;if(u||(null==h?void 0:h.enable)||d||f){const{kid:e,secretKey:t}=r,h=null==(i=this.playerData.configs)?void 0:i.Mp4EncryptPlayer,d="object"==typeof h?h:{};if(u){if(p)this.playerData.options.Mp4EncryptPlayer=c({vid:n,kid:e,isEncrypt:!0,rangeMaxDuration:10,keyTokenExpiredDuration:9999999,retryCount:3,useUnionInfoDRM:!0,sessionId:this.playerData.encryptSessionId,drmType:or.PRIVATE_ENCRYPT_UPGRADE,preferMMS:!0,secretKey:t},d);else if(a&&s){const t=_s(a),i=parseInt(""+t["X-Expires"]),r=isNaN(i)?30:i;this.playerData.options.Mp4EncryptPlayer=c({vid:n,kid:e,isEncrypt:!0,rangeMaxDuration:10,retryCount:3,drmKeyToken:a,useUnionInfoDRM:l,keyTokenExpiredDuration:r,preferMMS:!0,sessionId:s,playDomain:o.playDomain||this.playerData.playDomain},d)}}else this.playerData.options.Mp4EncryptPlayer=c({vid:n,retryCount:3,preferMMS:!0},d)}}}let Gw=!1;class Yw extends Uw{applyAbrPluginConfig(e,t){e.DASHPlugin=u(c({},e.DASHPlugin),{autoBitrateOpts:t})}prepareAbrModule(e,t){return d(this,null,(function*(){var i;const n=null==(i=e.configs)?void 0:i.autoBitrateOpts;e.isOpenABR()&&!(null==n?void 0:n.module)&&e.updateConfigs({autoBitrateOpts:u(c({},n),{module:yield t.loadPlugins(Fw.DashAbralgo)})})}))}needAbrAutoDefinition(){return!1}setAbrDefaultDefiWithAuto(){return!1}useNativeAbr(){return!1}canOpenAbr(e){if(this.playerData.isVidPlay()&&e){const{enableAdaptive:t,adaptiveBitrateStreamingInfo:i,playList:n=[]}=e;if(!(n.length>2&&t&&i))return Gw&&as.warn("The obtained media information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether the video contains ABR transcoding products."),Gw=!1,!1}return!0}canAdaptRangeEnable(){var e;return!(null==(e=Kr.os)?void 0:e.isIos)}generatePlaylistFromServer(e){Gw=!0;const{playList:t=[]}=e||{};return t.filter((e=>e.FileType===ys.VIDEO))}adaptRangeDefaultOptions(){return{maxTargetCacheDur:60,minTargetCacheDur:50,rangeMaxDuration:15,rangeMinDuration:5,cacheSafeFactor:2,estPTcontrol:!0,estPlayTime:12,minBandwidth:1e6,minDangerThreshold:3,rangeControl:!0,rangeMinSize:409600,safeFactor:.1,targetCacheControl:!0}}applyAdaptRangePluginConfig(e,t){var i;e.DASHPlugin=u(c({},null!=(i=e.DASHPlugin)?i:{}),{adaptRange:t})}applyAdaptRangeStrategy(e,t){var i,n;e.DASHPlugin=u(c({},e.DASHPlugin),{adaptRange:c(c(c({},this.adaptRangeDefaultOptions()),null!=(n=null==(i=e.DASHPlugin)?void 0:i.adaptRange)?n:{}),t)})}getPlugins(e){return d(this,null,(function*(){var t,i;const n=yield e.loadPlugins(Fw.DASH);return(null==(i=null==(t=null==n?void 0:n.encryptUtils)?void 0:t.isSupported)?void 0:i.call(t))?[n]:(as.warn("current browser is not supported DASHPlugin"),[])}))}setPluginConfigInVid(e,t){var i;const{vid:n,playList:r=[],dashOpts:o,defaultDefinitionData:a}=e||{},{config:s,privateDrmAuthToken:l,sessionId:u,useUnionInfoDRM:h}=t,d=c({},(null==(i=this.playerData.configs)?void 0:i.DASHPlugin)||{}),{kid:f,secretKey:p}=a,g=this.playerData.drmType===or.PRIVATE_ENCRYPT_UPGRADE,y=o.Data.PlayInfoList.reduce(((e,t)=>{const i=t.Definition||t.Quality;let n="";const o=r.find((e=>e.Definition===i||e.Quality===i));return o&&(n=o.definition),e[i]=n,e}),{});if(this.playerData.dashOpts=o,g)this.playerData.options.DASHPlugin=c({playInfoType:"TOP",useEME:!0,keyTokenExpiredDuration:9999999,useUnionInfoDRM:!0,defaultFormat:"dash",replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3,vid:n,definitionText:y,defaultDefinition:a.definition,kid:f,dashOpts:o,drmType:or.PRIVATE_ENCRYPT_UPGRADE,secretKey:p,sessionId:this.playerData.encryptSessionId,playDomain:s.playDomain||this.playerData.playDomain},d);else if(l&&u&&this.playerData.drmType!==or.DRM_ENCRYPT){const e=_s(l),t=parseInt(""+e["X-Expires"]),i=isNaN(t)?30:t;this.playerData.options.DASHPlugin=c({playInfoType:"TOP",vid:n,dashOpts:o,defaultFormat:"dash",definitionText:y,defaultDefinition:a.definition,useUnionInfoDRM:h,kid:f,keyTokenExpiredDuration:i,sessionId:u,drmKeyToken:l,playDomain:s.playDomain||this.playerData.playDomain,replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3},d)}else this.playerData.options.DASHPlugin=c({vid:n,dashOpts:o,playInfoType:"TOP",defaultFormat:"dash",definitionText:y,defaultDefinition:a.definition,replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3},d)}}var zw=/\s/;var $w=/^\s+/;function Xw(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&zw.test(e.charAt(t)););return t}(e)+1).replace($w,""):e}var qw=NaN,Zw=/^[-+]0x[0-9a-f]+$/i,Qw=/^0b[01]+$/i,Jw=/^0o[0-7]+$/i,eA=parseInt;function tA(e){if("number"==typeof e)return e;if(Cn(e))return qw;if(A(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=A(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xw(e);var i=Qw.test(e);return i||Jw.test(e)?eA(e.slice(2),i?2:8):Zw.test(e)?qw:+e}const iA=function(){return _.Date.now()};var nA="Expected a function",rA=Math.max,oA=Math.min;function aA(e,t,i){var n,r,o,a,s,l,c=0,u=!1,h=!1,d=!0;if("function"!=typeof e)throw new TypeError(nA);function f(t){var i=n,o=r;return n=r=void 0,c=t,a=e.apply(o,i)}function p(e){var i=e-l;return void 0===l||i>=t||i<0||h&&e-c>=o}function g(){var e=iA();if(p(e))return y(e);s=setTimeout(g,function(e){var i=t-(e-l);return h?oA(i,o-(e-c)):i}(e))}function y(e){return s=void 0,d&&n?f(e):(n=r=void 0,a)}function v(){var e=iA(),i=p(e);if(n=arguments,r=this,l=e,i){if(void 0===s)return function(e){return c=e,s=setTimeout(g,t),u?f(e):a}(l);if(h)return clearTimeout(s),s=setTimeout(g,t),f(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=tA(t)||0,A(i)&&(u=!!i.leading,o=(h="maxWait"in i)?rA(tA(i.maxWait)||0,t):o,d="trailing"in i?!!i.trailing:d),v.cancel=function(){void 0!==s&&clearTimeout(s),c=0,n=l=r=s=void 0},v.flush=function(){return void 0===s?a:y(iA())},v}const sA=class{static registerModules(e){for(const[t,i]of Object.entries(e)){if(!Object.values(Fw).includes(t))throw new Error(`Unknown UMD key: ${t}`);if(void 0===i)throw new Error(`Registered UMD module ${t} must not be undefined`)}Object.assign(sA.registeredModules,e)}clearPluginCache(e){const t=`${this.pluginPublicPath}_${e}_load`;delete sA.jsLoadMap[t],delete sA.jsLoadPromiseMap[t]}constructor(){this.umdMap=Hw,this.backupUmdUrlMap={},this.region={}.__DEFAULT_REGION__,this.customPluginPublicPath=""}get pluginPublicPath(){var e;return this.customPluginPublicPath||(null==(e=il(this.userRegion,this.region))?void 0:e.__UMD_PRE_PATH__)}updateBackupMap(e){this.backupUmdUrlMap=e}loadExtraCdn(e,t=!0){return new Promise(((i,n)=>{const r=t?document.createElement("script"):document.createElement("link");t?r.src=e:(r.rel="stylesheet",r.type="text/css",r.href=e),r.onerror=()=>{n(`url: ${e}`)},r.onload=r.onreadystatechange=function(){(null==this?void 0:this.readyState)&&"loaded"!==(null==this?void 0:this.readyState)&&"complete"!==(null==this?void 0:this.readyState)||(r.onload=r.onreadystatechange=null,i())},document.body.appendChild(r)}))}loadPlugins(e,t){return new Promise((i=>{var n;const r=`${this.pluginPublicPath}_${e}_load`;if(Object.prototype.hasOwnProperty.call(sA.registeredModules,e))return this.triggerSuccessCallback(t),i(sA.registeredModules[e]);if(Reflect.get(sA.jsLoadMap,r))return i(sA.jsLoadMap[r]);const o=this.umdMap[e];if((null==(n=this.importedPlugins)?void 0:n.length)>0&&o.pluginName){const e=this.importedPlugins.find((e=>e.pluginName===o.pluginName));if(e)return i(e)}if(!o)return as.error(`${e} umd info not exit`),this.handleLoadError(e,void 0,i);const{name:a,devPath:s}=o,l=a?Vn(window,a):null;if(l)return sA.jsLoadMap[r]=l,this.triggerSuccessCallback(t),i(l);const c=`${this.pluginPublicPath}/${e+".js"}`;let u=sA.jsLoadPromiseMap[r];as.log(`umdLoader cache hit ${r}=${!!u}`),u||(u=qs((()=>this.loadExtraCdn(c,!0)),2),sA.jsLoadPromiseMap[r]=u),u.then((()=>this.handleLoadSuccess(r,a,t,i))).catch((n=>this.handleLoadCatch(n,e,r,a,t,i)))}))}handleLoadSuccess(e,t,i,n){const r=t?Vn(window,t):null;sA.jsLoadMap[e]=null==r||r,this.triggerSuccessCallback(i),null==n||n(r)}handleLoadError(e,t,i){this.failCallback&&"function"==typeof this.failCallback&&this.failCallback(e,t),i(null)}handleLoadCatch(e,t,i,n,r,o){const a=this.backupUmdUrlMap[t];a?this.loadBackupUrl(a,t,i,n,r,o):(as.error(`load ${t} error, ${e}`),this.handleLoadError(t,e,o))}loadBackupUrl(e,t,i,n,r,o){if(!((a=e)&&a.indexOf&&/^(?:http|data:|\/)/.test(a)))return as.error(`umdMap.${t} isn't a valid url`),this.handleLoadError(t,void 0,o);var a;this.loadExtraCdn(e).then((()=>this.handleLoadSuccess(i,n,r,o))).catch((e=>{as.error(`load ${t} error, ${e}`),this.handleLoadError(t,void 0,o)}))}triggerSuccessCallback(e){e&&e()}};let lA=sA;lA.jsLoadMap={},lA.jsLoadPromiseMap={},lA.registeredModules={};const cA=new lA;var uA=(e=>(e.H265="h265",e.PRELOAD="preload",e.ADAPT_RANGE="adaptRange",e))(uA||{});function hA(e){if(!e||"boolean"==typeof e)return{config:{}};const t=e,{Strategy:i,disabled:n,config:r}=t,o=h(t,["Strategy","disabled","config"]);return u(c({},e),{config:c(c({},o),null!=r?r:{})})}var dA=(e=>(e[e.DISABLED=0]="DISABLED",e[e.INITIALIZING=1]="INITIALIZING",e[e.READY=2]="READY",e[e.FAILED=3]="FAILED",e))(dA||{});class fA{constructor(e){this.strategyKey=uA.PRELOAD,this.preloaderStatus=1,this.preloadCacheConfig={},this.preloadCacheList=[],this._strategyManager=e,this.sdkUmdLoader=new lA}init(e){return d(this,null,(function*(){var t,i,n,r,o,a,s,l,h;const f=null==(t=null==e?void 0:e.strategies)?void 0:t[uA.PRELOAD],p="boolean"==typeof f;if(!f||!p&&(null==f?void 0:f.disabled))return this.preloaderStatus=0,!1;const g=null==(i=hA(f))?void 0:i.config,y=null==(a=null==(o=null==(r=null==(n=this._strategyManager.config)?void 0:n.strategies)?void 0:r[uA.PRELOAD])?void 0:o.Strategy)?void 0:a.preloader;if(!(null==y?void 0:y.register))return this.preloaderStatus=3,!1;y.init((()=>d(this,null,(function*(){as.log("preloader init");const[e,t]=yield Promise.all([Vw.loadPreloader(this.sdkUmdLoader),p||"hls"!==(null==f?void 0:f.format)?Vw.loadMp4Encrypt(this.sdkUmdLoader):Vw.loadHlsjsPro(this.sdkUmdLoader)]);if(!(null==e?void 0:e.PreloaderManager)||!t)return this.preloaderStatus=3,void as.error("preloader init error");const i=(null==t?void 0:t.Mp4Preloader)||(null==t?void 0:t.HlsPreloader);return u(c({},g),{PreloaderModule:e.PreloaderManager,loaders:[i].filter((e=>!!e)),playPlugins:[t]})}))));const v=yield y.prepare();if(!v)return this.preloaderStatus=3,void as.warn("preloader prepare fail",v);this.preloaderStatus=2,null==(h=null==(l=null==(s=y.inst)?void 0:s.call(y))?void 0:l.on)||h.call(l,"prf_data_size",(e=>{var t,i;null==(i=null==(t=this._strategyManager.tea)?void 0:t.event)||i.call(t,"veplayer_preload_prf_data_size",c({},e))})),this.preloader=y,this.initPreloaderConfig()}))}addPreloadList(e){if(1===this.preloaderStatus)return this.preloadCacheList=this.preloadCacheList.concat(null!=e?e:[]),void as.log("preloader add preload cache list",e);2!==this.preloaderStatus?this.preloadCacheList=[]:this.preloader.addPreloadList(e)}setPreloadList(e){return d(this,null,(function*(){if(1===this.preloaderStatus)return this.preloadCacheList=null!=e?e:[],void as.log("preloader set preload cache list",e);2!==this.preloaderStatus?this.preloadCacheList=[]:this.preloader.setPreloadList(null!=e?e:[])}))}setPreloadScene(e,t){if([1,0].includes(e))return 1===this.preloaderStatus?(this.preloadCacheScene!==e&&(this.preloadCacheList=[],as.log("preloader reset preload cache list")),this.preloadCacheScene=e,this.preloadCacheConfig=c(c({},this.preloadCacheConfig),null!=t?t:{}),void as.log("preloader set preload cache config",this.preloadCacheScene,this.preloadCacheConfig)):void(2!==this.preloaderStatus||this.preloader.setPreloadScene(e,t))}initPreloaderConfig(){var e,t,i,n;"undefined"!==this.preloadCacheScene&&this.preloader.setPreloadScene(this.preloadCacheScene,null!=(e=this.preloadCacheConfig)?e:{}),(null==(t=this.preloadCacheList)?void 0:t.length)&&(this.preloader.setPreloadList(this.preloadCacheList),null==(n=(i=this.preloader).checkPreloadData)||n.call(i),this.preloadCacheList=[])}}class pA{constructor(e){this.strategyKey=uA.H265,this._strategyManager=e}init(){return d(this,null,(function*(){return!0}))}isHevcRecommended(){var e,t;return!!(null==(t=null==(e=this._strategyManager.getStrategyRecommendations().result)?void 0:e[uA.H265])?void 0:t.enableH265Hardware)}}const gA=new class{constructor(){var e,t;this.teaId=null==(e=il())?void 0:e.__LOG_TEA_ID__,this.teaChannel=null==(t=il())?void 0:t.__LOG_CHANNEL__,this.status=0,this.initUmdLoader()}get preloader(){var e;return null==(e=this.preloadWrapper)?void 0:e.preloader}get preloaderStatus(){var e,t;return null!=(t=null==(e=this.preloadWrapper)?void 0:e.preloaderStatus)?t:dA.INITIALIZING}initUmdLoader(){this.sdkUmdLoader=new lA}fetchWebId(){return d(this,null,(function*(){var e,t;return(null==(e=this.config)?void 0:e.deviceId)?Promise.resolve(null==(t=this.config)?void 0:t.deviceId):new Promise((e=>{var t;return(null==(t=this.tea)?void 0:t.getToken)?this.tea.getToken((t=>e(null==t?void 0:t.web_id))):e("default_web_id")})).then((e=>(this.config=u(c({},this.config),{deviceId:e}),this.webId)))}))}initTea(e){var t,i;const n=this.collector;n&&(e&&(this.teaId=null==(t=il(e))?void 0:t.__LOG_TEA_ID__,this.teaChannel=null==(i=il(e))?void 0:i.__LOG_CHANNEL__),this.tea=new n(`${this.teaId}_vestrategy_tracker`),this.tea.init({app_id:this.teaId,channel:this.teaChannel}),this.tea.start())}fetchVeStrategy(){return d(this,null,(function*(){if(this.config.Module)return;const e=yield Vw.loadVeStrategy(this.sdkUmdLoader);e&&(this.config=u(c({},this.config),{Module:e}))}))}fetchStrategies(){return d(this,null,(function*(){const e={};return Vw.prepareStrategyLoad(this.sdkUmdLoader),yield Promise.all(Object.keys(this.config.strategies).map((t=>d(this,null,(function*(){if(!this.config.strategies[t])return;!0===this.config.strategies[t]&&(this.config.strategies[t]={});const{Strategy:i}=this.config.strategies[t];if(i)e[t]=this.config.strategies[t];else{const i=t;if(!["h265","preload","adaptRange"].includes(i))return;const n=yield Vw.loadStrategy(this.sdkUmdLoader,i);n&&(e[t]=u(c({},this.config.strategies[t]),{Strategy:n}))}e[t]=hA(e[t])}))))),this.config.strategies=e,e}))}initOnce(e){return d(this,null,(function*(){if(!e||!e.appId)return;this.collector=Bs(),this.initTea(e.region),this.status=1,this.config=e;try{yield Promise.all([this.fetchWebId(),this.fetchVeStrategy()]),yield this.fetchStrategies()}catch(hs){}const{appId:t,deviceId:i,Module:n}=this.config;if(t&&i&&n){this.Module=n;const e=this.collector;yield n.bootstrap(u(c(u(c({},this.config),{strategies:this.config.strategies}),e?{tracker:{Collector:e,enableABVersion:!1}}:{}),{log:{logger:as}})),this.status=2,this.preloadWrapper=new fA(this),this.h265Wrapper=new pA(this)}else this.status=3;return this.isReady()}))}init(e){return d(this,null,(function*(){var t,i;const n=e;return this.initPromise?(null==(i=this.config)?void 0:i.serviceConfigMode)&&(null==n?void 0:n.serviceConfigMode)&&this.config.serviceConfigMode!==n.serviceConfigMode&&as.warn("[VeStrategy] Ignoring conflicting serviceConfigMode after initialization has started."):((null==(t=null==e?void 0:e.plugins)?void 0:t.length)&&Vw.setImportedPlugins(this.sdkUmdLoader,e.plugins),this.initPromise=this.initOnce(n).then((t=>d(this,null,(function*(){var i,n;return t&&(yield Promise.all([null==(i=this.preloadWrapper)?void 0:i.init(e),null==(n=this.h265Wrapper)?void 0:n.init()])),t}))))),this.initPromise}))}addPreloadList(e){this.preloadWrapper&&this.preloadWrapper.addPreloadList(e)}setPreloadList(e){return d(this,null,(function*(){if(this.preloadWrapper)return this.preloadWrapper.setPreloadList(e)}))}setPreloadScene(e,t){this.preloadWrapper&&this.preloadWrapper.setPreloadScene(e,t)}prepare(){return this.initPromise||Promise.resolve(this.isReady())}getDeviceId(){var e;return null==(e=this.config)?void 0:e.deviceId}isReady(){return 2===this.status}getStrategyRecommendations(e=void 0,t=void 0){if(!this.isReady())return{plugins:[],pluginConfiguration:{}};const i=this.config.Module.rec(e,t)||{};return as.log("strategy recommendations:",i),i}getStrategyRecommendationsAsync(e=void 0,t=void 0){return d(this,null,(function*(){if(!this.isReady())return{plugins:[],pluginConfiguration:{}};const i=yield this.config.Module.recAsync(e,t);return as.log("strategy recommendations:",i),i}))}isHevcRecommended(){var e,t;return this.h265Wrapper?this.h265Wrapper.isHevcRecommended():!!(null==(t=null==(e=this.getStrategyRecommendations().result)?void 0:e[uA.H265])?void 0:t.enableH265Hardware)}};let yA=!1;class vA extends Uw{constructor(e){super(e)}applyAbrPluginConfig(e,t){var i;e.EncryptHlsPlugin=u(c({},e.EncryptHlsPlugin),{autoBitrateOpts:t,maxBufferLength:(null==(i=e.EncryptHlsPlugin)?void 0:i.maxBufferLength)||40})}prepareAbrModule(e,t){return d(this,null,(function*(){var i;const n=null==(i=e.configs)?void 0:i.autoBitrateOpts;!e.isOpenABR()||(null==n?void 0:n.module)||this.useNativeAbr()||e.updateConfigs({autoBitrateOpts:u(c({},n),{module:yield t.loadPlugins(Fw.DashAbralgo)})})}))}needAbrAutoDefinition(){return!0}setAbrDefaultDefiWithAuto(){return!this.useNativeAbr()}generatePlaylistFromServer(e,t){var i,n,r;yA=!0;const{vid:o,playList:a=[],enableAdaptive:s,adaptiveBitrateStreamingInfo:l}=e||{};if(t&&(null==l?void 0:l.MainPlayUrl))return[{vid:o,url:null==l?void 0:l.MainPlayUrl,_mainURL:l.MainPlayUrl,_backupURL:l.BackupPlayUrl,streamType:l.AbrFormat,backupUrl:l.BackupPlayUrl,backUrlList:[l.BackupPlayUrl],isMasterM3u8:!0}];const c=[...a||[]];if(this.useNativeAbr()&&(null==(r=null==(n=null==(i=this.playerData)?void 0:i.configs)?void 0:n.autoBitrateOpts)?void 0:r.enable)&&s&&l&&c.length){const e={url:l.MainPlayUrl,definition:"auto",streamType:"hls",format:"hls",backupUrl:l.BackupPlayUrl,backUrlList:[l.BackupPlayUrl],vid:o};c.push(e)}return c}useNativeAbr(){return Kr.os.isIos||"safari"===Kr.browser&&this.playerData.drmType===or.DRM_ENCRYPT}canOpenAbr(e){if(this.playerData.isVidPlay()&&e){const{enableAdaptive:t,adaptiveBitrateStreamingInfo:i,playList:n=[]}=e;if(!(n.length>1&&t&&i))return yA&&as.warn("The obtained media information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether the video contains ABR transcoding products."),yA=!1,!1}return!0}canAdaptRangeEnable(){return!1}adaptRangeDefaultOptions(){}applyAdaptRangePluginConfig(e,t){}applyAdaptRangeStrategy(e,t){}getPlugins(e){return d(this,null,(function*(){var t,i,n;if(null==(i=null==(t=gA.config)?void 0:t.strategies)?void 0:i[uA.PRELOAD]){return[yield e.loadPlugins(Fw.HLSjsPro)]}const{configs:r,options:o,useHlsPluginForSafari:a,enableHlsJs:s,isVidEncrypt:l,isLive:c,openSoftDecoding:u,isMobile:h,drmType:d}=this.playerData,f=d===or.DRM_ENCRYPT,p=[or.PRIVATE_ENCRYPT_UPGRADE,or.PRIVATE_ENCRYPT].includes(d),g=zs(r,"EncryptHlsPlugin");if(!!(null==g?void 0:g.keyToken)||l&&!f||p||this.playerData.isOpenABR()&&!(null==(n=null==this?void 0:this.useNativeAbr)?void 0:n.call(this))){return[yield e.loadPlugins(Fw.HLSEncrypt)]}{const t=zs(o,"Subtitle"),i=c&&t,n=(Zs()||window.WebAssembly)&&u,l=r.enableHlsMSE,d=r.enableMobileHlsPlugin&&(Kr.os.isAndroid&&Zs()||Kr.os.isIos&&Qs()),p=f&&Kr.os.isAndroid,g=f&&tl,y=h&&!document.createElement("video").canPlayType("application/vnd.apple.mpegurl");if(h&&(n||i||l||d||p||y)||!(h||tl&&!a||g)){return[yield e.loadPlugins(s?Fw.HLSjsPro:Fw.HLS)]}}}))}setPluginConfigInVid(e,t){var i;const{vid:n,defaultDefinitionData:r}=e,{config:o,privateDrmAuthToken:a,sessionId:s,useUnionInfoDRM:l}=t,{playDomain:u,keyToken:h,getKeyType:d}=o,f=!!r.kid,p=this.playerData.drmType===or.DRM_ENCRYPT,g=this.playerData.drmType===or.PRIVATE_ENCRYPT_UPGRADE;if(f&&!p){const e=null==(i=this.playerData.configs)?void 0:i.EncryptHlsPlugin,t="object"==typeof e?e:{},{kid:o,secretKey:f}=r;if(h)this.playerData.options.EncryptHlsPlugin=c({keyToken:h,playDomain:u||this.playerData.playDomain,getKeyType:d||"TOP",preferMMS:!0,preferMMSStreaming:!0},t);else if(g)this.playerData.options.EncryptHlsPlugin=c({vid:n,kid:o,useUnionInfoDRM:!0,sessionId:this.playerData.encryptSessionId,drmType:or.PRIVATE_ENCRYPT_UPGRADE,keyTokenExpiredDuration:9999999,secretKey:f,preferMMS:!0,preferMMSStreaming:!0},t);else if(a&&s){const e=_s(a),i=parseInt(""+e["X-Expires"]),r=isNaN(i)?30:i;this.playerData.options.EncryptHlsPlugin=c({vid:n,kid:o,keyTokenExpiredDuration:r,drmKeyToken:a,useUnionInfoDRM:l,sessionId:s,playDomain:u||this.playerData.playDomain,preferMMS:!0,preferMMSStreaming:!0},t)}}}}class mA extends Uw{applyAbrPluginConfig(e,t){}needAbrAutoDefinition(){return!1}prepareAbrModule(e,t){}setAbrDefaultDefiWithAuto(){return!1}generatePlaylistFromServer(e,...t){const{playList:i=[]}=e||{};return[...i||[]]}useNativeAbr(){return!1}canOpenAbr(){return!1}canAdaptRangeEnable(){return!1}adaptRangeDefaultOptions(){}applyAdaptRangePluginConfig(e,t){}applyAdaptRangeStrategy(e,t){}getPlugins(){return Promise.resolve([])}setPluginConfigInVid(){}}var _A=(e=>(e.EDITION_STANDARD="standard_edition",e.EDITION_PREMIUM="premium_edition",e.EDITION_NONE="none_edition",e))(_A||{}),EA=(e=>(e.SDK_VOD_PLAY="web_vod_play",e.SDK_LIVE_PULL="web_live_pull",e))(EA||{}),TA=(e=>(e.H265="h265",e.PRELOAD="preload",e.ADAPT_RANGE="adaptRange",e.ABR="abr",e))(TA||{}),SA=(e=>(e[e.LICENSE_STATUS_INVALID=0]="LICENSE_STATUS_INVALID",e[e.LICENSE_STATUS_OK=1]="LICENSE_STATUS_OK",e[e.LICENSE_STATUS_EXPIRED=2]="LICENSE_STATUS_EXPIRED",e[e.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH=401]="LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH",e))(SA||{});const bA={setLicenseConfig:e=>d(exports,null,(function*(){})),checkLicense:()=>d(exports,null,(function*(){return"premium_edition"})),checkModuleList:()=>d(exports,null,(function*(){return Object.values(TA)})),checkLicenseStatus:()=>d(exports,null,(function*(){return 1})),checkLicenseModuleAuth:(e,t)=>d(exports,null,(function*(){return!0})),renderLogo:e=>{}};class CA{constructor(e,t){var i,n;this.id="",this.type="",this.isLive=!1,this.options=null,this.isMobile=!1,this.playList=[],this.plugins=[],this.openSoftDecoding=!1,this.current={lineId:0,language:"",definition:"",streamType:"",codec:tr.UNKNOWN,kid:"",secretKey:"",drmType:void 0},this.strategiesPlugins=[],this.strategiesPluginConfigs={},this.urlCheckData={enableUrlExpireCheck:!1,urlExpireTimestamp:Xa,urlExpireDiff:60,urlCheckExpireInterval:400},this.isAutoBitrateEnable=!1,this.isVidEncrypt=!1,this.drmType=void 0;const r=e,{options:o,type:a,isLive:s,id:l,root:c,plugins:u=[],defaultConfig:d,languages:f,codec:p,isMobile:g=!1,enableH265Degrade:y=!1,onMediaExpired:v,onTokenExpired:m,unionId:_,isMusic:E=!1,sdkPlugins:T=[],useHlsPluginForSafari:S=!0,enableHlsJs:b=!0,enableMenu:C=!1,region:k={}.__DEFAULT_REGION__,userRegion:I,debug:P=!1,licensSupportModuleList:D=Object.values(TA),encryptSessionId:w}=r,A=h(r,["options","type","isLive","id","root","plugins","defaultConfig","languages","codec","isMobile","enableH265Degrade","onMediaExpired","onTokenExpired","unionId","isMusic","sdkPlugins","useHlsPluginForSafari","enableHlsJs","enableMenu","region","userRegion","debug","licensSupportModuleList","encryptSessionId"]);this.configs=e,this.sdk=t,P&&(as.config.debug=3),this.options=Object.assign({},o,A),this.options.poster="string"==typeof this.options.poster?function(e){const t=""+e,i=ll.exec(t);if(!i)return t;let n,r,o="",a=0;for(r=i.index;r<t.length;r++){switch(t.charCodeAt(r)){case 34:n="&quot;";break;case 38:n="&amp;";break;case 39:n="&#x27;";break;case 60:n="&lt;";break;case 62:n="&gt;";break;default:continue}a!==r&&(o+=t.substring(a,r)),a=r+1,o+=n}return a!==r?o+t.substring(a,r):o}(this.options.poster):this.options.poster,this.options.icons=(e=>{const t={};return e&&Object.entries(e).forEach((([e,i])=>{i&&"string"!=typeof i&&(t[e]=i)})),t})(this.options.icons),this.id=l,this.root=c,this.type=a,this.isLive=!!(null!=s?s:"live"===a),this.defaultConfig=d,this.languageData=this.initI18nData(f),this.isMobile=g||"mobile"===Kr.device,this.openSoftDecoding=null==(i=this.configs)?void 0:i.useSoftDecoding,this.enableH265Degrade=y,this.codec=p||tr.UNKNOWN,this.onMediaExpired=v,this.onTokenExpired=m,null==(n=this.setVodPlayListConfig)||n.call(this,this.configs),this.current=hr.observe(this.current),this.plugins=[...u],this.isMusic=E,this.unionId=_,this.sdkPlugins=T,this.useHlsPluginForSafari=S,this.enableHlsJs=b,this.enableMenu=C,C&&(this.options.enableContextmenu=!0,this.options.closeVideoStopPropagation=!0),this.region=k,this.userRegion=I,this.setVodTeaId(),this.playDomainDegrade=!1,this.dashOpts=null,this.encryptSessionId=w,this.initPlayData(this.configs),hr.subscribeProperty(this.current,"definition",this.updateCheckExpireData.bind(this))}initPlayData(e){const t=this.initPlaylistAndGetCurrent(e);this.initCurrent(t)}initPlaylistAndGetCurrent(e){var t,i;const{url:n,playList:r=[],streamType:o="",definitionText:a,definitionTextKey:s,urlExpireTimestamp:l,playAuth:h,playAuthId:d}=e,f=e.defaultDefinition||this.configs.defaultDefinition,p=e.codec||tr.UNKNOWN;(null==e?void 0:e.autoBitrateOpts)&&this.updateConfigs({autoBitrateOpts:c(c({},null!=(t=this.configs.autoBitrateOpts)?t:{}),e.autoBitrateOpts)});let g=null;const y=fi([...r].filter((e=>e.url)).map(((e,t)=>u(c({},e),{bitrate:e.bitrate||e.Bitrate||1e3*(t+1),secretKey:e.playAuth,kid:e.playAuthId}))));if(n)if(0===y.length){const e=c(u(c({},this.current),{url:n,streamType:o,definitionTextKey:s,codec:p,secretKey:h,kid:d,urlExpireTimestamp:l}),s||a?{definition:a}:{definition:"HD"});this.playList=[e],this.defaultDefinition=e.definition}else{this.playList=y;const e=this.getUrlList({url:n});e.length>0?g=e[0]:as.warn("default url is not match Playlist")}else this.playList=y;e.drmType&&this.setDrmType(e.drmType);let v=this.getCurrentByDefaultConfig();v?this.defaultDefinition=v.definition:(v=g||(f&&(null==(i=this.getUrlList({definition:f}))?void 0:i[0])||this.playList[0]),this.defaultDefinition=null==v?void 0:v.definition);const m=this.getTargetStreamType(v);if(this.adapter=function(e,t){const i=u(c({},t),{streamType:e});switch(null==e?void 0:e.toLowerCase()){case"mp4":case"m4a":return new Ww(i);case"dash":return new Yw(i);case"hls":return new vA(i);default:return as.log(`no adapter match ${e}, use others adapter by default`),new mA(i)}}(m,{configs:this.configs,playerData:this}),this.isAutoBitrateEnable=this.checkAutoBitratePlayList(),this.isOpenABR()){const e=this.getABRStreamInfo(m,v);v=e.defaultStream,this.playList=e.playList,this.defaultDefinition=e.defaultDefinition}return this.playList.forEach((e=>{(null==e?void 0:e.streamType)&&(e.vtype=e.streamType.toUpperCase()),(null==e?void 0:e.codec)&&(e.codecType=e.codec)})),v}checkAutoBitratePlayList(){var e,t;return!(Kr.os.isIos&&this.adapter.needAbrAutoDefinition()&&!(null==(t=null==(e=this.playList)?void 0:e.find((e=>this.isAutoDefinition(null==e?void 0:e.definition))))?void 0:t.url))}getABRStreamInfo(e,t){var i,n,r,o,a;let s=this.defaultDefinition;const l=(null==(n=null==(i=this.playList)?void 0:i.concat)?void 0:n.call(i))||[];let c=t;const u=l.findIndex((e=>this.isAutoDefinition(null==e?void 0:e.definition))),h=-1!==u?l.splice(u,1)[0]:void 0,d={definition:null!=(r=null==h?void 0:h.definition)?r:"auto",bitrate:void 0,definitionTextKey:(null==h?void 0:h.definitionTextKey)||(null==(a=null==(o=this.configs)?void 0:o.autoBitrateOpts)?void 0:a.definitionTextKey)||"DEFINITION_AUTO",url:(null==h?void 0:h.url)||"__auto__",name:"auto",streamType:e||this.configs.streamType};return this.isAutoDefinition(this.configs.defaultDefinition)||(d.bitrate=null==c?void 0:c.bitrate,s=null==c?void 0:c.definition),this.isPlayAutoDefinition()&&(c=d,this.adapter.setAbrDefaultDefiWithAuto()&&(s=d.definition)),l.push(d),{defaultDefinition:s,defaultStream:c,playList:l}}isCurrentH265(){if(this.codec){return this.codec.replace(".","").toLowerCase()===tr.H265}return!1}setDrmType(e){this.drmType=e}getCurrentByDefaultConfig(){if(!this.defaultConfig)return;const{type:e,isLive:t,lineId:i="",definition:n=""}=this.defaultConfig;if((null!=t?t:"live"===e)!==this.isLive)return;if(!i&&!n)return as.warn("默认配置未设置默认线路或默认清晰度"),void(this.isHitDefault=!1);const r=this.getUrlList({lineId:i,definition:n});return r.length>0?(this.isHitDefault=!0,r[0]):(as.warn("playlist中没有满足默认配置的流"),void(this.isHitDefault=!1))}initCurrent(e){var t,i,n;Object.keys(this.current).forEach((t=>{this.current[t]=null==e?void 0:e[t]}));const r=null==e?void 0:e.codec;this.codec=r&&Object.values(tr).includes(r)?r:tr.UNKNOWN,(null==(t=this.current)?void 0:t.drmType)&&this.setDrmType(null==(i=this.current)?void 0:i.drmType),this.isVidEncrypt=!!(null==(n=this.current)?void 0:n.kid),this.initCheckExpireData()}initCheckExpireData(){const{enableUrlExpireCheck:e,urlExpireDiff:t,urlCheckExpireInterval:i}=this.configs;Mw(this.urlCheckData,{enableUrlExpireCheck:e,urlExpireDiff:t,urlCheckExpireInterval:i}),this.updateCheckExpireData()}updateCheckExpireData(){var e;const t=null==(e=this.getCurrentStreams())?void 0:e[0];if(t){const{url:e,urlExpireTimestamp:i}=t;if(!e)return;const n=ol(""+(i||this.configs.urlExpireTimestamp));n?this.urlCheckData.urlExpireTimestamp=n:this.urlCheckData.enableUrlExpireCheck&&(this.urlCheckData.urlExpireTimestamp=Xa,as.warn("not provide urlExpireTimestamp, url expire check will not work")),as.log("update urlCheckData to:",this.urlCheckData)}}initI18nData(e){const t=[Qa,Ja],i=e&&Object.entries(e).reduce(((e,[i,n])=>(Ya.includes(i)?e.push({LANG:"zh"===i?"zh-cn":i,TEXT:n}):t.push({LANG:i,TEXT:n}),e)),[]);return{extraLangList:t,extendLangList:i}}getCurrentUrl(){var e;return null==(e=this.getCurrentStreams()[0])?void 0:e.url}getTargetStreamType(e){var t;return e?e.streamType||this.configs.streamType||Ws(e.url):this.configs.streamType||Es(null==(t=this.configs)?void 0:t.getVideoByToken)}getCurrentStreamType(){const e=this.getCurrentStreams();if(e.length){const{url:t,streamType:i}=e[0];return i||this.configs.streamType||Ws(t)||"mp4"}return this.configs.streamType||"mp4"}getStreamType(){var e;return this.getCurrentStreamType()||Es(null==(e=this.configs)?void 0:e.getVideoByToken)}isOpenABR(){var e,t,i,n,r;if(!this.isAutoBitrateEnable||!(null==(t=null==(e=this.configs)?void 0:e.autoBitrateOpts)?void 0:t.enable)||!(null==(i=this.configs)?void 0:i.isLive)&&!(null==(r=null==(n=this.configs)?void 0:n.licensSupportModuleList)?void 0:r.includes(TA.ABR)))return!1;const o=this.sdk.getSdkPlugin("AuthToken");return this.adapter.canOpenAbr(null==o?void 0:o.playInfo)}showRealDefinition(){var e,t;return!!(null==(t=null==(e=this.configs)?void 0:e.autoBitrateOpts)?void 0:t.showRealDefinition)}isAutoDefinition(e){return["auto","自动"].includes(e)}isPlayAutoDefinition(e=""){var t;return this.isAutoDefinition(e||this.defaultDefinition)||(null==(t=this.configs.autoBitrateOpts)?void 0:t.startWithAuto)}isDefinitionMatch(e,t){return!(!this.isAutoDefinition(e)||!this.isAutoDefinition(t))||e===t}getCurrentStreams(){const e=this.current;return this.getUrlList(e)}getLineList(){return fi(er(this.playList,"lineId"))}getLineListByLineId(e){return this.playList.filter((t=>{var i;return(null==e?void 0:e.toString())===(null==(i=t.lineId)?void 0:i.toString())}))}getDefinitionListByLineId(e){return fi(er(this.getLineListByLineId(e),"definition"))}getUrlList(e){return this.playList.filter((t=>Object.keys(e).every((i=>{var n,r;if("url"===i){const i=null==e?void 0:e.url,n=null==t?void 0:t.url;return"string"==typeof i?i===(null==n?void 0:n.toString()):!(!Array.isArray(i)||!Array.isArray(n))&&i.map((e=>e.src)).join("")===n.map((e=>e.src)).join("")}{const o=(null==(n=e[i])?void 0:n.toString())===(null==(r=t[i])?void 0:r.toString()),a=!e[i];return o||a}}))))}getNextDefinition(e=!0,t){var i,n,r;const o=e?"next":"prev",{definition:a,lineId:s}=this.current;if(!a)return;const l=null==(i=this.getCurrentStreams())?void 0:i[0],c="auto"===a?l.mapDefinition:a,u=(e=>(null==e?void 0:e.length)&&e.reduce(((t,i,n)=>(t[i]={next:n+1>=e.length?null:e[n+1],pre:0===n?null:e[n-1]},t)),{}))(t)||Ga;if(!Object.keys(u).includes(c))return;let h=null==(n=u[c])?void 0:n[o];const d=this.getDefinitionListByLineId(s);for(;0===d.filter((e=>e.definition===h)).length&&h;)h=null==(r=u[h])?void 0:r[o];if(h)return"auto"===a&&h&&(l.mapDefinition=h),this.getUrlList({lineId:s,definition:h});as.log("已经降至最低级")}get apiMap(){var e;const t="sg",i=null==(e=rB.ttDramaEnv)?void 0:e.channel,n={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}},r={cn:{__PLAY_DOMAIN__:"https://vod.volcengineapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.volcengineapi.com"},mya:{__PLAY_DOMAIN__:"https://vod.ap-southeast-1.volcengineapi.com"}};let o,a=t;"byteplus"===i&&n?(o=n,a="sg"):"volcengine"===i&&r?(o=r,a=o[t]?t:"cn"):o={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}};const s=o[this.region]||o[a];return{playDomain:s.__PLAY_DOMAIN__,backupPlayDomain:null==s?void 0:s.__BACKUP_PLAY_DOMAIN__}}get playDomain(){var e;return this.playDomainDegrade&&null!=(e=this.apiMap.backupPlayDomain)?e:this.apiMap.playDomain}setVodTeaId(){const e=il(this.userRegion,this.region);!function(e){Pw.TEA_ID=e}(this.configs.logTeaAppId||e.__LOG_TEA_ID__||4951)}getMergedConfigs(e){const t=fi(this.configs);return Bi(t,fi(e),((e,t)=>{if(ge(e))return t})),t}updateConfigs(e){Bi(this.configs,fi(e),((e,t)=>{if(ge(e))return t}))}updatePlayList(){const{url:e,playList:t=[],urlExpireTimestamp:i}=this.configs,n=[...t].filter((e=>e.url));if(e&&!n.length){const t=u(c({},this.current),{url:e,urlExpireTimestamp:i});this.playList=[t]}else this.playList=n}isVidPlay(){var e,t;return!!(null==(t=null==(e=this.configs)?void 0:e.getVideoByToken)?void 0:t.playAuthToken)}}var kA=function(){function e(t){gr(this,e),this.config=t.config,this.parent=t.root,this.root=Ur.createDom("ul","",{},"xg-options-list xg-list-slide-scroll ".concat(this.config.className)),t.root.appendChild(this.root);var i=this.config.maxHeight;i&&this.setStyle({maxHeight:i}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var n="touch"===this.config.domEventType?"touchend":"click";this._delegates=ba.delegate.call(this,this.root,"li",n,this.onItemClick)}return vr(e,[{key:"renderItemList",value:function(e){var t=this,i=this.config,n=this.root;e?i.data=e:e=i.data,i.style&&Object.keys(i.style).map((function(e){n.style[e]=i[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,i){var n=e.selected?"option-item selected":"option-item";e["data-index"]=i,t.root.appendChild(Ur.createDom("li","<span>".concat(e.showText,"</span>"),e,n))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&Ur.hasClass(t,"selected"))return!1;var i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");Ur.addClass(t,"selected"),n&&Ur.removeClass(n,"selected"),i(e,{from:n?this.getAttrObj(n,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var i={};t.map((function(t){i[t]=e.getAttribute(t)}));var n=e.getAttribute("data-index");return n&&(i.index=Number(n)),i}},{key:"show",value:function(){Ur.removeClass(this.root,"hide"),Ur.addClass(this.root,"active")}},{key:"hide",value:function(){Ur.removeClass(this.root,"active"),Ur.addClass(this.root,"hide")}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.root.style[i]=e[i]}))}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map((function(e){e.destroy&&e.destroy()})),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),e}(),IA="side",PA="middle",DA="default",wA="click",AA="hover";var RA="mobile"===Kr.device,xA=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"onEnter",(function(e){e.stopPropagation(),n.emit("icon_mouseenter",{pluginName:n.pluginName}),n.switchActiveState(e)})),mr(Sr(n),"switchActiveState",(function(e){e.stopPropagation(),n.config.toggleMode===wA?n.toggle(!n.isActive):n.toggle(!0)})),mr(Sr(n),"onLeave",(function(e){e.stopPropagation(),n.emit("icon_mouseleave",{pluginName:n.pluginName}),n.config.listType!==IA&&n.isActive&&n.toggle(!1)})),mr(Sr(n),"onListEnter",(function(e){n.enterType=2})),mr(Sr(n),"onListLeave",(function(e){n.enterType=0,n.isActive&&n.toggle(!1)})),n.isIcons=!1,n.isActive=!1,n.curValue=null,n.curIndex=0,n}return vr(i,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.initIcons(),(RA=RA||"touch"===this.domEventType)&&"mobile"===Kr.device&&t.listType===DA&&(t.listType=IA),t.hidePortrait&&Ur.addClass(this.root,"portrait"),this.on([Ro,Io],(function(){e._resizeList()})),this.once(no,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),RA&&this.on(ho,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),RA?(t.toggleMode=wA,this.activeEvent="touchend"):this.activeEvent=t.toggleMode===wA?"click":"mouseenter",t.toggleMode===wA?this.bind(this.activeEvent,this.switchActiveState):(this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave)),this.isIcons&&this.bind("click",this.onIconClick)}},{key:"initIcons",value:function(){var e=this,t=this.icons,i=Object.keys(t),n=!1;i.length>0&&(i.forEach((function(i){e.appendChild(".xgplayer-icon",t[i]),!n&&(n=t[i])})),this.isIcons=n),n||(this.appendChild(".xgplayer-icon",Ur.createDom("span","",{},"icon-text")),Ur.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||Ur.addClass(this.root,"show")}},{key:"hide",value:function(){Ur.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,i){if(void 0===e)return"";var n=this.config.list;!i&&(i=this.player.lang),t=!t||Ur.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=n[e]);try{return"object"===pr(e[t])?e[t][i]||e[t].en:e[t]}catch(r){return console.warn(r),""}}},{key:"toggle",value:function(e){if(e!==this.isActive&&!this.config.disable){var t=this.player.controls,i=this.config.listType;e?(i===IA?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):(i===IA?t.focus():t.focusAwhile(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.stopPropagation();var i=this.config,n=i.listType,r=i.list;this.curIndex=t.to.index,this.curItem=r[this.curIndex],this.changeCurrentText(),(this.config.isItemClickHide||RA||n===IA)&&this.toggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0];t&&(this.find(".icon-text").innerHTML=this.getTextByLang(t,"iconText"))}}},{key:"renderItemList",value:function(e,t){var i=this,n=this.config,r=this.optionsList,o=this.player;if("number"==typeof t&&(this.curIndex=t,this.curItem=n.list[t]),r)return r.renderItemList(e),void this.changeCurrentText();var a,s,l={config:{data:e||[],className:(a=n.listType,s=n.position,a===IA?s===ma.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""),onItemClick:function(e,t){i.onItemClick(e,t)},domEventType:RA?"touch":"mouse"},root:n.listType===IA?o.innerContainer||o.root:this.root};if(this.config.isShowIcon){var c=this.player.root.getBoundingClientRect().height,u=n.listType===PA?c-50:c;u&&n.heightLimit&&(l.config.maxHeight="".concat(u,"px")),this.optionsList=new kA(l),this.changeCurrentText(),this.show()}this._resizeList()}},{key:"_resizeList",value:function(){if(this.config.heightLimit){var e=this.player.root.getBoundingClientRect().height,t=this.config.listType===PA?e-50:e;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(t,"px")})}}},{key:"destroy",value:function(){this.config.toggleMode===wA?this.unbind(this.activeEvent,this.switchActiveState):(this.unbind(this.activeEvent,this.onEnter),this.unbind("mouseleave",this.onLeave)),this.isIcons&&this.unbind("click",this.onIconClick),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null)}},{key:"render",value:function(){if(this.config.isShowIcon)return'<xg-icon class="xg-options-icon '.concat(this.config.className||"",'">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>')}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:100,list:[],listType:"default",listStyle:{},hidePortrait:!0,isShowIcon:!1,isItemClickHide:!0,toggleMode:AA,heightLimit:!0}}}]),i}();const OA={READY:"ready",COMPLETE:"complete",URL_CHANGE:"urlchange",PLAYER_FOCUS:"focus",PLAYER_BLUR:"blur",FULLSCREEN_CHANGE:"fullscreen_change",CSS_FULLSCREEN_CHANGE:"cssFullscreen_change",MINI_STATE_CHANGE:"mini_state_change",DESTROY:"destroy",REPLAY:"replay",RETRY:"retry",DEFINITION_CHANGE:"definition_change",Before_DEFINITION_CHANGE:"before_definition_change",AFTER_DEFINITION_CHANGE:"after_definition_change",VIDEO_RESIZE:"video_resize",PIP_CHANGE:"pip_change",ROTATE:"rotate",SHORTCUT:"shortcut",SEI_PARSED:"SEI_PARSED",USER_ACTION:"user_action",AUTOPLAY_STARTED:"autoplay_started",AUTOPLAY_PREVENTED:"autoplay_was_prevented",READY_CREATE_PLAYER:"ready_create_player",PLAYER_CREATED_FINISH:"player_create_finish",CREATE_PLAYER_PERF:"create_player_perf",PLAYER_REBUILD:"player_rebuild",NOT_SUPPORT_HARDWARE_DECODER:"not_support_hardware_decoder",NOT_SUPPORT_SOFT_DECODER:"not_support_soft_decoder",TOKEN_EXPIRED:"playAuthToken_expired",UMD_LOAD_FAIL:"umd_load_fail",PLAYNEXT:"playnext",URL_NULL:"urlNull",LEAVE_PLAYER:"leaveplayer",ENTER_PLAYER:"enterplayer",RESET:"reset",SOURCE_ERROR:"source_error",SOURCE_SUCCESS:"source_success",LICENSE_STATUS_WARNING:"license_status_warning",AUDIO_TRACKS_UPDATED:"audio_tracks_updated",AUDIO_TRACK_CHANGE:"audio_track_change"},LA=u(c({DANMU_CHANGE:"danmu_change",TIME_SHIFT_CHANGE:"time_shift_change",AI_SUBTITLE_LANG_CHANGE:"ai_subtitle_lang_change",AI_SUBTITLE_MATCH:"ai_subtitle_match",CANCEL_UNMUTE:"cancel_unmute",REFRESH_CLICK:"refresh_click",PLAY_BACKUP_CHANGE:"play_backup_change",PLAY_BACKUP_CHANGE_FINISH:"play_backup_change_finish",PLAY_ERROR_BUTTON_CLICK:"play_error_button_click",PlAY_URL_CHANGE:"play_url_change",SHOW_PLAY_ERROR:"show_play_error",PLAYER_EXTEND_BUTTON:"player_extend_button",LONG_WAITING:"long_waiting",OFTEN_WAITING:"often_waiting",DEFINITION_DEMOTE:"definition_demote",LARKWINDOW_CHANGE:"larkWindow_change",PANEL_MODE_CHANGE:"panel_mode_change",INNER_DEFINITION_CHANGE:"inner_definition_change",LINE_CHANGE:"line_change",GET_PLAY_URL_ERR:"get_play_url_err",MEDIA_EXPIRED:"MEDIA_EXPIRED",MIRROR_CHANGE:"mirror_change"},{}),{AUTOPLAY_SUCCESS:"autoplay_success",AUTOPLAY_FAILED:"autoplay_failed",MENU_LOG:"MENU_LOG",MENU_REPORT:"MENU_REPORT",PLAY_LIST_CHANGE:"play_list_change",PLAY_LIST_ITEM_CHANGE:"play_list_item_change",PLAY_NEXT_START:"play_next_start",PLAY_NEXT_END:"play_next_end",ABR_AUTO_DESC_CHANGE:"ABR_AUTO_DESC_CHANGE",CORE_EVENT:"core_event",PRELOAD_INFO:"PRELOAD_INFO"}),NA=c(c(c({},{ABORT:"abort",CANPLAY:"canplay",CANPLAY_THROUGH:"canplaythrough",DURATION_CHANGE:"durationchange",EMPITED:"empited",EMPTIED:"emptied",ENDED:"ended",ERROR:"error",LOADED_DATA:"loadeddata",LOADED_META_DATA:"loadedmetadata",LOAD_START:"loadstart",PAUSE:"pause",PLAY:"play",PLAYING:"playing",PROGRESS:"progress",RATE_CHANGE:"ratechange",SEEKED:"seeked",SEEKING:"seeking",STALLED:"stalled",SUSPEND:"suspend",TIME_UPDATE:"timeupdate",VOLUME_CHANGE:"volumechange",WAITING:"waiting"}),OA),LA),MA={SDKEvents:OA,PluginEvents:LA},UA=NA,BA=70,FA=30,HA=50,jA=60,VA=20,KA=e=>class extends e{constructor(e){super(e),this._playTimer=null,this.handleABRDescChange=(...e)=>{this._autoRealDefinition=e[1]||void 0,this.refreshDefinitionList()},this.handleResourceReady=(e=[])=>{var t,i;const{list:n}=this.getCurrentDefinitionInfo(this.player),r=n.filter((t=>{var i;const n=t&&e.find((e=>this.playerData.isDefinitionMatch(e.definition,t.definition)));return n&&"dash"===(null==(i=this.playerData.getStreamType())?void 0:i.toLowerCase())&&(t.url=n.url),n})),o=e.find((e=>null==e?void 0:e.selected))||this.playerData.current,a=r.find((e=>this.playerData.isDefinitionMatch(e.definition,null==o?void 0:o.definition)));this.playerData.playList=r,(null==a?void 0:a.definition)&&(null==(t=this.playerData.current)?void 0:t.definition)!==a.definition&&(this.playerData.current.definition=null==a?void 0:a.definition),null==(i=this.refreshDefinitionList)||i.call(this)},this.getAutoDefRealLevel=()=>{var e;if(this.playerData.isAutoDefinition(null==(e=this.playerData.current)?void 0:e.definition)){const{videoWidth:e,videoHeight:t}=this.player.media;if(e&&t){const{list:i=[]}=this.getCurrentDefinitionInfo(this.player),n=i.find((i=>{const n=i.vwidth||i.width,r=i.vheight||i.height;return n&&r&&n===e&&r===t}));(null==n?void 0:n.definition)&&this._autoRealDefinition!==n.definition&&(this._autoRealDefinition=n.definition,this.refreshDefinitionList(),"mobile"===Kr.device&&(null==this||this.updatePanel()))}}},this.clientType=e.clientType,this.playerData=e.player.config.playerData,this.toastInfo={},this.dataMonitoring()}afterCreate(){var e,t,i,n,r;super.afterCreate(),this._autoRealDefinition=void 0,null==(e=this.refreshDefinitionList)||e.call(this),(this.playerData.isOpenABR()||"dash"===(null==(t=this.playerData.getStreamType())?void 0:t.toLowerCase()))&&this.on("resourceReady",this.handleResourceReady),this.playerData.isOpenABR()&&(this.on("ABR_AUTO_DESC_CHANGE",this.handleABRDescChange),((null==(r=null==(n=null==(i=this.playerData)?void 0:i.adapter)?void 0:n.useNativeAbr)?void 0:r.call(n))||this.player.plugins.dashplugin||this.player.plugins.mp4encryptplayer)&&(this.autoDefDetectTimer=new Hs,this.autoDefDetectTimer.repeat(this.getAutoDefRealLevel,1e3))),this.on(LA.PLAY_NEXT_START,(()=>{this.definitionSubscribeId&&hr.unsubscribeProperty(this.playerData.current,"definition",this.definitionSubscribeId),this.playListSubscribeId&&hr.unsubscribeProperty(this.playerData,"playList",this.playListSubscribeId)})),this.on(LA.PLAY_NEXT_END,(()=>{var e,t;null==(e=this.dataMonitoring)||e.call(this),null==(t=this.refreshDefinitionList)||t.call(this)}))}getShowText(e={},t,i){var n,r;if(t)return this.playerData.isOpenABR()&&this.playerData.isAutoDefinition(t.definition)?(null==(r=null==(n=this.playerData.configs)?void 0:n.autoBitrateOpts)?void 0:r.autoDefinitionText)||e[t.definitionTextKey]||t.definition:e[t.definitionTextKey]||t.definition||t.definitionTextKey||i||"HD"}getCurrentDefinitionInfo(e){const t={list:[],defaultDefinition:""},i=e.config.playerData,{current:{lineId:n,definition:r}}=i,o=i.getDefinitionListByLineId(n);return Array.isArray(o)&&o.length>0&&(t.list=o.map((t=>(t.text||(t.text=this.getShowText(e.i18n,t,t.definition)),t)))),t.defaultDefinition=r,t}showToast(e,t){var i,n;const r=null==(i=this.player)?void 0:i.getPlugin("sdkToastPlugin");if(!r)return;const o=this.getShowText(this.i18n,e,t);this.toastInfo&&(clearTimeout(this.toastInfo.timer),null==(n=null==r?void 0:r.remove)||n.call(r,this.toastInfo.id),this.player.off(Ao,this.toastInfo.remove),this.player.off(Qr,this.toastInfo.remove)),this.toastInfo={id:r.add(`${this.langText.switching} ${o}...`,0,!0),showTime:Date.now(),delayClose:!1},this.toastInfo.timer=setTimeout((()=>{r.remove(this.toastInfo.id),clearTimeout(this.toastInfo.timer)}),2e3),this.toastInfo.remove=()=>{if(!this.toastInfo.id)return;Date.now()-this.toastInfo.showTime>2e3?r.remove(this.toastInfo.id):this.toastInfo.delayClose=!0},this.player.once(Ao,this.toastInfo.remove),this.player.once(Qr,this.toastInfo.remove)}selectDefinition(e){var t,i,n;const r=null==(n=null==(i=null==(t=this.renderList)?void 0:t.find)?void 0:i.call(t,(t=>this.playerData.isDefinitionMatch(t.definition,e.definition))))?void 0:n.definitionTextKey;this.config.showToastOnManualClick&&this.showToast(u(c({},e),{definitionTextKey:r}),e.definition),this.playerData.current.definition=e.definition,this.playerData.isAutoDefinition(e.definition)||(this._autoRealDefinition=void 0)}showRealDefinition(e){return e.selected&&this.playerData.isAutoDefinition(e.definition)&&this.playerData.showRealDefinition()&&this._autoRealDefinition&&!this.playerData.isAutoDefinition(this._autoRealDefinition)}dataMonitoring(){this.playerData&&(this.definitionSubscribeId=hr.subscribeProperty(this.playerData.current,"definition",((e,t)=>{if(e&&t&&e!==t&&this.player){const{list:i}=this.getCurrentDefinitionInfo(this.player),n=i.find((e=>e.definition===t));n&&n.url&&(this.player.changeDefinition(u(c({kid:n.playAuthId},n),{secretKey:n.secretKey,definition:t,url:n.url})),"MOBILE"===this.clientType&&this.updatePanel(),this.player.emit(LA.INNER_DEFINITION_CHANGE,{from:e,to:t,url:n.url}),this.player.emit(LA.PlAY_URL_CHANGE,{url:n.url,from:LA.INNER_DEFINITION_CHANGE}),"PC"===this.clientType&&this.renderItemList(t),this.player.config.isLive&&(this._playTimer=setTimeout((()=>{this.player.ended?this.player.replay():this.player.paused&&this.player.play()}),1e3)))}})),this.playListSubscribeId=hr.subscribeProperty(this.playerData,"playList",(()=>{this.refreshDefinitionList()})))}onItemClick(...e){super.onItemClick(...e)}destroy(){clearTimeout(this.toastInfo.timer),clearTimeout(this._playTimer),this.autoDefDetectTimer&&(this.autoDefDetectTimer.clear(),this.autoDefDetectTimer=null,this.getAutoDefRealLevel=null),this.off("resourceReady",this.handleResourceReady),this.off("ABR_AUTO_DESC_CHANGE",this.handleABRDescChange)}};class WA extends(KA(xA)){constructor(e){const t=e.config.className;super(u(c({},e),{config:c(c({},e.config),t?{className:`${t} xgplayer-definition-plugin-pc`}:{}),clientType:"PC"})),this.onItemClick=function(e,t,i){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return A(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),aA(e,t,{leading:n,maxWait:t,trailing:r})}(this.onItemClick.bind(this),1e3,{trailing:!0})}static get pluginName(){return"sdkDefinitionPlugin"}static get defaultConfig(){return{position:ba.POSITIONS.CONTROLS_RIGHT,index:FA,list:[],defaultDefinition:"",hidePortrait:!1,disable:!1,showToastOnManualClick:!0,className:"xgplayer-definition xgplayer-definition-plugin-pc",isShowIcon:!0,isNeedAuto:!0,allowedSize:null,alwaysShowDefinition:!1}}registerLanguageTexts(){return{switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}afterCreate(){super.afterCreate()}refreshDefinitionList(){var e;(null==(e=this.player.config)?void 0:e.alwaysShowDefinition)&&(this.config.alwaysShowDefinition=!0);const{defaultDefinition:t,list:i}=this.getCurrentDefinitionInfo(this.player);this.config.defaultDefinition=t,this.config.list=i.map(((e,t)=>u(c({},e),{itemIndex:t}))),this.config.list&&this.config.list.length>0&&(this.config.list.length<2?this.config.alwaysShowDefinition?(this.renderItemList(),this.show()):this.hide():(this.renderItemList(),this.show()))}show(){var e;!this.config.list||(null==(e=this.config.list)?void 0:e.length)<2&&!this.config.alwaysShowDefinition||Ur.addClass(this.root,"show")}afterPlayerInit(){}renderItemList(e){if(Array.isArray(e))return;const{list:t,defaultDefinition:i}=this.config;let n=0;const r=t.map(((t,r)=>{var o;const a={url:t.url,definition:t.definition||"",definitionTextKey:t.definitionTextKey,showText:this.getShowText(this.i18n,t,t.definition),isCurrent:!1,selected:!1,isDefinitionAuto:!1},s="string"==typeof e?t.definition===e:void 0===e&&t.definition===i;if(!Ur.isUndefined(t.definition)&&s&&(a.isCurrent=!0,a.selected=!0,n=r),this.showRealDefinition(a)){const e=null==(o=this.renderList)?void 0:o.find((e=>this.playerData.isDefinitionMatch(null==e?void 0:e.definition,this._autoRealDefinition))),t=this.getShowText(this.i18n,e,null==e?void 0:e.definition);a.showText=t?`${a.showText}(${t})`:a.showText}return a.isDefinitionAuto=this.playerData.isAutoDefinition(t.definition),a}));this.renderList=r,super.renderItemList(r,n)}onItemClick(e,t){var i;if(t.to.definition!==this.playerData.current.definition){const n=null==(i=this.playerData.getCurrentStreams())?void 0:i[0];this.emitUserAction(e,"change_definition",{from:n,to:t.to}),this.selectDef(t.to)}}selectDef(e){this.selectDefinition(e),"ontouchstart"in window&&this.optionsList.hide()}changeDefinition(e){const t=this.renderList.find((t=>this.playerData.isDefinitionMatch(t.definition,e)));t&&this.selectDef(t)}destroy(){super.destroy()}}function GA(e){const t={};for(const i of["lang","name"]){const n=e[i];void 0!==n&&(t[i]=n)}return t}function YA(e,t){if(!(t<0||t>=e.length))for(let i=0;i<e.length;i++)e[i].enabled=i===t}function zA(e,t){const i=e;if("function"==typeof i.setAudioOption)i.setAudioOption(GA(t));else{const{id:i,lang:n,name:r}=t,o=e.audioTracks.find((e=>e.id===i&&((void 0===n||e.lang===n)&&(void 0===r||e.name===r))));if(!o||e.audioTrack===o.id)return;e.audioTrack=o.id}}const $A={zh:"中文","zh-cn":"普通话","zh-hk":"粤語","zh-tw":"繁體中文","zh-sg":"普通话",en:"English",ja:"日本語",ko:"한국어",th:"ภาษาไทย",vi:"Tiếng Việt",id:"Bahasa Indonesia",ms:"Bahasa Melayu",fil:"Filipino",tl:"Filipino",my:"မြန်မာဘာသာ",km:"ភាសាខ្មែរ",lo:"ພາສາລາວ",hi:"हिन्दी",bn:"বাংলা",ta:"தமிழ்",te:"తెలుగు",mr:"मराठी",ur:"اردو",fr:"Français",de:"Deutsch",es:"Español","es-419":"Español (Latinoamérica)",it:"Italiano",pt:"Português","pt-br":"Português (Brasil)","pt-pt":"Português (Portugal)",nl:"Nederlands",sv:"Svenska",da:"Dansk",no:"Norsk",fi:"Suomi",ca:"Català",ru:"Русский",pl:"Polski",uk:"Українська",cs:"Čeština",sk:"Slovenčina",ro:"Română",hu:"Magyar",bg:"Български",hr:"Hrvatski",sr:"Српски",sl:"Slovenščina",el:"Ελληνικά",ar:"العربية",fa:"فارسی",he:"עברית",tr:"Türkçe",az:"Azərbaycan",kk:"Қазақша",mn:"Монгол",sw:"Kiswahili"};function XA(e){var t;return null!=(t=$A[e.toLowerCase()])?t:e.toUpperCase()}function qA(e,t){var i;const n=null!=(i=e.name)?i:"",r=e.lang?XA(e.lang):"";return[r||n||`Track ${e.id+1}`,!1!==(null==t?void 0:t.showNameSuffix)&&r&&n?`(${n})`:""].filter(Boolean).join(" ")}function ZA(e,t,i){var n;const r=null!=(n=e.label)?n:"",o=e.language?XA(e.language):"";return[o||r||`Track ${t+1}`,!1!==(null==i?void 0:i.showNameSuffix)&&o&&r?`(${r})`:""].filter(Boolean).join(" ")}class QA extends xA{constructor(){super(...arguments),this._nativeMode=!1,this._nativeAddTrackHandler=null,this._nativeChangeHandler=null,this._nativeRemoveTrackHandler=null,this._nativeChangeRaf=null}static get pluginName(){return"AudioTrack"}static get defaultConfig(){return u(c({},xA.defaultConfig),{position:ba.POSITIONS.CONTROLS_RIGHT,index:BA,list:[],className:"xgplayer-audio-track",hidePortrait:!1,isShowIcon:!0,showNameSuffix:!0})}registerIcons(){return{}}afterPlayerInit(){var e;super.afterPlayerInit(),this.on("hlsAudioTracksUpdated",(e=>{this._onAudioTracksUpdated(e.audioTracks)})),this.on("hlsAudioTrackSwitched",(e=>{this._updateSelection(e.id)}));const t=this._getHls();(null==(e=null==t?void 0:t.audioTracks)?void 0:e.length)>1?this._onAudioTracksUpdated(t.audioTracks):t?this.hide():this._initNativeAudioTracks()}onItemClick(e,t){if(super.onItemClick(e,t),this._nativeMode){const e=this._getNativeTrackList();if(!e)return;YA(e,t.to.id)}else{const e=this._getHls();if(!e)return;zA(e,t.to)}}destroy(){var e;null!==this._nativeChangeRaf&&cancelAnimationFrame(this._nativeChangeRaf),this._unbindNativeAudioTracks(),null==(e=super.destroy)||e.call(this)}_getHls(){var e,t;const i=this.player.plugins;return(null==(e=null==i?void 0:i.encrypthlsplugin)?void 0:e.hls)||(null==(t=null==i?void 0:i.hls)?void 0:t.hls)}_getNativeTrackList(){var e,t;return null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks}_initNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeMode=!0,this._nativeAddTrackHandler=()=>this._onNativeTracksChanged(),this._nativeChangeHandler=()=>{null===this._nativeChangeRaf&&(this._nativeChangeRaf=requestAnimationFrame((()=>{this._nativeChangeRaf=null,this._onNativeTrackEnabled()})))},this._nativeRemoveTrackHandler=()=>this._onNativeTracksChanged(),e.addEventListener("addtrack",this._nativeAddTrackHandler),e.addEventListener("change",this._nativeChangeHandler),e.addEventListener("removetrack",this._nativeRemoveTrackHandler),e.length>1?this._onNativeTracksChanged():this.hide())}_unbindNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeAddTrackHandler&&e.removeEventListener("addtrack",this._nativeAddTrackHandler),this._nativeChangeHandler&&e.removeEventListener("change",this._nativeChangeHandler),this._nativeRemoveTrackHandler&&e.removeEventListener("removetrack",this._nativeRemoveTrackHandler))}_onNativeTracksChanged(){const e=this._getNativeTrackList();!e||e.length<=1?this.hide():(this._renderNativeTracks(e),this.show())}_onNativeTrackEnabled(){const e=this._getNativeTrackList();e&&this._renderNativeTracks(e)}_renderNativeTracks(e){const t={showNameSuffix:!1!==this.config.showNameSuffix},i=[];for(let r=0;r<e.length;r++){const n=e[r],o=ZA(n,r,t);i.push({id:r,name:o,showText:o,iconText:o,selected:n.enabled,default:n.enabled})}const n=i.findIndex((e=>e.selected));this.config.list=i,super.renderItemList(i,n>-1?n:0)}_onAudioTracksUpdated(e){!e||e.length<=1?this.hide():(this._renderTracks(e),this.show())}_updateSelection(e){const t=this._getHls();t&&this._renderTracks(t.audioTracks,e)}_renderTracks(e,t){var i;const n=this._getHls(),r=null!=(i=null!=t?t:null==n?void 0:n.audioTrack)?i:-1,o={showNameSuffix:!1!==this.config.showNameSuffix},a=e.find((e=>e.default)),s=e.map((e=>u(c({},e),{showText:qA(e,o),iconText:qA(e,o),selected:e.id===r})));if(-1===r&&a){const e=s.findIndex((e=>e.id===a.id));e>-1&&(s[e].selected=!0)}const l=s.findIndex((e=>e.selected));this.config.list=s,super.renderItemList(s,l>-1?l:0)}}function JA(){return(new DOMParser).parseFromString('<svg width="19" height="16" viewBox="0 0 19 15" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_18_7532)" filter="url(#filter0_d_18_7532)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M9.33333 3.19115C9.33333 2.79702 8.91856 2.54067 8.56604 2.71694L4.66668 4.66662C4.66667 4.66662 4.66667 4.66663 4.66667 4.66663C4.66667 4.66664 4.66666 4.66665 4.66665 4.66665H3.19685C2.90404 4.66665 2.66666 4.90402 2.66666 5.19684V9.4698C2.66666 9.76261 2.90404 9.99998 3.19685 9.99998H4.55791C4.62971 9.99998 4.70076 10.0146 4.76676 10.0429L8.5943 11.6832C8.94415 11.8332 9.33333 11.5765 9.33333 11.1959V3.19115Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M13 6.87773L14.8934 4.7138C14.9485 4.6509 15.0377 4.6509 15.0927 4.7138L15.2921 4.94158C15.3471 5.00448 15.3471 5.10646 15.2921 5.16936L13.3986 7.33329L15.2921 9.49722C15.3471 9.56012 15.3471 9.6621 15.2921 9.725L15.0927 9.95278C15.0377 10.0157 14.9485 10.0157 14.8934 9.95278L13 7.78886L11.1066 9.95278C11.0515 10.0157 10.9623 10.0157 10.9073 9.95278L10.7079 9.725C10.6529 9.6621 10.6529 9.56012 10.7079 9.49722L12.6014 7.33329L10.7079 5.16936C10.6529 5.10646 10.6529 5.00448 10.7079 4.94158L10.9073 4.7138C10.9623 4.6509 11.0515 4.6509 11.1066 4.7138L13 6.87773Z" fill="white" stroke="white" stroke-width="0.530187"/>\n </g>\n <defs>\n <filter id="filter0_d_18_7532" x="-0.666667" y="0" width="19.3333" height="19.3333" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n <feFlood flood-opacity="0" result="BackgroundImageFix"/>\n <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n <feOffset dy="2.66667"/>\n <feGaussianBlur stdDeviation="1.33333"/>\n <feComposite in2="hardAlpha" operator="out"/>\n <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>\n <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_18_7532"/>\n <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_18_7532" result="shape"/>\n </filter>\n <clipPath id="clip0_18_7532">\n <rect width="14" height="14" fill="white" transform="translate(2)"/>\n </clipPath>\n </defs>\n</svg>\n\n',"image/svg+xml").firstChild}const{isWeixin:eR,os:tR,device:iR}=Kr,nR=tR.isAndroid,rR=tR.isIos,oR="mobile"===iR;let aR=0,sR=!1;class lR extends ba{constructor(e){super(e),this.state={mode:0,showUnmuteBt:!1},this.wxCanPlayFn=()=>{window.WeixinJSBridge&&window.WeixinJSBridge.invoke("getNetworkType",{},(()=>{this.wxTimer=setTimeout((()=>{this.wxTimer&&clearTimeout(this.wxTimer);const e=this.player.play();e&&e.then?e.then((()=>{as.log("wechat autoplay success")})).catch((e=>{as.warn("wechat autoplay fail:",e),this.state.showUnmuteBt=!1,this.renderUnmuteBt()})):as.warn("wechat browser no play promise")}))}))},this.wxPlay=()=>{this.player.readyState>=2?this.wxCanPlayFn():nR?this.player.once(no,this.wxCanPlayFn):rR&&this.player.once(mo,this.wxCanPlayFn)},this.userClickPlay=()=>{if(sR)return;const e=this.player.play();e&&e.then?e.then((()=>{as.log("user action autoplay success"),sR=!0})).catch((e=>{as.warn("user action autoplay fail:",e)})):(as.warn("no play promise"),sR=!0)},this.handleAutoplayPrevented=()=>0===this.state.mode?(as.warn("unmute autoplay fail"),this.player.emit(LA.AUTOPLAY_FAILED,{mode:"unmute"}),nR&&eR?void(this.state.mode=2):void(this.config.enableDegradeMuteAutoplay&&this.changeMuteMode())):1===this.state.mode?(as.warn("mute autoplay fail"),this.player.emit(LA.AUTOPLAY_FAILED,{mode:"mute"}),void(this.state.mode=2)):2===this.state.mode?(this.player.emit(LA.AUTOPLAY_FAILED,{mode:"noSupport"}),void as.warn("not support autoplay")):void 0,this.handleAutoplayStart=()=>{if(0!==this.state.mode)return 1===this.state.mode?(this.player.emit(LA.AUTOPLAY_SUCCESS,{mode:"mute"}),this.state.showUnmuteBt=!0,void this.renderUnmuteBt()):2===this.state.mode?(this.player.emit(LA.AUTOPLAY_SUCCESS,{mode:"click"}),this.player.muted=!1,this.state.showUnmuteBt=!1,void this.renderUnmuteBt()):void 0;this.player.emit(LA.AUTOPLAY_SUCCESS,{mode:"unmute"})},this.handleVolumechange=()=>{this.state.showUnmuteBt&&(this.state.showUnmuteBt=!1,this.renderUnmuteBt(),this.player.paused&&this.player.readyState>=1&&this.player.play())},this.cancelUnmute=e=>{const t=Date.now();t-aR>200&&(aR=t,this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt(),this.emitUserAction(e,"cancel_mute"))}}static get pluginName(){return"AutoplayPlugin"}static get defaultConfig(){return{position:ba.POSITIONS.ROOT,enableDegradeMuteAutoplay:!1,enableWxJsBridgeAutoplay:!1,userActionDom:window.document.body,enableUserActionAutoplay:!1,showUnmuteBtn:!0}}afterCreate(){this.initState(),this.initEvents(),this.setWXAutoPlay()}registerLanguageTexts(){return{unmute:{jp:"ミュートを解除する",en:"Click to unmute",zh:"点击取消静音","zh-hk":"點擊取消靜音"},muted:{jp:"ミュート",en:"muted",zh:"已静音","zh-hk":"已靜音"}}}registerIcons(){return{muted:{icon:JA,class:"xgplayer-muted-svg"}}}updateLang(){this.renderUnmuteBt()}initState(){const{enableDegradeMuteAutoplay:e,enableWxJsBridgeAutoplay:t,enableUserActionAutoplay:i}=this.player.config;e&&(this.config.enableDegradeMuteAutoplay=!0),t&&(this.config.enableWxJsBridgeAutoplay=!0),i&&(this.config.enableUserActionAutoplay=!0),this.state.mode=this.player.muted?1:0}initEvents(){this.player.on(vo,this.handleAutoplayPrevented),this.player.on(yo,this.handleAutoplayStart),this.player.on(oo,this.handleVolumechange),this.setUserActionAutoPlay()}setWXAutoPlay(){eR&&this.player.config.autoplay&&this.config.enableWxJsBridgeAutoplay&&(window.WeixinJSBridge?this.wxPlay():document.addEventListener("WeixinJSBridgeReady",this.wxPlay,!1))}setUserActionAutoPlay(){var e;(null==(e=this.config)?void 0:e.enableUserActionAutoplay)&&this.player.once(LA.AUTOPLAY_FAILED,(()=>{this.hasSetUserAutoplay=!0;(this.config.userActionDom instanceof window.Node?this.config.userActionDom:window.document.body).addEventListener("click",this.userClickPlay,!1)}))}changeMuteMode(){this.player.muted=!0,this.state.showUnmuteBt=!0,this.state.mode=1,this.renderUnmuteBt(),this.timer=setTimeout((()=>{this.timer&&clearTimeout(this.timer);const e=this.player.play();e&&e.then?e.then((()=>{as.log("degrade mute autoplay success")})).catch((e=>{as.warn("degrade mute autoplay fail:",e),this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt()})):as.warn("no play promise")}))}renderUnmuteBt(){var e,t,i;const n=this.root;if(n&&(n.innerHTML="",this.state.showUnmuteBt&&this.config.showUnmuteBtn)){const r=this.langText.unmute||(null==(i=null==(t=null==(e=this.registerLanguageTexts)?void 0:e.call(this))?void 0:t.unmute)?void 0:i.en),o=Ur.createDom("div",r,void 0,"xgplayer-unmute-bt");n.appendChild(o),this.bind(".xgplayer-unmute-bt","click",this.cancelUnmute),this.bind(".xgplayer-unmute-bt","touchend",this.cancelUnmute)}}destroy(){if(this.player.off(vo,this.handleAutoplayPrevented),this.player.off(yo,this.handleAutoplayStart),this.player.off(oo,this.handleVolumechange),this.timer&&window.clearTimeout(this.timer),this.wxTimer&&window.clearTimeout(this.wxTimer),document.removeEventListener("WeixinJSBridgeReady",this.wxPlay,!1),this.hasSetUserAutoplay){const e=oR?"touch":"click";(this.config.userActionDom instanceof window.Node?this.config.userActionDom:window.document.body).removeEventListener(e,this.userClickPlay,!1)}}render(){return'<div class="xgplayer-unmute"></div>'}}function cR(){return(new DOMParser).parseFromString('<svg width="18" height="18" viewBox="0 0 23 22" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M5.75 11C5.75 11.9665 4.9665 12.75 4 12.75C3.0335 12.75 2.25 11.9665 2.25 11C2.25 10.0335 3.0335 9.25 4 9.25C4.9665 9.25 5.75 10.0335 5.75 11ZM13.25 11C13.25 11.9665 12.4665 12.75 11.5 12.75C10.5335 12.75 9.75 11.9665 9.75 11C9.75 10.0335 10.5335 9.25 11.5 9.25C12.4665 9.25 13.25 10.0335 13.25 11ZM19 12.75C19.9665 12.75 20.75 11.9665 20.75 11C20.75 10.0335 19.9665 9.25 19 9.25C18.0335 9.25 17.25 10.0335 17.25 11C17.25 11.9665 18.0335 12.75 19 12.75Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}class uR extends ba{constructor(e){super(e),this.panel=null,this.panelContainer=null}static get pluginName(){return"MoreButtonPlugin"}static get defaultConfig(){return{position:ba.POSITIONS.ROOT_TOP,iconPlugins:[],maxShowNum:2}}beforePlayerInit(){}afterPlayerInit(){}afterCreate(){this.renderMoreIcon()}updateLang(e){if(!this.panelContainer)return;const t=this.panelContainer.querySelectorAll(".panel-icon-bt-text"),i=this.getAndSplitList().extraList;t.forEach((t=>{var n,r;const o=Number(t.getAttribute("plugin-index"));(null==(r=null==(n=i[o])?void 0:n.textTips)?void 0:r[e])&&(t.innerHTML=i[o].textTips[e])}))}registerIcons(){return{more:{icon:cR,class:"xgplayer-more-svg"}}}getAndSplitList(){var e;let t,i;const n=(null!=(e=this.player.config.ignores)?e:[]).map((e=>e.toLowerCase())),r=this.config.iconPlugins.filter((e=>!n.includes(e.pluginName.toLowerCase())));return r.length>this.config.maxShowNum+1?(t=r.slice(0,this.config.maxShowNum),i=r.slice(-(r.length-this.config.maxShowNum))):t=[...r],{list:null!=t?t:[],extraList:null!=i?i:[]}}children(){const e=this.getAndSplitList().list,t={};return e.forEach((e=>{t[e.pluginName]={plugin:e,options:{root:this.root}}})),t}renderMoreIcon(){const e=this.getAndSplitList().extraList;if(0===e.length)return;const t=this.root,i=Ur.createDom("div","",{},"xgplayer-icon");i.appendChild(this.icons.more),i.addEventListener("click",(()=>{this.renderPanel(e)}));const n=Ur.createDom("xg-icon","",{"data-index":0},"xgplayer-more");n.appendChild(i),t.appendChild(n)}renderPanel(e){this.panelContainer||(this.panelContainer=Ur.createDom("div","",{},"panel-content"),e.forEach(((e,t)=>{var i,n;const r=Ur.createDom("div","",{},"panel-icon-bt"),o=Ur.createDom("div","",{},"panel-icon-svg");r.appendChild(o),this.registerExtraPlugin(e,o);const a="zh-cn"===this.player.lang?"zh":this.player.lang,s=null!=(n=null==(i=e.textTips)?void 0:i[a])?n:e.pluginName;r.appendChild(Ur.createDom("span",s,{"plugin-index":t},"panel-icon-bt-text")),this.panelContainer.appendChild(r)}))),this.player.panel.showPanel(this.panelContainer)}registerExtraPlugin(e,t){this.player.registerPlugin({plugin:e,options:{root:t}})}destroy(){}render(){return'<div class="xgplayer-rightTop-iconList"></div>'}}function hR(){return(new DOMParser).parseFromString('<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M68 40C68 55.464 55.464 68 40 68C24.536 68 12 55.464 12 40C12 24.536 24.536 12 40 12C55.464 12 68 24.536 68 40ZM34.75 34.05C34.75 35.7897 33.5747 37.2 32.125 37.2C30.6753 37.2 29.5 35.7897 29.5 34.05C29.5 32.3103 30.6753 30.9 32.125 30.9C33.5747 30.9 34.75 32.3103 34.75 34.05ZM40.2276 43.7334C36.2145 43.7334 32.6052 45.4732 30.1709 48.2331C29.5316 48.9579 29.6009 50.0638 30.3258 50.7031C31.0506 51.3424 32.1565 51.2731 32.7958 50.5483C34.5802 48.5252 37.2407 47.2334 40.2276 47.2334C43.2213 47.2334 45.8871 48.531 47.6715 50.562C48.3094 51.288 49.4152 51.3594 50.1412 50.7215C50.8673 50.0836 50.9387 48.9778 50.3008 48.2518C47.8663 45.481 44.2498 43.7334 40.2276 43.7334ZM47.8352 37.2C49.2849 37.2 50.4602 35.7897 50.4602 34.05C50.4602 32.3103 49.2849 30.9 47.8352 30.9C46.3854 30.9 45.2102 32.3103 45.2102 34.05C45.2102 35.7897 46.3854 37.2 47.8352 37.2Z" fill="#ffffff" fill-opacity="0.15"/>\n</svg>\n',"image/svg+xml").firstChild}var dR=(e=>(e.NETWORK="NETWORK",e.NETWORK_TIMEOUT="NETWORK_TIMEOUT",e.NETWORK_FORBIDDEN="NETWORK_FORBIDDEN",e.NETWORK_NOTFOUND="NETWORK_NOTFOUND",e.NETWORK_RANGE_NOT_SATISFIABLE="NETWORK_RANGE_NOT_SATISFIABLE",e.NETWORK_PROTOCOL="NETWORK_PROTOCOL",e.NETWORK_URL_EXPIRE="NETWORK_URL_EXPIRE",e.NETWORK_URL_SIGN="NETWORK_URL_SIGN",e.NETWORK_ENCRYPT_HLS_ERR="NETWORK_ENCRYPT_HLS_ERR",e.MEDIA_ERR="MEDIA_ERR",e.MEDIA_ERR_ABORTED="MEDIA_ERR_ABORTED",e.MEDIA_ERR_NETWORK="MEDIA_ERR_NETWORK",e.MEDIA_ERR_DECODE="MEDIA_ERR_DECODE",e.MEDIA_ERR_SRC_NOT_SUPPORTED="MEDIA_ERR_SRC_NOT_SUPPORTED",e.MEDIA_ERR_NOT_SUPPORTED="MEDIA_ERR_NOT_SUPPORTED",e.MEDIA_ERR_URL_EMPTY="MEDIA_ERR_URL_EMPTY",e.MEDIA_ERR_FILE_NOT_SUPPORTED="MEDIA_ERR_FILE_NOT_SUPPORTED",e.MEDIA_ERR_PLAY_ERR="MEDIA_ERR_PLAY_ERR",e.MEDIA_SOURCE_CANNOT_PLAY_TYPE="MEDIA_SOURCE_CANNOT_PLAY_TYPE",e.BUSINESS_DRM_NOT_SUPPORT="BUSINESS_DRM_NOT_SUPPORT",e.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD="BUSINESS_DRM_NOT_SUPPORT_UN_RECORD",e.BUSINESS_DRM_LACK_MEDIA_KEY="BUSINESS_DRM_LACK_MEDIA_KEY",e.BUSINESS_DRM_LACK_KEY_SESSION="BUSINESS_DRM_LACK_KEY_SESSION",e.BUSINESS_DRM_GENERATE_REQUEST_FAIL="BUSINESS_DRM_GENERATE_REQUEST_FAIL",e.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH="BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH",e.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH="BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH",e.BUSINESS_DRM_LICENSE_FAIL="BUSINESS_DRM_LICENSE_FAIL",e.BUSINESS_DRM_KEY_ERROR="BUSINESS_DRM_KEY_ERROR",e.BUSINESS_DRM_CERT_FAIL="BUSINESS_DRM_CERT_FAIL",e.PRIVATE_DRM_KEY_GET_FAILED="PRIVATE_DRM_KEY_GET_FAILED",e.PRIVATE_DRM_CRYPTO_NOT_SUPPORT="PRIVATE_DRM_CRYPTO_NOT_SUPPORT",e.PRIVATE_DRM_RSA_FAIL="PRIVATE_DRM_RSA_FAIL",e.OTHER="OTHER",e.VOD_LOG_NOT_CONFIGURED="VOD_LOG_NOT_CONFIGURED",e.PLAY_AUTH_TOKEN_EXPIRED="PLAY_AUTH_TOKEN_EXPIRED",e.HLS_KEY_TOKEN_EXPIRED="HLS_KEY_TOKEN_EXPIRED",e.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED="THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED",e.GET_PLAY_INFO_ERR="GET_PLAY_INFO_ERR",e.GET_HLS_DECRYPTION_KEY_ERR="GET_HLS_DECRYPTION_KEY_ERR",e.LICENSE_VALIDATE_FAIL="LICENSE_VALIDATE_FAIL",e.DEFINITION_AUTO="DEFINITION_AUTO",e.LICENSE_STATUS_INVALID="LICENSE_STATUS_INVALID",e.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH="LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH",e.BASE_LICENSE_NOT_SUPPORT_265="BASE_LICENSE_NOT_SUPPORT_265",e.BASE_LICENSE_NOT_SUPPORT_ABR="BASE_LICENSE_NOT_SUPPORT_ABR",e.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER="BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER",e.BASE_LICENSE_NOT_SUPPORT_PRELOAD="BASE_LICENSE_NOT_SUPPORT_PRELOAD",e.EXPIRED_LICENSE_NOT_SUPPORT_265="EXPIRED_LICENSE_NOT_SUPPORT_265",e.EXPIRED_LICENSE_NOT_SUPPORT_ABR="EXPIRED_LICENSE_NOT_SUPPORT_ABR",e.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER="EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER",e.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD="EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD",e.DRAMA_INVALID_PARAM="DRAMA_INVALID_PARAM",e.DRAMA_NO_INFO_FOUND="DRAMA_NO_INFO_FOUND",e.DRAMA_NOT_SUBMITTED="DRAMA_NOT_SUBMITTED",e.DRAMA_UNDER_REVIEW="DRAMA_UNDER_REVIEW",e.DRAMA_FAILED_REVIEW="DRAMA_FAILED_REVIEW",e.DRAMA_WITHDRAWN_REVIEW="DRAMA_WITHDRAWN_REVIEW",e.DRAMA_FAILED_TO_QUERY="DRAMA_FAILED_TO_QUERY",e.DRAMA_INVALID_TTOP_TOKEN="DRAMA_INVALID_TTOP_TOKEN",e.DRAMA_NOT_ON_SHELF="DRAMA_NOT_ON_SHELF",e.DRAMA_FAILED_GET_EPISODE_INFO="DRAMA_FAILED_GET_EPISODE_INFO",e))(dR||{});const fR={NETWORK:{code:2100,message:"Network error",textKey:dR.NETWORK},NETWORK_TIMEOUT:{code:2101,message:"Network timeout",textKey:dR.NETWORK_TIMEOUT},NETWORK_FORBIDDEN:{code:2103,message:"Block access to this media",textKey:dR.NETWORK_FORBIDDEN},NETWORK_NOTFOUND:{code:2104,message:"Media not found",textKey:dR.NETWORK_NOTFOUND},NETWORK_RANGE_NOT_SATISFIABLE:{code:2116,message:"Media fetch range not satisfiable",textKey:dR.NETWORK_RANGE_NOT_SATISFIABLE},NETWORK_PROTOCOL:{code:2190,message:"The current page protocol is https, but video url protocol is http",textKey:dR.NETWORK_PROTOCOL},NETWORK_URL_EXPIRE:{code:2191,message:"Media url has expired",textKey:dR.NETWORK_URL_EXPIRE},NETWORK_URL_SIGN:{code:2192,message:"Media url signature parameter error",textKey:dR.NETWORK_URL_SIGN},NETWORK_ENCRYPT_HLS_ERR:{code:2193,message:"Get m3u8 file or encrypt key fail",textKey:dR.NETWORK_ENCRYPT_HLS_ERR},MEDIA_ERR_ABORTED:{code:5101,message:"User or browser abort the media",textKey:dR.NETWORK_URL_SIGN},MEDIA_ERR_NETWORK:{code:5102,message:"Network error",textKey:dR.MEDIA_ERR_NETWORK},MEDIA_ERR_DECODE:{code:5103,message:"Media decode error",textKey:dR.MEDIA_ERR_DECODE},MEDIA_ERR_SRC_NOT_SUPPORTED:{code:5104,message:"Media is not supported or url is not available",textKey:dR.MEDIA_ERR_SRC_NOT_SUPPORTED},MEDIA_ERR_NOT_SUPPORTED:{code:5105,message:"Media not support play",textKey:dR.MEDIA_ERR_NOT_SUPPORTED},MEDIA_ERR_URL_EMPTY:{code:5106,message:"Media url empty",textKey:dR.MEDIA_ERR_URL_EMPTY},MEDIA_ERR_FILE_NOT_SUPPORTED:{code:5901,message:"Media file not supported",textKey:dR.MEDIA_ERR_FILE_NOT_SUPPORTED},MEDIA_ERR_PLAY_ERR:{code:5902,message:"Media play error",textKey:dR.MEDIA_ERR_PLAY_ERR},BUSINESS_DRM_NOT_SUPPORT:{code:7101,message:"DRM encrypted playback is not supported",textKey:dR.BUSINESS_DRM_NOT_SUPPORT},BUSINESS_DRM_NOT_SUPPORT_UN_RECORD:{code:7102,message:"Anti-screen recording is not supported",textKey:dR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD},BUSINESS_DRM_LACK_MEDIA_KEY:{code:7103,message:"The video data lacks the corresponding MediaKey",textKey:dR.BUSINESS_DRM_LACK_MEDIA_KEY},BUSINESS_DRM_LACK_KEY_SESSION:{code:7104,message:"The browser does not support the corresponding DRM KeySession",textKey:dR.BUSINESS_DRM_LACK_KEY_SESSION},BUSINESS_DRM_GENERATE_REQUEST_FAIL:{code:7105,message:"Decryption playback error",textKey:dR.BUSINESS_DRM_GENERATE_REQUEST_FAIL},BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH:{code:7106,message:"Missing DRM certificate request link",textKey:dR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH},BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH:{code:7107,message:"Missing DRM License request link",textKey:dR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH},BUSINESS_DRM_LICENSE_FAIL:{code:7108,message:"Failed to request or update a license",textKey:dR.BUSINESS_DRM_LICENSE_FAIL},BUSINESS_DRM_KEY_ERROR:{code:7109,message:"Decryption Error",textKey:dR.BUSINESS_DRM_KEY_ERROR},BUSINESS_DRM_CERT_FAIL:{code:7110,message:"Failed to request DRM certificate",textKey:dR.BUSINESS_DRM_CERT_FAIL},PRIVATE_DRM_GET_KEY_FAILED:{code:7200,message:"Private DRM key get failed",textKey:dR.PRIVATE_DRM_KEY_GET_FAILED},PRIVATE_DRM_CRYPTO_NOT_SUPPORT:{code:7201,message:"Web cryptography API is not supported",textKey:dR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT},PRIVATE_DRM_RSA_FAIL:{code:7202,message:"Decryption by RSA-OAEP failed",textKey:dR.PRIVATE_DRM_RSA_FAIL},OTHER:{code:8e3,message:"Other error",textKey:dR.OTHER},VOD_LOG_NOT_CONFIGURED:{code:8999,message:"Log options not configured correctly",textKey:dR.VOD_LOG_NOT_CONFIGURED},PLAY_AUTH_TOKEN_EXPIRED:{code:10001,message:"playAuthToken has expired",textKey:dR.PLAY_AUTH_TOKEN_EXPIRED},HLS_KEY_TOKEN_EXPIRED:{code:10003,message:"keyToken has expired",textKey:dR.HLS_KEY_TOKEN_EXPIRED},THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED:{code:10003,message:"thirdPartyDrmAuthToken has expired",textKey:dR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED},GET_PLAY_INFO_ERR:{code:11001,message:"Failed to get play info",textKey:dR.GET_PLAY_INFO_ERR},GET_HLS_DECRYPTION_KEY_ERR:{code:11002,message:"Failed to get the HLS decryption key",textKey:dR.GET_HLS_DECRYPTION_KEY_ERR},LICENSE_STATUS_INVALID:{code:12001,message:"License validation is invalid",textKey:dR.LICENSE_STATUS_INVALID},LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH:{code:12002,message:"License domain name does not match",textKey:dR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH}},pR={BASE_LICENSE_NOT_SUPPORT_265:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12111,message:"The basic license does not support H265",textKey:dR.BASE_LICENSE_NOT_SUPPORT_265},BASE_LICENSE_NOT_SUPPORT_ABR:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12112,message:"The basic license does not support ABR",textKey:dR.BASE_LICENSE_NOT_SUPPORT_ABR},BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12113,message:"The basic license does not support dynamic buffer",textKey:dR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER},BASE_LICENSE_NOT_SUPPORT_PRELOAD:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12114,message:"The basic license does not support preload",textKey:dR.BASE_LICENSE_NOT_SUPPORT_PRELOAD},EXPIRED_LICENSE_NOT_SUPPORT_265:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12211,message:"Expired license does not support H265",textKey:dR.EXPIRED_LICENSE_NOT_SUPPORT_265},EXPIRED_LICENSE_NOT_SUPPORT_ABR:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12212,message:"Expired license does not support ABR",textKey:dR.EXPIRED_LICENSE_NOT_SUPPORT_ABR},EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12213,message:"The expired license does not support dynamic buffer",textKey:dR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER},EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12214,message:"Expired license does not support preloading",textKey:dR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD}};var gR=(e=>(e[e.manifest=1]="manifest",e[e.network=2]="network",e[e.demux=3]="demux",e[e.remux=4]="remux",e[e.media=5]="media",e[e.decoder=6]="decoder",e[e.drm=7]="drm",e[e.other=8]="other",e[e.runtime=9]="runtime",e[e.token=10]="token",e[e.serve=11]="serve",e[e.license=12]="license",e[e.ad=13]="ad",e))(gR||{});const yR={INVALID_PARAM:{code:9301,message:"Invalid parameter in short drama environment",textKey:dR.DRAMA_INVALID_PARAM},NO_INFO_FOUND:{code:9302,message:"No information found for this Episode",textKey:dR.DRAMA_NO_INFO_FOUND},NOT_SUBMITTED:{code:9303,message:"Episode not submitted for review",textKey:dR.DRAMA_NOT_SUBMITTED},UNDER_REVIEW:{code:9304,message:"Episode under for review",textKey:dR.DRAMA_UNDER_REVIEW},FAILED_REVIEW:{code:9305,message:"Episode failed review",textKey:dR.DRAMA_FAILED_REVIEW},WITHDRAWN_REVIEW:{code:9306,message:"Episode withdrawn from review",textKey:dR.DRAMA_WITHDRAWN_REVIEW},FAILED_TO_QUERY:{code:9307,message:"Failed to query video playback information",textKey:dR.DRAMA_FAILED_TO_QUERY},INVALID_TTOP_TOKEN:{code:9308,message:"Invalid playAuthToken or failed to verify TTOP token",textKey:dR.DRAMA_INVALID_TTOP_TOKEN},NOT_ON_SHELF:{code:9310,message:"Video is not on shelf",textKey:dR.DRAMA_NOT_ON_SHELF},FAILED_GET_EPISODE_INFO:{code:9399,message:"Failed get episode info",textKey:dR.DRAMA_FAILED_GET_EPISODE_INFO}};const vR={SUCCESS:0,NOT_SUBMITTED:1,UNDER_REVIEW:2,FAILED_REVIEW:3,WITHDRAWN:4,NOT_ON_SHELF:5},mR=1002305;class _R{constructor(){this.actions={}}addMiddleware(e,t){this.actions[e]?this.actions[e].push(t):this.actions[e]=[t]}removeMiddleware(e,t){const i=this.actions[e]||[],n=i.findIndex((e=>e===t));n>-1&&(i.splice(n,1),this.actions[e]=i)}removeAllMiddlewareByKey(e){this.actions[e]=[]}removeAllMiddleware(){this.actions={}}applyMiddleware(e){const t=this;return function(i,n){return d(this,null,(function*(){const{eventName:r}=i,o=t.actions[e]||[],a=[];o.forEach((e=>{try{const t=e(i);a.push(Gs(t))}catch(t){throw a.push(Gs(null)),t}})),Promise.all([...a]).then((e=>{e.every((e=>!e))&&n(r,i)})).catch((e=>{as.error(e),n(r,e)}))}))}}}const ER="xgplayer-error-analysing",TR="xgplayer-error-retrying",SR="ve_error",bR={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},CR={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},kR="http:",IR="https:";let PR=null;function DR(e){var t;const i=null==(t=null==window?void 0:window.location)?void 0:t.protocol;if(e.startsWith(kR)&&i===IR){if(new URL(e).protocol===kR)return wR.getVeErrorInfo(fR.NETWORK_PROTOCOL)}}class wR{constructor(e,t){this.retryTimestamps=[],this.totalRetryCount=0,this.retrying=!1,this.retryTimer=null,this.userInvokedPlay=!1,this._playIntentHook=()=>{this.userInvokedPlay=!0},this._onError=e=>d(this,null,(function*(){var t;this.player.addClass(ER);const i=yield this.transformToVeError(e);this.player.veError=i,as.error("error: ",i),this.player.removeClass(ER),(null==(t=this.config.ignoreErrorCodes)?void 0:t.includes(null==i?void 0:i.veErrorCode))?as.log("ignore errorCode",null==i?void 0:i.veErrorCode):this.player.emit(SR,i)})),this.player=e,this.config={},t&&Object.keys(wR.defaultConfig).forEach((e=>{void 0===t[e]?this.config[e]=wR.defaultConfig[e]:this.config[e]=t[e]})),this.init()}static get defaultConfig(){return{oriErrRetryCount:3,oriErrRetryCycle:1e4,oriErrRetryBaseDelay:500,oriErrMaxTotalRetry:0,enableOriErrRetry:!0,needSyncAnalyzeError:!0,analyzeTimeout:3e3,ignoreErrorCodes:[],clientKey:void 0}}createVeError(e={}){var t,i;const{errorType:n,errorCode:r=0,errorMessage:o="",originError:a="",ext:s={},mediaError:l=null}=e,h=(null==(i=null==(t=this.player)?void 0:t.i18n)?void 0:i.ERROR_TYPES)||{},d=this.player.media;if(d){const t=l||d.error||{},{duration:i,currentTime:h,ended:f,src:p,currentSrc:g}=this.player,{readyState:y,networkState:v}=d;let m=r||t.code;bR[m]&&(m=bR[m]);const{code:_,message:E,textKey:T}=e.veError||{},S=o||t.message,b=_||m,C=wR.getErrorType(e),k=E||S,I=T||(e=>{for(const[t,{code:i,textKey:n}]of Object.entries(fR))if(i===e)return n})(b)||function(e){for(const t of Object.values(yR))if(t.code===e)return t.textKey}(b),P=this.player.i18n[I]||k||this.player.i18n[dR.MEDIA_ERR]||"unknown error",D=this.player.config,w=this.config.clientKey?{clientKey:this.config.clientKey}:{},A=this.config.clientKey?{albumId:D.albumId||D.album_id,episodeId:D.episodeId||D.episode_id||D.episodeID}:{};return u(c({playerVersion:"1.18.0-rc.9",currentTime:h,duration:i,ended:f,readyState:y,networkState:v,src:p||g,errorType:n,errorCode:m,httpCode:e.httpCode,message:S,mediaError:t,originError:a?a.stack:"",host:Ur.getHostFromUrl(p||g),veErrorCode:b,veErrorType:C,veErrorMessage:k,displayMessage:P},w),{videoInfo:c({isMSE:Ls(this.player),vtype:this.player.url?this.player.vtype:"",drmEncryptType:al(this.player)||"",vid:D.vid},A),ext:s})}if(arguments.length>1){const e={playerVersion:"1.18.0-rc.9",domain:document.domain,ex:null},t=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"];for(let i=0;i<arguments.length;i++)e[t[i]]=arguments[i];return e.ex=h?(h[arguments[0]]||{}).msg:"",e}}static getErrorType(e){const{veError:t,mediaError:i}=e||{},n=t||(null==i?void 0:i.veError);if(null==n?void 0:n.code){const e=n.code+"";return n.code>=1e4?gR[e.slice(0,2)]:gR[e.slice(0,1)]}if(null==i?void 0:i.code)return CR[i.code]||"other"}static getVeErrorInfo(e,t){const{code:i,message:n,textKey:r}=e;return{code:i,message:t||n,textKey:r}}init(){var e,t;PR||(PR=this.player.errorHandler),function(e,t){for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&"function"==typeof t[i]&&Object.defineProperty(e,i,{configurable:!0,value:t[i]})}(this.player,(e=this.player,t=this,{errorHandler(i,n){var r;as.log("errorHandler, err: ",n);const o=e;if(o.media&&(o.media.error||n)){let e=o.media.error||n;const a=e.code?Gr[e.code]:"other";let s=e.message;"xg-video"===(null==(r=null==o?void 0:o.config)?void 0:r.mediaType)||o.media.currentSrc||o.media.srcObject||(s="empty_src",e={code:6,message:s}),o.emit(i,t.createVeError({errorType:a,errorCode:e.code,errorMessage:e.message||"",mediaError:e,veError:n.veError,originError:n}))}}})),this.setErrorEventMiddleWare(),this.player.on(Qr,this._onError),this.player.useHooks("play",this._playIntentHook)}destroy(){this.player.off(Qr,this._onError),this.player.removeHooks("play",this._playIntentHook),this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null,this.retrying=!1,this.player.removeClass(TR))}shouldOriRetryReloadOnly(){var e;if(this.userInvokedPlay)return!1;const t=this.player.config;if(!t||t.autoplay||t.autoplayMuted)return!1;const i=this.player.media;return!!i&&0===(null==(e=i.played)?void 0:e.length)}setErrorEventMiddleWare(){this.eventMiddleware=new _R,this.eventMiddleware.addMiddleware(Qr,this.defaultErrorMiddleWare.bind(this)),this.player.setEventsMiddleware({error:this.eventMiddleware.applyMiddleware(Qr)})}defaultErrorMiddleWare(e){return d(this,null,(function*(){var t,i;if(!Ur.isMSE(this.player.media)){const{error:n}=e||{};if(!n)return as.error("invalid media error: ",e),!1;const{code:r}=n||{};if((2===r||3===r||4===r)&&(null==(i=null==(t=this.player)?void 0:t.config)?void 0:i.url)){const t=Date.now();this.retryTimestamps=this.retryTimestamps.filter((e=>t-e<=this.config.oriErrRetryCycle));const{oriErrRetryCount:i,oriErrMaxTotalRetry:n}=this.config,o=n>0&&this.totalRetryCount>=n,a=this.retryTimestamps.length>=i,s=!1!==this.config.enableOriErrRetry;if(s&&!o&&!a)return this.oriVideoRetry(!this.shouldOriRetryReloadOnly());if(s&&(o?as.warn(`max total retry count ${n} reached, stop retrying`):as.warn(`retry count in window ${this.config.oriErrRetryCycle}ms reached ${i}, stop retrying`)),3===r)this.config.needSyncAnalyzeError&&(yield this.analyseStream());else{const t=rl(sl(this.player));if(t){const i=DR(t);if(i)return e.error.veError=i,!1;this.config.needSyncAnalyzeError&&(e.error.veError=yield this.analyseNet(t,e.error,this.config.analyzeTimeout))}}}}return!1}))}oriVideoRetry(e=!0){if(this.retrying)return!0;this.retrying=!0;const t=this.config.oriErrRetryBaseDelay*Math.pow(2,this.retryTimestamps.length);return as.warn(`origin video play error, retry in ${t}ms (window: ${this.retryTimestamps.length+1}/${this.config.oriErrRetryCount}, total: ${this.totalRetryCount+1})`),this.player.addClass(TR),clearTimeout(this.retryTimer),this.retryTimer=setTimeout((()=>{this.retryTimestamps.push(Date.now()),this.totalRetryCount++,e?this.player.retry():this.oriVideoReloadWithoutPlay(),this.player.removeClass(TR),this.retrying=!1}),t),!0}oriVideoReloadWithoutPlay(){const e=this.player;e.removeClass("xgplayer-is-error"),e.addClass("xgplayer-isloading"),e.runHooks("retry",(()=>{const t=e.currentTime,i="string"==typeof e.config.url?e.config.url:"",n=Ur.isMSE(e.media)?{url:i}:e.preProcessUrl(i);e.src=n.url,e.config.isLive||(e.currentTime=t)}))}analyseNet(e,t,i){return d(this,null,(function*(){const n=t.code||t.errorCode,r=t.message||t.errorMessage||t.msg;try{const t=yield Os(e,{range:"0-8",timeout:i});as.log("xhr result",t);const{status:o,response:a}=t;if(403===o){if("string"==typeof a){if(a.includes("expire"))return wR.getVeErrorInfo(fR.NETWORK_URL_EXPIRE);if(a.includes("sign"))return wR.getVeErrorInfo(fR.NETWORK_URL_SIGN)}return wR.getVeErrorInfo(fR.NETWORK_FORBIDDEN)}if(416===o)return wR.getVeErrorInfo(fR.NETWORK_RANGE_NOT_SATISFIABLE);if(404===o)return wR.getVeErrorInfo(fR.NETWORK_NOTFOUND);if(o===xs.TIMEOUT)return wR.getVeErrorInfo(fR.NETWORK_TIMEOUT);if(o===xs.ERROR)return wR.getVeErrorInfo(fR.NETWORK,r);if(200===o||206===o){if(4===n)return r?wR.getVeErrorInfo(fR.MEDIA_ERR_PLAY_ERR,r):wR.getVeErrorInfo(fR.MEDIA_ERR_FILE_NOT_SUPPORTED);if(3===n)return wR.getVeErrorInfo(fR.MEDIA_ERR_DECODE,r);if(2===n)return wR.getVeErrorInfo(fR.MEDIA_ERR_NETWORK,r);if(1===n)return wR.getVeErrorInfo(fR.MEDIA_ERR_ABORTED,r);if(-9996===n){return al(this.player)===or.PRIVATE_ENCRYPT_UPGRADE?wR.getVeErrorInfo(fR.PRIVATE_DRM_GET_KEY_FAILED):wR.getVeErrorInfo(fR.GET_HLS_DECRYPTION_KEY_ERR)}}return}catch(o){return as.warn("Failed to analyze the network. If the domain of the video address has been configured with CORS, it means that the playback error is caused by the failure of the video request. If the domain of the video address is not configured with CORS, the real reason for the playback error cannot be determined because the video request cannot be analyzed."),wR.getVeErrorInfo(fR.NETWORK)}}))}analyseStream(){return d(this,null,(function*(){}))}handle2100Error(e){return d(this,arguments,(function*({error:e,errorCode:t,httpCode:i,response:n,finalMessage:r}){const o={errorType:gR.network,errorCode:t,httpCode:i,errorMessage:r,originError:e};if(i){if(404===i)o.veError=wR.getVeErrorInfo(fR.NETWORK_NOTFOUND);else if(416===i)o.veError=wR.getVeErrorInfo(fR.NETWORK_RANGE_NOT_SATISFIABLE);else if(403===i){try{const e=yield function(e){return(t=e)&&"object"==typeof t&&"responseText"in t&&"status"in t&&"statusText"in t?e.responseText:function(e){return!(!e||"object"!=typeof e)&&"json"in e&&"text"in e&&"status"in e}(e)?e.text():e;var t}(n);if("string"==typeof e)return e.includes("expire")?o.veError=wR.getVeErrorInfo(fR.NETWORK_URL_EXPIRE):e.includes("sign")?o.veError=wR.getVeErrorInfo(fR.NETWORK_URL_SIGN):o.veError=wR.getVeErrorInfo(fR.NETWORK_FORBIDDEN),this.createVeError(o)}catch(a){as.warn("get response text error")}return o.veError=wR.getVeErrorInfo(fR.NETWORK_FORBIDDEN),this.createVeError(o)}}else{const e=rl(sl(this.player));if(e){const t=DR(e);t&&(o.veError=t)}}return this.createVeError(o)}))}handle9991Error({error:e,errorCode:t,httpCode:i,finalMessage:n}){return this.createVeError({errorType:gR.serve,errorCode:t||fR.OTHER.code,httpCode:i,errorMessage:n,originError:e,veError:wR.getVeErrorInfo(fR.GET_HLS_DECRYPTION_KEY_ERR)})}handleNetError(e){return d(this,arguments,(function*({error:e,errorCode:t,httpCode:i,finalMessage:n}){try{const r=rl(sl(this.player)),o=yield this.analyseNet(r,e,3e3);return o?this.createVeError({errorType:gR.network,errorCode:t||fR.OTHER.code,httpCode:i,errorMessage:n,originError:e,veError:o}):this.createVeError({errorCode:t||fR.NETWORK_ENCRYPT_HLS_ERR.code,httpCode:i,errorMessage:n,originError:e,veError:wR.getVeErrorInfo(fR.NETWORK_ENCRYPT_HLS_ERR)})}catch(r){return as.warn("analyse fail of the net error of encrypt hls m3u8 file"),this.createVeError({errorCode:t||fR.NETWORK_ENCRYPT_HLS_ERR.code,httpCode:i,errorMessage:n,originError:e,veError:wR.getVeErrorInfo(fR.NETWORK_ENCRYPT_HLS_ERR)})}}))}handleStuckError({error:e,errorCode:t,httpCode:i,finalMessage:n}){const r={errorType:gR.network,errorCode:t,httpCode:i,errorMessage:n,originError:e},{currentTime:o,duration:a,buffered:s}=this.player,l=!s||0===s.length||!a,c=this.player.checkBuffer(o,{startDiff:0,endDiff:.1});if(l||!c)return r.veError=wR.getVeErrorInfo(fR.NETWORK),this.createVeError(r);this.createVeError(r)}transformToVeError(e){return d(this,null,(function*(){if((null==e?void 0:e.veErrorCode)&&!this.player.getPlugin("Mp4EncryptPlayer"))return e;const{httpCode:t,errorMessage:i,message:n,msg:r,response:o}=e||{},a=(null==e?void 0:e.code)||(null==e?void 0:e.errorCode),s=i||n||("string"==typeof r?r:"other error");if(2100===a)return this.handle2100Error({error:e,errorCode:a,httpCode:t,response:o,finalMessage:s});if(-9991===a)this.handle9991Error({error:e,errorCode:a,httpCode:t,finalMessage:s});else{if([2103,5104,5102].includes(a)&&this.player.getPlugin("Mp4EncryptPlayer")||-9996===a&&this.player.getPlugin("EncryptHlsPlugin"))return this.handleNetError({error:e,errorCode:a,httpCode:t,finalMessage:s});if([9002,9003].includes(a))return this.handleStuckError({error:e,errorCode:a,httpCode:t,finalMessage:s})}return this.createVeError(c({errorCode:a||fR.OTHER.code,httpCode:t,errorMessage:s,originError:e},e||{}))}))}}const AR=new Set(Object.values(yR).map((e=>e.code)));let RR=class extends ba{constructor(e){super(e),this._errDetailList=[],this._errorDomMode=null,this.state={showError:!1,retryTimes:0,idx:0},this.handleError=e=>d(this,null,(function*(){this.isVodLogConError=(null==e?void 0:e.errorCode)===fR.VOD_LOG_NOT_CONFIGURED.code,this.player&&this.player.pause(),this.config.isNeedDemoteBack?(this.state.showError=!1,this.changeMainOrBackup()):this.state.showError=!0,this.renderError(e)})),this.handleEnd=()=>{},this.handleRefreshClick=()=>{var e,t;null==(e=this.player)||e.emit(LA.PLAY_ERROR_BUTTON_CLICK),this.player.removeClass(Pa.PAUSED),this.closeError(),null==(t=this.player)||t.retry()},this.closeError=()=>{this.state.showError&&(this.state.showError=!1,this.renderError())},this.playerData=e.player.config.playerData}static get pluginName(){return"sdkErrorPlugin"}static get defaultConfig(){return{showError:!0,errorImg:!0,errorTips:!0,isNeedRefreshButton:!0,isNeedCopyButton:!0,isNeedDemoteBack:!1,retryLoopNum:1,errorTipsText:null,position:ba.POSITIONS.ROOT}}afterCreate(){var e,t,i;this.initEvents();const n=Object.values(fR).reduce(((e,t)=>{const{code:i,textKey:n}=t;return e[i]=this.i18n[n],e}),{});this.errNoteMap=c({other:null!=(i=null==(t=null==(e=this.i18n.ERROR_TYPES)?void 0:e.other)?void 0:t.msg)?i:"error",1:this.i18n.MEDIA_ERR_ABORTED,2:this.i18n.MEDIA_ERR_NETWORK,3:this.i18n.MEDIA_ERR_DECODE},n)}registerLanguageTexts(){return{clickButton:{jp:"リフレッシュ",en:"Refresh",zh:"刷新","zh-hk":"刷新"},errorTips:{jp:"再生中にエラーが発生しました。[更新]をクリックして試してください",en:"An error occurred while playing, click refresh to try",zh:"播放发生错误,点击刷新试试吧","zh-hk":"播放發生錯誤,點擊刷新試試吧"},errorCode:{jp:"コード",en:"code",zh:"错误码","zh-hk":"錯誤碼"},did:{jp:"デバイスID",en:"deviceID",zh:"设备 ID","zh-hk":"設備 ID"},playTime:{jp:"遊び時間",en:"playTime",zh:"播放时间","zh-hk":"播放時間"},copyError:{jp:"コピーエラー",en:"Copy error",zh:"复制错误信息","zh-hk":"複製錯誤訊息"},copySuccess:{jp:"コピー成功",en:"Copy success",zh:"复制成功","zh-hk":"複製成功"}}}registerIcons(){return{errorImg:{icon:hR,class:"xgplayer-error-svg"}}}updateLang(){var e,t;if(!this.$errorDom)return;const i=this.$errorDom.querySelector(".xgplayer-error-tips");if(i){const n=null!=(t=null==(e=this.config.errorTipsText)?void 0:e[this.lang])?t:this.langText.errorTips;i.innerHTML=n}const n=this.$errorDom.querySelector(".xgplayer-error-button");n&&(n.innerHTML=this.langText.clickButton)}initEvents(){this.player.on(SR,this.handleError),this.on(no,this.closeError),this.on(Xr,this.closeError)}getRetryList(){var e;const t=this.playerData.getCurrentStreams()[0];return[null==t?void 0:t.url,...null!=(e=null==t?void 0:t.backUrlList)?e:[]]}changeMainOrBackup(){this.player.addClass(Pa.ENTER);const e=this.getRetryList(),t=this.config.retryLoopNum*e.length,i=(e.indexOf(this.player.config.url)+1)%e.length;this.state.idx=i;const n=e[i];if(!n||this.state.retryTimes===t)return this.player.removeClass(Pa.ENTER),this.state.retryTimes===t&&this.player.emit(LA.PLAY_BACKUP_CHANGE_FINISH),this.state.showError=!0,this.renderError(),void this.resetTimes();this.player.once("canplay",(()=>{this.state.retryTimes=0})),as.log(`retry times: ${this.state.retryTimes}`,n),this.player.emit(LA.PLAY_BACKUP_CHANGE,{currentUrl:this.player.config.url,nextUrl:n,retryTimes:this.state.retryTimes}),this.changeUrl(n),this.state.retryTimes=this.state.retryTimes+1}changeUrl(e){this.player.config.url=e,this.player.switchURL(e,!1),this.player.emit(LA.PlAY_URL_CHANGE,{url:e,from:LA.PLAY_BACKUP_CHANGE})}resetTimes(){this.state.retryTimes=0,this.state.idx=0}renderError(e){if(!this.config.showError)return;const t=this.root;t&&(t.innerHTML="",t.style.display="none",(this.state.showError||this.isVodLogConError)&&(this.player.emit(LA.SHOW_PLAY_ERROR),t.style.display="block",t.appendChild(this.getErrorDom(e))),this.isVodLogConError&&(this.player.blur(),this.player.pause()))}addErrDetail(e){Array.isArray(e)?this._errDetailList=[...this._errDetailList,...e]:this._errDetailList.push(e)}getErrorInfo(e){var t,i,n,r,o;const a=e.veErrorCode||e.errorCode,s=null==(t=this.player)?void 0:t.vodLogger,l=(null==(o=null==(r=null==(n=null==(i=null==s?void 0:s.tracker)?void 0:i.getConfig)?void 0:n.call(i))?void 0:r.user)?void 0:o.user_unique_id)||(null==s?void 0:s.line_user_id);return{code:a,appId:null==s?void 0:s.line_app_id,did:l||"unknown",playTime:ls().format("YYYY-MM-DD HH:mm:ss")}}getErrorInfoDom(e){const{code:t,did:i,playTime:n}=this.getErrorInfo(e),r=Ur.createDom("div","",void 0,"xgplayer-error-info-wrap"),o=`<p class="xgplayer-error-info-p">\n <span class="xgplayer-error-info-title">${this.langText.errorCode||"code"}</span>\n <span class="xgplayer-error-info-content">${t}</span>\n </p>`;r.appendChild(Ur.createDomFromHtml(o));const a=`<p class="xgplayer-error-info-p">\n <span class="xgplayer-error-info-title">${this.langText.did||"deviceID"}</span>\n <span class="xgplayer-error-info-content">${i}</span>\n </p>`;r.appendChild(Ur.createDomFromHtml(a));const s=`<p class="xgplayer-error-info-p">\n <span class="xgplayer-error-info-title">${this.langText.playTime||"playTime"}</span>\n <span class="xgplayer-error-info-content">${n}</span>\n </p>`;return r.appendChild(Ur.createDomFromHtml(s)),r}handleCopyBtnClick(e){const{did:t,playTime:i,appId:n}=this.getErrorInfo(e);try{const r=JSON.stringify(u(c({},e),{playTime:i,deviceID:t,appId:n}));navigator.clipboard.writeText(r).then((()=>{!function(e,t=1e3){const i=document.createElement("div");i.className="veplayer-toast",i.textContent=e,document.body.appendChild(i),setTimeout((()=>i.classList.add("show")),10),setTimeout((()=>{i.classList.remove("show"),setTimeout((()=>null==i?void 0:i.remove()),300)}),t)}(this.langText.copySuccess||"copySuccess")}))}catch(r){as.error("copy error info err ",r)}}getActionDom(e){const t=e.errorType,i=Ur.createDomFromHtml('<div class="xgplayer-error-action-wrap"></div>'),n=!(t&&[gR[10],gR[11],gR[12]].includes(t));if(this.config.isNeedRefreshButton&&n){const e=Ur.createDom("div",this.langText.clickButton||"Refresh",void 0,"xgplayer-error-button refresh-button");this.bind(".refresh-button","click",this.handleRefreshClick),i.appendChild(e)}if(this.config.isNeedCopyButton){const t=Ur.createDom("div",this.langText.copyError||"CopyError",void 0,"xgplayer-error-button copy-button");this.bind(".copy-button","click",this.handleCopyBtnClick.bind(this,e)),i.appendChild(t)}return i}getErrorDom(e){var t,i,n,r,o,a;const{errorCode:s,message:l,displayMessage:c}=e,u=null!=(t=null==e?void 0:e.veErrorCode)?t:null==e?void 0:e.errorCode,h=!!rB.ttDramaEnv,d="number"==typeof u&&AR.has(u);if("drama"===(h&&d?"drama":"normal")){if(!this.$errorDom){this.$errorDom=Ur.createDom("div","",void 0,"xgplayer-error-cover xgplayer-drama-error-cover");const e=Ur.createDom("div","Video isn't available",void 0,"xgplayer-drama-error-toast");this.$errorDom.appendChild(e),this.emit("sdkerrorplugin_render",this.$errorDom)}return this.$errorDom}if(!this.$errorDom){if(this.$errorDom=Ur.createDom("div","",void 0,"xgplayer-error-cover"),this.config.errorImg){const e=Ur.createDom("div","",void 0,"xgplayer-error-img");e.appendChild(this.icons.errorImg),this.$errorDom.appendChild(e)}if(this.config.errorTips){let t="";t=(null==(n=null==(i=this.config)?void 0:i.errorTipsText)?void 0:n[this.lang])?null==(r=this.config.errorTipsText)?void 0:r[this.lang]:e?c||this.errNoteMap[s]||this.player.errorNote&&this.i18n[this.player.errorNote]||l||this.errNoteMap.other||"error":this.langText.errorTips;const o=Ur.createDom("div",t,void 0,"xgplayer-error-tips");this.$errorDom.appendChild(o)}this.$errorDom.appendChild(this.getErrorInfoDom(e)),this.$errorDom.appendChild(this.getActionDom(e)),(null==(o=this._errDetailList)?void 0:o.length)&&(null==(a=this._errDetailList)||a.forEach((e=>{const t="function"==typeof e?e():e;if(t){const e=Ur.createDom("div",`${t.label}: ${t.value}`,void 0,"xgplayer-error-detail-info");this.$errorDom.appendChild(e)}}))),this.emit("sdkerrorplugin_render",this.$errorDom)}return this.$errorDom}destroy(){this.player.off(Qr,this.handleError)}render(){return this.config.showError?'<xgplayer-error class="xgplayer-error"></xgplayer-error>':""}};const xR=void 0;function OR(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function LR(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?OR(Object(i),!0).forEach((function(t){FR(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):OR(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function NR(e){return(NR="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})(e)}function MR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UR(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,QR(n.key),n)}}function BR(e,t,i){return t&&UR(e.prototype,t),i&&UR(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function FR(e,t,i){return(t=QR(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function HR(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&VR(e,t)}function jR(e){return(jR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function VR(e,t){return(VR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function KR(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(hs){return!1}}function WR(e,t,i){return(WR=KR()?Reflect.construct.bind():function(e,t,i){var n=[null];n.push.apply(n,t);var r=new(Function.bind.apply(e,n));return i&&VR(r,i.prototype),r}).apply(null,arguments)}function GR(e){var t="function"==typeof Map?new Map:void 0;return GR=function(e){if(null===e||(i=e,-1===Function.toString.call(i).indexOf("[native code]")))return e;var i;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return WR(e,arguments,jR(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),VR(n,e)},GR(e)}function YR(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zR(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return YR(e)}function $R(e){var t=KR();return function(){var i,n=jR(e);if(t){var r=jR(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return zR(this,i)}}function XR(){return XR="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=jR(e)););return e}(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},XR.apply(this,arguments)}function qR(e){return function(e){if(Array.isArray(e))return ZR(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ZR(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ZR(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ZR(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function QR(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var JR=["b","i","u","span","c","ruby","rt","v","lang"],ex=["br"];var tx=/^WEBVTT/i,ix=/^\d+\r?\n\d{2}:\d{2}:\d{2},\d{3}\s*-->/m,nx=/^STYLE+$/,rx=/^\:\:cue/,ox=/^}+$/,ax=/^\[Script Info\].*/,sx=[/[0-9]{1,3}:[0-9]{2}:[0-9]{2}\.[0-9]{1,3}-->[0-9]{1,3}:[0-9]{2}:[0-9]{2}\.[0-9]{1,3}/,/[0-9]{1,3}:[0-9]{2}\.[0-9]{1,3}-->[0-9]{1,3}:[0-9]{2}\.[0-9]{1,3}/,/[0-9]{1,3}\.[0-9]{1,3}-->[0-9]{1,2}\.[0-9]{1,3}/,/[0-9]{1,3}:[0-9]{2}:[0-9]{2},[0-9]{1,3}\s*-->\s*[0-9]{1,3}:[0-9]{2}:[0-9]{2},[0-9]{1,3}/],lx=/^Format:\s/,cx=/^Style:\s/,ux=/^Dialogue:\s/,hx=/^([0-5]?\d)[.,](\d{1,3})$/;function dx(e){var t=hx.exec(e);return t?(1e3*Number(t[1])+Number(t[2]))/1e3:0}function fx(e){var t=e.length;return 3===t?60*(60*Number(e[0])+Number(e[1]))+dx(e[2]):2===t?60*Number(e[0])+dx(e[1]):dx(e[0])}function px(e){return/^(\-|\+)?\d+(\.\d+)?$/.test(e)}function gx(e){return null==e?"":String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function yx(e,t){return e>=0&&e<t.length?t[e]:""}function vx(e){return t=function(e){return String(e||"").trim().split(/[\s.]/)[0].toLowerCase()}(e),JR.includes(t)||ex.includes(t);var t}var mx=function(){function e(){MR(this,e)}return BR(e,null,[{key:"parseJson",value:function(e){for(var t=[],i=0,n=0;n<e.length;n++){if(i>=50&&(i=0),0===i){var r={start:e[n].start,list:[e[n]],end:e[n].end};t.push(r)}else t[t.length-1].list.push(e[n]),t[t.length-1].end=e[n].end;i++}return t}},{key:"parse",value:function(t,i){var n=e.checkFormat(t);try{var r;i({format:n,list:(r="ass"===n?e.parseASS(t):e.parseVTT(t)).list,styles:r.styles})}catch(QB){console.error(QB),i({format:n},QB)}}},{key:"parseASSItem",value:function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(","),i={},n="";try{var r=t.length-e.length;return n=gx(n=(n=r>0?t.splice(e.length-1,r+1).join(",")+"":t[t.length-1]+"").replace(/\\n+/g,"")),t[e.length-1]=n,e.map((function(e,n){"end"===e||"start"===e?i[e]=fx(t[n].split(":")):"text"===e?i[e]=[t[n]]:"layer"===e?(i[e]=[t[n]],i.textTag=[t[n]]):i[e]="style"===e?[t[n]]:Number(t[n])?Number(t[n]):t[n]})),i}catch(QB){return console.error(QB),{}}}},{key:"parseASS",value:function(t){for(var i=t.split("\n"),n=[],r=0,o=0,a=[],s=[],l=null;r<i.length;){if(lx.test(i[r]))s=(s=i[r].replace(lx,"").replace(/\s+/g,"").split(",")).map((function(e){return e.toLocaleLowerCase()}));else if(cx.test(i[r]))a.push(i[r].replace(cx,"").replace(/\s+/g,""));else if(ux.test(i[r])){var c=e.parseASSItem(i[r].replace(ux,""),s);if(l&&c.start===l.start&&c.end===l.end)try{var u=l,h=u.text,d=u.textTag,f=u.style;h.push(c.text[0]),d.push(c.textTag[0]),f.push(c.style[0])}catch(QB){console.error(QB)}else{l=c;var p=null;o%50==0?((p={start:l.start,end:l.end,list:[]}).list.push(l),n.push(p)):((p=n[n.length-1]).end=l.end,p.list.push(l)),o++}}r++}return{list:n,styles:[]}}},{key:"parseVTTStyle",value:function(e,t){var i=e.split(":");if(i.length>1){var n=i[0].trim().split("-"),r="";n.length>1?n.map((function(e,t){r+=0===t?e:e.charAt(0).toUpperCase()+e.slice(1)})):r=n[0],t[r]=i[1].trim().replace(/;$/,"")}return t}},{key:"parseVTT",value:function(e){for(var t=(e=e.replace(tx,"")).split("\n"),i=[],n=0,r=0,o=null,a=!1,s=!1,l=null,c=null,u=[];n<t.length;){var h=yx(n,t).trim();if(!h||a&&px(h))a=!h;else if(rx.test(h)&&nx.test(yx(n-1,t).trim())){s=!0;var d=/\((.+?)\)/g.exec(h);c=d?d[1]:"",l=""}else if(s)ox.test(h)?(u.push({key:c||"",style:l||""}),l=null,c=null,s=!1):l+=h;else if(h){a=!1;var f=this.checkIsTime(t[n]);if(f){var p=this.parseVttTime(f);if(!o||p.start!==o.start||p.end!==o.end){(o=p).text=[],o.textTag=[];var g=null;r%50==0?((g={start:o.start,end:o.end,list:[]}).list.push(o),i.push(g)):((g=i[i.length-1]).end=o.end,g.list.push(o)),r++}}else if(o){var y=o,v=y.text,m=y.textTag,_=this.parseVttText(t[n]);v.push(_.text),m.push(_.tag)}a=!1}n++}return{list:i,styles:u}}},{key:"checkIsTime",value:function(e){e=e.replace(/\s+/g,"");for(var t=0,i=null;t<sx.length&&!(i=sx[t].exec(e));)t++;return i?i[0]:null}},{key:"parseVttText",value:function(e){var t=/^(<?.+?>)/g.exec(e),i="",n="default";if(t){if(vx(n=t[0].replace(/\<|\>|\&/g,"")))return{tag:"default",text:gx(e.replace(/\\n+/g,"<br/>"))};var r=RegExp("^<".concat(n,">(([\\s\\S])*?)</").concat(n,">$")).exec(e);r?i=r[1]:(i=e,n="")}else i=e;for(var o=/<(\w+)\.(\w+)>/g,a=o.exec(i);a&&a.length>2;)i=i.replace(a[0],"<".concat(a[1],' class="').concat(a[2],'">')),a=o.exec(i);return{tag:n,text:gx(i.replace(/\\n+/g,"<br/>"))}}},{key:"parseVttTime",value:function(e){var t=e.split("--\x3e"),i=0,n=0;if(2===t.length){var r=t[0].split(":"),o=t[1].split(":");i=fx(r),n=fx(o)}return{start:i,end:n,time:e}}},{key:"isVTT",value:function(e){return tx.test(e)}},{key:"isASS",value:function(e){return ax.test(e)}},{key:"checkFormat",value:function(e){return e?tx.test(e)?"vtt":ax.test(e)?"ass":ix.test(e)?"srt":"":""}}]),e}(),_x=[{code:0,msg:"SUCCESS"},{code:1,msg:"LOAD_ERROR"},{code:2,msg:"PARSER_ERROR"},{code:3,msg:"FORMAT_NOT_SUPPORTED"},{code:4,msg:"ID_OR_LANGUAGE_NOT_EXIST"},{code:5,msg:"PARAMETERS_ERROR"},{code:6,msg:"ABORT"},{code:7,msg:"UNKNOWN"},{code:8,msg:"DATA_ERROR:subtitle.url is null"},{code:9,msg:"DATA_ERROR:subtitle.url length is 0"}],Ex=function(e){HR(i,GR(Error));var t=$R(i);function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return MR(this,i),e||(e=_x[r||7].msg),(n=t.call(this,e)).code=r||7,n.message=e,n.type=_x[r||7].msg,n.orgError=o||null,n.data=a||null,n}return BR(i)}();function Tx(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,n={code:_x[e].code,msg:_x[e].msg,message:_x[e].msg,id:i&&i.id||"",language:i&&i.language||""};return Object.keys(t).map((function(e){n[e]=t[e]})),n}var Sx=BR((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.url,n=t.method,r=void 0===n?"GET":n,o=t.type,a=void 0===o?"arraybuffer":o,s=t.timeout,l=void 0===s?1e4:s,c=t.data,u=void 0===c?{}:c,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return MR(this,e),new Promise((function(e,t){var n=new window.XMLHttpRequest,o=r.toUpperCase(),s=[];if(a&&(n.responseType=a),l&&(n.timeout=l),Object.keys(u).forEach((function(e){s.push("k=".concat(u[e]))})),n.onload=function(){200===n.status||206===n.status?e({context:h,res:n}):t(new Error({context:h,res:n,type:"error"}))},n.onerror=function(e){t(new Error({context:h,res:n,type:"error"}))},n.ontimeout=function(e){t(new Error({context:h,res:n,type:"error"}))},n.onabort=function(){t(new Error({context:h,res:n,type:"error"}))},"GET"===o)n.open(o,"".concat(i)),n.send();else{if("post"!==o)throw new Error("xhr ".concat(o," is not supported"));n.open(o,i),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.send(s.join("&"))}}))})),bx=function(){function e(){var t,i;MR(this,e);var n=new Promise((function(e,n){t=e,i=n}));return n.resolve=function(e){t(e),n.state="fulfilled"},n.reject=function(e){i(e),n.state="rejected",n.isBreak="DESTROYED"===e},n.state="pending",n}return BR(e,[{key:"resolve",value:function(e){}},{key:"reject",value:function(e){}}]),e}();function Cx(e,t){if(!e)return!1;if(e.classList)return Array.prototype.some.call(e.classList,(function(e){return e===t}));var i=e.className&&"object"===NR(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function kx(e,t){e&&(e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):Cx(e,t)||(e.className&&"object"===NR(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t))}function Ix(e,t,i){var n=t.length;if(n<1)return-1;if(t[i=i<0?0:i>=n?n-1:i].start<=e&&e<t[i].end)return i;for(var r=t[i].end<=e?i+1:0;r<n;r++){if(t[r].start<=e&&e<t[r].end)return r;if(e>t[r].end&&r+1<n&&e<t[r+1].start)return-1;if(e>t[r].end&&r+1>=n)return-1}return-1}function Px(e,t,i){var n=t.length;if(n<1)return[];var r=[];if((i=i<0?0:i>=n?n-1:i)<n)for(var o=t[i].end<=e?i:0;o<n&&(t[o].start<=e&&e<t[o].end&&r.push(o),!(e<t[o].start));o++);return r}function Dx(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function wx(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=n,r.innerHTML=t,Object.keys(i).forEach((function(t){var n=t,o=i[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(n,o):r.setAttribute(n,o)})),r}function Ax(e){return e&&e instanceof window.HTMLMediaElement}function Rx(e,t,i){if(i||(i=new bx),"json"===t){var n=mx.parseJson(e);i.resolve({list:n,format:"json"})}else"string"===t&&mx.parse(e,(function(e,t){if(t){var n=Tx(2,t);i.reject(n,{format:e.format})}else if(e.format||e.list&&0!==e.list.length)i.resolve({styles:e.styles,list:e.list,format:e.format});else{var r=Tx(3);i.reject(r)}}));return i}function xx(e,t){t||(t=new bx);var i=[];"String"===Dx(e.url)?i=[e.url]:"Array"===Dx(e.url)&&(i=qR(e.url));return function n(){var r=i.shift();if(r)new Sx({url:r,type:"text"}).then((function(i){Rx(i.res.response,"string").then((function(i){t.resolve(LR(LR({},i),e))})).catch((function(e){t.reject(e)}))})).catch((function(o){if(i.length>0)n();else{var a=Tx(1,LR({statusText:o.statusText,status:o.status,type:o.type,message:"http load error",url:r},e));t.reject(a)}}));else{var o=Tx(1,LR({message:"http load error",url:e.url},e));t.reject(o)}}(),t}function Ox(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if("number"==typeof e)return Number.isFinite(e)?Math.trunc(e):t;if("string"==typeof e){var i=e.trim();if(!i)return t;var n=parseInt(i,10);return Number.isNaN(n)?t:n}return t}function Lx(e,t){return!(!e||!t)&&!!(e.id&&t.id&&e.id===t.id||e.language&&t.language&&e.language===t.language)}function Nx(e){return null!==e&&""!==e.trim()&&/^[a-zA-Z]+$/.test(e)}function Mx(e){return!!/[\x21-\x2f\x3a-\x40\x5b-\x60\x7B-\x7F]/.test(e)}var Ux=function(){function e(){var t=this;MR(this,e),this.__handlers=[],window.ResizeObserver&&(this.observer=new window.ResizeObserver((function(e){t.__trigger(e)})))}return BR(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var i=this.__handlers,n=-1,r=0;r<i.length;r++)i[r]&&e===i[r].target&&(n=r);n>-1?this.__handlers[n].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(i,n){e===i.target&&(t=n)})),this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e,t){for(var i=this.__handlers,n=0;n<i.length;n++)if(i[n]&&e===i[n].target){i[n].handler&&i[n].handler.forEach((function(i){try{i(e,t)}catch(QB){console.error(QB)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){var i=e.contentRect;t.__runHandler(e.target,i)}))}}]),e}(),Bx=null;var Fx="resize",Hx="change",jx="off",Vx="update",Kx="error",Wx=/^[A-Za-z0-9_-]+$/,Gx=/^[A-Za-z]{1,8}(?:-[A-Za-z0-9]{1,8})*$/;function Yx(e,t){t&&String(t).split(/(?:\\[nN]|\r\n|\r|\n)+/).forEach((function(t,i){i>0&&e.appendChild(document.createElement("br")),t&&e.appendChild(document.createTextNode(t))}))}function zx(e){var t=e.slice(1,-1).trim();if(!t||"!"===t[0]||"?"===t[0])return null;if("/"===t[0]){var i=/^\/\s*([A-Za-z][\w:-]*)/.exec(t),n=i&&i[1].toLowerCase();return n&&JR.includes(n)?{closing:!0,tagName:n}:null}var r=/\/\s*$/.test(t),o=t.replace(/\/\s*$/,""),a=/^([A-Za-z][\w:-]*(?:\.[^\s/>.]+)*)([\s\S]*)$/.exec(o);if(!a)return null;var s=a[1].split("."),l=s.shift().toLowerCase();if(!JR.includes(l)&&!ex.includes(l))return null;var c,u=function(e){var t=e.trim(),i={};if(!t||!/(?:^|\s)[^\s=]+\s*=/.test(t))return{attrs:i,annotation:t};for(var n=/([^\s=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,r=n.exec(t);r;)i[r[1].toLowerCase()]=r[2]||r[3]||r[4]||"",r=n.exec(t);return{attrs:i,annotation:""}}(a[2]),h=u.attrs;return{attrs:h,annotation:u.annotation,closing:!1,className:(c="".concat(s.join(" ")," ").concat(h.class||""),String(c||"").split(/\s+/).filter((function(e){return Wx.test(e)})).join(" ")),selfClosing:r,tagName:l}}function $x(e){var t="c"===e.tagName||"v"===e.tagName||"lang"===e.tagName?"span":e.tagName,i=document.createElement(t);e.className&&(i.className=e.className);var n=function(e){var t=String(e||"").trim();return Gx.test(t)?t:""}(e.attrs.lang||("lang"===e.tagName?e.annotation:""));return n&&i.setAttribute("lang",n),"v"===e.tagName&&e.annotation&&i.setAttribute("data-voice",e.annotation),i}function Xx(e,t){for(var i=function(e){return null==e?"":String(e).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;|&apos;/g,"'").replace(/&amp;/g,"&")}(t),n=[{dom:e,tagName:""}],r=/<[^>]*>/g,o=0,a=r.exec(i);a;){Yx(n[n.length-1].dom,i.slice(o,a.index));var s=a[0],l=zx(s);if(l)if(l.closing){var c=n.map((function(e){return e.tagName})).lastIndexOf(l.tagName);c>0?n.length=c:Yx(n[n.length-1].dom,s)}else if("br"===l.tagName)n[n.length-1].dom.appendChild(document.createElement("br"));else{var u=$x(l);n[n.length-1].dom.appendChild(u),l.selfClosing||n.push({dom:u,tagName:l.tagName})}else Yx(n[n.length-1].dom,s);o=r.lastIndex,a=r.exec(i)}Yx(n[n.length-1].dom,i.slice(o))}function qx(e){var t=[];if(e&&"String"===Dx(e))t.push({url:[e],index:0,start:-1,end:-1});else if("Array"===Dx(e)){if(0===e.length)return t;"String"===Dx(e[0])?t.push({url:qR(e),index:0,start:-1,end:-1}):e.forEach((function(e,i){t.push({url:e.url||e.src||"",index:i,start:e.start||-1,end:e.end||-1})}))}return t}var Zx=!1,Qx=function(e){HR(i,Rr);var t=$R(i);function i(e){var n,r,o,a,s,l,c;return MR(this,i),FR(YR(n=t.call(this)),"_onPause",(function(){n.stopRender()})),FR(YR(n),"_onPlay",(function(){n._curRenderTask.length>0&&n.startRender(-1)})),FR(YR(n),"_onTimeupdate",(function(){if(n._isOpen){if(n.config.domRender){var e=n.player.media?n.player.media:n.player,t=e.videoWidth,i=e.videoHeight;!n._videoMeta.scale&&t&&i&&n._onResize(n.player.root)}var r=n._getPlayerCurrentTime();Math.round(Math.abs(1e3*r-n._ctime))<200||(n._ctime=1e3*r,n.currentText&&n.currentText.list&&("live"===n.config.updateMode?n._liveUpdate(r):n._update(r)))}})),FR(YR(n),"_onResize",(function(e){var t=YR(n),i=t._videoMeta;if(t.config.domRender){if(e&&e instanceof window.Element||(e=n.player.root),n._iId&&(clearTimeout(n._iId),n._iId=null),!i.scale){if(!n.player.video)return;var r=n.player.video,o=r.videoWidth,a=r.videoHeight;if(!o||!a)return;i.videoWidth=o,i.videoHeight=a,i.scale=Ox(a/o*100)}n.__startResize(e)}})),FR(YR(n),"_onCoreEvents",(function(e){try{switch(e.eventName){case"core.subtitlesegments":n._onSubtitleSegment(e.list||[]);break;case"core.subtitleplaylist":n._onSubtitlePlaylist(e.list||[]);break;case"core.seipayloadtime":n._onCoreSeiintime(e)}}catch(t){console.error(t)}})),FR(YR(n),"startRender",(function(e){if(e>0&&n._renderIntervalId&&(window.cancelAnimationFrame(n._renderIntervalId),n._renderIntervalId=-1),n.textTrack){var t=YR(n)._curRenderTask;n._lastTimeStamp=(new Date).getTime();var i=[];t.forEach((function(t,r){var o=t.lastTime,a=t.wordList,s=t.interval,l=t.dom,c=t.ids;if(e<0||n._lastTimeStamp<0||n._lastTimeStamp-o>=s){var u=a.shift();u&&l.appendData(u),t.lastTime=n._lastTimeStamp}a.length<1&&i.push({index:r,ids:c})})),n._log(">>>>_renderByWords emptyArr",i.length,t.length),i.forEach((function(e){t.splice(e.index,1),n._log(">>>_renderByWords remove emptyArr",e.index,t.length)})),t.length>0&&(n._renderIntervalId=window.requestAnimationFrame(n.startRender))}})),FR(YR(n),"destroy",(function(){n.detachPlayer(),n.removeAllListeners(),n.player=null,n.textTrack=null,n._curRenderTask=[],n.stopRender()})),r=navigator.userAgent,o=/(?:Windows Phone)/.test(r),a=/(?:SymbianOS)/.test(r)||o,s=/(?:Android)/.test(r),l=/(?:Firefox)/.test(r),c=/(?:iPad|PlayBook)/.test(r)||s&&!/(?:Mobile)/.test(r)||l&&/(?:Tablet)/.test(r),Zx=/(?:iPhone)/.test(r)&&!c||s||a||c,n.currentText=null,n.currentExtText=null,n.textTrack=[],n._cid=-1,n._gid=-1,n._cids=[],n._iId=null,n._iC=0,n.player=null,n.root=null,n.config={line:"double",bottom:0,mode:"stroke",defaultOpen:!1,baseSizeX:49,baseSizeY:28,minSize:16,minMobileSize:13,fitVideo:!0,offsetBottom:2,fontColor:"#fff",domRender:!0,updateMode:"vod",renderMode:"",debugger:!1},n._ctime=0,n._loadingTrack={},n.seiTime=0,n.lastSeiTime=0,n._curTexts=[],n._curRenderTask=[],n._renderIntervalId=-1,n._lastTimeStamp=-1,Object.keys(n.config).map((function(t){void 0!==e[t]&&null!==e[t]&&(n.config[t]=e[t])})),n._isOpen=n.config.defaultOpen||!1,n._videoMeta={scale:0,videoHeight:0,videoWidth:0,lwidth:0,lheight:0,vWidth:0,vHeight:0,vBottom:0,vLeft:0,marginBottom:0},e.subTitles&&"Array"===Dx(e.subTitles)?(e.player&&n.attachPlayer(e.player),n.setSubTitles(e.subTitles,n.config.defaultOpen),n):zR(n)}return BR(i,[{key:"version",get:function(){return"3.0.25-rc.11"}},{key:"setSubTitles",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this._isOpen||i;n&&this.innerRoot&&this.switchOff(),!t||t.length<1?this.switchOff():(this.currentText=null,this.textTrack=[],t.forEach((function(t){var i={};Object.keys(t).map((function(e){i[e]=t[e]})),i.url=qx(i.url),i.isDefault&&(e.currentText=i),e.textTrack.push(i)})),this._log("setSubTitles",r),r&&(this.currentText||(this.currentText=this.textTrack[0]),this.switch().catch((function(t){e.emitError(t),e._log("[switch]",t)}))),this.currentText&&this._loadTrack(this.currentText).then((function(t){e.addStyles(t)})).catch((function(t){e.emitError(t),e._log("[_loadTrack] error",t)})),this.emit("reset",{type:"reset",list:this.textTrack,isOpen:r}))}},{key:"updateSubTitle",value:function(e){for(var t=this,i=-1,n=0;n<this.textTrack.length;n++)if(Lx(e,this.textTrack[n])){i=n;break}if(this._log("updateSubTitle",i,e),i>-1){var r=Lx(this.currentText,this.textTrack[i]);if(this._log("updateSubTitle","_isCurrent",r,"this.isOpen",this.isOpen,this.currentText),!r)return;var o=qx(e.url);this.isOpen?(o.forEach((function(e){t.textTrack[i].url.push(e)})),this._log("updateSubTitle _loadTrackUrls",this.textTrack[i]),this._loadTrackUrls(this.currentText,2)):this.textTrack[i].url=o}}},{key:"addStyles",value:function(e){var t=e.styles,i=e.format;t&&"vtt"===i&&(t.map((function(e){e.key||(e.key="xg-text-track-span")})),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i="";e.map((function(e){i+=" ".concat(t," ").concat(e.key," {").concat(e.style,"}")}));var n=document.head||document.getElementsByTagName("head")[0],r="xg-text-track-style",o=document.getElementById(r);if(o||((o=document.createElement("style")).type="text/css",o.id=r,n.appendChild(o)),o.styleSheet){var a=function(){try{o.styleSheet.cssText=(o.styleSheet.cssText||"")+i}catch(hs){}};o.styleSheet.disabled?setTimeout(a,10):a()}else{var s=document.createTextNode(i);o.appendChild(s)}}(t,".xg-text-track"))}},{key:"attachPlayer",value:function(e){var t=this;if(this._log("attachPlayer"),e&&e!==this.player){this.player&&this.detachPlayer();var i,n,r=this.config,o=r.fontColor,a=r.mode,s=r.fitVideo,l=r.domRender;if(this.player=e,l&&(this.root=document.createElement("xg-text-track"),this.root.className="xg-text-track",!this._isOpen&&kx(this.root,"text-track-hide"),!s&&kx(this.root,"text-track-no-fitvideo"),a&&kx(this.root,"text-track-".concat(a)),this.innerRoot=document.createElement("xg-text-track-inner"),this.root.appendChild(this.innerRoot),o&&(this.root.style.color=o),this.currentText&&["language","id","label"].map((function(e){t.root.setAttribute("data-".concat(e),t.currentText[e]||"")})),this.player.root&&this.player.root.appendChild(this.root),this.player.root&&(i=e.root,n=this._onResize,Bx||(Bx=new Ux),Bx.addObserver(i,n))),Ax(this.player))this.player.addEventListener("timeupdate",this._onTimeupdate),this.player.addEventListener("pause",this._onPause),this.player.addEventListener("play",this._onPlay);else{if("function"!=typeof this.player.on)return;this.player.on("destroy",this.destroy),this.player.on("timeupdate",this._onTimeupdate),this.player.on("pause",this._onPause),this.player.on("play",this._onPlay),this.player.on("core_event",this._onCoreEvents)}this._isOpen&&this.switch().catch((function(e){t._log("[switch]",e)}))}}},{key:"detachPlayer",value:function(){var e,t,i=this.player,n=this.config;i&&(Ax(i)?(i.removeEventListener("timeupdate",this._onTimeupdate),i.removeEventListener("pause",this._onPause),i.removeEventListener("play",this._onPlay)):"function"==typeof i.off&&(i.off("destroy",this.destroy),i.off("timeupdate",this._onTimeupdate),i.off("pause",this._onPause),i.off("play",this._onPlay),i.off("core_event",this._onCoreEvents)),n.domRender&&(i.root&&(e=i.root,Bx&&Bx.unObserver(e,t),this.root&&i.root.contains(this.root)&&i.root.removeChild(this.root)),this.innerRoot=null,this.root=null),this.player=null)}},{key:"switch",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};return this._log("switch",t),this._loadingTrack=t,new Promise((function(i,n){if(!t.id&&!t.language){if(e.currentText)return e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),void i({message:"switch default subtitle success",code:0});var r=new Ex("no default subtitle",5);return e.emitError(r),void n(r)}if(e.currentText&&Lx(t,e.currentText))e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),i(Tx(0));else{var o=null;e.__removeByTime(e._curTexts,0);for(var a=0;a<e.textTrack.length;a++)if(Lx(t,e.textTrack[a])){o=e.textTrack[a];break}if(e._log("nextSubtitle",o),o)e._emitPlayerSwitch(e.currentText,o),o.list?(e._loadingTrack={},e._updateCurrent(o),e.switchOn(),i(Tx(0))):(e._log("this._loadTrack",o),e._updateCurrent(o),e._loadTrack(o).then((function(r){if(e.addStyles(r),e._loadingTrack.id===o.id||e._loadingTrack.language===r.language)e._loadingTrack={},e._updateCurrent(r),e.switchOn(),i(Tx(0));else{var a=new Ex("check _loadingTrack fail id: ".concat(e._loadingTrack.id," nextSubtitle:").concat(r.id),6,null,t);e.emitError(a),n(a)}})).catch((function(t){e.emitError(t),n(t)})));else{var s=new Ex("The is no subtitle with id:[{".concat(t.id,"}] or language:[").concat(t.language,"]"),4,null,t);e.emitError(s),n(s)}}}))}},{key:"switchExt",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};return new Promise((function(i,n){if(t.id||t.language){for(var r=null,o=0;o<e.textTrack.length;o++)if(Lx(t,e.textTrack[o])){r=e.textTrack[o];break}r&&!Lx(r,e.currentText)&&e._loadTrack(r).then((function(t){e.currentExtText=t,i(Tx(0))})).catch((function(t){e.emitError(t)}))}else e.currentExtText=null,i(Tx(0))}))}},{key:"emitError",value:function(e){this.emit(Kx,{type:Kx,error:e})}},{key:"switchOn",value:function(){this._log("switchOn"),this._isOpen=!0,this.show();var e=this.currentText||{},t=e.id,i=e.language;this.emit(Hx,{type:Hx,isOpen:!0,id:t,language:i,texts:[]})}},{key:"switchOff",value:function(){if(this._isOpen=!1,this.hide(),this.currentText){var e=this.currentText,t=e.id,i=e.language;this.emit(jx,{type:jx,id:t,language:i,texts:[],isOpen:!1})}}},{key:"isOpen",get:function(){return this._isOpen}},{key:"_log",value:function(){if(this.config.debugger){for(var e,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];(e=console).log.apply(e,["[xgSubtitle]"].concat(i))}}},{key:"_loadTrack",value:function(e){var t=this;this._log("_loadTrack",e.language,e);var i=new bx,n="",r="";if(e.json?(n="json",r=e.json):!e.stringContent||e.url&&0!==e.url.length||(n="string",r=e.stringContent),r)return Rx(r,n).then((function(t){e.format=t.format,e.styles=t.styles,e.list=t.list,i.resolve(e)})).catch((function(e){t.emitError(e),i.reject(e)})),i;var o=e.url;return 0===o.length?(i.resolve(e),i):(xx(o.splice(0,1)[0]).then((function(n){e.format=n.format,e.styles=n.styles,e.list||(e.list=[]),t._pushList(e.list,n.list),o.length>0&&t._loadTrackUrls(e,2),i.resolve(e)})).catch((function(e){t.emitError(e),i.reject(e)})),i)}},{key:"_emitPlayerSwitch",value:function(e,t){e&&"live"===this.config.updateMode&&(e.list=[],e.url=[]);var i=LR({lang:t.language},t);this._log("emit subtile_switch ",t,i),this.player&&"function"==typeof this.player.emit&&this.player.emit("switch_subtitle",i)}},{key:"_loadTrackUrls",value:function(e,t,i){var n=this,r=e.url.length,o=r>t?e.url.splice(0,t):e.url.splice(0,r),a=o.length;this._log("_loadTrackUrls",e.language,r,o.length,a),o.forEach((function(t,r){xx(LR(LR({},t),{},{index:r})).then((function(t){e.format=t.format,e.styles=t.styles,e.list||(e.list=[]),n._pushList(e.list,t.list),a--})).catch((function(e){a--})).finally((function(t){0===a&&(i&&i.resolve(e),n._loadTrackUrls(e,2))}))}))}},{key:"_freshUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{url:""},i=-1;e.url.forEach((function(e,n){e.url===t.url&&(i=n)})),i>-1&&e.url.splice(i,1)}},{key:"_pushList",value:function(e,t){if(!t||0===t.length)return e;var i=t[0].start,n=t[t.length-1].end;if(0===e.length||i>=e[e.length-1].end)t.forEach((function(t){e.push(t)}));else{for(var r=-1,o=0;o<e.length;o++)if(e[o].start>n){r=o;break}r>-1&&t.forEach((function(t,i){e.splice(r+i,0,t)}))}return e}},{key:"_updateCurrent",value:function(e){var t=this;this.currentText=e,this.config.domRender&&this.root&&(["language","id","label"].map((function(e){t.root.setAttribute("data-".concat(e),t.currentText[e]||"")})),this.__remove(this._cids)),this._cids=[],this._gid=-1,this._cid=-1,this._curTexts=[];var i=this._getPlayerCurrentTime();i&&("live"===this.config.updateMode?this._liveUpdate(i):this._update(i))}},{key:"__loadAll",value:function(){var e=this;this.textTrack.forEach((function(t){e._loadTrack(t)}))}},{key:"getDelCid",value:function(e,t){for(var i=[],n=0;n<e.length;n++)t.includes(e[n])||i.push(e[n]);return i}},{key:"getNewCid",value:function(e,t){for(var i=[],n=0;n<t.length;n++)e.includes(t[n])||i.push(t[n]);return i}},{key:"_liveUpdate",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var i=[],n=Ix(e,this.currentText.list,this._gid);if(n>-1&&(i=Px(e,this.currentText.list[n].list,this._cid)),this.__removeByTime(this._curTexts,e),this._log("_liveUpdate",e,n,i,this.currentText.list[0].list[0].start,this.currentText.list[0].list[0].end),i.length>0){var r=function(e,t,i){if(0===e.length||t<0||t>e.length-1)return[];var n=e[t].list;if(0===i.length)return[];var r=n.splice(i[0],i.length);return t>0&&e.splice(0,t),0===n.length&&e.splice(0,1),r}(this.currentText.list,n,i),o=this._curTexts.length,a=o>0?this._curTexts[o-1].index:0;r.forEach((function(e,i){e.index=i+a,t._curTexts.push(e)})),this.__render(r)}this.emit(Vx,this.getUpdateData(this._curTexts,0,this.currentText))}}},{key:"_update",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var i=Ix(e,this.currentText.list,this._gid),n=[];if(i>-1&&(n=Px(e,this.currentText.list[i].list,this._cid)),n.length<1)return this._cids.length>0&&this.config.domRender&&this.__remove(this._cids),this._cids=[],this._curTexts.length>0&&this.emit(Vx,this.getUpdateData([],e,this.currentText)),void(this._curTexts=[]);if(this._cids.join("")!==n.join("")||i!==this._gid){this._gid=i,this._cid=n[0];var r=this.getDelCid(this._cids,n),o=this.getNewCid(this._cids,n);this._cids=n,this.config.domRender&&this.__remove(r);var a=[];o.map((function(e){var n=t.currentText.list[i].list[e];n.index=e,a.push(n)})),this.currentExtText&&o.map((function(e){var n=t.currentText.list[i].list[e];n.index=e,a.push(n)})),this._log("update",a,e),this._curTexts=a,this.emit(Vx,this.getUpdateData(a,e,this.currentText)),this.__render(a,e)}}}},{key:"getUpdateData",value:function(e,t,i){var n=i.id,r=i.language;return{type:Vx,currentTime:0|t,id:n,language:r,texts:e,isOpen:this._isOpen}}},{key:"_getPlayerCurrentTime",value:function(){if(!this.player)return 0;var e=this.player.currentTime;return Ox(1e3*(void 0===e?0:e)+1e3*this.seiTime-1e3*this.lastSeiTime)/1e3}},{key:"_onSubtitlePlaylist",value:function(e){this._log("_onSubtitlePlaylist",e);var t=e.map((function(e){return{label:e.name,language:e.lang,id:e.id,isDefault:e.default,url:[],mUrl:e.url}}));this.setSubTitles(t)}},{key:"_onSubtitleSegment",value:function(e){if(this._log("_onSubtitleSegment",e.length,e[0].lang,e[0].sn,e[e.length-1].sn,e[0].start,e[e.length-1].end),e&&0!==e.length){var t={language:e[0].lang,url:e.map((function(e){return{id:e.sn,url:e.url,duration:e.duration,start:e.start,end:e.end}}))};Lx(t,this.currentText)&&this.updateSubTitle(t)}}},{key:"_onCoreSeiintime",value:function(e){try{var t=e.time/1e3;this._log("_onCoreSeiintime sei",t,this.seiTime,this.lastSeiTime),this.seiTime=t,this.lastSeiTime=this.player?this.player.currentTime:0}catch(i){}}},{key:"resize",value:function(e,t){var i,n=this,r=this.config,o=r.baseSizeX,a=r.baseSizeY,s=r.minMobileSize,l=r.minSize,c=r.fitVideo,u=r.offsetBottom,h=this._videoMeta.scale;this._videoMeta.lwidth=e,this._videoMeta.lheight=t;var d=0;t/e*100>=h?(d=Ox(h*e)/100,i=e):(d=t,i=Ox(t/h*100)),this._videoMeta.vWidth=i,this._videoMeta.vHeight=d;var f=0,p=0;p=Ox(h>120?(f=a)*d/1080:(f=o)*i/1920);var g=Zx?s:l,y={fontSize:p=p<g?g:p>f?f:p},v=Ox((t-d)/2),m=Ox((e-i)/2),_=Ox(d*u)/100;this._videoMeta.vBottom=v,this._videoMeta.vLeft=m,this._videoMeta.marginBottom=_,c&&(y.bottom=v+_,y.left=y.right=m),Object.keys(y).map((function(e){n.root.style[e]="".concat(y[e],"px")})),this.emit(Fx,{vLeft:m,vBottom:v,marginBottom:_,vWidth:i,vHeight:d,fontSize:p,scale:h})}},{key:"__startResize",value:function(e){var t=this,i=e.getBoundingClientRect(),n=this._videoMeta,r=i.width,o=i.height;if(this._iId&&(clearTimeout(this._iId),this._iId=null),r>0&&o>0&&(r!==n.lwidth||o!==n.lheight))this._iC=0,this.resize(r,o);else{if(this._iC>=5)return void(this._iC=0);this._iC++,this._iId=setTimeout((function(){t.__startResize(e)}),50)}}},{key:"__removeByTime",value:function(e,t){for(var i=[],n=0;n<e.length;n++)(!t||e[n].end<t)&&i.push(n);0!==i.length&&(e.splice(i[0],i.length),this.config.domRender&&this.__remove(i))}},{key:"__remove",value:function(e){var t=this;if(e&&!(e.length<1)){this._log(">>>>_renderByWords__remove",e);for(var i=this.innerRoot.children,n=[],r=0;r<i.length;r++){var o=Number(i[r].getAttribute("data-index"));e.includes(o)&&n.push(i[r])}n.map((function(e){t.innerRoot.removeChild(e)}))}}},{key:"__render",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._log("__render",t.length,this.config.domRender);var i=this.config,n=i.renderMode,r=i.domRender;t.length>0&&r&&t.forEach((function(t){var i="text-track-".concat(e.config.line);t.text.forEach((function(r,o){o>0&&(i+=" text-track-deputy");var a={"data-start":t.start,"data-end":t.end,"data-index":t.index},s=wx("xg-text-track-span","",a,i);if(e.innerRoot.appendChild(s),"step"===n){var l=wx("xg-text-track-span","",a,"".concat(i," text-track-space"));e.innerRoot.appendChild(l),Xx(l,r),setTimeout((function(){e._renderByWords(s,o,t.start,t.end,r)}),600)}else Xx(s,r)}))}))}},{key:"_renderByWords",value:function(e,t,i,n,r){var o=document.createTextNode("");e.appendChild(o);var a,s,l=function(e){for(var t=e.split(""),i=[],n=!1,r=0;r<t.length;r++){var o=t[r];if(Nx(o))if(n){var a=i.length-1;i[a]="".concat(i[a]).concat(o)}else i.push(o),n=!0;else if(o.match(/^[ ]*$/)||Mx(o)||/[\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|\uffe5]/.test(o)){n=!1;var s=i.length-1;s>=0?i[s]="".concat(i[s]).concat(o):i.push(o)}else n=!1,i.push(o)}return i}((a=r,Xx(s=document.createElement("span"),a),s.textContent||"")),c=this._getPlayerCurrentTime(),u=Ox(1e3*(n-c));if(!(c>=n)){i>=c&&(c=i),u>300&&(u-=50);var h={dom:o,ids:t,wordList:l,interval:u/l.length,start:c,end:n,duration:u,lastTime:0};this._log(">>>>_renderByWords",u,h);for(var d=this._curRenderTask,f=-1,p=0;p<d.length;p++)if(d[p].ids===t){f=p;break}f>-1&&d.slice(f,1),d.push(h),this.startRender(-1)}}},{key:"stopRender",value:function(){this._renderIntervalId&&window.cancelAnimationFrame(this._renderIntervalId)}},{key:"show",value:function(){var e,t;this.config.domRender&&(e=this.root,t="text-track-hide",e&&(e.classList?t.split(/\s+/g).forEach((function(t){e.classList.remove(t)})):Cx(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===NR(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))))}},{key:"hide",value:function(){this.config.domRender&&(kx(this.root,"text-track-hide"),this.innerRoot&&(this.innerRoot.innerHTML=""))}},{key:"emit",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=XR(jR(i.prototype),"emit",this)).call.apply(n,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=XR(jR(i.prototype),"on",this)).call.apply(n,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=XR(jR(i.prototype),"once",this)).call.apply(n,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=XR(jR(i.prototype),"off",this)).call.apply(n,[this,e,t].concat(o))}},{key:"offAll",value:function(){XR(jR(i.prototype),"removeAllListeners",this).call(this)}},{key:"marginBottom",get:function(){var e=this._videoMeta,t=e.vBottom,i=e.marginBottom;return this.config.fitVideo?t+i:i}}]),i}();class Jx extends Rr{constructor(e){super(),this._onChange=e=>{const t=this._media.textTracks;if(!t||0===t.length)return;const i=[],n=[];let r=-1;for(let o=0;o<t.length;o++){const e=t[o];"subtitles"===e.kind&&(i.push({id:e.id||e.language,language:e.language,text:e.label,isDefault:"showing"===e.mode}),-1===r&&"showing"===e.mode&&(r=o),n.push(e.language))}n.join("|")!==this._languages?(this._languages=n.join("|"),this.emit("reset",{list:i,isOpen:r>-1})):-1===r?this.emit("off"):this.curIndex!==r&&this.emit("change",i[r]),this.curIndex=r},this._media=e,this._list=[],this._languages="",this.curIndex=-1,this._init()}_init(){const e=this._media.textTracks;e?(e.addEventListener("change",this._onChange),e.addEventListener("addtrack",this._onChange)):as.warn("current browser not support native subtitle")}switch(e){return new Promise(((t,i)=>{if(!e)return i({code:1,message:"no subtitle data"});const n=this._media.textTracks;for(let r=0;r<n.length;r++){const t=n[r];t.language===e.language?t.mode="showing":"showing"===t.mode&&(t.mode="disabled")}return t({code:0})}))}switchOff(){const e=this._media.textTracks;for(let t=0;t<e.length;t++)e[t].mode="disabled";this.curIndex=-1}destroy(){this._media.textTracks.removeEventListener("change",this._onChange),this._media=null,this._list=[],this._languages="",this.curIndex=-1}}function eO(){return(new DOMParser).parseFromString('<svg width="18" height="16" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2 0.5C0.895431 0.5 0 1.39543 0 2.5V13.5C0 14.6046 0.89543 15.5 2 15.5H16C17.1046 15.5 18 14.6046 18 13.5V2.5C18 1.39543 17.1046 0.5 16 0.5H2ZM7.49634 11.0454C8.00741 10.606 8.29061 10.0037 8.34595 9.23877H6.8811C6.84855 9.67171 6.71997 9.99235 6.49536 10.2007C6.27401 10.4058 5.93709 10.5083 5.48462 10.5083C4.98332 10.5083 4.61548 10.3309 4.3811 9.97607C4.14998 9.62126 4.03442 9.05973 4.03442 8.2915V7.75439C4.04093 7.01872 4.16463 6.47673 4.40552 6.12842C4.64966 5.77686 5.01587 5.60107 5.50415 5.60107C5.95337 5.60107 6.28703 5.70524 6.50513 5.91357C6.72648 6.11865 6.85506 6.45068 6.89087 6.90967H8.35571C8.27759 6.1154 7.98787 5.49854 7.48657 5.05908C6.98527 4.61963 6.32446 4.3999 5.50415 4.3999C4.9117 4.3999 4.39087 4.53988 3.94165 4.81982C3.49569 5.09652 3.15226 5.49528 2.91138 6.01611C2.67049 6.53695 2.55005 7.13916 2.55005 7.82275V8.25732C2.55005 9.32829 2.81047 10.1714 3.3313 10.7866C3.85539 11.3986 4.57316 11.7046 5.48462 11.7046C6.31795 11.7046 6.98853 11.4849 7.49634 11.0454ZM14.5393 11.0454C15.0504 10.606 15.3336 10.0037 15.3889 9.23877H13.9241C13.8915 9.67171 13.7629 9.99235 13.5383 10.2007C13.317 10.4058 12.9801 10.5083 12.5276 10.5083C12.0263 10.5083 11.6584 10.3309 11.4241 9.97607C11.193 9.62126 11.0774 9.05973 11.0774 8.2915V7.75439C11.0839 7.01872 11.2076 6.47673 11.4485 6.12842C11.6926 5.77686 12.0588 5.60107 12.5471 5.60107C12.9963 5.60107 13.33 5.70524 13.5481 5.91357C13.7695 6.11865 13.898 6.45068 13.9338 6.90967H15.3987C15.3206 6.1154 15.0308 5.49854 14.5295 5.05908C14.0282 4.61963 13.3674 4.3999 12.5471 4.3999C11.9547 4.3999 11.4338 4.53988 10.9846 4.81982C10.5387 5.09652 10.1952 5.49528 9.95435 6.01611C9.71346 6.53695 9.59302 7.13916 9.59302 7.82275V8.25732C9.59302 9.32829 9.85343 10.1714 10.3743 10.7866C10.8984 11.3986 11.6161 11.7046 12.5276 11.7046C13.3609 11.7046 14.0315 11.4849 14.5393 11.0454Z" fill="white"/>\n</svg>',"image/svg+xml").firstChild}function tO(){return(new DOMParser).parseFromString('<svg width="18" height="16" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.49609 11.0454C8.00716 10.606 8.29037 10.0037 8.3457 9.23877H6.88086C6.84831 9.67171 6.71973 9.99235 6.49512 10.2007C6.27376 10.4058 5.93685 10.5083 5.48438 10.5083C4.98307 10.5083 4.61523 10.3309 4.38086 9.97607C4.14974 9.62126 4.03418 9.05973 4.03418 8.2915V7.75439C4.04069 7.01872 4.16439 6.47673 4.40527 6.12842C4.64941 5.77686 5.01562 5.60107 5.50391 5.60107C5.95312 5.60107 6.28678 5.70524 6.50488 5.91357C6.72624 6.11865 6.85482 6.45068 6.89062 6.90967H8.35547C8.27734 6.1154 7.98763 5.49854 7.48633 5.05908C6.98503 4.61963 6.32422 4.3999 5.50391 4.3999C4.91146 4.3999 4.39062 4.53988 3.94141 4.81982C3.49544 5.09652 3.15202 5.49528 2.91113 6.01611C2.67025 6.53695 2.5498 7.13916 2.5498 7.82275V8.25732C2.5498 9.32829 2.81022 10.1714 3.33105 10.7866C3.85514 11.3986 4.57292 11.7046 5.48438 11.7046C6.31771 11.7046 6.98828 11.4849 7.49609 11.0454Z" fill="white"/>\n<path d="M14.5391 11.0454C15.0501 10.606 15.3333 10.0037 15.3887 9.23877H13.9238C13.8913 9.67171 13.7627 9.99235 13.5381 10.2007C13.3167 10.4058 12.9798 10.5083 12.5273 10.5083C12.026 10.5083 11.6582 10.3309 11.4238 9.97607C11.1927 9.62126 11.0771 9.05973 11.0771 8.2915V7.75439C11.0837 7.01872 11.2074 6.47673 11.4482 6.12842C11.6924 5.77686 12.0586 5.60107 12.5469 5.60107C12.9961 5.60107 13.3298 5.70524 13.5479 5.91357C13.7692 6.11865 13.8978 6.45068 13.9336 6.90967H15.3984C15.3203 6.1154 15.0306 5.49854 14.5293 5.05908C14.028 4.61963 13.3672 4.3999 12.5469 4.3999C11.9544 4.3999 11.4336 4.53988 10.9844 4.81982C10.5384 5.09652 10.195 5.49528 9.9541 6.01611C9.71322 6.53695 9.59277 7.13916 9.59277 7.82275V8.25732C9.59277 9.32829 9.85319 10.1714 10.374 10.7866C10.8981 11.3986 11.6159 11.7046 12.5273 11.7046C13.3607 11.7046 14.0312 11.4849 14.5391 11.0454Z" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M0 2.5C0 1.39543 0.895431 0.5 2 0.5H16C17.1046 0.5 18 1.39543 18 2.5V13.5C18 14.6046 17.1046 15.5 16 15.5H2C0.89543 15.5 0 14.6046 0 13.5V2.5ZM2 2.3H16C16.1105 2.3 16.2 2.38954 16.2 2.5V13.5C16.2 13.6105 16.1105 13.7 16 13.7H2C1.88954 13.7 1.8 13.6105 1.8 13.5V2.5C1.8 2.38954 1.88954 2.3 2 2.3Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}const{POSITIONS:iO}=ba,nO="mobile"===Kr.device,rO="text-close";function oO(e=[]){let t=-1;return e.map(((e,i)=>{e.id||e.language||(e.id=""+i),!e.url&&(e.url=e.src),!e.text&&(e.text=e.label),!e.language&&(e.language=e.srclang),void 0===e.isDefault&&(e.isDefault=e.default),(e.isDefault||e.default)&&(t<0?t=i:e.isDefault=e.default=!1)})),t}class aO extends ba{constructor(e){super(e),this.isOpenState=!0,this.optionList=null,this.currentLang="",this._onOff=()=>{this.noShowSubtitle()},this._onChange=e=>{const t=this.getSubTitleIndex(this.config.list,e);t<0||this.updateCurItem(t,e)},this._onListReset=e=>{this.updateList(e)},this.handleButtonChange=e=>{e.preventDefault(),e.stopPropagation(),e.delegateTarget||(nO?this.showMobilePanel():this.isOpenState?this.switchOffSubtitle():this.openSubtitle().then((()=>this.showList())))},this.onEnter=e=>{e.stopPropagation(),this.emit("icon_mouseenter",{pluginName:this.pluginName}),this.showList()},this.onLeave=e=>{e.stopPropagation(),this.emit("icon_mouseleave",{pluginName:this.pluginName}),this.hideList()},this.handlerClickSwitch=(e,t)=>{e.stopPropagation(),e.preventDefault(),this.subTitles&&(t.type===rO?this.switchOffSubtitle():this.switchSubTitle({language:t.language,id:t.id}))},this.onPlayerFocus=e=>{this.subTitles&&this.config.style.follow&&this.rePosition()},this.onPlayerBlur=e=>{this.subTitles&&this.config.style.follow&&!this.playerConfig.marginControls&&this.subTitles.root&&(this.subTitles.root.style.transform="translate(0, 0)")};const{player:t,config:i}=e;t.config.isLive&&(e.config.updateMode="live",Kr.os.isIos&&(e.config.mode="native"))}static get pluginName(){return"Subtitle"}static get defaultConfig(){return{position:iO.CONTROLS_RIGHT,index:jA,list:[],isDefaultOpen:!0,style:{follow:!0,mode:"stroke",followBottom:50,fitVideo:!0,offsetBottom:4,baseSizeX:49,baseSizeY:28,minSize:16,minMobileSize:13,line:"double",fontColor:"#fff"},isShowIcon:!0,mode:"external",updateMode:"vod"}}afterCreate(){const{list:e=[]}=this.config;this.curIndex=-1,this.curItem=null;const t=oO(e);super.afterCreate(),"native"===this.config.mode?this._initNativeSubtitle(t):this._initExtSubTitle(t),e.length||this.hide()}_initNativeSubtitle(e){const{player:t}=this;t._subTitles||(t._subTitles=new Jx(t.video)),this.subTitles=t._subTitles,this.subTitles.on("off",this._onOff),this.subTitles.on("change",this._onChange),this.subTitles.on("reset",this._onListReset),this._renderList(e)}_initExtSubTitle(e){const{list:t=[],style:i,isDefaultOpen:n,updateMode:r,renderMode:o}=this.config,a={subTitles:t,defaultOpen:n,debugger:!1,renderMode:o,updateMode:r};this.isOpenState=n,Object.keys(i).map((e=>{a[e]=i[e]}));!this.playerConfig.marginControls&&this.player.controls.root&&(this.on(ho,this.onPlayerFocus),this.on(fo,this.onPlayerBlur));const{player:s}=this;s._subTitles?s._subTitles._isOpen&&(e=this.getSubTitleIndex(this.config.list,s._subTitles.currentText)):(s._subTitles=new Qx(a),s._subTitles.attachPlayer(this.player),this.changeTipText()),this.subTitles=s._subTitles,this.subTitles.on("off",this._onOff),this.subTitles.on("change",this._onChange),this.subTitles.on("reset",this._onListReset),i.follow&&this.subTitles.root&&Ur.addClass(this.subTitles.root,"follow-control"),this._renderList(e)}_renderList(e){const{list:t=[],isDefaultOpen:i}=this.config;t.length&&(e<0?(t[0].isDefault=!0,this.curIndex=0,this.curItem=t[0]):(this.curIndex=e,this.curItem=t[e])),this.appendChild(".xgplayer-icon",this.icons.vttSubOpen),this.appendChild(".xgplayer-icon",this.icons.vttSubClose),this.creatOptionList(),this.initEvents(),this.isOpenState?Ur.addClass(this.root,"isOpen"):Ur.addClass(this.root,"isClose"),!1===this.config.isShowIcon&&this.hide()}updateCurItem(e,t){this.curIndex=e,this.curItem=this.config.list[e],this.renderItemList(),this.emit("subtitle_change",c({off:!1,isListUpdate:!1,list:[]},t))}initEvents(){this.bind(["click"],this.handleButtonChange),this.bind(["mouseenter"],this.onEnter),this.bind(["mouseleave"],this.onLeave),this._delegates=[]}showList(){var e;!nO&&this.isOpenState&&(null==(e=this.optionList)||e.show())}hideList(){var e;!nO&&this.isOpenState&&(null==(e=this.optionList)||e.hide())}openSubtitle(){return this.curIndex<0&&(this.curIndex=0,this.curItem=this.config.list[0]),this.curIndex>-1&&this.curItem?this.switchSubTitle(this.curItem):Promise.resolve(void 0)}getSubTitleIndex(e,t={id:"",language:""}){let i=-1;return t&&(t.id||t.language)?(e.forEach(((e,n)=>{e.id!==t.id&&e.language!==t.language||(i=n)})),i):i}registerIcons(){return{vttSubOpen:{icon:eO,class:"xgplayer-vttsub-open-svg"},vttSubClose:{icon:tO,class:"xgplayer-vttsub-close-svg"}}}registerLanguageTexts(){return{sub:{jp:"字幕",en:"Subtitles",zh:"字幕","zh-hk":"字幕"},subOpen:{jp:"字幕をオンにする",en:"Show subtitles",zh:"开启字幕","zh-hk":"開啟字幕"},subClose:{jp:"クローズドキャプション",en:"Hide subtitles",zh:"关闭字幕","zh-hk":"關閉字幕"}}}creatOptionList(){if(nO)return;const e={config:{data:this.getList(),className:"",onItemClick:(e,t)=>{this.handlerClickSwitch(e,null==t?void 0:t.to)}},root:this.root};this.optionList=new kA(e)}getList(){return this.config.list.map(((e,t)=>(t===this.curIndex&&this.isOpenState?(e.isCurrent=!0,e.selected=!0):(e.isCurrent=!1,e.selected=!1),e.showText=this.getTextByLang(e),e)))}renderOptionList(){this.optionList.renderItemList(this.getList())}switchSubTitle(e={id:"",language:""}){let t=-1;return e&&(e.id||e.language)?(this.config.list.map(((i,n)=>{i.id+""==e.id+""&&i.language+""==e.language+""&&(t=n)})),t<0||this.isOpenState&&t===this.curIndex?Promise.resolve(void 0):this.subTitles.switch(e).then((i=>{0===i.code&&(e.off=!1,e.isListUpdate=!1,e.list=[],this.curIndex=t,this.curItem=this.config.list[t],this.isOpenState=!0,Ur.removeClass(this.root,"isClose"),Ur.addClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),this.emit("subtitle_change",e))})).catch((e=>as.error("switch subtitle err: ",e)))):Promise.resolve(void 0)}switchOffSubtitle(){this.subTitles.switchOff(),this.noShowSubtitle()}noShowSubtitle(){var e;this.emit("subtitle_change",{off:!0,isListUpdate:!1,list:[]}),this.isOpenState=!1,Ur.addClass(this.root,"isClose"),Ur.removeClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),null==(e=this.optionList)||e.hide()}renderItemList(){nO?this.updatePanel():this.renderOptionList()}updateSubtitles(e=[],t=!0){if(!e)return;const i=this.curIndex>-1||this.config.isDefaultOpen;this.updateList({list:e,isOpen:i}),this.subTitles&&this.subTitles.setSubTitles(this.config.list,i,t)}updateList(e={}){var t,i,n,r;if(!e.list)return;e.list.length>0&&this.show();const o=[];e.list.map((e=>{o.push(e)}));const a=oO(o);e.isOpen?(this.isOpenState=!0,this.curIndex=a,this.curItem=a>-1?o[a]:null,Ur.removeClass(this.root,"isClose"),Ur.addClass(this.root,"isOpen")):(this.isOpenState=!1,this.curIndex=-1,this.curItem=null,Ur.removeClass(this.root,"isOpen"),Ur.addClass(this.root,"isClose"),this.changeTipText(),null==(t=this.optionList)||t.hide()),this.config.list=o,o.length>0?nO||null==(i=this.optionList)||i.hide():(this.switchOffSubtitle(),nO?this.showMobilePanel():null==(n=this.optionList)||n.show(),nO||null==(r=this.optionList)||r.hide(),this.hide()),this.renderItemList()}changeTipText(){this.isOpenState?this.find(".xg-tips").innerHTML=this.langText.subClose:this.find(".xg-tips").innerHTML=this.langText.subOpen}showMobilePanel(){var e;const t=this.renderPanel();null==(e=this.player.panel)||e.showPanel(t,this.langText.sub,!0)}updatePanel(){var e;const t=this.renderPanel();null==(e=this.player.panel)||e.updatePanel(t)}renderPanel(){const e=[...this.config.list],t=Ur.createDom("div","",{},"ai-panel-content");e.map(((e,i)=>{const n=c({language:e.language||e.srclang,"data-id":e.id,selected:this.isOpenState&&this.curIndex===i,showText:this.getTextByLang(e)},e),r=this.renderPanelItem(n);t.appendChild(r)}));const i={showText:this.langText.subClose,"data-type":rO,selected:!this.isOpenState};return t.appendChild(this.renderPanelItem(i)),t}renderPanelItem(e){const{showText:t,selected:i}=e,n=Ur.createDom("div","",{language:e.language,"data-id":e["data-id"],"data-type":e["data-type"]},"panel-Item "+(i?"select-in":""));n.innerHTML=t;const r=nO?"touchend":"click",o=ba.delegate(n,".panel-Item",r,(t=>{e["data-type"]===rO?(t.stopPropagation(),t.preventDefault(),this.switchOffSubtitle()):this.handlerClickSwitch(t,e)}));return this._delegates.push(o),n}getTextByLang(e,t,i){if(void 0===e)return"";const{list:n}=this.config;return!i&&(i=this.player.lang),t=!t||Ur.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=n[e]),"object"==typeof e[t]?e[t][i]||e[t].zh:e[t]||""}rePosition(){const{fitVideo:e}=this.config.style,t=0-this.player.controls.root.getBoundingClientRect().height;if(!e)return void(this.subTitles.root.style.transform=`translate(0, ${t}px)`);const{video:i,root:n}=this.player,{height:r,width:o}=n.getBoundingClientRect(),{videoHeight:a,videoWidth:s}=i;let l=parseInt(a/s*100,10)*o/100;l>r&&(l=r);const c=(r-l)/2-t;c<0&&(this.subTitles.root.style.transform=`translate(0, ${c}px)`)}destroy(){var e;this.subTitles&&(this.subTitles.destroy(),this.subTitles=null),this.unbind(["click"],this.handleButtonChange.bind(this)),this.unbind(["mouseenter"],this.showList.bind(this)),this.unbind(["mouseleave"],this.hideList.bind(this)),null==(e=this.optionList)||e.destroy(),this._delegates&&this._delegates.length>0&&(this._delegates.map((e=>{Array.isArray(e)&&e.map((e=>{e.destroy&&e.destroy()})),e.destroy&&e.destroy()})),this._delegates=null),super.destroy()}render(){return`\n <xg-icon class="xgplayer-vttsub">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="vttSubOpen">${this.langText.subOpen}</div>\n </xg-icon>\n `}}const sO=class extends ba{constructor(e){super(e),this.toastNumber=0,this.toastMaps={}}static get pluginName(){return"sdkToastPlugin"}static get defaultConfig(){return{index:5}}beforePlayerInit(){}afterPlayerInit(){}afterCreate(){}destroy(){}add(e,t=2e3,i=!1){const n=this.toastNumber+1;this.toastNumber=n;const r=this.renderToast(e,i,n);return this.root.appendChild(r),this.toastMaps[n]=r,t&&setTimeout((()=>{this.remove(n)}),t),n}remove(e){const t=this.toastMaps[e];t&&(this.root.contains(t)&&this.root.removeChild(t),delete this.toastMaps[e])}renderToast(e,t,i){const n=Ur.createDom("div","",void 0,"toast-container"),r=Ur.checkIsObject(e)?e:Ur.createDom("div",e,void 0,"toast-txt");if(n.appendChild(r),t){const e=Ur.createDom("span","×",void 0,"toast-close-bt");e.addEventListener("click",(()=>{this.remove(i)})),n.appendChild(e)}return n}render(){return'<xg-sdk-toast class="xgplayer-sdk-toast"></xg-sdk-toast>'}};function lO(){return(new Date).getTime()}var cO="loadstart",uO="loadeddata",hO="firstFrame",dO="waitingStart",fO="waitingEnd",pO="seekStart",gO="seekEnd",yO=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"_onTimeupdate",(function(){e._state.isTimeUpdate=!0,e._state.autoplayStart&&(Nr.logInfo("[xgLogger]".concat(e.player.playerId," _onTimeupdate")),e._sendFF("onTimeupdate"))})),mr(Sr(e),"_onAutoplayStart",(function(){Nr.logInfo("[xgLogger]".concat(e.player.playerId," _onAutoplayStart")),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),mr(Sr(e),"_onReset",(function(){e._state={autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1},e.vt=0,e.pt=0,e.fvt=0,e.newPointTime=lO(),e.loadedCostTime=0,e.startCostTime=0,e._isSeeking=!1,e.seekingStart=0,e.waitingStart=0,e.fixedWaitingStart=0,e._isWaiting=!1,e._waitTimer&&Ur.clearTimeout(Sr(e),e._waitTimer),e._waittTimer&&Ur.clearTimeout(Sr(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),mr(Sr(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=lO(),e.emitLog(pO,{start:lO()}))})),mr(Sr(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),mr(Sr(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=lO(),e.fixedWaitingStart=lO(),e._waitType=1,e.emitLog(dO,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),mr(Sr(e),"_onWaiting",(function(){!e._isWaiting&&e.vt&&(e._isWaiting=!0,e.vt?e.seekingStart?e._waitType=2:e._waitType=0:e._waitType=1,e.fixedWaitingStart=lO(),e._waitTimer=Ur.setTimeout(Sr(e),(function(){e._isWaiting&&(e.waitingStart=lO(),Ur.clearTimeout(Sr(e),e._waitTimer),e._waitTimer=null,e._startWaitTimeout(),e.emitLog(dO,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing"}))}),200))})),mr(Sr(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),mr(Sr(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return vr(i,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=lO(),this.loadedCostTime=0,this.startCostTime=0,this.on(co,(function(){var t=e._state,i=t.autoplayStart,n=t.isFFSend;e.startCostTime=lO()-e.newPointTime,Nr.logInfo("[xgLogger]".concat(e.player.playerId," LOAD_START"),"autoplayStart:".concat(i," isFFSend:").concat(n," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),n||(!t.isLs&&e.emitLog(cO,{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=lO(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())})),this.on(ao,(function(){e.vt=lO(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime;var t=e._state,i=t.isTimeUpdate,n=t.isFFSend,r=t.autoplayStart;Nr.logInfo("[xgLogger]".concat(e.player.playerId," LOADED_DATA"),"fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(i||r)&&e._sendFF("loadedData"),n||e.emitLog(uO,{}),e.suspendWaitingStatus("loadeddata")})),this.on(Jr,this._onSeeking),this.on(eo,this._onSeeked),this.on(Eo,(function(){e.endState("destroy")})),this.on(To,(function(){e.endState("urlChange"),Nr.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()})),this.on([Xr,no],this._onPlaying),this.on(io,this._onWaiting),this.on(Qr,this._onError),this.on(Fo,(function(){Nr.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()}))}},{key:"_initOnceEvents",value:function(){this.off(yo,this._onAutoplayStart),this.off(to,this._onTimeupdate),this.once(yo,this._onAutoplayStart),this.once(to,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=lO();var t=this._state,i=t.isFFLoading,n=t.isFFSend;Nr.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(i," !isFFSend:").concat(!n)),this.vt>0&&i&&!n&&(Nr.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(hO,{fvt:this.fvt,costTime:this.fvt,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&Ur.clearTimeout(this,this._waittTimer),this._waittTimer=Ur.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),Ur.clearTimeout(e,e._waittTimer),e._waittTimer=null}),this.config.waitTimeout)}},{key:"endState",value:function(e){this.suspendWaitingStatus(e),this.suspendSeekingStatus(e)}},{key:"suspendSeekingStatus",value:function(e){if(this.seekingStart){var t=lO(),i=t-this.seekingStart;this.seekingStart=0,this.emitLog(gO,{end:t,costTime:i,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(Ur.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(Ur.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var t=lO(),i=t-this.waitingStart,n=t-this.fixedWaitingStart,r=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(fO,{fixedCostTime:n>r?r:n,costTime:i>r?r:i,type:"loadeddata"===e?1:this._waitType,endType:2===this._waitType?"seek":e})}}},{key:"emitLog",value:function(e,t){var i=this.player;this.emit(Uo,fr({t:lO(),host:Ur.getHostFromUrl(i.currentSrc),vtype:i.vtype,eventType:e,currentTime:this.player.currentTime,readyState:i.video.readyState,networkState:i.video.networkState},t))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),i}();function vO(){return(new DOMParser).parseFromString('<svg class="xgplayer-replay-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78 78" width="78" height="78">\n <path fill="#fff" transform="translate(20, 20)" d="M8.22708362,13.8757234 L11.2677371,12.6472196 C11.7798067,12.4403301 12.3626381,12.6877273 12.5695276,13.1997969 L12.9441342,14.1269807 C13.1510237,14.6390502 12.9036264,15.2218816 12.3915569,15.4287712 L6.8284538,17.6764107 L5.90126995,18.0510173 C5.38920044,18.2579068 4.80636901,18.0105096 4.5994795,17.49844 L1.97723335,11.0081531 C1.77034384,10.4960836 2.0177411,9.91325213 2.52981061,9.70636262 L3.45699446,9.33175602 C3.96906396,9.12486652 4.5518954,9.37226378 4.75878491,9.88433329 L5.67885163,12.1615783 C7.99551726,6.6766934 13.3983951,3 19.5,3 C27.7842712,3 34.5,9.71572875 34.5,18 C34.5,26.2842712 27.7842712,33 19.5,33 C15.4573596,33 11.6658607,31.3912946 8.87004692,28.5831991 C8.28554571,27.9961303 8.28762719,27.0463851 8.87469603,26.4618839 C9.46176488,25.8773827 10.4115101,25.8794641 10.9960113,26.466533 C13.2344327,28.7147875 16.263503,30 19.5,30 C26.127417,30 31.5,24.627417 31.5,18 C31.5,11.372583 26.127417,6 19.5,6 C14.4183772,6 9.94214483,9.18783811 8.22708362,13.8757234 Z"></path>\n</svg>\n',"image/svg+xml").firstChild}var mO=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"registerIcons",value:function(){return{replay:vO}}},{key:"afterCreate",value:function(){var e=this;ba.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayClick",(function(){e.player.replay()}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on(qr,(function(){if(e.playerConfig.loop||Ur.addClass(e.player.root,"replay"),!e.config.disable){e.show();var t=e.root.querySelector("path");if(t){var i=window.getComputedStyle(t).getPropertyValue("transform");if("string"==typeof i&&i.indexOf("none")>-1)return null;t.setAttribute("transform",i)}}})),this.on($r,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),Ur.removeClass(this.player.root,"replay")}},{key:"show",value:function(e){this.config.disable||(this.root.style.display="flex")}},{key:"enable",value:function(){this.config.disable=!1}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){this.unbind(".xgplayer-replay",["click","touchend"],this.__handleReplay)}},{key:"render",value:function(){return'<xg-replay class="xgplayer-replay">\n <xg-replay-txt class="xgplayer-replay-txt" lang-key="'.concat(this.i18nKeys.REPLAY,'">').concat(this.i18n.REPLAY,"</xg-replay-txt>\n </xg-replay>")}}],[{key:"pluginName",get:function(){return"replay"}},{key:"defaultConfig",get:function(){return{disable:!1}}}]),i}();function _O(){return(new DOMParser).parseFromString('<svg class="play" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M576,363L810,512L576,661zM342,214L576,363L576,661L342,810z"></path>\n</svg>\n',"image/svg+xml").firstChild}function EO(){return(new DOMParser).parseFromString('<svg class="pause" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598,214h170v596h-170v-596zM256 810v-596h170v596h-170z"></path>\n</svg>\n',"image/svg+xml").firstChild}var TO={};function SO(e){e?window.clearTimeout(e):Object.keys(TO).map((function(e){window.clearTimeout(TO[e].id),delete TO[e]}))}var bO=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"onPlayerReset",(function(){n.autoPlayStart=!1;var e="auto"===n.config.mode?"auto-hide":"hide";n.setAttr("data-state","play"),Ur.removeClass(n.root,e),n.show()})),mr(Sr(n),"onAutoplayStart",(function(){if(!n.autoPlayStart){var e="auto"===n.config.mode?"auto-hide":"hide";Ur.addClass(n.root,e),n.autoPlayStart=!0,n.toggleTo("play")}})),n.autoPlayStart=!1,n}return vr(i,[{key:"afterCreate",value:function(){var e=this.playerConfig;this.initIcons(),this.listenEvents(),this.bindClickEvents(),e.autoplay||this.show()}},{key:"listenEvents",value:function(){var e=this,t=this.player,i=this.playerConfig;this.once(po,(function(){i&&(i.lang&&"en"===i.lang?Ur.addClass(t.root,"lang-is-en"):"jp"===i.lang&&Ur.addClass(t.root,"lang-is-jp"))})),this.on(yo,this.onAutoplayStart),this.on(vo,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),Ur.removeClass(e.root,t),e.show()})),this.on($r,(function(){e.toggleTo("play")})),this.on(Zr,(function(){e.toggleTo("pause")})),this.on(Fo,(function(){e.onPlayerReset()}))}},{key:"bindClickEvents",value:function(){var e=this;this.clickHandler=this.hook("startClick",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation();var i=e.player.paused;e.emitUserAction(t,"switch_play_pause",{props:"paused",from:i,to:!i})}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:_O,class:"xg-icon-play"},startPause:{icon:EO,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild("xg-start-inner",e.startPlay),this.appendChild("xg-start-inner",e.startPause)}},{key:"hide",value:function(){Ur.addClass(this.root,"hide")}},{key:"show",value:function(e){Ur.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){Ur.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){Ur.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(e){e?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(e){var t=this;this._animateId=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};return TO[e]&&window.clearTimeout(TO[e].id),TO[e]={},i.start&&i.start(),TO[e].id=window.setTimeout((function(){i.end&&i.end(),window.clearTimeout(TO[e].id),delete TO[e]}),t),TO[e].id}("pauseplay",400,{start:function(){Ur.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){Ur.removeClass(t.root,"interact"),!e&&t.hide(),t._animateId=null}})}},{key:"endAnimate",value:function(){Ur.removeClass(this.root,"interact"),SO(this._animateId),this._animateId=null}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.state<Na.READY)||(this.player.paused||t.state!==Na.RUNNING?t.play():t.pause())}},{key:"onPlayPause",value:function(e){this.toggleTo(e)}},{key:"toggleTo",value:function(e){var t=this.config,i=this.player;if(i&&!(i.state<Na.RUNNING)&&this.autoPlayStart){if("show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&i.paused&&!i.ended||t.isShowEnd&&i.ended)return this.switchStatus(),this.show(),void this.endAnimate();if(t.disableAnimate)return this.switchStatus(),void this.hide();if("play"===e)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||i.ended)return;this.animate()}}else this.switchStatus()}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),SO(this._animateId)}},{key:"render",value:function(){var e=this.playerConfig.autoplay?"auto"===this.config.mode?"auto-hide":"hide":"";return'\n <xg-start class="xgplayer-start '.concat(e,'">\n <xg-start-inner></xg-start-inner>\n </xg-start>')}}],[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}]),i}(),CO=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"render",value:function(){var e=this.config.innerHtml,t=Ur.createDom("xg-enter","",{},"xgplayer-enter");if(e&&e instanceof window.HTMLElement)t.appendChild(e);else if(e&&"string"==typeof e)t.innerHTML=e;else{for(var i="",n=1;n<=12;n++)i+='<div class="xgplayer-enter-bar'.concat(n,'"></div>');t.innerHTML='<div class="xgplayer-enter-spinner">'.concat(i,"</div>")}return t}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),i}();function kO(e,t,i){try{return' <div class="xg-tips '.concat(i?"hide":" ",'" lang-key="').concat(e.i18nKeys[t],'">\n ').concat(e.i18n[t],"\n </div>")}catch(hs){return'<div class="xg-tips hide"></div>'}}var IO=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"afterCreate",value:function(){this.getMini=this.getMini.bind(this),this.exitMini=this.exitMini.bind(this),this.bind("click",this.getMini)}},{key:"getMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"exitMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.getMini)}},{key:"render",value:function(){var e="MINISCREEN";return'\n <xg-icon class="xgplayer-miniicon">\n <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</span></div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:10}}}]),i}();function PO(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var DO=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],wO=DO.length;function AO(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===pr(e)&&e.nodeType){var t=function(e){return window.getComputedStyle(e)}(e);if("none"===t.display)return function(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0;t<wO;t++)e[DO[t]]=0;return e}();var i={};i.width=e.offsetWidth,i.height=e.offsetHeight;for(var n=i.isBorderBox="border-box"===t.boxSizing,r=0;r<wO;r++){var o=DO[r],a=t[o],s=parseFloat(a);i[o]=Number.isNaN(s)?0:s}var l=i.paddingLeft+i.paddingRight,c=i.paddingTop+i.paddingBottom,u=i.marginLeft+i.marginRight,h=i.marginTop+i.marginBottom,d=i.borderLeftWidth+i.borderRightWidth,f=i.borderTopWidth+i.borderBottomWidth,p=n,g=PO(t.width);!1!==g&&(i.width=g+(p?0:l+d));var y=PO(t.height);return!1!==y&&(i.height=y+(p?0:c+f)),i.innerWidth=i.width-(l+d),i.innerHeight=i.height-(c+f),i.outerWidth=i.width+u,i.outerHeight=i.height+h,i}}function RO(e,t){for(var i=0;i<e.length;i++){var n=e[i];if(n.identifier===t)return n}}var xO="dragStart",OO="dragMove",LO="dragEnded",NO={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},MO=function(e){_r(i,Rr);var t=Cr(i);function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return gr(this,i),(n=t.call(this)).isEnabled=!0,n.isDragging=!1,n.isDown=!1,n.position={},n.downPoint={},n.dragPoint={x:0,y:0},n.startPos={x:0,y:0},n._root=e instanceof Element?e:document.querySelector(e),n._handlerDom=r.handle instanceof Element?r.handle:document.querySelector(r.handle),n._root&&n._handlerDom?(n._bindStartEvent(),n):br(n)}return vr(i,[{key:"_bindStartEvent",value:function(){var e=this;"ontouchstart"in window?this._startKey="touchstart":this._startKey="mousedown",this["on".concat(this._startKey)]=this["on".concat(this._startKey)].bind(this),this._handlerDom.addEventListener(this._startKey,this["on".concat(this._startKey)]),NO[this._startKey].map((function(t){e["on".concat(t)]=e["on".concat(t)].bind(e)}))}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(e){var t=this;if(e){var i=NO[this._startKey];i.map((function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=i}}},{key:"_unbindPostStartEvents",value:function(){var e=this;this._boundPointerEvents&&(this._boundPointerEvents.map((function(t){window.removeEventListener(t,e["on".concat(t)])})),delete this._boundPointerEvents)}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1,this.isDragging&&this.onUp()}},{key:"onDocUp",value:function(e){this.onUp()}},{key:"animate",value:function(){var e=this;this.isDragging&&(this.positionDrag(),window.requestAnimationFrame((function(){e.animate()})))}},{key:"positionDrag",value:function(){var e="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=e,this._root.style.webKitTransform=e}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(e){this.dragStart(e,e)}},{key:"onmousemove",value:function(e){this.dragMove(e,e)}},{key:"onmouseup",value:function(e){this.dragEnd(e,e)}},{key:"ontouchstart",value:function(e){var t=e.changedTouches[0];this.dragStart(e,t),this.touchIdentifier=void 0!==t.pointerId?t.pointerId:t.identifier,e.preventDefault()}},{key:"ontouchmove",value:function(e){var t=RO(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=RO(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=RO(e.changedTouches,this.touchIdentifier);t&&this.dragCancel(e,t)}},{key:"dragStart",value:function(e,t){if(this._root&&!this.isDown&&this.isEnabled){this.downPoint=t,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var i=AO(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-i.height,this.startPos.maxX=window.innerWidth-i.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,t){this.isDragging=!0,this.animate(),this.emit(xO,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(LO)),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,t){var i={x:t.pageX-this.downPoint.pageX,y:t.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(i)&&this.dragRealStart(e,t),i}},{key:"dragMove",value:function(e,t){if(e=e||window.event,this.isDown){var i=this.startPos,n=i.x,r=i.y,o=this._dragPointerMove(e,t),a=o.x,s=o.y;a=this.checkContain("x",a,n),s=this.checkContain("y",s,r),this.position.x=n+a,this.position.y=r+s,this.dragPoint.x=a,this.dragPoint.y=s,this.emit(OO,this.position)}}},{key:"dragCancel",value:function(e,t){this.dragEnd(e,t)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,t,i){return t+i<0?0-i:"x"===e&&t+i>this.startPos.maxX?this.startPos.maxX-i:"y"===e&&t+i>this.startPos.maxY?this.startPos.maxY-i:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),i=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(i)?0:i,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var i=t.split(","),n=0===t.indexOf("matrix3d")?12:4,r=parseInt(i[n],10),o=parseInt(i[n+1],10);this.position.x+=r,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var i=AO(this._root.parentNode);return i?parseFloat(e)/100*i[t]:0}return parseInt(e,10)}}]),i}(),UO=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;gr(this,i),mr(Sr(n=t.call(this,e)),"onCancelClick",(function(e){n.exitMini(),n.isClose=!0})),mr(Sr(n),"onCenterClick",(function(e){var t=Sr(n).player;t.paused?t.play():t.pause()})),mr(Sr(n),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-n.pos.scrollY)<50)){var t=parseInt(Ur.getCss(n.player.root,"height"));t+=n.config.scrollTop,n.pos.scrollY=window.scrollY,window.scrollY>t+5?!n.isMini&&!n.isClose&&n.getMini():window.scrollY<=t&&(n.isMini&&n.exitMini(),n.isClose=!1)}})),n.isMini=!1,n.isClose=!1;var r=Sr(n).config;return n.pos={left:r.left<0?window.innerWidth-r.width-20:r.left,top:r.top<0?window.innerHeight-r.height-20:r.top,height:n.config.height,width:n.config.width,scrollY:window.scrollY||0},n.lastStyle=null,n}return vr(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.mini&&(e.config.isShowIcon=e.player.config.mini)}},{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.on(Zr,(function(){e.setAttr("data-state","pause")})),this.on($r,(function(){e.setAttr("data-state","play")}))}},{key:"onPluginsReady",value:function(){var e=this,t=this.player;if(!this.config.disable){if(this.config.isShowIcon){var i={config:{onClick:function(){e.getMini()}}};t.controls.registerPlugin(IO,i,IO.pluginName)}var n=Ur.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",n,this.onCancelClick),this.bind(".play-icon",n,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new MO(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:_O,class:"xg-icon-play"},pause:{icon:EO,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".play-icon",e.play),this.appendChild(".play-icon",e.pause)}},{key:"getMini",value:function(){var e=this;if(!this.isMini){var t=this.player,i=this.playerConfig,n=this.config.target||this.player.root;this.lastStyle={},Ur.addClass(t.root,"xgplayer-mini"),["width","height","top","left"].map((function(t){e.lastStyle[t]=n.style[t],n.style[t]="".concat(e.pos[t],"px")})),i.fluid&&(n.style["padding-top"]=""),this.emit(Do,!0),t.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var t=this.player,i=this.playerConfig,n=this.config.target||this.player.root;Ur.removeClass(t.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map((function(t){n.style[t]=e.lastStyle[t]})),this.lastStyle=null,i.fluid&&(t.root.style.width="100%",t.root.style.height="0",t.root.style["padding-top"]="".concat(100*i.height/i.width,"%")),this.emit(Do,!1),this.isMini=t.isMini=!1}},{key:"updatePos",value:function(e){this.pos=Object.assign(this.pos,e),this.isMini&&(this.player.root.style.left="".concat(this.pos.left,"px"),this.player.root.style.top="".concat(this.pos.top,"px"),this.player.root.style.width="".concat(this.pos.width,"px"),this.player.root.style.height="".concat(this.pos.height,"px"))}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=Ur.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",e,this.onCancelClick),this.unbind(".play-icon",e,this.onCenterClick),this._draggabilly&&this._draggabilly.destroy(),this._draggabilly=null,this.exitMini()}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-mini-layer class="xg-mini-layer">\n <xg-mini-header class="xgplayer-mini-header">\n '.concat(kO(this,"MINI_DRAG",this.playerConfig.isHideTips),'\n </xg-mini-header>\n <div class="mini-cancel-btn">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">\n <path fill="#fff" fill-rule="evenodd" d="M3.99 3.49a1 1 0 0 1 1.414 0L10 8.085l4.596-4.595a1 1 0 1 1 1.414 1.414L11.414 9.5l4.596 4.596a1 1 0 0 1 .084 1.32l-.084.094a1 1 0 0 1-1.414 0L10 10.914 5.404 15.51a1 1 0 0 1-1.414-1.414L8.585 9.5 3.99 4.904a1 1 0 0 1-.084-1.32z"></path>\n </svg>\n </div>\n <div class="play-icon">\n </div>\n </xg-mini-layer>')}}],[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}]),i}(),BO={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},FO=["videoClick","videoDbClick"],HO=function(e){_r(i,ua);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var i=Sr(e),n=i.player,r=i.playerConfig;n.isActive||(n.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&n.media.focus())})),mr(Sr(e),"onMouseEnter",(function(t){var i=Sr(e),n=i.playerConfig,r=i.player;!n.closeFocusVideoFocus&&r.media.focus(),n.closeDelayBlur?r.focus({autoHide:!1}):r.focus(),e.emit(Co)})),mr(Sr(e),"onMouseLeave",(function(t){var i=e.playerConfig,n=i.closePlayerBlur,r=i.leavePlayerTime,o=i.closeDelayBlur;n||o||(r?e.player.focus({autoHide:!0,delay:r}):e.player.blur({ignorePaused:!0})),e.emit(bo)})),mr(Sr(e),"onVideoClick",(function(t){var i=Sr(e),n=i.player,r=i.playerConfig;t.target&&r.closeVideoClick||t.target!==n.root&&t.target!==n.media&&t.target!==n.innerContainer&&t.target!==n.media.__canvas||(t.preventDefault(),r.closeVideoStopPropagation||t.stopPropagation(),e._clickCount++,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),e.clickTimer=setTimeout((function(){e._clickCount&&(e._clickCount--,la(Sr(e),FO[0],(function(t,i){e.switchPlayPause(i.e)}),{e:t,paused:n.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),mr(Sr(e),"onVideoDblClick",(function(t){var i=Sr(e),n=i.player,r=i.playerConfig;r.closeVideoDblclick||!t.target||t.target!==n.media&&t.target!==n.media.__canvas||(!r.closeVideoClick&&e._clickCount<2?e._clickCount=0:(e._clickCount=0,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),t.preventDefault(),t.stopPropagation(),la(Sr(e),FO[1],(function(t,i){e.emitUserAction(i.e,"switch_fullscreen",{props:"fullscreen",from:n.fullscreen,to:!n.fullscreen}),n.fullscreen?n.exitFullscreen():n.getFullscreen()}),{e:t,fullscreen:n.fullscreen})))})),e}return vr(i,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,FO.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===Kr.device&&!Kr.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,t=this.player,i=t.media,n=t.root,r=this.playerConfig.enableContextmenu;n&&n.addEventListener("click",this.onVideoClick,!1),n&&n.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(BO).map((function(t){n.addEventListener(t,e[BO[t]],!1)})),!r&&i&&i.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var t=this.player;this.emitUserAction(e,"switch_play_pause",{props:"paused",from:t.paused,to:!t.paused}),t.ended?t.duration!==1/0&&t.duration>0&&t.replay():t.paused?t.play():t.pause()}},{key:"onContextmenu",value:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e=this,t=this.player,i=t.video,n=t.root;this.clickTimer&&clearTimeout(this.clickTimer),n.removeEventListener("click",this.onVideoClick,!1),n.removeEventListener("dblclick",this.onVideoDblClick,!1),i.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(BO).map((function(t){n.removeEventListener(t,e[BO[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),i}(),jO="press",VO="pressend",KO="doubleclick",WO="click",GO="touchmove",YO="touchstart",zO="touchend",$O={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},XO={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function qO(e){return e&&e.length>0?e[e.length-1]:null}var ZO=function(){function e(t){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};gr(this,e),mr(this,"onTouchStart",(function(e){var t=i._pos,n=i.root,r=qO(e.touches);t.x=r?parseInt(r.pageX,10):e.pageX,t.y=r?parseInt(r.pageX,10):e.pageX,t.start=!0,i.__setPress(e),n.addEventListener(i.events.end,i.onTouchEnd),n.addEventListener(i.events.cancel,i.onTouchCancel),n.addEventListener(i.events.move,i.onTouchMove),i.trigger(YO,e)})),mr(this,"onTouchCancel",(function(e){i.onTouchEnd(e)})),mr(this,"onTouchEnd",(function(e){var t=i._pos,n=i.root;i.__clearPress(),n.removeEventListener(i.events.cancel,i.onTouchCancel),n.removeEventListener(i.events.end,i.onTouchEnd),n.removeEventListener(i.events.move,i.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&i.trigger(VO,e),i.trigger(zO,e),!t.press&&!t.moving&&i.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),mr(this,"onTouchMove",(function(e){var t=i._pos,n=i.config,r=qO(e.touches),o=r?parseInt(r.pageX,10):e.pageX,a=r?parseInt(r.pageY,10):e.pageX,s=o-t.x,l=a-t.y;Math.abs(l)<n.miniStep&&Math.abs(s)<n.miniStep||(i.__clearPress(),t.press&&i.trigger(VO,e),t.press=!1,t.moving=!0,i.trigger(GO,e))})),this._pos={moving:!1,start:!1,x:0,y:0},this.config={pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0},Object.keys(n).map((function(e){i.config[e]=n[e]})),this.root=t,this.events="mouse"===n.eventType?XO:$O,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return vr(e,[{key:"_initEvent",value:function(){this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(e){var t=this,i=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout((function(){t.trigger(jO,e),t._pos.press=!0,t.__clearPress()}),i.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(e){var t=this,i=this.config;if(this.dbIntrvalId)return this.__clearDb(),void this.trigger(KO,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(WO,e)}),i.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(e,t){this.__handlers[e]||(this.__handlers[e]=[]),this.__handlers[e].push(t)}},{key:"off",value:function(e,t){if(this.__handlers[e]){for(var i=this.__handlers[e],n=-1,r=0;r<i.length;r++)if(i[r]===t){n=r;break}n>=0&&this.__handlers[e].splice(n,1)}}},{key:"trigger",value:function(e,t){this.__handlers[e]&&this.__handlers[e].map((function(i){try{i(t)}catch(QB){console.error("trigger>>:".concat(e),QB)}}))}},{key:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).forEach((function(i){e.root.removeEventListener(i,e[t[i]])}))}}]),e}();function QO(){return(new DOMParser).parseFromString('<svg width="20" height="9" viewBox="0 0 8 9" fill="none" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <path opacity="0.54"\n d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z"\n fill="white" />\n <path transform="translate(5 0)" d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z" fill="white"/>\n</svg>',"image/svg+xml").firstChild}var JO="auto",eL="seeking",tL="playbackrate",iL=["videoClick","videoDbClick"],nL=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"onTouchStart",(function(e){var t=Sr(n),i=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=n.getTouche(e);if(s&&!r.disableGesture&&n.duration>0&&!i.ended){o.isStart=!0,n.timer&&clearTimeout(n.timer),Ur.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),n.find(".xg-dur").innerHTML=Ur.format(n.duration);var l=n.root.getBoundingClientRect();90===i.rotateDeg?(o.top=l.left,o.left=l.top,o.width=l.height,o.height=l.width):(o.top=l.top,o.left=l.left,o.width=l.width,o.height=l.height);var c=parseInt(s.pageX-o.left,10),u=parseInt(s.pageY-o.top,10);o.x=90===i.rotateDeg?u:c,o.y=90===i.rotateDeg?c:u,o.scopeL=r.scopeL*o.width,o.scopeR=(1-r.scopeR)*o.width,o.scopeM1=o.width*(1-r.scopeM)/2,o.scopeM2=o.width-o.scopeM1}})),mr(Sr(n),"onTouchMove",(function(e){var t=n.getTouche(e),i=Sr(n),r=i.pos,o=i.config,a=i.player;if(t&&!o.disableGesture&&n.duration&&r.isStart){var s=o.miniMoveStep,l=o.hideControlsActive,c=parseInt(t.pageX-r.left,10),u=parseInt(t.pageY-r.top,10),h=90===a.rotateDeg?u:c,d=90===a.rotateDeg?c:u;if(Math.abs(h-r.x)>s||Math.abs(d-r.y)>s){var f=h-r.x,p=d-r.y,g=r.scope;if(-1===g&&(0===(g=n.checkScope(h,d,f,p,r))&&(l?a.blur():a.focus({autoHide:!1}),!r.time&&(r.time=parseInt(1e3*a.currentTime,10)+1e3*n.timeOffset)),r.scope=g),-1===g||g>0&&!o.gestureY||0===g&&!o.gestureX)return;n.executeMove(f,p,g,r.width,r.height),r.x=h,r.y=d}}})),mr(Sr(n),"onTouchEnd",(function(e){var t=Sr(n),i=t.player,r=t.pos,o=t.playerConfig;if(setTimeout((function(){i.getPlugin("progress")&&i.getPlugin("progress").resetSeekState()}),10),r.isStart){r.scope>-1&&e.cancelable&&e.preventDefault();var a=n.config,s=a.disableGesture,l=a.gestureX;!s&&l?n.endLastMove(r.scope):r.time=0,r.scope=-1,n.resetPos(),Ur.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),n.changeAction(JO)}})),mr(Sr(n),"onRootTouchMove",(function(e){!n.config.disableGesture&&n.config.gestureX&&n.checkIsRootTarget(e)&&(e.stopPropagation(),n.pos.isStart?n.onTouchMove(e):n.onTouchStart(e))})),mr(Sr(n),"onRootTouchEnd",(function(e){n.pos.scope>-1&&n.onTouchEnd(e)})),n.pos={isStart:!1,x:0,y:0,time:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1},n.timer=null,n}return vr(i,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"registerIcons",value:function(){return{seekTipIcon:{icon:QO,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;iL.map((function(t){e.__hooks[t]=null}));var t=this.playerConfig,i=this.config,n=this.player;!0===t.closeVideoDblclick&&(i.closedbClick=!0),this.resetPos(),Ur.isUndefined(t.disableGesture)||(i.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=Ur.createDom("xg-mask","",{},"xgmask"),n.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new ZO(this.root,{eventType:r,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",(function(e){e.preventDefault()})),n.root.addEventListener("touchmove",this.onRootTouchMove,!0),n.root.addEventListener("touchend",this.onRootTouchEnd,!0),n.root.addEventListener("touchcancel",this.onRootTouchEnd,!0);var o=this.player.controls;o&&o.center&&(o.center.addEventListener("touchmove",this.onRootTouchMove,!0),o.center.addEventListener("touchend",this.onRootTouchEnd,!0),o.center.addEventListener("touchcancel",this.onRootTouchEnd,!0)),this.on(ro,(function(){var t=e.player,i=e.config;t.duration>0&&1e3*t.duration<i.moveDuration&&(i.moveDuration=1e3*t.duration)})),this.on([no,qr],(function(){var t=e.pos,i=t.time;!t.isStart&&i>0&&(e.pos.time=0)}));var a={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(a).map((function(t){e.touch.on(t,(function(i){e[a[t]](i)}))})),!i.disableActive){var s=n.plugins.progress;s&&(s.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),["dragend","click"].forEach((function(t){s.addCallBack(t,(function(){e.changeAction(JO)}))})))}}},{key:"registerThumbnail",value:function(){var e=this.player.plugins.thumbnail;if(e&&e.usable){this.thumbnail=e.createThumbnail(null,"mobile-thumbnail");var t=this.find(".time-preview");t.insertBefore(this.thumbnail,t.children[0])}}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle,t=e.playedColor,i=e.progressColor,n=e.timePreviewStyle,r=e.curTimeColor,o=e.durationColor;if(t&&(this.find(".xg-curbar").style.backgroundColor=t),i&&(this.find(".xg-bar").style.backgroundColor=i),n){var a=this.find(".time-preview");Object.keys(n).forEach((function(e){a.style[e]=n[e]}))}var s=r||t,l=o;s&&(this.find(".xg-cur").style.color=s),l&&(this.find(".xg-dur").style.color=l),this.config.disableTimeProgress&&Ur.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map((function(t){e.pos[t]=0}))):this.pos={isStart:!1,x:0,y:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1,time:0}}},{key:"changeAction",value:function(e){var t=this.player;this.root.setAttribute("data-xg-action",e);var i=t.plugins.start;i&&i.recover()}},{key:"getTouche",value:function(e){this.player.rotateDeg;var t=e.touches&&e.touches.length>0?e.touches[e.touches.length-1]:e;return{pageX:t.pageX,pageY:t.pageY}}},{key:"checkScope",value:function(e,t,i,n,r){var o=r.width,a=-1;if(e<0||e>o)return a;var s=0===n?Math.abs(i):Math.abs(i/n);return Math.abs(i)>0&&s>=1.73&&e>r.scopeM1&&e<r.scopeM2?a=0:(0===Math.abs(i)||s<=.57)&&(a=e<r.scopeL?1:e>r.scopeR?2:3),a}},{key:"executeMove",value:function(e,t,i,n,r){switch(i){case 0:this.updateTime(e/n*this.config.scopeM);break;case 1:this.updateBrightness(t/r);break;case 2:Kr.os.isIos||this.updateVolume(t/r)}}},{key:"endLastMove",value:function(e){var t=this,i=this.pos,n=this.player,r=this.config,o=(i.time-this.timeOffset)/1e3;if(0===e)n.seek(Number(o).toFixed(1)),r.hideControlsEnd?n.blur():n.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500);this.changeAction(JO)}},{key:"checkIsRootTarget",value:function(e){var t=this.player.plugins||{};return(!t.progress||!t.progress.root.contains(e.target))&&(t.start&&t.start.root.contains(e.target)||t.controls&&t.controls.root.contains(e.target))}},{key:"sendUseAction",value:function(e){var t=this.player.paused;this.emitUserAction(e,"switch_play_pause",{prop:"paused",from:t,to:!t})}},{key:"clickHandler",value:function(e){var t=this.player,i=this.config,n=this.playerConfig;t.state<Na.RUNNING?n.closeVideoClick||(this.sendUseAction(Ur.createEvent("click")),t.play()):!i.closedbClick||n.closeVideoClick?t.isActive?t.blur():t.focus():n.closeVideoClick||((t.isActive||i.focusVideoClick)&&(this.sendUseAction(Ur.createEvent("click")),this.switchPlayPause()),t.focus())}},{key:"dbClickHandler",value:function(e){var t=this.config,i=this.player;!t.closedbClick&&i.state>=Na.RUNNING&&(this.sendUseAction(Ur.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,i=this.player;la(this,iL[0],(function(e,i){t.clickHandler(i.e)}),{e:e,paused:i.paused})}},{key:"onDbClick",value:function(e){var t=this,i=this.player;la(this,iL[1],(function(e,i){t.dbClickHandler(i.e)}),{e:e,paused:i.paused})}},{key:"onPress",value:function(e){var t=this.pos,i=this.config,n=this.player;i.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{prop:"playbackRate",from:n.playbackRate,to:i.pressRate}),n.playbackRate=i.pressRate,this.changeAction(tL))}},{key:"onPressEnd",value:function(e){var t=this.pos,i=this.config,n=this.player;i.disablePress||(this.emitUserAction("pressend","change_rate",{prop:"playbackRate",from:n.playbackRate,to:t.rate}),n.playbackRate=t.rate,t.rate=1,this.changeAction(JO))}},{key:"updateTime",value:function(e){var t=this.player,i=this.config,n=this.player.duration;e=Number(e.toFixed(4));var r=parseInt(e*i.moveDuration,10)+this.timeOffset;r=(r+=this.pos.time)<0?0:r>1e3*n?1e3*n-200:r,t.getPlugin("time")&&t.getPlugin("time").updateTime(r/1e3),t.getPlugin("progress")&&t.getPlugin("progress").updatePercent(r/1e3/this.duration,!0),this.activeSeekNote(r/1e3,e>0),i.isTouchingSeek&&t.seek(Number((r-this.timeOffset)/1e3).toFixed(1)),this.pos.time=r}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.player,i=this.pos;if(e=parseInt(100*e,10),i.volume+=e,!(Math.abs(i.volume)<10)){var n=parseInt(10*t.volume,10)-parseInt(i.volume/10,10);n=n>10?10:n<1?0:n,t.volume=n/10,i.volume=0}}},{key:"updateBrightness",value:function(e){var t=this.pos,i=this.config,n=this.xgMask;if(i.darkness){this.player.rotateDeg&&(e=-e);var r=t.light+.8*e;r=r>i.maxDarkness?i.maxDarkness:r<0?0:r,n&&(n.style.backgroundColor="rgba(0,0,0,".concat(r,")")),t.light=r}}},{key:"activeSeekNote",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.player,n=this.config,r=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!r&&!n.disableActive){e<0?e=0:e>i.duration&&(e=i.duration-.2),this.changeAction(eL);var o=i.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=Ur.format(this.duration),this.find(".xg-cur").innerHTML=Ur.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?Ur.removeClass(this.find(".xg-seek-show"),"xg-back"):Ur.addClass(this.find(".xg-seek-show"),"xg-back"),this.updateThumbnails(e)}}},{key:"updateThumbnails",value:function(e){var t=this.player.plugins.thumbnail;t&&t.usable&&this.thumbnail&&t.update(this.thumbnail,e,160,90)}},{key:"switchPlayPause",value:function(){var e=this.player;if(e.state<Na.ATTACHED)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!0}},{key:"enableGesture",value:function(){this.config.disableGesture=!1}},{key:"destroy",value:function(){var e=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,e.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,e.root.removeEventListener("touchmove",this.onRootTouchMove,!0),e.root.removeEventListener("touchend",this.onRootTouchEnd,!0),e.root.removeEventListener("touchcancel",this.onRootTouchEnd,!0);var t=this.player.controls;t&&t.center&&(t.center.removeEventListener("touchmove",this.onRootTouchMove,!0),t.center.removeEventListener("touchend",this.onRootTouchEnd,!0),t.center.removeEventListener("touchcancel",this.onRootTouchEnd,!0))}},{key:"render",value:function(){var e="normal"!==this.config.gradient?"gradient ".concat(this.config.gradient):"gradient";return'\n <xg-trigger class="trigger">\n <div class="'.concat(e,'"></div>\n <div class="time-preview">\n <div class="xg-seek-show ').concat(this.config.disableSeekIcon?" hide-seek-icon":"",'">\n <i class="xg-seek-icon"></i>\n <span class="xg-cur">00:00</span>\n <span class="xg-separator">/</span>\n <span class="xg-dur">00:00</span>\n </div>\n <div class="xg-bar xg-timebar">\n <div class="xg-curbar"></div>\n </div>\n </div>\n <div class="xg-playbackrate xg-top-note">\n <span><i>').concat(this.config.pressRate,"X</i>").concat(this.i18n.FORWARD,"</span>\n </div>\n </xg-trigger>\n ")}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{index:0,disableGesture:!1,gestureX:!0,gestureY:!0,gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:36e4,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),i}();function rL(e){e.preventDefault(),e.returnValue=!1}function oL(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}var aL=function(e){_r(i,ua);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){if(e.player){var i=t||window.event,n=i.keyCode,r=Sr(e),o=r._keyState,a=r.player,s=e.config,l=s.disable,c=s.disableBodyTrigger,u=s.isIgnoreUserActive;l||c||!a.isUserActive&&!u||oL(i.target)||!e.checkIsVisible()||i.metaKey||i.altKey||i.ctrlKey?o.isBodyKeyDown=!1:(t.repeat||o.isKeyDown||((i.target===document.body||e.config.isGlobalTrigger&&!oL(i.target))&&e.checkCode(n,!0)&&(o.isBodyKeyDown=!0),document.addEventListener("keyup",e.onBodyKeyUp)),o.isBodyKeyDown&&e.handleKeyDown(i))}})),mr(Sr(e),"onBodyKeyUp",(function(t){e.player&&(document.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))})),mr(Sr(e),"onKeydown",(function(t){if(e.player){var i=t||window.event,n=Sr(e)._keyState;if(!i.repeat){if(e.config.disable||e.config.disableRootTrigger||i.metaKey||i.altKey||i.ctrlKey)return;!i||37!==i.keyCode&&!e.checkCode(i.keyCode)||i.target!==e.player.root&&i.target!==e.player.video&&i.target!==e.player.controls.el||(n.isKeyDown=!0),e.player.root.addEventListener("keyup",e.onKeyup)}n.isKeyDown&&e.handleKeyDown(i)}})),mr(Sr(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return vr(i,[{key:"mergekeyCodeMap",value:function(){var e=this,t=this.config.keyCodeMap;t&&Object.keys(t).map((function(i){e.keyCodeMap[i]?["keyCode","action","disable","pressAction","disablePress","isBodyTarget"].map((function(n){t[i][n]&&(e.keyCodeMap[i][n]=t[i][n])})):e.keyCodeMap[i]=t[i]}))}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e="function"==typeof this.config.seekStep?this.config.seekStep(this.player):this.config.seekStep;e&&"number"==typeof e&&(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:"playPause",disable:!1,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.config[i]=e[i]}))}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),t=e.height,i=e.top,n=e.bottom,r=window.innerHeight;return!(i<0&&i<0-.9*t||n>0&&n-r>.9*t)}},{key:"checkCode",value:function(e,t){var i=this,n=!1;return Object.keys(this.keyCodeMap).map((function(r){i.keyCodeMap[r]&&e===i.keyCodeMap[r].keyCode&&!i.keyCodeMap[r].disable&&(n=!t||t&&!i.keyCodeMap[r].noBodyTarget)})),n}},{key:"downVolume",value:function(e){var t=this.player;if(!(t.volume<=0)){var i=parseFloat((t.volume-.1).toFixed(1)),n={volume:{from:t.volume,to:i}};this.emitUserAction(e,"change_volume",{props:n}),t.volume=i>=0?i:0}}},{key:"upVolume",value:function(e){var t=this.player;if(!(t.volume>=1)){var i=parseFloat((t.volume+.1).toFixed(1)),n={volume:{from:t.volume,to:i}};this.emitUserAction(e,"change_volume",{props:n}),t.volume=i<=1?i:1}}},{key:"seek",value:function(e){var t=this.player,i=t.currentTime,n=t.offsetCurrentTime,r=t.duration,o=t.offsetDuration,a=t.timeSegments,s=n>-1?n:i,l=o||r,c=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep;s+c<=l?s+=c:s=l;var u=Ur.getCurrentTimeByOffset(s,a),h={currentTime:{from:i,to:u}};this.emitUserAction(e,"seek",{props:h}),this.player.currentTime=u}},{key:"seekBack",value:function(e){var t=this.player,i=t.currentTime,n=t.offsetCurrentTime,r=t.timeSegments,o=(n>-1?n:i)-(e.repeat?parseInt(this.seekStep/2,10):this.seekStep);o<0&&(o=0);var a={currentTime:{from:i,to:o=Ur.getCurrentTimeByOffset(o,r)}};this.emitUserAction(e,"seek",{props:a}),this.player.currentTime=o}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,i=this.config,n=this.player;0===t.playbackRate&&(t.playbackRate=n.playbackRate,n.playbackRate=i.playbackRate)}},{key:"playPause",value:function(e){var t=this.player;t&&(this.emitUserAction(e,"switch_play_pause"),t.paused?t.play():t.pause())}},{key:"exitFullscreen",value:function(e){var t=this.player,i=t.fullscreen,n=t.cssfullscreen;i&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:i,to:!i}),t.exitFullscreen()),n&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:n,to:!n}),t.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var t=this._keyState;if(e.repeat){t.isPress=!0;var i=Date.now();if(i-t.tt<200)return;t.tt=i}this.handleKeyCode(e.keyCode,e,t.isPress)}},{key:"handleKeyUp",value:function(e){var t=this._keyState;t.playbackRate>0&&(this.player.playbackRate=t.playbackRate,t.playbackRate=0),t.isKeyDown=!1,t.isPress=!1,t.tt=0}},{key:"handleKeyCode",value:function(e,t,i){for(var n=Object.keys(this.keyCodeMap),r=0;r<n.length;r++){var o=this.keyCodeMap[n[r]],a=o.action,s=o.keyCode,l=o.disable,c=o.pressAction,u=o.disablePress;if(s===e){if(!(l||i&&u)){var h=i&&c||a;"function"==typeof h?a(t,this.player,i):"string"==typeof h&&"function"==typeof this[h]&&this[h](t,this.player,i),this.emit(Mo,fr({key:n[r],target:t.target,isPress:i},this.keyCodeMap[n[r]]))}rL(t),t.stopPropagation();break}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!0,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!0}}}]),i}();function sL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="-5 -5 110 110">\n <path d="M100,50A50,50,0,1,1,50,0" stroke-width="5" stroke="#ddd" stroke-dasharray="236" fill="none"></path>\n</svg>\n',"image/svg+xml").firstChild}var lL=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"registerIcons",value:function(){return{loadingIcon:sL}}},{key:"afterCreate",value:function(){this.appendChild("xg-loading-inner",this.icons.loadingIcon)}},{key:"render",value:function(){return'\n <xg-loading class="xgplayer-loading">\n <xg-loading-inner></xg-loading-inner>\n </xg-loading>'}}],[{key:"pluginName",get:function(){return"loading"}},{key:"defaultConfig",get:function(){return{position:ma.ROOT}}}]),i}(),cL=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],uL=function(){function e(t){gr(this,e),this.fragments=t.fragments||[],0===this.fragments.length&&this.fragments.push({percent:1}),this._callBack=t.actionCallback,this.fragConfig={fragFocusClass:t.fragFocusClass||"inner-focus-point",fragAutoFocus:!!t.fragAutoFocus,fragClass:t.fragClass||""},this.style=t.style||{playedColor:"",cachedColor:"",progressColor:""},this.duration=0,this.cachedIndex=0,this.playedIndex=0,this.focusIndex=-1}return vr(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var i=0,n=this.fragments;this.fragments=n.map((function(e){return e.start=parseInt(i,10),e.end=parseInt(i+e.percent*t.duration,10),e.duration=parseInt(e.percent*t.duration,10),i+=e.percent*t.duration,e}))}},{key:"updateProgress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},i=this.progressList,n=this.fragments;if(!(i.length<1)){var r=t.newIndex,o=t.curIndex,a=t.millisecond;r!==o&&i.map((function(t,i){i<r?t[e].style.width="100%":i>r&&(t[e].style.width=0)}));var s=n[r],l=0===a?0:(a-s.start)/s.duration;i[r][e].style.width=l<0?0:"".concat(100*l,"%")}}},{key:"updateFocus",value:function(e){if(this.fragConfig.fragAutoFocus&&!(this.fragments.length<2))if(e){var t=this.findIndex(1e3*e.currentTime,this.focusIndex);if(t>=0&&t!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(t);var i={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(i)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var n={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(n),this.focusIndex=-1}}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(parseInt(1e3*t,10))}var i=this.playedIndex,n=this.cachedIndex;if("Undefined"!==Ur.typeOf(e.played)){var r=this.findIndex(1e3*e.played,i);if(r<0)return;this.updateProgress("played",{newIndex:r,curIndex:i,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=r}if("Undefined"!==Ur.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,n);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:n,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(e,t){var i=this.fragments;if(!i||0===i.length)return-1;if(1===i.length)return 0;if(t>-1&&t<i.length&&e>i[t].start&&e<i[t].end)return t;if(e>i[i.length-1].start)return i.length-1;for(var n=0;n<i.length;n++)if(e>i[n].start&&e<=i[n].end){t=n;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(Ur.hasClass(e[t],this.fragConfig.fragFocusClass))return{dom:e[t],pos:e[t].getBoundingClientRect()}}},{key:"findFragment",value:function(e){var t=this.root.children;return e<0||e>=t.length?null:{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"unHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)Ur.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return Ur.addClass(t[e],this.fragConfig.fragFocusClass),{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"reset",value:function(e){var t=this;if(Object.keys(this.fragConfig).forEach((function(i){void 0!==e[i]&&(t.fragConfig[i]=e[i])})),e.fragments){if(this.fragments=0===e.fragments.length?[{percent:1}]:e.fragments,this.updateDuration(this.duration),this.playedIndex=0,this.cachedIndex=0,this.root)for(var i=this.root.children;i.length>0;)this.root.removeChild(i[0]);this.render()}}},{key:"render",value:function(){var e=this,t=this.style.progressColor;if(this.root||(this.root=Ur.createDom("xg-inners","",{},"progress-list")),this.fragments){var i=this.fragConfig,n=i.fragClass,r=i.fragFocusClass;this.progressList=this.fragments.map((function(i){var o=Ur.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(i.percent):"flex: ".concat(i.percent)},"".concat(i.isFocus?r:""," xgplayer-progress-inner ").concat(n));return e.root.appendChild(o),cL.forEach((function(t){o.appendChild(Ur.createDom(t.tag,"",{style:t.styleKey?"background: ".concat(e.style[t.styleKey],"; width:0;"):"width:0;"},t.className))})),{cached:o.children[0],played:o.children[1]}}))}return this.root}}]),e}(),hL={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},dL=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"onMoveOnly",(function(e,t){var i=Sr(n),r=i.pos,o=i.config,a=i.player,s=t;if(e){Ur.event(e);var l=Ur.getEventPos(e,a.zoom),c=90===a.rotateDeg?l.clientY:l.clientX;if(r.moving&&Math.abs(r.x-c)<o.miniMoveStep)return;r.moving=!0,r.x=c,s=n.computeTime(e,c)}n.triggerCallbacks("dragmove",s,e),n._updateInnerFocus(s)})),mr(Sr(n),"onBodyClick",(function(e){n.pos.isLocked&&(n.pos.isLocked=!1,e.preventDefault(),e.stopPropagation())})),mr(Sr(n),"_mouseDownHandler",(function(e,t){n._state.time=t.currentTime,n.updateWidth(t.currentTime,t.seekTime,t.percent,0),n._updateInnerFocus(t)})),mr(Sr(n),"_mouseUpHandler",(function(e,t){Sr(n).pos.moving&&n.updateWidth(t.currentTime,t.seekTime,t.percent,2)})),mr(Sr(n),"_mouseMoveHandler",(function(e,t){var i=Sr(n),r=i._state,o=i.pos,a=i.config,s=i.player;r.time<t.currentTime?t.forward=!0:t.forward=!1,r.time=t.currentTime,o.isDown&&!o.moving&&(o.moving=!0,a.isPauseMoving&&s.pause(),n.triggerCallbacks("dragstart",t,e),n.emitUserAction("drag","dragstart",t)),n.updateWidth(t.currentTime,t.seekTime,t.percent,1),n.triggerCallbacks("dragmove",t,e),n._updateInnerFocus(t)})),mr(Sr(n),"onMouseDown",(function(e){var t=Sr(n),i=t._state,r=t.player,o=t.pos,a=t.config,s=t.playerConfig,l=Ur.getEventPos(e,r.zoom),c=90===r.rotateDeg?l.clientY:l.clientX;if(!(r.isMini||a.closeMoveSeek||!s.allowSeekAfterEnded&&r.ended)){if(r.duration||r.isPlaying){e.stopPropagation(),n.focus(),Ur.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),Ur.checkIsFunction(a.onMoveStart)&&a.onMoveStart(),Ur.event(e),o.x=c,o.isDown=!0,o.moving=!1,i.prePlayTime=r.currentTime,r.focus({autoHide:!1}),n.isProgressMoving=!0,Ur.addClass(n.progressBtn,"active");var u=n.computeTime(e,c);return u.prePlayTime=i.prePlayTime,n._mouseDownHandlerHook(e,u),"touchstart"===e.type?(n.root.addEventListener("touchmove",n.onMouseMove),n.root.addEventListener("touchend",n.onMouseUp),n.root.addEventListener("touchcancel",n.onMouseUp)):(n.unbind("mousemove",n.onMoveOnly),document.addEventListener("mousemove",n.onMouseMove,!1),document.addEventListener("mouseup",n.onMouseUp,!1)),!0}r.play()}})),mr(Sr(n),"onMouseUp",(function(e){var t=Sr(n),i=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=t._state;if(o){e.stopPropagation(),e.preventDefault(),Ur.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),Ur.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),Ur.event(e),Ur.removeClass(n.progressBtn,"active");var l=n.computeTime(e,o.x);l.prePlayTime=s.prePlayTime,o.moving?(n.triggerCallbacks("dragend",l,e),n.emitUserAction("drag","dragend",l)):(n.triggerCallbacks("click",l,e),n.emitUserAction("click","click",l)),n._mouseUpHandlerHook(e,l),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,o.isLocked=!0,s.prePlayTime=0,s.time=0;var c=e.type;"touchend"===c||"touchcancel"===c?(n.root.removeEventListener("touchmove",n.onMouseMove),n.root.removeEventListener("touchend",n.onMouseUp),n.root.removeEventListener("touchcancel",n.onMouseUp),n.blur()):(document.removeEventListener("mousemove",n.onMouseMove,!1),document.removeEventListener("mouseup",n.onMouseUp,!1),o.isEnter?"mobile"!==a.isMobileSimulateMode&&n.bind("mousemove",n.onMoveOnly):n.onMouseLeave(e)),Ur.setTimeout(Sr(n),(function(){n.resetSeekState()}),1),i.focus()}})),mr(Sr(n),"onMouseMove",(function(e){var t=Sr(n),i=t._state,r=t.pos,o=t.player,a=t.config;Ur.checkTouchSupport()&&e.preventDefault(),Ur.event(e);var s=Ur.getEventPos(e,o.zoom),l=90===o.rotateDeg?s.clientY:s.clientX,c=Math.abs(r.x-l);if(!(r.moving&&c<a.miniMoveStep||!r.moving&&c<a.miniStartStep)){r.x=l;var u=n.computeTime(e,l);u.prePlayTime=i.prePlayTime,n._mouseMoveHandlerHook(e,u)}})),mr(Sr(n),"onMouseOut",(function(e){n.triggerCallbacks("mouseout",null,e)})),mr(Sr(n),"onMouseOver",(function(e){n.triggerCallbacks("mouseover",null,e)})),mr(Sr(n),"onMouseEnter",(function(e){var t=Sr(n),i=t.player,r=t.pos;if(!(r.isDown||r.isEnter||i.isMini||!i.config.allowSeekAfterEnded&&i.ended)){r.isEnter=!0,n.bind("mousemove",n.onMoveOnly),n.bind("mouseleave",n.onMouseLeave),Ur.event(e);var o=Ur.getEventPos(e,i.zoom),a=90===i.rotateDeg?o.clientY:o.clientX,s=n.computeTime(e,a);n.triggerCallbacks("mouseenter",s,e),n.focus()}})),mr(Sr(n),"onMouseLeave",(function(e){n.triggerCallbacks("mouseleave",null,e),n.unlock(),n._updateInnerFocus(null)})),mr(Sr(n),"onVideoResize",(function(){var e=n.pos,t=e.x,i=e.isDown;if(e.isEnter&&!i){var r=n.computeTime(null,t);n.onMoveOnly(null,r)}})),n.useable=!1,n.isProgressMoving=!1,n.__dragCallBacks=[],n._state={now:-1,direc:0,time:0,prePlayTime:-1},n._disableBlur=!1,"boolean"==typeof n.config.isDragingSeek&&(console.warn("[XGPLAYER] 'isDragingSeek' is deprecated, please use 'isDraggingSeek' instead"),n.config.isDraggingSeek=n.config.isDragingSeek),n}return vr(i,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i+this.timeOffset}},{key:"changeState",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.useable=e}},{key:"show",value:function(e){this.root&&(this.root.style.display="flex")}},{key:"_initInner",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var n=fr(fr({fragments:t},i),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(n):(this.innerList=new uL(n),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map((function(t){e[t]=e.innerList[t].bind(e.innerList)})))}},{key:"_updateInnerFocus",value:function(e){this.innerList&&this.innerList.updateFocus(e)}},{key:"afterCreate",value:function(){if(!this.config.disable&&!this.playerConfig.isLive){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1,isLocked:!1},this.outer=this.find("xg-outer");var e=this.config,t=e.fragFocusClass,i=e.fragAutoFocus,n=e.fragClass;this._initInner(this.config.fragments,{fragFocusClass:t,fragAutoFocus:i,fragClass:n,style:this.playerConfig.commonStyle||{}}),"mobile"===Kr.device&&(this.config.isDraggingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.listenEvents(),this.bindDomEvents(),this.initCustomStyle()}}},{key:"listenEvents",value:function(){var e=this;this.on(ro,(function(){e.onMouseLeave()})),this.on(to,(function(){e.onTimeupdate()})),this.on(eo,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(lo,(function(){e.onCacheUpdate()})),this.on(qr,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(uo,(function(){e.onReset()})),this.on(Ro,(function(){e.onVideoResize()}))}},{key:"setConfig",value:function(e){var t=this,i=null;Object.keys(e).forEach((function(n){t.config[n]=e[n],"fragments"===n&&(i=e[n])})),i&&this._initInner(i,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===pr(e)&&Object.keys(e).map((function(i){t.style[i]=e[i]})))}},{key:"triggerCallbacks",value:function(e,t,i){this.__dragCallBacks.length>0&&this.__dragCallBacks.map((function(n){if(n&&n.handler&&n.type===e)try{n.handler(t,i)}catch(QB){console.error("[XGPLAYER][triggerCallbacks] ".concat(n," error"),QB)}}))}},{key:"addCallBack",value:function(e,t){t&&"function"==typeof t&&this.__dragCallBacks.push({type:e,handler:t})}},{key:"removeCallBack",value:function(e,t){var i=this.__dragCallBacks,n=-1;i.map((function(i,r){i&&i.type===e&&i.handler===t&&(n=r)})),n>-1&&i.splice(n,1)}},{key:"unlock",value:function(){var e=this.player,t=this.pos;t.isEnter=!1,t.isLocked=!1,e.isMini||(this.unbind("mousemove",this.onMoveOnly),t.isDown?this.unbind("mouseleave",this.onMouseLeave):this.blur())}},{key:"bindDomEvents",value:function(){var e=this.player.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),"touch"!==this.domEventType&&"compatible"!==this.domEventType||this.root.addEventListener("touchstart",this.onMouseDown),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==e.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut),this.player.root.addEventListener("click",this.onBodyClick,!0))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),Ur.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),Ur.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,i,n){var r=this.config,o=this.player;if(!r.isCloseClickSeek||0!==n){var a=t=t>=o.duration?o.duration-r.endedDiff:Number(t).toFixed(1);this.updatePercent(i),this.updateTime(e),(1!==n||r.isDraggingSeek&&"audio"!==o.config.mediaType)&&(this._state.now=a,this._state.direc=a>o.currentTime?0:1,o.seek(a))}}},{key:"computeTime",value:function(e,t){var i,n,r=this.player,o=this.root.getBoundingClientRect(),a=o.width,s=o.height,l=o.top,c=o.left,u=t;90===r.rotateDeg?(i=s,n=l):(i=a,n=c);var h=u-n,d=(h=h>i?i:h<0?0:h)/i;d=d<0?0:d>1?1:d,Number.isNaN(d)&&(d=this.player.currentTime/this.offsetDuration);var f=parseInt(d*this.offsetDuration*1e3,10)/1e3;return{percent:d,currentTime:f,seekTime:Ur.getCurrentTimeByOffset(f,r.timeSegments),offset:h,width:i,left:n,e:e}}},{key:"updateTime",value:function(e){var t=this.player,i=this.duration;e>i?e=i:e<0&&(e=0);var n=t.plugins.time;n&&n.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,t){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(100*e,"%"),this.innerList.update({played:e*this.offsetDuration},this.offsetDuration);var i=this.player.plugins.miniprogress;i&&i.update({played:e*this.offsetDuration},this.offsetDuration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,i=this._state,n=this.offsetDuration;if(!(t.isSeeking&&t.media.seeking||this.isProgressMoving)&&t.hasStart){if(i.now>-1){var r=parseInt(1e3*i.now,10)-parseInt(1e3*t.currentTime,10);if(0===i.direc&&r>300||1===i.direc&&r>-300)return void(i.now=-1);i.now=-1}var o=this.currentTime;o=Ur.adjustTimeByDuration(o,n,e),this.innerList.update({played:o},n),this.progressBtn.style.left="".concat(o/n*100,"%")}}},{key:"onCacheUpdate",value:function(e){var t=this.player,i=this.duration;if(t){var n=t.bufferedPoint.end;n=Ur.adjustTimeByDuration(n,i,e),this.innerList.update({cached:n},i)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0),this.progressBtn.style.left="0%"}},{key:"destroy",value:function(){var e=this.player;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var t=this.domEventType;"touch"!==t&&"compatible"!==t||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),this.root.removeEventListener("touchcancel",this.onMouseUp)),"mouse"!==t&&"compatible"!==t||(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),this.unbind("mouseleave",this.onMouseLeave),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),e.root.removeEventListener("click",this.onBodyClick,!0))}},{key:"render",value:function(){if(!this.config.disable&&!this.playerConfig.isLive){var e=this.player.controls?this.player.controls.config.mode:"";return'\n <xg-progress class="xgplayer-progress '.concat("bottom"===e?"xgplayer-progress-bottom":"",'">\n <xg-outer class="xgplayer-progress-outer">\n <xg-progress-btn class="xgplayer-progress-btn"></xg-progress-btn>\n </xg-outer>\n </xg-progress>\n ')}}}],[{key:"pluginName",get:function(){return"progress"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_CENTER,index:0,disable:!1,isDraggingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:hL.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return hL}}]),i}(),fL=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),mr(Sr(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return vr(i,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave),this.config.disable&&this.disable()}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),i}(),pL=function(e){_r(i,fL);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"btnClick",(function(t){t.preventDefault(),t.stopPropagation();var i=Sr(e).player;return e.emitUserAction(t,"switch_play_pause",{prop:"paused",from:i.paused,to:!i.paused}),i.ended?i.replay():i.paused?(i.play(),e.animate(!1)):(i.pause(),e.animate(!0)),!1})),e}return vr(i,[{key:"afterCreate",value:function(){kr(Er(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.initIcons(),this.bind(["touchend","click"],this.btnClick),this.listenEvents(),this.animate(!0))}},{key:"listenEvents",value:function(){var e=this,t=this.player;this.on([$r,Zr,Qr,uo],(function(){e.animate(t.paused)}))}},{key:"registerIcons",value:function(){return{play:{icon:_O,class:"xg-icon-play"},pause:{icon:EO,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.play),this.appendChild(".xgplayer-icon",e.pause)}},{key:"animate",value:function(e){if(this.player){var t=this.i18nKeys,i=this.find(".xg-tips");e?(this.setAttr("data-state","pause"),i&&this.changeLangTextKey(i,t.PLAY_TIPS)):(this.setAttr("data-state","play"),i&&this.changeLangTextKey(i,t.PAUSE_TIPS))}}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n '.concat(kO(this,"PLAY_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_LEFT,index:0,disable:!1}}}]),i}();function gL(){return(new DOMParser).parseFromString('<svg width="32px" height="40px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M11.2374369,14 L17.6187184,7.61871843 C17.9604272,7.27700968 17.9604272,6.72299032 17.6187184,6.38128157 C17.2770097,6.03957281 16.7229903,6.03957281 16.3812816,6.38128157 L9.38128157,13.3812816 C9.03957281,13.7229903 9.03957281,14.2770097 9.38128157,14.6187184 L16.3812816,21.6187184 C16.7229903,21.9604272 17.2770097,21.9604272 17.6187184,21.6187184 C17.9604272,21.2770097 17.9604272,20.7229903 17.6187184,20.3812816 L11.2374369,14 L11.2374369,14 Z" fill="#FFFFFF"></path>\n </g>\n</svg>',"image/svg+xml").firstChild}var yL=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.onClick=function(t){t.preventDefault(),t.stopPropagation(),e.config.onClick(t)},this.bind(["click","touchend"],this.onClick)}},{key:"registerIcons",value:function(){return{screenBack:{icon:gL,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){Ur.addClass(this.root,"show")}},{key:"hide",value:function(){Ur.removeClass(this.root,"show")}},{key:"render",value:function(){return'<xg-icon class="xgplayer-back">\n </xg-icon>'}}],[{key:"pluginName",get:function(){return"topbackicon"}},{key:"defaultConfig",get:function(){return{position:ma.ROOT_TOP,index:0}}}]),i}();function vL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598 214h212v212h-84v-128h-128v-84zM726 726v-128h84v212h-212v-84h128zM214 426v-212h212v84h-128v128h-84zM298 598v128h128v84h-212v-212h84z"></path>\n</svg>\n',"image/svg+xml").firstChild}function mL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M682 342h128v84h-212v-212h84v128zM598 810v-212h212v84h-128v128h-84zM342 342v-128h84v212h-212v-84h128zM214 682v-84h212v212h-84v-128h-128z"></path>\n</svg>\n',"image/svg+xml").firstChild}var _L=function(e){_r(i,fL);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"_onOrientationChange",(function(t){e.player.fullscreen&&e.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?e.player.setRotateDeg(0):e.player.setRotateDeg(90))})),e}return vr(i,[{key:"afterCreate",value:function(){var e=this;kr(Er(i.prototype),"afterCreate",this).call(this);var t=this.config,n=this.playerConfig;if(!t.disable){t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var r=Ur.getFullScreenEl();n.fullscreenTarget===r&&this.player.getFullscreen().catch((function(e){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreenChange",this.toggleFullScreen,{pre:function(t){var i=e.player.fullscreen;e.emitUserAction(t,"switch_fullscreen",{prop:"fullscreen",from:i,to:!i})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(Io,(function(t){var i=e.find(".xg-tips");i&&e.changeLangTextKey(i,t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t)})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:yL,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===Kr.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:vL,class:"xg-get-fullscreen"},exitFullscreen:{icon:mL,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===Kr.device?"touchend":"click",this.handleFullscreen),"mobile"===Kr.device&&window.removeEventListener("orientationchange",this._onOrientationChange)}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.fullscreen),this.appendChild(".xgplayer-icon",e.exitFullscreen)}},{key:"toggleFullScreen",value:function(e){e instanceof Event&&(e.preventDefault(),e.stopPropagation());var t=this.player,i=this.config;!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.useCssFullscreen()?(t.fullscreen?t.exitCssFullscreen():t.getCssFullscreen(),this.animate(t.fullscreen)):i.rotateFullscreen?(t.fullscreen?t.exitRotateFullscreen():t.getRotateFullscreen(),this.animate(t.fullscreen)):i.switchCallback&&"function"==typeof i.switchCallback?i.switchCallback(t.fullscreen):t.fullscreen?(t.exitFullscreen(),i.useScreenOrientation&&this.unlockScreen()):(t.getFullscreen().catch((function(e){})),i.useScreenOrientation&&t.aspectRatio>1&&this.lockScreen(i.lockOrientationType))}},{key:"animate",value:function(e){e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(e?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"render",value:function(){if(!this.config.disable){return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n '.concat(kO(this,"FULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}},{key:"lockScreen",value:function(e){try{screen.orientation.lock(e).catch((function(e){}))}catch(hs){}}},{key:"unlockScreen",value:function(){try{screen.orientation.unlock().catch((function(e){}))}catch(hs){}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,useScreenOrientation:!1,lockOrientationType:"landscape",switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),i}(),EL=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),(n=t.call(this,e)).isActiving=!1,n}return vr(i,[{key:"duration",get:function(){var e=this.player,t=e.offsetDuration,i=e.duration;return this.playerConfig.customDuration||t||i}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"afterCreate",value:function(){var e=this.player.controls.config.mode;this.mode="flex"===e?"flex":"normal",this.config.disable||("flex"===this.mode&&(this.createCenterTime(),this.root.style.display="none"),this.durationDom=this.find(".time-duration"),this.timeDom=this.find(".time-current"),this.listenEvents())}},{key:"listenEvents",value:function(){var e=this;this.on([ro,eo,to],(function(t){"durationchange"===t.eventName&&(e.isActiving=!1),e.onTimeUpdate()})),this.on(qr,(function(){e.onTimeUpdate(!0)})),this.on(uo,(function(){e.onReset()}))}},{key:"show",value:function(e){if("flex"===this.mode)return this.centerCurDom&&(this.centerCurDom.style.display="block"),void(this.centerDurDom&&(this.centerDurDom.style.display="block"));this.root.style.display="block"}},{key:"hide",value:function(){if("flex"===this.mode)return this.centerCurDom&&(this.centerCurDom.style.display="none"),void(this.centerDurDom&&(this.centerDurDom.style.display="none"));this.root.style.display="none"}},{key:"onTimeUpdate",value:function(e){var t=this.player,i=this.config,n=this.duration;if(!i.disable&&!this.isActiving&&t.hasStart){var r=this.currentTime+this.timeOffset;r=Ur.adjustTimeByDuration(r,n,e),"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(Ur.format(r)),n!==1/0&&n>0&&(this.centerDurDom.innerHTML=Ur.format(n))):(this.timeDom.innerHTML=this.minWidthTime(Ur.format(r)),n!==1/0&&n>0&&(this.durationDom.innerHTML=Ur.format(n)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(Ur.format(0)),this.centerDurDom.innerHTML=Ur.format(0)):(this.timeDom.innerHTML=this.minWidthTime(Ur.format(0)),this.durationDom.innerHTML=Ur.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=Ur.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-left"),this.centerDurDom=Ur.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-right"),t.children.length>0?t.insertBefore(this.centerCurDom,t.children[0]):t.appendChild(this.centerCurDom),t.appendChild(this.centerDurDom),this.extraEls=[this.centerCurDom,this.centerDurDom]}}},{key:"afterPlayerInit",value:function(){var e=this.config;this.duration===1/0||this.playerConfig.isLive?(Ur.hide(this.durationDom),Ur.hide(this.timeDom),Ur.hide(this.find(".time-separator")),Ur.show(this.find(".time-live-tag"))):Ur.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(Ur.hide(this.durationDom),Ur.hide(this.timeDom),Ur.hide(this.find(".time-separator")),Ur.show(this.find(".time-live-tag"))):(Ur.hide(this.find(".time-live-tag")),Ur.show(this.find(".time-separator")),Ur.show(this.durationDom),Ur.show(this.timeDom))}},{key:"updateTime",value:function(e){this.isActiving=!0,!e&&0!==e||e>this.duration||("flex"!==this.mode?this.timeDom.innerHTML=this.minWidthTime(Ur.format(e)):this.centerCurDom.innerHTML=this.minWidthTime(Ur.format(e)))}},{key:"minWidthTime",value:function(e){return e.split(":").map((function(e){return'<span class="time-min-width">'.concat(e,"</span>")})).join(":")}},{key:"resetActive",value:function(){var e=this,t=this.player,i=function(){e.isActiving=!1};this.off(eo,i),t.isSeeking&&t.media.seeking?this.once(eo,i):this.isActiving=!1}},{key:"destroy",value:function(){var e=this.player.controls.center;this.centerCurDom&&e.removeChild(this.centerCurDom),this.centerCurDom=null,this.centerDurDom&&e.removeChild(this.centerDurDom),this.centerDurDom=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-time">\n <span class="time-current">00:00</span>\n <span class="time-separator">/</span>\n <span class="time-duration">00:00</span>\n <span class="time-live-tag">'.concat(this.i18n.LIVE_TIP,"</span>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"time"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_LEFT,index:2,disable:!1}}}]),i}(),TL=function(e){_r(i,ua);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"_onDurationChange",(function(){e.updateSegments();var t=e.player,i=t.currentTime,n=t.timeSegments;if(e._checkIfEnabled(n)){var r=Ur.getIndexByTime(i,n),o=Ur.getOffsetCurrentTime(i,n,r);e.player.offsetCurrentTime=o,e.changeIndex(r,n)}})),mr(Sr(e),"_onLoadedData",(function(){var t=e.player.timeSegments;if(e._checkIfEnabled(t)){var i=Ur.getOffsetCurrentTime(0,t);e.player.offsetCurrentTime=i,e.changeIndex(0,t),e.curPos.start>0&&(e.player.currentTime=e.curPos.start)}})),mr(Sr(e),"_onTimeupdate",(function(){var t=e.player,i=t.currentTime,n=t.timeSegments;if(e._checkIfEnabled(n)){var r=n.length;e.lastCurrentTime=i;var o=Ur.getIndexByTime(i,n);o!==e.curIndex&&e.changeIndex(o,n);var a=Ur.getOffsetCurrentTime(i,n,o);if(e.player.offsetCurrentTime=a,e.curPos){var s=e.curPos,l=s.start,c=s.end;i<l?e.player.currentTime=l:i>c&&o>=r-1&&e.player.pause()}}})),mr(Sr(e),"_onSeeking",(function(){var t=e.player,i=t.currentTime,n=t.timeSegments;if(e._checkIfEnabled(n))if(i<n[0].start)e.player.currentTime=n[0].start;else if(i>n[n.length-1].end)e.player.currentTime=n[n.length-1].end;else{var r=Ur.getIndexByTime(i,n);if(r>=0){var o=e.getSeekTime(i,e.lastCurrentTime,r,n);o>=0&&(e.player.currentTime=o)}}})),mr(Sr(e),"_onPlay",(function(){var t=e.player,i=t.currentTime,n=t.timeSegments;e._checkIfEnabled(n)&&i>=n[n.length-1].end&&(e.player.currentTime=n[0].start)})),e}return vr(i,[{key:"afterCreate",value:function(){this.curIndex=-1,this.curPos=null,this.lastCurrentTime=0,this.updateSegments(),this.on(ro,this._onDurationChange),this.on(ao,this._onLoadedData),this.on(to,this._onTimeupdate),this.on(Jr,this._onSeeking),this.on($r,this._onPlay)}},{key:"setConfig",value:function(e){var t=this;if(e){var i=Object.keys(e);i.length<1||(i.forEach((function(i){t.config[i]=e[i]})),this.updateSegments())}}},{key:"updateSegments",value:function(){var e=this.config,t=e.disable,i=e.segments,n=this.player;if(t||!i||0===i.length)n.timeSegments=[],n.offsetDuration=0,n.offsetCurrentTime=-1;else{var r=this.formatTimeSegments(i,n.duration);n.timeSegments=r,n.offsetDuration=r.length>0?r[r.length-1].duration:0}}},{key:"formatTimeSegments",value:function(e,t){var i=[];return e?(e.sort((function(e,t){return e.start-t.start})),e.forEach((function(e,n){var r={};if(r.start=e.start<0?0:e.start,r.end=t>0&&e.end>t?t:e.end,!(t>0&&r.start>t)){i.push(r);var o=r.end-r.start;if(0===n)r.offset=e.start,r.cTime=0,r.segDuration=o,r.duration=o;else{var a=i[n-1];r.offset=a.offset+(r.start-a.end),r.cTime=a.duration+a.cTime,r.segDuration=o,r.duration=a.duration+o}}})),i):[]}},{key:"getSeekTime",value:function(e,t,i,n){var r=-1,o=n[i],a=o.start,s=o.end;if(e>=a&&e<=s)return r;var l=e-t;if(l<0&&e<a){var c=t>a?t-a:0;return r=i-1>=0?n[i-1].end+l+c:0}return-1}},{key:"_checkIfEnabled",value:function(e){return!(!e||e.length<1)}},{key:"changeIndex",value:function(e,t){this.curIndex=e,e>=0&&t.length>0?this.curPos=t[e]:this.curPos=null}}],[{key:"pluginName",get:function(){return"TimeSegmentsControls"}},{key:"defaultConfig",get:function(){return{disable:!0,segments:[]}}}]),i}();function SL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M940.632 837.632l-72.192-72.192c65.114-64.745 105.412-154.386 105.412-253.44s-40.299-188.695-105.396-253.424l-0.016-0.016 72.192-72.192c83.639 83.197 135.401 198.37 135.401 325.632s-51.762 242.434-135.381 325.612l-0.020 0.020zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>\n</svg>\n',"image/svg+xml").firstChild}function bL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>\n</svg>\n',"image/svg+xml").firstChild}function CL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M920.4 439.808l-108.544-109.056-72.704 72.704 109.568 108.544-109.056 108.544 72.704 72.704 108.032-109.568 108.544 109.056 72.704-72.704-109.568-108.032 109.056-108.544-72.704-72.704-108.032 109.568z"></path>\n</svg>\n',"image/svg+xml").firstChild}var kL=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var i=Sr(e).player,n=e.find(".xgplayer-bar");Ur.event(t);var r=n.getBoundingClientRect(),o=Ur.getEventPos(t,i.zoom),a=r.height-(o.clientY-r.top);if(o.h=a,o.barH=r.height,e.pos=o,!(a<-2))return e.updateVolumePos(a,t),document.addEventListener("mouseup",e.onBarMouseUp),e._d.isStart=!0,!1})),mr(Sr(e),"onBarMouseMove",(function(t){var i=Sr(e)._d;if(i.isStart){var n=Sr(e),r=n.pos,o=n.player;t.preventDefault(),t.stopPropagation(),Ur.event(t);var a=Ur.getEventPos(t,o.zoom);i.isMoving=!0;var s=r.h-a.clientY+r.clientY;s>r.barH||e.updateVolumePos(s,t)}})),mr(Sr(e),"onBarMouseUp",(function(t){Ur.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var i=Sr(e)._d;i.isStart=!1,i.isMoving=!1})),mr(Sr(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),mr(Sr(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),mr(Sr(e),"onVolumeChange",(function(t){if(e.player){var i=e.player,n=i.muted,r=i.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=n||0===r?"4px":"".concat(100*r,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(n,r)}})),e}return vr(i,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:bL,class:"xg-volume-small"},volumeLarge:{icon:SL,class:"xg-volume"},volumeMuted:{icon:CL,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;if(this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},!this.config.disable){this.initIcons();var t=this.playerConfig,i=t.commonStyle,n=t.volume;i.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=i.volumeColor),this.changeMutedHandler=this.hook("mutedChange",(function(t){e.changeMuted(t)}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),"mobile"!==Kr.device&&"mobile"!==this.playerConfig.isMobileSimulateMode&&(this.bind("mouseenter",this._onMouseenterHandler),this.bind(["blur","mouseleave"],this._onMouseleaveHandler),this.bind(".xgplayer-slider","mousedown",this.onBarMousedown),this.bind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.bind(".xgplayer-slider","mouseup",this.onBarMouseUp)),this.bind(".xgplayer-icon",["touchend","click"],this.changeMutedHandler),this.on(oo,this.onVolumeChange),this.once(ao,this.onVolumeChange),"Number"!==Ur.typeOf(n)&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,t){var i=this.player,n=this.find(".xgplayer-drag"),r=this.find(".xgplayer-bar");if(r&&n){var o=parseInt(e/r.getBoundingClientRect().height*1e3,10);n.style.height="".concat(e,"px");var a=Math.max(Math.min(o/1e3,1),0),s={volume:{from:i.volume,to:a}};i.muted&&(s.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:i.muted,volume:i.volume,props:s}),i.volume=Math.max(Math.min(o/1e3,1),0),i.muted&&(i.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,i=e.muted,n=this.find(".xgplayer-value-label"),r=Math.max(Math.min(t,1),0);n.innerText=i?0:Math.round(100*r)}},{key:"focus",value:function(){this.player.focus({autoHide:!1}),this._timerId&&(Ur.clearTimeout(this,this._timerId),this._timerId=null),Ur.addClass(this.root,"slide-show")}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this._d,o=this.player;r.isActive||(this._timerId&&(Ur.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=Ur.setTimeout(this,(function(){r.isActive||(i?o.blur():o.focus(),Ur.removeClass(e.root,"slide-show"),r.isStart&&e.onBarMouseUp(n)),e._timerId=null}),t))}},{key:"changeMuted",value:function(e){e&&e.stopPropagation();var t=this.player;this._d.isStart&&this.onBarMouseUp(e),this.emitUserAction(e,"change_muted",{muted:t.muted,volume:t.volume,props:{muted:{from:t.muted,to:!t.muted}}}),t.volume>0&&(t.muted=!t.muted),t.volume<.01&&(t.volume=this.config.miniVolume)}},{key:"animate",value:function(e,t){e||0===t?this.setAttr("data-state","mute"):t<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.volumeSmall),this.appendChild(".xgplayer-icon",e.volumeLarge),this.appendChild(".xgplayer-icon",e.volumeMuted)}},{key:"destroy",value:function(){this._timerId&&(Ur.clearTimeout(this,this._timerId),this._timerId=null),this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-slider","mousedown",this.onBarMousedown),this.unbind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.unbind(".xgplayer-slider","mouseup",this.onBarMouseUp),document.removeEventListener("mouseup",this.onBarMouseUp),this.unbind(".xgplayer-icon","mobile"===Kr.device?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){if(!this.config.disable){var e=this.config.default||this.player.volume,t=this.config.showValueLabel;return'\n <xg-icon class="xgplayer-volume" data-state="normal">\n <div class="xgplayer-icon">\n </div>\n <xg-slider class="xgplayer-slider">\n '.concat(t?'<div class="xgplayer-value-label">'.concat(100*e,"</div>"):"",'\n <div class="xgplayer-bar">\n <xg-drag class="xgplayer-drag" style="height: ').concat(100*e,'%"></xg-drag>\n </div>\n </xg-slider>\n </xg-icon>')}}}],[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),i}();function IL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="-4 -6 40 40" fill="none">\n <g>\n <path transform="scale(1.5 1.5)" d="M11.6665 9.16663H4.1665C2.78579 9.16663 1.6665 10.2859 1.6665 11.6666V15.8333C1.6665 17.214 2.78579 18.3333 4.1665 18.3333H11.6665C13.0472 18.3333 14.1665 17.214 14.1665 15.8333V11.6666C14.1665 10.2859 13.0472 9.16663 11.6665 9.16663Z" fill="white"/>\n <path transform="scale(1.5 1.5)" fill-rule="evenodd" clip-rule="evenodd" d="M3.88148 4.06298C3.75371 4.21005 3.67667 4.40231 3.67749 4.61242C3.67847 4.87253 3.79852 5.10435 3.98581 5.25646L6.99111 8.05895C7.32771 8.37283 7.85502 8.35443 8.16891 8.01782C8.48279 7.68122 8.46437 7.15391 8.12778 6.84003L6.62061 5.43457L9.8198 5.4224C9.82848 5.42239 9.8372 5.42221 9.84591 5.4219C10.9714 5.38233 12.0885 5.6285 13.0931 6.13744C14.0976 6.64635 14.957 7.40148 15.5908 8.33234C16.2246 9.2632 16.6122 10.3394 16.7177 11.4606C16.823 12.5819 16.6427 13.7115 16.1934 14.7442C16.0098 15.1661 16.203 15.6571 16.6251 15.8408C17.0471 16.0243 17.5381 15.8311 17.7216 15.4091C18.2833 14.1183 18.5087 12.7063 18.3771 11.3047C18.2453 9.90318 17.7607 8.55792 16.9684 7.39433C16.1761 6.23073 15.1021 5.28683 13.8463 4.65065C12.5946 4.01651 11.203 3.70872 9.80072 3.75583L6.43415 3.76862L7.96326 2.12885C8.27715 1.79225 8.25872 1.26494 7.92213 0.951061C7.58553 0.63718 7.05822 0.655585 6.74433 0.99219L3.90268 4.0395C3.89545 4.04724 3.88841 4.05509 3.88154 4.06303L3.88148 4.06298Z" fill="white"/>\n </g>\n <defs>\n <clipPath>\n <rect width="40" height="40" fill="white"/>\n </clipPath>\n </defs>\n</svg>\n',"image/svg+xml").firstChild}var PL=function(e){_r(i,fL);var t=Cr(i);function i(e){var n;return gr(this,i),(n=t.call(this,e)).rotateDeg=n.config.rotateDeg||0,n}return vr(i,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){kr(Er(i.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.onBtnClick=this.onBtnClick.bind(this),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(Ro,(function(){e.rotateDeg&&e.config.innerRotate&&Ur.setTimeout(e,(function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)}),100)}));var t=this.player.root;this.rootWidth=t.style.width||t.offsetWidth||t.clientWidth,this.rootHeight=t.style.height||t.offsetHeight||t.clientHeight,this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate)}}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{key:"onBtnClick",value:function(e){e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"rotate"),this.rotate(this.config.clockwise,this.config.innerRotate,1)}},{key:"updateRotateDeg",value:function(e,t){if(e||(e=0),t)this.player.videoRotateDeg=e;else{var i=this.player,n=this.rootWidth,r=this.rootHeight,o=i.root,a=i.innerContainer,s=i.media,l=o.offsetWidth,c=a&&t?a.offsetHeight:o.offsetHeight,u=n,h=r,d=0,f=0;.75!==e&&.25!==e||(u="".concat(c,"px"),h="".concat(l,"px"),d=-(c-l)/2,f=-(l-c)/2);var p="translate(".concat(d,"px,").concat(f,"px) rotate(").concat(e,"turn)"),g={transformOrigin:"center center",transform:p,webKitTransform:p,height:h,width:u},y=t?s:o,v=t?i.getPlugin("poster"):null;Object.keys(g).map((function(e){y.style[e]=g[e],v&&v.root&&(v.root.style[e]=g[e])}))}}},{key:"rotate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.player;this.rotateDeg||(this.rotateDeg=0);var r=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*r*i)%1,this.updateRotateDeg(this.rotateDeg,t),n.emit(Oo,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:IL}}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n '.concat(kO(this,"ROTATE_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),i}();function DL(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}function wL(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M9.4998 7.7C9.77595 7.7 9.9998 7.47614 9.9998 7.2V6.5C9.9998 6.22386 9.77595 6 9.4998 6H5.5402L5.52754 6.00016H5.5C5.22386 6.00016 5 6.22401 5 6.50016V10.4598C5 10.7359 5.22386 10.9598 5.5 10.9598H6.2C6.47614 10.9598 6.7 10.7359 6.7 10.4598V8.83005L8.76983 10.9386C8.96327 11.1357 9.27984 11.1386 9.47691 10.9451L9.97645 10.4548C10.1735 10.2613 10.1764 9.94476 9.983 9.7477L7.97289 7.7H9.4998Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}var AL="picture-in-picture",RL="inline",xL="fullscreen",OL=function(e){_r(i,fL);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"switchPIP",(function(t){if(!e.isPIPAvailable())return!1;t.stopPropagation&&t.stopPropagation(),e.isPip?(e.exitPIP(),e.emitUserAction(t,"change_pip",{props:"pip",from:!0,to:!1}),e.setAttr("data-state","normal")):4===e.player.media.readyState&&(e.requestPIP(),e.emitUserAction(t,"change_pip",{props:"pip",from:!1,to:!0}),e.setAttr("data-state","pip"))})),e}return vr(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.pip&&(e.config.showIcon=e.player.config.pip)}},{key:"afterCreate",value:function(){var e=this;this.isPIPAvailable()&&(kr(Er(i.prototype),"afterCreate",this).call(this),this.pMode=RL,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(mo,(function(){e.config.showIcon&&(Ur.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:DL,class:"xg-get-pip"},pipIconExit:{icon:wL,class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.pipIcon),this.appendChild(".xgplayer-icon",e.pipIconExit)}},{key:"initPipEvents",value:function(){var e=this,t=this.player;this.leavePIPCallback=function(){var i=t.paused;Ur.setTimeout(e,(function(){!i&&t.mediaPlay()}),0),!i&&t.mediaPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(xo,!1)},this.enterPIPCallback=function(i){t.emit(xo,!0),null!=i&&i.pictureInPictureWindow&&(e.pipWindow=i.pictureInPictureWindow),e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(i){var n=t.media.webkitPresentationMode;e.pMode===xL&&n!==xL&&t.onFullscreenChange(null,!1),e.pMode=n,n===AL?e.enterPIPCallback(i):n===RL&&e.leavePIPCallback(i)},t.media&&(t.media.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.media.addEventListener("leavepictureinpicture",this.leavePIPCallback),i.checkWebkitSetPresentationMode(t.media)&&t.media.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"copyStyleIntoPiPWindow",value:function(e){var t=Ir(document.styleSheets).map((function(t){try{return Ir(t.cssRules).map((function(e){return e.cssText})).join("")}catch(hs){var i=document.createElement("link");i.rel="stylesheet",i.type=t.type,i.media=t.media,i.href=t.href,e.document.head.appendChild(i)}return""})).filter(Boolean).join("\n"),i=document.createElement("style");i.textContent=t,e.document.head.appendChild(i)}},{key:"requestPIP",value:function(){var e=this,t=this.player,n=this.playerConfig,r=this.config;if(this.isPIPAvailable()&&!this.isPip)try{var o=n.poster;if(o&&(t.media.poster="String"===Ur.typeOf(o)?o:o.poster),r.preferDocument&&this.isDocPIPAvailable()){var a={};if(r.width&&r.height)a.width=r.width,a.height=r.height;else{var s=t.root.getBoundingClientRect();a.width=s.width,a.height=s.height}documentPictureInPicture.requestWindow(a).then((function(i){var n=r.docPiPNode,o=r.docPiPStyle;e.enterPIPCallback();var a=n||t.root,s=a.parentElement,l=a.previousSibling,c=a.nextSibling;e.copyStyleIntoPiPWindow(i);var u=document.createElement("style");if(u.append("body{padding:0; margin:0;}"),o){var h="";"string"==typeof o?h=o:"function"==typeof o&&(h=o.call(r)),h&&u.append(h)}else a===t.root&&u.append("\n .xgplayer{width: 100%!important; height: 100%!important;}\n ");i.document.head.append(u),i.document.body.append(a),i.addEventListener("pagehide",(function(t){s&&(c?s.insertBefore(a,c):l?s.insertBefore(a,l.nextSibling):s.appendChild(a)),e.leavePIPCallback()}),{once:!0})}))}else i.checkWebkitSetPresentationMode(t.media)?t.media.webkitSetPresentationMode("picture-in-picture"):t.media.requestPictureInPicture();return!0}catch(l){return console.error("requestPiP",l),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{var t;if(this.isPIPAvailable()&&this.isPip)this.isDocPIPAvailable()&&null!==(t=documentPictureInPicture)&&void 0!==t&&t.window?documentPictureInPicture.window.close():i.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("inline"):document.exitPictureInPicture();return!0}catch(n){return console.error("exitPIP",n),!1}}},{key:"isPip",get:function(){var e,t=this.player;return!(!this.isDocPIPAvailable()||null===(e=documentPictureInPicture)||void 0===e||!e.window)||document.pictureInPictureElement&&document.pictureInPictureElement===t.media||t.media.webkitPresentationMode===AL}},{key:"isPIPAvailable",value:function(){var e=this.player.media;return"Boolean"===Ur.typeOf(document.pictureInPictureEnabled)&&document.pictureInPictureEnabled&&("Boolean"===Ur.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===Ur.typeOf(e.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this);var e=this.player;e.media.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.media.removeEventListener("leavepictureinpicture",this.leavePIPCallback),i.checkWebkitSetPresentationMode(e.media)&&e.media.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.exitPIP(),this.unbind("click",this.btnClick)}},{key:"render",value:function(){if(this.config.showIcon&&this.isPIPAvailable())return'<xg-icon class="xgplayer-pip">\n <div class="xgplayer-icon xg-icon-disable">\n </div>\n '.concat(kO(this,"PIP",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:6,showIcon:!1,preferDocument:!1,width:void 0,height:void 0,docPiPNode:void 0,docPiPStyle:void 0}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}]),i}();function LL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="40" viewBox="10 0 24 40">\n <path transform="scale(0.038 0.028)" d="M800 380v768h-128v-352l-320 320v-704l320 320v-352z"></path>\n</svg>\n',"image/svg+xml").firstChild}var NL=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"playNext",(function(e){var t=Sr(n).player;e.preventDefault(),e.stopPropagation(),n.idx+1<n.config.urlList.length?(n.idx++,n.nextHandler(n.config.urlList[n.idx],n.idx),t.emit(No,n.idx+1)):(n.nextHandler(),t.emit(No))})),n.idx=-1,n}return vr(i,[{key:"afterCreate",value:function(){this.config.urlList&&0!==this.config.urlList.length&&(this.appendChild(".xgplayer-icon",this.icons.playNext),this.initEvents())}},{key:"registerIcons",value:function(){return{playNext:LL}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("nextClick",this.changeSrc);var e="mobile"===Kr.device?"touchend":"click";this.bind(e,this.playNext),this.show()}},{key:"changeSrc",value:function(e){var t=this.player;e&&(t.pause(),t.currentTime=0,t.switchURL?t.switchURL(e):t.src=e,t.config.url=e,t.play())}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.playNext)}},{key:"render",value:function(){if(this.config.urlList&&0!==this.config.urlList.length)return'\n <xg-icon class="xgplayer-playnext">\n <div class="xgplayer-icon">\n </div>\n '.concat(kO(this,"PLAYNEXT_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),i}(),ML={exports:{}};ML.exports=function e(t,i,n){var r,o,a=window,s="application/octet-stream",l=n||s,c=t,u=!i&&!n&&c,h=document.createElement("a"),d=function(e){return String(e)},f=a.Blob||a.MozBlob||a.WebKitBlob||d,p=i||"download";if(f=f.call?f.bind(a):Blob,"true"===String(this)&&(l=(c=[c,l])[0],c=c[1]),u&&u.length<2048&&(p=u.split("/").pop().split("?")[0],h.href=u,-1!==h.href.indexOf(u))){var g=new XMLHttpRequest;return g.open("GET",u,!0),g.responseType="blob",g.onload=function(t){e(t.target.response,p,s)},setTimeout((function(){g.send()}),0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(c)){if(!(c.length>2096103.424&&f!==d))return navigator.msSaveBlob?navigator.msSaveBlob(_(c),p):E(c);l=(c=_(c)).type||s}else if(/([\x80-\xff])/.test(c)){for(var y=0,v=new Uint8Array(c.length),m=v.length;y<m;++y)v[y]=c.charCodeAt(y);c=new f([v],{type:l})}function _(e){for(var t=e.split(/[:;,]/),i=t[1],n=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),r=n.length,o=0,a=new Uint8Array(r);o<r;++o)a[o]=n.charCodeAt(o);return new f([a],{type:i})}function E(e,t){if("download"in h)return h.href=e,h.setAttribute("download",p),h.className="download-js-link",h.innerHTML="downloading...",h.style.display="none",document.body.appendChild(h),setTimeout((function(){h.click(),document.body.removeChild(h),!0===t&&setTimeout((function(){a.URL.revokeObjectURL(h.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var i=document.createElement("iframe");document.body.appendChild(i),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),i.src=e,setTimeout((function(){document.body.removeChild(i)}),333)}if(r=c instanceof f?c:new f([c],{type:l}),navigator.msSaveBlob)return navigator.msSaveBlob(r,p);if(a.URL)E(a.URL.createObjectURL(r),!0);else{if("string"==typeof r||r.constructor===d)try{return E("data:"+l+";base64,"+a.btoa(r))}catch(T){return E("data:"+l+","+encodeURIComponent(r))}(o=new FileReader).onload=function(e){E(this.result)},o.readAsDataURL(r)}return!0};const UL=lr(ML.exports);function BL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-488.000000, -340.000000)" fill="#FFFFFF">\n <g id="Group-2">\n <g id="volme_big-copy" transform="translate(488.000000, 340.000000)">\n <rect id="Rectangle-18" x="11" y="4" width="2" height="12" rx="1"></rect>\n <rect id="Rectangle-2" x="3" y="18" width="18" height="2" rx="1"></rect>\n <rect id="Rectangle-2" transform="translate(4.000000, 17.500000) rotate(90.000000) translate(-4.000000, -17.500000) " x="1.5" y="16.5" width="5" height="2" rx="1"></rect><rect id="Rectangle-2-Copy-3" transform="translate(20.000000, 17.500000) rotate(90.000000) translate(-20.000000, -17.500000) " x="17.5" y="16.5" width="5" height="2" rx="1"></rect>\n <path d="M9.48791171,8.26502656 L9.48791171,14.2650266 C9.48791171,14.8173113 9.04019646,15.2650266 8.48791171,15.2650266 C7.93562696,15.2650266 7.48791171,14.8173113 7.48791171,14.2650266 L7.48791171,7.26502656 C7.48791171,6.71274181 7.93562696,6.26502656 8.48791171,6.26502656 L15.4879117,6.26502656 C16.0401965,6.26502656 16.4879117,6.71274181 16.4879117,7.26502656 C16.4879117,7.81731131 16.0401965,8.26502656 15.4879117,8.26502656 L9.48791171,8.26502656 Z" id="Combined-Shape" transform="translate(11.987912, 10.765027) scale(1, -1) rotate(45.000000) translate(-11.987912, -10.765027) "></path>\n </g>\n </g>\n </g>\n </g>\n</svg>\n',"image/svg+xml").firstChild}var FL=function(e){_r(i,fL);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"download",(function(e){if(!n.isLock){n.emitUserAction(e,"download");var t=n.playerConfig.url,i="";"String"===Ur.typeOf(t)?i=t:"Array"===Ur.typeOf(t)&&t.length>0&&(i=t[0].src);var r=n.getAbsoluteURL(i);UL(r),n.isLock=!0,n.timer=window.setTimeout((function(){n.isLock=!1,window.clearTimeout(n.timer),n.timer=null}),300)}})),n.timer=null,n.isLock=!1,n}return vr(i,[{key:"afterCreate",value:function(){kr(Er(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.download),this._handler=this.hook("click",this.download,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(["click","touchend"],this._handler))}},{key:"registerIcons",value:function(){return{download:BL}}},{key:"getAbsoluteURL",value:function(e){if(!e.match(/^https?:\/\//)){var t=document.createElement("div");t.innerHTML='<a href="'.concat(e,'">x</a>'),e=t.firstChild.href}return e}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.download),window.clearTimeout(this.timer),this.timer=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-download">\n <div class="xgplayer-icon">\n </div>\n '.concat(kO(this,"DOWNLOAD_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:3,disable:!0}}}]),i}(),HL=function(e){_r(i,fL);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){kr(Er(i.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var e=this.config;this.initSize=function(t){e.fitVideo&&(e.width=t.vWidth,e.height=t.vHeight)},this.once(Ro,this.initSize)}},{key:"onPluginsReady",value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind(["click","touchend"],this.onClickBtn)}},{key:"saveScreenShot",value:function(e,t){var i,n=document.createElement("a");n.href=e,n.download=t;try{"undefined"!=typeof MouseEvent?i=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}):(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}catch(hs){console.error("MouseEvent unsupported",hs)}i&&n.dispatchEvent(i)}},{key:"createCanvas",value:function(e,t){var i=document.createElement("canvas"),n=i.getContext("2d");this.canvasCtx=n,this.canvas=i,i.width=e||this.config.width,i.height=t||this.config.height,n.imageSmoothingEnabled=!0,n.imageSmoothingEnabled&&(n.imageSmoothingQuality="high")}},{key:"onClickBtn",value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot");var i=this.config;this.shot(i.width,i.height).then((function(e){t.emit(Lo,e),i.saveImg&&t.saveScreenShot(e,i.name+i.format)}))}},{key:"shot",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},r=this.config,o=this.player,a=n.quality||r.quality,s=n.type||r.type;return new Promise((function(n,l){var c,u=null;if(o.media.canvas)u=o.media.canvas;else{i.canvas?(i.canvas.width=e||r.width,i.canvas.height=t||r.height):i.createCanvas(e,t),u=i.canvas,c=i.canvasCtx;var h,d,f,p,g=o.media.videoWidth/o.media.videoHeight,y=u.width/u.height,v=o.media.videoWidth,m=o.media.videoHeight;g>y?(f=u.width,p=u.width/g,h=0,d=Math.round((u.height-p)/2)):g===y?(f=u.width,p=u.height,h=0,d=0):g<y&&(f=u.height*g,p=u.height,h=Math.round((u.width-f)/2),d=0),c.drawImage(o.media,0,0,v,m,h,d,f,p)}var _=u.toDataURL(s,a).replace(s,"image/octet-stream");n(_=_.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(Ro,this.initSize)}},{key:"render",value:function(){if(!this.config.disable){var e=this.icons.screenshotIcon?"xgplayer-icon":"xgplayer-icon btn-text",t="SCREENSHOT";return'\n <xg-icon class="xgplayer-shot">\n <div class="'.concat(e,'">\n ').concat(this.icons.screenshotIcon?"":'<span lang-key="'.concat(this.i18nKeys[t],'">').concat(this.i18n[t],"</span>"),"\n </div>\n </xg-icon>")}}}],[{key:"pluginName",get:function(){return"screenShot"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,saveImg:!0,fitVideo:!0,disable:!1,name:"screenshot"}}}]),i}(),jL=function(e){_r(i,xA);var t=Cr(i);function i(e){var n;return gr(this,i),(n=t.call(this,e)).curTime=0,n.isPaused=!0,n}return vr(i,[{key:"beforeCreate",value:function(e){var t=e.config.list;Array.isArray(t)&&t.length>0&&(e.config.list=t.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})))}},{key:"afterCreate",value:function(){var e=this;kr(Er(i.prototype),"afterCreate",this).call(this),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(wo,(function(t){e.renderItemList(e.config.list,t.to)})),this.player.definitionList.length<2&&this.hide()}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||Ur.addClass(this.root,"show")}},{key:"initDefinition",value:function(){var e=this.config,t=e.list,i=e.defaultDefinition;if(t.length>0){var n=null;t.map((function(e){e.definition===i&&(n=e)})),n||(n=t[0]),this.changeDefinition(n)}}},{key:"renderItemList",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.list||[],n=arguments.length>1?arguments[1]:void 0,r=n&&n.definition?n.definition:this.config.defaultDefinition;n&&t.forEach((function(e){e.selected=!1}));var o=0,a=t.map((function(t,i){var n=fr(fr({},t),{},{showText:e.getTextByLang(t)||t.definition,selected:!1});return(t.selected||t.definition&&t.definition==r)&&(n.selected=!0,o=i),n}));kr(Er(i.prototype),"renderItemList",this).call(this,a,o)}},{key:"changeDefinitionList",value:function(e){Array.isArray(e)&&(this.config.list=e.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})),this.renderItemList(),this.config.list.length<2?this.hide():this.show())}},{key:"changeDefinition",value:function(e,t){this.player.changeDefinition(e,t)}},{key:"onItemClick",value:function(e,t){var n=this.player.definitionList;kr(Er(i.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var r=0;r<n.length;r++)t.to&&n[r].definition===t.to.definition&&(t.to.url=n[r].url),t.from&&n[r].definition===t.from.definition&&(t.from.url=n[r].url);this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return fr(fr({},xA.defaultConfig),{},{position:ma.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),i}(),VL=function(e){_r(i,xA);var t=Cr(i);function i(e){var n;return gr(this,i),(n=t.call(this,e)).curRate=1,n}return vr(i,[{key:"beforeCreate",value:function(e){var t=e.player.config.playbackRate,i=t?Array.isArray(t)?t:e.config.list:[];Array.isArray(i)&&(e.config.list=i.map((function(e){return"number"==typeof e?e={rate:e,text:"".concat(e,"x")}:!e.text&&e.rate&&(e.text="".concat(e.rate,"x")),e})))}},{key:"afterCreate",value:function(){var e=this;kr(Er(i.prototype),"afterCreate",this).call(this),this.on(so,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(e){this.config.list&&0!==this.config.list.length&&kr(Er(i.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){kr(Er(i.prototype),"onItemClick",this).call(this,e,t);var n=e.delegateTarget,r=Number(n.getAttribute("rate"));if(!r||r===this.curValue)return!1;var o={playbackRate:{from:this.player.playbackRate,to:r}};this.emitUserAction(e,"change_rate",{props:o}),this.curValue=r,this.player.playbackRate=r}},{key:"renderItemList",value:function(){var e=this,t=this.player.playbackRate||1;this.curValue=t;var n=-1,r=this.config.list.map((function(i,r){var o={rate:i.rate};return o.rate===t&&(o.selected=!0,n=r),o.showText=e.getTextByLang(i),o}));kr(Er(i.prototype),"renderItemList",this).call(this,r,n)}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0],i="";i=!t||this.curIndex<0?"".concat(this.player.playbackRate,"x"):this.getTextByLang(t,"iconText"),this.find(".icon-text").innerHTML=i}}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return fr(fr({},xA.defaultConfig),{},{position:ma.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),i}();function KL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">\n <path fill="#fff" transform="scale(1.3, 1.3)" class=\'path_full\' d="M9,10v1a.9.9,0,0,1-1,1,.9.9,0,0,1-1-1V9A.9.9,0,0,1,8,8h2a.9.9,0,0,1,1,1,.9.9,0,0,1-1,1Zm6,4V13a1,1,0,0,1,2,0v2a.9.9,0,0,1-1,1H14a1,1,0,0,1,0-2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>\n</svg>\n',"image/svg+xml").firstChild}function WL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">\n <path fill="#fff" transform="scale(1.3, 1.3)" d="M9,10V9a.9.9,0,0,1,1-1,.9.9,0,0,1,1,1v2a.9.9,0,0,1-1,1H8a.9.9,0,0,1-1-1,.9.9,0,0,1,1-1Zm6,4v1a1,1,0,0,1-2,0V13a.9.9,0,0,1,1-1h2a1,1,0,0,1,0,2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>\n</svg>\n',"image/svg+xml").firstChild}var GL=function(e){_r(i,fL);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.cssFullscreen&&(e.config.disable=!e.player.config.cssFullscreen)}},{key:"afterCreate",value:function(){var e=this;kr(Er(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(Po,(function(t){e.animate(t)})),this.btnClick=this.btnClick.bind(this),this.handleCssFullscreen=this.hook("cssFullscreen_change",this.btnClick,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(["click","touchend"],this.handleCssFullscreen))}},{key:"initIcons",value:function(){var e=this.icons,t=this.find(".xgplayer-icon");t.appendChild(e.cssFullscreen),t.appendChild(e.exitCssFullscreen)}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.player.isCssfullScreen;this.emitUserAction(e,"switch_cssfullscreen",{cssfullscreen:t}),t?this.player.exitCssFullscreen():this.player.getCssFullscreen()}},{key:"animate",value:function(e){this.root&&(e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.switchTips(e))}},{key:"switchTips",value:function(e){var t=this.i18nKeys,i=this.find(".xg-tips");i&&this.changeLangTextKey(i,e?t.EXITCSSFULLSCREEN_TIPS:t.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:KL,class:"xg-get-cssfull"},exitCssFullscreen:{icon:WL,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return"<xg-icon class='xgplayer-cssfullscreen'>\n <div class=\"xgplayer-icon\">\n </div>\n ".concat(kO(this,"CSSFULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),i}(),YL=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"afterCreate",value:function(){var e=this;this.clickHandler=this.hook("errorRetry",this.errorRetry,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.onError=this.hook("showError",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(Qr,(function(t){e.onError(t)}))}},{key:"errorRetry",value:function(e){this.emitUserAction(e,"error_retry",{}),this.player.retry()}},{key:"handleError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.player,i=e.errorType,n=t.errorNote?this.i18n[t.errorNote]:"";if(!n)switch(i){case"decoder":n=this.i18n.MEDIA_ERR_DECODE;break;case"network":n=this.i18n.MEDIA_ERR_NETWORK;break;default:n=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=n,this.find(".xgplayer-error-tips").innerHTML="".concat(this.i18n.REFRESH_TIPS,'<span class="xgplayer-error-refresh">').concat(this.i18n.REFRESH,"</span>")}},{key:"destroy",value:function(){this.unbind(".xgplayer-error-refresh","click",this.clickHandler)}},{key:"render",value:function(){return'<xg-error class="xgplayer-error">\n <div class="xgplayer-errornote">\n <span class="xgplayer-error-text"></span>\n <span class="xgplayer-error-tips"><em class="xgplayer-error-refresh"></em></span>\n </div>\n </xg-error>'}}],[{key:"pluginName",get:function(){return"error"}}]),i}(),zL=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"afterCreate",value:function(){var e=this;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],(function(t){(e.config.onClick||e.customOnClick)&&(t.preventDefault(),t.stopPropagation(),e.customOnClick?e.customOnClick(t):e.config.onClick(t))})),this.player.showPrompt=function(){e.showPrompt.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).map((function(i){t.root.style[i]=e[i]}))}},{key:"showPrompt",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){this.customOnClick=n;var r=this.config.interval;if(this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),Ur.addClass(this.root,"show"),"arrow"===i.mode&&Ur.addClass(this.root,"arrow"),this.find(".xgplayer-prompt-detail").innerHTML="string"==typeof e?e:"".concat(e.text||"")+"".concat(e.highlight?'<i class="highlight">'.concat(e.highlight,"</i>"):""),i.style&&this.setStyle(i.style),"boolean"==typeof i.autoHide?i.autoHide:this.config.autoHide){var o=i.interval||r;this.intervalId=setTimeout((function(){t.hide()}),o)}}}},{key:"hide",value:function(){Ur.removeClass(this.root,"show"),Ur.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(Pa.CONTROLS_FOLLOW,'">\n <span class="xgplayer-prompt-detail"></span>\n </xg-prompt>')}}],[{key:"pluginName",get:function(){return"prompt"}},{key:"defaultConfig",get:function(){return{interval:3e3,style:{},mode:"arrow",autoHide:!0,detail:{text:"",highlight:""},onClick:function(){}}}}]),i}(),$L={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function XL(e){Object.keys($L).map((function(t){void 0===e[t]&&(e[t]=$L[t])}))}var qL={_updateDotDom:function(e,t){if(t){var i=this.calcuPosition(e.time,e.duration),n=e.style||{};n.left="".concat(i.left,"%"),n.width="".concat(i.width,"%"),t.setAttribute("data-text",e.text),t.setAttribute("data-time",e.time),i.isMini?Ur.addClass(t,"mini"):Ur.removeClass(t,"mini"),Object.keys(n).map((function(e){t.style[e]=n[e]}))}},initDots:function(){var e=this;this._ispots.map((function(t){e.createDot(t,!1)})),this.ispotsInit=!0},createDot:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.player.plugins.progress;if(i&&(t&&(XL(e),this._ispots.push(e)),this.ispotsInit||!t)){var n=this.calcuPosition(e.time,e.duration),r=e.style||{};r.left="".concat(n.left,"%"),r.width="".concat(n.width,"%");var o="xgspot_".concat(e.id," xgplayer-spot");n.isMini&&(o+=" mini");var a=e.template?'<div class="xgplayer-spot-pop">'.concat(e.template,"</div>"):"",s=Ur.createDom("xg-spot",a,{"data-text":e.text,"data-time":e.time,"data-id":e.id},o);Object.keys(r).map((function(e){s.style[e]=r[e]})),i.outer&&i.outer.appendChild(s),this.positionDot(s,e.id)}},findDot:function(e){if(this.player.plugins.progress){var t=this._ispots.filter((function(t,i){return t.id===e}));return t.length>0?t[0]:null}},updateDot:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.player.plugins.progress;if(i){var n=this.findDot(e.id);if(n&&Object.keys(e).map((function(t){n[t]=e[t]})),this.ispotsInit){var r=i.find('xg-spot[data-id="'.concat(e.id,'"]'));r&&(this._updateDotDom(e,r),t&&this.showDot(e.id))}}},deleteDot:function(e){var t=this._ispots,i=this.player.plugins.progress;if(i){for(var n=[],r=0;r<t.length;r++)t[r].id===e&&n.push(r);for(var o=n.length-1;o>=0;o--)if(t.splice(n[o],1),this.ispotsInit){var a=i.find('xg-spot[data-id="'.concat(e,'"]'));a&&a.parentElement.removeChild(a)}}},deleteAllDots:function(){var e=this.player.plugins.progress;if(e)if(this.ispotsInit){for(var t=e.root.getElementsByTagName("xg-spot"),i=t.length-1;i>=0;i--)e.outer.removeChild(t[i]);this._ispots=[]}else this._ispots=[]},updateAllDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this.player.plugins.progress;if(i)if(this.ispotsInit){this._ispots=[];var n=i.root.getElementsByTagName("xg-spot"),r=n.length;if(r>t.length)for(var o=r-1;o>t.length-1;o--)i.outer.removeChild(n[o]);t.forEach((function(t,i){i<r?(n[i].setAttribute("data-id","".concat(t.id)),e._ispots.push(t),e.updateDot(t)):e.createDot(t)}))}else this._ispots=t},positionDots:function(){var e=this,t=this._ispots,i=this.playerSize,n=this.player.sizeInfo,r=this.player.plugins.progress;r&&n.width!==i.width&&(i.width=n.width,i.left=n.left,t.forEach((function(t){var i=r.find('xg-spot[data-id="'.concat(t.id,'"]'));i&&e.positionDot(i,t.id)})))},positionDot:function(e,t){var i=Ur.findDom(e,".xgplayer-spot-pop");if(i){var n=this.playerSize,r=e.getBoundingClientRect(),o=i.getBoundingClientRect(),a=r.left-n.left,s=n.width-a-r.width/2;if(a<o.width/2||n.width<o.width){var l=o.width/2-a;i.style.left="".concat(l,"px")}else if(s<o.width/2){var c=s-o.width/2+r.width/2;i.style.left="".concat(c,"px")}else i.style.left="50%"}},updateDuration:function(){var e=this,t=this.player.plugins.progress;t&&this._ispots.forEach((function(i){var n=t.find('xg-spot[data-id="'.concat(i.id,'"]'));e._updateDotDom(i,n)}))},getAllDotsDom:function(){var e=this.player.plugins.progress;return e?e.root.getElementsByTagName("xg-spot"):[]},getDotDom:function(e){var t=this.player.plugins.progress;if(t)return t.find('xg-spot[data-id="'.concat(e,'"]'))}};var ZL={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseOver"},QL=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"onMousemove",(function(e){n.config.disable||(Ur.hasClass(e.target,"xg-spot-content")&&n.config.isHideThumbnailHover?n.player.plugins.progress.onMouseLeave(e):(n._state.f||Ur.hasClass(e.target,"xg-spot-content"))&&(Ur.event(e),e.stopPropagation()))})),mr(Sr(n),"onMousedown",(function(e){n.config.disable||(n._state.f||Ur.hasClass(e.target,"xg-spot-content"))&&(Ur.event(e),e.stopPropagation())})),mr(Sr(n),"onMouseup",(function(e){if(n.isDrag){var t=n.player.plugins.progress;t&&t.pos&&(t.onMouseUp(e),!t.pos.isEnter&&t.onMouseLeave(e))}})),mr(Sr(n),"onDotMouseLeave",(function(e){if(!n.config.disable){n._curDot.removeEventListener("mouseleave",n.onDotMouseLeave),n.blurDot(e.target),n._curDot=null;var t=n.player.plugins.progress;t&&t.enableBlur(),n.show()}})),mr(Sr(n),"onProgressMouseOver",(function(e,t){if(!n.config.disable&&Ur.hasClass(t.target,"xgplayer-spot")&&!n._curDot){n._curDot=t.target,n.focusDot(t.target),n._curDot.children.length>0&&n.hide();var i=n.player.plugins.progress;i&&i.disableBlur(),n._curDot.addEventListener("mouseleave",n.onDotMouseLeave)}})),n._ispots=[],n.videoPreview=null,n.videothumbnail=null,n.thumbnail=null,n.timeStr="",n._state={now:0,f:!1},n}return vr(i,[{key:"beforeCreate",value:function(e){var t=e.player.plugins.progress;t&&(e.root=t.root)}},{key:"afterCreate",value:function(){var e=this;this._curDot=null,this.handlerSpotClick=this.hook("spotClick",(function(t,i){i.seekTime&&e.player.seek(i.seekTime)})),this.transformTimeHook=this.hook("transformTime",(function(t){e.setTimeContent(Ur.format(t))})),function(e){var t=e.config,i=e.player;Object.keys(qL).map((function(t){e[t]=qL[t].bind(e)}));var n=i.config.progressDot||t.ispots||[];e._ispots=n.map((function(e){return XL(e),e})),e.ispotsInit=!1,e.playerSize={left:i.sizeInfo.left,width:i.sizeInfo.width},e.on(ro,(function(){e.ispotsInit?e.updateDuration():e.initDots()})),e.on(Ro,(function(){e.positionDots()}))}(this),this.on(ro,(function(){e.show()})),this.config.disable&&this.disable(),this.extTextRoot=this.find(".xg-spot-ext-text")}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(i){t.config[i]=e[i]}))}},{key:"onPluginsReady",value:function(){this.player.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,t=this.player.plugins.progress;if(t&&(Object.keys(ZL).map((function(i){e[ZL[i]]=e[ZL[i]].bind(e),t.addCallBack(i,e[ZL[i]])})),"mobile"!==Kr.device)){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var i=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(n){n.stopPropagation(),i(parseInt(1e3*e._state.now,10)/1e3,n),t&&t.onMouseUp(n)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragStart",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!0,this.videoPreview&&Ur.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&Ur.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){this.config.disable||Ur.hasClass(t.target,"xgplayer-spot")&&(t.stopPropagation(),t.preventDefault(),["time","id","text"].map((function(i){e[i]=t.target.getAttribute("data-".concat(i))})),e.time&&(e.time=Number(e.time)),this.handlerSpotClick(t,e))}},{key:"updateLinePos",value:function(e,t){var i=this.root,n=this.previewLine,r=this.player,o=this.config,a="flex"===r.controls.mode,s=i.getBoundingClientRect().width;if(s||!this._hasThumnail){var l,c=e-(s=this._hasThumnail&&s<o.width?o.width:s)/2;c<0&&!a?(c=0,l=e-s/2):c>t-s&&!a?(l=c-(t-s),c=t-s):l=0,void 0!==l&&(n.style.transform="translateX(".concat(l.toFixed(2),"px)")),i.style.transform="translateX(".concat(c.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var t=this.timeText,i=this.timePoint;t.innerHTML=e,!this.thumbnail&&(i.innerHTML=e)}},{key:"updatePosition",value:function(e,t,i,n){var r=this.root,o=this.config,a=this._state;if(r){a.now=i,this.transformTimeHook(i);var s=this.timeStr;n&&n.target&&Ur.hasClass(n.target,"xgplayer-spot")?(this.showTips(n.target.getAttribute("data-text"),!1,s),this.focusDot(n.target),a.f=!0,o.isFocusDots&&a.f&&(a.now=parseInt(n.target.getAttribute("data-time"),10))):o.defaultText?(a.f=!1,this.showTips(o.defaultText,!0,s)):(a.f=!1,this.hideTips("")),this.updateTimeText(s),this.updateThumbnails(a.now),this.updateLinePos(e,t)}}},{key:"setTimeContent",value:function(e){this.timeStr=e}},{key:"updateThumbnails",value:function(e){var t=this.player,i=this.videoPreview,n=this.config,r=t.plugins.thumbnail;if(r&&r.usable){this.thumbnail&&r.update(this.thumbnail,e,n.width,n.height);var o=i&&i.getBoundingClientRect();this.videothumbnail&&r.update(this.videothumbnail,e,o.width,o.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==Kr.device){var t=this.player,i=this.config,n=t.getPlugin("thumbnail");if(n&&n.setConfig(e),n&&n.usable&&i.isShowThumbnail){Ur.removeClass(this.root,"short-line no-thumbnail"),"short"===i.mode&&Ur.addClass(this.root,"short-line"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.thumbnail=n.createThumbnail(r,"progress-thumbnail"),i.isShowCoverPreview&&(this.videoPreview=Ur.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=n.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else Ur.addClass(this.root,"short-line no-thumbnail")}}},{key:"calcuPosition",value:function(e,t){var i=this.player.plugins.progress,n=this.player,r=i.root.getBoundingClientRect().width,o=n.duration/r*6;return e+t>n.duration&&(t=n.duration-e),n.duration,n.duration,{left:e/n.duration*100,width:t/n.duration*100,isMini:t<o}}},{key:"showDot",value:function(e){var t=this.findDot(e);if(t){var i=this.root.getBoundingClientRect().width,n=t.time/this.player.duration*i;this.updatePosition(n,i,t.time)}}},{key:"focusDot",value:function(e,t){e&&(t||(t=e.getAttribute("data-id")),Ur.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(Ur.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";Ur.addClass(this.root,"no-timepoint"),e&&(Ur.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(Ur.addClass(this.root,"product"),this.tipText.textContent=e):(Ur.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(i," ").concat(e)))}},{key:"hideTips",value:function(){Ur.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",Ur.removeClass(this.find(".xg-spot-content"),"show-text"),Ur.removeClass(this.root,"product")}},{key:"hide",value:function(){Ur.addClass(this.root,"hide")}},{key:"show",value:function(e){Ur.removeClass(this.root,"hide")}},{key:"enable",value:function(){var e=this.config,t=this.playerConfig;this.config.disable=!1,this.show(),!this.thumbnail&&e.isShowThumbnail&&this.registerThumbnail(t.thumbnail||{})}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){var e=this,t=this.player.plugins.progress;t&&Object.keys(ZL).map((function(i){t.removeCallBack(i,e[ZL[i]])})),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return"mobile"===Kr.device||"mobile"===this.playerConfig.isMobileSimulateMode?"":'<div class="xg-spot-info hide '.concat("short"===this.config.mode?"short-line":"",'">\n <div class="xg-spot-content">\n <div class="xg-spot-thumbnail">\n <span class="xg-spot-time"></span>\n </div>\n <div class="xg-spot-text"><span class="spot-inner-text"></span></div>\n </div>\n <div class="xgplayer-progress-point">00:00</div>\n <div class="xg-spot-ext-text"></div>\n <div class="xg-spot-line"></div>\n </div>')}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90}}}]),i}(),JL=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),(n=t.call(this,e)).ratio=1,n.interval=null,n._preloadMark={},n}return vr(i,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([ro],(function(){var t=e.config,i=t.pic_num,n=t.interval;e.usable&&(e.interval=n>0?n:Math.round(1e3*e.player.duration/i)/1e3)}))}},{key:"setConfig",value:function(e){var t=this;if(e){var i=Object.keys(e);i.length<1||(i.forEach((function(i){t.config[i]=e[i]})),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,t=e.urls,i=e.pic_num;return t&&t.length>0&&i>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,i=e.height,n=e.pic_num,r=e.interval;this.ratio=t/i*100,this.interval=r||Math.round(this.player.duration/n),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e<this.config.urls.length?this.config.urls[e]:""}},{key:"preload",value:function(e){var t=this;if(!this._preloadMark[e]){var i=this.config.urls,n=i.length,r=[];e>0&&r.push(e-1),r.push(e),e>0&&e<n-1&&r.push(e+1),r.map((function(e){!t._preloadMark[e]&&e>=0&&e<n&&(t._preloadMark[e]=1,Ur.preloadImg(i[e],(function(){t._preloadMark[e]=2})))}))}}},{key:"getPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.config,r=n.pic_num,o=n.row,a=n.col,s=n.width,l=n.height;this.interval=Math.round(this.player.duration/r);var c=Math.ceil(e/this.interval),u=(c=c>r?r:c)<o*a?0:Math.ceil(c/(o*a))-1,h=c-u*(a*o),d=h>0?Math.ceil(h/a)-1:0,f=h>0?h-d*a-1:0,p=0,g=0;t&&i?t/i<s/l?p=(g=i)*(s/l):g=(p=t)/(s/l):i?t||(p=(g=i||l)*(s/l)):g=(p=t||s)/(s/l);var y=this.getUrlByIndex(u);return{urlIndex:u,rowIndex:d,colIndex:f,url:y,height:g,width:p,style:{backgroundImage:"url(".concat(y,")"),backgroundSize:"".concat(p*a,"px auto"),backgroundPosition:"-".concat(f*p,"px -").concat(d*g,"px"),width:"".concat(p,"px"),height:"".concat(g,"px")}}}},{key:"update",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=this.config,a=o.pic_num,s=o.urls;if(!(a<=0)&&s&&0!==s.length){var l=this.getPosition(t,i,n);this.preload(l.urlIndex),Object.keys(l.style).map((function(t){e.style[t]=l.style[t]})),Object.keys(r).map((function(t){e.style[t]=r[t]}))}}},{key:"changeConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setConfig(e)}},{key:"createThumbnail",value:function(e,t){var i=Ur.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(i),i}}],[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}]),i}();function eN(e){return e?"background:".concat(e,";"):""}var tN=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onTimeupdate",(function(){var t=e.player.ended,i=Sr(e).offsetDuration,n=e.currentTime;n=Ur.adjustTimeByDuration(n,i,t),e.update({played:n},i)})),e}return vr(i,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i}},{key:"afterCreate",value:function(){var e=this;this.root&&(this.on(to,this.onTimeupdate),this.on(uo,(function(){e.reset()})))}},{key:"reset",value:function(){this.update({played:0,cached:0},0)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;t&&this.root&&(e.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(e.cached/t*100,"%")),e.played&&(this.find("xg-mini-progress-played").style.width="".concat(e.played/t*100,"%")))}},{key:"render",value:function(){var e=this.playerConfig,t=e.commonStyle;if(e.miniprogress){var i=this.config,n=i.mode,r=i.height,o={cached:eN(t.cachedColor),played:eN(t.playedColor),progress:eN(t.progressColor),height:r>0&&2!==r?"height: ".concat(r,"px;"):""};return'<xg-mini-progress class="xg-mini-progress '.concat("show"===n?"xg-mini-progress-show":"",'" style="').concat(o.progress," ").concat(o.height,'">\n <xg-mini-progress-cache class="xg-mini-progress-cache" style="').concat(o.cached,'"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played" style="').concat(o.played,'"></xg-mini-progress-played>\n </xg-mini-progress>')}}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{mode:"auto",height:2}}}]),i}(),iN="realtime",nN="firstframe",rN="poster";var oN=null,aN=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onLoadedData",(function(t){e.player&&(e._frameCount=e.config.startFrameCount,e.stop(),e.renderOnTimeupdate(t),e.off(to,e.renderOnTimeupdate),e.on(to,e.renderOnTimeupdate))})),mr(Sr(e),"onVisibilitychange",(function(t){"visible"===document.visibilityState?e._checkIfCanStart()&&e.start():"hidden"===document.visibilityState&&e.stop()})),mr(Sr(e),"renderOnTimeupdate",(function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(to,e.renderOnTimeupdate);var i=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(0,i)}})),mr(Sr(e),"start",(function(t,i){var n=e.player.video,r=function(){try{return parseInt(window.performance.now(),10)}catch(hs){return(new Date).getTime()}}(),o=e.checkVideoIsSupport(n);o&&e.canvasCtx&&(i||(i=e.interval),e.stop(),n.videoWidth&&n.videoHeight&&(e.videoPI=n.videoHeight>0?parseInt(n.videoWidth/n.videoHeight*100,10):0,(e.config.mode===iN||r-e.preTime>=i)&&(n&&n.videoWidth&&e.update(o,e.videoPI),e.preTime=r)),e.frameId="timer"===e._loopType?Ur.setTimeout(Sr(e),e.start,i):Ur.requestAnimationFrame(e.start))})),mr(Sr(e),"stop",(function(){e.frameId&&("timer"===e._loopType?Ur.clearTimeout(Sr(e),e.frameId):Ur.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return vr(i,[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),i.isSupport||(this.config.disable=!0);var t=this.config,n=t.disable,r=t.mode,o=t.frameRate;n||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this._isLoaded=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/o,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this._loopType=this.config.mode!==iN&&this.interval>=1e3?"timer":"animation",this.once(mo,(function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())})),r!==rN&&(r!==nN&&(this.on(uo,(function(){e.stop()})),this.on($r,(function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(0,t)})),this.on(Zr,(function(){e.stop()}))),this.on(ao,this.onLoadedData),this.on(co,(function(){e._isLoaded=!1,e.stop()})),document.addEventListener("visibilitychange",this.onVisibilitychange)))}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){"root"===i&&e[i]!==t.config[i]?t.reRender(e[i]):"frameRate"===i?t.interval=parseInt(1e3/e[i],10):"disable"===i&&e[i]&&t.stop(),t.config[i]=e[i]}))}},{key:"init",value:function(e){var t=this.player,n=this.config;this.canvasFilter=i.supportCanvasFilter();try{var r=e||n.root;r||(r=n.isInnerRender&&t.innerContainer||t.root),r.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(n.index,'"><canvas>\n </canvas><xgmask></xgmask></div>')),this.root=r.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=n.filter,this.canvas.style.webkitFilter=n.filter),this.mask=this.find("xgmask"),n.addMask&&(this.mask.style.background=n.maskBg),this.canvasCtx=this.canvas.getContext("2d")}catch(hs){Nr.logError("plugin:DynamicBg",hs)}}},{key:"reRender",value:function(e){if(this.config.disable||this.root){this.stop();var t=this.root?this.root.parentElement:null;if(t!==e&&t.removeChild(this.root),e){this.init(e),this.renderOnce();var i=this.config.startInterval;this._checkIfCanStart()&&this.start(0,i)}else this.root=null}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var t=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(t&&("safari"!==Kr.browser||!Ur.isMSE(t)))return t;var i=t?t.tagName.toLowerCase():"";return"canvas"===i||"img"===i?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===Ur.typeOf(e)?e:"String"===Ur.typeOf(e.poster)?e.poster:null;this.updateImg(t)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&!this.player.paused&&e!==nN&&e!==rN}},{key:"renderOnce",value:function(){var e=this.player.video;if(e.videoWidth&&e.videoHeight){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var t=this.checkVideoIsSupport(e);t&&this.update(t,this.videoPI)}}},{key:"updateImg",value:function(e){var t=this;if(e){var i=this.canvas.getBoundingClientRect(),n=i.width,r=i.height,o=new window.Image;o.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=r,t.canvas.width=n;var e=parseInt(n/r*100,10);t.update(o,e),o=null}},o.src=e}}},{key:"update",value:function(e,t){if(this.canvas&&this.canvasCtx&&t)try{var i=this._pos,n=this.config,r=this.canvas.getBoundingClientRect(),o=r.width,a=r.height;if(o!==i.width||a!==i.height||i.pi!==t){var s=parseInt(o/a*100,10);i.pi=t,i.width!==o&&(i.width=this.canvas.width=o),i.height!==a&&(i.height=this.canvas.height=a);var l=a,c=o;s<t?c=parseInt(a*t/100,10):s>t&&(l=parseInt(100*o/t,10)),i.rwidth=c*n.multiple,i.rheight=l*n.multiple,i.x=(o-i.rwidth)/2,i.y=(a-i.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=n.filter),this.canvasCtx.drawImage(e,i.x,i.y,i.rwidth,i.rheight)}catch(hs){Nr.logError("plugin:DynamicBg",hs)}}},{key:"destroy",value:function(){this.stop(),document.removeEventListener("visibilitychange",this.onVisibilitychange),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,index:-1,mode:"framerate",frameRate:10,filter:"blur(50px)",startFrameCount:2,startInterval:0,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof oN?oN:oN=function(){try{return!!document.createElement("canvas").getContext}catch(hs){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===Kr.browser||"firefox"===Kr.browser)}}]),i}(),sN="info",lN=Ko,cN=function(e){_r(i,ua);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"_recordUserActions",(function(t){var i=e._getTime(),n=Object.assign({},t,{msg:t.msg||t.action});e._stats[sN].push(fr(fr({type:"userAction"},i),{},{payload:n}))})),mr(Sr(e),"_onReset",(function(){e.reset()})),mr(Sr(e),"_recordInfo",(function(t){e.info(t)})),mr(Sr(e),"_downloadStats",(function(){var t=e.getStats(),i=new Blob([JSON.stringify(t)],{type:"application/json"}),n=window.URL.createObjectURL(i),r=document.createElement("a");r.style.display="none",r.href=n,r.download="player.txt",r.disabled=!1,r.click()})),e}return vr(i,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(Bo,this._recordUserActions),this.on(lN.STATS_INFO,this._recordInfo),this.on(lN.STATS_DOWNLOAD,this._downloadStats),this.on(lN.STATS_RESET,this._onReset)}},{key:"destroy",value:function(){this.offAll()}},{key:"downloadStats",value:function(){this._downloadStats()}},{key:"info",value:function(e){e.profile?this._infoProfile(e):this._info(e)}},{key:"_info",value:function(e){var t=this._getTime();this._stats[sN].push(fr(fr({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=fr({cat:"function",dur:Date.now()-e.startMs,name:e.name||e.msg,ph:"X",pid:0,tid:0,ts:e.startMs,profile:!0},e);this._info(t)}else console.warn("infoProfile need object data, include startMs")}},{key:"reset",value:function(){var e;this._stats=(mr(e={},sN,[]),mr(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player.media,t=[],i=0;i<e.buffered.length;i++)t.push({start:e.buffered.start(i),end:e.buffered.end(i)});var n={currentTime:e.currentTime,readyState:e.readyState,buffered:t,paused:e.paused,ended:e.ended};return this._stats.media=n,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){return this._stats[sN].map((function(e){var t=e.payload.data,i="";try{t instanceof Error?i=t.msg:void 0!==t&&(i=JSON.stringify(t))}catch(QB){console.log("err",QB)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(i," ")}))}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats[sN].forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),i}(),uN=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=Sr(e),n=t.player,r=t.config;if(n.media.readyState!==HTMLMediaElement.HAVE_NOTHING){if(n.media.seeking){if(!e.seekingEventReceived)return}else e.seekingEventReceived=!1;if(!n.media.paused||0===n.media.currentTime||!e.hasPlayed){var o=n.media.buffered,a=r.smallGapLimit||.5,s=r.gapDetectionThreshold||.3,l=n.media.currentTime,c=e._getIndex(o,l,s);if(null!==c&&0!==c){console.log("GapJump bufferRange ",o.start(c),o.end(c));var u=o.start(c)+.1;if(!(u>n.media.duration)){var h=u-l,d=h<=a;h<i.BROWSER_GAP_TOLERANCE||d&&(!1!==r.useGapJump&&(n.media.currentTime=e.isSafari?u+.1:u),e.player&&e.player.emit("detectGap"),console.log("gapJump gapIndex",c," isGapSamll:",d," currentTime:",n.media.currentTime," jumpSize:",l-n.media.currentTime),.08!==u&&n&&n.emit("log",{type:"oneevent",end_type:"gap",vid:n.config.vid,ext:{video_postion:Math.floor(1e3*u)}}))}}}}})),e}return vr(i,[{key:"afterCreate",value:function(){var e=this;!1!==this.config.useGapJump&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(io,this.onGapJump),this.on($r,(function(){e.hasPlayed=!0})),this.on(Jr,(function(){e.seekingEventReceived=!0})))}},{key:"_getIndex",value:function(e,t,i){if(!e||!e.length)return null;if(1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var n=this._getBuffered(e),r=null,o=0;o<n.length;o++){if(n[o].start>t&&(0===o||n[o-1].end-t<=i)){r=o;break}}return r}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),i}();uN.BROWSER_GAP_TOLERANCE=.001;var hN=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=Sr(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),mr(Sr(e),"onJump",(function(){var t=Sr(e),i=t.player,n=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>n.jumpCntMax||!1===n.useWaitingTimeoutJump||i.media.paused&&0!==i.media.currentTime&&e.hasPlayed)){e.jumpSize=n.jumpSize*(e.jumpCnt+1),e.jumpCnt===n.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var r=i.currentTime+e.jumpSize;r>i.media.duration||(e.jumpCnt++,i.currentTime=r)}})),e}return vr(i,[{key:"afterCreate",value:function(){var e=this,t=this.config,i=t.useWaitingTimeoutJump,n=t.jumpSize;!1!==i&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=n,this.on(io,this.onWaiting),this.on([Xr,no],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on($r,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),i}(),dN="cdn",fN=["cdn"],pN=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"getSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dN;if(!e.speedListCache||!e.speedListCache[t])return 0;if(e.speedListCache[t].length<=0)return 0;var i=0;return e.speedListCache[t].map((function(e){i+=e})),Math.floor(i/e.speedListCache[t].length)})),mr(Sr(e),"startTimer",(function(){Ur.isMSE(e.player.video)||(e.initSpeedList(),e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),mr(Sr(e),"initSpeedList",(function(){e.speedListCache={},fN.forEach((function(t){e.speedListCache[t]=[]}))})),mr(Sr(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.type||dN)})),mr(Sr(e),"testSpeed",(function(){if(clearTimeout(e.timer),e.timer=null,e.player&&e.config.openSpeed){var t=e.config,i=t.url,n=t.loadSize,r=t.testCnt,o=t.testTimeStep,a=i+(i.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(e.cnt>=r)){e.cnt++;try{var s=(new Date).getTime(),l=null,c=new XMLHttpRequest;e.xhr=c,c.open("GET",a);var u={},h=Math.floor(10*Math.random());u.Range="bytes="+h+"-"+(n+h),u&&Object.keys(u).forEach((function(e){c.setRequestHeader(e,u[e])})),c.onreadystatechange=function(){if(4===c.readyState){e.xhr=null,l=(new Date).getTime();var t=c.getResponseHeader("Content-Length")/1024*8,i=Math.round(1e3*t/(l-s));e.appendList(i),e.timer=setTimeout(e.testSpeed,o)}},c.send()}catch(hs){console.error(hs)}}}})),mr(Sr(e),"appendList",(function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dN;if(e.speedListCache&&e.speedListCache[i]){var n=e.config.saveSpeedMax;e.speedListCache[i].length>=n&&e.speedListCache[i].shift(),e.speedListCache[i].push(t);var r=Sr(e).player;r&&(i===dN?r.realTimeSpeed=t:r[e.getSpeedName("realTime",i)]=t),e.updateSpeed(i)}})),mr(Sr(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dN,i=e.getSpeed(t),n=Sr(e).player;if(n)if(t===dN)n.avgSpeed&&i===n.avgSpeed||(n.avgSpeed=i,n.emit(So,{speed:i,realTimeSpeed:n.realTimeSpeed}));else{var r=e.getSpeedName("avg",t);n[r]&&i===n[r]||(n[r]=i,n.emit(So,{speed:i,realTimeSpeed:n.realTimeSpeed}))}})),e}return vr(i,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,i=e.addSpeedTypeList;(null==i?void 0:i.length)>0&&fN.push.apply(fN,Ir(i)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,t&&this.on([ao,_o],this.startTimer)}},{key:"getSpeedName",value:function(e,t){return e+"Speed"+t.toUpperCase()}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer)return clearTimeout(this.timer),void(this.timer=null);if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){var e=this;this.off("real_time_speed",this._onRealSpeedChange),this.off([ao,_o],this.startTimer),fN.forEach((function(t){e.speedListCache&&e.speedListCache[t]&&(e.speedListCache[t]=[])})),this.speedListCache&&(this.speedListCache={}),clearTimeout(this.timer),this.timer=null,this.xhr&&4!==this.xhr.readyState&&(this.xhr.cancel&&this.xhr.cancel(),this.xhr=null)}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:204800,testTimeStep:3e3,url:"",saveSpeedMax:5,addSpeedTypeList:[]}}}]),i}(),gN=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"afterCreate",value:function(){var e=this,t=this.player,i=this.config,n=t.media||t.video;(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],i.disabled)||n.getVideoPlaybackQuality&&(this.on($r,(function(){e._startTick()})),this.on(Zr,(function(){e._stopTick()})),this.on(qr,(function(){e._stopTick()})),this.on(uo,(function(){e._stopTick()})))}},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._timer=setTimeout((function(){e._checkDecodeFPS(),e._startTick()}),this.config.tick)}},{key:"_stopTick",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"_checkBuffer",value:function(e,t){for(var i=!1,n=[],r=0;r<t.length;r++){var o=t.start(r),a=t.end(r);if(n.push({start:o,end:a}),o<=e&&e<=a-1){i=!0;break}}return{enoughBuffer:i,buffers:n}}},{key:"_checkStuck",value:function(e,t,i,n){var r=this.player.media||this.player.video,o=document.hidden,a=r.paused,s=r.readyState,l=r.currentTime,c=r.buffered;if(!(o||a||s<4)){var u=this._checkBuffer(l,c),h=u.enoughBuffer,d=u.buffers;h&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:l,buffers:d,curDecodedFrames:e,totalVideoFrames:t,droppedVideoFrames:i,checkInterval:n}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(Wo,this._payload),this._reset())):this._reset())}}},{key:"_reset",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_checkDecodeFPS",value:function(){var e=this.player.media||this.player.video;if(e){var t=e.getVideoPlaybackQuality(),i=t.totalVideoFrames,n=t.droppedVideoFrames,r=performance.now();if(i&&this._lastCheckPoint){var o=i-this._lastDecodedFrames,a=r-this._lastCheckPoint;this._checkStuck(o,i,n,a)}this._lastDecodedFrames=i,this._lastCheckPoint=r}}},{key:"destroy",value:function(){this._stopTick()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),i}();const yN=class extends ba{static get pluginName(){return"poster"}static get defaultConfig(){return{isEndedShow:!0,hideCanplay:!1,notHidden:!1,poster:"",fillMode:"fixWidth"}}set isEndedShow(e){this.config.isEndedShow=e}get isEndedShow(){return this.config.isEndedShow}hide(){Ur.addClass(this.root,"hide")}show(){return Ur.removeClass(this.root,"hide"),""}beforeCreate(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}afterCreate(){this.on(qr,(()=>{this.isEndedShow&&Ur.removeClass(this.root,"hide")})),this.config.hideCanplay?(this.once(to,(()=>{this.onTimeUpdate()})),this.on(To,(()=>{Ur.removeClass(this.root,"hide"),Ur.addClass(this.root,"xg-showplay"),this.once(to,(()=>{this.onTimeUpdate()}))}))):this.on($r,(()=>{Ur.addClass(this.root,"hide")}))}onTimeUpdate(){this.player.currentTime?Ur.removeClass(this.root,"xg-showplay"):this.once(to,(()=>{this.onTimeUpdate()}))}update(e){e&&(this.config.poster=e,this.root.style.backgroundImage=`url(${e})`)}setConfig(e){"string"==typeof e?this.config.poster=e:"object"==typeof e&&Object.keys(this.config).forEach((t=>{Object.keys(e).includes(t)&&(this.config[t]=e[t])})),this.update(this.config.poster)}getBgSize(e){let t="";switch(e){case"cover":t="cover";break;case"contain":t="contain";break;case"fixHeight":t="auto 100%";break;case"fixWidth":t="100% auto";break;default:t=""}return t?`background-size: ${t};`:""}render(){const{poster:e,hideCanplay:t,fillMode:i,notHidden:n}=this.config,r=this.getBgSize(i);return`<xg-poster class="xgplayer-poster ${n?"xg-not-hidden":t?"xg-showplay":""} ${e?"active":""}" style="${e?`background-image:url(${e});${r}`:r}">\n </xg-poster>`}};La.use({LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}});class vN{constructor(e,t){const i=t&&"mobile"===t.isMobileSimulateMode,{isLive:n}=t,r=[...n?[]:[TL,dL,tN,QL,EL],pL,_L,PL,NL,jL,VL,FL,HL,kL,OL],o=[mO,yN,bO,lL,CO,YL,zL,JL,UO];this.plugins=[cN,yO,...r,...o,uN,hN];const a=i?"mobile":Kr.device;switch(a){case"pc":this.plugins.push(aL,HO,GL,pN,gN);break;case"mobile":this.plugins.push(nL);break;default:this.plugins.push(aL,HO,GL)}(Kr.os.isIpad||"pc"===a)&&this.plugins.push(aN),this.ignores=[],this.i18n=[]}}function mN(e,t){return d(this,arguments,(function*({isLive:e=!1,streamType:t,isMobile:i=!1,getSoftOptionTask:n,playerData:r},o){const a=[vN,_N()],{openSoftDecoding:s,isMusic:l}=r,c=[],u=[];if(i?a.push(function({isLive:e,playerData:t}){const i=["error","playbackRate"],n=t.configs,r=zs(n,"EncryptHlsPlugin");(null==r?void 0:r.playAuthToken)||i.push("definition");const o=[uR];return class{constructor(){this.plugins=o,this.ignores=[...i]}}}({isLive:e,playerData:o.playerData})):a.push(function({isLive:e,playerData:t}){const i=["cssfullscreen"],n=[QA],r=t.configs,o=zs(r,"EncryptHlsPlugin");(null==o?void 0:o.playAuthToken)||(i.push("definition"),n.push(WA));return class{constructor(){this.plugins=n,this.ignores=[...i]}}}({isLive:e,playerData:o.playerData})),"flv"===t)u.push((()=>d(this,null,(function*(){if(i){if(Zs()||Qs()||s){const e=yield o.sdkUmdLoader.loadPlugins(Fw.FLV);c.push(e)}}else{const e=yield o.sdkUmdLoader.loadPlugins(Fw.FLV);c.push(e)}})))());zs(o.playerData.options,"Subtitle")&&o.playerData.plugins.every((e=>"subtitle"!==e.pluginName.toLowerCase()))&&c.push(aO);const[h,f]=yield Promise.all([n(),EN({playerData:o.playerData},o),...u]);return{presets:a,softDecodingOption:h,plugins:[...c,...f].filter(Boolean)}}))}function _N(e){const t=[RR,sO,lR];return class{constructor(){this.plugins=t,this.ignores=["error"]}}}function EN(e,t){return d(this,arguments,(function*({playerData:e},t){var i,n,r;const o=[];e.options,e.drmType,or.DRM_ENCRYPT;const a=(yield null==(r=null==(n=null==(i=t.playerData)?void 0:i.adapter)?void 0:n.getPlugins)?void 0:r.call(n,t.sdkUmdLoader))||[];return o.push(...a),Boolean(Aw()||Bs())&&o.push(Nw),e.enableMenu&&o.push(xR),o}))}function TN(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="0" height="0"/>\n',"image/svg+xml").firstChild}function SN(){return(new DOMParser).parseFromString('<svg width="72" height="72" viewBox="0 0 72 72" xmlns="http://www.w3.org/2000/svg"><g fill="#FFF" fill-rule="evenodd"><circle fill-opacity=".3" cx="36" cy="36" r="36"/><path d="M40.167 32.667a.833.833 0 01-.834-.834v-1.666c0-.46.373-.834.834-.834h5.409a11.653 11.653 0 00-9.576-5c-6.443 0-11.667 5.224-11.667 11.667S29.557 47.667 36 47.667c5.285 0 9.749-3.514 11.183-8.333h3.445C49.112 46.014 43.138 51 36 51c-8.284 0-15-6.716-15-15 0-8.284 6.716-15 15-15 4.713 0 8.918 2.173 11.668 5.572l-.001-4.739c0-.46.373-.833.833-.833h1.667c.46 0 .833.373.833.833V31c0 .879-.68 1.598-1.542 1.662l-.125.005h-9.166z"/></g></svg>',"image/svg+xml").firstChild}function bN(){return(new DOMParser).parseFromString('<svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="60" height="60" rx="30" fill="#000" fill-opacity=".4"/><path d="M40.243 28.3a2 2 0 010 3.401L24.06 41.712c-1.332.825-3.052-.134-3.052-1.7V19.988c0-1.566 1.72-2.525 3.052-1.7l16.184 10.01z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function CN(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.867 2.5h.55c.44 0 .799.34.83.771l.003.062v13.334c0 .44-.34.799-.771.83l-.062.003h-.55a.833.833 0 01-.444-.128l-.064-.045-4.867-3.744a.831.831 0 01-.322-.59l-.003-.07V7.077c0-.235.099-.458.271-.615l.054-.045L9.36 2.673a.832.832 0 01.43-.17l.078-.003h.55-.55zm6.767 2.278A7.474 7.474 0 0118.75 10a7.477 7.477 0 01-2.128 5.234.4.4 0 01-.57-.004l-.587-.586a.442.442 0 01.005-.617A5.812 5.812 0 0017.083 10c0-1.557-.61-2.97-1.603-4.017a.442.442 0 01-.003-.615l.586-.586a.4.4 0 01.57-.004zM2.5 6.667c.23 0 .417.186.417.416v5.834c0 .23-.187.416-.417.416h-.833a.417.417 0 01-.417-.416V7.083c0-.23.187-.416.417-.416H2.5zm11.768.46A4.153 4.153 0 0115.417 10c0 1.12-.442 2.137-1.162 2.886a.388.388 0 01-.555-.007l-.577-.578c-.176-.176-.156-.467.009-.655A2.49 2.49 0 0013.75 10a2.49 2.49 0 00-.61-1.636c-.163-.188-.182-.477-.006-.653l.578-.578a.388.388 0 01.556-.006z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function kN(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.045 2.5h.55c.44 0 .8.34.831.771l.003.062v13.334c0 .44-.34.799-.771.83l-.063.003h-.55a.833.833 0 01-.443-.128l-.065-.045-4.866-3.744a.831.831 0 01-.323-.59l-.003-.07V7.077c0-.235.1-.458.272-.615l.054-.045 4.866-3.744a.832.832 0 01.43-.17l.078-.003h.55-.55zM2.68 6.667c.23 0 .416.186.416.416v5.834c0 .23-.186.416-.416.416h-.834a.417.417 0 01-.416-.416V7.083c0-.23.186-.416.416-.416h.834zm10.467.294a.417.417 0 01.59 0l1.767 1.768L17.27 6.96a.417.417 0 01.589 0l.59.59a.417.417 0 010 .589L16.68 9.908l1.768 1.767c.15.15.162.387.035.55l-.035.04-.589.589a.417.417 0 01-.59 0l-1.767-1.768-1.768 1.768a.417.417 0 01-.59 0l-.588-.59a.417.417 0 010-.589l1.767-1.768-1.767-1.767a.417.417 0 01-.035-.55l.035-.04.589-.589z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function IN(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.867 2.5h.55c.44 0 .799.34.83.771l.003.062v13.334c0 .44-.34.799-.771.83l-.062.003h-.55a.833.833 0 01-.444-.128l-.064-.045-4.867-3.744a.831.831 0 01-.322-.59l-.003-.07V7.077c0-.235.099-.458.271-.615l.054-.045L9.36 2.673a.832.832 0 01.43-.17l.078-.003h.55-.55zM2.5 6.667c.23 0 .417.186.417.416v5.834c0 .23-.187.416-.417.416h-.833a.417.417 0 01-.417-.416V7.083c0-.23.187-.416.417-.416H2.5zm11.768.46A4.153 4.153 0 0115.417 10c0 1.12-.442 2.137-1.162 2.886a.388.388 0 01-.555-.007l-.577-.578c-.176-.176-.156-.467.009-.655A2.49 2.49 0 0013.75 10a2.49 2.49 0 00-.61-1.636c-.163-.188-.182-.477-.006-.653l.578-.578a.388.388 0 01.556-.006z" fill="#fff"/></svg>',"image/svg+xml").firstChild}const PN=u(c({startPlay:bN,play:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.121 8.299a2 2 0 010 3.402l-7.94 4.91c-1.332.825-3.051-.133-3.051-1.7V5.09c0-1.567 1.72-2.525 3.052-1.701l7.939 4.911z" fill="#fff"/></svg>',"image/svg+xml").firstChild},pause:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="5.313" y="3.75" width="3.125" height="12.5" rx=".625" fill="#fff"/><rect x="11.563" y="3.75" width="3.125" height="12.5" rx=".625" fill="#fff"/></svg>',"image/svg+xml").firstChild},fullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.778 2h4.444v1.778H3.778v4.444H2V3.778C2 2.796 2.796 2 3.778 2zM2 11.778v4.444C2 17.204 2.796 18 3.778 18h4.444v-1.778H4.823l2.313-2.313a.9.9 0 00-1.272-1.273l-2.086 2.086v-2.944H2zm14.222 0v4.444h-4.444V18h4.444c.982 0 1.778-.796 1.778-1.778v-4.444h-1.778zM18 8.222V3.778C18 2.796 17.204 2 16.222 2h-4.444v1.778h2.945l-2.587 2.586a.9.9 0 101.273 1.273l2.813-2.813v3.398H18z" fill="#fff"/></svg>',"image/svg+xml").firstChild},exitFullscreen:function(){return(new DOMParser).parseFromString('<svg width="21" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.892 2h4.445v1.778H3.892v4.444H2.114V3.778C2.114 2.796 2.91 2 3.892 2zm4.445 16v-4.444c0-.982-.796-1.778-1.778-1.778H2.114v1.778h2.944L2.264 16.35a.9.9 0 001.272 1.273l2.988-2.987a.918.918 0 00.035-.037V18h1.778zm8-6.222v4.444h-4.445V18h4.445c.981 0 1.777-.796 1.777-1.778v-4.444h-1.777zM11.892 2v4.445c0 .981.796 1.777 1.778 1.777h4.444V6.445H15.17l2.568-2.568a.9.9 0 10-1.273-1.273L13.67 5.4V2h-1.778z" fill="#fff"/></svg>',"image/svg+xml").firstChild},playNext:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.03 8.312a2 2 0 010 3.376l-7.642 4.858c-1.332.847-3.073-.11-3.073-1.687V5.14c0-1.577 1.741-2.534 3.073-1.687l7.642 4.858z" fill="#fff"/><path d="M13 3.5a.5.5 0 01.5-.5h1a.5.5 0 01.5.5v13a.5.5 0 01-.5.5h-1a.5.5 0 01-.5-.5v-13z" fill="#fff"/></svg>',"image/svg+xml").firstChild},replay:SN,refresh:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 2.488a7.48 7.48 0 00-4.154 1.253.908.908 0 101.005 1.512 5.695 5.695 0 018.844 4.746h-.908a.33.33 0 00-.264.528l1.816 2.422a.33.33 0 00.529 0l1.815-2.422A.33.33 0 0018.42 10h-.908A7.511 7.511 0 0010 2.49zM2.489 10a7.511 7.511 0 0011.665 6.26.908.908 0 00-1.005-1.513A5.695 5.695 0 014.305 10h.908a.33.33 0 00.264-.528L3.66 7.05a.33.33 0 00-.528 0L1.317 9.47a.33.33 0 00.264.53h.908z" fill="#fff"/></svg>',"image/svg+xml").firstChild}},{}),{volumeLarge:CN,volumeMuted:kN,volumeSmall:IN}),DN={whitelist:[""],widescreen:!0,width:"100%",height:"100%",lang:$s(),fitVideoSize:!1,inactive:2e3,playsinline:!0,keyShortcut:"off",closeVideoClick:!0,closeVideoDblclick:!0,closePlayerBlur:!1,closeControlsBlur:!1,closePlayVideoFocus:!0,leavePlayerTime:0,mini:!1,pip:{position:"controlsRight",index:2.5,showIcon:!0},volume:{index:2.6},miniscreen:{left:window.innerWidth-360,top:window.innerHeight-450},time:{index:3},icons:c({},PN),flv:{retryCount:0,preferMMS:!0,preferMMSStreaming:!0},hls:{retryCount:3,allowedStreamTrackChange:!1,preferMMS:!0,preferMMSStreaming:!0},Mp4EncryptPlayer:{retryCount:3},DASHPlugin:{disableBufferBreakCheck:!1},gapJump:{smallGapLimit:1},EncryptHlsPlugin:{preferMMS:!0,preferMMSStreaming:!0}},wN={isLive:!0,closeVideoClick:!0,autoplay:!0,autoplayMuted:!0,preloadTime:8,start:{isShowPause:!1,isShowEnd:!1,mode:"hide",disableAnimate:!0},retry:{count:0}},AN={isLive:!1,closeVideoClick:!1,defaultPlaybackRate:1,closeVideoStopPropagation:!0,autoplay:!1,autoplayMuted:!1,playbackRate:[2,1.5,1.25,{rate:1,iconText:{zh:"倍速",en:"Speed",jp:"Speed"}},.75,.5],start:{isShowPause:!0,isShowEnd:!1,mode:"hide",disableAnimate:!0},progresspreview:{isShowCoverPreview:!0},progress:{isPauseMoving:!0}};const RN=u(c({startPlay:bN,play:function(){return(new DOMParser).parseFromString('<svg style="\n height: 18px;\n width: 18px;\n" width="28" height="28" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg"><path d="M19.77 11.619c1.768 1.094 1.768 3.668 0 4.762L8.653 23.257c-1.865 1.154-4.273-.188-4.273-2.381V7.125c0-2.194 2.408-3.536 4.273-2.382L19.77 11.62z" fill="#fff"/></svg>',"image/svg+xml").firstChild},pause:function(){return(new DOMParser).parseFromString('<svg style="\n height: 18px;\n width: 18px;\n" width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="7.438" y="5.25" width="4.375" height="17.5" rx=".875" fill="#fff"/><rect x="16.188" y="5.25" width="4.375" height="17.5" rx=".875" fill="#fff"/></svg>',"image/svg+xml").firstChild},fullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.125 3a.375.375 0 00-.375.375v.75c0 .207.168.375.375.375H15.5v3.375c0 .207.168.375.375.375h.75A.375.375 0 0017 7.875v-4.5A.375.375 0 0016.625 3h-4.5zm0 12.5a.375.375 0 00-.375.375v.75c0 .207.168.375.375.375h4.5a.375.375 0 00.375-.375v-4.5a.375.375 0 00-.375-.375h-.75a.375.375 0 00-.375.375V15.5h-3.375zM3 3.375C3 3.168 3.168 3 3.375 3h4.5c.207 0 .375.168.375.375v.75a.375.375 0 01-.375.375H4.5v3.375a.375.375 0 01-.375.375h-.75A.375.375 0 013 7.875v-4.5zM7.875 15.5H4.5v-3.375a.375.375 0 00-.375-.375h-.75a.375.375 0 00-.375.375v4.5c0 .207.168.375.375.375h4.5a.375.375 0 00.375-.375v-.75a.375.375 0 00-.375-.375z" fill="#fff"/></svg>\n',"image/svg+xml").firstChild},exitFullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M17.5 8.333h-4.167c-.92 0-1.666-.746-1.666-1.666V2.5h1.666v4.167H17.5v1.666zM2.5 6.667v1.666h4.167c.92 0 1.666-.746 1.666-1.666V2.5H6.667v4.167H2.5zM2.5 13.333h4.167V17.5h1.666v-4.167c0-.92-.746-1.666-1.666-1.666H2.5v1.666zM13.333 17.5v-4.167H17.5v-1.666h-4.167c-.92 0-1.666.746-1.666 1.666V17.5h1.666z" fill="#fff"/></svg>\n',"image/svg+xml").firstChild},playNext:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M4.77 4.124l8.358 5.07c.38.23.486.704.238 1.056a.807.807 0 01-.238.22L4.77 15.543c-.38.231-.889.132-1.137-.221a.723.723 0 01-.134-.417V4.762c0-.421.368-.762.822-.762.159 0 .316.042.449.124z" stroke="#fff" stroke-width="1.5"/><path d="M15.5 4.5A.5.5 0 0116 4h.5a.5.5 0 01.5.5v11a.5.5 0 01-.5.5H16a.5.5 0 01-.5-.5v-11z" fill="#fff"/></svg>',"image/svg+xml").firstChild},replay:SN,refresh:function(){return(new DOMParser).parseFromString('<svg width="18" height="18" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M0 0h18v18H0z"/><path d="M10.875 7.5a.375.375 0 01-.375-.375v-.75c0-.207.168-.375.375-.375h2.434a5.25 5.25 0 10.723 4.5h1.55a6.75 6.75 0 11-1.332-5.743V2.626c0-.207.168-.375.375-.375h.75c.207 0 .375.168.375.375V6.75a.75.75 0 01-.694.748L15 7.5h-4.125z" fill="#FFF"/></g></svg>',"image/svg+xml").firstChild}},{}),{volumeLarge:CN,volumeMuted:kN,volumeSmall:IN}),xN=u(c({width:"100%",height:"100%",lang:$s(),playsinline:!0,closeVideoClick:!0,closeVideoTouch:!0,whitelist:[""],"x5-video-player-type":"h5-page","x5-video-player-fullscreen":!1,"x5-video-orientation":"landscape|portrait",enterTips:{background:"linear-gradient(90deg,#000,#49e6d3,#49e6d3,#138afc,#000)"},retainPlay:!0,start:{isShowPause:!0,isShowEnd:!0,disableAnimate:!1},fullscreen:{useCssFullscreen:!1},plugins:[],time:{mode:"pc",index:2.5},controls:{mode:"flex"}},{}),{cusPlaybackRatePlugin:{needCheck:!0,needPanel:!1},icons:c({},RN),flv:{innerDegrade:1,retryCount:0,preferMMS:!0,preferMMSStreaming:!0},hls:{innerDegrade:1,retryCount:3,allowedStreamTrackChange:!1,preferMMS:!0,preferMMSStreaming:!0},Mp4EncryptPlayer:{retryCount:3},DASHPlugin:{disableBufferBreakCheck:!1},gapJump:{smallGapLimit:1},EncryptHlsPlugin:{preferMMS:!0,preferMMSStreaming:!0}}),ON={isLive:!0,closeVideoClick:!0,autoplay:!0,autoplayMuted:!0,start:{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"},retry:{count:0},longwaiting:{duration:3e4},mobile:{gestureY:!1,gestureX:!1,disableActive:!0}},LN={isLive:!1,closeVideoClick:!1,autoplay:!1,autoplayMuted:!1,playbackRate:[2,1.5,1.25,{rate:1,iconText:"倍速",en:"speed",jp:"speed"},.75,.5],defaultPlaybackRate:1,closeVideoStopPropagation:!0,mobile:{gestureY:!1},start:{isShowPause:!0,isShowEnd:!1,disableAnimate:!1,mode:"hide"}};const{POSITIONS:NN}=ba,MN=e=>{const t="mobile"===Kr.device,{pluginName:i=`ExtendPlugin${Math.random().toString().slice(-5)}`,type:n=(t?"inner":"normal"),position:r=NN.CONTROLS_LEFT,icon:o=TN,index:a=1,hideAtFullScreen:s=!0,tips:l={jp:"custom",en:"custom",zh:"自定义","zh-hk":"自定义"}}=e;return class extends ba{static get isExtendPlugin(){return!0}static get type(){return n}static get textTips(){return l}static get pluginName(){return i}static get defaultConfig(){return{position:r,index:a}}afterCreate(){var e;this.appendChild(".xgplayer-icon",this.icons[i]),this.initEvents(),s&&(null==(e=this.player)?void 0:e.fullscreen)&&this.handleFullScreenChange()}registerIcons(){return{[i]:{icon:o,class:"xgplayer-extendicon-svg"}}}updateIcons(e){const t=this.find(".xgplayer-icon");t&&(t.innerHTML=e)}registerLanguageTexts(){return{[i]:l}}initEvents(){var e;this.handleCallback=aA(this.handleCallback.bind(this),200);const t="mobile"===Kr.device?"touchend":"click";this.bind(t,this.handleCallback),this.show(),s&&(null==(e=this.player)||e.on(Io,this.handleFullScreenChange.bind(this)))}handleFullScreenChange(){var e;const t=this.player;null==(e=this.player)||e.changePluginsIcon(i,!(null==t?void 0:t.fullscreen))}handleCallback(e){const{player:t}=this;t&&(e.preventDefault(),e.stopPropagation(),t.emit(LA.PLAYER_EXTEND_BUTTON,i))}destroy(){var e;this.unbind(["touchend","click"],this.handleCallback),s&&(null==(e=this.player)||e.off(Io,this.handleFullScreenChange.bind(this)))}render(){return`\n <xg-icon class="xgplayer-extend-icon">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="${i}">${this.langText[i]}</div>\n </xg-icon>\n `}}};class UN{constructor(e){var t,i,n;const{config:r,root:o,player:a}=e;this.config=r,this.parent=o,this.player=a;let s=null!=(t=null==r?void 0:r.mode)?t:za.INNER;Object.values(za).includes(s)||(s=za.INNER),this.mode=s,this.isAutoChange=null!=(i=null==r?void 0:r.isAutoChange)&&i,this.isShow=!1,this.showCancelBtn=null!=(n=null==r?void 0:r.showCancelBtn)&&n,this.initEvents(),this.renderPanel()}initEvents(){var e;this.isAutoChange&&(window.addEventListener("orientationchange",this.handleOrientationChange.bind(this)),null==(e=this.player)||e.on(Io,this.handleOrientationChange.bind(this)))}handleOrientationChange(){var e,t,i;const n=[90,-90,"90","-90"].includes(window.orientation);(null==(e=this.player)?void 0:e.fullscreen)&&n?this.changeMode(za.FULLSCREEN):this.changeMode(null!=(i=null==(t=this.config)?void 0:t.mode)?i:za.INNER)}changeConfig(e){this.config=e}changeMode(e){this.mode=e,this.player.emit(LA.PANEL_MODE_CHANGE,{mode:e}),this.destroy(),this.renderPanel()}renderPanel(){const e=`xg-mobile-panel panel-${["normal","inner","fullscreen"][this.mode]}`;switch(this.root=Ur.createDom("div","",{},e),this.parent&&(this.parent.appendChild(this.root),this.hide()),this.bind("click",this.handleHide.bind(this)),this.mode){case za.NORMAL:{const e=Ur.createDom("div","",{},"xg-mobile-panel-content "+(this.showCancelBtn?"xg-mobile-panel-cancel-mode":""));if(this.root.appendChild(e),this.showCancelBtn){const e="zh-cn"===this.player.lang?"zh":this.player.lang,t=Ur.createDom("div",qa[e],{},"xg-mobile-panel-cancel");this.root.appendChild(t)}this.container=e,e.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()}));break}case za.INNER:this.container=this.root;break;case za.FULLSCREEN:{const e=Ur.createDom("div","",{},"xg-mobile-panel-content");this.root.appendChild(e),this.container=e,e.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()}));break}}}showPanel(e,t="",i=!1){return d(this,null,(function*(){if(i&&Ur.addClass(e,"item-list-panel-content"),this.setTitle(t),this.children)return yield this.hide(),void setTimeout((()=>{this.children=e,this.container&&(this.title&&this.container.appendChild(this.title),this.container.appendChild(e)),this.show()}));this.children=e,this.container&&(this.title&&this.container.appendChild(this.title),this.container.appendChild(e)),this.show()}))}updatePanel(e){this.children&&Ur.hasClass(this.children,"item-list-panel-content")&&Ur.addClass(e,"item-list-panel-content"),this.children=e,this.container&&(this.container.innerHTML="",this.title&&this.container.appendChild(this.title),this.container.appendChild(e))}setTitle(e){e&&this.mode!==za.INNER?this.title?this.title.innerHTML=e:this.title=this.renderTitle(e):this.title=void 0}renderTitle(e){return Ur.createDom("div",e,{},"xg-mobile-panel-title")}show(){this.isShow=!0,Ur.removeClass(this.root,"hide"),Ur.addClass(this.root,"active")}hide(){this.isShow=!1,Ur.removeClass(this.root,"active"),Ur.addClass(this.root,"hide"),this.container&&(this.container.innerHTML="")}handleHide(e){e.stopPropagation(),e.preventDefault(),this.hide()}bind(e,t,i=!1){this.root&&`on${e}`in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,i)}destroy(){var e;this.parent&&this.root&&this.parent.contains(this.root)&&(this.parent.removeChild(this.root),this.root=null),window.removeEventListener("orientationchange",this.handleOrientationChange.bind(this)),null==(e=this.player)||e.off(Io,this.handleOrientationChange.bind(this))}}function BN(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M16 3.8001H4C3.55817 3.8001 3.2 4.15827 3.2 4.6001V12.6001C3.2 13.0419 3.55817 13.4001 4 13.4001H16C16.4418 13.4001 16.8 13.0419 16.8 12.6001V4.6001C16.8 4.15827 16.4418 3.8001 16 3.8001ZM4 2.6001C2.89543 2.6001 2 3.49553 2 4.6001V12.6001C2 13.7047 2.89543 14.6001 4 14.6001H16C17.1046 14.6001 18 13.7047 18 12.6001V4.6001C18 3.49553 17.1046 2.6001 16 2.6001H4ZM5.0249 6.24509V11.6001H5.9024V9.23009H8.6174V11.6001H9.4949V6.24509H8.6174V8.48009H5.9024V6.24509H5.0249ZM10.5474 6.24509V11.6001H12.5049C13.3749 11.6001 14.0274 11.3601 14.4774 10.8801C14.9049 10.4226 15.1224 9.77009 15.1224 8.92259C15.1224 8.06759 14.9049 7.41509 14.4774 6.96509C14.0274 6.48509 13.3749 6.24509 12.5049 6.24509H10.5474ZM11.4249 6.99509H12.3399C13.0074 6.99509 13.4949 7.14509 13.8024 7.45259C14.1024 7.75259 14.2524 8.24759 14.2524 8.92259C14.2524 9.58259 14.1024 10.0701 13.8024 10.3851C13.4949 10.6926 13.0074 10.8501 12.3399 10.8501H11.4249V6.99509ZM4.15 16.1001C3.79101 16.1001 3.5 16.3911 3.5 16.7501C3.5 17.1091 3.79101 17.4001 4.15 17.4001H15.85C16.209 17.4001 16.5 17.1091 16.5 16.7501C16.5 16.3911 16.209 16.1001 15.85 16.1001H4.15Z" fill="#ffffff"/>\n</svg>',"image/svg+xml").firstChild}const{POSITIONS:FN}=ba;class HN extends(KA(ba)){constructor(e){super(u(c({},e),{clientType:"MOBILE"})),this.handleButtonChange=()=>{const e=this.renderItemList();this.renderPanel(e)}}static get pluginName(){return"DefinitionMobilePlugin"}static get textTips(){return{jp:"明快さ",en:"Definition",zh:"清晰度","zh-hk":"清晰度"}}static get defaultConfig(){return{position:FN.CONTROLS_RIGHT,index:3,showToastOnManualClick:!0,alwaysShowDefinition:!1}}afterCreate(){super.afterCreate()}refreshDefinitionList(){var e;const{current:{lineId:t}}=this.playerData,i=this.playerData.getDefinitionListByLineId(t);(null==(e=this.player.config)?void 0:e.alwaysShowDefinition)&&(this.config.alwaysShowDefinition=!0),i.length>1||this.config.alwaysShowDefinition?(this.appendChild(".xgplayer-icon",this.icons.definition),this.initEvents()):this.hide(),this.renderItemList()}registerIcons(){return{definition:{icon:BN,class:"xgplayer-definition-svg"}}}registerLanguageTexts(){return{definition:{jp:"明快さ",en:"Definition",zh:"清晰度","zh-hk":"清晰度"},definitionSelect:{jp:"クラリティセレクション",en:"Definition Choose",zh:"清晰度选择","zh-hk":"清晰度選擇"},switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}afterPlayerInit(){}initEvents(){this.unbind(["click"],this.handleButtonChange),this.bind(["click"],this.handleButtonChange)}renderItemList(){const{defaultDefinition:e,list:t}=this.getCurrentDefinitionInfo(this.player),i=Ur.createDom("div","",{},"definition-panel-content");return t.forEach((t=>{t.selected=e===t.definition,t.isDefinitionAuto=this.playerData.isAutoDefinition(t.definition);const n=this.renderItem(t);i.appendChild(n)})),this.renderList=t,i}renderItem(e){var t;const{current:{definition:i}}=this.playerData,n=Ur.createDom("div","",{},"panel-Item "+(i===e.definition?"select-in":""));let r=this.getShowText(this.i18n,e,i);if(this.showRealDefinition(e)){const e=null==(t=this.renderList)?void 0:t.find((e=>this.playerData.isDefinitionMatch(null==e?void 0:e.definition,this._autoRealDefinition))),i=this.getShowText(this.i18n,e,null==e?void 0:e.definition);r=i?`${r}(${i})`:r}return n.innerHTML=r,n.addEventListener("click",(t=>{var n;if(t.stopPropagation(),t.preventDefault(),e.definition!==this.playerData.current.definition){const r=null==(n=this.playerData.getCurrentStreams())?void 0:n[0];this.emitUserAction(t,"change_definition",{from:r,to:e}),this.config.showToastOnManualClick&&this.showToast(e,i),this.playerData.current.definition=e.definition}})),n}selectDef(e){this.selectDefinition(e)}changeDefinition(e){const t=this.renderList.find((t=>this.playerData.isDefinitionMatch(t.definition,e)));t&&this.selectDef(t)}renderPanel(e){var t,i;null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(e,this.langText.definitionSelect,!0)}updatePanel(){var e,t,i,n,r,o,a;if((null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&(null==(r=null==(n=null==(i=this.player)?void 0:i.panel)?void 0:n.title)?void 0:r.innerHTML)!==this.langText.definitionSelect)return;const s=this.renderItemList();null==(a=null==(o=this.player)?void 0:o.panel)||a.updatePanel(s)}destroy(){super.destroy(),this.unbind(["click"],this.handleButtonChange)}render(){return'\n <xg-icon class="xgplayer-mobile-definition">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}function jN(){return(new DOMParser).parseFromString('<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M12.7123 1C11.85 1 11.1173 1.55472 10.8516 2.32675L4.94973 2.32675C3.16413 2.32675 1.71662 3.77427 1.71662 5.55987C1.71662 7.34547 3.16413 8.79298 4.94973 8.79298L11.0483 8.79298L11.1134 8.79418C11.9936 8.82748 12.697 9.55166 12.697 10.44C12.697 11.3497 11.9596 12.0871 11.05 12.0871H5.01323C4.67882 11.4781 4.03143 11.0654 3.28763 11.0654C2.20111 11.0654 1.32031 11.9462 1.32031 13.0327C1.32031 14.1192 2.20111 15 3.28763 15C4.14992 15 4.88264 14.4452 5.14834 13.6732H11.05C12.8356 13.6732 14.2831 12.2256 14.2831 10.44C14.2831 8.65444 12.8356 7.20693 11.05 7.20693L4.94973 7.20693C4.04009 7.20693 3.30267 6.46951 3.30267 5.55987C3.30267 4.65022 4.04009 3.91281 4.94973 3.91281L10.9866 3.91281C11.321 4.52183 11.9685 4.93464 12.7123 4.93464C13.7988 4.93464 14.6796 4.05384 14.6796 2.96732C14.6796 1.8808 13.7988 1 12.7123 1ZM12.7123 2.18954C12.2827 2.18954 11.9345 2.53777 11.9345 2.96732C11.9345 3.39688 12.2827 3.7451 12.7123 3.7451C13.1418 3.7451 13.4901 3.39688 13.4901 2.96732C13.4901 2.53777 13.1418 2.18954 12.7123 2.18954ZM2.50986 13.0327C2.50986 12.6031 2.85808 12.2549 3.28763 12.2549C3.71719 12.2549 4.06541 12.6031 4.06541 13.0327C4.06541 13.4622 3.71719 13.8105 3.28763 13.8105C2.85808 13.8105 2.50986 13.4622 2.50986 13.0327Z" fill="#FFFFFF"/>\n</svg>',"image/svg+xml").firstChild}const{POSITIONS:VN}=ba;class KN extends ba{constructor(e){super(e),this.playerData=e.player.config.playerData,this.dataMonitoring()}static get pluginName(){return"LineMobilePlugin"}static get textTips(){return{jp:"ライン",en:"Line",zh:"线路","zh-hk":"線路"}}static get defaultConfig(){return{position:VN.CONTROLS_RIGHT,index:4}}dataMonitoring(){this.playerData&&hr.subscribeProperty(this.playerData.current,"definition",((e,t)=>{if(e!==t&&this.player){const e=this.playerData.getCurrentUrl();this.player.changeDefinition({definition:t,url:e}),this.updatePanel(),setTimeout((()=>{this.player.paused&&this.player.play()}),1e3)}}))}registerIcons(){return{line:{icon:jN,class:"xgplayer-line-svg"}}}registerLanguageTexts(){return{line:{jp:"ライン",en:"Line",zh:"线路","zh-hk":"線路"},lineSelect:{jp:"ライン選ぶ",en:"Line Choose",zh:"线路选择","zh-hk":"線路選擇"}}}afterCreate(){this.appendChild(".xgplayer-icon",this.icons.line),this.initEvents()}afterPlayerInit(){}initEvents(){this.bind(["click"],this.handleButtonChange.bind(this))}handleButtonChange(){const e=this.renderItemList();this.renderPanel(e)}renderItemList(){const e=this.playerData.getLineList(),t=Ur.createDom("div","",{},"line-panel-content");return e.forEach((e=>{const i=this.renderItem(e);t.appendChild(i)})),t}renderItem(e){const{current:{lineId:t}}=this.playerData,i=Ur.createDom("div","",{},"panel-Item "+(t===e.lineId?"select-in":""));return i.innerHTML=this.i18n[e.lineTextKey]||e.lineTextKey,i.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.player.emit(LA.LINE_CHANGE,{from:this.playerData.current.lineId,to:e.lineId}),this.playerData.current.lineId=e.lineId,this.player.emit(OA.PLAYER_REBUILD)})),i}renderPanel(e){var t,i;null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(e,this.langText.lineSelect,!0)}updatePanel(){var e;const t=this.renderItemList();null==(e=this.player)||e.panel.updatePanel(t)}destroy(){this.unbind(["click"],this.handleButtonChange.bind(this))}render(){return'\n <xg-icon class="xgplayer-mobile-line">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}function WN(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M14.6879 3.64579C14.7387 3.60575 14.7387 3.52868 14.6879 3.48864L13.3089 2.40296C13.2433 2.35132 13.147 2.39805 13.147 2.48153V4.6529C13.147 4.73639 13.2433 4.78312 13.3089 4.73147L14.6879 3.64579ZM4 2.61914H11.3001V3.91914H4C3.6134 3.91914 3.3 4.23254 3.3 4.61914V15.6191C3.3 16.0057 3.6134 16.3191 4 16.3191H16C16.3866 16.3191 16.7 16.0057 16.7 15.6191V6.75253H18V15.6191C18 16.7237 17.1046 17.6191 16 17.6191H4C2.89543 17.6191 2 16.7237 2 15.6191V4.61914C2 3.51457 2.89543 2.61914 4 2.61914ZM17.7879 3.48864C17.8388 3.52868 17.8388 3.60575 17.7879 3.64579L16.4089 4.73147C16.3433 4.78312 16.2471 4.73639 16.2471 4.6529V2.48153C16.2471 2.39805 16.3433 2.35132 16.4089 2.40296L17.7879 3.48864Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}const{POSITIONS:GN}=ba;class YN extends ba{constructor(e){super(e),this.state={currentRate:1,isSupport:!0},this.playerData=e.player.config.playerData}static get pluginName(){return"PlaybackRateMobilePlugin"}static get textTips(){return{jp:"倍速",en:"PlaybackRate",zh:"倍速","zh-hk":"倍速"}}static get defaultConfig(){return{position:GN.CONTROLS_RIGHT,index:5,list:[2,1.5,1.25,1,.75,.5],default:1}}registerIcons(){return{playbackRate:{icon:WN,class:"xgplayer-rate-svg"}}}registerLanguageTexts(){return{rate:{jp:"倍速",en:"PlaybackRate",zh:"倍速","zh-hk":"倍速"},rateSelect:{jp:"倍速選ぶ",en:"PlaybackRate",zh:"倍速选择","zh-hk":"倍速選擇"}}}afterCreate(){this.appendChild(".xgplayer-icon",this.icons.playbackRate),this.initEvents(),this.state.currentRate=this.player.playbackRate||1,this.changeIconText()}afterPlayerInit(){}initEvents(){this.bind(["click"],this.renderList.bind(this)),this.on(so,(()=>{var e,t;this.state.currentRate!==this.player.playbackRate&&(this.state.currentRate=this.player.playbackRate,(null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&this.updatePanel(),this.changeIconText())}))}renderList(){const e=this.renderItemList();this.renderPanel(e)}renderItemList(){const e=Ur.createDom("div","",{},"playbackRate-panel-content");return this.config.list.forEach((t=>{const i=this.renderItem(t);e.appendChild(i)})),e}renderItem(e){const t=A(e)?e:{textKey:e+"X",value:e},i=Ur.createDom("div","",{},"panel-Item "+(this.state.currentRate===t.value?"select-in":""));return i.innerHTML=this.i18n[t.textKey]||t.textKey,i.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault();const i={playbackRate:{from:this.player.playbackRate,to:t.value}};this.emitUserAction(e,"change_rate",{props:i}),this.state.currentRate=t.value,this.player.playbackRate=t.value,this.updatePanel(),this.changeIconText()})),i}renderPanel(e){var t,i;null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(e,this.langText.rateSelect,!0)}updatePanel(){var e;const t=this.renderItemList();null==(e=this.player)||e.panel.updatePanel(t)}changeIconText(){let e;const t=this.state.currentRate,i=t%1==0?t.toFixed(1):t+"";switch(i.length){case 1:case 2:case 3:default:e=.7;break;case 4:e=.5}const n=this.find(".icon-text");n.style.transform=`scale(${e})`,n.innerHTML=i}destroy(){this.unbind(["click"],this.renderList.bind(this))}render(){return'\n <xg-icon class="xgplayer-mobile-playBackRate">\n <div class="xgplayer-icon">\n <div class="icon-text"></div>\n </div>\n </xg-icon>\n '}}function zN(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M16.8881 11.8208C16.812 11.6153 16.5213 11.6153 16.4452 11.8208L16.0985 12.7579C15.8115 13.5334 15.2001 14.1448 14.4246 14.4318L13.4875 14.7786C13.2819 14.8546 13.2819 15.1454 13.4875 15.2214L14.4246 15.5682C15.2001 15.8551 15.8115 16.4666 16.0985 17.2421L16.4452 18.1792C16.5213 18.3847 16.812 18.3847 16.8881 18.1792L17.2348 17.2421C17.5218 16.4666 18.1332 15.8551 18.9087 15.5682L19.8458 15.2214C20.0514 15.1454 20.0514 14.8546 19.8458 14.7786L18.9087 14.4318C18.1332 14.1448 17.5218 13.5334 17.2348 12.7579L16.8881 11.8208Z" fill="white"/>\n<rect x="9.5" y="2" width="1.5" height="16" rx="0.75" fill="white"/>\n<rect x="5.75" y="5" width="1.5" height="10" rx="0.75" fill="white"/>\n<rect x="2" y="7" width="1.5" height="6" rx="0.75" fill="white"/>\n<path d="M16.5 7.75C16.5 7.33579 16.8358 7 17.25 7C17.6642 7 18 7.33579 18 7.75V9.18934C18 9.85752 17.1921 10.1921 16.7197 9.71967C16.579 9.57902 16.5 9.38825 16.5 9.18934V7.75Z" fill="white"/>\n<path d="M12.75 5.75C12.75 5.33579 13.0858 5 13.5 5C13.9142 5 14.25 5.33579 14.25 5.75V11.3229C14.25 11.4394 14.2229 11.5542 14.1708 11.6584C13.8169 12.3662 12.75 12.1144 12.75 11.3229V5.75Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}const{POSITIONS:$N}=ba;class XN extends ba{constructor(){super(...arguments),this._nativeMode=!1,this._nativeAddTrackHandler=null,this._nativeChangeHandler=null,this._nativeRemoveTrackHandler=null,this._clickHandler=null,this._nativePanelUpdateRaf=null}static get pluginName(){return"AudioTrackMobile"}static get textTips(){return{en:"Audio",zh:"音频","zh-hk":"音頻",jp:"オーディオ"}}static get defaultConfig(){return{position:$N.CONTROLS_RIGHT,index:2.6,isShowIcon:!0,showNameSuffix:!0}}registerIcons(){return{audiotrack:{icon:zN,class:"xgplayer-audiotrack-svg"}}}afterPlayerInit(){var e;this.on("hlsAudioTracksUpdated",(e=>{this._onAudioTracksUpdated(e.audioTracks)})),this.on("hlsAudioTrackSwitched",(e=>{var t,i;(null==(i=null==(t=this.player)?void 0:t.panel)?void 0:i.isShow)&&this._updateHlsPanel(e.id)}));const t=this._getHls();(null==(e=null==t?void 0:t.audioTracks)?void 0:e.length)>1?this._onAudioTracksUpdated(t.audioTracks):t||this._initNativeAudioTracks()}destroy(){this._clickHandler&&this.unbind(["click"],this._clickHandler),null!==this._nativePanelUpdateRaf&&cancelAnimationFrame(this._nativePanelUpdateRaf),this._unbindNativeAudioTracks()}render(){return this.config.isShowIcon?'\n <xg-icon class="xgplayer-mobile-audiotrack">\n <div class="xgplayer-icon"></div>\n </xg-icon>\n ':""}_getHls(){var e,t;const i=this.player.plugins;return(null==(e=null==i?void 0:i.encrypthlsplugin)?void 0:e.hls)||(null==(t=null==i?void 0:i.hls)?void 0:t.hls)}_getNativeTrackList(){var e,t;return null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks}_onAudioTracksUpdated(e){!e||e.length<=1||this._bindClickOnce()}_renderList(){this._nativeMode?this._renderNativePanel():this._renderHlsPanel()}_getLabelOpts(){return{showNameSuffix:!1!==this.config.showNameSuffix}}_renderHlsPanel(){var e,t,i;const n=this._getHls();if(!n)return;const r=n.audioTracks;if(!(null==r?void 0:r.length))return;const o=null!=(e=n.audioTrack)?e:-1,a=r.find((e=>e.default)),s=this._getLabelOpts(),l=Ur.createDom("div","",{},"audiotrack-panel-content");r.forEach((e=>{let t=e.id===o;t||-1!==o||(null==a?void 0:a.id)!==e.id||(t=!0);const i=Ur.createDom("div","",{},"panel-Item "+(t?"select-in":""));i.innerHTML=qA(e,s),i.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this._switchHlsTrack(n,e)})),l.appendChild(i)})),null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(l,this._panelTitle(),!0)}_updateHlsPanel(e){var t,i;const n=this._getHls();if(!n)return;const r=n.audioTracks;if(!(null==r?void 0:r.length))return;const o=this._getLabelOpts(),a=Ur.createDom("div","",{},"audiotrack-panel-content");r.forEach((t=>{const i=Ur.createDom("div","",{},"panel-Item "+(t.id===e?"select-in":""));i.innerHTML=qA(t,o),i.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault(),this._switchHlsTrack(n,t)})),a.appendChild(i)})),null==(i=null==(t=this.player)?void 0:t.panel)||i.updatePanel(a)}_switchHlsTrack(e,t){zA(e,t)}_initNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeMode=!0,this._nativeAddTrackHandler=()=>this._onNativeTracksChanged(),this._nativeChangeHandler=()=>{var e,t;(null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&null===this._nativePanelUpdateRaf&&(this._nativePanelUpdateRaf=requestAnimationFrame((()=>{var e,t;this._nativePanelUpdateRaf=null,(null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&this._renderNativePanel(!0)})))},this._nativeRemoveTrackHandler=()=>this._onNativeTracksChanged(),e.addEventListener("addtrack",this._nativeAddTrackHandler),e.addEventListener("change",this._nativeChangeHandler),e.addEventListener("removetrack",this._nativeRemoveTrackHandler),e.length>1&&this._onNativeTracksChanged())}_unbindNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeAddTrackHandler&&e.removeEventListener("addtrack",this._nativeAddTrackHandler),this._nativeChangeHandler&&e.removeEventListener("change",this._nativeChangeHandler),this._nativeRemoveTrackHandler&&e.removeEventListener("removetrack",this._nativeRemoveTrackHandler))}_bindClickOnce(){this._clickHandler||(this.appendChild(".xgplayer-icon",this.icons.audiotrack),this._clickHandler=this._renderList.bind(this),this.bind(["click"],this._clickHandler))}_onNativeTracksChanged(){const e=this._getNativeTrackList();!e||e.length<=1||this._bindClickOnce()}_renderNativePanel(e=!1){var t;const i=this._getNativeTrackList();if(!i)return;const n=this._getLabelOpts(),r=Ur.createDom("div","",{},"audiotrack-panel-content");for(let a=0;a<i.length;a++){const e=i[a],t=ZA(e,a,n),o=Ur.createDom("div","",{},"panel-Item "+(e.enabled?"select-in":""));o.innerHTML=t,o.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault();const t=this._getNativeTrackList();t&&YA(t,a)})),r.appendChild(o)}const o=null==(t=this.player)?void 0:t.panel;e?null==o||o.updatePanel(r):null==o||o.showPanel(r,this._panelTitle(),!0)}_panelTitle(){var e;return null!=(e=XN.textTips[this.player.lang||"en"])?e:XN.textTips.en}}class qN{constructor(e){this.__args=null,this.sdk=null,this.playerData=null,this.player=null,this._emitter=null,this.beforeCreate&&"function"==typeof this.beforeCreate&&this.beforeCreate(),this.__args=e,this.pluginName="",this.__init(e)}static defineGetterOrSetter(e,t){for(const i in t)Object.defineProperty(e,i,t[i])}static get pluginName(){return"pluginName"}beforeCreate(){}afterCreate(){}beforePlayerCreate(){}afterPlayerCreate(){}destroy(){}__init(e){qN.defineGetterOrSetter(this,{sdk:{get:()=>e.sdk,configurable:!0},player:{get:()=>e.sdk.getPlayerInstance(),configurable:!0},playerData:{get:()=>e.sdk.playerData,configurable:!0},pluginName:{get:()=>e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),configurable:!0},_emitter:{get:()=>e.sdk._emitter,configurable:!0}})}__destroy(){const e=this.sdk,t=this.pluginName;this.destroy&&"function"==typeof this.destroy&&this.destroy(),["sdk","player","playerData","pluginName","_emitter"].map((e=>{Object.defineProperty(this,e,{writable:!0})})),Object.keys(this).map((e=>{this[e]=null,delete this[e]})),Object.setPrototypeOf&&Object.setPrototypeOf(this,null),delete e._sdkPlugins[t]}}const ZN=18e5,QN=1e3,JN="media_info",eM="ttdrama_media_info",tM="[mediaInfoCache]";let iM=c({},{enable:!1,expireTime:ZN,cacheType:"memory",maxEntries:100});const nM=new Map;function rM(e,t={}){as.log(`${tM} ${e}`,t)}function oM(e){var t;return{vid:null==e?void 0:e.vid,playListLength:(null==(t=null==e?void 0:e.playList)?void 0:t.length)||0,hasValidPlayUrl:cM(e)}}function aM(){return c({},iM)}function sM(){const e=nM.size;nM.clear();const t=function(){const e=gM();if(!e)return 0;const t=[`${Is}${JN}_`,`${Is}${eM}_`],i=[];for(let n=0;n<e.length;n++){const r=e.key(n);r&&t.some((e=>r.startsWith(e)))&&i.push(r)}return i.forEach((t=>e.removeItem(t))),i.length}();rM("clear success",{memoryCacheCount:e,localStorageCacheCount:t})}function lM(e){return"string"==typeof e?e.trim():""}function cM(e){var t;return!!(null==(t=null==e?void 0:e.playList)?void 0:t.some((e=>!!(null==e?void 0:e.url))))}function uM(e){let t=5381;for(let i=0;i<e.length;i++)t=33*t^e.charCodeAt(i);return(t>>>0).toString(36)}function hM(e){const t=dM(e);return t.playAuthTokenHash?uM(JSON.stringify(t)):""}function dM(e){const t=lM(e.playAuthToken);return{playAuthTokenHash:t?uM(t):"",reqParams:fM(e.reqParams),urlQueryParams:e.urlQueryParams,needThumbs:e.needThumbs,needBarrageMask:e.needBarrageMask}}function fM(e){if(!e)return;const t=c({},e);return delete t.Vid,delete t.vid,Object.keys(t).length?t:void 0}const pM={getItem:e=>nM.get(e)||null,setItem(e,t){nM.delete(e),nM.set(e,t)},removeItem(e){nM.delete(e)}};function gM(){try{return"undefined"!=typeof localStorage?localStorage:null==window?void 0:window.localStorage}catch(hs){return}}function yM(e){return e.startsWith(`${Is}${JN}_`)||e.startsWith(`${Is}${eM}_`)}function vM(){if("memory"===iM.cacheType)return Array.from(nM.keys()).filter(yM);const e=gM();return e?function(e){const t=[];for(let i=0;i<e.length;i++){const n=e.key(i);n&&yM(n)&&t.push(n)}return t}(e):[]}function mM(){return"memory"===iM.cacheType?pM:gM()}function _M(e){try{return JSON.parse(e)}catch(hs){return}}function EM(e){const t=lM(e.moduleName),i=lM(e.cacheKey);return t&&i?`${Is}${t}_${i}`:""}function TM(e){const t=(e.playList||[]).map((e=>function(e){const t=Number(e);if(Number.isFinite(t)&&!(t<=0))return t>s(10,12)?t:1e3*t}(e.urlExpireTimestamp||e.MainUrlExpire||e.mainUrlExpire||e.main_url_expire))).filter((e=>!!e));if(t.length)return Math.min(...t)}function SM(e){return{moduleName:lM(e.moduleName),cacheKey:lM(e.cacheKey),cacheKeyInfo:e.cacheKeyInfo,cacheType:iM.cacheType}}function bM(e){const t=mM(),i=EM(e),n=SM(e);if(!t)return void rM("get skip no storage",n);if(!i)return void rM("get skip empty storage key",n);const r=t.getItem(i)||"";if(!r)return void rM("get miss empty cache",n);const o=_M(r);if(!o)return void rM("get miss parse failed",n);const a=null==o?void 0:o.mediaInfo;if(a&&o.expireAt)return Date.now()>=o.expireAt?(t.removeItem(i),void rM("get miss expired and removed",u(c({},n),{expireAt:o.expireAt,now:Date.now()}))):(rM("get hit",c(u(c({},n),{cacheKeyInfo:o.cacheKeyInfo,expireAt:o.expireAt,ttl:o.expireAt-Date.now()}),oM(a))),function(e,t,i,n){try{e.setItem(t,JSON.stringify(u(c({},i),{lastAccessedAt:Date.now()})))}catch(QB){rM("touch failed",u(c({},n),{error:QB}))}}(t,i,o,n),a);rM("get miss invalid cache payload",n)}function CM(e,t,i=ZN){const n=mM(),r=EM(e),o=SM(e);if(!n)return void rM("set skip no storage",c(c({},o),oM(t)));if(!r)return void rM("set skip empty storage key",c(c({},o),oM(t)));if(!cM(t))return void rM("set skip invalid media info",c(c({},o),oM(t)));const a=function(e,t){const i=Date.now()+t,n=TM(e);return n?Math.min(i,n-QN):i}(t,i);if(a<=Date.now())return void rM("set skip expired media info",c(u(c({},o),{expireTime:i,expireAt:a}),oM(t)));const s={createdAt:Date.now(),expireAt:a,lastAccessedAt:Date.now(),cacheKeyInfo:e.cacheKeyInfo,mediaInfo:t};try{n.setItem(r,JSON.stringify(s)),function(e){const t=vM(),i=iM.maxEntries;if(t.length<=i)return;const n=t.map((t=>{const i=_M(e.getItem(t)||"");return{key:t,lastAccessedAt:(null==i?void 0:i.lastAccessedAt)||(null==i?void 0:i.createdAt)||0}})).sort(((e,t)=>e.lastAccessedAt-t.lastAccessedAt)),r=t.length-i;n.slice(0,r).forEach((t=>e.removeItem(t.key))),rM("prune success",{removeCount:r,maxEntries:i,cacheType:iM.cacheType})}(n),rM("set success",c(u(c({},o),{cacheKeyInfo:s.cacheKeyInfo,expireTime:i,expireAt:a}),oM(t)))}catch(QB){rM("set failed",c(u(c({},o),{error:QB}),oM(t)))}}function kM(e){if(iM.enable)return function(e){return bM({moduleName:JN,cacheKey:hM(e),cacheKeyInfo:dM(e)})}(e)}function IM(e,t){iM.enable&&function(e,t,i=ZN){CM({moduleName:JN,cacheKey:hM(e),cacheKeyInfo:dM(e)},t,i)}(e,t,iM.expireTime)}let PM=!1;const DM=["url","src","_mainURL","_backupURL","backupUrl","MainPlayUrl","mainPlayUrl","main_play_url","BackupPlayUrl","backupPlayUrl","backup_play_url"];function wM(e,t){if(!e)return e;const i=e.indexOf("#"),n=-1===i?"":e.slice(i),r=-1===i?e:e.slice(0,i),o=r.indexOf("?"),a=-1===o?r:r.slice(0,o),s=-1===o?"":r.slice(o+1),l=s?s.split("&").filter((e=>{const t=e.split("=")[0];try{return"t"!==decodeURIComponent(t||"")}catch(hs){return"t"!==t}})):[];return l.push(`t=${encodeURIComponent(t)}`),`${a}?${l.join("&")}${n}`}function AM(e,t){return"string"==typeof e?wM(e,t):Array.isArray(e)?e.map((e=>"string"==typeof e?wM(e,t):e&&"object"==typeof e&&"string"==typeof e.src?u(c({},e),{src:wM(e.src,t)}):e)):e}function RM(e,t=Date.now()){if(!PM||!e)return e;const i=c({},e);return DM.forEach((e=>{i[e]&&(i[e]=AM(i[e],t))})),Array.isArray(i.backUrlList)&&(i.backUrlList=i.backUrlList.map((e=>AM(e,t)))),i}function xM(e,t=Date.now()){return PM&&e?u(c({},e),{playList:(e.playList||[]).map((e=>RM(e,t)))}):e}const OM=[["format","format"],["codec","codec"],["definition","definition"],["fileType","file_type"],["needThumbs","need_thumbs"],["needBarrageMask","need_barrage_mask"],["unionInfo","union_info"],["quality","quality"],["drmKek","drm_kek"],["jsPlayer","js_player"]];function LM(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function NM(e){if(!e)return;const t={};return OM.forEach((([i,n])=>{const r=e[i];"string"==typeof r&&(t[n]=r)})),t}function MM(e){return uM(JSON.stringify(NM(e)||{}))}function UM(e){return!0===(null==e?void 0:e.canIUseGetDramaInfoTranscodeParam)}function BM(e,t){return e&&t?`${e}${-1===e.indexOf("?")?"?":"&"}${i=t,Object.entries(i).map((([e,t])=>Array.isArray(t)?t.map((t=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&"):`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&")}`:e;var i}function FM(e,t=10,i=0){const n=parseInt(`${e}`,t);return Number.isNaN(n)?i:n}function HM(e){var t;return lM(e.defaultDefinition||(null==(t=e.getVideoByToken)?void 0:t.defaultDefinition))}function jM(e){var t,i;const n="sg",r={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}},o={cn:{__PLAY_DOMAIN__:"https://vod.volcengineapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.volcengineapi.com"},mya:{__PLAY_DOMAIN__:"https://vod.ap-southeast-1.volcengineapi.com"}};let a={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}},s=n;return"byteplus"===e&&r?(a=r,s="sg"):"volcengine"===e&&o&&(a=o,s=a[n]?n:"cn"),(null==(t=null==a?void 0:a[n])?void 0:t.__PLAY_DOMAIN__)||(null==(i=null==a?void 0:a[s])?void 0:i.__PLAY_DOMAIN__)||""}function VM(e){return lM(e.albumId||e.album_id)}function KM(e){return lM(e.episodeId||e.episode_id||e.episodeID)}function WM(e,t){const i={episodeId:KM(e)};return!LM(e,"transcodeParam")||t&&!UM(t)||(i.transcodeParam=e.transcodeParam),i}function GM(e){const t=lM(e.episodeId);return t?LM(e,"transcodeParam")?`${t}_${MM(e.transcodeParam||{})}`:t:""}function YM(e){const t={episodeId:lM(e.episodeId)};return LM(e,"transcodeParam")&&(t.transcodeParamHash=MM(e.transcodeParam||{})),t}function zM(e){return function(e){if(iM.enable)return bM(e);rM("get skip disabled",u(c({},SM(e)),{config:aM()}))}({moduleName:eM,cacheKey:GM(e),cacheKeyInfo:YM(e)})}function $M(e,t){!function(e,t){iM.enable?CM(e,t,iM.expireTime):rM("set skip disabled",c(u(c({},SM(e)),{config:aM()}),oM(t)))}({moduleName:eM,cacheKey:GM(e),cacheKeyInfo:YM(e)},t)}function XM(e){const t=e.getVideoByToken||{};return u(c({},t),{defaultDefinition:HM(e),reqParams:c({},t.reqParams||{}),urlQueryParams:t.urlQueryParams||e.urlQueryParams})}function qM(e,t){const i=XM(e);return u(c({},i),{playDomain:i.playDomain||jM(null==t?void 0:t.channel)})}function ZM(e,t={}){var i,n,r;const o=(e,t,i)=>{for(const n of t)if(e&&void 0!==e[n])return e[n];return i},a=o(e,["PlayInfoList","playInfoList","play_info_list"],[]),s=o(e,["PosterUrl","posterUrl","poster_url"],""),l=o(e,["Vid","vid"],""),h=o(e,["Duration","duration"],0),d=o(e,["BarrageMaskUrl","barrageMaskUrl","barrage_mask_url"],""),f=o(e,["ThumbInfoList","thumbInfoList","thumb_info_list"],[]),p=o(e,["EnableAdaptive","enableAdaptive","enable_adaptive"],void 0),g=o(e,["AdaptiveBitrateStreamingInfo","adaptiveBitrateStreamingInfo","adaptive_bitrate_streaming_info"],void 0),y=null==t?void 0:t.urlQueryParams,{definitionMap:v,autoDemoteDefinition:m,autoDemoteDefinitionTextKey:_}=t||{},E=a.map((e=>{const t=(t,i)=>o(e,t,i),i=t(["MainPlayUrl","mainPlayUrl","main_play_url"],""),n=t(["BackupPlayUrl","backupPlayUrl","backup_play_url"],""),r=BM(i,y),a=BM(n,y),s=t(["Format","format"],"");return c(c({vid:l,url:r,_mainURL:r,_backupURL:a,streamType:s,backupUrl:a,backUrlList:[a],fileType:t(["FileType","fileType","file_type"]),format:s,bitrate:t(["Bitrate","bitrate"]),size:t(["Size","size"]),kid:t(["PlayAuthId","playAuthId","play_auth_id"]),playAuthId:t(["PlayAuthId","playAuthId","play_auth_id"]),playAuth:t(["PlayAuth","playAuth","play_auth"]),secretKey:t(["PlayAuth","playAuth","play_auth"]),vwidth:t(["Width","width"]),vheight:t(["Height","height"]),vtype:null==s?void 0:s.toLocaleUpperCase(),codec:t(["Codec","codec"]),urlExpireTimestamp:FM(t(["MainUrlExpire","mainUrlExpire","main_url_expire"]),10,Xa),drmType:t(["DrmType","drmType","drm_type"])},e),Fs(e,{definitionMap:v,autoDemoteDefinition:m,autoDemoteDefinitionTextKey:_}))})).sort(Ss);return{playList:E,type:(null==(i=E[0])?void 0:i.Format)||(null==(n=E[0])?void 0:n.format)||(null==(r=E[0])?void 0:r.streamType),poster:s||"",vid:l,duration:h||0,dashOpts:{Data:u(c({},e),{VideoID:l})},thumbs:f||[],barrageMaskUrl:d||"",enableAdaptive:p,adaptiveBitrateStreamingInfo:g}}function QM(e){var t;return!!(null==(t=null==e?void 0:e.getVideoByToken)?void 0:t.playAuthToken)}function JM(e){var t;return"string"==typeof e?e:(null==(t=null==e?void 0:e[0])?void 0:t.src)||""}function eU(e,t){var i,n;const r=HM(t),o=function(e,t){const i=e.playList||[];return t&&i.find((e=>{var i;const n=e.mapDefinition||e.definition||e.Definition;return(null==(i=null==n?void 0:n.toLocaleLowerCase)?void 0:i.call(n))===t.toLocaleLowerCase()}))||i[0]}(e,r),a=JM(null==o?void 0:o.url);if(!o||!a)return;const s=o.mapDefinition||o.definition||o.Definition||r,l=o.streamType||o.format||o.Format||e.type||"",c=(o.codec||(null==(n=null==(i=o.Codec)?void 0:i.toLowerCase)?void 0:n.call(i))||tr.H264).toLowerCase();return{vid:e.vid||o.vid||t.vid||"",url:a,definition:s,streamType:l,codec:c,bitrate:FM(o.bitrate||o.Bitrate),duration:FM(o.duration||o.Duration||e.duration),size:FM(o.size||o.Size)}}function tU(e){const t=function(e){return kM(XM(e))}(e);return t?eU(t,e):void 0}function iU(e,t){const i=qM(e,t);return i.playAuthToken?bs(i).catch((()=>{})):Promise.resolve(void 0)}function nU(e,t){return d(this,null,(function*(){if(t&&!t.canIUseGetDramaInfo)return rU(e,t);const i=function(e,t){const i=zM(WM(e,t));return i?eU(i,e):void 0}(e,t);if(i)return RM(i);if(!(null==t?void 0:t.canIUseGetDramaInfo))return rU(e,t);const n=yield function(e,t){const i=VM(t),n=KM(t);if(!i||!n)return Promise.resolve(void 0);if(!(null==e?void 0:e.canIUseGetDramaInfo))return iU(t,e);if(!e.getDramaInfo)return Promise.resolve(void 0);const r={clientKey:e.clientKey,albumId:i,episodeId:n,vid:t.vid||""};return UM(e)&&LM(t,"transcodeParam")&&(r.transcodeParam=NM(t.transcodeParam)||{}),new Promise((i=>{try{e.getDramaInfo((n=>{try{if(!(null==n?void 0:n.is_success))return as.error("[ttdrama] getDramaInfo invalid response",n),void i(void 0);const{data:r}=n;if((null==r?void 0:r.status)!==vR.SUCCESS||!(null==r?void 0:r.video_info))return as.error("[ttdrama] getDramaInfo invalid response",n),void i(void 0);const o=ZM(r.video_info,qM(t,e));i(o)}catch(hs){as.error("[ttdrama] getDramaInfo invalid response",n),i(void 0)}}),r)}catch(n){as.error("[ttdrama] getDramaInfo call failed",n),i(void 0)}}))}(t,e);return n?($M(WM(e,t),n),RM(eU(n,e))):void 0}))}function rU(e,t){return d(this,null,(function*(){const i=tU(e);if(i)return RM(i);const n=yield iU(e,t);var r;return n?(r=n,IM(XM(e),r),RM(eU(n,e))):void 0}))}function oU(e,t){return d(this,null,(function*(){if(JM(e.url))return e;if(function(e){return!!(e&&VM(e)&&KM(e))}(e)){const i=yield nU(e,t);return i||t||QM(e)?i:e}return QM(e)?rU(e,t):e}))}function aU(e,t){return d(this,null,(function*(){if(!(null==e?void 0:e.length))return e||[];let i;if(Kr.os.isAndroid&&!(null==t?void 0:t.canAndroidBatchGetDramaInfo)){i=[];for(const n of e)i.push(yield oU(n,t))}else i=yield Promise.all(e.map((e=>oU(e,t))));return i.filter(Boolean)}))}const sU=[{id:1,tag:"cmn-Hans-CN",label:"简体中文"},{id:2,tag:"eng-US",label:"English"},{id:3,tag:"jpn-JP",label:"日本語"},{id:4,tag:"kor-KR",label:"한국어"},{id:5,tag:"cmn-Hans-CN|eng-US",label:"中英双语"},{id:6,tag:"rus-RU",label:"Русский"},{id:7,tag:"fra-FR",label:"Français"},{id:8,tag:"por-PT",label:"Português"},{id:9,tag:"spa-ES",label:"Español"},{id:10,tag:"vie-VN",label:"Tiếng Việt"},{id:11,tag:"afr-ZA",label:"Afrikaans"},{id:12,tag:"ben-BD",label:"বাংলা"},{id:13,tag:"bul-BG",label:"Български"},{id:14,tag:"mya-MM",label:"မြန်မာဘာသာ"},{id:15,tag:"ces-CZ",label:"Čeština"},{id:16,tag:"dan-DK",label:"Dansk"},{id:17,tag:"hrv-HR",label:"Hrvatski"},{id:18,tag:"nld-NL",label:"Nederlands"},{id:19,tag:"fin-FI",label:"Suomi"},{id:20,tag:"deu-DE",label:"Deutsch"},{id:21,tag:"ell-GR",label:"Ελληνικά"},{id:22,tag:"hun-HU",label:"Magyar"},{id:23,tag:"ind-ID",label:"Bahasa Indonesia"},{id:24,tag:"gle-IE",label:"Gaeilge"},{id:25,tag:"isl-IS",label:"Íslenska"},{id:26,tag:"ita-IT",label:"Italiano"},{id:27,tag:"nor-NO",label:"Norsk"},{id:28,tag:"pol-PL",label:"Polski"},{id:29,tag:"swe-SE",label:"Svenska"},{id:30,tag:"tha-TH",label:"ภาษาไทย"},{id:31,tag:"tur-TR",label:"Türkçe"},{id:32,tag:"ukr-UA",label:"Українська"},{id:33,tag:"urd-PK",label:"اردو"},{id:34,tag:"ara-SA",label:"العربية"},{id:35,tag:"fra-CA",label:"Français (Canada)"},{id:36,tag:"cmn-Hant-CN",label:"繁體中文"},{id:37,tag:"msa-MY",label:"Bahasa Melayu"},{id:38,tag:"heb-IL",label:"עברית"},{id:39,tag:"jva-ID",label:"Basa Jawa"},{id:40,tag:"ron-RO",label:"Română"},{id:41,tag:"fil-PH",label:"Filipino"},{id:42,tag:"hin-IN",label:"हिन्दी"},{id:43,tag:"ben-IN",label:"বাংলা (ভারত)"},{id:44,tag:"khm-KH",label:"ភាសាខ្មែរ"},{id:45,tag:"bos-PH",label:"Bosanski"},{id:46,tag:"est-EE",label:"Eesti"},{id:47,tag:"lav-LV",label:"Latviešu"},{id:48,tag:"slk-SK",label:"Slovenčina"},{id:49,tag:"lit-LT",label:"Lietuvių"},{id:50,tag:"uyg-CN",label:"ئۇيغۇرچە"}],lU=new Map,cU=new Map;for(const JB of sU)lU.set(JB.id,JB.label),cU.set(JB.tag.toLowerCase(),JB.label);function uU(...e){for(const t of e){if("string"!=typeof t)continue;const e=t.trim();if(e)return e}return null}function hU(e){return{albumId:uU(null==e?void 0:e.album_id,null==e?void 0:e.albumId),episodeId:uU(null==e?void 0:e.episode_id,null==e?void 0:e.episodeId,null==e?void 0:e.episodeID)}}const dU=wR.getVeErrorInfo,fU={playAuthToken:"",needDefinitionList:!0},pU=(e,t,i,n=!1)=>{for(const r of t){const t=null==e?void 0:e[r];if(void 0!==t&&(!n||""!==t))return t}return i},gU=(e,t="")=>null==e?t:`${e}`,yU=e=>{switch(e){case vR.NOT_SUBMITTED:return"NOT_SUBMITTED";case vR.UNDER_REVIEW:return"UNDER_REVIEW";case vR.FAILED_REVIEW:return"FAILED_REVIEW";case vR.WITHDRAWN:return"WITHDRAWN_REVIEW";case vR.NOT_ON_SHELF:return"NOT_ON_SHELF";default:return"FAILED_GET_EPISODE_INFO"}},vU=(e,t)=>void 0!==t?yU(t):(null==e?void 0:e.includes("not found"))||(null==e?void 0:e.includes("未查询"))?"NO_INFO_FOUND":(null==e?void 0:e.includes("query"))||(null==e?void 0:e.includes("查询"))?"FAILED_TO_QUERY":"FAILED_GET_EPISODE_INFO";class mU extends qN{constructor(e){super(e),this.isPlayByToken=!1,this.isEncrypt=!1,this.config=null,this.useUnionInfoDRM=!0,this.retryCount=1,this.init()}static get pluginName(){return"AuthToken"}beforePlayerCreate(){return d(this,null,(function*(){if(this.isPlayByToken){const e=yield this.getVideoInfo();e&&this.playerData.initPlayData(e)}}))}getVideoInfo(e){return d(this,null,(function*(){var t;const i=null==(t=this.sdk)?void 0:t._createPlayerPerf,n=()=>d(this,null,(function*(){var t,n,r,o,a,s,l,c,u,h,f,p,g;try{const y=this.isMinisDramaMode&&(null==(t=null==rB?void 0:rB.ttDramaEnv)?void 0:t.canIUseGetDramaInfo);if(!y&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.checkPlayAuthTokenValid",(()=>this.checkPlayAuthTokenValid())):this.checkPlayAuthTokenValid()))return;if(!!this.keyTokenInfo&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.checkKeyTokenValid",(()=>this.checkKeyTokenValid())):this.checkKeyTokenValid()))return;if(!!this.thirdPartyDrmAuthTokenInfo&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.checkDrmAuthTokenValid",(()=>this.checkDrmAuthTokenValid())):this.checkDrmAuthTokenValid()))return;const v=((null==i?void 0:i.measureAsync)?yield i.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getVideos",(()=>d(this,null,(function*(){return yield this.getVideos(e)})))):yield this.getVideos(e))||{};if(!(null==(n=null==v?void 0:v.playList)?void 0:n.length))return void as.error("get no media info");as.log("getVideo res: ",v);const{type:m,poster:_,vid:E,dashOpts:T,thumbs:S,barrageMaskUrl:b}=v||{},C=v.playList||[];null==(o=null==(r=this.sdk)?void 0:r.assertLiteConfig)||o.call(r,{type:m,playList:C,rtm:v.rtm}),this.playInfo=v,this.setSubtitleConfig(v);const k=m||Es(this.config);this.getPrivateDrmInfo&&((null==i?void 0:i.measureAsync)?yield i.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo",(()=>d(this,null,(function*(){return yield this.getPrivateDrmInfo(C,E,k)})))):yield this.getPrivateDrmInfo(C,E,k)),this.playerData.options.vid=E;if(_&&(this.config.needPoster||this.isMinisDramaMode)&&("string"==typeof this.playerData.options.poster?this.playerData.options.poster=_:"object"==typeof this.playerData.options.poster?this.playerData.options.poster.poster=_:this.playerData.options.poster=_),this.config.needThumbs&&S.length>0&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.getThumbnailConfig",(()=>this.getThumbnailConfig(S))):this.getThumbnailConfig(S)),C.length>0){(null==(a=C[0])?void 0:a.drmType)&&this.playerData.setDrmType(C[0].drmType);const t=(null==(l=null==(s=this.playerData)?void 0:s.adapter)?void 0:l.generatePlaylistFromServer(v,this.config.useMasterM3u8))||[...C],n=this.config.defaultDefinition||(null==e?void 0:e.defaultDefinition)||this.playerData.configs.defaultDefinition;let r=t[0];if(n){const e=t.find((e=>(e.mapDefinition||e.definition||e.Definition).toLocaleLowerCase()===n.toLocaleLowerCase()));e&&(r=e)}const o=this.config.needDefinitionList?t:[r];this.isEncrypt=!!(null==o?void 0:o[0].kid);const d=(null==(c=C[0])?void 0:c.codec)||(null==(h=null==(u=C[0])?void 0:u.Codec)?void 0:h.toLowerCase())||(null==(p=null==(f=this.tokenInfo)?void 0:f.Codec)?void 0:p.toLowerCase())||tr.H264,y={vid:E,dashOpts:T,codec:d,playList:o,defaultDefinitionData:r};return(null==i?void 0:i.measure)?(i.measure("beforePlayerCreate.authtoken.getVideoInfo.getDrmConfig",(()=>this.getDrmConfig(y))),i.measure("beforePlayerCreate.authtoken.getVideoInfo.setPluginConfigInVid",(()=>{var e;return null==(e=this.playerData.adapter)?void 0:e.setPluginConfigInVid(y,this)}))):(this.getDrmConfig(y),null==(g=this.playerData.adapter)||g.setPluginConfigInVid(y,this)),{vid:E,playList:o,codec:d,defaultDefinition:r.definition}}as.error("get no media info")}catch(y){if(as.error(y),"VEPLAYER_LITE_UNSUPPORTED_FEATURE"===(null==y?void 0:y.code))throw y}}));return(null==i?void 0:i.measureAsync)?yield i.measureAsync("beforePlayerCreate.authtoken.getVideoInfo",n):yield n()}))}getDramaInfoViaJSB(e){return d(this,null,(function*(){var t,i;const n=rB.ttDramaEnv,r=e||(null==(t=this.playerData)?void 0:t.configs)||{},{albumId:o,episodeId:a}=hU(r),s=r.vid||"";if((null==n?void 0:n.getDramaInfo)&&o&&a)return new Promise((e=>{const t={clientKey:n.clientKey,albumId:o,episodeId:a,vid:s};!0===n.canIUseGetDramaInfoTranscodeParam&&Object.prototype.hasOwnProperty.call(r,"transcodeParam")&&(t.transcodeParam=NM(r.transcodeParam)||{});const i=t=>{var i;as.error("getDramaInfo error:",t);const n={errorType:"drama",errorCode:yR.FAILED_GET_EPISODE_INFO.code,veError:dU({code:yR.FAILED_GET_EPISODE_INFO.code,message:yR.FAILED_GET_EPISODE_INFO.message,textKey:yR.FAILED_GET_EPISODE_INFO.textKey}),errorMessage:yR.FAILED_GET_EPISODE_INFO.message,ext:{originError:t},originError:t};null==(i=this.sdk)||i.delayError.push(n),e(void 0)};try{n.getDramaInfo((t=>{var n,r,l,c;try{if(as.log("getDramaInfoViaJSB res:",t),this.reportGetDramaInfoPerf(t,{albumId:o,episodeId:a,vid:s}),!(null==t?void 0:t.is_success)){as.error("getDramaInfoViaJSB invalid response:",t);const i=vU(null==(n=null==t?void 0:t.error)?void 0:n.error_msg,void 0),o=yR[i]||yR.FAILED_GET_EPISODE_INFO,a={errorType:"drama",errorCode:o.code,veError:dU({code:o.code,message:o.message,textKey:o.textKey}),errorMessage:o.message,ext:{jsbError:null==t?void 0:t.error},originError:t};return null==(r=this.sdk)||r.delayError.push(a),void e(void 0)}const{data:i}=t;if((null==i?void 0:i.status)!==vR.SUCCESS){as.error("getDramaInfoViaJSB invalid response:",t);const n=yU(null==i?void 0:i.status),r=yR[n]||yR.FAILED_GET_EPISODE_INFO,o={errorType:"drama",errorCode:r.code,veError:dU({code:r.code,message:r.message,textKey:r.textKey}),errorMessage:r.message,ext:{status:null==i?void 0:i.status},originError:t};return null==(l=this.sdk)||l.delayError.push(o),void e(void 0)}if(!(null==i?void 0:i.video_info)){as.error("getDramaInfoViaJSB invalid response:",t);const n={errorType:"drama",errorCode:yR.FAILED_TO_QUERY.code,veError:dU({code:yR.FAILED_TO_QUERY.code,message:yR.FAILED_TO_QUERY.message,textKey:yR.FAILED_TO_QUERY.textKey}),errorMessage:yR.FAILED_TO_QUERY.message,ext:{status:null==i?void 0:i.status},originError:t};return null==(c=this.sdk)||c.delayError.push(n),void e(void 0)}as.log("videoInfoRes before transformDramaVideoInfoToRes",i.video_info);const u=this.transformDramaVideoInfoToRes(i.video_info,this.config);as.log("videoInfoRes after transformDramaVideoInfoToRes",u),e(u)}catch(u){i(u)}}),t)}catch(l){i(l)}}));{const e=yR.INVALID_PARAM;null==(i=this.sdk)||i.delayError.push({errorType:gR.network,errorCode:e.code,veError:dU({code:e.code,message:e.message,textKey:e.textKey}),errorMessage:e.message,ext:{},originError:void 0})}}))}mapReviewStatusToErrorCode(e){return yU(e)}mapDramaErrorCode(e,t){return vU(e,t)}transformDramaVideoInfoToRes(e,t){return ZM(e,t)}callOnGetMediaInfo(e,t){var i,n,r;if(e)try{null==(r=null==(n=null==(i=this.playerData)?void 0:i.configs)?void 0:n.onGetMediaInfo)||r.call(n,{data:e,fromCache:t})}catch(o){as.error("onGetMediaInfo callback error:",o)}}reportGetDramaInfoPerf(e,t){var i,n,r,o;const a=null==(i=null==e?void 0:e.data)?void 0:i.perf_info;a&&(null==(o=null==(n=this.sdk)?void 0:n.recordGetDramaInfoPerf)||o.call(n,{perfInfo:a,albumId:t.albumId,episodeId:t.episodeId,vid:t.vid,isSuccess:!!(null==e?void 0:e.is_success),status:null==(r=null==e?void 0:e.data)?void 0:r.status,fromCache:!1,timestamp:Date.now()}))}getVideos(e){return d(this,null,(function*(){var t,i,n,r,o,a;const s=null==(t=this.sdk)?void 0:t._createPlayerPerf;if(as.log("tt drama info: ",this.isMinisDramaMode,null==rB?void 0:rB.ttDramaEnv),this.isMinisDramaMode&&(null==(i=null==rB?void 0:rB.ttDramaEnv)?void 0:i.canIUseGetDramaInfo)){const t=u(c({},e||(null==(n=this.playerData)?void 0:n.configs)||{}),{defaultDefinition:(null==e?void 0:e.defaultDefinition)||(null==(o=null==(r=this.playerData)?void 0:r.configs)?void 0:o.defaultDefinition)||(null==(a=this.config)?void 0:a.defaultDefinition),getVideoByToken:this.config}),i=zM(WM(t,rB.ttDramaEnv));if(i){const e=xM(i);return this.callOnGetMediaInfo(e,!0),e}const l=e=>{$M(WM(t,rB.ttDramaEnv),e);const i=xM(e);return this.callOnGetMediaInfo(i,!1),i};if(null==s?void 0:s.measureAsync){return l(yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getVideos.getDramaInfoViaJSB",(()=>d(this,null,(function*(){return yield this.getDramaInfoViaJSB(e)})))))}return l(yield this.getDramaInfoViaJSB(e))}const l=e=>{var t,i,n;try{const i=JSON.parse(e.response);if(100006===Vn(i,"ResponseMetadata.Error.CodeN")){as.error("playAuthToken is invalid or expired, please check or update your playAuthToken");const i={errorType:"token",errorCode:9101,veError:dU(fR.PLAY_AUTH_TOKEN_EXPIRED),errorMessage:"playAuthToken has expired",ext:{serveResponse:"string"==typeof(null==e?void 0:e.response)?null==e?void 0:e.response:"",serveStatus:null==e?void 0:e.status,playAuthToken:this.config.playAuthToken,config:this.config},originError:e};return null==(t=this.sdk)?void 0:t.delayError.push(i)}}catch(o){as.log(o)}null==(i=this._emitter)||i.emit(LA.GET_PLAY_URL_ERR,e);const r={errorType:"token",errorCode:9100,errorMessage:"get play url error by playAuthToken, please check the playAuthToken",veError:dU(fR.GET_PLAY_INFO_ERR),ext:{serveResponse:"string"==typeof(null==e?void 0:e.response)?null==e?void 0:e.response:"",serveStatus:null==e?void 0:e.status,playAuthToken:this.config.playAuthToken},originError:e};null==(n=this.sdk)||n.delayError.push(r)},h=e=>d(this,null,(function*(){if(!this.config.playDomain&&502===(null==e?void 0:e.status)&&this.playerData.apiMap.backupPlayDomain)return this.playerData.playDomainDegrade=!0,yield Cs((()=>bs(c({playDomain:this.playerData.playDomain},this.config))),this.retryCount,(e=>502===e.status),l);l(e)})),f=()=>d(this,null,(function*(){var e,t;const i=c({playDomain:this.config.playDomain||this.playerData.playDomain},this.config),n=hM(i),r=kM(i);if(r){as.log("[mediaInfoCache] authToken use cached media info",{cacheKey:n,vid:r.vid,playListLength:(null==(e=r.playList)?void 0:e.length)||0});const t=xM(r);return this.callOnGetMediaInfo(t,!0),t}as.log("[mediaInfoCache] authToken request media info",{cacheKey:n,retryCount:this.retryCount,playDomain:i.playDomain});const o=yield Cs((()=>bs(i)),this.retryCount,(e=>502===e.status),h);IM(i,o);const a=xM(o);return as.log("[mediaInfoCache] authToken request finished",{cacheKey:n,vid:null==o?void 0:o.vid,playListLength:(null==(t=null==o?void 0:o.playList)?void 0:t.length)||0,mediaInfo:o}),this.callOnGetMediaInfo(a,!1),a}));return(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getVideos.getPlayInfoByAuthToken",f):yield f()}))}getPrivateDrmInfo(e,t,i){return d(this,null,(function*(){var n,r,o,a;const s=null==(n=this.sdk)?void 0:n._createPlayerPerf;if(this.config.getDrmAuthToken&&"function"==typeof this.config.getDrmAuthToken&&this.playerData.unionId){let n;if(this.sessionId=(new Date).getTime().toString(),"hls"===i){const e=(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.loadPlugins.hlsEncrypt",(()=>d(this,null,(function*(){return yield this.sdk.sdkUmdLoader.loadPlugins(Fw.HLSEncrypt)})))):yield this.sdk.sdkUmdLoader.loadPlugins(Fw.HLSEncrypt);n=null==(r=null==e?void 0:e.updateUnionInfo)?void 0:r.call(e,this.playerData.unionId,this.sessionId)}else if("dash"===i){const e=(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.loadPlugins.dash",(()=>d(this,null,(function*(){return yield this.sdk.sdkUmdLoader.loadPlugins(Fw.DASH)})))):yield this.sdk.sdkUmdLoader.loadPlugins(Fw.DASH);n=null==(o=null==e?void 0:e.updateUnionInfo)?void 0:o.call(e,this.playerData.unionId,this.sessionId)}else if(["mp4","m4a"].includes(i)){const e=(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.loadPlugins.mp4Encrypt",(()=>d(this,null,(function*(){return yield Vw.loadMp4Encrypt(this.sdk.sdkUmdLoader)})))):yield Vw.loadMp4Encrypt(this.sdk.sdkUmdLoader);n=null==(a=null==e?void 0:e.updateUnionInfo)?void 0:a.call(e,this.playerData.unionId,this.sessionId)}if(!n)return void as.error("updateUnionInfo fail");const c=[...new Set(e.map((e=>e.kid)))].join(",");try{const i=(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.getDrmAuthToken",(()=>d(this,null,(function*(){return yield Xs(Gs(this.config.getDrmAuthToken(c,t,n)),200,"The execution time of obtaining privateDrmAuthToken by getDrmAuthToken function of options has exceeded more than 200ms")})))):yield Xs(Gs(this.config.getDrmAuthToken(c,t,n)),200,"The execution time of obtaining privateDrmAuthToken by getDrmAuthToken function of options has exceeded more than 200ms");if(i&&"string"==typeof i){this.privateDrmAuthToken=i;const t=_s(i);(null==t?void 0:t.DrmType)&&(this.useUnionInfoDRM="webdevice"===(null==t?void 0:t.DrmType)),e.forEach((e=>{e.drmKeyToken=this.privateDrmAuthToken}))}}catch(l){as.error("get privaterDrmToken fail")}}}))}getThumbnailConfig(e){const t=e[0],i=c({},this.playerData.configs.thumbnail||{});this.playerData.options.thumbnail=c({pic_num:t.CaptureNum,urls:t.StoreUrls,width:t.CellWidth,height:t.CellHeight,col:t.ImgXLen,row:t.ImgYLen},i)}getBarrageMaskUrl(e){var t,i;const n=null==(t=this.playerData.configs)?void 0:t.DanmuPlugin,r="object"==typeof n?n:{},o=c({},(null==r?void 0:r.maskConfig)||{});this.playerData.configs.DanmuPlugin?(this.playerData.options.DanmuPlugin.maskActive=null==(i=r.maskActive)||i,this.playerData.options.DanmuPlugin.maskConfig=c({maskUrl:e},o)):this.playerData.options.DanmuPlugin={active:!0,maskActive:!0,maskConfig:c({maskUrl:e},o)}}setSubtitleConfig(e){var t,i,n,r,o,a,s,l,h;if(!(null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.autoSubtitle)||!e)return;const d=this.getAutoSubtitleList(e),f=null==(n=this.playerData.options)?void 0:n.Subtitle,p=null==(r=this.playerData.configs)?void 0:r.Subtitle,g="object"==typeof f&&f?f:"object"==typeof p&&p?p:{};this.playerData.options.Subtitle=u(c({},g),{list:d}),null==(h=null==(l=null==(s=null==(a=null==(o=this.sdk)?void 0:o.player)?void 0:a.plugins)?void 0:s.subtitle)?void 0:l.updateSubtitles)||h.call(l,d)}getAutoSubtitleList(e){const t=this.getSubtitleSourceData(e),i=pU(t,["SubtitleInfoList","subtitleInfoList","subtitle_info_list"],[]);if(!Array.isArray(i))return[];const n=i.map(((e,t)=>this.getAutoSubtitleItem(e,t))).filter((e=>Boolean(e)));return n.some((e=>void 0!==e._subtitleOrder))&&n.sort(((e,t)=>{var i,n;return(null!=(i=e._subtitleOrder)?i:1/0)-(null!=(n=t._subtitleOrder)?n:1/0)})),n.forEach((e=>{delete e._subtitleOrder})),n}getSubtitleSourceData(e){const t=null==e?void 0:e.dashOpts;return(null==t?void 0:t.Data)||(null==t?void 0:t.data)||e}getAutoSubtitleItem(e,t){const i="string"==typeof e?this.getStringAutoSubtitleItem(e,t):this.getObjectAutoSubtitleItem(e,t);if(i)return this.formatAutoSubtitleItem(i,e,t)}getStringAutoSubtitleItem(e,t){const i=`${t+1}`;return c({id:`${t}`,language:`${t}`,label:i,text:i},!/\n/.test(n=e)&&(/^(https?:)?\/\//.test(n)||/^data:/.test(n)||/\.(vtt|srt)([?#].*)?$/i.test(n))?{url:e}:{stringContent:e});var n}getObjectAutoSubtitleItem(e,t){if(!e||"object"!=typeof e)return;const i=pU(e,["SubtitleUrl","subtitleUrl","subtitle_url","url","src"],"",!0),n=pU(e,["StringContent","stringContent","string_content"],"",!0),r=pU(e,["List","list"]);if(!i&&!n&&!r)return;const o=function(e,t){const i="string"==typeof e?parseInt(e,10):e;if("number"==typeof i&&!isNaN(i)){const e=lU.get(i);if(e)return e}if(t){const e=cU.get(t.toLowerCase());if(e)return e}}(pU(e,["LanguageId","languageId","language_id"],void 0,!0),pU(e,["Language","language"],"",!0)),a=o||gU(pU(e,["Title","title","label","text","Language","language","Tag","tag","LanguageId","languageId","language_id"],`${t+1}`,!0),`${t+1}`),s=gU(pU(e,["SubtitleId","subtitleId","subtitle_id","FileId","fileId","file_id","id"],`${t}`,!0),`${t}`),l=gU(pU(e,["Language","language","LanguageId","languageId","language_id","srclang"],`${t}`,!0),`${t}`);return c(c(c(u(c({},e),{id:s,language:l,label:a,text:a}),i?{url:i}:{}),n?{stringContent:n}:{}),r?{list:r}:{})}formatAutoSubtitleItem(e,t,i){var n,r;const o=null==(r=null==(n=this.playerData)?void 0:n.configs)?void 0:r.formatAutoSubtitleItem;if("function"!=typeof o)return e;const a=o(t,i);if(!1!==a&&null!==a){if(!0===a||void 0===a)return e;if("string"==typeof a||"number"==typeof a){const t=`${a}`;return u(c({},e),{label:t,text:t})}if("object"==typeof a){if(!1===a.show||!1===a.visible)return;const t=Object.prototype.hasOwnProperty.call(a,"order"),i=Object.prototype.hasOwnProperty.call(a,"label")||Object.prototype.hasOwnProperty.call(a,"text")?(()=>{var t;const i=gU(null!=(t=a.label)?t:a.text,"");return u(c({},e),{label:i,text:i})})():e;t&&(i._subtitleOrder=a.order);const n=Object.prototype.hasOwnProperty.call(a,"isDefault"),r=Object.prototype.hasOwnProperty.call(a,"default");return(n||r)&&(i.isDefault=n?Boolean(a.isDefault):Boolean(a.default)),i}return e}}getDrmConfig(e){var t,i,n,r,o,a,s,l;const{thirdPartyDrmAuthToken:u,serverCertificatePath:h}=this.config;if(u)try{const{vid:u,playList:d}=e,{kid:f,codec:p}=null==d?void 0:d[0];if(!f||!u)return void as.warn("get kid or vid fail");const g=null==(t=this.playerData.configs)?void 0:t.drm,y="object"==typeof g?g:{},{playDomain:v}=this.config,m=v||this.playerData.playDomain,_=function(e,t="GetPlayInfoToken"){const i=vs(window.atob(e));return i?i[t]:""}(this.config.thirdPartyDrmAuthToken,"GetThirdPartyDrmAuthToken"),E=c({ignoreLicenseHeader:!1,unRecord:null!=(i=this.config.unRecord)&&i,contentType:ir[p],initDataType:"cenc",[Za.FAIRPLAY]:{serverProcessSPCPath:ks(Za.FAIRPLAY,f,m,_),serverCertificatePath:h},[Za.WIDEVINE]:{serverProcessSPCPath:ks(Za.WIDEVINE,f,m,_)},[Za.PLAYREADY]:{serverProcessSPCPath:ks(Za.PLAYREADY,f,m,_)}},y);(null==(o=null==(r=null==(n=this.sdk)?void 0:n.player)?void 0:r.plugins)?void 0:o.drm)&&(null==(l=null==(s=null==(a=this.sdk)?void 0:a.player)?void 0:s.plugins)||l.drm.updateConfig(E)),this.playerData.options.drm=E}catch(d){as.error("generate drm config error:",d)}else this.playerData.options.drm={initDataType:"cenc"}}get isMinisDramaMode(){const e=rB.ttDramaEnv;return!!(null==e?void 0:e.getDramaInfo)}init(){const e=this.playerData.configs,{getVideoByToken:t={}}=e;this.initConfig(t)}initConfig(e,t){var i;const n=t||(null==(i=this.playerData)?void 0:i.configs)||{},{albumId:r,episodeId:o}=hU(n),a=!(!r||!o),s=!!rB.ttDramaEnv;if(this.isPlayByToken=!!e.playAuthToken||s&&a,this.isPlayByToken&&(this.config=Object.assign({},fU,e),Object.prototype.hasOwnProperty.call(n,"definitionMap")&&(this.config.definitionMap=n.definitionMap),e.playAuthToken)){if(this.tokenInfo=ms(e.playAuthToken),e.keyToken){const t=(l=e.keyToken,/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/.test(l)?window.atob(e.keyToken):e.keyToken);this.keyTokenInfo=_s(t)}e.thirdPartyDrmAuthToken&&(this.thirdPartyDrmAuthTokenInfo=ms(e.thirdPartyDrmAuthToken,"GetThirdPartyDrmAuthToken")),e.retryCount&&(this.retryCount=e.retryCount)}var l}updateDramaEpisode(e,t){return d(this,null,(function*(){var i,n,r;const o=t||(null==(i=this.playerData)?void 0:i.configs)||{},a=o.getVideoByToken||{},s={config:this.config,isPlayByToken:this.isPlayByToken,tokenInfo:this.tokenInfo,keyTokenInfo:this.keyTokenInfo,thirdPartyDrmAuthTokenInfo:this.thirdPartyDrmAuthTokenInfo,retryCount:this.retryCount};this.initConfig(a,o);const l=yield this.getVideoInfo(o);if(!l)throw this.config=s.config,this.isPlayByToken=s.isPlayByToken,this.tokenInfo=s.tokenInfo,this.keyTokenInfo=s.keyTokenInfo,this.thirdPartyDrmAuthTokenInfo=s.thirdPartyDrmAuthTokenInfo,this.retryCount=s.retryCount,new Error("Failed to get drama media info");if(t&&(this.playerData.configs=t),e)this.playerData.initPlayData(l);else{const e=this.playerData.current.definition,t=(null==(n=l.playList)?void 0:n.find((t=>{var i,n;const r=t.mapDefinition||t.definition||t.Definition;return(null==(i=null==r?void 0:r.toLocaleLowerCase)?void 0:i.call(r))===(null==(n=null==e?void 0:e.toLocaleLowerCase)?void 0:n.call(e))})))||(null==(r=l.playList)?void 0:r[0]),i=(null==t?void 0:t.mapDefinition)||(null==t?void 0:t.definition)||(null==t?void 0:t.Definition);this.playerData.updateConfigs(u(c({},l),{defaultDefinition:i})),this.playerData.updatePlayList(),t&&this.playerData.initCurrent(t),this.playerData.updateCheckExpireData()}}))}updateAuthToken(e,t){return d(this,null,(function*(){const i=Object.assign({},this.config,e);this.initConfig(i);const n=yield this.getVideoInfo();n&&(t?this.playerData.initPlayData(n):(this.playerData.updateConfigs(u(c({},n),{defaultDefinition:this.playerData.current.definition})),this.playerData.updatePlayList(),this.playerData.updateCheckExpireData()))}))}checkPlayAuthTokenValid(){var e,t;if(!this.tokenInfo)return!1;if(Ts(this.tokenInfo)){as.error("playAuthToken is expired, please check or update your playAuthToken"),null==(e=this.sdk)||e.delayEvents.push({name:OA.TOKEN_EXPIRED,payload:{type:"playAuthToken",token:this.tokenInfo}});const i={errorType:"token",errorCode:9101,veError:dU(fR.PLAY_AUTH_TOKEN_EXPIRED),errorMessage:"playAuthToken has expired",ext:{playAuthToken:this.config.playAuthToken,config:this.config},originError:void 0};return null==(t=this.sdk)||t.delayError.push(i),!0}return!1}checkKeyTokenValid(){var e,t;if(Ts(this.keyTokenInfo)){as.error("keyToken is expired, please check or update your keyToken"),null==(e=this.sdk)||e.delayEvents.push({name:OA.TOKEN_EXPIRED,payload:{type:"keyToken",token:this.keyTokenInfo}});const i={errorType:"token",errorCode:9102,veError:dU(fR.HLS_KEY_TOKEN_EXPIRED),errorMessage:"keyToken for hls encrypt play has expired",ext:{keyToken:this.config.keyToken,config:this.config},originError:void 0};return null==(t=this.sdk)||t.delayError.push(i),!0}return!1}checkDrmAuthTokenValid(){var e,t;if(Ts(this.thirdPartyDrmAuthTokenInfo)){as.error("thirdPartyDrmAuthToken is expired, please check or update your thirdPartyDrmAuthToken"),null==(e=this.sdk)||e.delayEvents.push({name:OA.TOKEN_EXPIRED,payload:{type:"thirdPartyDrmAuthToken",token:this.thirdPartyDrmAuthTokenInfo}});const i={errorType:"token",errorCode:9103,errorMessage:"thirdPartyDrmAuthToken for DRM has expired",veError:dU(fR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED),ext:{thirdPartyDrmAuthToken:this.config.thirdPartyDrmAuthToken,config:this.config},originError:void 0};return null==(t=this.sdk)||t.delayError.push(i),!0}return!1}}class _U extends qN{static get pluginName(){return"Abr"}constructor(e){super(e)}static get defaultConfig(){return{autoDefiText:"",isOpenAutoDefi:!1,interval:1e3,hurryThreshold:.25,lowThreshold:.4,highThreshold:.7,noStallCheckTime:5,isOpenHint:!1,method:31}}beforePlayerCreate(){return d(this,null,(function*(){return yield this.prepareAbrModule()}))}prepareAbrModule(){return d(this,null,(function*(){var e,t;return null==(t=null==(e=this.sdk.playerData)?void 0:e.adapter)?void 0:t.prepareAbrModule(this.playerData,this.sdk.sdkUmdLoader)}))}adaptAbrOptions(){var e;const t=null==(e=this.playerData.configs)?void 0:e.autoBitrateOpts;if(t){const e=this.playerData.defaultDefinition;return u(c(c({},_U.defaultConfig),t),{autoDefiText:t.autoDefinitionText||"",isOpenAutoDefi:this.playerData.isOpenABR(),isPlayAutoDefi:this.playerData.isPlayAutoDefinition(e)})}}applyAbrConfig(e){var t,i;const n=this.adaptAbrOptions();n&&(null==(i=null==(t=this.sdk.playerData)?void 0:t.adapter)||i.applyAbrPluginConfig(e,n))}}class EU extends qN{static get pluginName(){return"AdaptRange"}constructor(e){super(e)}adaptRangeOptions(){var e,t,i,n,r,o,a,s;const l=null!=(t=null==(e=this.playerData.configs)?void 0:e.adaptRange)?t:void 0;if(!(null==l?void 0:l.enable)||!(null==(n=null==(i=this.playerData.adapter)?void 0:i.canAdaptRangeEnable)?void 0:n.call(i)))return;const h=this.playerData.adapter.adaptRangeDefaultOptions();return u(c(c({},null!=h?h:{}),l),{minTargetCacheDur:null!=(r=l.minCacheDuration)?r:null==h?void 0:h.minTargetCacheDur,maxTargetCacheDur:null!=(o=l.maxCacheDuration)?o:null==h?void 0:h.maxTargetCacheDur,rangeMinDuration:null!=(a=l.minRangeDuration)?a:null==h?void 0:h.rangeMinDuration,rangeMaxDuration:null!=(s=l.maxRangeDuration)?s:null==h?void 0:h.rangeMaxDuration})}applyRangeConfig(e){const t=this.adaptRangeOptions();t&&e&&this.playerData.adapter.applyAdaptRangePluginConfig(e,t)}}class TU extends qN{static get pluginName(){return"Strategy"}applyFinalStrategy(e){var t,i,n,r;if(gA.isReady()){const o=this.playerData.configs.duration||(null==(i=null==(t=this.playerData.playList)?void 0:t[0])?void 0:i.duration)||-1,a=o>0&&o<=180?"svideo":o>180&&o<=1800?"mvideo":"lvideo",s={vtype:null==(n=this.playerData.adapter)?void 0:n.streamType,duration:o,videoLabel:a},l=gA.getStrategyRecommendations(void 0,s),{result:c}=l;as.log("VodLogCommon Final StrategyConfig:",c);const u=null==c?void 0:c[uA.ADAPT_RANGE];(null==u?void 0:u.enable)&&(null==u?void 0:u.options)&&(null==(r=this.playerData.adapter)||r.applyAdaptRangeStrategy(e,u.options))}}}const SU={init(e){var t;if(!e)return;const i=e.playerData.sdkPlugins;(null==(t=e.playerData)?void 0:t.isLive)?e.sdkPlugins=[...i]:e.sdkPlugins=[mU,_U,EU,TU,...i],e._sdkPlugins={}},registerPlugin(e,t){if(!e||!t)return;let i=null,n=null;e.plugin&&"function"==typeof e.plugin?(i=e.plugin,n=e.options):(i=e,n={}),n.sdk=t;const r=n.pluginName||i.pluginName;if(!r)throw new Error("The property pluginName is necessary");const o=t._sdkPlugins;try{o[r.toLowerCase()]&&this.unRegister(r);const e=new i(n);return o[r.toLowerCase()]=e,o[r.toLowerCase()].func=i,e&&"function"==typeof e.afterCreate&&e.afterCreate(),e}catch(a){as.error(a)}},unRegister(e,t){if(e&&t){e=e.toLowerCase();try{const i=t._sdkPlugins[e];i&&(i.pluginName&&i.__destroy(),delete t._sdkPlugins[e])}catch(i){as.error(i)}}},beforePlayerCreate(e){if(!e)return;e._sdkPlugins||this.init(e);const t=e._sdkPlugins,i=null==e?void 0:e._createPlayerPerf,n=[];for(const r of Object.keys(t))if(t[r]&&t[r].beforePlayerCreate)try{const e=()=>Gs(t[r].beforePlayerCreate());(null==i?void 0:i.measureAsync)?n.push(i.measureAsync(`beforePlayerCreate.${r}`,e)):n.push(e())}catch(hs){throw n.push(Gs(null)),hs}return new Promise(((e,t)=>{Promise.all([...n]).then((()=>{e(null)})).catch((i=>{as.error(i),"VEPLAYER_LITE_UNSUPPORTED_FEATURE"!==(null==i?void 0:i.code)?e(null):t(i)}))}))},afterPlayerCreate(e){if(!e)return;const t=e._sdkPlugins;for(const i of Object.keys(t))if(t[i]&&t[i].beforePlayerCreate)try{t[i].afterPlayerCreate()}catch(hs){throw hs}},destroy(e){if(!e)return;const t=e._sdkPlugins;if(t){for(const i of Object.keys(t))this.unRegister(i,e);delete e._sdkPlugins}}},bU=SU,CU={[dR.NETWORK]:"Network error",[dR.NETWORK_TIMEOUT]:"Network timeout",[dR.NETWORK_FORBIDDEN]:"The video URL is prohibited from access. Please check the domain name access control",[dR.NETWORK_NOTFOUND]:"The video not found, please check whether the URL is correct",[dR.NETWORK_RANGE_NOT_SATISFIABLE]:"The request range is incorrect, please try again later",[dR.NETWORK_PROTOCOL]:"The request protocol is incorrect, please use the https URL to access",[dR.NETWORK_URL_EXPIRE]:"The video URL has expired",[dR.NETWORK_URL_SIGN]:"The video URL signature is incorrect, please check whether the URL is correct",[dR.NETWORK_ENCRYPT_HLS_ERR]:"Get the m3u8 file or encrypt key fail",[dR.MEDIA_ERR]:"Media error",[dR.MEDIA_ERR_ABORTED]:"Playback was canceled by the user or browser",[dR.MEDIA_ERR_NETWORK]:"Network error",[dR.MEDIA_ERR_DECODE]:"Decoding error",[dR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"Audio/Video format not supported or URL unavailable",[dR.MEDIA_ERR_NOT_SUPPORTED]:"Unsupported video format",[dR.MEDIA_ERR_URL_EMPTY]:"Video URL is empty",[dR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"Video file is not supported in the current browser environment",[dR.MEDIA_ERR_PLAY_ERR]:"Video playback error",[dR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"Unsupported video type",[dR.BUSINESS_DRM_NOT_SUPPORT]:"DRM encrypted playback is not supported",[dR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"Screen recording protection is not supported",[dR.BUSINESS_DRM_LACK_MEDIA_KEY]:"Video data lacks the corresponding MediaKey",[dR.BUSINESS_DRM_LACK_KEY_SESSION]:"Browser does not support the corresponding DRM KeySession",[dR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"Decryption playback error",[dR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"Missing DRM certificate request link",[dR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"Missing DRM License request link",[dR.BUSINESS_DRM_LICENSE_FAIL]:"Request or update License failed",[dR.BUSINESS_DRM_KEY_ERROR]:"Decryption error",[dR.BUSINESS_DRM_CERT_FAIL]:"Request for DRM certificate failed",[dR.PRIVATE_DRM_KEY_GET_FAILED]:"Private DRM get key failed",[dR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"Web cryptography API is not supported, please visit page by https",[dR.PRIVATE_DRM_RSA_FAIL]:"Decryption by RSA-OAEP failed, please check playAuthId",[dR.OTHER]:"Other error",[dR.VOD_LOG_NOT_CONFIGURED]:"Log options not configured correctly",[dR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken has expired",[dR.HLS_KEY_TOKEN_EXPIRED]:"keyToken has expired",[dR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken has expired",[dR.GET_PLAY_INFO_ERR]:"Failed to get media information",[dR.GET_HLS_DECRYPTION_KEY_ERR]:"Failed to get HLS key",[dR.LICENSE_VALIDATE_FAIL]:"License validation failed",[dR.DEFINITION_AUTO]:"Auto",[dR.LICENSE_STATUS_INVALID]:"License validation is invalid",[dR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license domain name does not match",[dR.BASE_LICENSE_NOT_SUPPORT_265]:"The basic license does not support H265",[dR.BASE_LICENSE_NOT_SUPPORT_ABR]:"The basic license does not support ABR",[dR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"The basic license does not support dynamic buffer",[dR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"The basic license does not support preload",[dR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"Expired license does not support H265",[dR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"Expired license does not support ABR",[dR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"The expired license does not support dynamic buffer",[dR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"Expired license does not support preloading",[dR.DRAMA_INVALID_PARAM]:"Invalid parameter",[dR.DRAMA_NO_INFO_FOUND]:"No information found for this episode",[dR.DRAMA_NOT_SUBMITTED]:"Episode has not been submitted for review",[dR.DRAMA_UNDER_REVIEW]:"Episode is under review",[dR.DRAMA_FAILED_REVIEW]:"Episode failed review",[dR.DRAMA_WITHDRAWN_REVIEW]:"Episode review was withdrawn",[dR.DRAMA_FAILED_TO_QUERY]:"Failed to query video playback information",[dR.DRAMA_INVALID_TTOP_TOKEN]:"Invalid playback credential or TTOP signature verification failed",[dR.DRAMA_NOT_ON_SHELF]:"Video is not on shelf",[dR.DRAMA_FAILED_GET_EPISODE_INFO]:"Failed to get episode information"},kU={[dR.NETWORK]:"网络错误",[dR.NETWORK_TIMEOUT]:"网络超时",[dR.NETWORK_FORBIDDEN]:"视频地址禁止访问,请检查域名访问控制",[dR.NETWORK_NOTFOUND]:"视频不存在,请检查视频地址是否正确",[dR.NETWORK_RANGE_NOT_SATISFIABLE]:"请求 range 不正确,请稍后再试",[dR.NETWORK_PROTOCOL]:"请求协议错误,请使用 https 地址访问",[dR.NETWORK_URL_EXPIRE]:"视频地址已过期",[dR.NETWORK_URL_SIGN]:"视频地址签名错误,请检查地址是否正确",[dR.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 文件或密钥获取失败",[dR.MEDIA_ERR]:"播放错误",[dR.MEDIA_ERR_ABORTED]:"播放被用户或浏览器取消",[dR.MEDIA_ERR_NETWORK]:"网络错误",[dR.MEDIA_ERR_DECODE]:"解码错误",[dR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音/视频格式不支持或地址不可用",[dR.MEDIA_ERR_NOT_SUPPORTED]:"不支持的视频格式",[dR.MEDIA_ERR_URL_EMPTY]:"视频地址为空",[dR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"视频文件当前浏览器环境下不支持",[dR.MEDIA_ERR_PLAY_ERR]:"视频播放错误",[dR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"不支持的视频类型",[dR.BUSINESS_DRM_NOT_SUPPORT]:"DRM加密播放不支持",[dR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"不支持防录屏",[dR.BUSINESS_DRM_LACK_MEDIA_KEY]:"视频数据缺少相应 MediaKey",[dR.BUSINESS_DRM_LACK_KEY_SESSION]:"浏览器不支持相应 DRM KeySession",[dR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"解密播放错误",[dR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"缺少 DRM 证书请求链接",[dR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"缺少 DRM License 请求链接",[dR.BUSINESS_DRM_LICENSE_FAIL]:"请求或更新 License 失败",[dR.BUSINESS_DRM_KEY_ERROR]:"解密错误",[dR.BUSINESS_DRM_CERT_FAIL]:"请求DRM证书失败",[dR.PRIVATE_DRM_KEY_GET_FAILED]:"私有加密密钥解析失败",[dR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"当前浏览器不支持Crypto API,请使用https环境访问",[dR.PRIVATE_DRM_RSA_FAIL]:"解密错误,请检查playAuthId是否正确",[dR.OTHER]:"其他错误",[dR.VOD_LOG_NOT_CONFIGURED]:"未正确配置质量日志参数",[dR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken 已过期",[dR.HLS_KEY_TOKEN_EXPIRED]:"keyToken 已过期",[dR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken 已过期",[dR.GET_PLAY_INFO_ERR]:"获取媒体信息失败",[dR.GET_HLS_DECRYPTION_KEY_ERR]:"获取 HLS 密钥失败",[dR.LICENSE_VALIDATE_FAIL]:"license 校验失败",[dR.DEFINITION_AUTO]:"自动",[dR.LICENSE_STATUS_INVALID]:"license 校验无效",[dR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license 域名不匹配",[dR.BASE_LICENSE_NOT_SUPPORT_265]:"基础版license 不支持H265",[dR.BASE_LICENSE_NOT_SUPPORT_ABR]:"基础版license 不支持自适应码率",[dR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基础版license 不支持动态Buffer",[dR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基础版license 不支持预加载",[dR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"已过期版license 不支持H265",[dR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"已过期版license 不支持自适应码率",[dR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"已过期版license 不支持动态Buffer",[dR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"已过期版license 不支持预加载",[dR.DRAMA_INVALID_PARAM]:"参数错误",[dR.DRAMA_NO_INFO_FOUND]:"未查询到该剧集信息",[dR.DRAMA_NOT_SUBMITTED]:"剧集未送审",[dR.DRAMA_UNDER_REVIEW]:"剧集审核中",[dR.DRAMA_FAILED_REVIEW]:"剧集审核不通过",[dR.DRAMA_WITHDRAWN_REVIEW]:"剧集审核撤回",[dR.DRAMA_FAILED_TO_QUERY]:"查询视频播放信息失败",[dR.DRAMA_INVALID_TTOP_TOKEN]:"播放凭证无效或TTOP签名验证失败",[dR.DRAMA_NOT_ON_SHELF]:"视频未上架",[dR.DRAMA_FAILED_GET_EPISODE_INFO]:"查询剧集信息失败"},IU={[dR.NETWORK]:"ネットワークエラー",[dR.NETWORK_TIMEOUT]:"ネットワークタイムアウト",[dR.NETWORK_FORBIDDEN]:"動画のURLへのアクセスが禁止されています。ドメインアクセス制御を確認してください",[dR.NETWORK_NOTFOUND]:"動画が存在しません。動画アドレスが正しいか確認してください",[dR.NETWORK_RANGE_NOT_SATISFIABLE]:"リクエスト範囲が正しくありません。後でもう一度お試しください",[dR.NETWORK_PROTOCOL]:"リクエストプロトコルエラー。httpsアドレスを使用してアクセスしてください",[dR.NETWORK_URL_EXPIRE]:"動画のURLは期限切れです",[dR.NETWORK_URL_SIGN]:"動画のURL署名エラー。アドレスが正しいか確認してください",[dR.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 ファイルまたはキーの取得に失敗しました",[dR.MEDIA_ERR]:"再生エラー",[dR.MEDIA_ERR_ABORTED]:"再生がユーザーまたはブラウザによってキャンセルされました",[dR.MEDIA_ERR_NETWORK]:"ネットワークエラー",[dR.MEDIA_ERR_DECODE]:"デコードエラー",[dR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音声/動画フォーマットがサポートされていないか、アドレスが利用できません",[dR.MEDIA_ERR_NOT_SUPPORTED]:"サポートされていない動画フォーマット",[dR.MEDIA_ERR_URL_EMPTY]:"動画のURLが空です",[dR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"動画ファイルは現在のブラウザ環境でサポートされていません",[dR.MEDIA_ERR_PLAY_ERR]:"動画再生エラー",[dR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"サポートされていない動画の種類",[dR.BUSINESS_DRM_NOT_SUPPORT]:"DRM暗号化再生はサポートされていません",[dR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"録画防止はサポートされていません",[dR.BUSINESS_DRM_LACK_MEDIA_KEY]:"動画データに対応するMediaKeyが不足しています",[dR.BUSINESS_DRM_LACK_KEY_SESSION]:"ブラウザが対応するDRM KeySessionをサポートしていません",[dR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"復号再生エラー",[dR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"DRM証明書リクエストリンクが不足しています",[dR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"DRMライセンスリクエストリンクが不足しています",[dR.BUSINESS_DRM_LICENSE_FAIL]:"ライセンスのリクエストまたは更新に失敗しました",[dR.BUSINESS_DRM_KEY_ERROR]:"復号エラー",[dR.BUSINESS_DRM_CERT_FAIL]:"DRM証明書のリクエストに失敗しました",[dR.PRIVATE_DRM_KEY_GET_FAILED]:"プライベートDRMキーの取得に失敗しました",[dR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"現在のブラウザはCrypto APIをサポートしていません。アクセスするにはhttps環境を使用してください",[dR.PRIVATE_DRM_RSA_FAIL]:"復号化エラー。playAuthIdが正しいかどうかを確認してください",[dR.OTHER]:"その他のエラー",[dR.VOD_LOG_NOT_CONFIGURED]:"品質ログパラメータが正しく設定されていません",[dR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthTokenが期限切れです",[dR.HLS_KEY_TOKEN_EXPIRED]:"keyTokenが期限切れです",[dR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthTokenが期限切れです",[dR.GET_PLAY_INFO_ERR]:"動画情報の取得に失敗しました",[dR.GET_HLS_DECRYPTION_KEY_ERR]:"HLSキーの取得に失敗しました",[dR.LICENSE_VALIDATE_FAIL]:"ライセンスの検証に失敗しました",[dR.DEFINITION_AUTO]:"自動",[dR.LICENSE_STATUS_INVALID]:"ライセンス検証が無効です",[dR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"ライセンスドメイン名が一致しません",[dR.BASE_LICENSE_NOT_SUPPORT_265]:"基本ライセンスはH265をサポートしていません",[dR.BASE_LICENSE_NOT_SUPPORT_ABR]:"基本ライセンスはアダプティブビットレートをサポートしていません",[dR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基本ライセンスはダイナミックバッファをサポートしていません",[dR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基本ライセンスはプリロードをサポートしていません",[dR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"期限切れのライセンスはH265をサポートしていません",[dR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"期限切れのライセンスはアダプティブ ビットレートをサポートしていません",[dR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"期限切れのライセンスは動的バッファをサポートしていません",[dR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"期限切れのライセンスはプリロードをサポートしていません",[dR.DRAMA_INVALID_PARAM]:"パラメータが無効です",[dR.DRAMA_NO_INFO_FOUND]:"このエピソードの情報が見つかりません",[dR.DRAMA_NOT_SUBMITTED]:"エピソードは審査に提出されていません",[dR.DRAMA_UNDER_REVIEW]:"エピソードは審査中です",[dR.DRAMA_FAILED_REVIEW]:"エピソードは審査に不合格でした",[dR.DRAMA_WITHDRAWN_REVIEW]:"エピソードの審査が取り下げられました",[dR.DRAMA_FAILED_TO_QUERY]:"動画再生情報の取得に失敗しました",[dR.DRAMA_INVALID_TTOP_TOKEN]:"再生資格情報が無効か、TTOP署名の検証に失敗しました",[dR.DRAMA_NOT_ON_SHELF]:"動画は未公開です",[dR.DRAMA_FAILED_GET_EPISODE_INFO]:"エピソード情報の取得に失敗しました"},PU=[{LANG:"en",TEXT:CU},{LANG:"zh",TEXT:kU},{LANG:"zh-hk",TEXT:{[dR.NETWORK]:"網路錯誤",[dR.NETWORK_TIMEOUT]:"網路逾時",[dR.NETWORK_FORBIDDEN]:"視頻地址禁止訪問,請檢查域名訪問控制",[dR.NETWORK_NOTFOUND]:"視頻不存在,請檢查視訊地址是否正確",[dR.NETWORK_RANGE_NOT_SATISFIABLE]:"請求範圍不正確,請稍後再試",[dR.NETWORK_PROTOCOL]:"請求協議錯誤,請使用 https 地址訪問",[dR.NETWORK_URL_EXPIRE]:"視頻地址已過期",[dR.NETWORK_URL_SIGN]:"視頻地址簽名錯誤,請檢查地址是否正確",[dR.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 檔案或金鑰取得失敗",[dR.MEDIA_ERR]:"播放錯誤",[dR.MEDIA_ERR_ABORTED]:"播放被用戶或瀏覽器取消",[dR.MEDIA_ERR_NETWORK]:"網路錯誤",[dR.MEDIA_ERR_DECODE]:"解碼錯誤",[dR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音/視頻格式不支援或地址不可用",[dR.MEDIA_ERR_NOT_SUPPORTED]:"不支援的視頻格式",[dR.MEDIA_ERR_URL_EMPTY]:"視頻地址為空",[dR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"視頻文件在當前瀏覽器環境下不支援",[dR.MEDIA_ERR_PLAY_ERR]:"視頻播放錯誤",[dR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"不支援的視頻類型",[dR.BUSINESS_DRM_NOT_SUPPORT]:"不支援 DRM 加密播放",[dR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"不支援防錄屏",[dR.BUSINESS_DRM_LACK_MEDIA_KEY]:"視頻數據缺少相應 MediaKey",[dR.BUSINESS_DRM_LACK_KEY_SESSION]:"瀏覽器不支援相應 DRM KeySession",[dR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"解密播放錯誤",[dR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"缺少 DRM 證書請求鏈接",[dR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"缺少 DRM License 請求鏈接",[dR.BUSINESS_DRM_LICENSE_FAIL]:"請求或更新 License 失敗",[dR.BUSINESS_DRM_KEY_ERROR]:"解密錯誤",[dR.BUSINESS_DRM_CERT_FAIL]:"請求 DRM 證書失敗",[dR.PRIVATE_DRM_KEY_GET_FAILED]:"私有加密金鑰解析失敗",[dR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"目前瀏覽器不支援Crypto API,請使用https環境訪問",[dR.PRIVATE_DRM_RSA_FAIL]:"解密錯誤,請檢查playAuthId是否正確",[dR.OTHER]:"其他錯誤",[dR.VOD_LOG_NOT_CONFIGURED]:"未正確配置質量日誌參數",[dR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken 已過期",[dR.HLS_KEY_TOKEN_EXPIRED]:"keyToken 已過期",[dR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken 已過期",[dR.GET_PLAY_INFO_ERR]:"獲取視頻信息失敗",[dR.GET_HLS_DECRYPTION_KEY_ERR]:"獲取 HLS 密鑰失敗",[dR.LICENSE_VALIDATE_FAIL]:"license 校驗失敗",[dR.DEFINITION_AUTO]:"自動",[dR.LICENSE_STATUS_INVALID]:"license 校驗無效",[dR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license 域名不匹配",[dR.BASE_LICENSE_NOT_SUPPORT_265]:"基礎版license 不支援H265",[dR.BASE_LICENSE_NOT_SUPPORT_ABR]:"基礎版license 不支援自適應碼率",[dR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基礎版license 不支援動態Buffer",[dR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基礎版license 不支援預載入",[dR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"已過期版license 不支援H265",[dR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"已過期版license 不支援自適應碼率",[dR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"已過期版license 不支援動態Buffer",[dR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"已過期版license 不支援預載入",[dR.DRAMA_INVALID_PARAM]:"參數錯誤",[dR.DRAMA_NO_INFO_FOUND]:"未查詢到該劇集資訊",[dR.DRAMA_NOT_SUBMITTED]:"劇集未送審",[dR.DRAMA_UNDER_REVIEW]:"劇集審核中",[dR.DRAMA_FAILED_REVIEW]:"劇集審核不通過",[dR.DRAMA_WITHDRAWN_REVIEW]:"劇集審核撤回",[dR.DRAMA_FAILED_TO_QUERY]:"查詢視頻播放資訊失敗",[dR.DRAMA_INVALID_TTOP_TOKEN]:"播放憑證無效或TTOP簽名驗證失敗",[dR.DRAMA_NOT_ON_SHELF]:"影片未上架",[dR.DRAMA_FAILED_GET_EPISODE_INFO]:"查詢劇集資訊失敗"}},{LANG:"jp",TEXT:IU}];class DU{}DU.isSupported=()=>!1,DU.isSupportedH264=e=>!1;const wU="ignoreServicePreloadConfigEnable";const AU=["live","rtm","music","danmu","ad"],RU=["configs","options","defaultConfig","current"],xU=["url","src","playUrl","playURL"],OU=["plugins","sdkPlugins","strategiesPlugins","presets"];class LU extends Error{constructor(e){super(`[VEPLAYER_LITE_UNSUPPORTED_FEATURE] ${e} 功能不受精简版支持,请改用 ${function(e){const t=(e||"").toUpperCase();return t.includes("BYTEPLUS")?"@byteplus/veplayer":t.includes("VOLCENGINE")?"@volcengine/veplayer":"@byted-vcloud/veplayer"}("BYTEPLUS")}。`),this.code="VEPLAYER_LITE_UNSUPPORTED_FEATURE",this.name="VePlayerLiteUnsupportedFeatureError",this.feature=e,Object.setPrototypeOf(this,LU.prototype)}}class NU extends Error{constructor(){super("[VEPLAYER_LITE_UNSUPPORTED_ENVIRONMENT] 当前环境不支持 Lite 版本使用"),this.code="VEPLAYER_LITE_UNSUPPORTED_ENVIRONMENT",this.name="VePlayerLiteUnsupportedEnvironmentError",Object.setPrototypeOf(this,NU.prototype)}}function MU(e){return"object"==typeof e&&null!==e||"function"==typeof e}function UU(e,t){if(MU(e))try{return e[t]}catch(hs){return}}function BU(e){try{return Array.isArray(e)}catch(hs){return!1}}function FU(e){if(!BU(e))return[];const t=UU(e,"length");if("number"!=typeof t||t<0||t>4294967295||Math.floor(t)!==t)return[];const i=[];for(let n=0;n<t;n+=1)i.push(UU(e,String(n)));return i}function HU(e){return null!=e&&!1!==e}function jU(e){return"string"==typeof e?e.toLowerCase():""}function VU(e){return"string"==typeof e&&e.split(/[?#]/,1)[0].toLowerCase().endsWith(".sdp")}function KU(e){return xU.some((t=>function(e){const t=[e],i=new WeakSet;for(let n=0;n<t.length;n+=1){const e=t[n];if(VU(e))return!0;if(MU(e)&&!i.has(e))if(i.add(e),BU(e))for(const i of FU(e))t.push(i);else for(const i of xU)t.push(UU(e,i))}return!1}(UU(e,t))))}function WU(e){if("string"==typeof e)return[e];if(!MU(e))return[];const t=[],i=UU(e,"pluginName"),n=UU(e,"name");return"string"==typeof i&&t.push(i),"string"==typeof n&&t.push(n),t}function GU(e,t){return OU.some((i=>FU(UU(e,i)).some((e=>function(e){const t=WU(e);return t.push(...WU(UU(e,"plugin"))),t.push(...WU(UU(e,"preset"))),t}(e).some((e=>function(e,t){const{compact:i,parts:n}=function(e){const t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().replace(/[\s_]+/g,"-").replace(/-+/g,"-");return{compact:t.replace(/-/g,""),parts:t.split("-")}}(t);switch(e){case"live":return"timeshiftplugin"===i||"liveinfopanel"===i||i.startsWith("livesubtitles");case"rtm":return"rtm"===i||"rtmplugin"===i;case"music":return i.includes("music");case"danmu":return i.includes("danmu");case"ad":return n.some((e=>"ad"===e||"ads"===e))||["ad","ads","adplugin","adsplugin"].includes(i)}}(t,e)))))))}function YU(e,t){switch(t){case"live":return!0===UU(e,"isLive")||"live"===jU(UU(e,"type"))||HU(UU(e,"TimeShiftPlugin"))||HU(UU(e,"LiveInfoPanel"))||HU(UU(e,"LiveSubtitlesPlugin"))||HU(UU(e,"LiveSubtitlesIconPlugin"));case"rtm":return"rtm"===jU(UU(e,"streamType"))||HU(UU(e,"rtm"))||KU(e);case"music":return!0===UU(e,"isMusic")||HU(UU(e,"music"));case"danmu":{const t=UU(e,"getVideoByToken");return HU(UU(e,"DanmuPlugin"))||!0===UU(e,"needBarrageMask")||!0===UU(t,"needBarrageMask")}case"ad":return HU(UU(e,"AdsPlugin"))||HU(UU(e,"AdPlugin"))}}function zU(e){const t=function(e){const t=[],i=[e],n=new WeakSet;for(let r=0;r<i.length;r+=1){const e=i[r];if(MU(e)&&!n.has(e)){n.add(e),t.push(e);for(const t of RU)i.push(UU(e,t));for(const t of FU(UU(e,"playList")))i.push(t)}}return t}(e);for(const i of AU)if(t.some((e=>YU(e,i)||GU(e,i))))throw new LU(i)}const $U=()=>Ur.generateSessionId(),XU=e=>"number"==typeof e&&Number.isFinite(e)&&e>=0?e:0,qU=e=>c({},e),ZU=(e,t)=>t.lastEnteredPlayingAt-e.lastEnteredPlayingAt||t.sequence-e.sequence,QU=(e,t)=>t.lastPlaybackAt-e.lastPlaybackAt||t.sequence-e.sequence,JU=(e,t)=>t.createdAt-e.createdAt||t.sequence-e.sequence,eB=(e,t,i="creating")=>({playbackSessionId:t,playbackState:i,isEnded:!1,isPaused:!1,isBeforePlayerCreate:!0,albumId:e.albumId,episodeId:e.episodeId,duration:0,currentTime:0});const tB=new class{constructor(e=Date.now,t=$U){this.now=e,this.createPlaybackSessionId=t,this.sessions=new Map,this.transactionResolvers=new WeakMap,this.historical=null,this.sequence=0}register(e,t){const i=this.now(),n=++this.sequence,r=this.createPlaybackSessionId();this.sessions.set(e,{vePlayer:e,playbackSessionId:r,pendingPlaybackSessionId:null,identity:c({},t),pendingIdentity:null,identitySwitchCore:null,pendingTransaction:null,identitySwitchArmed:!1,identitySwitchIsSameCore:!1,useStableSnapshot:!1,core:null,state:"creating",creationFailed:!1,hasEverPlayed:!1,isBuffering:!1,createdAt:i,lastEnteredPlayingAt:0,lastPlaybackAt:0,sequence:n,lastStableSnapshot:eB(t,r)})}has(e){return this.sessions.has(e)}beginCoreCreate(e,t){const i=this.sessions.get(e);i&&(!this.matchesPendingTransaction(i,t)&&i.pendingTransaction||(i.core=null,i.state="creating",i.creationFailed=!1,i.isBuffering=!1,this.matchesPendingTransaction(i,t)&&(i.identitySwitchCore=null,i.identitySwitchArmed=!1,i.identitySwitchIsSameCore=!1)))}failCoreCreate(e,t){const i=this.sessions.get(e);i&&(!this.matchesPendingTransaction(i,t)&&i.pendingTransaction||(i.core=null,i.state="error",i.creationFailed=!0,i.isBuffering=!1,this.matchesPendingTransaction(i,t)&&this.rollbackIdentitySwitch(e,t)))}attachCore(e,t,i){var n;const r=this.sessions.get(e);if(r&&(this.matchesPendingTransaction(r,i)||!r.pendingTransaction)){r.core=t,r.state="ready",r.creationFailed=!1,r.isBuffering=!1,this.matchesPendingTransaction(r,i)&&(r.identitySwitchCore=t,r.identitySwitchArmed=!0,r.identitySwitchIsSameCore=!1);for(const i of["play","playing","waiting","canplay","timeupdate","pause","ended","error"])null==(n=t.on)||n.call(t,i,(()=>this.handleCoreEvent(e,t,i)))}}handleCoreEvent(e,t,i){const n=this.sessions.get(e);if(n&&n.core===t&&("error"!==i&&"canplay"!==i||!n.pendingTransaction||n.identitySwitchArmed||n.identitySwitchCore!==t)){if("play"===i||"playing"===i){const e="playing"!==n.state,t=this.now();return n.hasEverPlayed=!0,n.isBuffering=!1,n.state="playing",n.lastPlaybackAt=t,void(e&&(n.lastEnteredPlayingAt=t))}if("waiting"!==i){if(n.isBuffering=!1,"canplay"===i)return n.pendingTransaction?n.identitySwitchArmed&&n.identitySwitchCore===t&&this.commitIdentitySwitch(e,n.pendingTransaction):(n.useStableSnapshot=!1,n.lastStableSnapshot=null),void(n.hasEverPlayed||(n.state="ready"));if("timeupdate"!==i)if("pause"!==i){if("ended"===i)return n.hasEverPlayed=!0,n.lastPlaybackAt=this.now(),void(n.state="ended");n.state="error",n.pendingTransaction&&n.identitySwitchArmed&&n.identitySwitchCore===t&&this.rollbackIdentitySwitch(e,n.pendingTransaction)}else n.hasEverPlayed&&(n.lastPlaybackAt=this.now(),n.state="paused");else n.hasEverPlayed&&(n.lastPlaybackAt=this.now(),n.state=t.paused?"paused":"playing")}else n.hasEverPlayed&&(n.isBuffering=!0,n.state="buffering")}}beginIdentitySwitch(e,t,i,n=!1,r){const o=this.sessions.get(e);if(!o)return null;if(!!o.pendingIdentity||!!o.pendingPlaybackSessionId){if(!this.matchesPendingTransaction(o,r))return null}else o.lastStableSnapshot=this.snapshotSession(o,null!=i?i:o.core).snapshot,o.identitySwitchCore=null!=i?i:o.core,o.identitySwitchArmed=!1,o.identitySwitchIsSameCore=!0,o.pendingTransaction=this.createIdentitySwitchTransaction();return o.pendingIdentity=c({},t),n&&!o.pendingPlaybackSessionId&&(o.pendingPlaybackSessionId=this.createPlaybackSessionId()),o.useStableSnapshot=!0,o.pendingTransaction}armIdentitySwitch(e,t,i){const n=this.sessions.get(e);return!(!n||n.core!==i||!this.matchesPendingTransaction(n,t))&&(n.identitySwitchCore=i,n.identitySwitchArmed=!0,n.identitySwitchIsSameCore=!0,!0)}hasActiveIdentitySwitch(e){var t;return!!(null==(t=this.sessions.get(e))?void 0:t.pendingTransaction)}commitIdentitySwitch(e,t){const i=this.sessions.get(e);if(!i||!i.pendingIdentity&&!i.pendingPlaybackSessionId||!this.matchesPendingTransaction(i,t))return;i.pendingIdentity&&(i.identity=i.pendingIdentity),i.pendingPlaybackSessionId&&(i.playbackSessionId=i.pendingPlaybackSessionId),i.pendingIdentity=null,i.pendingPlaybackSessionId=null,i.identitySwitchCore=null,i.identitySwitchArmed=!1,i.identitySwitchIsSameCore=!1;const n=i.pendingTransaction;i.pendingTransaction=null,i.useStableSnapshot=!1,i.lastStableSnapshot=null,this.settleTransaction(n)}rollbackIdentitySwitch(e,t){const i=this.sessions.get(e);if(!i||!this.matchesPendingTransaction(i,t))return;const n=!i.identitySwitchIsSameCore&&!!i.core&&i.core===i.identitySwitchCore,r=i.identitySwitchIsSameCore&&!!i.core&&i.core===i.identitySwitchCore;i.pendingIdentity=null,i.pendingPlaybackSessionId=null,i.identitySwitchCore=null,i.identitySwitchArmed=!1,i.identitySwitchIsSameCore=!1;const o=i.pendingTransaction;i.pendingTransaction=null,i.useStableSnapshot=!r&&!!i.lastStableSnapshot,r&&(i.lastStableSnapshot=null),n&&(i.core=null),this.settleTransaction(o)}destroy(e,t){const i=this.sessions.get(e);if(!i)return;const n=i.useStableSnapshot&&i.lastStableSnapshot?this.rank(i,qU(i.lastStableSnapshot)):this.snapshotSession(i,null!=t?t:i.core);n.snapshot=u(c({},n.snapshot),{playbackState:"destroyed",isBeforePlayerCreate:!1}),n.state="destroyed",this.settleTransaction(i.pendingTransaction),this.sessions.delete(e),n.hasEverPlayed&&(!this.historical||QU(n,this.historical)<0)&&(this.historical=n)}query(e){const t=[];for(const o of this.sessions.values()){if((o.pendingIdentity||o.pendingPlaybackSessionId||o.useStableSnapshot)&&o.lastStableSnapshot){t.push(this.rank(o,qU(o.lastStableSnapshot)));continue}const i=e.find((e=>e===o.core&&e.sdk===o.vePlayer));try{const e=this.snapshotSession(o,null!=i?i:null);o.lastStableSnapshot=qU(e.snapshot),t.push(e)}catch(hs){o.lastStableSnapshot&&t.push(this.rank(o,qU(o.lastStableSnapshot)))}}const i=t.filter((e=>"playing"===e.state||"buffering"===e.state)).sort(ZU)[0];if(i)return qU(i.snapshot);const n=t.filter((e=>e.hasEverPlayed)).concat(this.historical?[this.historical]:[]).sort(QU)[0];if(n)return qU(n.snapshot);const r=t.sort(JU)[0];return r?qU(r.snapshot):null}resetForTests(){this.sessions.clear(),this.historical=null,this.sequence=0}createIdentitySwitchTransaction(){let e;const t={settled:new Promise((t=>{e=t}))};return this.transactionResolvers.set(t,e),t}settleTransaction(e){if(!e)return;const t=this.transactionResolvers.get(e);t&&(this.transactionResolvers.delete(e),t())}matchesPendingTransaction(e,t){return!!t&&e.pendingTransaction===t}snapshotSession(e,t){if(!t){const t=e.creationFailed?"error":"creating";return this.rank(e,eB(e.identity,e.playbackSessionId,t))}const i=!!t.paused,n=!!t.ended;let r;return r=t.isError||"error"===e.state?"error":n||"ended"===e.state?"ended":e.hasEverPlayed&&i?"paused":e.hasEverPlayed&&e.isBuffering?"buffering":e.hasEverPlayed?"playing":"ready",this.rank(e,{playbackSessionId:e.playbackSessionId,playbackState:r,isEnded:n,isPaused:i,isBeforePlayerCreate:!1,albumId:e.identity.albumId,episodeId:e.identity.episodeId,duration:XU(t.duration),currentTime:XU(t.currentTime)})}rank(e,t){return{snapshot:t,state:t.playbackState,hasEverPlayed:e.hasEverPlayed,createdAt:e.createdAt,lastEnteredPlayingAt:e.lastEnteredPlayingAt,lastPlaybackAt:e.lastPlaybackAt,sequence:e.sequence}}};window.Player||(window.Player=Wa);const iB=class{constructor(e){this.player=null,this.mountingDom=null,this.playerContainer=null,this.mobilePanel=null,this._lastSelectedAudioTrack=null,this._suppressAudioTrackMemory=!1,this._suppressAudioTrackMemoryTimer=null,this._playNextPending=!1,this._isCollectingCreatePlayerPerf=!1,this._getDramaInfoPerfRecords=[],this._isFirstCreated=!0,this.sdkPlugins=[],this._sdkPlugins={},this.delayError=[],this._publicPlayNextOperation=null,this._lifecycleGeneration=0,this._isVolcengine=!1,this._originConfigs={},this.delayEvents=[],this.createPlayer=e=>d(this,null,(function*(){const t=this._lifecycleGeneration||0;tB.beginCoreCreate(this,e);try{const i=yield this._createPlayer(e,t);return this._isStaleLifecycleGeneration(t)?void this._discardStalePlayer(i):i}catch(QB){throw tB.failCoreCreate(this,e),QB}})),this._createPlayer=(e,...t)=>d(this,[e,...t],(function*(e,t=this._lifecycleGeneration||0){var i,n,r,o,a,s,l;this._createPlayerPerf=new Ms,this._isCollectingCreatePlayerPerf=!0;const f=this._createPlayerPerf;if(yield f.measureAsync("destroyPlayer",(()=>d(this,null,(function*(){yield this._destroyPlayer()})))),this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();if(yield this.beforePlayerCreate(),this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();zU(this.playerData);const{options:p,plugins:g,isMobile:y,openSoftDecoding:v,configs:m,strategiesPlugins:_,strategiesPluginConfigs:E}=this.playerData,T=!1,S=this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),b=this.playerData.getCurrentStreamType()||Es(null==m?void 0:m.getVideoByToken);zs(m,"EncryptHlsPlugin")||S&&b||this.playerData.isOpenABR()||(as.warn(`url is empty or streamType is empty (url:${S}, streamType: ${b})`),this.renderPoster());const C=()=>d(this,null,(function*(){const e=rl(S);return yield this.getSoftDecodingOption(v,e,b)})),k=yield f.measureAsync("createSDKPreset",(()=>d(this,null,(function*(){return yield mN({isLive:T,isMobile:y,streamType:b,playerData:this.playerData,getSoftOptionTask:C},this)}))));if(this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();const{presets:I,softDecodingOption:P,plugins:D}=k,w=y?function(e=!1){const t=c({},xN),i=c({},e?ON:LN);return c(c({},t),i)}(T):function(e=!1){const t=c({},DN),i=c({},e?wN:AN);return c(c({},t),i)}(T),{basicPlugins:A=[],iconPlugins:R=[]}=this._analyzeExtendPlugins(),x=P||{},{plugins:O=[]}=x,L=h(x,["plugins"]),N=this.getDefinitionConfig(),M=Ur.deepMerge(w,p),U=u(c(u(c(c(c({},{errorKey:SR}),M),L||{}),{definition:N,icons:c(c(c({},w.icons),{}),null!=(i=null==p?void 0:p.icons)?i:{}),MoreButtonPlugin:{iconPlugins:[...null!=(r=null==(n=p.MoreButtonPlugin)?void 0:n.iconPlugins)?r:[],...R,YN,HN,XN]}}),E),{playerData:this.playerData});this.playerData.getLineList().length>1&&U.MoreButtonPlugin.iconPlugins.push(KN),this.setDefaultConfigOptions(U);const B=function(e){const t=[];return e.forEach((e=>{t.find((t=>{var i,n;return(null==(i=null==t?void 0:t.pluginName)?void 0:i.toLowerCase())===(null==(n=null==e?void 0:e.pluginName)?void 0:n.toLowerCase())}))||t.push(e)})),t}([...A,...g,...D,...O,..._]),F=(null!=(o=null==U?void 0:U.ignores)?o:[]).some((e=>"sdkunmuteplugin"===(e+"").toLowerCase()));U.ignores=[...null!=(a=null==U?void 0:U.ignores)?a:[],...F?["AutoplayPlugin"]:[]],this._isFirstCreated?this._isFirstCreated=!1:(U.autoplayMuted=!1,U.ignores=[...null!=(s=null==U?void 0:U.ignores)?s:[],"sdkUnmutePlugin"]),this.setPluginConfig(U);const H={},j=null==(l=iB.ttDramaEnv)?void 0:l.videoSecurityModule;if(null==j?void 0:j.generateSignature){const e=yield f.measureAsync("videoSecuritySignature",(()=>d(this,null,(function*(){return yield j.generateSignature()}))));e&&(console.log("data-tt-sign: ",e),H["data-tt-sign"]=e)}if(this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();this._emitter.emit(OA.READY_CREATE_PLAYER);let V,K={};if(iB.shouldCheckLicense()){const e=yield iB.checkLicenseStatus();e!==SA.LICENSE_STATUS_OK&&e!==SA.LICENSE_STATUS_EXPIRED&&(K={progress:{closeMoveSeek:!0,isCloseClickSeek:!0},sdkErrorPlugin:{isNeedRefreshButton:!1}})}if(this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();if(f.measure("instantiatePlayer",(()=>{var e;V=new Wa(u(c(c({el:this.playerContainer,presets:I,url:S,isLive:!1},U),K),{videoAttributes:c(c({},null!=(e=U.videoAttributes)?e:{}),H),plugins:[...B]}))})),this._isStaleLifecycleGeneration(t))return this._discardStalePlayer(V),this._cancelStalePlayerCreation();this.player=V,V.playerData=this.playerData,V.sdk=this,tB.attachCore(this,V,e);const W=f.finish();return this._isCollectingCreatePlayerPerf=!1,this._lastCreatePlayerPerfReport=W,this.emit(OA.CREATE_PLAYER_PERF,W),as.log("createPlayer perf: ",W),this._emitter.emit(OA.PLAYER_CREATED_FINISH),this.afterPlayerCreate(),V})),this._onMp4PreloadInfo=e=>{this.emit(LA.PRELOAD_INFO,e)},this._proxyError=e=>this.emit(UA.ERROR,e),this._onError=e=>{var t;const{errorCode:i,httpCode:n,mediaError:r}=e||{};if(Ur.isMSE(null==(t=this.player)?void 0:t.media))n+""!="403"&&i+""!="9203"||this._emitExpireEvent("error",e);else if(4===(null==r?void 0:r.code)||2===(null==r?void 0:r.code)){const t=rl(this.playerData.getCurrentUrl());t&&Os(t,{range:"0-8",timeout:2e3}).then((t=>{as.log("xhr result",t);const{status:i,response:n}=t;403===i&&"string"==typeof n&&n.includes("expire")&&this._emitExpireEvent("error",e)})).catch((e=>{as.log("xhr error",e)}))}},this._onNativeAddTrack=()=>{var e,t;if(this._getHlsInstance())return;this._playNextPending=!1;const i=null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks;if(!i)return;const n=[];for(let r=0;r<i.length;r++){const e=i[r];n.push({id:e.id,name:e.label||e.language||e.id,lang:e.language,default:e.enabled,selected:e.enabled})}this._applyAudioPreferenceNative(i),this._emitter.emit(OA.AUDIO_TRACKS_UPDATED,{audioTracks:n})},this._onNativeTrackChange=()=>{var e,t;if(this._getHlsInstance())return;const i=null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks;if(i)for(let n=0;n<i.length;n++){const e=i[n];if(e.enabled){const t={id:n,name:e.label||e.language||String(n),lang:e.language,default:e.enabled,selected:!0};this._playNextPending||(this._lastSelectedAudioTrack=t),this._emitter.emit(OA.AUDIO_TRACK_CHANGE,{id:n,audioTrack:t});break}}},function(e){if(!e)throw new NU}(Boolean(iB.ttDramaEnv)),this.assertLiteConfig(e),tB.register(this,hU(e)),this._init(e)}static getPlayerPlaybackState(){var e,t,i;const n=null!=(i=null==(t=null==(e=Wa.instManager)?void 0:e.findAll)?void 0:t.call(e,(e=>!!(null==e?void 0:e.sdk)&&tB.has(e.sdk))))?i:[];return tB.query(n)}static registerModules(e){lA.registerModules(e)}static setAppendVideoUrlTimestamp(e=!0){!function(e=!0){PM=!!e}(e)}static getAppendVideoUrlTimestamp(){return PM}static setTTDramaEnv(e){var t;as.log("TTDramaEnv: ",e);iB.ttDramaEnv=u(c({},e),{channel:null!=(t=e.channel)?t:"byteplus"})}static setMediaInfoCacheConfig(e){!function(e){e?("boolean"==typeof e.enable&&(iM.enable=e.enable),e.cacheType&&(iM.cacheType=e.cacheType),"number"==typeof e.expireTime&&Number.isFinite(e.expireTime)&&e.expireTime>0?iM.expireTime=e.expireTime:void 0!==e.expireTime&&rM("config ignore invalid expireTime",{expireTime:e.expireTime,currentExpireTime:iM.expireTime}),"number"==typeof e.maxEntries&&Number.isFinite(e.maxEntries)&&e.maxEntries>0?iM.maxEntries=Math.floor(e.maxEntries):void 0!==e.maxEntries&&rM("config ignore invalid maxEntries",{maxEntries:e.maxEntries,currentMaxEntries:iM.maxEntries}),rM("config updated",aM())):rM("config skip empty config",{currentConfig:aM()})}(e)}static getMediaInfoCacheConfig(){return aM()}static clearMediaInfoCache(){sM()}static setDebug(e){!function(e){as.config.debug=e?3:1}(e)}static setCollector(e){Us=e}static shouldCheckLicense(){return!1}static prepare(e){return d(this,null,(function*(){let t=e;const i=Boolean(iB.ttDramaEnv);!(null==t?void 0:t.appId)&&i&&(t=u(c({},t),{appId:mR}));const n=null==t?void 0:t.serviceConfigMode,r=function(e,t){return"remote"===e||"local-only"===e?e:t?"local-only":"remote"}(n,i);void 0!==n&&"remote"!==n&&"local-only"!==n&&as.warn("[VePlayer.prepare] Invalid serviceConfigMode; using the environment default.");const o=function(e){var t,i;const n=null==(t=null==e?void 0:e.strategies)?void 0:t.preload,r="boolean"==typeof n;if(!n||!r&&(null==n?void 0:n.disabled))return e;const o=r?{}:n;return u(c({},e),{strategies:u(c({},e.strategies),{preload:u(c({},o),{[wU]:!0,config:u(c({},null!=(i=null==o?void 0:o.config)?i:{}),{[wU]:!0})})})})}(u(c({},t),{serviceConfigMode:r}));if(iB.shouldCheckLicense())try{iB.hasInitVeStrategy=!0;const e=yield iB.checkLicenseStatus(),t=yield iB.checkLicense();if(e===SA.LICENSE_STATUS_INVALID)throw new Error("LICENSE_STATUS_INVALID");if(t===_A.EDITION_STANDARD)throw new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(QB){return void as.error(QB.message)}else iB.hasInitVeStrategy=!0;yield gA.init(o)}))}static setPreloadScene(e,t){return gA.setPreloadScene(e,t)}static get preloader(){return gA.preloader}static get preloaderStatus(){return gA.preloaderStatus}static addPreloadList(e){return aU(e,iB.ttDramaEnv).then((e=>((null==e?void 0:e.length)||as.warn("[addPreloadList] resolved preloadList is empty"),gA.addPreloadList(e))))}static setPreloadList(e){return aU(e,iB.ttDramaEnv).then((e=>((null==e?void 0:e.length)||as.warn("[setPreloadList] resolved preloadList is empty"),as.log("[setPreloadList] resolved preloadList:",JSON.stringify(e)),gA.setPreloadList(e))))}static setLicenseConfig(e){return bA.setLicenseConfig(e)}static checkLicense(){return bA.checkLicense()}static checkModuleList(){return bA.checkModuleList()}static checkLicenseStatus(){return bA.checkLicenseStatus()}static checkLicenseModuleAuth(e,t){return bA.checkLicenseModuleAuth(e,t)}static generateEncryptInfo(e,t){return d(this,null,(function*(){try{const i={hls:Fw.HLSEncrypt,mp4:Fw.MP4Encrypt,dash:Fw.DASH};if(!t||!i[t])return void as.warn("param of streamType is invalid");const n=(new Date).getTime().toString(),r="mp4"===t?yield Vw.loadMp4Encrypt(cA):yield cA.loadPlugins(i[t]);return null==r?void 0:r.generateEncryptInfo(e,n)}catch(i){as.error("generate encrypt info error: ",i)}}))}assertLiteConfig(e){zU(e)}_init(e,t){return d(this,null,(function*(){var i;if(iB.ttDramaEnv){!(!e.url&&!e.playList)&&this.delayError.push(this._buildDramaInvalidParamError())}this._emitter=new Rr,this.renderDom({id:null==e?void 0:e.id,root:null==e?void 0:e.root});const n=iB.shouldCheckLicense()&&!(null==e?void 0:e.isLive)?yield iB.checkModuleList():Object.values(TA);this.playerData=hr.observe(new CA(u(c({},e),{licensSupportModuleList:n}),this)),this.adapter=this.playerData.adapter,this.initUmdLoader(e),this.on(OA.TOKEN_EXPIRED,this.onTokenExpiredAction.bind(this)),this.checkVodLogOptions(),this._initSdkPlugins();this.createPlayer(t).catch((e=>{if("VEPLAYER_LITE_UNSUPPORTED_FEATURE"===(null==e?void 0:e.code))return as.error("createPlayer error:",e),void this.emit(UA.ERROR,e);throw e})),this._initI18N(this.playerData.languageData),this._originConfigs={autoBitrateOpts:{enable:null==(i=null==e?void 0:e.autoBitrateOpts)?void 0:i.enable},useSoftDecoding:null==e?void 0:e.useSoftDecoding}}))}_initSdkPlugins(){bU.init(this);[...this.sdkPlugins].map((e=>bU.registerPlugin(e,this)))}_initCheckExpire(){this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null);const{enableUrlExpireCheck:e,urlCheckExpireInterval:t}=this.playerData.urlCheckData;e&&(this.checkExpireTimer=new Hs,this.checkExpireTimer.repeat(this._onRepeat.bind(this),t)),this.on(LA.MEDIA_EXPIRED,this._onMediaExpiredAction.bind(this))}initUmdLoader(e){this.sdkUmdLoader=new lA,this.updateUmdLoader(this.sdkUmdLoader,e)}updateUmdLoader(e,t){const{umdUrlMap:i,region:n,userRegion:r,pluginPublicPath:o,plugins:a=[]}=t;e.failCallback=(e,t)=>this.umdLoadErr(e,t),i&&"object"==typeof i&&e.updateBackupMap(t.umdUrlMap),e.region=n,e.userRegion=r,o&&"string"==typeof o&&(e.customPluginPublicPath=o),e.importedPlugins=a}checkVodLogOptions(){var e;const{isLive:t,configs:i}=this.playerData,n=zs(i,"vodLogOpts");if(!t&&!i.disableVodLogOptsCheck){if(null==(e=iB.ttDramaEnv)?void 0:e.clientKey)return;if(!(null==n?void 0:n.line_app_id)){const e={errorType:"log",errorCode:fR.VOD_LOG_NOT_CONFIGURED.code,errorMessage:"vod log options not configured or configured correctly",ext:{},originError:void 0};this.delayError.push(e)}}}umdLoadErr(e,t){this.emit(OA.UMD_LOAD_FAIL,{name:e,error:t})}_onRepeat(){const{urlExpireTimestamp:e,urlExpireDiff:t=60}=this.playerData.urlCheckData;Math.round((new Date).getTime()/1e3)>=e-t&&(this.playerData.urlCheckData.urlExpireTimestamp=Xa,this._emitExpireEvent("time"))}_emitExpireEvent(e="error",t){const i=Math.round((new Date).getTime()/1e3),n={errorCode:-499897,errorType:"network",errorMessage:"url expire",url:this.playerData.getCurrentUrl(),httpCode:403,version:"1.18.0-rc.9",ext:this,detectType:e,urlCheckData:this.playerData.urlCheckData,originError:t,from:"veplayer"};this.emitExpireTimestamp?i-this.emitExpireTimestamp>300&&(this.emitExpireTimestamp=i,as.warn("media is expired, ",n),this.emit(UA.MEDIA_EXPIRED,n)):(this.emitExpireTimestamp=i,as.warn("media is expired, ",n),this.emit(UA.MEDIA_EXPIRED,n))}on(e,t){this._emitter.on(e,t)}emit(e,t){this._emitter.emit(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}renderDom({id:e,root:t}){const i=document.createElement("div");this.playerContainer=i;const n=t||document.querySelector(`#${e}`);n&&(n.appendChild(i),this.mountingDom=n)}renderPoster(){if(!this.playerContainer)return;const{poster:e="",width:t,height:i}=this.playerData.options;("string"==typeof e?e:null==e?void 0:e.poster)&&(this.playerContainer.style.cssText=`background: url("${e}");\n background-size: cover;\n width:${t?t+"px":"100%"};\n height:${i?i+"px":"100%"};\n `)}getDefinitionConfig(){var e;const{current:{lineId:t},isVidEncrypt:i,configs:n,options:r}=this.playerData,o="hls"===(this.playerData.getCurrentStreamType()||Es(null==n?void 0:n.getVideoByToken))&&i&&!!(null==(e=zs(r,"EncryptHlsPlugin"))?void 0:e.keyToken);let a=this.playerData.getDefinitionListByLineId(t).map((e=>o?function(e,t){const i=c({},e);return t.forEach((e=>delete i[e])),i}(e,["secretKey","playAuth"]):e)),s=this.playerData.current.definition;return this.playerData.isOpenABR()&&(s=this.playerData.defaultDefinition,a=(null==a?void 0:a.length)&&!this.adapter.needAbrAutoDefinition()?a.filter((e=>!this.playerData.isAutoDefinition(e.definition))):a),{defaultDefinition:s,list:a}}checkLicenseCallback(){return d(this,null,(function*(){var e,t,i,n,r,o,a,s,l,h,d,f,p;const g=yield iB.checkLicense(),y=yield iB.checkLicenseStatus();if(this.player.licenseLogInfo={licenseStatus:y,licenseType:g},y===SA.LICENSE_STATUS_EXPIRED)bA.renderLogo(this.playerContainer),!this.playerData.isOpenABR()&&(null==(t=null==(e=null==this?void 0:this._originConfigs)?void 0:e.autoBitrateOpts)?void 0:t.enable)&&this.emit(OA.LICENSE_STATUS_WARNING,pR.EXPIRED_LICENSE_NOT_SUPPORT_ABR),(null==(n=null==(i=this.playerData.configs)?void 0:i.adaptRange)?void 0:n.enable)&&this.emit(OA.LICENSE_STATUS_WARNING,pR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER),!0===iB.hasInitVeStrategy&&this.emit(OA.LICENSE_STATUS_WARNING,pR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD);else if(y!==SA.LICENSE_STATUS_OK){null==(r=this.player.plugins.controls)||r.destroy(),null==(o=this.player.plugins.play)||o.destroy(),null==(a=this.player.plugins.sdkdefinitionplugin)||a.hide(),null==(s=this.player.plugins.definitionmobileplugin)||s.destroy(),null==(l=this.player.media)||l.removeAttribute("src");const e=u(c({errorType:gR.license},y===SA.LICENSE_STATUS_INVALID?{errorCode:fR.LICENSE_STATUS_INVALID.code,errorMessage:fR.LICENSE_STATUS_INVALID.message}:{errorCode:fR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH.code,errorMessage:fR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH.message}),{ext:{},originError:void 0});this.delayError.push(e)}else g===_A.EDITION_STANDARD&&(!this.playerData.isOpenABR()&&(null==(d=null==(h=this._originConfigs)?void 0:h.autoBitrateOpts)?void 0:d.enable)&&this.emit(OA.LICENSE_STATUS_WARNING,pR.BASE_LICENSE_NOT_SUPPORT_ABR),(null==(p=null==(f=this.playerData.configs)?void 0:f.adaptRange)?void 0:p.enable)&&this.emit(OA.LICENSE_STATUS_WARNING,pR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER),!0===iB.hasInitVeStrategy&&this.emit(OA.LICENSE_STATUS_WARNING,pR.BASE_LICENSE_NOT_SUPPORT_PRELOAD))}))}setPluginConfig(e){var t,i,n,r,o;const{apiMap:a,configs:s,unionInfo:l,playList:h,useHlsPluginForSafari:d,isMobile:f}=this.playerData,p=this.playerData.getCurrentStreamType()||Es(null==s?void 0:s.getVideoByToken),g=zs(s,"EncryptHlsPlugin"),y=zs(e,"EncryptHlsPlugin"),v=zs(s,"Mp4EncryptPlayer"),m=zs(e,"Mp4EncryptPlayer"),_=zs(s,"DASHPlugin"),E=zs(e,"DASHPlugin"),T=zs(s,"vodLogOpts"),S=(null==(t=iB.ttDramaEnv)?void 0:t.clientKey)?{appVersion:iB.ttDramaEnv.appVersion,clientKey:iB.ttDramaEnv.clientKey,line_app_id:mR,line_user_id:As(iB.ttDramaEnv.clientKey)}:{},b=!!(null==(i=null==h?void 0:h[0])?void 0:i.kid)||!!g;g&&(e.EncryptHlsPlugin=c(c(c({playDomain:a.playDomain,getKeyType:"TOP",preferMMS:!0,preferMMSStreaming:!0},f||!tl||d?{}:{useHls:!1}),y||{}),g)),v&&(e.Mp4EncryptPlayer=c(c({playDomain:a.playDomain,preferMMS:!0,getKeyType:"TOP"},m||{}),v)),_&&(e.DASHPlugin=c(c({playDomain:a.playDomain,getKeyType:"TOP"},E||{}),_));const{vid:C}=s,{encryptSessionId:k,current:I,drmType:P}=this.playerData,{kid:D,secretKey:w}=I;if(P===or.PRIVATE_ENCRYPT_UPGRADE&&k&&w&&("hls"===p?e.EncryptHlsPlugin=c(c({vid:C,kid:D,useUnionInfoDRM:!0,sessionId:k,drmType:or.PRIVATE_ENCRYPT_UPGRADE,keyTokenExpiredDuration:9999999,secretKey:w,preferMMS:!0,preferMMSStreaming:!0},y||{}),g||{}):"dash"===p?e.DASHPlugin=c(c({playInfoType:"TOP",useEME:!0,keyTokenExpiredDuration:9999999,useUnionInfoDRM:!0,defaultFormat:"dash",replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3,vid:C,kid:D,drmType:or.PRIVATE_ENCRYPT_UPGRADE,secretKey:w,sessionId:k},E||{}),_||{}):"mp4"===p&&(e.Mp4EncryptPlayer=c(c({vid:C,kid:D,isEncrypt:!0,rangeMaxDuration:10,keyTokenExpiredDuration:9999999,retryCount:3,useUnionInfoDRM:!0,sessionId:k,drmType:or.PRIVATE_ENCRYPT_UPGRADE,secretKey:w,preferMMS:!0},m||{}),v||{}))),s.privateDrmAuthToken&&s.kid&&l&&("hls"===p?e.EncryptHlsPlugin=c(c({kid:s.kid,drmKeyToken:s.privateDrmAuthToken,playDomain:a.playDomain,preferMMS:!0,preferMMSStreaming:!0},y||{}),g||{}):"dash"===p?e.DASHPlugin=c(c({kid:s.kid,drmKeyToken:s.privateDrmAuthToken,playDomain:a.playDomain},E||{}),_||{}):"mp4"===p&&(e.Mp4EncryptPlayer=c(c({kid:s.kid,drmKeyToken:s.privateDrmAuthToken,playDomain:a.playDomain,preferMMS:!0},m||{}),v||{}))),T||S.clientKey){as.log("codec",this.playerData.codec);const t=il(this.userRegion,this.region),i=null==t?void 0:t.__LOG_CUSTOM_REGION__,n=null==t?void 0:t.__LOG_CHANNEL_DOMAIN__;e.vodLogOpts=c(c(u(c(c({vtype:(p||"mp4").toUpperCase(),codec_type:this.playerData.codec,drm_type:b?1:0,playerVersion:"1.18.0-rc.9",channel:null==t?void 0:t.__LOG_CHANNEL__,needXhrCheck:!0,enableTeaWebId:!0},i?{trackerConfig:{log_from_region:null==t?void 0:t.__LOG_CUSTOM_REGION__}}:{}),n?{channelDomain:n}:{}),{ext:this.vodLogCommon}),S),T||{})}null==(n=this.getSdkPlugin("Abr"))||n.applyAbrConfig(e),null==(r=this.getSdkPlugin("AdaptRange"))||r.applyRangeConfig(e),null==(o=this.getSdkPlugin("Strategy"))||o.applyFinalStrategy(e)}detectCodec(e){return d(this,null,(function*(){var t;try{const{LoadProbe:i}=(yield this.sdkUmdLoader.loadPlugins(Fw.StreamProbe))||{};if(i){const n=yield null==(t=new i)?void 0:t.parseUrl(e),{codec:r}=n||{};"bytevc1"===r?this.playerData.codec=tr.H265:"avc"===r&&(this.playerData.codec=tr.H264)}}catch(hs){as.warn("detect codec error: ",hs)}}))}setDefaultConfigOptions(e){if(!this._isFirstCreated)return;const{defaultConfig:t,isHitDefault:i}=this.playerData;if(!t)return;const{volume:n,startTime:r,DanmuPlugin:o,LiveSubtitlesIconPlugin:a}=null!=t?t:{};n&&(e.volume=e.volume?u(c({},e.volume),{default:n}):n),i&&r&&(e.startTime=r)}getCurrentPlayerConfig(){var e,t;const{isLive:i,current:{lineId:n,definition:r}}=this.playerData,o={type:i?"live":"vod",isLive:i,definition:r,lineId:n,volume:null!=(e=this.player.volume)?e:.6};return i||(o.startTime=null!=(t=this.player.currentTime)?t:0),c({},o)}getStreamType(){var e,t;return this.playerData.getCurrentStreamType()||Es(null==(t=null==(e=this.playerData)?void 0:e.configs)?void 0:t.getVideoByToken)}_analyzeExtendPlugins(){var e;const{options:t}=this.playerData,i=t.extendPlugin||[],n=null!=(e=null==t?void 0:t.ignore)?e:[],r=[],o=[];return i.forEach((e=>{const t=MN(e);"inner"!==t.type||n[e.pluginName]?r.push(t):o.push(t)})),{basicPlugins:r,iconPlugins:o}}beforePlayerCreate(){return d(this,null,(function*(){const e=this._createPlayerPerf;e?yield e.measureAsync("beforePlayerCreate",(()=>d(this,null,(function*(){yield Promise.all([e.measureAsync("beforePlayerCreate.sdkPlugins",(()=>d(this,null,(function*(){yield bU.beforePlayerCreate(this)})))),e.measureAsync("beforePlayerCreate.prepareStrategies",(()=>d(this,null,(function*(){yield this.prepareStrategies()}))))]),e.measure("beforePlayerCreate.updateConfigByStrategy",(()=>{this.updateConfigByStrategy()}))})))):(yield Promise.all([bU.beforePlayerCreate(this),this.prepareStrategies()]),this.updateConfigByStrategy())}))}getCreatePlayerPerfReport(){return this._lastCreatePlayerPerfReport}recordGetDramaInfoPerf(e){var t,i,n;if(null==e?void 0:e.perfInfo){this._getDramaInfoPerfRecords=this._getDramaInfoPerfRecords||[],this._getDramaInfoPerfRecords.push(e),this._markGetDramaInfoClientPerf(e);try{null==(n=null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.onGetDramaInfoPerf)||n.call(i,e)}catch(r){as.error("onGetDramaInfoPerf callback error:",r)}}}getDramaInfoPerfRecords(){return[...this._getDramaInfoPerfRecords||[]]}getLastDramaInfoPerf(){const e=this._getDramaInfoPerfRecords||[];return e[e.length-1]}_markGetDramaInfoClientPerf(e){if(!this._isCollectingCreatePlayerPerf||!this._createPlayerPerf)return;const t=e.perfInfo,i=(e,t)=>{var i;"number"==typeof t&&(null==(i=this._createPlayerPerf)||i.markDuration(`beforePlayerCreate.authtoken.getVideoInfo.getVideos.getDramaInfoViaJSB.perfInfo.${e}`,t))};i("prepareCost",t.prepare_cost),i("requestCost",t.request_cost),i("parseCost",t.parse_cost),i("totalCost",t.total_cost)}prepareStrategies(){return d(this,null,(function*(){if(yield gA.prepare()){const{plugins:e,pluginConfiguration:t}=gA.getStrategyRecommendations();this.playerData.strategiesPlugins=e,this.playerData.strategiesPluginConfigs=t}else this.playerData.strategiesPlugins=[],this.playerData.strategiesPluginConfigs={}}))}updateConfigByStrategy(){if(gA.isReady()){const e=gA.getStrategyRecommendations(),{result:t}=e;if(as.log("vodLogCommon strategyConfig:",t),this.vodLogCommon={strategyResult:t},null==t?void 0:t[uA.H265]){const{configs:e}=this.playerData;if(!e)return;const{url:i,codec:n}=e,r=this.playerData.playList||[],o=r.filter((e=>!e.codec||e.codec===tr.UNKNOWN)),a=r.filter((e=>e.codec===tr.H264)),s=r.filter((e=>e.codec===tr.H265)),l=t[uA.H265].enableH265Hardware,h=er(l?s.concat(a).concat(o):a.concat(o).concat(s),"definition"),d=!l&&!!i&&n===tr.H265&&h.length>0;this.playerData.initPlayData(u(c({},this.playerData.configs),{url:d?null:i,codec:d?tr.UNKNOWN:n,playList:h})),as.log("hit h265strategy, current playList: ",this.playerData.playList)}}}afterPlayerCreate(){const{isMobile:e,isLive:t}=this.playerData;iB.shouldCheckLicense()&&!t&&this.checkLicenseCallback(),this._setVeError(),this._mountingPlayerPanel(e),this._mountingExtendMethods(),this._bindSdkEvents(),this._bindPlayerEvents(),this._setPlayerInfo(),this._initCheckExpire(),bU.afterPlayerCreate(this)}_setVeError(){var e;const t=this.playerData.configs,i={oriErrRetryCount:t.oriErrRetryCount,oriErrRetryCycle:t.oriErrRetryCycle,oriErrRetryBaseDelay:t.oriErrRetryBaseDelay,oriErrMaxTotalRetry:t.oriErrMaxTotalRetry,enableOriErrRetry:t.enableOriErrRetry,needSyncAnalyzeError:t.needSyncAnalyzeError,analyzeTimeout:t.analyzeTimeout,clientKey:null==(e=iB.ttDramaEnv)?void 0:e.clientKey};this.veErrorIns=new wR(this.player,i)}_emitDelayError(){this.player&&this.delayError.forEach((e=>{this.player.emit(UA.ERROR,e)})),this.delayError=[]}_emitDelayEvent(){this.player&&this.delayEvents.forEach((e=>{const{name:t,payload:i}=e||{};t&&this.emit(t,i)})),this.delayEvents=[]}_setPlayerInfo(){this.player&&(this.player.playerVersion="1.18.0-rc.9",this.player.vtype=this.getVtype())}getVtype(){var e,t,i;const n=this.getStreamType()||Es(null==(t=null==(e=this.playerData)?void 0:e.configs)?void 0:t.getVideoByToken),r=Ur.isMSE(this.player.media);return!this.player.playerType&&(this.player.playerType=n,"hls"===(null==n?void 0:n.toLowerCase())&&(null==(i=this.player)?void 0:i.vodLogger))?r?"HLS_MSE":"HLS":n.toUpperCase()}_mountingPlayerPanel(e){var t;const{options:i,isLive:n}=this.playerData;this.player&&e&&(this.mobilePanel=new UN({config:null!=(t=i.panel)?t:{mode:n?za.INNER:za.NORMAL,isAutoChange:!0},root:this.player.root,player:this.player}),this.player.panel=this.mobilePanel)}_onPlayerRebuild(){if(!this._publicPlayNextOperation&&!tB.hasActiveIdentitySwitch(this))return this.createPlayer()}_getPlayerRebuildListener(){return this._playerRebuildListener||(this._playerRebuildListener=()=>this._onPlayerRebuild()),this._playerRebuildListener}_bindPlayerEvents(){var e;if(!this.player)return;this.player.on(OA.PLAYER_REBUILD,this._getPlayerRebuildListener()),this.player.once(UA.READY,this._emitDelayError.bind(this)),this.player.once(UA.READY,this._emitDelayEvent.bind(this)),this.player.on(UA.ERROR,this._onError),this.player.on(SR,this._proxyError);const t=null==(e=this.player.plugins)?void 0:e.mp4encryptplayer;t&&t.on(LA.PRELOAD_INFO,this._onMp4PreloadInfo)}_onMediaExpiredAction(){var e,t;if(this.emitExpireTimestamp=Math.round((new Date).getTime()/1e3),(null==(e=this.playerData)?void 0:e.onMediaExpired)&&"function"==typeof(null==(t=this.playerData)?void 0:t.onMediaExpired)){const e=Gs(this.playerData.onMediaExpired());(null==e?void 0:e.then)&&e.then((e=>this.updateMediaSource(e)))}}updateMediaSource(e){try{this.assertLiteConfig(e)}catch(r){return Promise.reject(r)}const{url:t,playList:i,getVideoByToken:n}=e||{};return t||(null==i?void 0:i.length)?new Promise(((t,n)=>{this.playerData.updateConfigs(e),this.playerData.updatePlayList(),this.playerData.updateCheckExpireData();const r=this.playerData.getCurrentUrl();if(this.player.isError||this.player.state<6&&Kr.isWeixin&&Kr.os.isIos){if(!(null==i?void 0:i.length))return this.playNext(c({},e),!1);{const t=this.playerData.current.definition,n=i.find((e=>e.definition===t));if(n&&n.url)return this.playNext(u(c({},e),{url:n.url}),!1)}}else{this.player.setConfig(u(c({},e),{url:r,definition:this.getDefinitionConfig()}));const i=this.player.switchURL(r,{seamless:!0});i&&i.then?(i.then((()=>t(void 0))),i.catch((()=>n()))):t(void 0)}})):(null==n?void 0:n.playAuthToken)?this.updateAuthToken(n):void 0}onTokenExpiredAction(){var e,t;if((null==(e=this.playerData)?void 0:e.onTokenExpired)&&"function"==typeof(null==(t=this.playerData)?void 0:t.onTokenExpired)){const e=Gs(this.playerData.onTokenExpired());(null==e?void 0:e.then)&&e.then((e=>this.updateAuthToken(e)))}}_bindSdkEvents(){const e=Object.values(Go).filter((e=>e!==Qr)),t=[...Object.values(LA),...Object.values(OA),...e];[...new Set(t.filter((e=>"string"==typeof e)))].forEach((e=>{"string"==typeof e&&this.player.on(e,((...t)=>{this._emitter.emit(e,...t)}))})),this.player.on("hlsAudioTracksUpdated",(e=>{this._applyAudioPreference(e.audioTracks),this._emitter.emit(OA.AUDIO_TRACKS_UPDATED,e)})),this.player.on("hlsAudioTrackSwitched",(e=>{var t,i,n,r,o;const a=this._getHlsInstance(),s=null==(t=null==a?void 0:a.audioTracks)?void 0:t.find((t=>t.id===e.id));if(this._suppressAudioTrackMemory)this._clearSuppressAudioTrackMemory();else{s&&(this._lastSelectedAudioTrack=s);const e=null!=(r=null==(n=null==(i=this.playerData)?void 0:i.configs)?void 0:n.audioTrackSwitchSeekOffset)?r:.1,t=null==(o=this.player)?void 0:o.media;e>0&&t&&!t.paused&&isFinite(t.currentTime)&&(t.currentTime+=e)}this._emitter.emit(OA.AUDIO_TRACK_CHANGE,u(c({},e),{audioTrack:s}))})),this._bindNativeAudioTrackEvents()}_bindNativeAudioTrackEvents(){var e,t;const i=null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks;i&&(i.addEventListener("addtrack",this._onNativeAddTrack),i.addEventListener("change",this._onNativeTrackChange),i.addEventListener("removetrack",this._onNativeAddTrack))}_mountingExtendMethods(){this.player&&(this.player.changePluginsIcon=this.changePluginsIcon.bind(this))}_getHlsInstance(){var e,t,i;const n=null==(e=this.player)?void 0:e.plugins;return(null==(t=null==n?void 0:n.encrypthlsplugin)?void 0:t.hls)||(null==(i=null==n?void 0:n.hls)?void 0:i.hls)}_applyAudioPreference(e){var t,i,n,r;if(!(null==e?void 0:e.length))return;const o=this._getHlsInstance();if(!o)return;const a=null!=(r=null!=(n=this._lastSelectedAudioTrack)?n:null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.audioPreference)?r:{};if(0===Object.keys(a).length)return;this._setSuppressAudioTrackMemory();const s=o;if("function"==typeof s.setAudioOption)s.setAudioOption(GA(a));else{const t=a.lang;if(!t)return void this._clearSuppressAudioTrackMemory();const i=e.findIndex((e=>{var i;return(null==(i=e.lang)?void 0:i.toLowerCase())===t.toLowerCase()}));-1!==i&&o.audioTrack!==i?o.audioTrack=i:this._clearSuppressAudioTrackMemory()}}_setSuppressAudioTrackMemory(){this._suppressAudioTrackMemory=!0,null!==this._suppressAudioTrackMemoryTimer&&clearTimeout(this._suppressAudioTrackMemoryTimer),this._suppressAudioTrackMemoryTimer=setTimeout((()=>{this._suppressAudioTrackMemory=!1,this._suppressAudioTrackMemoryTimer=null}),2e3)}_clearSuppressAudioTrackMemory(){this._suppressAudioTrackMemory=!1,null!==this._suppressAudioTrackMemoryTimer&&(clearTimeout(this._suppressAudioTrackMemoryTimer),this._suppressAudioTrackMemoryTimer=null)}_applyAudioPreferenceNative(e){var t,i,n;if(!(null==e?void 0:e.length))return;const r=[this._lastSelectedAudioTrack,null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.audioPreference];for(const o of r){if(!o)continue;const t=o.id,i=o.lang,r=o.name;if(void 0===t&&!i&&!r)continue;let a=-1;for(let o=0;o<e.length;o++){const s=e[o];if((void 0===t||o===Number(t))&&!(i&&(null==(n=s.language)?void 0:n.toLowerCase())!==i.toLowerCase()||r&&s.label!==r)){a=o;break}}if(-1!==a)return void YA(e,a)}}_offPlayerEvents(){var e;if(!this.player)return;this.player.off(OA.PLAYER_REBUILD,this._getPlayerRebuildListener()),this.player.off(UA.ERROR,this._onError),this.player.off(SR,this._proxyError);const t=null==(e=this.player.plugins)?void 0:e.mp4encryptplayer;null==t||t.off(LA.PRELOAD_INFO,this._onMp4PreloadInfo)}changePluginsIcon(e,t){var i;if(!this.player)return;const n=this.player.getPlugin(e);if(!n||!(null==n?void 0:n.root))return;const r=Ur.hasClass(null==n?void 0:n.parent,"panel-icon-svg")?null==(i=null==n?void 0:n.parent)?void 0:i.parentNode:null==n?void 0:n.root;r&&(t?Ur.show(r,"block"):Ur.hide(r))}getSdkPlugin(e){var t;const i=null==(t=this._sdkPlugins)?void 0:t[e.toLowerCase()];return i&&i.pluginName?i:null}switchAuthToken(e,t=!0){try{this.assertLiteConfig({getVideoByToken:e})}catch(i){return Promise.reject(i)}return this._performAuthTokenSwitch(e,t)}_switchAuthToken(e,t,i){return this._performAuthTokenSwitch(e,t,i).then((()=>{i&&tB.commitIdentitySwitch(this,i)})).catch((e=>{throw i&&tB.rollbackIdentitySwitch(this,i),e}))}_performAuthTokenSwitch(e,t,i){const n=t?0:this.player.currentTime,r=this.getSdkPlugin("AuthToken");return r&&this.player?this._runDestroyableSourceSwitch((o=>r.updateAuthToken(e,t).then((()=>(o(),this._playerPlayNext(n,i)))).then((()=>{})))):(as.error("current is not playAuthToken play or player not created"),Promise.reject())}updateAuthToken(e){try{this.assertLiteConfig({getVideoByToken:e})}catch(i){return Promise.reject(i)}const t=this.getSdkPlugin("AuthToken");return new Promise(((i,n)=>{t&&this.player?t.updateAuthToken(e,!1).then((()=>{if(this.player.isError)this._playerPlayNext(this.player.currentTime).then((()=>i())).catch((()=>n()));else{const e=this.playerData.getCurrentUrl();this.player.setConfig({url:e,definition:this.getDefinitionConfig()});const t=this.player.switchURL(e,{seamless:!0});t&&t.then?(t.then((()=>i())),t.catch((()=>n()))):i()}})).catch((e=>n(e))):(as.error("current is not playAuthToken play or player not created"),n())}))}_playerPlayNext(e=0,t){const i=this.player;return new Promise(((n,r)=>{var o,a,s;const l=i.paused&&!i.isError;i.addClass(Pa.ENTER);const h=this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),d=u(c(c({},this.playerData.options),this._getDramaConfigPatchForPlayer()),{definition:this.getDefinitionConfig(),startTime:e,autoplay:!0,url:h});d.poster&&i.plugins.poster&&i.plugins.poster.update(d.poster),this.setPluginConfig(d);let f=!t,p=!1,g=()=>{};const y=[],v=(e,t)=>{y.push([e,t]),i.once(e,t)},m=e=>{p||(p=!0,g(),(()=>{for(const[e,t]of y)i.off(e,t);y.length=0})(),e())};g=this._registerSourceSwitchAborter((e=>{m((()=>r(e)))}));const _=(e,t)=>{const i=(...n)=>{f?m((()=>t(...n))):v(e,i)};v(e,i)};_(UA.ERROR,(e=>r(e))),_(UA.CANPLAY,(()=>{l&&i.pause(),n(!0)})),v(UA.EMPTIED,(()=>{!f&&t&&(f=tB.armIdentitySwitch(this,t,i))}));try{if(i.plugins.dashplugin){const e=c(c({},zs(i.config,"DASHPlugin")),this.playerData.options.DASHPlugin||{});e.dashOpts=this.playerData.dashOpts,e.vid=null==(a=null==(o=this.playerData.dashOpts)?void 0:o.Data)?void 0:a.Vid,i.plugins.drm&&(null==(s=i.plugins.drm)||s.restart()),i.setConfig(d),i.plugins.dashplugin.next(i.currentTime,"NEXT",e)}else i.playNext(d)}catch(QB){m((()=>r(QB)))}}))}get src(){var e,t;return(null==(e=this.player)?void 0:e.currentSrc)||(null==(t=this.player)?void 0:t.src)}set src(e){this.player&&(this.player.src=e)}switchURL(e){try{this.assertLiteConfig({url:e})}catch(n){return Promise.reject(n)}const t=this.player.switchURL(e,!1),i=this.player.currentTime;return t&&t.then?t:new Promise((e=>{const t=this.player.paused&&!this.player.isError,n=()=>{this.player.currentTime=i,t&&this.player.once(UA.CANPLAY,(()=>{this.player.pause()})),e()};Kr.os.isAndroid?this.once(UA.TIME_UPDATE,(()=>{n()})):this.once(UA.CANPLAY,(()=>{n()})),this.player.play()}))}next(e,t=!0){try{this.assertLiteConfig(e)}catch(i){return Promise.reject(i)}return this._publicPlayNextOperation||tB.hasActiveIdentitySwitch(this)?Promise.reject(this._createPlayNextInProgressError()):this._next(e,t)}_next(e,t=!0,i){var n;const r=this._lifecycleGeneration||0,o=t?0:this.player.currentTime,a=this.playerData.configs,s=this._applyIncomingIdentityAliases(c(u(c({},a),{startTime:o,autoplay:!0}),e),e);(null==(n=null==e?void 0:e.getVideoByToken)?void 0:n.playAuthToken)&&(s.streamType=Es(null==e?void 0:e.getVideoByToken)||nr.MP4);const l=tB.beginIdentitySwitch(this,hU(s),this.player,t,i);return l?this._teardown(!0).then((()=>{if(this._isStaleLifecycleGeneration(r))throw this._createDestroyedPlaybackSwitchError();return this._init(s,l)})).catch((e=>{if(tB.rollbackIdentitySwitch(this,l),this._isDestroyedPlaybackSwitchError(e))throw e;if(as.error("next_error",e),"VEPLAYER_LITE_UNSUPPORTED_FEATURE"===(null==e?void 0:e.code))throw e})):Promise.reject(this._createPlayNextInProgressError())}playNext(e,t=!0){try{this.assertLiteConfig(e)}catch(s){return Promise.reject(s)}if(this._publicPlayNextOperation||tB.hasActiveIdentitySwitch(this))return Promise.reject(this._createPlayNextInProgressError());const i={};this._publicPlayNextOperation=i;const n=this.player;try{n.emit(LA.PLAY_NEXT_START)}catch(s){return this._publicPlayNextOperation===i&&(this._publicPlayNextOperation=null),Promise.reject(s)}let r,o=null;try{const i=this._createDramaPlayNextCandidateConfig(e);if(o=tB.beginIdentitySwitch(this,hU(i),this.player,t),!o)throw this._createPlayNextInProgressError();this._lastSelectedAudioTrack=null,this._clearSuppressAudioTrackMemory(),this._playNextPending=!0,r=this._playNext(e,t,o)}catch(s){o&&tB.rollbackIdentitySwitch(this,o),r=Promise.reject(s)}const a=r.catch((e=>{throw o&&tB.rollbackIdentitySwitch(this,o),e}));return o?o.settled.then((()=>{this._publicPlayNextOperation===i&&(this._publicPlayNextOperation=null)})):a.finally((()=>{this._publicPlayNextOperation===i&&(this._publicPlayNextOperation=null)})).catch((()=>{})),a.finally((()=>{n.emit(LA.PLAY_NEXT_END)})).catch((()=>{})),a}_createPlayNextInProgressError(){return new Error("VePlayer playNext is already in progress")}_registerSourceSwitchAborter(e){this._sourceSwitchAborters||(this._sourceSwitchAborters=new Set);const t=this._sourceSwitchAborters;return t.add(e),()=>{t.delete(e),0===t.size&&this._sourceSwitchAborters===t&&(this._sourceSwitchAborters=void 0)}}_abortSourceSwitches(){const e=this._sourceSwitchAborters;if(this._sourceSwitchAborters=void 0,!e)return;const t=this._createDestroyedPlaybackSwitchError();for(const i of e)i(t)}_runDestroyableSourceSwitch(e){return new Promise(((t,i)=>{let n=!1,r=()=>{};const o=()=>{if(n)throw this._createDestroyedPlaybackSwitchError()},a=e=>{n||(n=!0,r(),e())};r=this._registerSourceSwitchAborter((e=>{a((()=>i(e)))}));try{Promise.resolve(e(o)).then((e=>a((()=>t(e)))),(e=>a((()=>i(e)))))}catch(QB){a((()=>i(QB)))}}))}_createDestroyedPlaybackSwitchError(){return new Error("VePlayer destroyed during playback switch")}_isDestroyedPlaybackSwitchError(e){return e instanceof Error&&"VePlayer destroyed during playback switch"===e.message}_isStaleLifecycleGeneration(e){return e!==(this._lifecycleGeneration||0)}_cancelStalePlayerCreation(){this._isCollectingCreatePlayerPerf=!1}_discardStalePlayer(e){var t;if(e){this.player===e&&(this.player=null);try{const i=null==(t=e.destroy)?void 0:t.call(e);(null==i?void 0:i.catch)&&i.catch((()=>{}))}catch(i){}}}updatePlayNextSubtitleConfig(e,t){var i,n,r,o;const a=zs(e,"Subtitle"),s=Array.isArray(null==a?void 0:a.list);if(!s&&!t)return;const l=s?a.list:[],h=u(c(c(c({},zs(this.playerData.options,"Subtitle")||{}),zs(this.playerData.configs,"Subtitle")||{}),a||{}),{list:l});e.Subtitle=h,this.playerData.updateConfigs({Subtitle:h}),this.playerData.options.Subtitle=h,null==(o=null==(r=null==(n=null==(i=this.player)?void 0:i.plugins)?void 0:n.subtitle)?void 0:r.updateSubtitles)||o.call(r,l)}_playNext(e,t=!0,i){var n,r,o;if(!e)return Promise.reject();const{url:a,playList:s,getVideoByToken:l}=e,h=this.player.paused&&!this.player.isError,d=t?0:this.player.currentTime;if(a||(null==s?void 0:s.length)){this._applyIncomingIdentityAliases(this.playerData.configs,e),this.playerData.updateConfigs(e),this.playerData.initPlayData(e);const n=this.adapter.canOpenAbr()&&this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),r=this.player,o=r.state,a=this.getDefinitionConfig(),s=u(c({startTime:d},e),{url:n,definition:a});return this.updatePlayNextSubtitleConfig(s,t),this.setPluginConfig(s),new Promise(((e,t)=>{let n=!1,a=!1,l=()=>{};const c=[],u=(e,t)=>{const i=(...i)=>{n||e===UA.EMPTIED?t(...i):u(e,t)};c.push([e,i]),r.once(e,i)},d=e=>{a||(a=!0,l(),(()=>{var e;for(const[t,i]of c)null==(e=r.off)||e.call(r,t,i);c.length=0})(),e())};l=this._registerSourceSwitchAborter((e=>{d((()=>t(e)))})),u(UA.ERROR,(e=>{d((()=>t(e)))})),u(UA.CANPLAY,(()=>{d((()=>{6===o&&h?r.pause():6!==o&&r.config.autoplay&&r.play(),e(void 0)}))}));const f=()=>{n||(n=!i||tB.armIdentitySwitch(this,i,r))};c.push([UA.EMPTIED,f]),r.once(UA.EMPTIED,f);try{r.playNext(s)}catch(p){d((()=>t(p)))}}))}if(iB.ttDramaEnv){if(null==(n=e.getVideoByToken)?void 0:n.playAuthToken){if((this.playerData.getCurrentStreamType()||Es(null==(r=this.playerData.configs)?void 0:r.getVideoByToken))!==(e.streamType||Es(null==e?void 0:e.getVideoByToken)||"mp4"))return this._next(e,t,i)}const o=this._createDramaPlayNextCandidateConfig(e);return i?this.switchDramaEpisode(o,t,i):this.switchDramaEpisode(o,t)}if(null==l?void 0:l.playAuthToken){return(this.playerData.getCurrentStreamType()||Es(null==(o=this.playerData.configs)?void 0:o.getVideoByToken))!==(e.streamType||Es(null==e?void 0:e.getVideoByToken)||"mp4")?this._next(e,t,i):(this.playerData.updateConfigs(e),this._switchAuthToken(l,t,i))}return this._next(e,t,i)}_applyIncomingIdentityAliases(e,t){const i=e,n=t;for(const r of[["albumId","album_id"],["episodeId","episode_id","episodeID"]]){if(r.some((e=>Object.prototype.hasOwnProperty.call(n,e)))){for(const e of r)delete i[e];for(const e of r)Object.prototype.hasOwnProperty.call(n,e)&&(i[e]=n[e])}}return e}_createDramaPlayNextCandidateConfig(e){const t=this._applyIncomingIdentityAliases(this.playerData.getMergedConfigs(e),e);return Object.prototype.hasOwnProperty.call(e,"transcodeParam")&&(t.transcodeParam=e.transcodeParam),t}_getDramaConfigPatchForPlayer(){const e=this.playerData.configs,t=["albumId","album_id","episodeId","episode_id","episodeID"],i={};for(const n of t){const t=e[n];null!=t&&""!==t&&(i[n]=t)}return i}_buildDramaInvalidParamError(){const e=yR.INVALID_PARAM;return{errorType:gR.network,errorCode:e.code,veError:wR.getVeErrorInfo({code:e.code,message:e.message,textKey:e.textKey}),errorMessage:e.message,ext:{},originError:void 0}}_getDramaAlbumIdFromConfig(e){return hU(e).albumId||""}_getDramaEpisodeIdFromConfig(e){return hU(e).episodeId||""}switchDramaEpisode(e,t=!0,i){const n=t?0:this.player.currentTime,r=this.getSdkPlugin("AuthToken"),o=tB.beginIdentitySwitch(this,hU(e),this.player,t,i);return o?r&&this.player?this._runDestroyableSourceSwitch((i=>r.updateDramaEpisode(t,e).then((()=>(i(),this._playerPlayNext(n,o)))).then((()=>{})))).then((()=>{tB.commitIdentitySwitch(this,o)})).catch((e=>{throw tB.rollbackIdentitySwitch(this,o),e})):(tB.rollbackIdentitySwitch(this,o),as.error("switchDramaEpisode: AuthToken plugin or player not available"),Promise.reject(new Error("AuthToken plugin or player not available"))):Promise.reject(this._createPlayNextInProgressError())}_destroyPlayer(){return d(this,null,(function*(){var e,t,i;this._offPlayerEvents(),null==(e=this.veErrorIns)||e.destroy(),this.veErrorIns=null,yield null==(t=this.mobilePanel)?void 0:t.destroy(),yield null==(i=this.player)?void 0:i.destroy(),this.player=null}))}getPlayerInstance(){return this.player}getSoftDecodingOption(e,t,i){return d(this,null,(function*(){var n,r;const{enableH265Degrade:o,codec:a,configs:s,isLive:l}=this.playerData,c=function(e){var t,i;if(!(null==e?void 0:e.playAuthToken))return!1;const n=ms(null==e?void 0:e.playAuthToken),r=null!=(i=null==(t=null==n?void 0:n.FileType)?void 0:t.toLowerCase())?i:"video";return!!n&&("evideo"===r||"eaudio"===r)}(null==s?void 0:s.getVideoByToken),u=!!(s.enableMp4MSE||zs(this.playerData.options,"Mp4EncryptPlayer")||"mp4"===i&&(a===tr.H265||c||(null==(n=null==s?void 0:s.autoBitrateOpts)?void 0:n.enable)));if(iB.shouldCheckLicense()&&(null==(r=this._originConfigs)?void 0:r.useSoftDecoding)&&!l)try{const e=yield iB.checkLicenseStatus();if(!(yield iB.checkLicenseModuleAuth(EA.SDK_VOD_PLAY,TA.H265)))throw this.emit(OA.LICENSE_STATUS_WARNING,e===SA.LICENSE_STATUS_EXPIRED?pR.EXPIRED_LICENSE_NOT_SUPPORT_265:pR.BASE_LICENSE_NOT_SUPPORT_265),new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(QB){return void as.error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}if(e){const e=yield this.sdkUmdLoader.loadPlugins(Fw.XGVideo);if(null==e?void 0:e.isSupported()){if(a&&e.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),u){const e=yield Vw.loadMp4Encrypt(this.sdkUmdLoader);return{mediaType:this.playerData.isCurrentH265()?"xg-video":"video",innerDegrade:1,codecType:null!=a?a:tr.H264,plugins:[e]}}return{mediaType:"xg-video",innerDegrade:1,codecType:null!=a?a:tr.H264}}{this.emit(OA.NOT_SUPPORT_SOFT_DECODER);const e={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0};this.delayError.push(e),as.error("soft decode is not support by current browser")}}else if(o&&!a&&t&&(yield this.detectCodec(t)),this.playerData.isCurrentH265()&&!function(){const e=window.navigator.userAgent.toLocaleLowerCase(),t=/(iphone)/.test(e)||/(ipad)/.test(e);if(/(VivoBrowser)/.test(e)){const t=e.match(/VivoBrowser\/(\d+)?/);if((null==t?void 0:t[1])>=22)return!0}return!!(t||window.MediaSource&&window.MediaSource.isTypeSupported&&(window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"')))}())if(o){if(iB.shouldCheckLicense()&&!l)try{const e=yield iB.checkLicenseStatus();if(!(yield iB.checkLicenseModuleAuth(EA.SDK_VOD_PLAY,TA.H265)))throw this.emit(OA.LICENSE_STATUS_WARNING,e===SA.LICENSE_STATUS_EXPIRED?pR.EXPIRED_LICENSE_NOT_SUPPORT_265:pR.BASE_LICENSE_NOT_SUPPORT_265),new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(QB){return void as.error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}const e=yield this.sdkUmdLoader.loadPlugins(Fw.XGVideo);if(null==e?void 0:e.isSupported()){if(null==e||e.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),this.playerData.openSoftDecoding=!0,u){const e=yield Vw.loadMp4Encrypt(this.sdkUmdLoader);return{mediaType:this.playerData.isCurrentH265()?"xg-video":"video",innerDegrade:1,codecType:null!=a?a:tr.H264,plugins:[e]}}return{mediaType:"xg-video",innerDegrade:1,codecType:null!=a?a:tr.H264}}{this.emit(OA.NOT_SUPPORT_SOFT_DECODER);const e={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0};this.delayError.push(e),as.error("soft decode is not support by current browser")}}else{this.emit(OA.NOT_SUPPORT_HARDWARE_DECODER);const e={ext:{},originError:void 0,errorType:"decoder",errorCode:3,errorMessage:"h265 hardware decode is not supported by this browser"};this.delayError.push(e),as.error("h265 hardware decode is not supported by this browser")}return{}}))}setH265SoftPlayList(){if(this.playerData.isCurrentH265()){const e=this.playerData.playList;e.length>1&&(this.playerData.playList=e.filter((e=>{var t;return(null==(t=null==e?void 0:e.codec)?void 0:t.toLowerCase())===tr.H265}))),this.playerData.initCurrent(this.playerData.playList[0])}}changeDefinition(e){var t,i,n,r,o,a;if((null==(t=this.getDefinitionList())?void 0:t.length)<=1)return;const{sdkdefinitionplugin:s,definitionmobileplugin:l}=(null==(i=this.player)?void 0:i.plugins)||{};if(s||l)e!==this.playerData.current.definition&&(s?null==s||s.changeDefinition(e):l&&(null==l||l.changeDefinition(e)));else{let t;const{current:{lineId:i}}=this.playerData;t=this.playerData.getDefinitionListByLineId(i).find((t=>t.definition===e)),t||(t=null==(a=null==(o=null==(r=null==(n=this.player)?void 0:n.config)?void 0:r.definition)?void 0:o.list)?void 0:a.find((t=>(null==t?void 0:t.definition)===e))),t&&(this.player.changeDefinition(t),t.definition!==this.playerData.current.definition&&(this.playerData.current.definition=t.definition))}}getDefinitionList(){var e;const{sdkdefinitionplugin:t,definitionmobileplugin:i}=(null==(e=this.player)?void 0:e.plugins)||{};return t||i?(null==t?void 0:t.renderList)||(null==i?void 0:i.renderList):this.player.definitionList.map((e=>{var t;const i=this.playerData.isDefinitionMatch(e.definition,null==(t=this.player.curDefinition)?void 0:t.definition),n=e.url===this.player.url,r=e.url===this.player.src;return u(c({},e),{isDefinitionAuto:this.playerData.isAutoDefinition(e.definition),selected:i||(this.playerData.isOpenABR()&&Kr.os.isIos?r:n)})}))}getAudioTracks(){var e,t,i;const n=this._getHlsInstance();if(null==(e=null==n?void 0:n.audioTracks)?void 0:e.length){const e=n.audioTrack;return n.audioTracks.map((t=>u(c({},t),{selected:t.id===e})))}const r=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;if(!(null==r?void 0:r.length))return[];const o=[];for(let a=0;a<r.length;a++){const e=r[a];o.push({id:a,name:e.label||e.language||String(a),lang:e.language,default:e.enabled,selected:e.enabled})}return o}getCurrentAudioTrack(){var e,t,i;const n=this._getHlsInstance();if(null==(e=null==n?void 0:n.audioTracks)?void 0:e.length){const e=n.audioTrack,t=n.audioTracks.find((t=>t.id===e));return t?u(c({},t),{selected:!0}):null}const r=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;if(!r)return null;for(let o=0;o<r.length;o++){const e=r[o];if(e.enabled)return{id:o,name:e.label||e.language||String(o),lang:e.language,default:!0,selected:!0}}return null}switchAudioTrack(e){var t,i;const{id:n}=e,r=this._getHlsInstance();if(r)return void zA(r,e);const o=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;o&&YA(o,n)}get preLoadData(){var e;if(!this.player||!this.player.plugins)return{hit:0};const t=this.player.plugins.mp4encryptplayer;if(t&&t.preLoadData)return{hit:!0===t.hitpreload?1:0,duration:t.preLoadData.duration,length:t.preLoadData.byteLength};const i=(null==(e=this.player)?void 0:e.stat)||{};if(i.preLoadData){const{length:e,duration:t}=i.preLoadData,n={hit:e>0?1:0,length:e,duration:0};return t>=0&&(n.duration=t),n}return{hit:0,duration:0,length:0}}_initI18N(e){const{extraLangList:t,extendLangList:i}=e;null==t||t.forEach((e=>{La.use(e)})),La.extend(PU),i&&La.extend(i)}get musicMode(){}set musicMode(e){}get musicTimeScale(){}set musicTimeScale(e){}get musicList(){}set musicList(e){}musicAdd(e){}musicRandom(){}musicNext(){}musicPrev(){}musicSetIndex(e){}musicForward(){}musicBackward(){}musicRemove(e){}musicSetAbCycle(e,t,i,n){}musicRemoveAbCycle(){}getLogUserId(){var e,t,i;const n=null==(e=this.player)?void 0:e.vodLogger;if(n){const e=(null==(t=null==n?void 0:n.tracker)?void 0:t.getConfig())||{};return null==(i=null==e?void 0:e.user)?void 0:i.user_unique_id}}get region(){return this.playerData.region}get userRegion(){return this.playerData.userRegion}getPlugin(e){var t;return null==(t=this.player)?void 0:t.getPlugin(e)}getSubtitleList(){var e,t;const i=this.getPlugin("subtitle");return null!=(t=null==(e=null==i?void 0:i.config)?void 0:e.list)?t:[]}switchSubtitle(e){const t=this.getPlugin("subtitle");return t?t.switchSubTitle(e):Promise.reject(new Error("subtitle plugin is not registered"))}showSubtitle(){var e,t;const i=this.getPlugin("subtitle");if(i)if(i.curIndex>-1&&i.curItem)i.switchSubTitle(i.curItem);else{const n=null!=(t=null==(e=i.config)?void 0:e.list)?t:[];n.length>0&&i.switchSubTitle(n[0])}}hideSubtitle(){var e;const t=this.getPlugin("subtitle");null==(e=null==t?void 0:t.switchOffSubtitle)||e.call(t)}_teardown(e){return d(this,null,(function*(){var t;const i=this.player;e||(this._lifecycleGeneration=(this._lifecycleGeneration||0)+1,this._abortSourceSwitches(),tB.destroy(this,i)),yield this._destroyPlayer(),this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null,this._onRepeat=null),this.mountingDom&&this.mountingDom.contains(this.playerContainer)&&this.mountingDom.removeChild(this.playerContainer),null==(t=this._emitter)||t.removeAllListeners(),this._emitter=null,bU.destroy(this)}))}destroy(){return d(this,null,(function*(){yield this._teardown(!1)}))}};let nB=iB;nB.isMSESupported=Zs,nB.veStrategy=gA,nB.sdkVersion="1.18.0-rc.9",nB.ttDramaEnv=null,nB.isMMSSupported=Qs,nB.isRTMSupported=DU.isSupported,nB.hasInitVeStrategy=!1;const rB=nB;function oB(){return La}const aB="function"==typeof Buffer,sB=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),lB=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),cB=(e=>{let t={};return lB.forEach(((e,i)=>t[e]=i)),t})(),uB=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,hB=String.fromCharCode.bind(String),dB=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),fB=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),pB=e=>{let t,i,n,r,o="";const a=e.length%3;for(let s=0;s<e.length;){if((i=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=i<<16|n<<8|r,o+=lB[t>>18&63]+lB[t>>12&63]+lB[t>>6&63]+lB[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},gB="function"==typeof btoa?e=>btoa(e):aB?e=>Buffer.from(e,"binary").toString("base64"):pB,yB=aB?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let i=0,n=e.length;i<n;i+=4096)t.push(hB.apply(null,e.subarray(i,i+4096)));return gB(t.join(""))},vB=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?hB(192|t>>>6)+hB(128|63&t):hB(224|t>>>12&15)+hB(128|t>>>6&63)+hB(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return hB(240|t>>>18&7)+hB(128|t>>>12&63)+hB(128|t>>>6&63)+hB(128|63&t)},mB=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,_B=e=>e.replace(mB,vB),EB=aB?e=>Buffer.from(e,"utf8").toString("base64"):sB?e=>yB(sB.encode(e)):e=>gB(_B(e)),TB=(e,t=!1)=>t?dB(EB(e)):EB(e),SB=e=>{if(e=e.replace(/\s+/g,""),!uB.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,i,n,r="";for(let o=0;o<e.length;)t=cB[e.charAt(o++)]<<18|cB[e.charAt(o++)]<<12|(i=cB[e.charAt(o++)])<<6|(n=cB[e.charAt(o++)]),r+=64===i?hB(t>>16&255):64===n?hB(t>>16&255,t>>8&255):hB(t>>16&255,t>>8&255,255&t);return r},bB=TB;var CB={};!function(e){e._getPrivFilters=function(){var e,t=/</g,i=/"/g,n=/'/g,r=/&/g,o=/\x00/g,a=/(?:^$|[\x00\x09-\x0D "'`=<>])/g,s=/[&<>"'`]/g,l=/(?:\x00|^-*!?>|--!?>|--?!?$|\]>|\]$)/g,c=/&(?:#([xX][0-9A-Fa-f]+|\d+);?|(Tab|NewLine|colon|semi|lpar|rpar|apos|sol|comma|excl|ast|midast|ensp|emsp|thinsp);|(nbsp|amp|AMP|lt|LT|gt|GT|quot|QUOT);?)/g,u={Tab:"\t",NewLine:"\n",colon:":",semi:";",lpar:"(",rpar:")",apos:"'",sol:"/",comma:",",excl:"!",ast:"*",midast:"*",ensp:" ",emsp:" ",thinsp:" ",nbsp:" ",amp:"&",lt:"<",gt:">",quot:'"',QUOT:'"'},h=/^(?:(?!-*expression)#?[-\w]+|[+-]?(?:\d+|\d*\.\d+)(?:r?em|ex|ch|cm|mm|in|px|pt|pc|%|vh|vw|vmin|vmax)?|!important|)$/i,d=/[\x00-\x1F\x7F\[\]{}\\"]/g,f=/[\x00-\x1F\x7F\[\]{}\\']/g,p=/url[\(\u207D\u208D]+/g,g=/['\(\)]/g,y=/\/\/%5[Bb]([A-Fa-f0-9:]+)%5[Dd]/,v={javascript:1,data:1,vbscript:1,mhtml:1,"x-schema":1},m=/(?::|&#[xX]0*3[aA];?|&#0*58;?|&colon;)/,_=/(?:^[\x00-\x20]+|[\t\n\r\x00]+)/g,E={Tab:"\t",NewLine:"\n"},T=function(e,t,i){return void 0===e?"undefined":null===e?"null":e.toString().replace(t,i)},S=String.fromCodePoint||function(e){return 0===arguments.length?"":e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),e%1024+56320))};function b(e){var t=e.split(m,2);return!t[0]||2!==t.length&&e.length===t[0].length?null:t[0]}function C(t,i,n,r){return i=i||u,n=n||c,void 0===t?"undefined":null===t?"null":t.toString().replace(o,"�").replace(n,(function(t,n,o,a){return n?(n=Number(n[0]<="9"?n:"0"+n),r?S(n):128===n?"€":130===n?"‚":131===n?"ƒ":132===n?"„":133===n?"…":134===n?"†":135===n?"‡":136===n?"ˆ":137===n?"‰":138===n?"Š":139===n?"‹":140===n?"Œ":142===n?"Ž":145===n?"‘":146===n?"’":147===n?"“":148===n?"”":149===n?"•":150===n?"–":151===n?"—":152===n?"˜":153===n?"™":154===n?"š":155===n?"›":156===n?"œ":158===n?"ž":159===n?"Ÿ":n>=55296&&n<=57343||13===n?"�":e.frCoPt(n)):i[o||a]||t}))}function k(e){return"\\"+e.charCodeAt(0).toString(16).toLowerCase()+" "}function I(e){return e.replace(p,(function(e){return"-x-"+e}))}function P(t){var i=b(t=e.yufull(C(t)));return i&&v[i.toLowerCase()]?"##"+t:t}return e={frCoPt:function(e){return null==e?"":!isFinite(e=Number(e))||e<=0||e>1114111||e>=1&&e<=8||e>=14&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||11===e||65535==(65535&e)||65534==(65535&e)?"�":S(e)},d:C,yup:function(e){return(e=b(e.replace(o,"")))?C(e,E,null,!0).replace(_,"").toLowerCase():null},y:function(e){return T(e,s,(function(e){return"&"===e?"&amp;":"<"===e?"&lt;":">"===e?"&gt;":'"'===e?"&quot;":"'"===e?"&#39;":"&#96;"}))},ya:function(e){return T(e,r,"&amp;")},yd:function(e){return T(e,t,"&lt;")},yc:function(e){return T(e,l,(function(e){return"\0"===e?"�":"--!"===e||"--"===e||"-"===e||"]"===e?e+" ":e.slice(0,-1)+" >"}))},yavd:function(e){return T(e,i,"&quot;")},yavs:function(e){return T(e,n,"&#39;")},yavu:function(e){return T(e,a,(function(e){return"\t"===e?"&#9;":"\n"===e?"&#10;":"\v"===e?"&#11;":"\f"===e?"&#12;":"\r"===e?"&#13;":" "===e?"&#32;":"="===e?"&#61;":"<"===e?"&lt;":">"===e?"&gt;":'"'===e?"&quot;":"'"===e?"&#39;":"`"===e?"&#96;":"�"}))},yu:encodeURI,yuc:encodeURIComponent,yubl:function(t){return v[e.yup(t)]?"x-"+t:t},yufull:function(t){return e.yu(t).replace(y,(function(e,t){return"//["+t+"]"}))},yublf:function(t){return e.yubl(e.yufull(t))},yceu:function(e){return e=C(e),h.test(e)?e:";-x:'"+I(e.replace(f,k))+"';-v:"},yced:function(e){return I(C(e).replace(d,k))},yces:function(e){return I(C(e).replace(f,k))},yceuu:function(e){return P(e).replace(g,(function(e){return"'"===e?"\\27 ":"("===e?"%28":"%29"}))},yceud:function(e){return P(e)},yceus:function(e){return P(e).replace(n,"\\27 ")}}};var t=e._privFilters=e._getPrivFilters();function i(e,i,n){return t.yubl(i((n||t.yufull)(e)))}e.inHTMLData=t.yd,e.inHTMLComment=t.yc,e.inSingleQuotedAttr=t.yavs,e.inDoubleQuotedAttr=t.yavd,e.inUnQuotedAttr=t.yavu,e.uriInSingleQuotedAttr=function(e){return i(e,t.yavs)},e.uriInDoubleQuotedAttr=function(e){return i(e,t.yavd)},e.uriInUnQuotedAttr=function(e){return i(e,t.yavu)},e.uriInHTMLData=t.yufull,e.uriInHTMLComment=function(e){return t.yc(t.yufull(e))},e.uriPathInSingleQuotedAttr=function(e){return i(e,t.yavs,t.yu)},e.uriPathInDoubleQuotedAttr=function(e){return i(e,t.yavd,t.yu)},e.uriPathInUnQuotedAttr=function(e){return i(e,t.yavu,t.yu)},e.uriPathInHTMLData=t.yu,e.uriPathInHTMLComment=function(e){return t.yc(t.yu(e))},e.uriQueryInSingleQuotedAttr=e.uriPathInSingleQuotedAttr,e.uriQueryInDoubleQuotedAttr=e.uriPathInDoubleQuotedAttr,e.uriQueryInUnQuotedAttr=e.uriPathInUnQuotedAttr,e.uriQueryInHTMLData=e.uriPathInHTMLData,e.uriQueryInHTMLComment=e.uriPathInHTMLComment,e.uriComponentInSingleQuotedAttr=function(e){return t.yavs(t.yuc(e))},e.uriComponentInDoubleQuotedAttr=function(e){return t.yavd(t.yuc(e))},e.uriComponentInUnQuotedAttr=function(e){return t.yavu(t.yuc(e))},e.uriComponentInHTMLData=t.yuc,e.uriComponentInHTMLComment=function(e){return t.yc(t.yuc(e))},e.uriFragmentInSingleQuotedAttr=function(e){return t.yubl(t.yavs(t.yuc(e)))},e.uriFragmentInDoubleQuotedAttr=function(e){return t.yubl(t.yavd(t.yuc(e)))},e.uriFragmentInUnQuotedAttr=function(e){return t.yubl(t.yavu(t.yuc(e)))},e.uriFragmentInHTMLData=e.uriComponentInHTMLData,e.uriFragmentInHTMLComment=e.uriComponentInHTMLComment}(CB);const kB="position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; pointer-events: none; z-index: 9999; font-size: 14px; display: block;",IB={SLOW:.5,MODERATE:1,FAST:2},PB={SLOW:5,MODERATE:3.5,FAST:2},DB={style:{node:kB,wrap:"",img:""},class:{node:"",wrap:"xg-dynamic-watermark",img:""}};function wB(e,t){const i=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.keys(t).forEach((e=>{i.setAttribute(e,t[e])})),i}class AB{constructor(e){this.root=e.root,this.config=e,this.wrap=document.createElement("div"),this.img=document.createElement("img"),this.imgSrc="",this.root&&this.root.appendChild(this.wrap),this.moveTimer=null,this.blinkTimer=null,this.pauseAnimation=!1,this.observer=[]}_getWatermarkDom(){const{content:e="",fontFamily:t}=this.config,i=e,n="string"==typeof this.config.fontSize?`${this.config.fontSize}`:`${this.config.fontSize}px`,r=document.createElement("text");r.style.fontSize=n,r.style.whiteSpace="nowrap",t&&(r.style.fontFamily=t),r.innerHTML=CB.inHTMLData(i),document.body.appendChild(r);const o=wB("svg",{xmlns:"http://www.w3.org/2000/svg",width:r.offsetWidth+2,height:r.offsetHeight}),a=wB("text",c({x:r.offsetWidth/2,y:r.offsetHeight/2,style:`\n fill:${this.config.fontColor};\n text-anchor: middle;\n alignment-baseline:middle;\n opacity: ${this.config.opacity};\n font-size: ${n};\n `},t?{"font-family":t}:{}));return a.innerHTML=CB.inHTMLData(i),document.body.removeChild(r),o.appendChild(a),"data:image/svg+xml;base64, "+bB((new XMLSerializer).serializeToString(o))}_startRender(){switch(this.pauseAnimation=!1,this.config.displayType){case 0:this._fixedRender();break;case 1:this._startMove();break;case 2:this._startBlink()}this.observer[0]=this._attrObserver(this.img,["src","class"],"img"),this.observer[1]=this._attrObserver(this.wrap,["class","style","id"],"node"),this.observer[2]=this._attrObserver(this.root,["class","style"],"wrap"),this.observer[3]=this._domObserver(this.wrap),this.observer[4]=this._domObserver(this.root),this.observer[5]=this._domObserver(this.root.parentElement,!0)}_startMove(){var e;if(!this.img||!(null==(e=this.wrap)?void 0:e.clientWidth))return;const{offsetX:t,offsetY:i}=this._getOffset(),n=IB[this.config.tickerSpeed]||IB.MODERATE;let r=t,o=n,a=i,s=n;clearInterval(this.moveTimer),this.moveTimer=setInterval((()=>{if(this.pauseAnimation)return;const e=this._getOffsetThreshold();r+=o,a+=s,this.wrap.offsetWidth>this.img.offsetWidth&&r>this.wrap.offsetWidth&&(r=this.wrap.offsetWidth-this.img.offsetWidth),this.wrap.offsetHeight>this.img.offsetHeight&&a>this.wrap.offsetHeight&&(a=this.wrap.offsetHeight-this.img.offsetHeight),this.img.setAttribute("style",`position: relative;left:${r}px; top:${a}px`),r>=e.hRight&&(o=-n),r<=e.hLeft&&(o=n),a>=e.vBottom&&(s=-n),a<=e.vTop&&(s=n)}),30)}_startBlink(){const e=PB[this.config.tickerSpeed]||PB.MODERATE;clearInterval(this.blinkTimer),this._blinkRender(e,!0),this.blinkTimer=setInterval((()=>{this.pauseAnimation||this._blinkRender(e)}),1e3*e)}_randomBetween(e,t){const i=t-e+1;return Math.floor(Math.random()*i)+e}_fixedRender(){var e;if(!this.img||!(null==(e=this.wrap)?void 0:e.clientWidth))return;this.img.setAttribute("style","");const{offsetX:t,offsetY:i}=this._getOffset(),n=PB[this.config.tickerSpeed];return n?this.img.setAttribute("style",`opacity: 0.1;transform: translate(${t}px, ${i}px);animation: _xg_animation_blink ${n}s linear infinite;`):this.img.setAttribute("style",`opacity: 1;transform: translate(${t}px, ${i}px);`)}_getOffset(){const{left:e,top:t,right:i,bottom:n}=this.config,{clientWidth:r,clientHeight:o}=this.wrap,{clientWidth:a,clientHeight:s}=this.img;let l=0,c=0;return void 0!==i&&r&&(l=r-a-i),void 0!==e&&r&&(l=e),void 0!==n&&o&&(c=o-s-n),void 0!==t&&o&&(c=t),{offsetX:l,offsetY:c}}_getOffsetThreshold(){const{clientWidth:e,clientHeight:t}=this.wrap,{clientWidth:i,clientHeight:n}=this.img;return{hLeft:e-i>=0?0:e-i,hRight:e-i>=0?e-i:0,vTop:t-n>=0?0:t-n,vBottom:t-n>=0?t-n:0}}_blinkRender(e,t){var i;if(!this.img||!(null==(i=this.wrap)?void 0:i.clientWidth))return;if(this.img.setAttribute("style","opacity: 0.1;"),t){const{offsetX:t,offsetY:i}=this._getOffset();return this.img.setAttribute("style",`opacity: 0.1;transform: translate(${t}px, ${i}px);animation: _xg_animation_blink ${e}s linear 1;`)}const n=this._getOffsetThreshold(),{clientWidth:r,clientHeight:o}=this.wrap,a=r?this._randomBetween(n.hLeft,n.hRight):0,s=o?this._randomBetween(n.vTop,n.vBottom):0;setTimeout((()=>{this.img.setAttribute("style",`opacity: 0.1;transform: translate(${a}px, ${s}px);animation: _xg_animation_blink ${e}s linear 1;`)}),10)}_attrObserver(e,t,i){if(!e||!this.wrap||!window.MutationObserver)return;const n=new window.MutationObserver((t=>{e&&this.wrap&&t.forEach((t=>{if("class"===t.attributeName&&e.getAttribute("class")!=DB.class[i]&&e.setAttribute("class",DB.class[i]),"style"===t.attributeName&&e.getAttribute("style")!=DB.style[i]&&e.setAttribute("style",DB.style[i]),"img"===i&&"src"===t.attributeName){if(((null==e?void 0:e.getAttribute("src"))||"")!==this.imgSrc){const t=this._getWatermarkDom();this.wrap&&t&&(this.imgSrc=t,e.setAttribute("src",t))}}}))}));return n.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:t}),n}_domObserver(e,t){if(!e||!this.wrap)return;const i=new window.MutationObserver((i=>{e&&this.wrap&&i.forEach((i=>{i.removedNodes.forEach((i=>{if(!t)return e.appendChild(i);!e.getElementsByClassName(this.config.rootClassName).length&&e.appendChild(i)}))}))}));return i.observe(e,{childList:!0}),i}update(){const e=this._getWatermarkDom();this.wrap&&this.img&&e&&(this.imgSrc=e,this.img.setAttribute("src",e))}start(){if(!(this.root&&this.wrap&&this.img))return;clearInterval(this.moveTimer),clearInterval(this.blinkTimer),this.observer.forEach((e=>{var t;null==(t=null==e?void 0:e.disconnect)||t.call(e)})),this.wrap.innerHTML="",this.wrap.setAttribute("style",kB);const e=this._getWatermarkDom();e&&(this.img.src=e,this.img.style.opacity="0",this.img.alt="",this.imgSrc=e,this.wrap.appendChild(this.img),setTimeout((()=>this._startRender())))}pause(){this.pauseAnimation=!0}resume(){this.pauseAnimation=!1}resize(){}destroy(){clearInterval(this.moveTimer),clearInterval(this.blinkTimer),this.observer.forEach((e=>{var t;null==(t=null==e?void 0:e.disconnect)||t.call(e)})),this.img=null,this.wrap.innerHTML="",this.wrap=null}}const RB="xg-dynamic-watermark";class xB extends ba{constructor(e){super(e),this.wm=null}static get pluginName(){return"DynamicWatermark"}static get defaultConfig(){return{position:ba.POSITIONS.ROOT,displayType:1,tickerSpeed:void 0,fontSize:12,fontColor:"#ffffff",opacity:.3,enable:!1,top:void 0,left:void 0,right:void 0,bottom:void 0,content:""}}afterCreate(){this.config.enable&&(this._initWatermark(),this.once(to,(()=>{this.start()})),this.on(Ro,(()=>{this.resize()})))}start(){var e,t;null==(t=null==(e=this.wm)?void 0:e.start)||t.call(e)}pause(){var e,t;null==(t=null==(e=this.wm)?void 0:e.pause)||t.call(e)}resume(){var e,t;null==(t=null==(e=this.wm)?void 0:e.resume)||t.call(e)}resize(){var e,t;null==(t=null==(e=this.wm)?void 0:e.resize)||t.call(e)}_initWatermark(){this.wm=new AB(u(c({},this.config),{root:this.root,rootClassName:RB}))}destroy(){var e,t;null==(t=null==(e=this.wm)?void 0:e.destroy)||t.call(e),this.offAll()}render(){return`\n <xg-dynamic-watermark class=${RB} />\n `}}class OB extends ba{constructor(e){super(e),this.waitings=[],this.longWaitingEmitTime=0,this.waitingStartTime=0,this.playerData=null,this.playerData=this.playerConfig.playerData}static get pluginName(){return"DefinitionDemotePlugin"}static get defaultConfig(){return{isNeedAutoDemote:!0,toastShowTime:3e3,demotePriority:[],isNeedShowTips:!0,oftenWaitingCount:3,oftenWaitingTime:5e3,longWaitingTime:5e3}}registerLanguageTexts(){return{definition_demote_txt:{jp:"現在のネットワークは不安定です。に切り替えることをお勧めします",en:"The current network is unstable, it is recommended to switch to ",zh:"当前网络不稳定,建议切换到","zh-hk":"當前網絡不穩定,建議切換到"}}}afterCreate(){this.bindCtx(),this.bindEvents()}bindCtx(){this._count=this._count.bind(this),this._time=this._time.bind(this),this._waiting=this._waiting.bind(this),this._clearTime=this._clearTime.bind(this),this.demote=this.demote.bind(this)}bindEvents(){this.on(io,this._waiting),this.on(Zr,this._clearTime),this.on($r,this._clearTime),this.on(wo,this._clearTime),this.on(LA.PlAY_URL_CHANGE,this._clearTime),this.config.isNeedAutoDemote&&this.player.on(LA.LONG_WAITING,this.demote)}_waiting(){this._count(),this._time()}_count(){const e=Date.now();this.waitings.push(e);const{oftenWaitingCount:t,oftenWaitingTime:i}=this.config;if(this.waitings.length>=t){const n=this.waitings.shift();n&&e-n<=i&&(as.warn(`stuttering occurred at least ${t} times within ${i}ms`),this.player.emit(LA.OFTEN_WAITING)),this.clearState()}}_time(){if(this.timer)return void as.log("The stuttering was triggered continuously, and the interval since the last stuttering was ",Date.now()-this.waitingStartTime+"ms");this.waitingStartTime=Date.now();const e=this.player.currentTime;this.timer=setTimeout((()=>{this.player&&this.player.currentTime<=e+.1&&(as.warn(`stuttering last more than ${this.config.longWaitingTime}ms`),this.player.emit(LA.LONG_WAITING),this.timer&&(clearTimeout(this.timer),this.timer=null),this.waitingStartTime&&(this.waitingStartTime=0))}),this.config.longWaitingTime)}_clearTime(){this.waitingStartTime&&as.log("stuttering last for ",Date.now()-this.waitingStartTime+"ms"),this.clearState()}clearState(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.waitings.length>0&&(this.waitings=[]),this.waitingStartTime&&(this.waitingStartTime=0)}demote(){if(!this.player.checkBuffer(this.player.currentTime,{endDiff:.5,startDiff:.5})&&!this.player.isSeeking&&this.player.state===Na.RUNNING&&this.player.currentTime>1){if(!this.playerData)return;const e=this.playerData.getNextDefinition(!0,this.config.demotePriority),t=null==e?void 0:e[0];if(!t||!t.url)return;const i=t.definition;if(!i)return;const{current:{definition:n}}=this.playerData;if(this.player.emit(LA.DEFINITION_DEMOTE,{currentDef:n,willChangeDef:i,next:t}),"auto"===n){const e=t.url;as.log(`auto demote definition to ${t.definition}`),this.changeUrl(e)}else i!==n&&this.showToast(t)}else as.log("stuttering but not need demote definition")}changeUrl(e){this.player&&e&&(this.player.config.url=e,this.player.switchURL(e,{seamless:!this.player.config.isLive}).then((()=>{as.log(`auto demote definition switch url(${e}) success`)})),this.player.emit(LA.PlAY_URL_CHANGE,{url:e,from:"definition_demote"}))}showToast(e){var t;const i=null==(t=this.player)?void 0:t.getPlugin("sdkToastPlugin");if(!i)return;if(this.toastId&&(i.remove(this.toastId),this.toastId=null),!this.config.isNeedShowTips)return;const n=this.i18n[e.definitionTextKey]||e.definitionTextKey||e.definition,r=Ur.createDom("div",this.langText.definition_demote_txt,void 0,"toast-txt"),o=Ur.createDom("span",n,void 0,"toast-txt-bt");r.appendChild(o),this.toastId=i.add(r,this.config.toastShowTime,!0),o.addEventListener("click",(()=>{this.playerData&&(this.playerData.current.definition=e.definition,i.remove(this.toastId),this.toastId=null,as.log(`user handle demote definition to ${e.definition}`))}))}destroy(){this.clearState()}}function LB(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.5 0.199997C8.5 0.0895386 8.5896 0 8.69995 0H9.30005C9.4104 0 9.5 0.0895386 9.5 0.199997V1.8C9.5 1.91046 9.4104 2 9.30005 2H8.69995C8.5896 2 8.5 1.91046 8.5 1.8V0.199997Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M0 1.95424C0 1.85173 0.0773926 1.76582 0.179443 1.75529L7.27954 1.02277C7.34546 1.01596 7.40649 1.04182 7.44751 1.08664C7.47998 1.12207 7.5 1.16936 7.5 1.22171V14.7783C7.5 14.8969 7.39746 14.9894 7.27954 14.9773L0.179443 14.2447C0.0773926 14.2342 0 14.1483 0 14.0458V1.95424ZM1.5 12.873V3.12701L6 2.66273V13.3373L1.5 12.873Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M18 1.95424C18 1.85173 17.9226 1.76582 17.8206 1.75529L10.7205 1.02277C10.6025 1.01059 10.5 1.10313 10.5 1.22171V14.7783C10.5 14.8969 10.6025 14.9894 10.7205 14.9773L17.8206 14.2447C17.9226 14.2342 18 14.1483 18 14.0458V1.95424ZM16.5 3.12701L12 2.66273V13.3373L16.5 12.873V3.12701Z" fill="white"/>\n <path d="M8.69995 3C8.5896 3 8.5 3.08954 8.5 3.2V4.8C8.5 4.91046 8.5896 5 8.69995 5H9.30005C9.32642 5 9.35156 4.9949 9.37451 4.98564C9.39111 4.97896 9.40674 4.97011 9.4209 4.95944C9.46899 4.92293 9.5 4.8651 9.5 4.8V3.2C9.5 3.14664 9.47925 3.09818 9.44507 3.06232C9.40869 3.02393 9.35718 3 9.30005 3H8.69995Z" fill="white"/>\n <path d="M8.5 6.2C8.5 6.08954 8.5896 6 8.69995 6H9.30005C9.34277 6 9.38232 6.01344 9.41479 6.03635C9.46631 6.07254 9.5 6.13234 9.5 6.2V7.8C9.5 7.85072 9.48096 7.89703 9.44995 7.9323C9.41821 7.96826 9.37354 7.99272 9.32373 7.99861C9.31592 7.99953 9.30811 8 9.30005 8H8.69995C8.5896 8 8.5 7.91046 8.5 7.8V6.2Z" fill="white"/>\n <path d="M8.53711 9.08395C8.51367 9.11667 8.5 9.15674 8.5 9.20001V10.8C8.5 10.9105 8.5896 11 8.69995 11H9.30005C9.4104 11 9.5 10.9105 9.5 10.8V9.20001C9.5 9.08954 9.4104 9 9.30005 9H8.69995C8.68384 9 8.66821 9.00189 8.65332 9.00546C8.60571 9.01688 8.5647 9.04529 8.53711 9.08395Z" fill="white"/>\n <path d="M8.5 12.2C8.5 12.1371 8.52905 12.081 8.57446 12.0443C8.60864 12.0166 8.65234 12 8.69995 12H9.30005C9.4104 12 9.5 12.0895 9.5 12.2V13.8C9.5 13.8664 9.46753 13.9253 9.41772 13.9616C9.38477 13.9857 9.34399 14 9.30005 14H8.69995C8.5896 14 8.5 13.9105 8.5 13.8V12.2Z" fill="white"/>\n <path d="M8.69995 15C8.5896 15 8.5 15.0895 8.5 15.2V15.8C8.5 15.9105 8.5896 16 8.69995 16H9.30005C9.4104 16 9.5 15.9105 9.5 15.8V15.2C9.5 15.0895 9.4104 15 9.30005 15H8.69995Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}function NB(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.5 0.2C8.5 0.0895431 8.58954 0 8.7 0H9.3C9.41046 0 9.5 0.0895431 9.5 0.2V1.8C9.5 1.91046 9.41046 2 9.3 2H8.7C8.58954 2 8.5 1.91046 8.5 1.8V0.2Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M0 1.95424C0 1.85173 0.0775055 1.76582 0.179474 1.7553L7.27947 1.02276C7.39742 1.01059 7.5 1.10313 7.5 1.2217V14.7783C7.5 14.8969 7.39742 14.9894 7.27947 14.9773L0.179474 14.2447C0.0775053 14.2342 0 14.1483 0 14.0458V1.95424ZM1.5 12.873V3.12702L6 2.66273V13.3373L1.5 12.873Z" fill="white"/>\n <path d="M17.8205 1.7553C17.9225 1.76582 18 1.85173 18 1.95424V14.0458C18 14.1483 17.9225 14.2342 17.8205 14.2447L10.7205 14.9773C10.6026 14.9894 10.5 14.8969 10.5 14.7783V1.2217C10.5 1.10313 10.6026 1.01059 10.7205 1.02276L17.8205 1.7553Z" fill="white"/>\n <path d="M8.7 3C8.58954 3 8.5 3.08954 8.5 3.2V4.8C8.5 4.91046 8.58954 5 8.7 5H9.3C9.41046 5 9.5 4.91046 9.5 4.8V3.2C9.5 3.08954 9.41046 3 9.3 3H8.7Z" fill="white"/>\n <path d="M8.5 6.2C8.5 6.08954 8.58954 6 8.7 6H9.3C9.41046 6 9.5 6.08954 9.5 6.2V7.8C9.5 7.91046 9.41046 8 9.3 8H8.7C8.58954 8 8.5 7.91046 8.5 7.8V6.2Z" fill="white"/>\n <path d="M8.7 9C8.58954 9 8.5 9.08954 8.5 9.2V10.8C8.5 10.9105 8.58954 11 8.7 11H9.3C9.41046 11 9.5 10.9105 9.5 10.8V9.2C9.5 9.08954 9.41046 9 9.3 9H8.7Z" fill="white"/>\n <path d="M8.5 12.2C8.5 12.0895 8.58954 12 8.7 12H9.3C9.41046 12 9.5 12.0895 9.5 12.2V13.8C9.5 13.9105 9.41046 14 9.3 14H8.7C8.58954 14 8.5 13.9105 8.5 13.8V12.2Z" fill="white"/>\n <path d="M8.7 15C8.58954 15 8.5 15.0895 8.5 15.2V15.8C8.5 15.9105 8.58954 16 8.7 16H9.3C9.41046 16 9.5 15.9105 9.5 15.8V15.2C9.5 15.0895 9.41046 15 9.3 15H8.7Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}const{POSITIONS:MB}=ba,UB="getMirror",BB="exitMirror";class FB extends ba{constructor(e){super(e),this.isEnableMirror=!0,this.isEnableMirror=this.config.defaultEnable}static get pluginName(){return"mirrorPlugin"}static get defaultConfig(){return{position:MB.CONTROLS_RIGHT,index:HA,disable:!1,defaultEnable:!1}}afterCreate(){this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.updateMirrorState(this.isEnableMirror))}registerIcons(){return{[UB]:{icon:LB,class:"xg-get-mirror"},[BB]:{icon:NB,class:"xg-exit-mirror"}}}initIcons(){const{icons:e}=this,t=this.find(".xgplayer-icon");t.appendChild(e[UB]),t.appendChild(e[BB])}registerLanguageTexts(){return{getMirror:{jp:"ミラーを開く",en:"Turn on mirroring",zh:"开启镜像","zh-hk":"開啟鏡像"},exitMirror:{jp:"ミラーを閉じる",en:"Turn off mirroring",zh:"关闭镜像","zh-hk":"關閉鏡像"}}}btnClick(e){e.preventDefault(),e.stopPropagation(),this.isEnableMirror?this.action(!1):this.action(!0)}action(e){this.isEnableMirror=e,this.updateMirrorState(this.isEnableMirror),this.player.emit(LA.MIRROR_CHANGE,this.isEnableMirror)}updateMirrorState(e){const t=this.player;e?t.addClass("xgplayer-mirror"):t.removeClass("xgplayer-mirror"),this.animate(e)}animate(e){this.root&&(e?this.setAttr("data-state","enable"):this.setAttr("data-state","normal"),this.switchTips(e))}switchTips(e){this.changeLangTextKey(this.find(".xg-tips"),e?BB:UB)}destroy(){this.unbind(["click","touchend"],this.btnClick)}render(){if(!this.config.disable)return`<xg-icon class='xgplayer-mirror-icon'>\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="mirror">${this.langText[UB]}</div>\n </xg-icon>`}}class HB extends ba{constructor(e){super(e),this.memoryId="",this.shouldShowToast=!1,this.saveTimeFun=Ur.checkIsFunction(this.config.saveTime)?this.config.saveTime:this.saveTimeByStorage,this.getTimeFun=Ur.checkIsFunction(this.config.getTime)?this.config.getTime:this.getTimeByStorage,this.startTime=0,this.memoryId=this.config.memoryId,this.showToast=this.showToast.bind(this),this.saveTime=this.saveTime.bind(this),this.visibilitychangeCallback=this.visibilitychangeCallback.bind(this)}static get pluginName(){return"memoryPlay"}static get defaultConfig(){return{getTime:null,saveTime:null,memoryId:"",minStartTime:1,minEndTime:1}}registerLanguageTexts(){return{preText:{jp:"に位置付けられました",en:"Has located for you to ",zh:"已为您定位至","zh-hk":"已為您定位至"}}}children(){return{toast:sO}}afterCreate(){this.once(eo,this.showToast),this.on(to,(()=>{this.curTime=this.player.currentTime}))}beforePlayerInit(){return this.memoryId||(this.playerConfig.vid?this.memoryId=this.playerConfig.vid:this.player.url&&(this.memoryId=this.player.url.replace(/\?.*$/,""))),this.setSave(),this.getTime()}getTime(){return new Promise((e=>{const t=(i=this.getTimeFun(this.memoryId))&&i.then?i:new Promise((e=>{e(i)}));var i;t.then((t=>{var i,n,r,o,a,s;const l=function(e,t=0){const i=parseFloat(e);return Number.isNaN(i)?t:i}(t);!isNaN(l)&&l>0?(this.startTime=l,this.shouldShowToast=!0,this.playerConfig.startTime=this.startTime,(null==(r=null==(n=null==(i=this.player.plugins)?void 0:i.hls)?void 0:n.hls)?void 0:r.config)&&(this.player.plugins.hls.hls.config.startTime=this.startTime),(null==(s=null==(a=null==(o=this.player.plugins)?void 0:o.encrypthlsplugin)?void 0:a.hls)?void 0:s.config)&&(this.player.plugins.encrypthlsplugin.hls.config.startTime=this.startTime)):as.warn("the time got is invalid",t),e()})).catch((t=>{as.error("getTime function occur error",t),e()}))}))}saveTime(){var e;if(!this.player)return;const{minStartTime:t=1,minEndTime:i=1}=this.config,{currentTime:n,duration:r}=this.player,o=null!=(e=null!=n?n:this.curTime)?e:0;r&&(o<t||Math.abs(r-o)<i?this.saveTimeFun(this.memoryId,0):this.saveTimeFun(this.memoryId,o))}visibilitychangeCallback(){"hidden"===document.visibilityState&&this.saveTime()}setSave(){this.on(qr,this.saveTime.bind(this)),this.on(Qr,this.saveTime.bind(this)),document.addEventListener("visibilitychange",this.visibilitychangeCallback.bind(this)),document.addEventListener("pagehide",this.saveTime.bind(this)),window.addEventListener("beforeunload",this.saveTime.bind(this))}showToast(){var e;if(this.shouldShowToast){this.shouldShowToast=!1;const t=null==(e=this.player)?void 0:e.getPlugin("sdkToastPlugin");if(!t)return;if(this.startTime>0){const e=Ur.format(this.startTime);t.add(`${this.langText.preText}${e}`,4e3,!0)}}}saveTimeByStorage(e,t){Ps(e,HB.pluginName,t+"")}getTimeByStorage(e){return Ds(e,HB.pluginName)||0}destroy(){this.saveTime(),document.removeEventListener("visibilitychange",this.visibilitychangeCallback),document.removeEventListener("pagehide",this.saveTime),window.removeEventListener("beforeunload",this.saveTime)}}function jB(){return(new DOMParser).parseFromString('<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#filter0_dii_340_912)">\n<path d="M4.00011 7.66678C4.00005 5.82578 5.49245 4.33333 7.33344 4.33333H23.3742H32.6657C34.5066 4.33333 35.999 5.82572 35.999 7.66667V13.5764L35.9998 32.3332C35.9999 34.1742 34.5075 35.6667 32.6665 35.6667H7.33423C5.49332 35.6667 4.00096 34.1743 4.0009 32.3334L4.00011 7.66678Z" fill="url(#paint0_linear_340_912)"/>\n<path d="M4.10011 7.66677C4.10005 5.88101 5.54768 4.43333 7.33344 4.43333H23.3742H32.6657C34.4514 4.43333 35.899 5.88095 35.899 7.66667V13.5764L35.8998 32.3332C35.8999 34.119 34.4523 35.5667 32.6665 35.5667H7.33423C5.54855 35.5667 4.10095 34.1191 4.1009 32.3334L4.10011 7.66677Z" stroke="url(#paint1_linear_340_912)" stroke-width="0.2"/>\n</g>\n<path d="M6.76669 9.66667C6.76669 8.24914 7.91582 7.1 9.33335 7.1H30.6667C32.0842 7.1 33.2334 8.24914 33.2334 9.66667V30.3333C33.2334 31.7509 32.0842 32.9 30.6667 32.9H9.33335C7.91582 32.9 6.76669 31.7509 6.76669 30.3333V9.66667Z" fill="url(#paint2_linear_340_912)" stroke="url(#paint3_linear_340_912)" stroke-width="0.2"/>\n<g filter="url(#filter1_dii_340_912)">\n<path d="M15.4689 18.4428L10.9398 27.4593C10.6614 28.0134 11.0643 28.6667 11.6845 28.6667H27.8647C28.5118 28.6667 28.912 27.9614 28.5801 27.4059L25.3326 21.9703C25.0217 21.4499 24.2769 21.425 23.932 21.9235L21.1839 25.8946C21.1128 25.9973 20.9581 25.9882 20.8996 25.8778L16.9499 18.4266C16.6329 17.8285 15.7728 17.8379 15.4689 18.4428Z" fill="url(#paint4_linear_340_912)"/>\n<path d="M15.4689 18.4428L10.9398 27.4593C10.6614 28.0134 11.0643 28.6667 11.6845 28.6667H27.8647C28.5118 28.6667 28.912 27.9614 28.5801 27.4059L25.3326 21.9703C25.0217 21.4499 24.2769 21.425 23.932 21.9235L21.1839 25.8946C21.1128 25.9973 20.9581 25.9882 20.8996 25.8778L16.9499 18.4266C16.6329 17.8285 15.7728 17.8379 15.4689 18.4428Z" stroke="url(#paint5_linear_340_912)" stroke-width="0.166667"/>\n</g>\n<g filter="url(#filter2_dii_340_912)">\n<circle cx="23.6667" cy="14.6667" r="2" fill="url(#paint6_linear_340_912)"/>\n<circle cx="23.6667" cy="14.6667" r="2" stroke="url(#paint7_linear_340_912)" stroke-width="0.166667"/>\n</g>\n<defs>\n<filter id="filter0_dii_340_912" x="3.8431" y="4.17631" width="32.6278" height="32.1184" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="0.157018" dy="0.314036"/>\n<feGaussianBlur stdDeviation="0.157018"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.0684375 0 0 0 0 0.0704062 0 0 0 0 0.075 0 0 0 0.5 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_340_912"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_340_912" result="shape"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="0.471054" dy="0.471054"/>\n<feGaussianBlur stdDeviation="0.157018"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.355764 0 0 0 0 0.368819 0 0 0 0 0.391667 0 0 0 1 0"/>\n<feBlend mode="normal" in2="shape" result="effect2_innerShadow_340_912"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="-0.471054" dy="-0.471054"/>\n<feGaussianBlur stdDeviation="0.0785089"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.191389 0 0 0 0 0.197708 0 0 0 0 0.216667 0 0 0 1 0"/>\n<feBlend mode="normal" in2="effect2_innerShadow_340_912" result="effect3_innerShadow_340_912"/>\n</filter>\n<filter id="filter1_dii_340_912" x="10.4333" y="17.5669" width="18.6828" height="11.6831" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.0823529 0 0 0 0 0.0901961 0 0 0 0 0.105882 0 0 0 1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_340_912"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_340_912" result="shape"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.930313 0 0 0 0 0.935083 0 0 0 0 0.954167 0 0 0 1 0"/>\n<feBlend mode="normal" in2="shape" result="effect2_innerShadow_340_912"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="-0.166667" dy="-0.333333"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.409097 0 0 0 0 0.443509 0 0 0 0 0.570833 0 0 0 1 0"/>\n<feBlend mode="normal" in2="effect2_innerShadow_340_912" result="effect3_innerShadow_340_912"/>\n</filter>\n<filter id="filter2_dii_340_912" x="21.25" y="12.25" width="4.83329" height="5.00001" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.0823529 0 0 0 0 0.0901961 0 0 0 0 0.105882 0 0 0 1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_340_912"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_340_912" result="shape"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.930313 0 0 0 0 0.935083 0 0 0 0 0.954167 0 0 0 1 0"/>\n<feBlend mode="normal" in2="shape" result="effect2_innerShadow_340_912"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="-0.166667" dy="-0.333333"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.364583 0 0 0 0 0.397828 0 0 0 0 0.520833 0 0 0 1 0"/>\n<feBlend mode="normal" in2="effect2_innerShadow_340_912" result="effect3_innerShadow_340_912"/>\n</filter>\n<linearGradient id="paint0_linear_340_912" x1="30.2254" y1="8.17498" x2="11.4982" y2="41.5657" gradientUnits="userSpaceOnUse">\n<stop stop-color="#434548"/>\n<stop offset="0.855332" stop-color="#3E3F42"/>\n</linearGradient>\n<linearGradient id="paint1_linear_340_912" x1="7.52649" y1="1.8673" x2="25.0283" y2="33.3887" gradientUnits="userSpaceOnUse">\n<stop stop-color="#383838"/>\n<stop offset="0.192009" stop-color="#45484D"/>\n<stop offset="0.703503" stop-color="#37393D"/>\n<stop offset="0.962692" stop-color="#1B1C1E"/>\n</linearGradient>\n<linearGradient id="paint2_linear_340_912" x1="28.5212" y1="10.1877" x2="13.0162" y2="37.9513" gradientUnits="userSpaceOnUse">\n<stop stop-color="#2E2F32"/>\n<stop offset="0.855332" stop-color="#242528"/>\n</linearGradient>\n<linearGradient id="paint3_linear_340_912" x1="9.60543" y1="4.95372" x2="24.0954" y2="31.1622" gradientUnits="userSpaceOnUse">\n<stop stop-color="#1F2124"/>\n<stop offset="0.192009" stop-color="#282B30"/>\n<stop offset="0.703503" stop-color="#27292F"/>\n<stop offset="0.962692" stop-color="#1D1F23"/>\n</linearGradient>\n<linearGradient id="paint4_linear_340_912" x1="16.969" y1="16.5412" x2="22.5457" y2="28.6249" gradientUnits="userSpaceOnUse">\n<stop stop-color="#C7CCE2"/>\n<stop offset="1" stop-color="#8B95BC"/>\n</linearGradient>\n<linearGradient id="paint5_linear_340_912" x1="17.5125" y1="20.3581" x2="20.121" y2="28.4669" gradientUnits="userSpaceOnUse">\n<stop offset="0.181113" stop-color="#B1B7D3"/>\n<stop offset="1" stop-color="#535C80"/>\n</linearGradient>\n<linearGradient id="paint6_linear_340_912" x1="23.0637" y1="12.5093" x2="25.4773" y2="15.7207" gradientUnits="userSpaceOnUse">\n<stop stop-color="#B8BED6"/>\n<stop offset="1" stop-color="#7E88AD"/>\n</linearGradient>\n<linearGradient id="paint7_linear_340_912" x1="23.1781" y1="13.818" x2="24.4392" y2="16.2252" gradientUnits="userSpaceOnUse">\n<stop offset="0.181113" stop-color="#B1B7D3"/>\n<stop offset="1" stop-color="#495274"/>\n</linearGradient>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}class VB{constructor(e){this.config=e.config,this.parent=e.root,this.root=Ur.createDom("ul","",{},`xg-play-list xg-list-slide-scroll ${this.config.className}`);const t="mobile"===Kr.device?"touchend":"click";this.modal=Ur.createDom("div","",{},"xg-play-list-modal"),this.modal.appendChild(this.root),e.root.appendChild(this.modal),this._delegates=ba.delegate.call(this,this.modal,".xg-play-list-modal",t,this.modalClick.bind(this));const{maxHeight:i}=this.config;i&&this.setStyle({maxHeight:i}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList(),this._delegates.concat(ba.delegate.call(this,this.root,"li",t,this.onItemClick))}renderItemList(e){const{config:t,root:i}=this;e?t.data=e:e=t.data,t.style&&Object.keys(t.style).map((e=>{i.style[e]=t[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map(((e,t)=>{const i=e.selected?"xg-play-list-item selected":"xg-play-list-item";e["data-index"]=t;const n=e.duration?Ur.format(e.duration):"",r=`\n <div style="${e.poster?`background-image: url('${e.poster}')`:""}" class="xg-play-list-poster ${e.selected?"is-active":""} ${e.poster?"":"no-poster"}" >\n <div class="bg"></div>\n <div class="icon"></div>\n <div class="duration">${n}</div>\n <duv class="playing">\n <div class="icon-wrap">\n <div class="icon-line"></div>\n <div class="icon-line"></div>\n <div class="icon-line"></div>\n <div class="icon-line"></div>\n </div>\n </duv>\n </div>\n <div class="xg-play-list-title">\n <div class="xg-play-list-title-text">${e.title}</div>\n </div>\n `,o=Ur.createDom("li",r,e,i),a=Ur.findDom(o,".bg"),s=null==jB?void 0:jB();!e.poster&&s&&a.appendChild(s),this.root.appendChild(o)}));const n=e.findIndex((e=>e.selected));if(n>=0){const t=Ur.findDom(this.root,".xg-play-list-item.selected");if(!t)return;const{height:i}=t.getBoundingClientRect(),{height:r}=this.root.getBoundingClientRect(),o=(e.length-n)*i,a=i*e.length;this.root.scrollTop=o<r?a-r:n*i}}onItemClick(e){e.delegateTarget||(e.delegateTarget=e.target);const t=e.delegateTarget;if(t&&Ur.hasClass(t,"selected"))return!1;const i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");Ur.addClass(t,"selected"),n&&Ur.removeClass(n,"selected"),i&&i(e,{from:n?this.getAttrObj(n,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}getAttrObj(e,t){if(!e||!t)return{};const i={};t.map((t=>{i[t]=e.getAttribute(t)}));const n=e.getAttribute("data-index");return n&&(i.index=Number(n)),i}show(){Ur.removeClass(this.modal,"hide"),Ur.addClass(this.modal,"active"),Ur.removeClass(this.root,"hide"),Ur.addClass(this.root,"active")}hide(){Ur.removeClass(this.modal,"active"),Ur.addClass(this.modal,"hide"),Ur.removeClass(this.root,"active"),Ur.addClass(this.root,"hide")}modalClick(e){e.stopPropagation(),this.hide();const t="function"==typeof this.config.onModalClick?this.config.onModalClick:null;t&&t(e)}setStyle(e){Object.keys(e).forEach((t=>{this.root.style[t]=e[t]}))}destroy(){this._delegates&&(this._delegates.map((e=>{e.destroy&&e.destroy()})),this._delegates=null),this.root.parentNode.removeChild(this.root),this.root.innerHTML=null,this.root=null}}function KB(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M12.8499 8.49494C13.7054 8.98885 14.1331 9.23581 14.2767 9.55822C14.4019 9.83944 14.4019 10.1606 14.2767 10.4418C14.1331 10.7642 13.7054 11.0112 12.8499 11.5051L6.65863 15.0796C5.80315 15.5735 5.37542 15.8205 5.02442 15.7836C4.71827 15.7514 4.44016 15.5909 4.25921 15.3418C4.05177 15.0563 4.05177 14.5624 4.05177 13.5746V6.42547C4.05177 5.43765 4.05177 4.94374 4.25921 4.65822C4.44016 4.40917 4.71827 4.2486 5.02442 4.21642C5.37542 4.17953 5.80315 4.42649 6.65863 4.92039L12.8499 8.49494Z" fill="white"/>\n<rect x="13.8274" y="4.02594" width="2.17238" height="11.9481" rx="0.814644" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}function WB(){return(new DOMParser).parseFromString('<svg width="21" height="22" viewBox="0 0 21 22" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#filter0_d_126_721)">\n<path d="M8.18979 6.3414C8.60304 6.57999 8.80967 6.69928 8.87901 6.85503C8.93949 6.99088 8.93949 7.14601 8.87901 7.28186C8.80967 7.4376 8.60304 7.5569 8.18979 7.79549L5.59253 9.29502C5.17928 9.53361 4.97266 9.6529 4.80311 9.63508C4.65522 9.61954 4.52087 9.54197 4.43346 9.42167C4.33325 9.28374 4.33325 9.04515 4.33325 8.56797V5.56891C4.33325 5.09173 4.33325 4.85314 4.43346 4.71522C4.52087 4.59491 4.65522 4.51735 4.80311 4.5018C4.97266 4.48398 5.17928 4.60328 5.59253 4.84187L8.18979 6.3414Z" fill="white"/>\n</g>\n<path d="M11.5264 7.19745H18" stroke="white" stroke-width="1.61843" stroke-linecap="round"/>\n<path d="M5.05273 12.5922L18.0001 12.5922" stroke="white" stroke-width="1.61843" stroke-linecap="round"/>\n<path d="M5.05273 17.9869L18.0001 17.9869" stroke="white" stroke-width="1.61843" stroke-linecap="round"/>\n<defs>\n<filter id="filter0_d_126_721" x="0.736733" y="0.903543" width="11.7841" height="12.3298" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset/>\n<feGaussianBlur stdDeviation="1.79826"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_126_721"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_126_721" result="shape"/>\n</filter>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}const GB="playListNext",YB="playListToggle",zB="mobile"===Kr.device;function $B(e=[]){if(!Array.isArray(e))return[];return e.filter((e=>e.url||e.playAuthToken)).map(((e,t)=>{const i=c({},e||{});return i.vid||(i.vid=""+t),i}))}function XB(e=[],t=0){const i=Number(t),n=Number.isNaN(i)?0:i;let r=0;return r=n<=0?0:n<e.length?n:0,r<0?0:r}CA.prototype.setVodPlayListConfig=function(e){if(!(e.plugins||[]).find((e=>e.pluginName===qB.pluginName)))return;const t=zs(e,"playListPlugin");if(t&&function(e){const t=typeof e;return null!==e&&("object"===t||"function"===t)}(t)){const{list:i=[],defaultIndex:n=0}=t,r=$B(i),o=XB(r,n),a=null==r?void 0:r[o];if(a){const{url:t,poster:i,playAuthToken:n}=a;n?e.getVideoByToken=u(c({},e.getVideoByToken||{}),{playAuthToken:n}):t&&(e.url=t),i&&(e.poster=i)}}};class qB extends ba{constructor(){super(...arguments),this.timer=null,this.onEnter=e=>{e.stopPropagation(),this.emit("icon_mouseenter",{pluginName:this.pluginName}),this.switchActiveState(e)},this.switchActiveState=e=>{e.stopPropagation();const{toggleMode:t}=this.config;"click"===t?this.toggle(!this.isActive):this.toggle(!0)},this.handleNext=e=>{e.stopPropagation(),this.next()},this._onTimeUpdate=()=>{const{player:e}=this;!this.halfPass&&e.currentTime>e.duration/2&&this.confirmOrder()},this._onEnded=()=>{if("order"===this.mode&&this.curIndex+1>=this.list.length)return this.player.pause(),void(this.player.currentTime=0);this.next()},this.onLeave=e=>{e.stopPropagation(),this.emit("icon_mouseleave",{pluginName:this.pluginName}),this.isActive&&this.toggle(!1)}}static get pluginName(){return"playListPlugin"}static get defaultConfig(){return{position:ba.POSITIONS.CONTROLS_LEFT,index:VA,list:[],mode:"order",defaultIndex:0,isItemClickHide:!0,toggleMode:"click"}}beforeCreate(e){Object.values(ba.POSITIONS).includes(e.position)||(e.root=e.player.controls.left,e.config.position=ba.POSITIONS.CONTROLS_LEFT,e.position=ba.POSITIONS.CONTROLS_LEFT)}afterCreate(){const{config:e}=this,{list:t=[],mode:i,defaultIndex:n}=e||{};this.initIcons(),this.halfPass=!1,this.list=$B(t),this.timer=setTimeout((()=>{this.emit(LA.PLAY_LIST_CHANGE,this.list)})),this.disable=!(t.length>0),this.mode=i,this.curIndex=XB(this.list,n),this.curIndex>0?(this.nextIndex=this.curIndex+1<this.list.length?this.curIndex+1:0,this.prevIndex=this.curIndex-1):(this.nextIndex=1,this.prevIndex=this.list.length-1),this.on(to,this._onTimeUpdate),this.on(qr,this._onEnded),this.on([Ro,Io],(()=>{this._resizeList()})),this.once(no,(()=>{this.list&&this.list.length>0&&(this.renderItemList(),this.show())})),zB&&this.on(ho,(()=>{this.isActive&&(this.optionsList&&this.optionsList.hide(),this.isActive=!1)})),zB?(e.toggleMode="click",this.activeEvent="touchend"):this.activeEvent="click"===e.toggleMode?"click":"mouseenter",this.bind(".xg-play-next-btn","click",this.handleNext),"click"===e.toggleMode?this.bind(".xg-play-list-btn",this.activeEvent,this.switchActiveState):(this.bind(".xg-play-list-btn",this.activeEvent,this.onEnter),this.bind(".xg-play-list-btn","mouseleave",this.onLeave))}registerLanguageTexts(){return{playNext:{jp:"次に遊ぶ",en:"play next",zh:"播放下一个","zh-hk":"播放下一個"},playList:{jp:"プレイリスト",en:"playList",zh:"播放列表","zh-hk":"播放清單"}}}registerIcons(){return{[GB]:{icon:KB,class:"xg-play-next-btn"},[YB]:{icon:WB,class:"xg-play-list-btn"}}}initIcons(){const{icons:e}=this;this.appendChild(".xg-play-next-btn",e[GB]),this.appendChild(".xg-play-list-btn",e[YB])}show(){!this.list||this.list.length<1||Ur.addClass(this.root,"show")}hide(){Ur.removeClass(this.root,"show")}prev(){this.disable||(this.halfPass||(this.halfPass=!0,this._prevCompute()),this.curIndex=this.prevIndex,this.change())}next(){this.disable||(this.halfPass||(this.halfPass=!0,this._nextCompute()),this.curIndex=this.nextIndex,this.change())}changeList(e){this.player.currentTime=0,this.list=$B(e),this.nextIndex=0,this.curIndex=0,this.change(),this.disable=!(this.list.length>0),this.emit(LA.PLAY_LIST_CHANGE,this.list)}setIndex(e){e<0||e>=this.list.length||(this.nextIndex=e+1<this.list.length?e+1:0,this.prevIndex=e-1<0?this.list.length-1:e-1,this.curIndex=e,this.change())}change(){if(this.disable)return;const{player:e,list:t,curIndex:i}=this;this.halfPass=!1;const{url:n,playAuthToken:r,title:o="",vid:a="",poster:s=""}=t[i];this.curInfo={url:n,playAuthToken:r,title:o,vid:a,poster:s};const l=e.sdk||e;r?l.playNext({vid:a,poster:s,autoplay:!0,getVideoByToken:{playAuthToken:r}}):l.playNext({vid:a,poster:s,autoplay:!0,url:n}),this.renderItemList(),e.off("timeupdate",this._emitChange.bind(this)),e.once("timeupdate",this._emitChange.bind(this))}confirmOrder(){this.halfPass=!0,this._nextCompute(),this._prevCompute()}_nextCompute(){this.disable||(this.curIndex+1<this.list.length?this.nextIndex=this.curIndex+1:this.nextIndex=0)}_prevCompute(){this.disable||(this.curIndex-1>=0?this.prevIndex=this.curIndex-1:this.prevIndex=this.list.length-1)}_emitChange(){this.emit(LA.PLAY_LIST_ITEM_CHANGE,this.curInfo)}toggle(e){if(e===this.isActive)return;const{controls:t}=this.player;e?(t.blur(),this.optionsList&&this.optionsList.show()):(t.focus(),this.optionsList&&this.optionsList.hide()),this.isActive=e}onItemClick(e,t){e.stopPropagation(),this.curIndex=t.to.index,this.change(),this.toggle(!1)}renderItemList(e){const{list:t,config:i,optionsList:n,player:r}=this;"number"==typeof e&&(this.curIndex=e,this.curInfo=t[e]);const o=t.map(((t,i)=>{const n=u(c({},t),{selected:!1});return i===this.curIndex&&(n.selected=!0,e=i),n}));if(n)return void n.renderItemList(o);const a={config:{data:o,className:"xg-side-play-list",onItemClick:(e,t)=>{this.onItemClick(e,t)},onModalClick:()=>{this.toggle(!1)}},root:r.innerContainer||r.root},{height:s}=this.player.root.getBoundingClientRect(),l=s;l&&i.heightLimit&&(a.config.maxHeight=`${l}px`),this.optionsList=new VB(a),this.show(),this._resizeList()}_resizeList(){if(!this.config.heightLimit)return;const{height:e}=this.player.root.getBoundingClientRect(),t=e;this.optionsList&&this.optionsList.setStyle({maxHeight:`${t}px`})}destroy(){const{config:e}=this;"click"===e.toggleMode?this.unbind(this.activeEvent,this.switchActiveState):(this.unbind(this.activeEvent,this.onEnter),this.unbind("mouseleave",this.onLeave)),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null),this.timer&&(clearTimeout(this.timer),this.timer=null)}set disable(e){this._disable=e,e?(this.hide(),this.optionsList&&this.optionsList.hide()):this.show()}get disable(){return this._disable}render(){if(!this.disable)return`<xg-icon class="xg-options-icon xg-play-list-btn-container ${this.config.className||""}">\n <div class="xgplayer-icon xg-play-next-btn">\n <div class="xg-tips" lang-key="playNext">${this.langText.playNext}</div>\n </div>\n <div class="xgplayer-icon xg-play-list-btn">\n <div class="xg-tips" lang-key="playList">${this.langText.playList}</div>\n </div>\n </xg-icon>`}}const ZB=Object.assign(rB,{Events:UA,Event:MA,DefinitionDemotePlugin:OB,MirrorPlugin:FB,MemoryPlay:HB,Subtitle:aO,DynamicWatermarkPlugin:xB,PlayListPlugin:qB,getI18N:oB,BasePlugin:ua,Plugin:ba,Sniffer:Kr,Util:Ur,STATE_CLASS:Pa,I18N:La,STATES:Na});exports.BasePlugin=ua,exports.CodecType=tr,exports.ContentType=ir,exports.DefinitionDemotePlugin=OB,exports.DynamicWatermarkPlugin=xB,exports.EAudioFormat=rr,exports.EDRMTYPE=or,exports.EVideoFormat=nr,exports.Event=MA,exports.Events=UA,exports.I18N=La,exports.MemoryPlay=HB,exports.MirrorPlugin=FB,exports.POSITIONS=ar,exports.PlayListPlugin=qB,exports.Plugin=ba,exports.STATES=Na,exports.STATE_CLASS=Pa,exports.Sniffer=Kr,exports.Subtitle=aO,exports.UmdKeys=Fw,exports.Util=Ur,exports.default=ZB,exports.getI18N=oB;
1
+ // @byteplus/veplayer@1.18.0 Built @9/1/2026, 4:36:00 PM
2
+ "use strict";var e,t=Object.defineProperty,i=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,s=Math.pow,l=(e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n,c=(e,t)=>{for(var i in t||(t={}))o.call(t,i)&&l(e,i,t[i]);if(r)for(var i of r(t))a.call(t,i)&&l(e,i,t[i]);return e},u=(e,t)=>i(e,n(t)),h=(e,t)=>{var i={};for(var n in e)o.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&r)for(var n of r(e))t.indexOf(n)<0&&a.call(e,n)&&(i[n]=e[n]);return i},d=(e,t,i)=>new Promise(((n,r)=>{var o=e=>{try{s(i.next(e))}catch(ds){r(ds)}},a=e=>{try{s(i.throw(e))}catch(ds){r(ds)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(o,a);s((i=i.apply(e,t)).next())}));function f(e,t){return e===t||e!=e&&t!=t}function p(e,t){for(var i=e.length;i--;)if(f(e[i][0],t))return i;return-1}Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var g=Array.prototype.splice;function y(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}y.prototype.clear=function(){this.__data__=[],this.size=0},y.prototype.delete=function(e){var t=this.__data__,i=p(t,e);return!(i<0)&&(i==t.length-1?t.pop():g.call(t,i,1),--this.size,!0)},y.prototype.get=function(e){var t=this.__data__,i=p(t,e);return i<0?void 0:t[i][1]},y.prototype.has=function(e){return p(this.__data__,e)>-1},y.prototype.set=function(e,t){var i=this.__data__,n=p(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};const v="object"==typeof global&&global&&global.Object===Object&&global;var m="object"==typeof self&&self&&self.Object===Object&&self;const _=v||m||Function("return this")();const E=_.Symbol;var T=Object.prototype,S=T.hasOwnProperty,b=T.toString,C=E?E.toStringTag:void 0;var k=Object.prototype.toString;var I="[object Null]",P="[object Undefined]",D=E?E.toStringTag:void 0;function w(e){return null==e?void 0===e?P:I:D&&D in Object(e)?function(e){var t=S.call(e,C),i=e[C];try{e[C]=void 0;var n=!0}catch(ds){}var r=b.call(e);return n&&(t?e[C]=i:delete e[C]),r}(e):function(e){return k.call(e)}(e)}function A(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var R="[object AsyncFunction]",x="[object Function]",O="[object GeneratorFunction]",L="[object Proxy]";function N(e){if(!A(e))return!1;var t=w(e);return t==x||t==O||t==R||t==L}const M=_["__core-js_shared__"];var U,B=(U=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"";var F=Function.prototype.toString;function H(e){if(null!=e){try{return F.call(e)}catch(ds){}try{return e+""}catch(ds){}}return""}var j=/^\[object .+?Constructor\]$/,V=Function.prototype,K=Object.prototype,G=V.toString,W=K.hasOwnProperty,Y=RegExp("^"+G.call(W).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function z(e){return!(!A(e)||(t=e,B&&B in t))&&(N(e)?Y:j).test(H(e));var t}function $(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return z(i)?i:void 0}const X=$(_,"Map");const q=$(Object,"create");var Z=Object.prototype.hasOwnProperty;var Q=Object.prototype.hasOwnProperty;function J(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function ee(e,t){var i,n,r=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof t?"string":"hash"]:r.map}function te(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}J.prototype.clear=function(){this.__data__=q?q(null):{},this.size=0},J.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},J.prototype.get=function(e){var t=this.__data__;if(q){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return Z.call(t,e)?t[e]:void 0},J.prototype.has=function(e){var t=this.__data__;return q?void 0!==t[e]:Q.call(t,e)},J.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=q&&void 0===t?"__lodash_hash_undefined__":t,this},te.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(X||y),string:new J}},te.prototype.delete=function(e){var t=ee(this,e).delete(e);return this.size-=t?1:0,t},te.prototype.get=function(e){return ee(this,e).get(e)},te.prototype.has=function(e){return ee(this,e).has(e)},te.prototype.set=function(e,t){var i=ee(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function ie(e){var t=this.__data__=new y(e);this.size=t.size}ie.prototype.clear=function(){this.__data__=new y,this.size=0},ie.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},ie.prototype.get=function(e){return this.__data__.get(e)},ie.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.set=function(e,t){var i=this.__data__;if(i instanceof y){var n=i.__data__;if(!X||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new te(n)}return i.set(e,t),this.size=i.size,this};var ne=function(){try{var e=$(Object,"defineProperty");return e({},"",{}),e}catch(ds){}}();const re=ne;function oe(e,t,i){"__proto__"==t&&re?re(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}var ae=Object.prototype.hasOwnProperty;function se(e,t,i){var n=e[t];ae.call(e,t)&&f(n,i)&&(void 0!==i||t in e)||oe(e,t,i)}function le(e,t,i,n){var r=!i;i||(i={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=n?n(i[s],e[s],s,i,e):void 0;void 0===l&&(l=e[s]),r?oe(i,s,l):se(i,s,l)}return i}function ce(e){return null!=e&&"object"==typeof e}function ue(e){return ce(e)&&"[object Arguments]"==w(e)}var he=Object.prototype,de=he.hasOwnProperty,fe=he.propertyIsEnumerable;const pe=ue(function(){return arguments}())?ue:function(e){return ce(e)&&de.call(e,"callee")&&!fe.call(e,"callee")};const ge=Array.isArray;var ye="object"==typeof exports&&exports&&!exports.nodeType&&exports,ve=ye&&"object"==typeof module&&module&&!module.nodeType&&module,me=ve&&ve.exports===ye?_.Buffer:void 0;const _e=(me?me.isBuffer:void 0)||function(){return!1};var Ee=9007199254740991,Te=/^(?:0|[1-9]\d*)$/;function Se(e,t){var i=typeof e;return!!(t=null==t?Ee:t)&&("number"==i||"symbol"!=i&&Te.test(e))&&e>-1&&e%1==0&&e<t}var be=9007199254740991;function Ce(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=be}var ke={};function Ie(e){return function(t){return e(t)}}ke["[object Float32Array]"]=ke["[object Float64Array]"]=ke["[object Int8Array]"]=ke["[object Int16Array]"]=ke["[object Int32Array]"]=ke["[object Uint8Array]"]=ke["[object Uint8ClampedArray]"]=ke["[object Uint16Array]"]=ke["[object Uint32Array]"]=!0,ke["[object Arguments]"]=ke["[object Array]"]=ke["[object ArrayBuffer]"]=ke["[object Boolean]"]=ke["[object DataView]"]=ke["[object Date]"]=ke["[object Error]"]=ke["[object Function]"]=ke["[object Map]"]=ke["[object Number]"]=ke["[object Object]"]=ke["[object RegExp]"]=ke["[object Set]"]=ke["[object String]"]=ke["[object WeakMap]"]=!1;var Pe="object"==typeof exports&&exports&&!exports.nodeType&&exports,De=Pe&&"object"==typeof module&&module&&!module.nodeType&&module,we=De&&De.exports===Pe&&v.process;const Ae=function(){try{var e=De&&De.require&&De.require("util").types;return e||we&&we.binding&&we.binding("util")}catch(ds){}}();var Re=Ae&&Ae.isTypedArray;const xe=Re?Ie(Re):function(e){return ce(e)&&Ce(e.length)&&!!ke[w(e)]};var Oe=Object.prototype.hasOwnProperty;function Le(e,t){var i=ge(e),n=!i&&pe(e),r=!i&&!n&&_e(e),o=!i&&!n&&!r&&xe(e),a=i||n||r||o,s=a?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(e.length,String):[],l=s.length;for(var c in e)!t&&!Oe.call(e,c)||a&&("length"==c||r&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Se(c,l))||s.push(c);return s}var Ne=Object.prototype;function Me(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ne)}function Ue(e,t){return function(i){return e(t(i))}}const Be=Ue(Object.keys,Object);var Fe=Object.prototype.hasOwnProperty;function He(e){return null!=e&&Ce(e.length)&&!N(e)}function je(e){return He(e)?Le(e):function(e){if(!Me(e))return Be(e);var t=[];for(var i in Object(e))Fe.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e)}var Ve=Object.prototype.hasOwnProperty;function Ke(e){if(!A(e))return function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}(e);var t=Me(e),i=[];for(var n in e)("constructor"!=n||!t&&Ve.call(e,n))&&i.push(n);return i}function Ge(e){return He(e)?Le(e,!0):Ke(e)}var We="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ye=We&&"object"==typeof module&&module&&!module.nodeType&&module,ze=Ye&&Ye.exports===We?_.Buffer:void 0,$e=ze?ze.allocUnsafe:void 0;function Xe(e,t){if(t)return e.slice();var i=e.length,n=$e?$e(i):new e.constructor(i);return e.copy(n),n}function qe(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t}function Ze(){return[]}var Qe=Object.prototype.propertyIsEnumerable,Je=Object.getOwnPropertySymbols;const et=Je?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var i=-1,n=null==e?0:e.length,r=0,o=[];++i<n;){var a=e[i];t(a,i,e)&&(o[r++]=a)}return o}(Je(e),(function(t){return Qe.call(e,t)})))}:Ze;function tt(e,t){for(var i=-1,n=t.length,r=e.length;++i<n;)e[r+i]=t[i];return e}const it=Ue(Object.getPrototypeOf,Object);const nt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)tt(t,et(e)),e=it(e);return t}:Ze;function rt(e,t,i){var n=t(e);return ge(e)?n:tt(n,i(e))}function ot(e){return rt(e,je,et)}function at(e){return rt(e,Ge,nt)}const st=$(_,"DataView");const lt=$(_,"Promise");const ct=$(_,"Set");const ut=$(_,"WeakMap");var ht="[object Map]",dt="[object Promise]",ft="[object Set]",pt="[object WeakMap]",gt="[object DataView]",yt=H(st),vt=H(X),mt=H(lt),_t=H(ct),Et=H(ut),Tt=w;(st&&Tt(new st(new ArrayBuffer(1)))!=gt||X&&Tt(new X)!=ht||lt&&Tt(lt.resolve())!=dt||ct&&Tt(new ct)!=ft||ut&&Tt(new ut)!=pt)&&(Tt=function(e){var t=w(e),i="[object Object]"==t?e.constructor:void 0,n=i?H(i):"";if(n)switch(n){case yt:return gt;case vt:return ht;case mt:return dt;case _t:return ft;case Et:return pt}return t});const St=Tt;var bt=Object.prototype.hasOwnProperty;const Ct=_.Uint8Array;function kt(e){var t=new e.constructor(e.byteLength);return new Ct(t).set(new Ct(e)),t}var It=/\w*$/;var Pt=E?E.prototype:void 0,Dt=Pt?Pt.valueOf:void 0;function wt(e,t){var i=t?kt(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}var At="[object Boolean]",Rt="[object Date]",xt="[object Map]",Ot="[object Number]",Lt="[object RegExp]",Nt="[object Set]",Mt="[object String]",Ut="[object Symbol]",Bt="[object ArrayBuffer]",Ft="[object DataView]",Ht="[object Float32Array]",jt="[object Float64Array]",Vt="[object Int8Array]",Kt="[object Int16Array]",Gt="[object Int32Array]",Wt="[object Uint8Array]",Yt="[object Uint8ClampedArray]",zt="[object Uint16Array]",$t="[object Uint32Array]";function Xt(e,t,i){var n,r=e.constructor;switch(t){case Bt:return kt(e);case At:case Rt:return new r(+e);case Ft:return function(e,t){var i=t?kt(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,i);case Ht:case jt:case Vt:case Kt:case Gt:case Wt:case Yt:case zt:case $t:return wt(e,i);case xt:return new r;case Ot:case Mt:return new r(e);case Lt:return function(e){var t=new e.constructor(e.source,It.exec(e));return t.lastIndex=e.lastIndex,t}(e);case Nt:return new r;case Ut:return n=e,Dt?Object(Dt.call(n)):{}}}var qt=Object.create,Zt=function(){function e(){}return function(t){if(!A(t))return{};if(qt)return qt(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();const Qt=Zt;function Jt(e){return"function"!=typeof e.constructor||Me(e)?{}:Qt(it(e))}var ei=Ae&&Ae.isMap;const ti=ei?Ie(ei):function(e){return ce(e)&&"[object Map]"==St(e)};var ii=Ae&&Ae.isSet;const ni=ii?Ie(ii):function(e){return ce(e)&&"[object Set]"==St(e)};var ri=1,oi=2,ai=4,si="[object Arguments]",li="[object Function]",ci="[object GeneratorFunction]",ui="[object Object]",hi={};function di(e,t,i,n,r,o){var a,s=t&ri,l=t&oi,c=t&ai;if(i&&(a=r?i(e,n,r,o):i(e)),void 0!==a)return a;if(!A(e))return e;var u=ge(e);if(u){if(a=function(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&bt.call(e,"index")&&(i.index=e.index,i.input=e.input),i}(e),!s)return qe(e,a)}else{var h=St(e),d=h==li||h==ci;if(_e(e))return Xe(e,s);if(h==ui||h==si||d&&!r){if(a=l||d?{}:Jt(e),!s)return l?function(e,t){return le(e,nt(e),t)}(e,function(e,t){return e&&le(t,Ge(t),e)}(a,e)):function(e,t){return le(e,et(e),t)}(e,function(e,t){return e&&le(t,je(t),e)}(a,e))}else{if(!hi[h])return r?e:{};a=Xt(e,h,s)}}o||(o=new ie);var f=o.get(e);if(f)return f;o.set(e,a),ni(e)?e.forEach((function(n){a.add(di(n,t,i,n,e,o))})):ti(e)&&e.forEach((function(n,r){a.set(r,di(n,t,i,r,e,o))}));var p=u?void 0:(c?l?at:ot:l?Ge:je)(e);return function(e,t){for(var i=-1,n=null==e?0:e.length;++i<n&&!1!==t(e[i],i,e););}(p||e,(function(n,r){p&&(n=e[r=n]),se(a,r,di(n,t,i,r,e,o))})),a}hi[si]=hi["[object Array]"]=hi["[object ArrayBuffer]"]=hi["[object DataView]"]=hi["[object Boolean]"]=hi["[object Date]"]=hi["[object Float32Array]"]=hi["[object Float64Array]"]=hi["[object Int8Array]"]=hi["[object Int16Array]"]=hi["[object Int32Array]"]=hi["[object Map]"]=hi["[object Number]"]=hi[ui]=hi["[object RegExp]"]=hi["[object Set]"]=hi["[object String]"]=hi["[object Symbol]"]=hi["[object Uint8Array]"]=hi["[object Uint8ClampedArray]"]=hi["[object Uint16Array]"]=hi["[object Uint32Array]"]=!0,hi["[object Error]"]=hi[li]=hi["[object WeakMap]"]=!1;function fi(e){return di(e,5)}function pi(e,t,i){(void 0!==i&&!f(e[t],i)||void 0===i&&!(t in e))&&oe(e,t,i)}var gi,yi=function(e,t,i){for(var n=-1,r=Object(e),o=i(e),a=o.length;a--;){var s=o[gi?a:++n];if(!1===t(r[s],s,r))break}return e};const vi=yi;var mi="[object Object]",_i=Function.prototype,Ei=Object.prototype,Ti=_i.toString,Si=Ei.hasOwnProperty,bi=Ti.call(Object);function Ci(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function ki(e,t,i,n,r,o,a){var s=Ci(e,i),l=Ci(t,i),c=a.get(l);if(c)pi(e,i,c);else{var u,h=o?o(s,l,i+"",e,t,a):void 0,d=void 0===h;if(d){var f=ge(l),p=!f&&_e(l),g=!f&&!p&&xe(l);h=l,f||p||g?ge(s)?h=s:ce(u=s)&&He(u)?h=qe(s):p?(d=!1,h=Xe(l,!0)):g?(d=!1,h=wt(l,!0)):h=[]:function(e){if(!ce(e)||w(e)!=mi)return!1;var t=it(e);if(null===t)return!0;var i=Si.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&Ti.call(i)==bi}(l)||pe(l)?(h=s,pe(s)?h=function(e){return le(e,Ge(e))}(s):A(s)&&!N(s)||(h=Jt(l))):d=!1}d&&(a.set(l,h),r(h,l,n,o,a),a.delete(l)),pi(e,i,h)}}function Ii(e,t,i,n,r){e!==t&&vi(t,(function(o,a){if(r||(r=new ie),A(o))ki(e,t,a,i,Ii,n,r);else{var s=n?n(Ci(e,a),o,a+"",e,t,r):void 0;void 0===s&&(s=o),pi(e,a,s)}}),Ge)}function Pi(e){return e}var Di=Math.max;var wi=re?function(e,t){return re(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:Pi;const Ai=wi;var Ri,xi,Oi,Li=Date.now;const Ni=(Ri=Ai,xi=0,Oi=0,function(){var e=Li(),t=16-(e-Oi);if(Oi=e,t>0){if(++xi>=800)return arguments[0]}else xi=0;return Ri.apply(void 0,arguments)});function Mi(e,t){return Ni(function(e,t,i){return t=Di(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,o=Di(n.length-t,0),a=Array(o);++r<o;)a[r]=n[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=n[r];return s[t]=i(a),function(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}(e,this,s)}}(e,t,Pi),e+"")}function Ui(e){return Mi((function(t,i){var n=-1,r=i.length,o=r>1?i[r-1]:void 0,a=r>2?i[2]:void 0;for(o=e.length>3&&"function"==typeof o?(r--,o):void 0,a&&function(e,t,i){if(!A(i))return!1;var n=typeof t;return!!("number"==n?He(i)&&Se(t,i.length):"string"==n&&t in i)&&f(i[t],e)}(i[0],i[1],a)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var s=i[n];s&&e(t,s,n,o)}return t}))}const Bi=Ui((function(e,t,i,n){Ii(e,t,i,n)}));function Fi(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new te;++t<i;)this.add(e[t])}function Hi(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1}function ji(e,t){return e.has(t)}Fi.prototype.add=Fi.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Fi.prototype.has=function(e){return this.__data__.has(e)};var Vi=1,Ki=2;function Gi(e,t,i,n,r,o){var a=i&Vi,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(e),u=o.get(t);if(c&&u)return c==t&&u==e;var h=-1,d=!0,f=i&Ki?new Fi:void 0;for(o.set(e,t),o.set(t,e);++h<s;){var p=e[h],g=t[h];if(n)var y=a?n(g,p,h,t,e,o):n(p,g,h,e,t,o);if(void 0!==y){if(y)continue;d=!1;break}if(f){if(!Hi(t,(function(e,t){if(!ji(f,t)&&(p===e||r(p,e,i,n,o)))return f.push(t)}))){d=!1;break}}else if(p!==g&&!r(p,g,i,n,o)){d=!1;break}}return o.delete(e),o.delete(t),d}function Wi(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i}function Yi(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i}var zi=1,$i=2,Xi="[object Boolean]",qi="[object Date]",Zi="[object Error]",Qi="[object Map]",Ji="[object Number]",en="[object RegExp]",tn="[object Set]",nn="[object String]",rn="[object Symbol]",on="[object ArrayBuffer]",an="[object DataView]",sn=E?E.prototype:void 0,ln=sn?sn.valueOf:void 0;var cn=1,un=Object.prototype.hasOwnProperty;var hn=1,dn="[object Arguments]",fn="[object Array]",pn="[object Object]",gn=Object.prototype.hasOwnProperty;function yn(e,t,i,n,r,o){var a=ge(e),s=ge(t),l=a?fn:St(e),c=s?fn:St(t),u=(l=l==dn?pn:l)==pn,h=(c=c==dn?pn:c)==pn,d=l==c;if(d&&_e(e)){if(!_e(t))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new ie),a||xe(e)?Gi(e,t,i,n,r,o):function(e,t,i,n,r,o,a){switch(i){case an:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case on:return!(e.byteLength!=t.byteLength||!o(new Ct(e),new Ct(t)));case Xi:case qi:case Ji:return f(+e,+t);case Zi:return e.name==t.name&&e.message==t.message;case en:case nn:return e==t+"";case Qi:var s=Wi;case tn:var l=n&zi;if(s||(s=Yi),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;n|=$i,a.set(e,t);var u=Gi(s(e),s(t),n,r,o,a);return a.delete(e),u;case rn:if(ln)return ln.call(e)==ln.call(t)}return!1}(e,t,l,i,n,r,o);if(!(i&hn)){var p=u&&gn.call(e,"__wrapped__"),g=h&&gn.call(t,"__wrapped__");if(p||g){var y=p?e.value():e,v=g?t.value():t;return o||(o=new ie),r(y,v,i,n,o)}}return!!d&&(o||(o=new ie),function(e,t,i,n,r,o){var a=i&cn,s=ot(e),l=s.length;if(l!=ot(t).length&&!a)return!1;for(var c=l;c--;){var u=s[c];if(!(a?u in t:un.call(t,u)))return!1}var h=o.get(e),d=o.get(t);if(h&&d)return h==t&&d==e;var f=!0;o.set(e,t),o.set(t,e);for(var p=a;++c<l;){var g=e[u=s[c]],y=t[u];if(n)var v=a?n(y,g,u,t,e,o):n(g,y,u,e,t,o);if(!(void 0===v?g===y||r(g,y,i,n,o):v)){f=!1;break}p||(p="constructor"==u)}if(f&&!p){var m=e.constructor,_=t.constructor;m==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _||(f=!1)}return o.delete(e),o.delete(t),f}(e,t,i,n,r,o))}function vn(e,t,i,n,r){return e===t||(null==e||null==t||!ce(e)&&!ce(t)?e!=e&&t!=t:yn(e,t,i,n,vn,r))}var mn=1,_n=2;function En(e){return e==e&&!A(e)}function Tn(e,t){return function(i){return null!=i&&(i[e]===t&&(void 0!==t||e in Object(i)))}}function Sn(e){var t=function(e){for(var t=je(e),i=t.length;i--;){var n=t[i],r=e[n];t[i]=[n,r,En(r)]}return t}(e);return 1==t.length&&t[0][2]?Tn(t[0][0],t[0][1]):function(i){return i===e||function(e,t,i,n){var r=i.length,o=r,a=!n;if(null==e)return!o;for(e=Object(e);r--;){var s=i[r];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++r<o;){var l=(s=i[r])[0],c=e[l],u=s[1];if(a&&s[2]){if(void 0===c&&!(l in e))return!1}else{var h=new ie;if(n)var d=n(c,u,l,e,t,h);if(!(void 0===d?vn(u,c,mn|_n,n,h):d))return!1}}return!0}(i,e,t)}}var bn="[object Symbol]";function Cn(e){return"symbol"==typeof e||ce(e)&&w(e)==bn}var kn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,In=/^\w*$/;function Pn(e,t){if(ge(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!Cn(e))||(In.test(e)||!kn.test(e)||null!=t&&e in Object(t))}var Dn="Expected a function";function wn(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Dn);var i=function(){var n=arguments,r=t?t.apply(this,n):n[0],o=i.cache;if(o.has(r))return o.get(r);var a=e.apply(this,n);return i.cache=o.set(r,a)||o,a};return i.cache=new(wn.Cache||te),i}wn.Cache=te;var An=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Rn=/\\(\\)?/g,xn=function(e){var t=wn(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(An,(function(e,i,n,r){t.push(n?r.replace(Rn,"$1"):i||e)})),t}));const On=xn;var Ln=1/0,Nn=E?E.prototype:void 0,Mn=Nn?Nn.toString:void 0;function Un(e){if("string"==typeof e)return e;if(ge(e))return function(e,t){for(var i=-1,n=null==e?0:e.length,r=Array(n);++i<n;)r[i]=t(e[i],i,e);return r}(e,Un)+"";if(Cn(e))return Mn?Mn.call(e):"";var t=e+"";return"0"==t&&1/e==-Ln?"-0":t}function Bn(e,t){return ge(e)?e:Pn(e,t)?[e]:On(function(e){return null==e?"":Un(e)}(e))}var Fn=1/0;function Hn(e){if("string"==typeof e||Cn(e))return e;var t=e+"";return"0"==t&&1/e==-Fn?"-0":t}function jn(e,t){for(var i=0,n=(t=Bn(t,e)).length;null!=e&&i<n;)e=e[Hn(t[i++])];return i&&i==n?e:void 0}function Vn(e,t,i){var n=null==e?void 0:jn(e,t);return void 0===n?i:n}function Kn(e,t){return null!=e&&t in Object(e)}function Gn(e,t){return null!=e&&function(e,t,i){for(var n=-1,r=(t=Bn(t,e)).length,o=!1;++n<r;){var a=Hn(t[n]);if(!(o=null!=e&&i(e,a)))break;e=e[a]}return o||++n!=r?o:!!(r=null==e?0:e.length)&&Ce(r)&&Se(a,r)&&(ge(e)||pe(e))}(e,t,Kn)}var Wn=1,Yn=2;function zn(e){return Pn(e)?function(e){return function(t){return null==t?void 0:t[e]}}(Hn(e)):function(e){return function(t){return jn(t,e)}}(e)}function $n(e){return"function"==typeof e?e:null==e?Pi:"object"==typeof e?ge(e)?(t=e[0],i=e[1],Pn(t)&&En(i)?Tn(Hn(t),i):function(e){var n=Vn(e,t);return void 0===n&&n===i?Gn(e,t):vn(i,n,Wn|Yn)}):Sn(e):zn(e);var t,i}function Xn(e){return e!=e}function qn(e,t){return!!(null==e?0:e.length)&&function(e,t,i){return t==t?function(e,t,i){for(var n=i-1,r=e.length;++n<r;)if(e[n]===t)return n;return-1}(e,t,i):function(e,t,i,n){for(var r=e.length,o=i+(n?1:-1);n?o--:++o<r;)if(t(e[o],o,e))return o;return-1}(e,Xn,i)}(e,t,0)>-1}function Zn(e,t,i){for(var n=-1,r=null==e?0:e.length;++n<r;)if(i(t,e[n]))return!0;return!1}const Qn=ct&&1/Yi(new ct([,-0]))[1]==1/0?function(e){return new ct(e)}:function(){};var Jn=200;function er(e,t){return e&&e.length?function(e,t,i){var n=-1,r=qn,o=e.length,a=!0,s=[],l=s;if(i)a=!1,r=Zn;else if(o>=Jn){var c=t?null:Qn(e);if(c)return Yi(c);a=!1,r=ji,l=new Fi}else l=t?[]:s;e:for(;++n<o;){var u=e[n],h=t?t(u):u;if(u=i||0!==u?u:0,a&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),s.push(u)}else r(l,h,i)||(l!==s&&l.push(h),s.push(u))}return s}(e,$n(t)):[]}const tr={H264:"h264",H265:"h265",H266:"h266",AAC:"aac",MP3:"mp3",OPUS:"opus",UNKNOWN:"unknown"},ir={[tr.H265]:'video/mp4; codecs="hev1.1.6.L120.90"',[tr.H264]:'video/mp4; codecs="avc1.42c01e"'};var nr=(e=>(e.MP4="mp4",e.DASH="dash",e.HLS="hls",e))(nr||{}),rr=(e=>(e.M4A="m4a",e.MP4="mp4",e.MP3="mp3",e.DASH="dash",e.HLS="hls",e.OGG="ogg",e))(rr||{}),or=(e=>(e.DRM_ENCRYPT="drm_encrypt",e.PRIVATE_ENCRYPT="private_encrypt",e.PRIVATE_ENCRYPT_UPGRADE="private_encrypt_upgrade",e.STANDARD_ENCRYPT="standard_encrypt",e))(or||{}),ar=(e=>(e.ROOT="root",e.ROOT_LEFT="rootLeft",e.ROOT_RIGHT="rootRight",e.ROOT_TOP="rootTop",e.CONTROLS_LEFT="controlsLeft",e.CONTROLS_RIGTH="controlsRight",e.CONTROLS_RIGHT="controlsRight",e.CONTROLS_CENTER="controlsCenter",e.CONTROLS="controls",e))(ar||{}),sr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function lr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cr=function(){let e,t=null;function i(e){return!!e&&("object"==typeof e||"function"==typeof e)}function n(e){if(null!==e&&!i(e))throw new TypeError("Object prototype may only be an Object or null: "+e)}const r=Object,o=Boolean(r.create)||!({__proto__:null}instanceof r),a=r.create||(o?function(e){return n(e),{__proto__:e}}:function(e){if(n(e),null===e)throw new SyntaxError("Native Object.create is required to create objects with null prototype");var t=function(){};return t.prototype=e,new t}),s=function(){return null},l=r.getPrototypeOf||([].__proto__===Array.prototype?function(e){const t=e.__proto__;return i(t)?t:null}:s);return e=function(c,u){if(void 0===(this&&this instanceof e?this.constructor:void 0))throw new TypeError("Constructor Proxy requires 'new'");if(!i(c)||!i(u))throw new TypeError("Cannot create proxy with a non-object as target or handler");let h=function(){};t=function(){c=null,h=function(e){throw new TypeError(`Cannot perform '${e}' on a proxy that has been revoked`)}},setTimeout((function(){t=null}),0);const d=u;u={get:null,set:null,apply:null,construct:null};for(let e in d){if(!(e in u))throw new TypeError(`Proxy polyfill does not support trap '${e}'`);u[e]=d[e]}"function"==typeof d&&(u.apply=d.apply.bind(d));const f=l(c);let p,g=!1,y=!1;"function"==typeof c?(p=function(){const e=this&&this.constructor===p,t=Array.prototype.slice.call(arguments);if(h(e?"construct":"apply"),e&&u.construct)return u.construct.call(this,c,t);if(!e&&u.apply)return u.apply(c,this,t);if(e){t.unshift(c);return new(c.bind.apply(c,t))}return c.apply(this,t)},g=!0):c instanceof Array?(p=[],y=!0):p=o||null!==f?a(f):{};const v=u.get?function(e){return h("get"),u.get(this,e,p)}:function(e){return h("get"),this[e]},m=u.set?function(e,t){h("set"),u.set(this,e,t,p)}:function(e,t){h("set"),this[e]=t},_=r.getOwnPropertyNames(c),E={};_.forEach((function(e){if((g||y)&&e in p)return;const t=r.getOwnPropertyDescriptor(c,e),i={enumerable:Boolean(t.enumerable),get:v.bind(c,e),set:m.bind(c,e)};r.defineProperty(p,e,i),E[e]=!0}));let T=!0;if(g||y){const e=r.setPrototypeOf||([].__proto__===Array.prototype?function(e,t){return n(t),e.__proto__=t,e}:s);f&&e(p,f)||(T=!1)}if(u.get||!T)for(let e in c)E[e]||r.defineProperty(p,e,{get:v.bind(c,e)});return r.seal(c),r.seal(p),p},e.revocable=function(i,n){return{proxy:new e(i,n),revoke:t}},e};const ur=lr(cr)();const hr=new class{constructor(){this.subscribeId=0,this.watcherMap=new Map}observe(e){const t=new ur(e,{set:(e,i,n)=>{const r=Reflect.get(e,i);Reflect.set(e,i,n);const o=this.watcherMap.get(t);return o&&(this.flushCallback(o),this.flushPropertyCallback(o,i,r,n)),!0}});return this.watcherMap.set(t,{pending:!1,queue:[],property:{}}),t}subscribe(e,t){const i=this.watcherMap.get(e);if(!i)return;this.subscribeId++;return i.queue.push({id:this.subscribeId,callback:t}),this.subscribeId}unsubscribe(e,t){const i=this.watcherMap.get(e);if(!i)return;const n=i.queue,r=n.findIndex((e=>e.id===t));void 0!==r&&r>-1&&n.splice(r,1)}subscribeProperty(e,t,i){const n=this.watcherMap.get(e);if(n){this.subscribeId++,n.property[t]||(n.property[t]={pending:!1,timer:0,pre:null,queue:[]});return n.property[t].queue.push({id:this.subscribeId,callback:i}),this.subscribeId}}unsubscribeProperty(e,t,i){const n=this.watcherMap.get(e);if(n){const e=n.property[t];if(e){const t=e.queue,n=t.findIndex((e=>e.id===i));void 0!==n&&n>-1&&t.splice(n,1)}}}flushCallback(e){e.pending||(e.pending=!0,setTimeout((()=>{e.queue.forEach((e=>e.callback())),e.pending=!1}),0))}flushPropertyCallback(e,t,i,n){const r=e.property[t];r&&(clearTimeout(r.timer),!1===r.pending&&(r.pending=!0,r.pre=i),r.timer=setTimeout((()=>{r.queue.forEach((e=>e.callback(r.pre,n))),r.pending=!1}),0))}};function dr(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function fr(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?dr(Object(i),!0).forEach((function(t){mr(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):dr(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function pr(e){return(pr="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})(e)}function gr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yr(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,Dr(n.key),n)}}function vr(e,t,i){return t&&yr(e.prototype,t),i&&yr(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function mr(e,t,i){return(t=Dr(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tr(e,t)}function Er(e){return(Er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Tr(e,t){return(Tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Sr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function br(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Sr(e)}function Cr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(ds){return!1}}();return function(){var i,n=Er(e);if(t){var r=Er(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return br(this,i)}}function kr(){return kr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Er(e)););return e}(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},kr.apply(this,arguments)}function Ir(e){return function(e){if(Array.isArray(e))return Pr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Pr(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Pr(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pr(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function Dr(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var wr={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new r(n,o||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,r,o,a){var s=i?i+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,o),!0;case 6:return u.fn.call(u.context,t,n,r,o,a),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,r);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(e,t,i){return o(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return o(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,n,r){var o=i?i+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||r&&!s.once||n&&s.context!==n||a(this,o);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||r&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s}(wr);var Ar=wr.exports;const Rr=lr(Ar);var xr="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,Or={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},Lr="%c[xgplayer]",Nr={config:{debug:xr?3:0},logInfo:function(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];this.config.debug>=3&&(t=console).log.apply(t,[Lr,Or.info,e].concat(n))},logWarn:function(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];this.config.debug>=1&&(t=console).warn.apply(t,[Lr,Or.warn,e].concat(n))},logError:function(e){var t;if(!(this.config.debug<1)){for(var i=this.config.debug>=2?"trace":"error",n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=console)[i].apply(t,[Lr,Or.error,e].concat(r))}}};var Mr=function(){function e(t){gr(this,e),this.bufferedList=t}return vr(e,[{key:"start",value:function(e){return this.bufferedList[e].start}},{key:"end",value:function(e){return this.bufferedList[e].end}},{key:"length",get:function(){return this.bufferedList.length}}]),e}(),Ur={};function Br(e){var t=pr(e);return null!==e&&("object"===t||"function"===t)}function Fr(e,t,i){var n,r,o,a,s,l,c=0,u=!1,h=!1,d=!0,f=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var i=n,o=r;return n=r=void 0,c=t,a=e.apply(o,i)}function g(e,t){return f?(window.cancelAnimationFrame(s),window.requestAnimationFrame(e)):setTimeout(e,t)}function y(e){var i=e-l;return void 0===l||i>=t||i<0||h&&e-c>=o}function v(){var e=Date.now();if(y(e))return m(e);s=g(v,function(e){var i=e-c,n=t-(e-l);return h?Math.min(n,o-i):n}(e))}function m(e){return s=void 0,d&&n?p(e):(n=r=void 0,a)}function _(){for(var e=Date.now(),i=y(e),o=arguments.length,d=new Array(o),f=0;f<o;f++)d[f]=arguments[f];if(n=d,r=this,l=e,i){if(void 0===s)return function(e){return c=e,s=g(v,t),u?p(e):a}(l);if(h)return s=g(v,t),p(l)}return void 0===s&&(s=g(v,t)),a}return t=+t||0,Br(i)&&(u=!!i.leading,o=(h="maxWait"in i)?Math.max(+i.maxWait||0,t):o,d="trailing"in i?!!i.trailing:d),_.cancel=function(){void 0!==s&&function(e){if(f)return window.cancelAnimationFrame(e);clearTimeout(e)}(s),c=0,n=l=r=s=void 0},_.flush=function(){return void 0===s?a:m(Date.now())},_.pending=function(){return void 0!==s},_}Ur.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=n,r.innerHTML=t,Object.keys(i).forEach((function(t){var n=t,o=i[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(n,o):r.setAttribute(n,o)})),r},Ur.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var n=document.createElement("div");n.innerHTML=e;var r=n.children;return n=null,r.length>0?(r=r[0],i&&Ur.addClass(r,i),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(o){return Nr.logError("util.createDomFromHtml",o),null}},Ur.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(ds){var i=e.className&&"object"===pr(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},Ur.addClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)}))}catch(ds){Ur.hasClass(e,t)||(e.className&&"object"===pr(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},Ur.removeClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.remove(t)}))}catch(ds){Ur.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===pr(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))}},Ur.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){Ur.hasClass(e,t)?Ur.removeClass(e,t):Ur.addClass(e,t)}))},Ur.classNames=function(){for(var e=arguments,t=[],i=function(i){"String"===Ur.typeOf(e[i])?t.push(e[i]):"Object"===Ur.typeOf(e[i])&&Object.keys(e[i]).map((function(n){e[i][n]&&t.push(n)}))},n=0;n<arguments.length;n++)i(n);return t.join(" ")},Ur.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,i=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(i)}catch(ds){Nr.logError("util.findDom",ds),0===i.indexOf("#")&&(e=t.getElementById(i.slice(1)))}return e},Ur.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},Ur.padStart=function(e,t,i){for(var n=String(i),r=t>>0,o=Math.ceil(r/n.length),a=[],s=String(e);o--;)a.push(n);return a.join("").substring(0,r-s.length)+s},Ur.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=Ur.padStart(Math.floor(e/3600),2,0),i=Ur.padStart(Math.floor((e-3600*t)/60),2,0),n=Ur.padStart(Math.floor(e-3600*t-60*i),2,0);return("00"===t?[i,n]:[t,i,n]).join(":")},Ur.event=function(e){if(e.touches){var t=e.touches[0]||e.changedTouches[0];e.clientX=t.clientX||0,e.clientY=t.clientY||0,e.offsetX=t.pageX-t.target.offsetLeft,e.offsetY=t.pageY-t.target.offsetTop}e._target=e.target||e.srcElement},Ur.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},Ur.deepCopy=function(e,t){if("Object"===Ur.typeOf(t)&&"Object"===Ur.typeOf(e))return Object.keys(t).forEach((function(i){"Object"!==Ur.typeOf(t[i])||t[i]instanceof Node?"Array"===Ur.typeOf(t[i])?e[i]="Array"===Ur.typeOf(e[i])?e[i].concat(t[i]):t[i]:e[i]=t[i]:void 0===e[i]||void 0===e[i]?e[i]=t[i]:Ur.deepCopy(e[i],t[i])})),e},Ur.deepMerge=function(e,t){return Object.keys(t).map((function(i){var n;"Array"===Ur.typeOf(t[i])&&"Array"===Ur.typeOf(e[i])?"Array"===Ur.typeOf(e[i])&&(n=e[i]).push.apply(n,Ir(t[i])):Ur.typeOf(e[i])!==Ur.typeOf(t[i])||null===e[i]||"Object"!==Ur.typeOf(e[i])||t[i]instanceof window.Node?null!==t[i]&&(e[i]=t[i]):Ur.deepMerge(e[i],t[i])})),e},Ur.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var i=document.createElement("a");return i.href=t.replace(/url\("|"\)/g,""),i.href},Ur.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},Ur.setInterval=function(e,t,i,n){e._interval[t]||(e._interval[t]=window.setInterval(i.bind(e),n))},Ur.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},Ur.setTimeout=function(e,t,i){e._timers||(e._timers=[]);var n=setTimeout((function(){t(),Ur.clearTimeout(e,n)}),i);return e._timers.push(n),n},Ur.clearTimeout=function(e,t){var i=e._timers;if("Array"===Ur.typeOf(i)){for(var n=0;n<i.length;n++)if(i[n]===t){i.splice(n,1),clearTimeout(t);break}}else clearTimeout(t)},Ur.clearAllTimers=function(e){var t=e._timers;"Array"===Ur.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},Ur.createImgBtn=function(e,t,i,n){var r,o,a,s=Ur.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(s.style.backgroundImage='url("'.concat(t,'")'),i&&n)&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){return!(i.indexOf(e)>-1&&n.indexOf(e)>-1)||(r=parseFloat(i.slice(0,i.indexOf(e)).trim()),o=parseFloat(n.slice(0,n.indexOf(e)).trim()),a=e,!1)})),s.style.width="".concat(r).concat(a),s.style.height="".concat(o).concat(a),s.style.backgroundSize="".concat(r).concat(a," ").concat(o).concat(a),s.style.margin="start"===e?"-".concat(o/2).concat(a," auto auto -").concat(r/2).concat(a):"auto 5px auto 5px");return s},Ur.Hex2RGBA=function(e,t){var i=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var n="#";e.replace(/[0-9A-F]/gi,(function(e){n+=e+e})),e=n}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){i.push(parseInt(e,16))})),"rgba(".concat(i.join(","),", ").concat(t,")")):"rgba(255, 255, 255, 0.1)"},Ur.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},Ur.checkIsFunction=function(e){return e&&"function"==typeof e},Ur.checkIsObject=function(e){return null!==e&&"object"===pr(e)},Ur.hide=function(e){e.style.display="none"},Ur.show=function(e,t){e.style.display=t||"block"},Ur.isUndefined=function(e){if(null==e)return!0},Ur.isNotNull=function(e){return!(null==e)},Ur.setStyleFromCsstext=function(e,t){t&&("String"===Ur.typeOf(t)?t.replace(/\s+/g,"").split(";").map((function(t){if(t){var i=t.split(":");i.length>1&&(e.style[i[0]]=i[1])}})):Object.keys(t).map((function(i){e.style[i]=t[i]})))},Ur.filterStyleFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],i=e.style.cssText;if(!i)return{};var n=i.replace(/\s+/g,"").split(";"),r={},o={};return n.map((function(e){if(e){var i=e.split(":");i.length>1&&(!function(e,t){for(var i=0,n=t.length;i<n;i++)if(e.indexOf(t[i])>-1)return!0;return!1}(i[0],t)?o[i[0]]=i[1]:r[i[0]]=i[1])}})),e.setAttribute("style",""),Object.keys(o).map((function(t){e.style[t]=o[t]})),r},Ur.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var i=t.replace(/\s+/g,"").split(";"),n={};return i.map((function(e){if(e){var t=e.split(":");t.length>1&&(n[t[0]]=t[1])}})),n},Ur.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var n=new window.Image;n.onload=function(e){n=null,t&&t(e)},n.onerror=function(e){n=null,i&&i(e)},n.src=e}},Ur.stopPropagation=function(e){e&&e.stopPropagation()},Ur.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},Ur.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},Ur.checkTouchSupport=function(){return"ontouchstart"in window},Ur.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=[],n=0;n<e.length;n++)i.push({start:e.start(n)<.5?0:e.start(n),end:e.end(n)});i.sort((function(e,t){var i=e.start-t.start;return i||t.end-e.end}));var r=[];if(t)for(var o=0;o<i.length;o++){var a=r.length;if(a){var s=r[a-1].end;i[o].start-s<t?i[o].end>s&&(r[a-1].end=i[o].end):r.push(i[o])}else r.push(i[o])}else r=i;return new Mr(r)},Ur.getEventPos=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.touches&&e.touches.length>0&&(e=e.touches[0]),{x:e.x/t,y:e.y/t,clientX:e.clientX/t,clientY:e.clientY/t,offsetX:e.offsetX/t,offsetY:e.offsetY/t,pageX:e.pageX/t,pageY:e.pageY/t}},Ur.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},Ur.getHostFromUrl=function(e){if("String"!==Ur.typeOf(e))return"";var t=e.split("/"),i="";return t.length>3&&t[2]&&(i=t[2]),i},Ur.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},Ur.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},Ur.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},Ur.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(ds){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(window.performance.now())),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?i:3&i|8).toString(16)}))},Ur.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},Ur.adjustTimeByDuration=function(e,t,i){return t&&e&&(e>t||i&&e<t)?t:e},Ur.createPositionBar=function(e,t){var i=Ur.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(i),i},Ur.getTransformStyle=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i={scale:"".concat(e.scale||1),translate:"".concat(e.x||0,"%, ").concat(e.y||0,"%"),rotate:"".concat(e.rotate||0,"deg")};return Object.keys(i).forEach((function(e){var n=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),r="".concat(e,"(").concat(i[e],")");n.test(t)?(n.lastIndex=-1,t=t.replace(n,r)):t+="".concat(r," ")})),t},Ur.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},Ur.getIndexByTime=function(e,t){var i=t.length,n=-1;if(i<1)return n;if(e<=t[0].end||i<2)n=0;else if(e>t[i-1].end)n=i-1;else for(var r=1;r<i;r++)if(e>t[r-1].end&&e<=t[r].end){n=r;break}return n},Ur.getOffsetCurrentTime=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,n=-1;if((n=i>=0&&i<t.length?i:Ur.getIndexByTime(e,t))<0)return-1;var r=t.length,o=t[n],a=o.start,s=o.end,l=o.cTime,c=o.offset;return e<a?l:e>=a&&e<=s?e-c:e>s&&n>=r-1?s:-1},Ur.getCurrentTimeByOffset=function(e,t){var i=-1;if(!t||t.length<0)return e;for(var n=0;n<t.length;n++)if(e<=t[n].duration){i=n;break}if(-1!==i){var r=t[i].start;return i-1<0?r+e:r+(e-t[i-1].duration)}return e};var Hr=/(Android)\s([\d.]+)/,jr=/(Version)\/([\d.]+)/,Vr=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],Kr={get device(){return Kr.os.isPc?"pc":"mobile"},get browser(){if("undefined"==typeof navigator)return"";var e=navigator.userAgent.toLowerCase(),t={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(t).filter((function(i){return t[i].test(e)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),i=/(?:SymbianOS)/.test(e)||t,n=/(?:Tizen)/gi.test(e),r=/(?:Web0S)/gi.test(e),o=/(?:Android)/.test(e),a=/(?:Firefox)/.test(e),s=/(?:iPad|PlayBook)/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,l=s||o&&!/(?:Mobile)/.test(e)||a&&/(?:Tablet)/.test(e),c=/(?:iPhone)/.test(e)&&!l;return{isTablet:l,isPhone:c,isIpad:s,isIos:c||s,isAndroid:o,isPc:!(c||o||i||l),isSymbian:i,isWindowsPhone:t,isFireFox:a,isTizen:n,isWebOS:r}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",i=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?jr:Hr)?t.exec(e):[];if(i&&i.length>=3){var n=i[2].split(".");return n.length>0?parseInt(n[0]):0}return 0},get isWeixin(){if("undefined"==typeof navigator)return!1;return!!/(micromessenger)\/([\d.]+)/.exec(navigator.userAgent.toLocaleLowerCase())},isSupportMP4:function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;if(this.supportResult)return this.supportResult;var t=document.createElement("video");return"function"==typeof t.canPlayType&&Vr.map((function(i){"probably"===t.canPlayType('video/mp4; codecs="'.concat(i,'"'))&&(e.isSupport=!0,e.mime+="||".concat(i))})),this.supportResult=e,t=null,e},isMSESupport:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if("undefined"==typeof MediaSource||!MediaSource)return!1;try{return MediaSource.isTypeSupported(e)}catch(t){return this._logger.error(e,t),!1}},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var i=e.video||{},n=e.audio||{};try{var r=MediaSource.isTypeSupported(i.contentType),o=MediaSource.isTypeSupported(n.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(ds){return Promise.resolve(t)}}},Gr="3.0.23-rc.3",Wr={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},Yr={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},zr=vr((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};gr(this,e);var n=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.media){var r=i.mediaError?i.mediaError:t.media.error||{},o=t.duration,a=t.currentTime,s=t.ended,l=t.src,c=t.currentSrc,u=t.media,h=u.readyState,d=u.networkState,f=i.errorCode||r.code;Yr[f]&&(f=Yr[f]);var p={playerVersion:Gr,currentTime:a,duration:o,ended:s,readyState:h,networkState:d,src:l||c,errorType:i.errorType,errorCode:f,message:i.errorMessage||r.message,mediaError:r,originError:i.originError?i.originError.stack:"",host:Ur.getHostFromUrl(l||c)};return i.ext&&Object.keys(i.ext).map((function(e){p[e]=i.ext[e]})),p}if(arguments.length>1){for(var g={playerVersion:Gr,domain:document.domain},y=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],v=0;v<arguments.length;v++)g[y[v]]=arguments[v];return g.ex=n?(n[arguments[0]]||{}).msg:"",g}})),$r="play",Xr="playing",qr="ended",Zr="pause",Qr="error",Jr="seeking",eo="seeked",to="timeupdate",io="waiting",no="canplay",ro="durationchange",oo="volumechange",ao="loadeddata",so="ratechange",lo="progress",co="loadstart",uo="emptied",ho="focus",fo="blur",po="ready",go="urlNull",yo="autoplay_started",vo="autoplay_was_prevented",mo="complete",_o="replay",Eo="destroy",To="urlchange",So="download_speed_change",bo="leaveplayer",Co="enterplayer",ko="loading",Io="fullscreen_change",Po="cssFullscreen_change",Do="mini_state_change",wo="definition_change",Ao="after_definition_change",Ro="video_resize",xo="pip_change",Oo="rotate",Lo="screenShot",No="playnext",Mo="shortcut",Uo="xglog",Bo="user_action",Fo="reset",Ho="source_error",jo="source_success",Vo=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],Ko={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},Go="fps_stuck";const Wo=Object.freeze(Object.defineProperty({__proto__:null,ABORT:"abort",AFTER_DEFINITION_CHANGE:Ao,AUTOPLAY_PREVENTED:vo,AUTOPLAY_STARTED:yo,BEFORE_DEFINITION_CHANGE:"before_definition_change",BUFFER_CHANGE:"bufferedChange",CANPLAY:no,CANPLAY_THROUGH:"canplaythrough",COMPLETE:mo,CSS_FULLSCREEN_CHANGE:Po,DEFINITION_CHANGE:wo,DESTROY:Eo,DOWNLOAD_SPEED_CHANGE:So,DURATION_CHANGE:ro,EMPTIED:uo,ENDED:qr,ENTER_PLAYER:Co,ERROR:Qr,FPS_STUCK:Go,FULLSCREEN_CHANGE:Io,LEAVE_PLAYER:bo,LOADED_DATA:ao,LOADED_METADATA:"loadedmetadata",LOADING:ko,LOAD_START:co,MINI_STATE_CHANGE:Do,PAUSE:Zr,PIP_CHANGE:xo,PLAY:$r,PLAYER_BLUR:fo,PLAYER_FOCUS:ho,PLAYING:Xr,PLAYNEXT:No,PROGRESS:lo,RATE_CHANGE:so,READY:po,REPLAY:_o,RESET:Fo,RETRY:"retry",ROTATE:Oo,SCREEN_SHOT:Lo,SEEKED:eo,SEEKING:Jr,SEI_PARSED:"SEI_PARSED",SHORTCUT:Mo,SOURCE_ERROR:Ho,SOURCE_SUCCESS:jo,STALLED:"stalled",STATS_EVENTS:Ko,SUSPEND:"suspend",SWITCH_SUBTITLE:"switch_subtitle",TIME_UPDATE:to,URL_CHANGE:To,URL_NULL:go,USER_ACTION:Bo,VIDEO_EVENTS:Vo,VIDEO_RESIZE:Ro,VOLUME_CHANGE:oo,WAITING:io,XGLOG:Uo},Symbol.toStringTag,{value:"Module"}));function Yo(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}var zo=function(e){_r(i,Rr);var t=Cr(i);function i(e){var n;gr(this,i),(n=t.call(this,e))._hasStart=!1,n._currentTime=0,n._duration=0,n._internalOp={},n._lastMuted=!1,n.vtype="MP4",n._rate=-1,n.mediaConfig=Object.assign({},{controls:!1,autoplay:e.autoplay,playsinline:e.playsinline,"x5-playsinline":e.playsinline,"webkit-playsinline":e.playsinline,"x5-video-player-fullscreen":e["x5-video-player-fullscreen"]||e.x5VideoPlayerFullscreen,"x5-video-orientation":e["x5-video-orientation"]||e.x5VideoOrientation,airplay:e.airplay,"webkit-airplay":e.airplay,tabindex:0|e.tabindex,mediaType:e.mediaType||"video","data-index":-1},e.videoConfig,e.videoAttributes);var r=e["x5-video-player-type"]||e.x5VideoPlayerType;return Kr.isWeixin&&Kr.os.isAndroid&&r&&(n.mediaConfig["x5-video-player-type"]=r,delete n.mediaConfig.playsinline,delete n.mediaConfig["webkit-playsinline"],delete n.mediaConfig["x5-playsinline"]),e.loop&&(n.mediaConfig.loop="loop"),e.autoplayMuted&&!Object.prototype.hasOwnProperty.call(n.mediaConfig,"muted")&&(n.mediaConfig.muted=!0),n.media=e.mediaEl instanceof HTMLMediaElement?e.mediaEl:"function"==typeof e.mediaEl?e.mediaEl(n.mediaConfig):Ur.createDom(n.mediaConfig.mediaType,"",n.mediaConfig,""),e.defaultPlaybackRate&&(n.media.defaultPlaybackRate=n.media.playbackRate=e.defaultPlaybackRate),"Number"===Ur.typeOf(e.volume)&&(n.volume=e.volume),e.autoplayMuted&&(n.media.muted=!0,n._lastMuted=!0),e.autoplay&&(n.media.autoplay=!0),e.playsinline&&(n.media.playsinline=!0),n._interval={},n.mediaEventMiddleware={},n.attachVideoEvents(),n}return vr(i,[{key:"setEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(i){t.mediaEventMiddleware[i]=e[i]}))}},{key:"removeEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(e){delete t.mediaEventMiddleware[e]}))}},{key:"attachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.media;this._evHandlers||(this._evHandlers=Vo.map((function(t){var i="on".concat(t.charAt(0).toUpperCase()).concat(t.slice(1));return"function"==typeof e[i]&&e.on(t,e[i]),mr({},t,function(e,t){return function(i,n){var r={player:t,eventName:e,originalEvent:i,detail:i.detail||{},timeStamp:i.timeStamp,currentTime:t.currentTime,duration:t.duration,paused:t.paused,ended:t.ended,isInternalOp:!!t._internalOp[i.type],muted:t.muted,volume:t.volume,host:Ur.getHostFromUrl(t.currentSrc),vtype:t.vtype};if(t.removeInnerOP(i.type),"timeupdate"===e&&(t._currentTime=t.media&&t.media.currentTime),"ratechange"===e){var o=t.media?t.media.playbackRate:0;if(o&&t._rate===o)return;t._rate=t.media&&t.media.playbackRate}if("durationchange"===e&&(t._duration=t.media.duration),"volumechange"===e&&(r.isMutedChange=t._lastMuted!==t.muted,t._lastMuted=t.muted),"error"===e&&(r.error=n||t.video.error),t.mediaEventMiddleware[e]){var a=Yo.bind(t,e,r);try{t.mediaEventMiddleware[e].call(t,r,a)}catch(s){throw Yo.call(t,e,r),s}}else Yo.call(t,e,r)}}(t,e))}))),this._evHandlers.forEach((function(e){var i=Object.keys(e)[0];t.addEventListener(i,e[i],!1)}))}},{key:"detachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.media;this._evHandlers.forEach((function(e){var i=Object.keys(e)[0];t.removeEventListener(i,e[i],!1)})),this._evHandlers.forEach((function(t){var i=Object.keys(t)[0],n="on".concat(i.charAt(0).toUpperCase()).concat(i.slice(1));"function"==typeof e[n]&&e.off(i,e[n])})),this._evHandlers=null}},{key:"_attachSourceEvents",value:function(e,t){var i=this;e.removeAttribute("src"),e.load(),t.forEach((function(e,t){i.media.appendChild(Ur.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||""),"data-index":t+1}))}));var n=e.children;if(n){this._videoSourceCount=n.length,this._videoSourceIndex=n.length,this._vLoadeddata=function(e){i.emit(jo,{src:e.target.currentSrc,host:Ur.getHostFromUrl(e.target.currentSrc)})};for(var r=null,o=0;o<this._evHandlers.length;o++)if("error"===Object.keys(this._evHandlers[o])[0]){r=this._evHandlers[o];break}!this._sourceError&&(this._sourceError=function(e){var t=parseInt(e.target.getAttribute("data-index"),10);if(i._videoSourceIndex--,0===i._videoSourceIndex||t>=i._videoSourceCount){var n={code:4,message:"sources_load_error"};r?r.error(e,n):i.errorHandler("error",n)}var o=Wr[4];i.emit(Ho,new zr(i,{errorType:o,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var a=0;a<n.length;a++)n[a].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var t=e.children;if(t&&0!==t.length&&this._sourceError){for(var i=0;i<t.length;i++)t[i].removeEventListener("error",this._sourceError);for(;t.length>0;)e.removeChild(t[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.media&&(this.media.error||t)){var i=this.media.error||t,n=i.code?Wr[i.code]:"other";i.message;this.media.currentSrc||this.media.srcObject||(i={code:6,message:"empty_src"}),this.emit(e,new zr(this,{errorType:n,errorCode:i.code,errorMessage:i.message||"",mediaError:i}))}}},{key:"destroy",value:function(){for(var e in this.media&&(this.media.pause&&(this.media.pause(),this.media.muted=!0),this.media.removeAttribute("src"),this.media.load()),this._currentTime=0,this._duration=0,this.mediaConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,e)&&(clearInterval(this._interval[e]),this._interval[e]=null);this.detachVideoEvents(),this.media=null,this.mediaEventMiddleware={},this.removeAllListeners()}},{key:"video",get:function(){return this.media},set:function(e){this.media=e}},{key:"play",value:function(){return this.media?this.media.play():null}},{key:"pause",value:function(){this.media&&this.media.pause()}},{key:"load",value:function(){this.media&&this.media.load()}},{key:"canPlayType",value:function(e){return!!this.media&&this.media.canPlayType(e)}},{key:"getBufferedRange",value:function(e){var t=[0,0];if(!this.media)return t;e||(e=this.media.buffered);var i=this.media.currentTime;if(e)for(var n=0,r=e.length;n<r&&(t[0]=e.start(n),t[1]=e.end(n),!(t[0]<=i&&i<=t[1]));n++);return t[0]-i<=0&&i-t[1]<=0?t:[0,0]}},{key:"autoplay",get:function(){return!!this.media&&this.media.autoplay},set:function(e){this.media&&(this.media.autoplay=e)}},{key:"buffered",get:function(){return this.media?this.media.buffered:null}},{key:"buffered2",get:function(){return this.media&&this.media.buffered?Ur.getBuffered2(this.media.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.media)return e;var t=this.media.buffered;if(!t||0===t.length)return e;for(var i=0;i<t.length;i++)if((t.start(i)<=this.currentTime||t.start(i)<.1)&&t.end(i)>=this.currentTime)return{start:t.start(i),end:t.end(i)};return e}},{key:"crossOrigin",get:function(){return this.media?this.media.crossOrigin:""},set:function(e){this.media&&(this.media.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.media?this.media.currentSrc:""},set:function(e){this.media&&(this.media.currentSrc=e)}},{key:"currentTime",get:function(){return this.media?void 0!==this.media.currentTime?this.media.currentTime:this._currentTime:0},set:function(e){this.media&&(this.media.currentTime=e)}},{key:"defaultMuted",get:function(){return!!this.media&&this.media.defaultMuted},set:function(e){this.media&&(this.media.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return!!this.media&&this.media.ended}},{key:"error",get:function(){return this.media.error}},{key:"errorNote",get:function(){if(!this.media.error)return"";return["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][this.media.error.code-1]}},{key:"loop",get:function(){return!!this.media&&this.media.loop},set:function(e){this.media&&(this.media.loop=e)}},{key:"muted",get:function(){return!!this.media&&this.media.muted},set:function(e){this.media&&this.media.muted!==e&&(this._lastMuted=this.media.muted,this.media.muted=e)}},{key:"networkState",get:function(){return this.media.networkState}},{key:"paused",get:function(){return!this.media||this.media.paused}},{key:"playbackRate",get:function(){return this.media?this.media.playbackRate:0},set:function(e){this.media&&e!==1/0&&(this.media.defaultPlaybackRate=e,this.media.playbackRate=e)}},{key:"played",get:function(){return this.media?this.media.played:null}},{key:"preload",get:function(){return!!this.media&&this.media.preload},set:function(e){this.media&&(this.media.preload=e)}},{key:"readyState",get:function(){return this.media.readyState}},{key:"seekable",get:function(){return!!this.media&&this.media.seekable}},{key:"seeking",get:function(){return!!this.media&&this.media.seeking}},{key:"src",get:function(){return this.media?this.media.src:""},set:function(e){this.media&&(this.emit(To,e),this.emit(io),this._currentTime=0,this._duration=0,Ur.isMSE(this.media)?this.onWaiting():(this._detachSourceEvents(this.media),"Array"===Ur.typeOf(e)?this._attachSourceEvents(this.media,e):e?this.media.src=e:this.media.removeAttribute("src"),this.load()))}},{key:"volume",get:function(){return this.media?this.media.volume:0},set:function(e){e!==1/0&&this.media&&(this.media.volume=e)}},{key:"aspectRatio",get:function(){return this.media?this.media.videoWidth/this.media.videoHeight:0}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=kr(Er(i.prototype),"emit",this)).call.apply(n,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=kr(Er(i.prototype),"on",this)).call.apply(n,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=kr(Er(i.prototype),"once",this)).call.apply(n,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=kr(Er(i.prototype),"off",this)).call.apply(n,[this,e,t].concat(o))}},{key:"offAll",value:function(){kr(Er(i.prototype),"removeAllListeners",this).call(this)}}]),i}(),$o=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};gr(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return vr(e,[{key:"openDB",value:function(e){var t=this,i=this,n=this.myDB.version||1,r=i.indexedDB.open(i.myDB.name,n);r.onerror=function(e){},r.onsuccess=function(n){t.myDB.db=n.target.result,e.call(i)},r.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(i.myDB.ojstore.name)||t.createObjectStore(i.myDB.ojstore.name,{keyPath:i.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){this.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(e,t){for(var i,n=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(i=n.add(t[r])).onerror=function(){},i.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var i,n=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(i=n.put(t[r])).onerror=function(){},i.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,i){var n=this,r=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);r.onerror=function(){i.call(n,null)},r.onsuccess=function(e){var t=e.target.result;i.call(n,t)}}},{key:"deleteData",value:function(e,t){this.myDB.db.transaction(e,"readwrite").objectStore(e).delete(t)}},{key:"clearData",value:function(e){this.myDB.db.transaction(e,"readwrite").objectStore(e).clear()}}]),e}(),Xo=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],qo=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],Zo=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],Qo="data-xgplayerid";function Jo(e,t,i){for(var n=arguments.length,r=new Array(n>3?n-3:0),o=3;o<n;o++)r[o-3]=arguments[o];var a=t.call.apply(t,[e].concat(r));i&&"function"==typeof i&&(a&&a.then?a.then((function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];i.call.apply(i,[e].concat(n))})):i.call.apply(i,[e].concat(r)))}function ea(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[e]&&(this.__hooks[e]=null),function(){var n=arguments,r=this;if(i.pre)try{var o;(o=i.pre).call.apply(o,[this].concat(Array.prototype.slice.call(arguments)))}catch(ds){throw ds.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(ds.message),ds}if(this.__hooks&&this.__hooks[e])try{var a=la.apply(void 0,[this,e,t].concat(Array.prototype.slice.call(arguments)));a?a.then?a.then((function(e){!1!==e&&Jo.apply(void 0,[r,t,i.next].concat(Ir(n)))})).catch((function(e){throw e})):Jo.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments))):void 0===a&&Jo.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}catch(ds){throw ds.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(ds.message),ds}else Jo.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function ta(e,t){var i=this.__hooks;if(!i||!Array.isArray(i[e]))return-1;for(var n=i[e],r=0;r<n.length;r++)if(n[r]===t)return r;return-1}function ia(e,t){var i=this.__hooks;if(i)return i.hasOwnProperty(e)?(Array.isArray(i[e])||(i[e]=[]),-1===ta.call(this,e,t)&&i[e].push(t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function na(e,t){var i=this.__hooks;if(i)if(Array.isArray(i[e])){var n=i[e],r=ta.call(this,e,t);-1!==r&&n.splice(r,1)}else i[e]&&(i[e]=null)}function ra(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return t.useHooks&&t.useHooks.apply(t,n)}}function oa(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return t.removeHooks&&t.removeHooks.apply(t,n)}}}function aa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&t.map((function(t){e.__hooks[t]=null})),Object.defineProperty(e,"hooks",{get:function(){return e.__hooks&&Object.keys(e.__hooks).map((function(t){if(e.__hooks[t])return t}))}})}function sa(e){e.__hooks=null}function la(e,t,i){for(var n=arguments.length,r=new Array(n>3?n-3:0),o=3;o<n;o++)r[o-3]=arguments[o];if(e.__hooks&&Array.isArray(e.__hooks[t])){var a=e.__hooks[t],s=-1;return function e(t,i,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),l=3;l<r;l++)o[l-3]=arguments[l];if(s++,0===a.length||s===a.length)return n.call.apply(n,[t,t].concat(o));var c=a[s],u=c.call.apply(c,[t,t].concat(o));return u&&u.then?u.then((function(r){return!1===r?null:e.apply(void 0,[t,i,n].concat(o))})).catch((function(e){console.warn("[runHooks]".concat(i," reject"),e.message)})):!1!==u?e.apply(void 0,[t,i,n].concat(o)):void 0}.apply(void 0,[e,t,i].concat(r))}return i.call.apply(i,[e,e].concat(r))}function ca(e,t){Nr.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}var ua=function(){function e(t){gr(this,e),Ur.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),aa(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return vr(e,[{key:"beforeCreate",value:function(e){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(e){this.player=e.player,this.playerConfig=e.player&&e.player.config,this.pluginName=e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=e.player&&e.player.logger}},{key:"updateLang",value:function(e){e||(e=this.lang)}},{key:"lang",get:function(){return this.player.lang}},{key:"i18n",get:function(){return this.player.i18n}},{key:"i18nKeys",get:function(){return this.player.i18nKeys}},{key:"domEventType",get:function(){var e=Ur.checkTouchSupport()?"touch":"mouse";return!this.playerConfig||"touch"!==this.playerConfig.domEventType&&"mouse"!==this.playerConfig.domEventType||(e=this.playerConfig.domEventType),e}},{key:"on",value:function(e,t){var i=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):Array.isArray(e)&&e.forEach((function(e){i.__events[e]=t,i.player.on(e,t)})):ca(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var i=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):Array.isArray(e)&&e.forEach((function(n){i.__onceEvents[n]=t,i.player.once(e,t)})):ca(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var i=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):Array.isArray(e)&&e.forEach((function(n){delete i.__events[e],i.player.off(n,t)})):ca(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e=this;["__events","__onceEvents"].forEach((function(t){Object.keys(e[t]).forEach((function(i){e[t][i]&&e.off(i,e[t][i]),i&&delete e[t][i]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t;if(this.player){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];(t=this.player).emit.apply(t,[e].concat(n))}}},{key:"emitUserAction",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var n=fr(fr({},i),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,n)}}},{key:"hook",value:function(e,t){return ea.call.apply(ea,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return ia.call.apply(ia,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return na.call.apply(na,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return i&&(t.pluginName=i),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e=this,t=this.player,i=this.pluginName;this.offAll(),Ur.clearAllTimers(this),Ur.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(i),sa(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&Object.defineProperty(e,i,t[i])}},{key:"defineMethod",value:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&"function"==typeof t[i]&&Object.defineProperty(e,i,{configurable:!0,value:t[i]})}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}();if("undefined"!=typeof Element&&!Element.prototype.matches){var ha=Element.prototype;ha.matches=ha.matchesSelector||ha.mozMatchesSelector||ha.msMatchesSelector||ha.oMatchesSelector||ha.webkitMatchesSelector}var da=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function fa(e,t,i,n,r){var o=pa.apply(this,arguments);return e.addEventListener(i,o,r),{destroy:function(){e.removeEventListener(i,o,r)}}}function pa(e,t,i,n){return function(i){i.delegateTarget=da(i.target,t),i.delegateTarget&&n.call(e,i)}}var ga=function(e,t,i,n,r){return"function"==typeof e.addEventListener?fa.apply(null,arguments):"function"==typeof i?fa.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return fa(e,t,i,n,r)})))};const ya=lr(ga);var va={CONTROLS:"controls",ROOT:"root"},ma={ROOT:"root",ROOT_LEFT:"rootLeft",ROOT_RIGHT:"rootRight",ROOT_TOP:"rootTop",CONTROLS_LEFT:"controlsLeft",CONTROLS_RIGTH:"controlsRight",CONTROLS_RIGHT:"controlsRight",CONTROLS_CENTER:"controlsCenter",CONTROLS:"controls"},_a="xg-icon-disable";function Ea(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function Ta(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=null;if(e instanceof window.Element)return Ur.addClass(e,i),Object.keys(n).map((function(t){e.setAttribute(t,n[t])})),e;if(Ea(e)||Ea(e.url))return n.src=Ea(e)?e:e.url||"",o=Ur.createDom(e.tag||"img","",n,"xg-img ".concat(i));if("function"==typeof e)try{return(o=e())instanceof window.Element?(Ur.addClass(o,i),Object.keys(n).map((function(e){o.setAttribute(e,n[e])})),o):(Nr.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(ds){return Nr.logError("Plugin named [".concat(r,"]:createIcon"),ds),null}return"string"==typeof e?Ur.createDomFromHtml(e,n,i):(Nr.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function Sa(e,t){var i=t.config.icons||t.playerConfig.icons;Object.keys(e).map((function(n){var r=e[n],o=r&&r.class?r.class:"",a=r&&r.attr?r.attr:{},s=null;i&&i[n]&&(o=function(e,t){return"object"===pr(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(i[n],o),a=function(e,t){return"object"===pr(e)&&e.attr&&"object"===pr(e.attr)&&Object.keys(e.attr).map((function(i){t[i]=e.attr[i]})),t}(i[n],a),s=Ta(i[n],n,o,a,t.pluginName)),!s&&r&&(s=Ta(r.icon?r.icon:r,a,o,{},t.pluginName)),t.icons[n]=s}))}var ba=function(e){_r(i,ua);var t=Cr(i);function i(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return gr(this,i),(e=t.call(this,n)).__delegates=[],e}return vr(i,[{key:"__init",value:function(e){if(kr(Er(i.prototype),"__init",this).call(this,e),e.root){var t=e.root,n=null;this.icons={},this.root=null,this.parent=null,this.extraEls=[],Sa(this.registerIcons()||{},this),this.langText={};var r,o,a=this.registerLanguageTexts()||{};r=a,o=this,Object.keys(r).map((function(e){Object.defineProperty(o.langText,e,{get:function(){var t=o.lang,i=o.i18n;return i[e]?i[e]:r[e]&&r[e][t]||""}})}));var s="";try{s=this.render()}catch(ds){throw Nr.logError("Plugin:".concat(this.pluginName,":render"),ds),new Error("Plugin:".concat(this.pluginName,":render:").concat(ds.message))}if(s)(n=i.insert(s,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(n=Ur.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(n)}this.root=n,this.parent=t;var l=this.config.attr||{},c=this.config.style||{};this.setAttr(l),this.setStyle(c),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var t=this.children();t&&"object"===pr(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(i){var n,r,o=i,a=t[o],s={root:e.root};"function"==typeof a?(n=e.config[o]||{},r=a):"object"===pr(a)&&"function"==typeof a.plugin&&(n=a.options?Ur.deepCopy(e.config[o]||{},a.options):e.config[o]||{},r=a.plugin),s.config=n,void 0!==n.index&&(s.index=n.index),n.root&&(s.root=n.root),e.registerPlugin(r,s,o)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,i=this.i18n,n=this.langText;t&&function e(t,i){for(var n=0;n<t.children.length;n++)t.children[n].children.length>0?e(t.children[n],i):i(t.children[n])}(t,(function(t){var r=t.getAttribute&&t.getAttribute("lang-key");if(r){var o=i[r.toUpperCase()]||n[r];o&&(t.innerHTML="function"==typeof o?o(e):o)}}))}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=this.i18n||{},n=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var r=i[t]||n[t]||"";r&&(e.innerHTML=r)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,Ur.addClass(this.find(".xgplayer-icon"),_a)}},{key:"enable",value:function(){this.config.disable=!1,Ur.removeClass(this.find(".xgplayer-icon"),_a)}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var r=kr(Er(i.prototype),"registerPlugin",this).call(this,e,t,n);return this._children.push(r),r}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,t,n){var r=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){r.bindEL(e,t)})):this.bindEL(e,t);else{var o=i.delegate.call(this,this.root,e,t,n);this.__delegates=this.__delegates.concat(o)}}},{key:"unbind",value:function(e,t){var i=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){i.unbindEL(e,t)})):this.unbindEL(e,t);else for(var n="".concat(e,"_").concat(t),r=0;r<this.__delegates.length;r++)if(this.__delegates[r].key===n){this.__delegates[r].destroy(),this.__delegates.splice(r,1);break}}},{key:"setStyle",value:function(e,t){var i=this;if(this.root)return"String"===Ur.typeOf(e)?this.root.style[e]=t:void("Object"===Ur.typeOf(e)&&Object.keys(e).map((function(t){i.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var i=this;if(this.root)return"String"===Ur.typeOf(e)?this.root.setAttribute(e,t):void("Object"===Ur.typeOf(e)&&Object.keys(e).map((function(t){i.root.setAttribute(t,e[t])})))}},{key:"setHtml",value:function(e,t){this.root&&(this.root.innerHTML=e,"function"==typeof t&&t())}},{key:"bindEL",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,i)}},{key:"unbindEL",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.removeEventListener(e,t,i)}},{key:"show",value:function(e){if(this.root)return this.root.style.display=void 0!==e?e:"block","none"===window.getComputedStyle(this.root,null).getPropertyValue("display")?this.root.style.display="block":void 0}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,t){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!(t&&t instanceof window.Element))return null;try{return"string"==typeof e?this.find(e).appendChild(t):e.appendChild(t)}catch(i){return Nr.logError("Plugin:appendChild",i),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e=this,t=this.player;this.__delegates.map((function(e){e.destroy()})),this.__delegates=[],this._children instanceof Array&&(this._children.map((function(e){t.unRegisterPlugin(e.pluginName)})),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),kr(Er(i.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null})),this.extraEls=[]}}],[{key:"insert",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.children.length,r=Number(i),o=e instanceof window.Node;if(n){for(var a=0,s=null,l="";a<n;a++){s=t.children[a];var c=Number(s.getAttribute("data-index"));if(c>=r){l="beforebegin";break}c<r&&(l="afterend")}return o?"afterend"===l?t.appendChild(e):t.insertBefore(e,s):s.insertAdjacentHTML(l,e),"afterend"===l?t.children[t.children.length-1]:t.children[a]}return o?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.children[t.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,t,i,n){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(e instanceof window.Node&&"function"==typeof n)if(Array.isArray(i))i.forEach((function(i){var a=ya(e,t,i,n,r);a.key="".concat(t,"_").concat(i),o.push(a)}));else{var a=ya(e,t,i,n,r);a.key="".concat(t,"_").concat(i),o.push(a)}return o}},{key:"ROOT_TYPES",get:function(){return va}},{key:"POSITIONS",get:function(){return ma}}]),i}(),Ca=function(){function e(){var t=this;if(gr(this,e),mr(this,"__trigger",(function(e){var i=(new Date).getTime();t.timeStamp=i;for(var n=0;n<e.length;n++)t.__runHandler(e[n].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver(function(e,t,i){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Br(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),Fr(e,t,{leading:n,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(ds){console.error(ds)}}return vr(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer.observe(e);for(var i=e.getAttribute(Qo),n=this.__handlers,r=-1,o=0;o<n.length;o++)n[o]&&e===n[o].target&&(r=o);r>-1?this.__handlers[r].handler=t:this.__handlers.push({target:e,handler:t,playerId:i})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(i,n){e===i.target&&(t=n)}));try{var i;null===(i=this.observer)||void 0===i||i.unobserve(e)}catch(ds){}t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){var e;null===(e=this.observer)||void 0===e||e.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,i=0;i<t.length;i++)if(t[i]&&e===t[i].target){try{t[i].handler(e)}catch(n){console.error(n)}return!0}return!1}}]),e}(),ka=null;var Ia={pluginGroup:{},init:function(e){var t,i,n=e._pluginInfoId;n||(n=(new Date).getTime(),e._pluginInfoId=n),!e.config.closeResizeObserver&&(t=e.root,i=function(){e.resize()},ka||(ka=new Ca),ka.addObserver(t,i)),this.pluginGroup[n]={_originalOptions:e.config||{},_plugins:{}}},formatPluginInfo:function(e,t){var i=null,n=null;return e.plugin&&"function"==typeof e.plugin?(i=e.plugin,n=e.options):(i=e,n={}),t&&(n.config=t||{}),{PLUFGIN:i,options:n}},checkPluginIfExits:function(e,t){for(var i=0;i<t.length;i++)if(e.toLowerCase()===t[i].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(e,t){for(var i=Object.keys(t),n=null,r=0;r<i.length;r++)if(e.toLowerCase()===i[r].toLowerCase()){n=t[i[r]];break}return"Object"===Ur.typeOf(n)?{root:n.root,position:n.position}:{}},lazyRegister:function(e,t){var i=this,n=t.timeout||1500;return Promise.race([t.loader().then((function(t){var n;n=t&&t.__esModule?t.default:t,i.register(e,n,t.options)})),new Promise((function(e,t){setTimeout((function(){t(new Error("timeout"))}),n)}))])},register:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var n=e._pluginInfoId;if(n&&this.pluginGroup[n]){this.pluginGroup[n]._plugins||(this.pluginGroup[n]._plugins={});var r=this.pluginGroup[n]._plugins,o=this.pluginGroup[n]._originalOptions;i.player=e;var a=i.pluginName||t.pluginName;if(!a)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported(e.config.mediaType,e.config.codecType)){i.config||(i.config={});for(var s=Object.keys(o),l=0;l<s.length;l++)if(a.toLowerCase()===s[l].toLowerCase()){var c=o[s[l]];"Object"===Ur.typeOf(c)?i.config=Object.assign({},i.config,o[s[l]]):"Boolean"===Ur.typeOf(c)&&(i.config.disable=!c);break}t.defaultConfig&&Object.keys(t.defaultConfig).forEach((function(e){void 0===i.config[e]&&(i.config[e]=t.defaultConfig[e])})),i.root?"string"==typeof i.root&&(i.root=e[i.root]):i.root=e.root,i.index=i.config.index||0;try{r[a.toLowerCase()]&&(this.unRegister(n,a.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(a,"] exist, destroy the old instance")));var u=new t(i);return r[a.toLowerCase()]=u,r[a.toLowerCase()].func=t,u&&"function"==typeof u.afterCreate&&u.afterCreate(),u}catch(h){throw console.error(h),h}}else console.warn("not supported plugin [".concat(a,"]"))}}},unRegister:function(e,t){e._pluginInfoId&&(e=e._pluginInfoId),t=t.toLowerCase();try{var i=this.pluginGroup[e]._plugins[t];i&&(i.pluginName&&i.__destroy(),delete this.pluginGroup[e]._plugins[t])}catch(ds){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),ds)}},deletePlugin:function(e,t){var i=e._pluginInfoId;i&&this.pluginGroup[i]&&this.pluginGroup[i]._plugins&&delete this.pluginGroup[i]._plugins[t]},getPlugins:function(e){var t=e._pluginInfoId;return t&&this.pluginGroup[t]?this.pluginGroup[t]._plugins:{}},findPlugin:function(e,t){var i=e._pluginInfoId;if(!i||!this.pluginGroup[i])return null;var n=t.toLowerCase();return this.pluginGroup[i]._plugins[n]},beforeInit:function(e){var t=this;function i(e){return e&&e.then?e:new Promise((function(e){e()}))}return new Promise((function(n){if(t.pluginGroup)return(e._loadingPlugins&&e._loadingPlugins.length?Promise.all(e._loadingPlugins):Promise.resolve()).then((function(){var r=e._pluginInfoId;if(t.pluginGroup[r]){var o=t.pluginGroup[r]._plugins,a=[];Object.keys(o).forEach((function(e){if(o[e]&&o[e].beforePlayerInit)try{var t=o[e].beforePlayerInit();a.push(i(t))}catch(ds){throw a.push(i(null)),ds}})),Promise.all([].concat(a)).then((function(){n()})).catch((function(e){console.error(e),n()}))}else n()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var i=this.pluginGroup[t]._plugins;Object.keys(i).forEach((function(e){i[e]&&i[e].afterPlayerInit&&i[e].afterPlayerInit()}))}},setLang:function(e,t){var i=t._pluginInfoId;if(i&&this.pluginGroup[i]){var n=this.pluginGroup[i]._plugins;Object.keys(n).forEach((function(t){if(n[t].updateLang)n[t].updateLang(e);else try{n[t].lang=e}catch(i){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,i=e._pluginInfoId;if(i&&this.pluginGroup[i]){var n=[],r=this.pluginGroup[i]._plugins;Object.keys(r).forEach((function(e){"controls"!==e&&r[e]&&(n.push({plugin:r[e].func,options:r[e].__args}),t.unRegister(i,e))})),n.forEach((function(i){t.register(e,i.plugin,i.options)}))}},onPluginsReady:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var i=this.pluginGroup[t]._plugins||{};Object.keys(i).forEach((function(e){i[e].onPluginsReady&&"function"==typeof i[e].onPluginsReady&&i[e].onPluginsReady()}))}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){var i,n,r;i=e.root,null===(r=ka)||void 0===r||r.unObserver(i,n);for(var o=this.pluginGroup[t]._plugins,a=0,s=Object.keys(o);a<s.length;a++){var l=s[a];this.unRegister(t,l)}delete this.pluginGroup[t],delete e._pluginInfoId}}},Pa={DEFAULT:"xgplayer",DEFAULT_SKIN:"xgplayer-skin-default",ENTER:"xgplayer-is-enter",PAUSED:"xgplayer-pause",PLAYING:"xgplayer-playing",ENDED:"xgplayer-ended",CANPLAY:"xgplayer-canplay",LOADING:"xgplayer-isloading",ERROR:"xgplayer-is-error",REPLAY:"xgplayer-replay",NO_START:"xgplayer-nostart",ACTIVE:"xgplayer-active",INACTIVE:"xgplayer-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",INNER_FULLSCREEN:"xgplayer-fullscreen-inner",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",CONTROLS_AUTOHIDE:"controls-autohide",TOP_BAR_AUTOHIDE:"top-bar-autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};function Da(){return{id:"",el:null,url:"",domEventType:"default",nullUrlStart:!1,width:600,height:337.5,fluid:!1,fitVideoSize:"fixed",videoFillMode:"auto",volume:.6,autoplay:!1,autoplayMuted:!1,loop:!1,isLive:!1,zoom:1,videoInit:!0,poster:"",isMobileSimulateMode:!1,defaultPlaybackRate:1,execBeforePluginsCall:null,allowSeekAfterEnded:!0,enableContextmenu:!0,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!0,closeControlsBlur:!0,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},preProcessUrl:null,ignores:[],whitelist:[],inactive:3e3,lang:(e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase(),"zh-cn"===e&&(e="zh"),e),controls:!0,marginControls:!1,fullscreenTarget:null,screenShot:!1,rotate:!1,pip:!1,download:!1,mini:!1,cssFullscreen:!0,keyShortcut:!0,presets:[],plugins:[],playbackRate:1,definition:{list:[]},playsinline:!0,customDuration:0,timeOffset:0,icons:{},i18n:[],tabindex:0,thumbnail:null,videoConfig:{},isHideTips:!1,minWaitDelay:200,commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}};var e}var wa=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var i=Sr(e),n=i.player;i.playerConfig.closeControlsBlur&&n.focus({autoHide:!1})})),mr(Sr(e),"onMouseLeave",(function(t){Sr(e).player.focus()})),e}return vr(i,[{key:"beforeCreate",value:function(e){e.config.mode||"mobile"!==Kr.device||(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,t=this.config,i=t.disable,n=t.height,r=t.mode;if(!i){"flex"===r&&this.player.addClass(Pa.FLEX_CONTROLS);var o={height:"".concat(n,"px")};Object.keys(o).map((function(t){e.root.style[t]=o[t]})),this.left=this.find("xg-left-grid"),this.center=this.find("xg-center-grid"),this.right=this.find("xg-right-grid"),this.innerRoot=this.find("xg-inner-controls"),this.on(Do,(function(t){t?Ur.addClass(e.root,"mini-controls"):Ur.removeClass(e.root,"mini-controls")}));var a=this.playerConfig.isMobileSimulateMode;"mobile"!==Kr.device&&"mobile"!==a&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"focusAwhile",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&Ur.addClass(this.root,Pa.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){Ur.removeClass(this.root,Pa.CONTROLS_AUTOHIDE)}},{key:"show",value:function(e){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(this.root){var r=e.defaultConfig||{};if(!t.root){switch(t.position?t.position:t.config&&t.config.position?t.config.position:r.position){case ma.CONTROLS_LEFT:t.root=this.left;break;case ma.CONTROLS_RIGHT:t.root=this.right;break;case ma.CONTROLS_CENTER:t.root=this.center;break;case ma.CONTROLS:t.root=this.root;break;default:t.root=this.left}return kr(Er(i.prototype),"registerPlugin",this).call(this,e,t,n)}}}},{key:"destroy",value:function(){"mobile"!==Kr.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave)),this.left=null,this.center=null,this.right=null,this.innerRoot=null}},{key:"render",value:function(){var e=this.config,t=e.mode,i=e.autoHide,n=e.initShow;if(!e.disable){var r=Ur.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},mr({},Pa.CONTROLS_AUTOHIDE,i),{"xgplayer-controls-initshow":n||!i});return'<xg-controls class="'.concat(r,'" unselectable="on">\n <xg-inner-controls class="xg-inner-controls xg-pos">\n <xg-left-grid class="xg-left-grid">\n </xg-left-grid>\n <xg-center-grid class="xg-center-grid"></xg-center-grid>\n <xg-right-grid class="xg-right-grid">\n </xg-right-grid>\n </xg-inner-controls>\n </xg-controls>')}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),i}(),Aa={lang:{},langKeys:[],textKeys:[]};function Ra(e,t){return Object.keys(t).forEach((function(i){var n,r=Ur.typeOf(t[i]),o=Ur.typeOf(e[i]);"Array"===r?("Array"!==o&&(e[i]=[]),(n=e[i]).push.apply(n,Ir(t[i]))):"Object"===r?("Object"!==o&&(e[i]={}),Ra(e[i],t[i])):e[i]=t[i]})),e}function xa(){Object.keys(Aa.lang.en).map((function(e){Aa.textKeys[e]=e}))}function Oa(e,t){var i=e.LANG;if(t||(t=Aa),t.lang){var n=e.TEXT||{};"zh"===i&&(i="zh-cn"),t.lang[i]?Ra(t.lang[i],n):(t.langKeys.push(i),t.lang[i]=n),xa()}}Oa({LANG:"en",TEXT:{ERROR_TYPES:{network:{code:1,msg:"video download error"},mse:{code:2,msg:"stream append error"},parse:{code:3,msg:"parsing error"},format:{code:4,msg:"wrong format"},decoder:{code:5,msg:"decoding error"},runtime:{code:6,msg:"grammatical errors"},timeout:{code:7,msg:"play timeout"},other:{code:8,msg:"other errors"}},HAVE_NOTHING:"There is no information on whether audio/video is ready",HAVE_METADATA:"Audio/video metadata is ready ",HAVE_CURRENT_DATA:"Data about the current play location is available, but there is not enough data to play the next frame/millisecond",HAVE_FUTURE_DATA:"Current and at least one frame of data is available",HAVE_ENOUGH_DATA:"The available data is sufficient to start playing",NETWORK_EMPTY:"Audio/video has not been initialized",NETWORK_IDLE:"Audio/video is active and has been selected for resources, but no network is used",NETWORK_LOADING:"The browser is downloading the data",NETWORK_NO_SOURCE:"No audio/video source was found",MEDIA_ERR_ABORTED:"The fetch process is aborted by the user",MEDIA_ERR_NETWORK:"An error occurred while downloading",MEDIA_ERR_DECODE:"An error occurred while decoding",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported",REPLAY:"Replay",ERROR:"Network is offline",PLAY_TIPS:"Play",PAUSE_TIPS:"Pause",PLAYNEXT_TIPS:"Play next",DOWNLOAD_TIPS:"Download",ROTATE_TIPS:"Rotate",RELOAD_TIPS:"Reload",FULLSCREEN_TIPS:"Fullscreen",EXITFULLSCREEN_TIPS:"Exit fullscreen",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Exit cssfullscreen",TEXTTRACK:"Caption",PIP:"PIP",SCREENSHOT:"Screenshot",LIVE:"LIVE",OFF:"Off",OPEN:"Open",MINI_DRAG:"Click and hold to drag",MINISCREEN:"Miniscreen",REFRESH_TIPS:"Please Try",REFRESH:"Refresh",FORWARD:"forward",LIVE_TIP:"Live"}});var La={get textKeys(){return Aa.textKeys},get langKeys(){return Aa.langKeys},get lang(){var e={};return Aa.langKeys.map((function(t){e[t]=Aa.lang[t]})),Aa.lang["zh-cn"]&&(e.zh=Aa.lang["zh-cn"]||{}),e},extend:function(e,t){var i=[];if(t||(t=Aa),t.lang){i="Array"!==Ur.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e;var n=t.lang;i.map((function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),n[e.LANG]?Ra(n[e.LANG]||{},e.TEXT||{}):Oa(e,t)})),xa()}},use:Oa,init:function(e){var t,i={lang:{},langKeys:[],textKeys:{},pId:e};return Ra(i.lang,Aa.lang),(t=i.langKeys).push.apply(t,Ir(Aa.langKeys)),Ra(i.textKeys,Aa.textKeys),i}},Na={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7,DESTROYED:8},Ma=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],Ua={},Ba=null,Fa=function(e){_r(i,Ar.EventEmitter);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"add",value:function(e){e&&(Ua[e.playerId]=e,1===Object.keys(Ua).length&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete Ua[e.playerId])}},{key:"_iterate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var i in Ua)if(Object.prototype.hasOwnProperty.call(Ua,i)){var n=Ua[i];if(t){if(e(n))break}else e(n)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var t=null;return this._iterate((function(i){var n=e(i);return n&&(t=i),n}),!0),t}},{key:"findAll",value:function(e){var t=[];return this._iterate((function(i){e(i)&&t.push(i)})),t}},{key:"setActive",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Ua[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!0,t.isInstNext=!1):t.isUserActive=!1})):Ua[e].isUserActive=t,e}},{key:"getActiveId",value:function(){for(var e=Object.keys(Ua),t=0;t<e.length;t++){var i=Ua[e[t]];if(i&&i.isUserActive)return e[t]}return null}},{key:"setNext",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Ua[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!1,t.isInstNext=!0):t.isInstNext=!1})):Ua[e].isInstNext=t,e}}],[{key:"getInstance",value:function(){return Ba||(Ba=new i),Ba}}]),i}();var Ha=["play","pause","replay","retry"],ja=0,Va=0,Ka=null,Ga=function(e){_r(i,zo);var t=Cr(i);function i(e){var n;gr(this,i);var r,o=Ur.deepMerge(Da(),e);mr(Sr(n=t.call(this,o)),"canPlayFunc",(function(){if(n.config){var e=n.config,t=e.autoplay,i=e.defaultPlaybackRate;Nr.logInfo("player","canPlayFunc, startTime",n.__startTime),n._seekToStartTime(),n.playbackRate=i,(t||n._useAutoplay)&&n.mediaPlay(),n.off(no,n.canPlayFunc),n.removeClass(Pa.ENTER)}})),mr(Sr(n),"onFullscreenChange",(function(e,t){var i=function(){Ur.setTimeout(Sr(n),(function(){n.resize()}),100)},r=Ur.getFullScreenEl();n._fullActionFrom?n._fullActionFrom="":n.emit(Bo,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:n.currentTime,duration:n.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=function(e,t,i){if(e){var n=e.getAttribute(i);return!(!n||n!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}}(r,n.playerId,Qo);if(t||r&&(r===n._fullscreenEl||o))i(),!n.config.closeFocusVideoFocus&&n.media.focus(),n.fullscreen=!0,n.changeFullStyle(n.root,r,Pa.FULLSCREEN),n.emit(Io,!0,n._fullScreenOffset),n.cssfullscreen&&n.exitCssFullscreen();else if(n.fullscreen){i();var a=Sr(n),s=a._fullScreenOffset;if(a.config.needFullscreenScroll?(window.scrollTo(s.left,s.top),Ur.setTimeout(Sr(n),(function(){n.fullscreen=!1,n._fullScreenOffset=null}),100)):(!n.config.closeFocusVideoFocus&&n.media.focus(),n.fullscreen=!1,n._fullScreenOffset=null),n.cssfullscreen)n.removeClass(Pa.FULLSCREEN);else{var l=n._fullscreenEl;l||!n.root.contains(e.target)&&e.target!==n.root||(l=e.target),n.recoverFullStyle(n.root,l,Pa.FULLSCREEN)}n._fullscreenEl=null,n.emit(Io,!1)}})),mr(Sr(n),"_onWebkitbeginfullscreen",(function(e){n._fullscreenEl=n.media,n.onFullscreenChange(e,!0)})),mr(Sr(n),"_onWebkitendfullscreen",(function(e){n.onFullscreenChange(e,!1)})),aa(Sr(n),Ha),n.config=o,n._pluginInfoId=Ur.generateSessionId(),(r=Sr(n)).logInfo=Nr.logInfo.bind(r),r.logWarn=Nr.logWarn.bind(r),r.logError=Nr.logError.bind(r);var a=n.constructor.defaultPreset;if(n.config.presets.length){var s=n.config.presets.indexOf("default");s>=0&&a&&(n.config.presets[s]=a)}else a&&n.config.presets.push(a);if(n.userTimer=null,n.waitTimer=null,n.handleSource=!0,n._state=Na.INITIAL,n.isAd=!1,n.isError=!1,n._hasStart=!1,n.isSeeking=!1,n.isCanplay=!1,n._useAutoplay=!1,n.__startTime=-1,n.rotateDeg=0,n.isActive=!1,n.fullscreen=!1,n.cssfullscreen=!1,n.isRotateFullscreen=!1,n._fullscreenEl=null,n.timeSegments=[],n._cssfullscreenEl=null,n.curDefinition=null,n._orgCss="",n._fullScreenOffset=null,n._videoHeight=0,n._videoWidth=0,n.videoPos={pi:1,scale:0,rotate:-1,x:0,y:0,h:-1,w:-1,vy:0,vx:0},n.sizeInfo={width:0,height:0,left:0,top:0},n._accPlayed={t:0,acc:0,loopAcc:0},n._offsetInfo={currentTime:-1,duration:0},n.innerContainer=null,n.controls=null,n.topBar=null,n.root=null,n.__i18n=La.init(n._pluginInfoId),Kr.os.isAndroid&&Kr.osVersion>0&&Kr.osVersion<6&&(n.config.autoplay=!1),n.database=new $o,n.isUserActive=!1,n._onceSeekCanplay=null,n._isPauseBeforeSeek=0,n.innerStates={isActiveLocked:!1},n.instManager=Ka,!n._initDOM())return console.error(new Error("can't find the dom which id is ".concat(n.config.id," or this.config.el does not exist"))),br(n);var l=n.config,c=l.definition,u=void 0===c?{}:c;if(!l.url&&u.list&&u.list.length>0){var h=u.list.find((function(e){return e.definition&&e.definition===u.defaultDefinition}));h||(u.defaultDefinition=u.list[0].definition,h=u.list[0]),n.config.url=h.url,n.curDefinition=h}return n._bindEvents(),n._registerPresets(),n._registerPlugins(),Ia.onPluginsReady(Sr(n)),n.getInitDefinition(),n.setState(Na.READY),Ur.setTimeout(Sr(n),(function(){n.emit(po)}),0),n.onReady&&n.onReady(),(n.config.videoInit||n.config.autoplay)&&(!n.hasStart||n.state<Na.ATTACHED)&&n.start(),n}return vr(i,[{key:"_initDOM",value:function(){var e,t=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var i=this.config.el;if(!i||1!==i.nodeType)return this.emit(Qr,new zr("use",this.config.vid,{line:32,handle:"Constructor",msg:"container id can't be empty"})),console.error("this.confg.id or this.config.el can't be empty"),!1;this.root=i}var n=function(e){for(var t=Object.keys(Ua),i=0;i<t.length;i++){var n=Ua[t[i]];if(n.root===e)return n}return null}(this.root);if(n&&(Nr.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),n.destroy()),this.root.setAttribute(Qo,this.playerId),this.media.setAttribute(Qo,this.playerId),null===(e=Ka)||void 0===e||e.add(this),Ia.init(this),this._initBaseDoms(),this.config.controls){var r=this.config.controls.root||null,o=Ia.register(this,wa,{root:r});this.controls=o}var a="mobile"===this.config.isMobileSimulateMode?"mobile":Kr.device;if(this.addClass("".concat(Pa.DEFAULT," ").concat(Pa.INACTIVE," xgplayer-").concat(a," ").concat(this.config.controls?"":Pa.NO_CONTROLS)),this.config.autoplay?this.addClass(Pa.ENTER):this.addClass(Pa.NO_START),this.config.fluid){var s=this.config,l=s.width,c=s.height;"number"==typeof l&&"number"==typeof c||(l=600,c=337.5);var u={width:"100%",height:"0","max-width":"100%","padding-top":"".concat(100*c/l,"%")};Object.keys(u).forEach((function(e){t.root.style[e]=u[e]}))}else["width","height"].forEach((function(e){t.config[e]&&("number"!=typeof t.config[e]?t.root.style[e]=t.config[e]:t.root.style[e]="".concat(t.config[e],"px"))}));var h=this.root.getBoundingClientRect(),d=h.width,f=h.height,p=h.left,g=h.top;return this.sizeInfo.width=d,this.sizeInfo.height=f,this.sizeInfo.left=p,this.sizeInfo.top=g,!0}},{key:"_initBaseDoms",value:function(){this.topBar=null,this.leftBar=null,this.rightBar=null,this.config.marginControls&&(this.innerContainer=Ur.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer))}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),Xo.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),Kr.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(ao,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once($r,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),Xo.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off($r,this.playFunc),this.off(no,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_clearUserTimer",value:function(){this.userTimer&&(Ur.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"_startInit",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.media&&(e&&""!==e&&("Array"!==Ur.typeOf(e)||0!==e.length)||(e="",this.emit(go),Nr.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){Ur.isNotNull(i.playSessionId)&&(this._playSessionId=i.playSessionId),this.handleSource&&(this._detachSourceEvents(this.media),"Array"===Ur.typeOf(e)&&e.length>0?this._attachSourceEvents(this.media,e):this.media.src&&this.media.src===e?e||this.media.removeAttribute("src"):this.media.src=e),"Number"===Ur.typeOf(this.config.volume)&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root;this.media instanceof window.Element&&!n.contains(this.media)&&n.insertBefore(this.media,n.firstChild);var r=this.media.readyState;Nr.logInfo("_startInit readyState",r),this.config.autoplay&&(!Ur.isMSE(this.media)&&this.load(),(Kr.os.isIpad||Kr.os.isPhone)&&this.mediaPlay());var o=this.config.startTime;this.__startTime=o>0?o:-1,this.config.startTime=0,r>=2&&this.duration>0?this.canPlayFunc():this.on(no,this.canPlayFunc),(!this.hasStart||this.state<Na.ATTACHED)&&Ia.afterInit(this),this.hasStart=!0,this.setState(Na.ATTACHED),Ur.setTimeout(this,(function(){t.emit(mo)}),0)}}},{key:"_registerPlugins",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._loadingPlugins=[];var i=this.config.ignores||[],n=this.config.plugins||[],r=this.config.i18n||[];t&&La.extend(r,this.__i18n);var o=i.join("||").toLowerCase().split("||"),a=this.plugins;n.forEach((function(i){try{var n=i.plugin?i.plugin.pluginName:i.pluginName;if(n&&o.indexOf(n.toLowerCase())>-1)return null;if(!t&&a[n.toLowerCase()])return;if(i.lazy&&i.loader){var r=Ia.lazyRegister(e,i);return void(i.forceBeforeInit&&(r.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})).catch((function(t){Nr.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})),e._loadingPlugins.push(r)))}return e.registerPlugin(i)}catch(s){Nr.logError("_registerPlugins:",s)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var i,n,r=t.preset&&t.options?new t.preset(t.options,e.config):new t({},e.config),o=r.plugins,a=void 0===o?[]:o,s=r.ignores,l=void 0===s?[]:s,c=r.icons,u=void 0===c?{}:c,h=r.i18n,d=void 0===h?[]:h;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(i=e.config.plugins).push.apply(i,Ir(a)),(n=e.config.ignores).push.apply(n,Ir(l)),Object.keys(u).map((function(t){e.config.icons[t]||(e.config.icons[t]=u[t])}));var f=e.config.i18n||[];d.push.apply(d,Ir(f)),e.config.i18n=d}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case ma.ROOT_RIGHT:this.rightBar||(this.rightBar=Ur.createPositionBar("xg-right-bar",this.root)),t=this.rightBar;break;case ma.ROOT_LEFT:this.leftBar||(this.leftBar=Ur.createPositionBar("xg-left-bar",this.root)),t=this.leftBar;break;case ma.ROOT_TOP:this.topBar||(this.topBar=Ur.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&Ur.addClass(this.topBar,Pa.TOP_BAR_AUTOHIDE)),t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var i=Ia.formatPluginInfo(e,t),n=i.PLUFGIN,r=i.options,o=this.config.plugins;!Ia.checkPluginIfExits(n.pluginName,o)&&o.push(n);var a=Ia.getRootByConfig(n.pluginName,this.config);a.root&&(r.root=a.root),a.position&&(r.position=a.position);var s,l=r.position?r.position:r.config&&r.config.position||n.defaultConfig&&n.defaultConfig.position;return!r.root&&"string"==typeof l&&l.indexOf("controls")>-1?null===(s=this.controls)||void 0===s?void 0:s.registerPlugin(n,r,n.pluginName):(r.root||(r.root=this._getRootByPosition(l)),Ia.register(this,n,r))}},{key:"deregister",value:function(e){"string"==typeof e?Ia.unRegister(this,e):e instanceof ua&&Ia.unRegister(this,e.pluginName)}},{key:"unRegisterPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.deregister(e),t&&this.removePluginFromConfig(e)}},{key:"removePluginFromConfig",value:function(e){var t;if("string"==typeof e?t=e:e instanceof ua&&(t=e.pluginName),t)for(var i=this.config.plugins.length-1;i>-1;i--){if(this.config.plugins[i].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(i,1);break}}}},{key:"plugins",get:function(){return Ia.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=Ia.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(Ur.hasClass(this.root,e)||Ur.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&Ur.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return Ur.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,t){this.root&&this.root.setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){this.root&&this.root.removeAttribute(e,t)}},{key:"start",value:function(e){var t=this;if(!(this.state>Na.ATTACHING)){var i=this._playSessionId;return Ur.isNotNull(i)&&(this._playSessionId=void 0),e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this.setState(Na.ATTACHING),this._registerPlugins(!1),Ia.beforeInit(this).then((function(){if(t.config){e||(e=t.url||t.config.url);var n=t.preProcessUrl(e);return t._startInit(n.url,{playSessionId:i})}})).catch((function(e){throw e.fileName="player",e.lineNumber="236",Nr.logError("start:beforeInit:",e),e}))}}},{key:"switchURL",value:function(e,t){var i=this,n=e;"Object"===Ur.typeOf(e)&&(n=e.url),n=this.preProcessUrl(n).url;var r=this.currentTime;this.__startTime=r;var o=this.paused&&!this.isError;return this.src=n,new Promise((function(e,t){var r=function(e){i.off("timeupdate",a),i.off("canplay",a),t(e)},a=function(){i._seekToStartTime(),o&&i.pause(),i.off("error",r),e(!0)};i.once("error",r),n?(Kr.os.isAndroid?i.once("timeupdate",a):i.once("canplay",a),i.play()):i.errorHandler("error",{code:6,message:"empty_src"})}))}},{key:"videoPlay",value:function(){this.mediaPlay()}},{key:"mediaPlay",value:function(){var e=this;if(!this.hasStart&&this.state<Na.ATTACHED)return this.removeClass(Pa.NO_START),this.addClass(Pa.ENTER),this.start(),void(this._useAutoplay=!0);this.state<Na.RUNNING&&(this.removeClass(Pa.NO_START),!this.isCanplay&&this.addClass(Pa.ENTER));var t=kr(Er(i.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(Pa.NOT_ALLOW_AUTOPLAY),e.addClass(Pa.PLAYING),e.state<Na.RUNNING&&(Nr.logInfo(">>>>playPromise.then"),e.setState(Na.RUNNING),e.emit(yo))})).catch((function(t){if(Nr.logWarn(">>>>playPromise.catch",t.name),e.media&&e.media.error)return e.onError(),void e.removeClass(Pa.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=Ur.setTimeout(e,(function(){e._errorTimer=null,e.emit(vo),e.addClass(Pa.NOT_ALLOW_AUTOPLAY),e.removeClass(Pa.ENTER),e.pause(),e.setState(Na.NOTALLOW)}),0))})):(Nr.logWarn("video.play not return promise"),this.state<Na.RUNNING&&(this.setState(Na.RUNNING),this.removeClass(Pa.NOT_ALLOW_AUTOPLAY),this.removeClass(Pa.NO_START),this.removeClass(Pa.ENTER),this.addClass(Pa.PLAYING),this.emit(yo))),t}},{key:"mediaPause",value:function(){kr(Er(i.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){kr(Er(i.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(Pa.PAUSED),la(this,"play",(function(){return e.mediaPlay()}))}},{key:"pause",value:function(){var e=this;la(this,"pause",(function(){kr(Er(i.prototype),"pause",e).call(e)}))}},{key:"seek",value:function(e,t){var i=this;if(this.media&&!Number.isNaN(Number(e))&&this.hasStart){var n=this.config,r=n.isSeekedPlay,o=n.seekedStatus,a=t||(r?"play":o);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(eo,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(i.removeClass(Pa.ENTER),i.isSeeking=!1,a){case"play":i.play();break;case"pause":i.pause();break;default:i._isPauseBeforeSeek>1||i.paused?i.pause():i.play()}i._isPauseBeforeSeek=0,i._onceSeekCanplay=null},this.once(eo,this._onceSeekCanplay),this.state<Na.RUNNING?(this.removeClass(Pa.NO_START),this.currentTime=e,this.play()):this.currentTime=e}}},{key:"getInitDefinition",value:function(){var e=this,t=this.config,i=t.definition;!t.url&&i&&i.list&&i.list.length>0&&i.defaultDefinition&&i.list.map((function(t){t.definition===i.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t)}))}},{key:"changeDefinition",value:function(e,t){var i=this,n=this.config.definition;if(Array.isArray(null==n?void 0:n.list)&&n.list.forEach((function(t){(null==e?void 0:e.definition)===t.definition&&(i.curDefinition=t)})),null!=e&&e.bitrate&&"number"!=typeof e.bitrate&&(e.bitrate=parseInt(e.bitrate,10)||0),this.emit(wo,{from:t,to:e}),this.hasStart){var r=this.switchURL(e.url,fr({seamless:!1!==n.seamless&&"undefined"!=typeof MediaSource&&"function"==typeof MediaSource.isTypeSupported},e));r&&r.then?r.then((function(){i.emit(Ao,{from:t,to:e})})):this.emit(Ao,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(ao,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[Pa.NOT_ALLOW_AUTOPLAY,Pa.PLAYING,Pa.NO_START,Pa.PAUSED,Pa.REPLAY,Pa.ENTER,Pa.ENDED,Pa.ERROR,Pa.LOADING];this.hasStart=!1,this.isError=!1,this._useAutoplay=!1,this.mediaPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,t.forEach((function(t){e.removeClass(t)})),this.addClass(Pa.NO_START),this.emit(Fo)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1?arguments[1]:void 0;if(this.resetState(),this.plugins&&(t.map((function(t){e.deregister(t)})),i)){var n=Da();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=n[t])}))}}},{key:"destroy",value:function(){var e,t=this,n=this.innerContainer,r=this.root,o=this.media;if(r&&o){if(this.hasStart=!1,this._useAutoplay=!1,r.removeAttribute(Qo),o.removeAttribute(Qo),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),Ur.clearAllTimers(this),this.emit(Eo),null===(e=Ka)||void 0===e||e.remove(this),Ia.destroy(this),sa(this),kr(Er(i.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),n)for(var a=n.children,s=0;s<a.length;s++)n.removeChild(a[s]);!n&&o instanceof window.Node&&r.contains(o)&&!this.config.remainMediaAfterDestroy&&r.removeChild(o),["topBar","leftBar","rightBar","innerContainer"].map((function(e){t[e]&&r.removeChild(t[e]),t[e]=null}));var l=r.className.split(" ");l.length>0?r.className=l.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):r.className="",this.removeAttribute("data-xgfill"),["isSeeking","isCanplay","isActive","cssfullscreen","fullscreen"].forEach((function(e){t[e]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(Pa.ENDED),this.currentTime=0,this.isSeeking=!1,la(this,"replay",(function(){e.once(eo,(function(){var t=e.mediaPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.emit(_o),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(Pa.ERROR),this.addClass(Pa.LOADING),la(this,"retry",(function(){var t=e.currentTime,i=e.config.url,n=Ur.isMSE(e.media)?{url:i}:e.preProcessUrl(i);e.src=n.url,!e.config.isLive&&(e.currentTime=t),e.once(no,(function(){e.mediaPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,i,n){e&&(n||(n=Pa.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=Ur.filterStyleFromText(e)),Ur.addClass(e,i),t&&t!==e&&!this._orgPCss&&(this._orgPCss=Ur.filterStyleFromText(t),Ur.addClass(t,n),t.setAttribute(Qo,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,i,n){n||(n=Pa.PARENT_FULLSCREEN),this._orgCss&&(Ur.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),Ur.removeClass(e,i),t&&t!==e&&this._orgPCss&&(Ur.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",Ur.removeClass(t,n),t.removeAttribute(Qo))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,i=this.media;if("video"!==e&&"media"!==e||(e=this[e]),e||(e=t),this._fullScreenOffset={top:Ur.scrollTop(),left:Ur.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get",Ur.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var n=0;n<qo.length;n++){var r=qo[n];if(e[r]){var o="webkitRequestFullscreen"===r?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[r]();return o&&o.then?o:Promise.resolve()}}return i.fullscreenEnabled||i.webkitSupportsFullscreen?(i.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(a){return Promise.reject(new Error("call getFullscreen fail"))}}},{key:"exitFullscreen",value:function(e){if(this.isRotateFullscreen&&this.exitRotateFullscreen(),this._fullscreenEl||Ur.getFullScreenEl()){this.root;var t=this.media;this._fullActionFrom="exit";try{for(var i=0;i<Zo.length;i++){var n=Zo[i];if(document[n]){var r=document[n]();return r&&r.then?r:Promise.resolve()}}return t&&t.webkitSupportsFullscreen?(t.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}catch(o){return Promise.reject(new Error("call exitFullscreen fail"))}}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.isRotateFullscreen?this.exitRotateFullscreen():this.fullscreen&&this.exitFullscreen();var t=e?"".concat(Pa.INNER_FULLSCREEN," ").concat(Pa.CSS_FULLSCREEN):Pa.CSS_FULLSCREEN;this.changeFullStyle(this.root,e,t);var i=this.config.fullscreen,n=void 0===i?{}:i;(!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen())&&(this.fullscreen=!0,this.emit(Io,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(Po,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(Pa.INNER_FULLSCREEN," ").concat(Pa.CSS_FULLSCREEN):Pa.CSS_FULLSCREEN;if(this.fullscreen){var t=this.config.fullscreen,i=void 0===t?{}:t;!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.useCssFullscreen()?(this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this.fullscreen=!1,this.emit(Io,!1)):this.removeClass(e)}else this.recoverFullStyle(this.root,this._cssfullscreenEl,e);this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(Po,!1)}},{key:"getRotateFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.cssfullscreen&&this.exitCssFullscreen(e);var t=e?"".concat(Pa.INNER_FULLSCREEN," ").concat(Pa.ROTATE_FULLSCREEN):Pa.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,t,Pa.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!0,this.fullscreen=!0,this.setRotateDeg(90),this._rootStyle=this.root.getAttribute("style");var i=90===Math.abs(window.orientation)||90===Math.abs(screen.orientation.angle);this.root.style.width="".concat(i?window.innerWidth:window.innerHeight,"px"),this.emit(Io,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this._fullscreenEl!==this.root?"".concat(Pa.INNER_FULLSCREEN," ").concat(Pa.ROTATE_FULLSCREEN):Pa.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,t,Pa.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(Io,!1),this._rootStyle&&(this.root.style.style=this._rootStyle,this._rootStyle=!1)}},{key:"setRotateDeg",value:function(e){90===window.orientation||-90===window.orientation?this.rotateDeg=0:this.rotateDeg=e}},{key:"focus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};this.isActive?this.onFocus(e):this.emit(ho,fr({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};this.isActive?(this._clearUserTimer(),this.emit(fo,fr({paused:this.paused,ended:this.ended},e))):this.onBlur(e)}},{key:"onFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!0,delay:3e3},i=this.innerStates;if(this.isActive=!0,this.removeClass(Pa.INACTIVE),this._clearUserTimer(),void 0!==t.isLock&&(i.isActiveLocked=t.isLock),!1===t.autoHide||!0===t.isLock||i.isActiveLocked)this._clearUserTimer();else{var n=t&&t.delay?t.delay:this.config.inactive;this.userTimer=Ur.setTimeout(this,(function(){e.userTimer=null,e.blur()}),n)}}},{key:"onBlur",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).ignorePaused,t=void 0!==e&&e;if(!this.innerStates.isActiveLocked){var i=this.config.closePauseVideoFocus;this.isActive=!1,(t||i||!this.paused&&!this.ended)&&this.addClass(Pa.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(Pa.ENTER),this.removeClass(Pa.ERROR),this.removeClass(Pa.LOADING),this.isCanplay=!0,this.waitTimer&&Ur.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){var e=this;this.isError=!1,this.isSeeking=!1,this.__startTime>0&&(this.duration>0?this._seekToStartTime():this.once(ro,(function(){e._seekToStartTime()})))}},{key:"onLoadstart",value:function(){this.removeClass(Pa.ERROR),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===Na.ENDED&&this.setState(Na.RUNNING),this.removeClass(Pa.PAUSED),this.ended&&this.removeClass(Pa.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(Pa.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this._clearUserTimer(),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(Pa.ENDED),this.setState(Na.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(Pa.NOT_ALLOW_AUTOPLAY),this.removeClass(Pa.NO_START),this.removeClass(Pa.ENTER),this.removeClass(Pa.LOADING),this.addClass(Pa.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(Pa.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&Ur.clearTimeout(this,this.waitTimer),this.removeClass(Pa.LOADING),this.removeClass(Pa.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&Ur.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=Ur.setTimeout(this,(function(){e.addClass(Pa.LOADING),e.emit(ko),Ur.clearTimeout(e,e.waitTimer),e.waitTimer=null}),this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[Pa.NO_START,Pa.PAUSED,Pa.ENDED,Pa.ERROR,Pa.REPLAY,Pa.LOADING].forEach((function(t){e.removeClass(t)})),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.media.videoHeight&&this.resize(),(this.waitTimer||this.hasClass(Pa.LOADING))&&this.media.readyState>2&&(this.removeClass(Pa.LOADING),Ur.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state===Na.NOTALLOW&&this.duration&&(this.setState(Na.RUNNING),this.emit(yo)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===Ur.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"emitUserAction",value:function(e,t,i){if(this.media&&t&&e){var n="String"===Ur.typeOf(e)?e:e.type||"";i.props&&"Array"!==Ur.typeOf(i.props)&&(i.props=[i.props]),this.emit(Bo,fr({eventType:n,action:t,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},i))}}},{key:"updateAcc",value:function(e){if(this._accPlayed.t){var t=(new Date).getTime()-this._accPlayed.t;this._accPlayed.acc+=t,this._accPlayed.t=0,("ended"===e||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{startDiff:0,endDiff:0})||{},i=t.startDiff,n=void 0===i?0:i,r=t.endDiff,o=void 0===r?0:r,a=this.media.buffered;if(!a||0===a.length||!this.duration)return!0;for(var s=e||this.media.currentTime||.2,l=a.length,c=0;c<l;c++)if(a.start(c)+n<=s&&a.end(c)-o>s)return!0;return!1}},{key:"resizePosition",value:function(){var e=this,t=this.videoPos,i=t.vy,n=t.vx,r=t.h,o=t.w,a=this.videoPos.rotate;if(!(a<0&&r<0&&o<0)){var s=this.videoPos._pi;if(!s&&this.media.videoHeight&&(s=this.media.videoWidth/this.media.videoHeight*100),s){this.videoPos.pi=s;var l={rotate:a=a<0?0:a},c=0,u=0,h=1,d=Math.abs(a/90),f=this.root,p=this.innerContainer,g=f.offsetWidth,y=p?p.offsetHeight:f.offsetHeight,v={},m=y,_=g;if(d%2==0)h=r>0?100/r:o>0?100/o:1,l.scale=h,c=i>0?(100-r)/2-i:0,l.y=2===d?0-c:c,u=n>0?(100-o)/2-n:0,l.x=2===d?0-u:u,v.width="".concat(_,"px"),v.height="".concat(m,"px"),v.maxWidth="",v.maxHeight="";else if(d%2==1){m=g;var E=y-g;u=-E/2/(_=y)*100,l.x=3===d?u+i/2:u-i/2,c=E/2/m*100,l.y=3===d?c+n/2:c-n/2,l.scale=h,v.width="".concat(_,"px"),v.maxWidth="".concat(_,"px"),v.height="".concat(m,"px"),v.maxHeight="".concat(m,"px")}var T=Ur.getTransformStyle(l,this.media.style.transform||this.media.style.webkitTransform);v.transform=T,v.webkitTransform=T,Object.keys(v).map((function(t){e.media.style[t]=v[t]}))}}}},{key:"position",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{h:0,y:0,x:0,w:0};if(this.media&&e&&e.h){var t=this.videoPos;t.h=100*e.h||0,t.w=100*e.w||0,t.vx=100*e.x||0,t.vy=100*e.y||0,this.resizePosition()}}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(i){if("plugins"!==i){t.config[i]=e[i];var n=t.plugins[i.toLowerCase()];n&&"Function"===Ur.typeOf(n.setConfig)&&n.setConfig(e[i])}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this.setConfig(e),this._currentTime=0,this._duration=0,la(this,"playnext",(function(){t.start(),t.emit(No,e)}))}},{key:"resize",value:function(){var e=this;if(this.media&&this.root){var t=this.root.getBoundingClientRect();this.sizeInfo.width=t.width,this.sizeInfo.height=t.height,this.sizeInfo.left=t.left,this.sizeInfo.top=t.top;var i=this.media,n=i.videoWidth,r=i.videoHeight,o=this.config,a=o.fitVideoSize,s=o.videoFillMode;if("fill"!==s&&"cover"!==s&&"contain"!==s||this.setAttribute("data-xgfill",s),r&&n){this._videoHeight=r,this._videoWidth=n;var l=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,c=t.width,u=t.height-l,h=parseInt(n/r*1e3,10),d=parseInt(c/u*1e3,10),f=c,p=u,g={};"auto"===a&&d>h||"fixWidth"===a?(p=c/h*1e3,this.config.fluid?g.paddingTop="".concat(100*p/f,"%"):g.height="".concat(p+l,"px")):("auto"===a&&d<h||"fixHeight"===a)&&(f=h*u/1e3,g.width="".concat(f,"px")),this.fullscreen||this.cssfullscreen||Object.keys(g).forEach((function(t){e.root.style[t]=g[t]})),("fillHeight"===s&&d<h||"fillWidth"===s&&d>h)&&this.setAttribute("data-xgfill","cover");var y={videoScale:h,vWidth:f,vHeight:p,cWidth:f,cHeight:p+l};this.resizePosition(),this.emit(Ro,y)}}}},{key:"updateObjectPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.media.updateObjectPosition?this.media.updateObjectPosition(e,t):this.media.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%")}},{key:"setState",value:function(e){Nr.logInfo("setState","state from:".concat(Ma[this.state]," to:").concat(Ma[e])),this._state=e}},{key:"preProcessUrl",value:function(e,t){var i=this.config,n=i.preProcessUrl,r=i.preProcessUrlOptions,o=Object.assign({},r,t);return Ur.isBlob(e)||"function"!=typeof n?{url:e}:n(e,o)}},{key:"_seekToStartTime",value:function(){this.__startTime>0&&this.duration>0&&(this.currentTime=this.__startTime>this.duration?this.duration:this.__startTime,this.__startTime=-1)}},{key:"state",get:function(){return this._state}},{key:"isFullscreen",get:function(){return this.fullscreen}},{key:"isCssfullScreen",get:function(){return this.cssfullscreen}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"==typeof e&&(this._hasStart=e,!1===e&&this.setState(Na.READY),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===Na.RUNNING||this._state===Na.ENDED},set:function(e){e?this.setState(Na.RUNNING):this._state>=Na.RUNNING&&this.setState(Na.ATTACHED)}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,i=this.config.definition,n=null,r=null;i.list=e,this.emit("resourceReady",e),e.forEach((function(e){var o;(null===(o=t.curDefinition)||void 0===o?void 0:o.definition)===e.definition&&(n=e),i.defaultDefinition===e.definition&&(r=e)})),!r&&e.length>0&&(r=e[0]),n?this.changeDefinition(n):r&&this.changeDefinition(r)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.media||!this.media.getVideoPlaybackQuality)return e;var t=this.media.getVideoPlaybackQuality();return e.dropped=t.droppedVideoFrames||0,e.total=t.totalVideoFrames||0,e.corrupted=t.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){var t=La.langKeys.filter((function(t){return t===e}));0!==t.length||"zh"===e?(this.config.lang=e,Ia.setLang(e,this)):console.error("Sorry, set lang fail, because the language [".concat(e,"] is not supported now, list of all supported languages is [").concat(La.langKeys.join(),"] "))}},{key:"i18n",get:function(){var e=this.config.lang;return"zh"===e&&(e="zh-cn"),this.__i18n.lang[e]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return Gr}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(e){this.__url=e}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(e){this.plugins.poster&&this.plugins.poster.update(e)}},{key:"readyState",get:function(){return kr(Er(i.prototype),"readyState",this)}},{key:"error",get:function(){var e=kr(Er(i.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return kr(Er(i.prototype),"networkState",this)}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed,t=e.acc,i=e.t;return i?(new Date).getTime()-i+t:t}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(e){(e=Ur.convertDeg(e))%90==0&&e!==this.videoPos.rotate&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return Va},set:function(e){Va=e}},{key:"realTimeSpeed",get:function(){return ja},set:function(e){ja=e}},{key:"offsetCurrentTime",get:function(){return this._offsetInfo.currentTime||0},set:function(e){this._offsetInfo.currentTime=e}},{key:"offsetDuration",get:function(){return this._offsetInfo.duration||0},set:function(e){this._offsetInfo.duration=e||0}},{key:"hook",value:function(e,t){return ea.call.apply(ea,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return ia.call.apply(ia,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return na.call.apply(na,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,t,i){for(var n=arguments.length,r=new Array(n>3?n-3:0),o=3;o<n;o++)r[o-3]=arguments[o];return ra.call.apply(ra,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,t,i){for(var n=arguments.length,r=new Array(n>3?n-3:0),o=3;o<n;o++)r[o-3]=arguments[o];return oa.call.apply(oa,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){var i;"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),Ur.typeOf(t)===Boolean&&(this.muted=t)),null===(i=Ka)||void 0===i||i.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return Nr.config.debug},set:function(e){Nr.config.debug=e}},{key:"instManager",get:function(){return Ka},set:function(e){Ka=e}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return null===(e=Ka)||void 0===e?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,t){var i;null===(i=Ka)||void 0===i||i.setActive(e,t)}},{key:"isHevcSupported",value:function(){return Kr.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return Kr.probeConfigSupported(e)}},{key:"install",value:function(e,t){i.plugins||(i.plugins={}),i.plugins[e]||(i.plugins[e]=t)}},{key:"use",value:function(e,t){i.plugins||(i.plugins={}),i.plugins[e]=t}}]),i}();mr(Ga,"defaultPreset",null),mr(Ga,"XgVideoProxy",null),Ga.instManager=Fa.getInstance();const Wa=Object.assign(Ga,{BasePlugin:ua,Errors:zr,Events:Wo,InstManager:Fa,Sniffer:Kr,Util:Ur}),Ya={origin:{index:1,next:"uhd",prev:null},uhd:{index:2,next:"hd",prev:"origin"},hd:{index:3,next:"sd",prev:"uhd"},sd:{index:4,next:"ld",prev:"hd"},ld:{index:5,next:"ao",prev:"sd"},ao:{index:6,next:null,prev:"ld"}},za=["zh","en","jp","zh-hk"],$a={NORMAL:0,INNER:1,FULLSCREEN:2};var Xa=(e=>(e[e.VALID=10]="VALID",e[e.TRANSCODING=30]="TRANSCODING",e[e.NO_SET_AUDIT=1e3]="NO_SET_AUDIT",e[e.OFFLINE=1002]="OFFLINE",e[e.NO_AUTH=2001]="NO_AUTH",e[e.UN_AUTH=2002]="UN_AUTH",e))(Xa||{});const qa=5e9,Za={jp:"キャンセル",en:"Cancel",zh:"取消","zh-hk":"取消"};var Qa=(e=>(e.WIDEVINE="widevine",e.FAIRPLAY="fairplay",e.PLAYREADY="playready",e))(Qa||{}),Ja={LANG:"jp",TEXT:{ERROR_TYPES:{network:{code:1,msg:"ビデオダウンロードエラー"},mse:{code:2,msg:"ストリーム追加エラー"},parse:{code:3,msg:"解析エラー"},format:{code:4,msg:"間違ったフォーマット"},decoder:{code:5,msg:"デコードエラー"},runtime:{code:6,msg:"文法エラー"},timeout:{code:7,msg:"再生タイムアウト"},other:{code:8,msg:"その他のエラー"}},HAVE_NOTHING:"オーディオ/ビデオが準備できているか情報がありません",HAVE_METADATA:"オーディオ/ビデオのメタデータは準備できています",HAVE_CURRENT_DATA:"現在の再生位置に関するデータは利用可能ですが、次のフレーム/ミリ秒を再生するのに十分なデータがありません",HAVE_FUTURE_DATA:"現在、少なくとも次のフレームのデータが利用可能です",HAVE_ENOUGH_DATA:"利用可能なデータは再生を開始するのに十分です",NETWORK_EMPTY:"オーディオ/ビデオが初期化されていません",NETWORK_IDLE:"オーディオ/ビデオはアクティブでリソースが選択されていますが、ネットワークが使用されていません",NETWORK_LOADING:"ブラウザーはデータをダウンロードしています",NETWORK_NO_SOURCE:"オーディオ/ビデオ のソースが見つかりません",MEDIA_ERR_ABORTED:"ユーザーによってフェッチプロセスが中止されました",MEDIA_ERR_NETWORK:"ダウンロード中にエラーが発生しました",MEDIA_ERR_DECODE:"デコード中にエラーが発生しました",MEDIA_ERR_SRC_NOT_SUPPORTED:"オーディオ/ビデオ の形式がサポートされていません",REPLAY:"リプレイ",ERROR:"ネットワークの接続に問題が発生しました",PLAY_TIPS:"プレイ",PAUSE_TIPS:"一時停止",PLAYNEXT_TIPS:"次をプレイ",DOWNLOAD_TIPS:"ダウンロード",ROTATE_TIPS:"回転",RELOAD_TIPS:"再読み込み",FULLSCREEN_TIPS:"フルスクリーン",EXITFULLSCREEN_TIPS:"フルスクリーンを終了",CSSFULLSCREEN_TIPS:"シアターモード",EXITCSSFULLSCREEN_TIPS:"シアターモードを終了",TEXTTRACK:"字幕",PIP:"ミニプレーヤー",SCREENSHOT:"スクリーンショット",LIVE:"生放送",OFF:"オフ",OPEN:"開いた",MINI_DRAG:"ボタンを押して働画をドラッグする",MINISCREEN:"小さな画面",REFRESH:"リフレッシュ",REFRESH_TIPS:"してみてください",FORWARD:"早送り",LIVE_TIP:"生放送"}},es={LANG:"zh-hk",TEXT:{ERROR_TYPES:{network:{code:1,msg:"視頻下載錯誤"},mse:{code:2,msg:"流追加錯誤"},parse:{code:3,msg:"解析錯誤"},format:{code:4,msg:"格式錯誤"},decoder:{code:5,msg:"解碼錯誤"},runtime:{code:6,msg:"語法錯誤"},timeout:{code:7,msg:"播放超時"},other:{code:8,msg:"其他錯誤"}},HAVE_NOTHING:"沒有關於音頻/視頻是否就緒的信息",HAVE_METADATA:"音頻/視頻的元數據已就緒",HAVE_CURRENT_DATA:"關於當前播放位置的數據是可用的,但沒有足夠的數據來播放下壹幀/毫秒",HAVE_FUTURE_DATA:"當前及至少下壹幀的數據是可用的",HAVE_ENOUGH_DATA:"可用數據足以開始播放",NETWORK_EMPTY:"音頻/視頻尚未初始化",NETWORK_IDLE:"音頻/視頻是活動的且已選取資源,但並未使用網絡",NETWORK_LOADING:"瀏覽器正在下載數據",NETWORK_NO_SOURCE:"未找到音頻/視頻來源",MEDIA_ERR_ABORTED:"取回過程被用戶中止",MEDIA_ERR_NETWORK:"下載錯誤",MEDIA_ERR_DECODE:"解碼錯誤",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音頻/視頻格式",REPLAY:"重播",ERROR:"網絡連接似乎出現了問題",PLAY_TIPS:"播放",PAUSE_TIPS:"暫停",PLAYNEXT_TIPS:"下壹集",DOWNLOAD_TIPS:"下載",ROTATE_TIPS:"旋轉",RELOAD_TIPS:"重新載入",FULLSCREEN_TIPS:"進入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"進入樣式全屏",EXITCSSFULLSCREEN_TIPS:"退出樣式全屏",TEXTTRACK:"字幕",PIP:"畫中畫",SCREENSHOT:"截圖",LIVE:"正在直播",OFF:"關閉",OPEN:"開啟",MINI_DRAG:"點擊按住可拖動視頻",MINISCREEN:"小屏幕",REFRESH_TIPS:"請試試",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}};const ts="undefined"!=typeof window&&window.location&&window.location.href.indexOf("veplayerdebugger=1")>-1,is="color: #fff; background-color: #5f5f5f;",ns="color: #fff; background-color: #f53f3f;",rs="color: #fff; background-color: #ff7d00;",os="color: #fff; background: #4281ff",as="%c VePlayer %c 1.18.0 ",ss={config:{debug:ts?3:1},log:function(e,...t){this.config.debug>=3&&console.log(as,is,os,e,...t)},warn:function(e,...t){this.config.debug>=1&&console.warn(as,rs,os,e,...t)},error:function(e,...t){if(this.config.debug<1)return;const i=this.config.debug>=2?"trace":"error";console[i](as,ns,os,e,...t)}};localStorage.getItem("velog")&&(ss.config.debug=3);var ls={exports:{}};ls.exports=function(){var e=1e3,t=6e4,i=36e5,n="millisecond",r="second",o="minute",a="hour",s="day",l="week",c="month",u="quarter",h="year",d="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},v=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},m={s:v,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+v(n,2,"0")+":"+v(r,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),r=t.clone().add(n,c),o=i-r<0,a=t.clone().add(n+(o?-1:1),c);return+(-(n+(i-r)/(o?r-a:a-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:h,w:l,d:s,D:d,h:a,m:o,s:r,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},_="en",E={};E[_]=y;var T=function(e){return e instanceof k},S=function e(t,i,n){var r;if(!t)return _;if("string"==typeof t){var o=t.toLowerCase();E[o]&&(r=o),i&&(E[o]=i,r=o);var a=t.split("-");if(!r&&a.length>1)return e(a[0])}else{var s=t.name;E[s]=t,r=s}return!n&&r&&(_=r),r||!n&&_},b=function(e,t){if(T(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new k(i)},C=m;C.l=S,C.i=T,C.w=function(e,t){return b(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var k=function(){function y(e){this.$L=S(e.locale,null,!0),this.parse(e)}var v=y.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(C.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(p);if(n){var r=n[2]-1||0,o=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},v.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},v.$utils=function(){return C},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(e,t){var i=b(e);return this.startOf(t)<=i&&i<=this.endOf(t)},v.isAfter=function(e,t){return b(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<b(e)},v.$g=function(e,t,i){return C.u(e)?this[t]:this.set(i,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var i=this,n=!!C.u(t)||t,u=C.p(e),f=function(e,t){var r=C.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return n?r:r.endOf(s)},p=function(e,t){return C.w(i.toDate()[e].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},g=this.$W,y=this.$M,v=this.$D,m="set"+(this.$u?"UTC":"");switch(u){case h:return n?f(1,0):f(31,11);case c:return n?f(1,y):f(0,y+1);case l:var _=this.$locale().weekStart||0,E=(g<_?g+7:g)-_;return f(n?v-E:v+(6-E),y);case s:case d:return p(m+"Hours",0);case a:return p(m+"Minutes",1);case o:return p(m+"Seconds",2);case r:return p(m+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var i,l=C.p(e),u="set"+(this.$u?"UTC":""),f=(i={},i[s]=u+"Date",i[d]=u+"Date",i[c]=u+"Month",i[h]=u+"FullYear",i[a]=u+"Hours",i[o]=u+"Minutes",i[r]=u+"Seconds",i[n]=u+"Milliseconds",i)[l],p=l===s?this.$D+(t-this.$W):t;if(l===c||l===h){var g=this.clone().set(d,1);g.$d[f](p),g.init(),this.$d=g.set(d,Math.min(this.$D,g.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[C.p(e)]()},v.add=function(n,u){var d,f=this;n=Number(n);var p=C.p(u),g=function(e){var t=b(f);return C.w(t.date(t.date()+Math.round(e*n)),f)};if(p===c)return this.set(c,this.$M+n);if(p===h)return this.set(h,this.$y+n);if(p===s)return g(1);if(p===l)return g(7);var y=(d={},d[o]=t,d[a]=i,d[r]=e,d)[p]||1,v=this.$d.getTime()+n*y;return C.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||f;var n=e||"YYYY-MM-DDTHH:mm:ssZ",r=C.z(this),o=this.$H,a=this.$m,s=this.$M,l=i.weekdays,c=i.months,u=function(e,i,r,o){return e&&(e[i]||e(t,n))||r[i].slice(0,o)},h=function(e){return C.s(o%12||12,e,"0")},d=i.meridiem||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n},p={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:C.s(s+1,2,"0"),MMM:u(i.monthsShort,s,c,3),MMMM:u(c,s),D:this.$D,DD:C.s(this.$D,2,"0"),d:String(this.$W),dd:u(i.weekdaysMin,this.$W,l,2),ddd:u(i.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(o),HH:C.s(o,2,"0"),h:h(1),hh:h(2),a:d(o,a,!0),A:d(o,a,!1),m:String(a),mm:C.s(a,2,"0"),s:String(this.$s),ss:C.s(this.$s,2,"0"),SSS:C.s(this.$ms,3,"0"),Z:r};return n.replace(g,(function(e,t){return t||p[e]||r.replace(":","")}))},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(n,d,f){var p,g=C.p(d),y=b(n),v=(y.utcOffset()-this.utcOffset())*t,m=this-y,_=C.m(this,y);return _=(p={},p[h]=_/12,p[c]=_,p[u]=_/3,p[l]=(m-v)/6048e5,p[s]=(m-v)/864e5,p[a]=m/i,p[o]=m/t,p[r]=m/e,p)[g]||m,f?_:C.a(_)},v.daysInMonth=function(){return this.endOf(c).$D},v.$locale=function(){return E[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=S(e,t,!0);return n&&(i.$L=n),i},v.clone=function(){return C.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},y}(),I=k.prototype;return b.prototype=I,[["$ms",n],["$s",r],["$m",o],["$H",a],["$W",s],["$M",c],["$y",h],["$D",d]].forEach((function(e){I[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),b.extend=function(e,t){return e.$i||(e(t,k,b),e.$i=!0),b},b.locale=S,b.isDayjs=T,b.unix=function(e){return b(1e3*e)},b.en=E[_],b.Ls=E,b.p={},b}();const cs=lr(ls.exports);var us,hs,ds,fs={exports:{}};const ps=lr(fs.exports=(us="minute",hs=/[+-]\d\d(?::?\d\d)?/g,ds=/([+-]|\d\d)/g,function(e,t,i){var n=t.prototype;i.utc=function(e){return new t({date:e,utc:!0,args:arguments})},n.utc=function(e){var t=i(this.toDate(),{locale:this.$L,utc:!0});return e?t.add(this.utcOffset(),us):t},n.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var r=n.parse;n.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),r.call(this,e)};var o=n.init;n.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else o.call(this)};var a=n.utcOffset;n.utcOffset=function(e,t){var i=this.$utils().u;if(i(e))return this.$u?0:i(this.$offset)?a.call(this):this.$offset;if("string"==typeof e&&null===(e=function(e){void 0===e&&(e="");var t=e.match(hs);if(!t)return null;var i=(""+t[0]).match(ds)||["-",0,0],n=i[0],r=60*+i[1]+ +i[2];return 0===r?0:"+"===n?r:-r}(e)))return this;var n=Math.abs(e)<=16?60*e:e,r=this;if(t)return r.$offset=n,r.$u=0===e,r;if(0!==e){var o=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(r=this.local().add(n+o,us)).$offset=n,r.$x.$localOffset=o}else r=this.utc();return r};var s=n.format;n.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return s.call(this,t)},n.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},n.isUTC=function(){return!!this.$u},n.toISOString=function(){return this.toDate().toISOString()},n.toString=function(){return this.toDate().toUTCString()};var l=n.toDate;n.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var c=n.diff;n.diff=function(e,t,n){if(e&&this.$u===e.$u)return c.call(this,e,t,n);var r=this.local(),o=i(e).local();return c.call(r,o,t,n)}}));var gs=function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=22)}([function(e,t,i){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,i){var n=i(12)("wks"),r=i(13),o=i(0).Symbol,a="function"==typeof o;(e.exports=function(e){return n[e]||(n[e]=a&&o[e]||(a?o:r)("Symbol."+e))}).store=n},function(e,t,i){var n=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},function(e,t,i){var n=i(4);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,i){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};e.exports=function(e){return"object"===(void 0===e?"undefined":n(e))?null!==e:"function"==typeof e}},function(e,t,i){var n=i(6);e.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,r){return e.call(t,i,n,r)}}return function(){return e.apply(t,arguments)}}},function(e,t,i){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,i){e.exports=!i(15)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,i){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,i){var n=i(3),r=i(26),o=i(27),a=Object.defineProperty;t.f=i(7)?Object.defineProperty:function(e,t,i){if(n(e),t=o(t,!0),n(i),r)try{return a(e,t,i)}catch(s){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},function(e,t,i){e.exports=!1},function(e,t,i){var n=i(8),r=i(1)("toStringTag"),o="Arguments"==n(function(){return arguments}());e.exports=function(e){var t,i,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(i){}}(t=Object(e),r))?i:o?n(t):"Object"==(a=n(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,i){var n=i(2),r=i(0),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:i(10)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,i){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,i){var n=i(9),r=i(28);e.exports=i(7)?function(e,t,i){return n.f(e,t,r(1,i))}:function(e,t,i){return e[t]=i,e}},function(e,t,i){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t,i){var n=i(4),r=i(0).document,o=n(r)&&n(r.createElement);e.exports=function(e){return o?r.createElement(e):{}}},function(e,t,i){var n=i(0),r=i(14),o=i(18),a=i(13)("src"),s=i(29),l=(""+s).split("toString");i(2).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,i,s){var c="function"==typeof i;c&&(o(i,"name")||r(i,"name",t)),e[t]!==i&&(c&&(o(i,a)||r(i,a,e[t]?""+e[t]:l.join(String(t)))),e===n?e[t]=i:s?e[t]?e[t]=i:r(e,t,i):(delete e[t],r(e,t,i)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},function(e,t,i){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,i){e.exports={}},function(e,t,i){var n,r,o,a=i(5),s=i(38),l=i(39),c=i(16),u=i(0),h=u.process,d=u.setImmediate,f=u.clearImmediate,p=u.MessageChannel,g=u.Dispatch,y=0,v={},m=function(){var e=+this;if(v.hasOwnProperty(e)){var t=v[e];delete v[e],t()}},_=function(e){m.call(e.data)};d&&f||(d=function(e){for(var t=[],i=1;arguments.length>i;)t.push(arguments[i++]);return v[++y]=function(){s("function"==typeof e?e:Function(e),t)},n(y),y},f=function(e){delete v[e]},"process"==i(8)(h)?n=function(e){h.nextTick(a(m,e,1))}:g&&g.now?n=function(e){g.now(a(m,e,1))}:p?(o=(r=new p).port2,r.port1.onmessage=_,n=a(o.postMessage,o,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(n=function(e){u.postMessage(e+"","*")},u.addEventListener("message",_,!1)):n="onreadystatechange"in c("script")?function(e){l.appendChild(c("script")).onreadystatechange=function(){l.removeChild(this),m.call(e)}}:function(e){setTimeout(a(m,e,1),0)}),e.exports={set:d,clear:f}},function(e,t,i){var n=i(6);function r(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=n})),this.resolve=n(t),this.reject=n(i)}e.exports.f=function(e){return new r(e)}},function(e,t,i){e.exports=i(23)},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),i(24);var n,r=(n=i(48))&&n.__esModule?n:{default:n};t.default={url:r.default},e.exports=t.default},function(e,t,i){var n,r,o,a,s=i(10),l=i(0),c=i(5),u=i(11),h=i(25),d=i(4),f=i(6),p=i(30),g=i(31),y=i(37),v=i(20).set,m=i(40)(),_=i(21),E=i(41),T=i(42),S=i(43),b=l.TypeError,C=l.process,k=C&&C.versions,I=k&&k.v8||"",P=l.Promise,D="process"==u(C),w=function(){},A=r=_.f,R=!!function(){try{var e=P.resolve(1),t=(e.constructor={})[i(1)("species")]=function(e){e(w,w)};return(D||"function"==typeof PromiseRejectionEvent)&&e.then(w)instanceof t&&0!==I.indexOf("6.6")&&-1===T.indexOf("Chrome/66")}catch(n){}}(),x=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},O=function(e,t){if(!e._n){e._n=!0;var i=e._c;m((function(){for(var n=e._v,r=1==e._s,o=0,a=function(t){var i,o,a,s=r?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{s?(r||(2==e._h&&M(e),e._h=1),!0===s?i=n:(u&&u.enter(),i=s(n),u&&(u.exit(),a=!0)),i===t.promise?c(b("Promise-chain cycle")):(o=x(i))?o.call(i,l,c):l(i)):c(n)}catch(h){u&&!a&&u.exit(),c(h)}};i.length>o;)a(i[o++]);e._c=[],e._n=!1,t&&!e._h&&L(e)}))}},L=function(e){v.call(l,(function(){var t,i,n,r=e._v,o=N(e);if(o&&(t=E((function(){D?C.emit("unhandledRejection",r,e):(i=l.onunhandledrejection)?i({promise:e,reason:r}):(n=l.console)&&n.error&&n.error("Unhandled promise rejection",r)})),e._h=D||N(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},N=function(e){return 1!==e._h&&0===(e._a||e._c).length},M=function(e){v.call(l,(function(){var t;D?C.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})}))},U=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),O(t,!0))},B=function e(t){var i,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw b("Promise can't be resolved itself");(i=x(t))?m((function(){var r={_w:n,_d:!1};try{i.call(t,c(e,r,1),c(U,r,1))}catch(o){U.call(r,o)}})):(n._v=t,n._s=1,O(n,!1))}catch(r){U.call({_w:n,_d:!1},r)}}};R||(P=function(e){p(this,P,"Promise","_h"),f(e),n.call(this);try{e(c(B,this,1),c(U,this,1))}catch(t){U.call(this,t)}},(n=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=i(44)(P.prototype,{then:function(e,t){var i=A(y(this,P));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=D?C.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&O(this,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new n;this.promise=e,this.resolve=c(B,e,1),this.reject=c(U,e,1)},_.f=A=function(e){return e===P||e===a?new o(e):r(e)}),h(h.G+h.W+h.F*!R,{Promise:P}),i(45)(P,"Promise"),i(46)("Promise"),a=i(2).Promise,h(h.S+h.F*!R,"Promise",{reject:function(e){var t=A(this);return(0,t.reject)(e),t.promise}}),h(h.S+h.F*(s||!R),"Promise",{resolve:function(e){return S(s&&this===a?P:this,e)}}),h(h.S+h.F*!(R&&i(47)((function(e){P.all(e).catch(w)}))),"Promise",{all:function(e){var t=this,i=A(t),n=i.resolve,r=i.reject,o=E((function(){var i=[],o=0,a=1;g(e,!1,(function(e){var s=o++,l=!1;i.push(void 0),a++,t.resolve(e).then((function(e){l||(l=!0,i[s]=e,--a||n(i))}),r)})),--a||n(i)}));return o.e&&r(o.v),i.promise},race:function(e){var t=this,i=A(t),n=i.reject,r=E((function(){g(e,!1,(function(e){t.resolve(e).then(i.resolve,n)}))}));return r.e&&n(r.v),i.promise}})},function(e,t,i){var n=i(0),r=i(2),o=i(14),a=i(17),s=i(5),l=function e(t,i,l){var c,u,h,d,f=t&e.F,p=t&e.G,g=t&e.P,y=t&e.B,v=p?n:t&e.S?n[i]||(n[i]={}):(n[i]||{}).prototype,m=p?r:r[i]||(r[i]={}),_=m.prototype||(m.prototype={});for(c in p&&(l=i),l)h=((u=!f&&v&&void 0!==v[c])?v:l)[c],d=y&&u?s(h,n):g&&"function"==typeof h?s(Function.call,h):h,v&&a(v,c,h,t&e.U),m[c]!=h&&o(m,c,d),g&&_[c]!=h&&(_[c]=h)};n.core=r,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,i){e.exports=!i(7)&&!i(15)((function(){return 7!=Object.defineProperty(i(16)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,i){var n=i(4);e.exports=function(e,t){if(!n(e))return e;var i,r;if(t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;if("function"==typeof(i=e.valueOf)&&!n(r=i.call(e)))return r;if(!t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},function(e,t,i){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,i){e.exports=i(12)("native-function-to-string",Function.toString)},function(e,t,i){e.exports=function(e,t,i,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(i+": incorrect invocation!");return e}},function(e,t,i){var n=i(5),r=i(32),o=i(33),a=i(3),s=i(34),l=i(36),c={},u={},h=e.exports=function(e,t,i,h,d){var f,p,g,y,v=d?function(){return e}:l(e),m=n(i,h,t?2:1),_=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(o(v)){for(f=s(e.length);f>_;_++)if((y=t?m(a(p=e[_])[0],p[1]):m(e[_]))===c||y===u)return y}else for(g=v.call(e);!(p=g.next()).done;)if((y=r(g,m,p.value,t))===c||y===u)return y};h.BREAK=c,h.RETURN=u},function(e,t,i){var n=i(3);e.exports=function(e,t,i,r){try{return r?t(n(i)[0],i[1]):t(i)}catch(a){var o=e.return;throw void 0!==o&&n(o.call(e)),a}}},function(e,t,i){var n=i(19),r=i(1)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||o[r]===e)}},function(e,t,i){var n=i(35),r=Math.min;e.exports=function(e){return e>0?r(n(e),9007199254740991):0}},function(e,t,i){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,i){var n=i(11),r=i(1)("iterator"),o=i(19);e.exports=i(2).getIteratorMethod=function(e){if(null!=e)return e[r]||e["@@iterator"]||o[n(e)]}},function(e,t,i){var n=i(3),r=i(6),o=i(1)("species");e.exports=function(e,t){var i,a=n(e).constructor;return void 0===a||null==(i=n(a)[o])?t:r(i)}},function(e,t,i){e.exports=function(e,t,i){var n=void 0===i;switch(t.length){case 0:return n?e():e.call(i);case 1:return n?e(t[0]):e.call(i,t[0]);case 2:return n?e(t[0],t[1]):e.call(i,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(i,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(i,t[0],t[1],t[2],t[3])}return e.apply(i,t)}},function(e,t,i){var n=i(0).document;e.exports=n&&n.documentElement},function(e,t,i){var n=i(0),r=i(20).set,o=n.MutationObserver||n.WebKitMutationObserver,a=n.process,s=n.Promise,l="process"==i(8)(a);e.exports=function(){var e,t,i,c=function(){var n,r;for(l&&(n=a.domain)&&n.exit();e;){r=e.fn,e=e.next;try{r()}catch(o){throw e?i():t=void 0,o}}t=void 0,n&&n.enter()};if(l)i=function(){a.nextTick(c)};else if(!o||n.navigator&&n.navigator.standalone)if(s&&s.resolve){var u=s.resolve(void 0);i=function(){u.then(c)}}else i=function(){r.call(n,c)};else{var h=!0,d=document.createTextNode("");new o(c).observe(d,{characterData:!0}),i=function(){d.data=h=!h}}return function(n){var r={fn:n,next:void 0};t&&(t.next=r),e||(e=r,i()),t=r}}},function(e,t,i){e.exports=function(e){try{return{e:!1,v:e()}}catch(t){return{e:!0,v:t}}}},function(e,t,i){var n=i(0).navigator;e.exports=n&&n.userAgent||""},function(e,t,i){var n=i(3),r=i(4),o=i(21);e.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var i=o.f(e);return(0,i.resolve)(t),i.promise}},function(e,t,i){var n=i(17);e.exports=function(e,t,i){for(var r in t)n(e,r,t[r],i);return e}},function(e,t,i){var n=i(9).f,r=i(18),o=i(1)("toStringTag");e.exports=function(e,t,i){e&&!r(e=i?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},function(e,t,i){var n=i(0),r=i(9),o=i(7),a=i(1)("species");e.exports=function(e){var t=n[e];o&&t&&!t[a]&&r.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,i){var n=i(1)("iterator"),r=!1;try{var o=[7][n]();o.return=function(){r=!0},Array.from(o,(function(){throw 2}))}catch(a){}e.exports=function(e,t){if(!t&&!r)return!1;var i=!1;try{var o=[7],a=o[n]();a.next=function(){return{done:i=!0}},o[n]=function(){return a},e(o)}catch(s){}return i}},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};t.default=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!e||!t)return Promise.reject("vid, host and token can't be empty");var s=void 0;try{s=(0,o.getUri)(e,t,i,r)}catch(l){return Promise.reject(l.message)}return new a.default({type:"json",method:"GET",url:s}).then((function(e){var t=void 0;if(e&&e.response)switch(n(e.response)){case"string":t=JSON.parse(e.response).Result;break;case"object":t=e.response.Result;break;default:t=e.response}else t=e;return t}))};var r,o=i(49),a=(r=i(51))&&r.__esModule?r:{default:r};e.exports=t.default},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.getUri=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments[3];try{e=JSON.parse((0,n.decode)(e))}catch(s){throw new Error("base64 decode error: "+s.message)}!1===o.jointSsl||r(i,"ssl")||r(i,"Ssl")||(i.Ssl=1);var a=(/^http/.test(t)?t:"//"+t)+"?"+e.GetPlayInfoToken+function(e){var t=[];for(var i in e)r(e,i)&&t.push(i+"="+e[i]);return t.length>0?"&"+t.join("&"):""}(i);return a};var n=i(50),r=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){var t=void 0,i=void 0,n=void 0,r=void 0,o=void 0,a=void 0,s=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1],l=e.length;for(o=0,a="";o<l;){do{t=s[255&e.charCodeAt(o++)]}while(o<l&&-1===t);if(-1===t)break;do{i=s[255&e.charCodeAt(o++)]}while(o<l&&-1===i);if(-1===i)break;a+=String.fromCharCode(t<<2|(48&i)>>4);do{if(61==(n=255&e.charCodeAt(o++)))return a;n=s[n]}while(o<l&&-1===n);if(-1===n)break;a+=String.fromCharCode((15&i)<<4|(60&n)>>2);do{if(61==(r=255&e.charCodeAt(o++)))return a;r=s[r]}while(o<l&&-1===r);if(-1===r)break;a+=String.fromCharCode((3&n)<<6|r)}return a}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=t.url,n=t.method,r=void 0===n?"GET":n,o=t.data,a=void 0===o?{}:o,s=t.headers,l=void 0===s?{}:s;return new Promise((function(e,t){var n=new window.XMLHttpRequest,o=r.toUpperCase(),s=[];if("GET"!==o)throw new Error("xhr "+o+" is not supported");for(var c in a)s.push(c+"="+a[c]);for(var u in n.open(o,""+i,!0),n.responseType="",l)Object.prototype.hasOwnProperty.call(l,u)&&n.setRequestHeader(u,""+l[u]);n.onload=function(){200===n.status||206===n.status?e(n):t(n)},n.onerror=n.ontimeout=function(){return t(n)},n.send()}))},e.exports=t.default}]);const ys=lr(gs);cs.extend(ps);var vs=(e=>(e.VIDEO="video",e.EVIDEO="evideo",e.DRM_EVIDEO="drm_evideo",e))(vs||{});function ms(e){try{return JSON.parse(e)}catch(ds){return ss.warn(`[utils/json] decode fail: ${e}`,ds),null}}function _s(e,t="GetPlayInfoToken"){if(!e)return;const i={},n=ms(window.atob(e));if(n&&"string"==typeof n[t]){n[t].split("&").map((e=>{const t=e.split("=");t[0]&&t[1]&&(i[t[0]]=t[1])}))}return i}function Es(e){const t={};return decodeURIComponent(e).split("&").map((e=>{const i=e.split("=");i[0]&&i[1]&&(t[decodeURIComponent(i[0])]=decodeURIComponent(i[1]))})),t}const Ts=e=>{var t,i,n;if(!(null==e?void 0:e.playAuthToken))return;const r=_s(null==e?void 0:e.playAuthToken),o=null!=(i=null==(t=null==r?void 0:r.FileType)?void 0:t.toLowerCase())?i:"video",a=null==(n=null==r?void 0:r.Format)?void 0:n.toLowerCase();return a||(Object.values(vs).includes(o)?nr.MP4:rr.M4A)},Ss=function(e){if(!e["X-Expires"]||!e["X-Date"])return!1;const t=parseInt(e["X-Expires"]);if(isNaN(t))return!1;const i=e["X-Date"].replace(/T/g," ").replace(/Z/g,""),n=cs.utc(i,"YYYYMMDD hhmmss");if(!n.isValid())return!1;return n.add(t,"seconds").isBefore(cs())};function bs(e,t){const i=["240p","360p","480p","540p","720p","1080p","2k","4k","od","oe"],n=e.Definition,r=t.Definition;if(i.includes(n)&&i.includes(r)){const e=i.findIndex((e=>e.toLocaleLowerCase()===n.toLocaleLowerCase()));return i.findIndex((e=>e.toLocaleLowerCase()===r.toLocaleLowerCase()))-e}return t.Bitrate&&e.Bitrate?t.Bitrate-e.Bitrate:-1}function Cs(e){const{playAuthToken:t,playDomain:i,reqParams:n={},definitionMap:r,needThumbs:o=!1,needBarrageMask:a=!1,autoDemoteDefinition:s,autoDemoteDefinitionTextKey:l,urlQueryParams:h}=e;if(t){const e=u(c({},n),{NeedThumbs:o?1:0,NeedBarrageMask:a?1:0});return new Promise(((n,o)=>{ys.url(t,i,e).then((e=>{var t;const{Status:i,PlayInfoList:o=[],PosterUrl:a,Vid:d,Duration:f,BarrageMaskUrl:p,ThumbInfoList:g=[],EnableAdaptive:y,AdaptiveBitrateStreamingInfo:v}=e.Data||e;if(i===Xa.VALID&&o.length){const i=o.map((e=>{var t;const i=h?zs(e.MainPlayUrl,h):e.MainPlayUrl,n=h?zs(e.BackupPlayUrl,h):e.BackupPlayUrl;return c(c({vid:d,url:i,_mainURL:i,_backupURL:n,streamType:e.Format,backupUrl:n,backUrlList:[n],fileType:e.FileType,format:e.Format,bitrate:e.Bitrate,size:e.Size,kid:e.PlayAuthId,playAuthId:e.PlayAuthId,playAuth:e.PlayAuth,secretKey:e.PlayAuth,vwidth:e.Width,vheight:e.Height,vtype:null==(t=e.Format)?void 0:t.toLocaleUpperCase(),codec:e.Codec,urlExpireTimestamp:al(e.MainUrlExpire,10,qa),drmType:e.DrmType},e),Hs(e,{definitionMap:r,autoDemoteDefinition:s,autoDemoteDefinitionTextKey:l}))})).sort(bs);n({playList:i,type:null==(t=i[0])?void 0:t.Format,poster:a,vid:d,duration:f,dashOpts:e.Data?e:{Data:u(c({},e),{VideoID:d})},thumbs:g,barrageMaskUrl:p,enableAdaptive:y,adaptiveBitrateStreamingInfo:v})}else n({playList:[],poster:a,vid:d,duration:f,dashOpts:e.Data?e:{Data:e},thumbs:g,barrageMaskUrl:p,enableAdaptive:y,adaptiveBitrateStreamingInfo:v}),ss.error("HAS NO VIDEO INFORMATION CORRECTLY, PLEASE CHECK THE TOKEN.")})).catch((e=>{ss.log("err",e),o(e)}))}))}return Promise.resolve(void 0)}function ks(e,t,i,n){return d(this,null,(function*(){try{return yield e()}catch(r){if(--t&&i(r))return ks(e,t,i,n);if(n&&"function"==typeof n)return yield n(r);throw r}}))}function Is(e,t,i,n){return i+"/?"+n+"&"+rl({ThirdPartyDrmType:e,Kid:t})}const Ps="__veplayer_";function Ds(e,t="",i){if(!e)return;const n=Ps+t+"_"+e;localStorage.setItem(n,i+"")}function ws(e,t=""){if(!e)return;const i=Ps+t+"_"+e;return localStorage.getItem(i)}function As(){var e,t;try{const i=null==(t=null==(e=globalThis.crypto)?void 0:e.randomUUID)?void 0:t.call(e);if("string"==typeof i&&i.length>0)return i}catch(ds){}return`ve_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,14)}`}function Rs(e){if(!e)return As();const t=`line_user_${encodeURIComponent(e)}`;try{const e=ws(t,"ttdrama");if(e)return e;const i=As();return Ds(t,"ttdrama",i),i}catch(ds){return As()}}function xs(){try{return Math.round(window.performance.now())}catch(e){return(new Date).getTime()}}var Os=(e=>(e[e.DEFAULT=0]="DEFAULT",e[e.ERROR=-1]="ERROR",e[e.TIMEOUT=-2]="TIMEOUT",e))(Os||{});function Ls(e,t){return new Promise(((i,n)=>{try{e||n(new Error("url is undefined"));let r=xs();const o=r,a=new window.XMLHttpRequest,s={status:0,statusText:"",connectTime:0,raw:a};a.open("get",e),a.onreadystatechange=()=>{2===a.readyState&&(s.headers=function(e){const t={};if(e instanceof window.XMLHttpRequest)try{e.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){const i=e.split(": "),n=i.shift();t[n]=i.join(": ")}))}catch(i){return t}return t}(a),s.connectTime=xs()-o,s.status=a.status,s.statusText=a.statusText,r=xs())},a.onload=()=>{s.response=a.response,i(s)},a.onprogress=e=>{const t=xs()-r;let i=0;i=parseInt(""+e.loaded/1e3/(t/1e3),10),s.speed=0|i,s.costTime=t},a.onerror=()=>{s.status||(s.status=-1,s.costTime=xs()-r),n(s)},a.ontimeout=()=>{s.status||(s.status=-2,s.costTime=xs()-r),i(s)},a.onabort=()=>{i(s)},(null==t?void 0:t.type)&&(a.responseType=t.type),a.timeout=(null==t?void 0:t.timeout)||1e4,a.setRequestHeader("Range",`bytes=${(null==t?void 0:t.range)||"0-1048576"}`),a.send()}catch(ds){n(ds)}}))}function Ns(e){var t,i,n;if(e.url)return(null==(i=null==(t=null==e?void 0:e.plugins)?void 0:t.encrypthlsplugin)?void 0:i.hls)||(null==(n=null==e?void 0:e.plugins)?void 0:n.mp4encryptplayer)?1:+Ur.isMSE(e.media)}function Ms(e){return Number.isFinite(e)?Math.max(0,Math.round(e)):0}class Us{constructor(){this.timings=[],this.timingMap={},this.now=function(){const e=globalThis.performance;return(null==e?void 0:e.now)&&"function"==typeof e.now?()=>e.now():()=>Date.now()}(),this.startAt=this.now()}markDuration(e,t){const i=Ms(t);this.timings.push({name:e,duration:i}),this.timingMap[e]=i}measure(e,t){const i=this.now();try{return t()}finally{this.markDuration(e,this.now()-i)}}measureAsync(e,t){return d(this,null,(function*(){const i=this.now();try{return yield t()}finally{this.markDuration(e,this.now()-i)}}))}finish(){return{totalDuration:Ms(this.now()-this.startAt),timings:[...this.timings],timingMap:c({},this.timingMap)}}}let Bs;const Fs=()=>Bs,Hs=function(e,t){var i;const{definitionMap:n,autoDemoteDefinition:r,autoDemoteDefinitionTextKey:o}=t||{};if(!e)return{definition:"240P"};const a=e,s=a.Definition||a.Quality||a.definition||a.quality;if(!s)return{definition:"240P"};if(n){let e={definition:s};const t=n[s];return e=t?"string"==typeof t?{definition:t}:c({definition:s},t||{}):{definition:s},r&&r.toLocaleLowerCase()===(null==(i=null==e?void 0:e.definition)?void 0:i.toLocaleLowerCase())&&(e={definition:"auto",definitionTextKey:o,mapDefinition:e.definition}),e}return{definition:s}};const js=class{constructor(){this.timeID=null,this.func=null}repeat(e,t){this.timeID=1,this.repeatInterval(e,t)}repeatInterval(e,t){this.timeID&&(null===this.func&&(this.func=e),this.func===e&&(this.timeID&&clearTimeout(this.timeID),this.timeID=null,this.timeID=setTimeout((()=>{e(),this.repeatInterval(e,t)}),t)))}clear(){clearTimeout(this.timeID),this.timeID=null}},Vs='video/mp4; codecs="avc1.42E01E,mp4a.40.2"',Ks=['video/mp4;codecs="hev1.1.6.L120.90"','video/mp4;codecs="hev1.2.4.L120.90"','video/mp4;codecs="hev1.3.E.L120.90"','video/mp4;codecs="hev1.4.10.L120.90"'],Gs={mp4:["video/mp4","audio/mp4"],hls:["application/vnd.apple.mpegurl","application/x-mpegurl","audio/mpegurl"],webm:["audio/webm","video/webm"],mov:["video/quicktime"]};function Ws(e){var t;let i;if(Array.isArray(e)&&e.length){if(e[0].type){let e="";for(const t of Object.entries(Gs)){const[i,n]=t;if(n.includes(i)){e=i;break}}if(e)return e}i=null==(t=e[0])?void 0:t.src}else i="string"==typeof e?e:"";return function(e){return e&&0<e.toLowerCase().indexOf(".m3u8")}(i)?"hls":function(e){return e&&0<e.toLowerCase().indexOf(".flv")}(i)?"flv":function(e){return e&&0<e.toLowerCase().indexOf(".mp4")}(i)?"mp4":function(e){return e&&0<e.toLowerCase().indexOf(".mpd")}(i)?"dash":"mp4"}function Ys(e){return e&&e.then?e:Promise.resolve(e)}const zs=(e,t)=>t?e+=(-1===e.indexOf("?")?"?":"&")+rl(t):e,$s=(e,t)=>{if(!t||!e)return;let i;return Object.keys(e).map((n=>{n.toLowerCase()===t.toLowerCase()&&(i=e[n])})),i};function Xs(){let e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return"zh-cn"!==e&&"cn"!==e||(e="zh"),e}function qs(e,t=200,i=""){let n=setTimeout((()=>{i&&ss.warn(i),n=null}),t);return e.then?e.then((()=>clearTimeout(n))):(clearTimeout(n),n=null),e}function Zs(e,t=1,i=0){return new Promise(((n,r)=>{e().then(n).catch((o=>{setTimeout((()=>{1!==t?Zs(e,t-1,i).then(n,r):r(o)}),i)}))}))}function Qs(e='video/mp4; codecs="avc1.42E01E,mp4a.40.2"'){if(!window.MediaSource)return!1;try{return window.MediaSource.isTypeSupported(e)}catch(t){return ss.error("mse error",t),!1}}function Js(e="h264"){return void 0!==window.ManagedMediaSource&&("h264"===e?window.ManagedMediaSource.isTypeSupported(Vs):"h265"===e?Ks.some((e=>window.ManagedMediaSource.isTypeSupported(e))):window.ManagedMediaSource.isTypeSupported(e))}const el="undefined"!=typeof window,tl=el&&navigator.userAgent.toLocaleLowerCase(),il=el&&/^((?!chrome|android).)*safari/.test(tl);function nl(e,t){const i={sg:{__LOG_TEA_ID__:323254,__LOG_CHANNEL__:"sg",__LOG_CUSTOM_REGION__:"byteplus",__LOG_CHANNEL_DOMAIN__:"https://mcs-nontt.byteintlapi.com",__UMD_PRE_PATH__:"https://sf-unpkg.bytepluscdn.com/obj/byteplusfe-sg/sdk/@byteplus/veplayer/1.18.0/plugin"}},n=t||"sg";return e&&i[e]||i[n]}function rl(e){return Object.entries(e).map((([e,t])=>Array.isArray(t)?t.map((t=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&"):`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&")}function ol(e){var t;return"string"==typeof e?e:null==(t=null==e?void 0:e[0])?void 0:t.src}function al(e,t=10,i=0){const n=parseInt(e,t);return Number.isNaN(n)?i:n}function sl(e){var t,i,n,r,o,a,s;const l=e.getPlugin("drm"),c=e.getPlugin("EncryptHlsPlugin"),u=e.getPlugin("Mp4EncryptPlayer"),h=e.getPlugin("DASHPlugin"),d=(null==(t=null==c?void 0:c.config)?void 0:t.drmKeyToken)||(null==(i=null==u?void 0:u.config)?void 0:i.drmKeyToken)||(null==(n=null==h?void 0:h.config)?void 0:n.drmKeyToken),f=((null==(r=null==c?void 0:c.config)?void 0:r.drmType)||(null==(o=null==u?void 0:u.config)?void 0:o.drmType)||(null==(a=null==h?void 0:h.config)?void 0:a.drmType))===or.PRIVATE_ENCRYPT_UPGRADE,p=null==(s=null==c?void 0:c.config)?void 0:s.keyToken;return l?or.DRM_ENCRYPT:d?or.PRIVATE_ENCRYPT:p?or.STANDARD_ENCRYPT:f?or.PRIVATE_ENCRYPT_UPGRADE:void 0}function ll(e){var t,i,n,r;const o=null==(i=null==(t=null==e?void 0:e.plugins)?void 0:t.encrypthlsplugin)?void 0:i._playOriginalUrl,a=null==(n=null==e?void 0:e.curDefinition)?void 0:n.main_url;return o||a||(null==(r=e.curDefinition)?void 0:r.url)||e.config.url}const cl=/["'&<>]/;function ul(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function hl(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ul(Object(i),!0).forEach((function(t){yl(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ul(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function dl(e){return(dl="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})(e)}function fl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pl(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,ml(n.key),n)}}function gl(e,t,i){return t&&pl(e.prototype,t),i&&pl(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function yl(e,t,i){return(t=ml(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function vl(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i,n,r={},o=Object.keys(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}function ml(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var _l=function(e){return e&&e.Math==Math&&e},El=_l("object"==typeof globalThis&&globalThis)||_l("object"==typeof window&&window)||_l("object"==typeof self&&self)||_l("object"==typeof sr&&sr)||function(){return this}()||Function("return this")(),Tl={},Sl=function(e){try{return!!e()}catch(t){return!0}},bl=!Sl((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Cl=!Sl((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),kl=Cl,Il=Function.prototype.call,Pl=kl?Il.bind(Il):function(){return Il.apply(Il,arguments)},Dl={},wl={}.propertyIsEnumerable,Al=Object.getOwnPropertyDescriptor,Rl=Al&&!wl.call({1:2},1);Dl.f=Rl?function(e){var t=Al(this,e);return!!t&&t.enumerable}:wl;var xl,Ol,Ll=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Nl=Cl,Ml=Function.prototype,Ul=Ml.call,Bl=Nl&&Ml.bind.bind(Ul,Ul),Fl=Nl?Bl:function(e){return function(){return Ul.apply(e,arguments)}},Hl=Fl,jl=Hl({}.toString),Vl=Hl("".slice),Kl=function(e){return Vl(jl(e),8,-1)},Gl=Sl,Wl=Kl,Yl=Object,zl=Fl("".split),$l=Gl((function(){return!Yl("z").propertyIsEnumerable(0)}))?function(e){return"String"==Wl(e)?zl(e,""):Yl(e)}:Yl,Xl=function(e){return null==e},ql=Xl,Zl=TypeError,Ql=function(e){if(ql(e))throw Zl("Can't call method on "+e);return e},Jl=$l,ec=Ql,tc=function(e){return Jl(ec(e))},ic="object"==typeof document&&document.all,nc={all:ic,IS_HTMLDDA:void 0===ic&&void 0!==ic},rc=nc.all,oc=nc.IS_HTMLDDA?function(e){return"function"==typeof e||e===rc}:function(e){return"function"==typeof e},ac=oc,sc=nc.all,lc=nc.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:ac(e)||e===sc}:function(e){return"object"==typeof e?null!==e:ac(e)},cc=El,uc=oc,hc=function(e,t){return arguments.length<2?(i=cc[e],uc(i)?i:void 0):cc[e]&&cc[e][t];var i},dc=Fl({}.isPrototypeOf),fc=hc("navigator","userAgent")||"",pc=El,gc=fc,yc=pc.process,vc=pc.Deno,mc=yc&&yc.versions||vc&&vc.version,_c=mc&&mc.v8;_c&&(Ol=(xl=_c.split("."))[0]>0&&xl[0]<4?1:+(xl[0]+xl[1])),!Ol&&gc&&(!(xl=gc.match(/Edge\/(\d+)/))||xl[1]>=74)&&(xl=gc.match(/Chrome\/(\d+)/))&&(Ol=+xl[1]);var Ec=Ol,Tc=Ec,Sc=Sl,bc=!!Object.getOwnPropertySymbols&&!Sc((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Tc&&Tc<41})),Cc=bc&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,kc=hc,Ic=oc,Pc=dc,Dc=Object,wc=Cc?function(e){return"symbol"==typeof e}:function(e){var t=kc("Symbol");return Ic(t)&&Pc(t.prototype,Dc(e))},Ac=String,Rc=function(e){try{return Ac(e)}catch(t){return"Object"}},xc=oc,Oc=Rc,Lc=TypeError,Nc=function(e){if(xc(e))return e;throw Lc(Oc(e)+" is not a function")},Mc=Nc,Uc=Xl,Bc=function(e,t){var i=e[t];return Uc(i)?void 0:Mc(i)},Fc=Pl,Hc=oc,jc=lc,Vc=TypeError,Kc={exports:{}},Gc=El,Wc=Object.defineProperty,Yc=function(e,t){try{Wc(Gc,e,{value:t,configurable:!0,writable:!0})}catch(i){Gc[e]=t}return t},zc=Yc,$c="__core-js_shared__",Xc=El[$c]||zc($c,{}),qc=Xc;(Kc.exports=function(e,t){return qc[e]||(qc[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Zc=Kc.exports,Qc=Ql,Jc=Object,eu=function(e){return Jc(Qc(e))},tu=eu,iu=Fl({}.hasOwnProperty),nu=Object.hasOwn||function(e,t){return iu(tu(e),t)},ru=Fl,ou=0,au=Math.random(),su=ru(1..toString),lu=function(e){return"Symbol("+(void 0===e?"":e)+")_"+su(++ou+au,36)},cu=El,uu=nu,hu=lu,du=bc,fu=Cc,pu=Zc("wks"),gu=cu.Symbol,yu=gu&&gu.for,vu=fu?gu:gu&&gu.withoutSetter||hu,mu=function(e){if(!uu(pu,e)||!du&&"string"!=typeof pu[e]){var t="Symbol."+e;du&&uu(gu,e)?pu[e]=gu[e]:pu[e]=fu&&yu?yu(t):vu(t)}return pu[e]},_u=Pl,Eu=lc,Tu=wc,Su=Bc,bu=function(e,t){var i,n;if("string"===t&&Hc(i=e.toString)&&!jc(n=Fc(i,e)))return n;if(Hc(i=e.valueOf)&&!jc(n=Fc(i,e)))return n;if("string"!==t&&Hc(i=e.toString)&&!jc(n=Fc(i,e)))return n;throw Vc("Can't convert object to primitive value")},Cu=TypeError,ku=mu("toPrimitive"),Iu=function(e,t){if(!Eu(e)||Tu(e))return e;var i,n=Su(e,ku);if(n){if(void 0===t&&(t="default"),i=_u(n,e,t),!Eu(i)||Tu(i))return i;throw Cu("Can't convert object to primitive value")}return void 0===t&&(t="number"),bu(e,t)},Pu=Iu,Du=wc,wu=function(e){var t=Pu(e,"string");return Du(t)?t:t+""},Au=lc,Ru=El.document,xu=Au(Ru)&&Au(Ru.createElement),Ou=function(e){return xu?Ru.createElement(e):{}},Lu=Ou,Nu=!bl&&!Sl((function(){return 7!=Object.defineProperty(Lu("div"),"a",{get:function(){return 7}}).a})),Mu=bl,Uu=Pl,Bu=Dl,Fu=Ll,Hu=tc,ju=wu,Vu=nu,Ku=Nu,Gu=Object.getOwnPropertyDescriptor;Tl.f=Mu?Gu:function(e,t){if(e=Hu(e),t=ju(t),Ku)try{return Gu(e,t)}catch(i){}if(Vu(e,t))return Fu(!Uu(Bu.f,e,t),e[t])};var Wu={},Yu=bl&&Sl((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),zu=lc,$u=String,Xu=TypeError,qu=function(e){if(zu(e))return e;throw Xu($u(e)+" is not an object")},Zu=bl,Qu=Nu,Ju=Yu,eh=qu,th=wu,ih=TypeError,nh=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,oh="enumerable",ah="configurable",sh="writable";Wu.f=Zu?Ju?function(e,t,i){if(eh(e),t=th(t),eh(i),"function"==typeof e&&"prototype"===t&&"value"in i&&sh in i&&!i[sh]){var n=rh(e,t);n&&n[sh]&&(e[t]=i.value,i={configurable:ah in i?i[ah]:n[ah],enumerable:oh in i?i[oh]:n[oh],writable:!1})}return nh(e,t,i)}:nh:function(e,t,i){if(eh(e),t=th(t),eh(i),Qu)try{return nh(e,t,i)}catch(n){}if("get"in i||"set"in i)throw ih("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var lh=Wu,ch=Ll,uh=bl?function(e,t,i){return lh.f(e,t,ch(1,i))}:function(e,t,i){return e[t]=i,e},hh={exports:{}},dh=bl,fh=nu,ph=Function.prototype,gh=dh&&Object.getOwnPropertyDescriptor,yh=fh(ph,"name"),vh={EXISTS:yh,PROPER:yh&&"something"===function(){}.name,CONFIGURABLE:yh&&(!dh||dh&&gh(ph,"name").configurable)},mh=oc,_h=Xc,Eh=Fl(Function.toString);mh(_h.inspectSource)||(_h.inspectSource=function(e){return Eh(e)});var Th,Sh,bh,Ch=_h.inspectSource,kh=oc,Ih=El.WeakMap,Ph=kh(Ih)&&/native code/.test(String(Ih)),Dh=lu,wh=Zc("keys"),Ah=function(e){return wh[e]||(wh[e]=Dh(e))},Rh={},xh=Ph,Oh=El,Lh=lc,Nh=uh,Mh=nu,Uh=Xc,Bh=Ah,Fh=Rh,Hh="Object already initialized",jh=Oh.TypeError,Vh=Oh.WeakMap;if(xh||Uh.state){var Kh=Uh.state||(Uh.state=new Vh);Kh.get=Kh.get,Kh.has=Kh.has,Kh.set=Kh.set,Th=function(e,t){if(Kh.has(e))throw jh(Hh);return t.facade=e,Kh.set(e,t),t},Sh=function(e){return Kh.get(e)||{}},bh=function(e){return Kh.has(e)}}else{var Gh=Bh("state");Fh[Gh]=!0,Th=function(e,t){if(Mh(e,Gh))throw jh(Hh);return t.facade=e,Nh(e,Gh,t),t},Sh=function(e){return Mh(e,Gh)?e[Gh]:{}},bh=function(e){return Mh(e,Gh)}}var Wh={set:Th,get:Sh,has:bh,enforce:function(e){return bh(e)?Sh(e):Th(e,{})},getterFor:function(e){return function(t){var i;if(!Lh(t)||(i=Sh(t)).type!==e)throw jh("Incompatible receiver, "+e+" required");return i}}},Yh=Sl,zh=oc,$h=nu,Xh=bl,qh=vh.CONFIGURABLE,Zh=Ch,Qh=Wh.enforce,Jh=Wh.get,ed=Object.defineProperty,td=Xh&&!Yh((function(){return 8!==ed((function(){}),"length",{value:8}).length})),id=String(String).split("String"),nd=hh.exports=function(e,t,i){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!$h(e,"name")||qh&&e.name!==t)&&(Xh?ed(e,"name",{value:t,configurable:!0}):e.name=t),td&&i&&$h(i,"arity")&&e.length!==i.arity&&ed(e,"length",{value:i.arity});try{i&&$h(i,"constructor")&&i.constructor?Xh&&ed(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(r){}var n=Qh(e);return $h(n,"source")||(n.source=id.join("string"==typeof t?t:"")),e};Function.prototype.toString=nd((function(){return zh(this)&&Jh(this).source||Zh(this)}),"toString");var rd=hh.exports,od=oc,ad=Wu,sd=rd,ld=Yc,cd=function(e,t,i,n){n||(n={});var r=n.enumerable,o=void 0!==n.name?n.name:t;if(od(i)&&sd(i,o,n),n.global)r?e[t]=i:ld(t,i);else{try{n.unsafe?e[t]&&(r=!0):delete e[t]}catch(a){}r?e[t]=i:ad.f(e,t,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},ud={},hd=Math.ceil,dd=Math.floor,fd=Math.trunc||function(e){var t=+e;return(t>0?dd:hd)(t)},pd=function(e){var t=+e;return t!=t||0===t?0:fd(t)},gd=pd,yd=Math.max,vd=Math.min,md=function(e,t){var i=gd(e);return i<0?yd(i+t,0):vd(i,t)},_d=pd,Ed=Math.min,Td=function(e){return e>0?Ed(_d(e),9007199254740991):0},Sd=Td,bd=function(e){return Sd(e.length)},Cd=tc,kd=md,Id=bd,Pd=function(e){return function(t,i,n){var r,o=Cd(t),a=Id(o),s=kd(n,a);if(e&&i!=i){for(;a>s;)if((r=o[s++])!=r)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===i)return e||s||0;return!e&&-1}},Dd={includes:Pd(!0),indexOf:Pd(!1)},wd=nu,Ad=tc,Rd=Dd.indexOf,xd=Rh,Od=Fl([].push),Ld=function(e,t){var i,n=Ad(e),r=0,o=[];for(i in n)!wd(xd,i)&&wd(n,i)&&Od(o,i);for(;t.length>r;)wd(n,i=t[r++])&&(~Rd(o,i)||Od(o,i));return o},Nd=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Md=Ld,Ud=Nd.concat("length","prototype");ud.f=Object.getOwnPropertyNames||function(e){return Md(e,Ud)};var Bd={};Bd.f=Object.getOwnPropertySymbols;var Fd=hc,Hd=ud,jd=Bd,Vd=qu,Kd=Fl([].concat),Gd=Fd("Reflect","ownKeys")||function(e){var t=Hd.f(Vd(e)),i=jd.f;return i?Kd(t,i(e)):t},Wd=nu,Yd=Gd,zd=Tl,$d=Wu,Xd=function(e,t,i){for(var n=Yd(t),r=$d.f,o=zd.f,a=0;a<n.length;a++){var s=n[a];Wd(e,s)||i&&Wd(i,s)||r(e,s,o(t,s))}},qd=Sl,Zd=oc,Qd=/#|\.prototype\./,Jd=function(e,t){var i=tf[ef(e)];return i==rf||i!=nf&&(Zd(t)?qd(t):!!t)},ef=Jd.normalize=function(e){return String(e).replace(Qd,".").toLowerCase()},tf=Jd.data={},nf=Jd.NATIVE="N",rf=Jd.POLYFILL="P",of=Jd,af=El,sf=Tl.f,lf=uh,cf=cd,uf=Yc,hf=Xd,df=of,ff=function(e,t){var i,n,r,o,a,s=e.target,l=e.global,c=e.stat;if(i=l?af:c?af[s]||uf(s,{}):(af[s]||{}).prototype)for(n in t){if(o=t[n],r=e.dontCallGetSet?(a=sf(i,n))&&a.value:i[n],!df(l?n:s+(c?".":"#")+n,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;hf(o,r)}(e.sham||r&&r.sham)&&lf(o,"sham",!0),cf(i,n,o,e)}},pf=Kl,gf=Array.isArray||function(e){return"Array"==pf(e)},yf=TypeError,vf=function(e){if(e>9007199254740991)throw yf("Maximum allowed index exceeded");return e},mf=wu,_f=Wu,Ef=Ll,Tf=function(e,t,i){var n=mf(t);n in e?_f.f(e,n,Ef(0,i)):e[n]=i},Sf={};Sf[mu("toStringTag")]="z";var bf="[object z]"===String(Sf),Cf=bf,kf=oc,If=Kl,Pf=mu("toStringTag"),Df=Object,wf="Arguments"==If(function(){return arguments}()),Af=Cf?If:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(i){}}(t=Df(e),Pf))?i:wf?If(t):"Object"==(n=If(t))&&kf(t.callee)?"Arguments":n},Rf=Fl,xf=Sl,Of=oc,Lf=Af,Nf=Ch,Mf=function(){},Uf=[],Bf=hc("Reflect","construct"),Ff=/^\s*(?:class|function)\b/,Hf=Rf(Ff.exec),jf=!Ff.exec(Mf),Vf=function(e){if(!Of(e))return!1;try{return Bf(Mf,Uf,e),!0}catch(t){return!1}},Kf=function(e){if(!Of(e))return!1;switch(Lf(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return jf||!!Hf(Ff,Nf(e))}catch(t){return!0}};Kf.sham=!0;var Gf=!Bf||xf((function(){var e;return Vf(Vf.call)||!Vf(Object)||!Vf((function(){e=!0}))||e}))?Kf:Vf,Wf=gf,Yf=Gf,zf=lc,$f=mu("species"),Xf=Array,qf=function(e){var t;return Wf(e)&&(t=e.constructor,(Yf(t)&&(t===Xf||Wf(t.prototype))||zf(t)&&null===(t=t[$f]))&&(t=void 0)),void 0===t?Xf:t},Zf=function(e,t){return new(qf(e))(0===t?0:t)},Qf=Sl,Jf=Ec,ep=mu("species"),tp=function(e){return Jf>=51||!Qf((function(){var t=[];return(t.constructor={})[ep]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},ip=ff,np=Sl,rp=gf,op=lc,ap=eu,sp=bd,lp=vf,cp=Tf,up=Zf,hp=tp,dp=Ec,fp=mu("isConcatSpreadable"),pp=dp>=51||!np((function(){var e=[];return e[fp]=!1,e.concat()[0]!==e})),gp=hp("concat"),yp=function(e){if(!op(e))return!1;var t=e[fp];return void 0!==t?!!t:rp(e)};ip({target:"Array",proto:!0,arity:1,forced:!pp||!gp},{concat:function(e){var t,i,n,r,o,a=ap(this),s=up(a,0),l=0;for(t=-1,n=arguments.length;t<n;t++)if(yp(o=-1===t?a:arguments[t]))for(r=sp(o),lp(l+r),i=0;i<r;i++,l++)i in o&&cp(s,l,o[i]);else lp(l+1),cp(s,l++,o);return s.length=l,s}});var vp=Kl,mp=Fl,_p=function(e){if("Function"===vp(e))return mp(e)},Ep=Nc,Tp=Cl,Sp=_p(_p.bind),bp=function(e,t){return Ep(e),void 0===t?e:Tp?Sp(e,t):function(){return e.apply(t,arguments)}},Cp=bp,kp=$l,Ip=eu,Pp=bd,Dp=Zf,wp=Fl([].push),Ap=function(e){var t=1==e,i=2==e,n=3==e,r=4==e,o=6==e,a=7==e,s=5==e||o;return function(l,c,u,h){for(var d,f,p=Ip(l),g=kp(p),y=Cp(c,u),v=Pp(g),m=0,_=h||Dp,E=t?_(l,v):i||a?_(l,0):void 0;v>m;m++)if((s||m in g)&&(f=y(d=g[m],m,p),e))if(t)E[m]=f;else if(f)switch(e){case 3:return!0;case 5:return d;case 6:return m;case 2:wp(E,d)}else switch(e){case 4:return!1;case 7:wp(E,d)}return o?-1:n||r?r:E}},Rp={forEach:Ap(0),map:Ap(1),filter:Ap(2),some:Ap(3),every:Ap(4),find:Ap(5),findIndex:Ap(6),filterReject:Ap(7)},xp=Rp.map;ff({target:"Array",proto:!0,forced:!tp("map")},{map:function(e){return xp(this,e,arguments.length>1?arguments[1]:void 0)}});var Op=Ld,Lp=Nd,Np=Object.keys||function(e){return Op(e,Lp)},Mp=eu,Up=Np;ff({target:"Object",stat:!0,forced:Sl((function(){Up(1)}))},{keys:function(e){return Up(Mp(e))}});var Bp=Af,Fp=String,Hp=function(e){if("Symbol"===Bp(e))throw TypeError("Cannot convert a Symbol value to a string");return Fp(e)},jp=Fl,Vp=pd,Kp=Hp,Gp=Ql,Wp=jp("".charAt),Yp=jp("".charCodeAt),zp=jp("".slice),$p=function(e){return function(t,i){var n,r,o=Kp(Gp(t)),a=Vp(i),s=o.length;return a<0||a>=s?e?"":void 0:(n=Yp(o,a))<55296||n>56319||a+1===s||(r=Yp(o,a+1))<56320||r>57343?e?Wp(o,a):n:e?zp(o,a,a+2):r-56320+(n-55296<<10)+65536}},Xp={codeAt:$p(!1),charAt:$p(!0)},qp=Xp.charAt,Zp=Ql,Qp=pd,Jp=Hp;ff({target:"String",proto:!0,forced:!0},{at:function(e){var t=Jp(Zp(this)),i=t.length,n=Qp(e),r=n>=0?n:i+n;return r<0||r>=i?void 0:qp(t,r)}});var eg=Af,tg=bf?{}.toString:function(){return"[object "+eg(this)+"]"};bf||cd(Object.prototype,"toString",tg,{unsafe:!0});var ig=qu,ng=function(){var e=ig(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},rg=Pl,og=nu,ag=dc,sg=ng,lg=RegExp.prototype,cg=function(e){var t=e.flags;return void 0!==t||"flags"in lg||og(e,"flags")||!ag(lg,e)?t:rg(sg,e)},ug=vh.PROPER,hg=cd,dg=qu,fg=Hp,pg=Sl,gg=cg,yg="toString",vg=RegExp.prototype[yg],mg=pg((function(){return"/a/b"!=vg.call({source:"a",flags:"b"})})),_g=ug&&vg.name!=yg;(mg||_g)&&hg(RegExp.prototype,yg,(function(){var e=dg(this);return"/"+fg(e.source)+"/"+fg(gg(e))}),{unsafe:!0});var Eg=Ou("span").classList,Tg=Eg&&Eg.constructor&&Eg.constructor.prototype,Sg=Tg===Object.prototype?void 0:Tg,bg=Sl,Cg=function(e,t){var i=[][e];return!!i&&bg((function(){i.call(null,t||function(){return 1},1)}))},kg=Rp.forEach,Ig=El,Pg={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Dg=Sg,wg=Cg("forEach")?[].forEach:function(e){return kg(this,e,arguments.length>1?arguments[1]:void 0)},Ag=uh,Rg=function(e){if(e&&e.forEach!==wg)try{Ag(e,"forEach",wg)}catch(t){e.forEach=wg}};for(var xg in Pg)Pg[xg]&&Rg(Ig[xg]&&Ig[xg].prototype);Rg(Dg);var Og=oc,Lg=String,Ng=TypeError,Mg=Fl,Ug=qu,Bg=function(e){if("object"==typeof e||Og(e))return e;throw Ng("Can't set "+Lg(e)+" as a prototype")},Fg=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=Mg(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(n){}return function(i,n){return Ug(i),Bg(n),t?e(i,n):i.__proto__=n,i}}():void 0),Hg=oc,jg=lc,Vg=Fg,Kg=function(e,t,i){var n,r;return Vg&&Hg(n=t.constructor)&&n!==i&&jg(r=n.prototype)&&r!==i.prototype&&Vg(e,r),e},Gg=Fl(1..valueOf),Wg="\t\n\v\f\r                 \u2028\u2029\ufeff",Yg=Ql,zg=Hp,$g=Wg,Xg=Fl("".replace),qg="["+$g+"]",Zg=RegExp("^"+qg+qg+"*"),Qg=RegExp(qg+qg+"*$"),Jg=function(e){return function(t){var i=zg(Yg(t));return 1&e&&(i=Xg(i,Zg,"")),2&e&&(i=Xg(i,Qg,"")),i}},ey={start:Jg(1),end:Jg(2),trim:Jg(3)},ty=bl,iy=El,ny=Fl,ry=of,oy=cd,ay=nu,sy=Kg,ly=dc,cy=wc,uy=Iu,hy=Sl,dy=ud.f,fy=Tl.f,py=Wu.f,gy=Gg,yy=ey.trim,vy="Number",my=iy[vy],_y=my.prototype,Ey=iy.TypeError,Ty=ny("".slice),Sy=ny("".charCodeAt),by=function(e){var t,i,n,r,o,a,s,l,c=uy(e,"number");if(cy(c))throw Ey("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=yy(c),43===(t=Sy(c,0))||45===t){if(88===(i=Sy(c,2))||120===i)return NaN}else if(48===t){switch(Sy(c,1)){case 66:case 98:n=2,r=49;break;case 79:case 111:n=8,r=55;break;default:return+c}for(a=(o=Ty(c,2)).length,s=0;s<a;s++)if((l=Sy(o,s))<48||l>r)return NaN;return parseInt(o,n)}return+c};if(ry(vy,!my(" 0o1")||!my("0b1")||my("+0x1"))){for(var Cy,ky=function(e){var t=arguments.length<1?0:my(function(e){var t=uy(e,"number");return"bigint"==typeof t?t:by(t)}(e)),i=this;return ly(_y,i)&&hy((function(){gy(i)}))?sy(Object(t),i,ky):t},Iy=ty?dy(my):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),Py=0;Iy.length>Py;Py++)ay(my,Cy=Iy[Py])&&!ay(ky,Cy)&&py(ky,Cy,fy(my,Cy));ky.prototype=_y,_y.constructor=ky,oy(iy,vy,ky,{constructor:!0})}var Dy=bl,wy=vh.EXISTS,Ay=Fl,Ry=Wu.f,xy=Function.prototype,Oy=Ay(xy.toString),Ly=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Ny=Ay(Ly.exec);Dy&&!wy&&Ry(xy,"name",{configurable:!0,get:function(){try{return Ny(Ly,Oy(this))[1]}catch(e){return""}}});var My=ff,Uy=$l,By=tc,Fy=Cg,Hy=Fl([].join),jy=Uy!=Object,Vy=Fy("join",",");My({target:"Array",proto:!0,forced:jy||!Vy},{join:function(e){return Hy(By(this),void 0===e?",":e)}});var Ky,Gy,Wy,Yy,zy="process"==Kl(El.process),$y=Wu.f,Xy=nu,qy=mu("toStringTag"),Zy=function(e,t,i){e&&!i&&(e=e.prototype),e&&!Xy(e,qy)&&$y(e,qy,{configurable:!0,value:t})},Qy=hc,Jy=Wu,ev=bl,tv=mu("species"),iv=function(e){var t=Qy(e),i=Jy.f;ev&&t&&!t[tv]&&i(t,tv,{configurable:!0,get:function(){return this}})},nv=dc,rv=TypeError,ov=Gf,av=Rc,sv=TypeError,lv=qu,cv=function(e){if(ov(e))return e;throw sv(av(e)+" is not a constructor")},uv=Xl,hv=mu("species"),dv=function(e,t){var i,n=lv(e).constructor;return void 0===n||uv(i=lv(n)[hv])?t:cv(i)},fv=Cl,pv=Function.prototype,gv=pv.apply,yv=pv.call,vv="object"==typeof Reflect&&Reflect.apply||(fv?yv.bind(gv):function(){return yv.apply(gv,arguments)}),mv=hc("document","documentElement"),_v=Fl([].slice),Ev=TypeError,Tv=/(?:ipad|iphone|ipod).*applewebkit/i.test(fc),Sv=El,bv=vv,Cv=bp,kv=oc,Iv=nu,Pv=Sl,Dv=mv,wv=_v,Av=Ou,Rv=function(e,t){if(e<t)throw Ev("Not enough arguments");return e},xv=Tv,Ov=zy,Lv=Sv.setImmediate,Nv=Sv.clearImmediate,Mv=Sv.process,Uv=Sv.Dispatch,Bv=Sv.Function,Fv=Sv.MessageChannel,Hv=Sv.String,jv=0,Vv={},Kv="onreadystatechange";try{Ky=Sv.location}catch(dF){}var Gv=function(e){if(Iv(Vv,e)){var t=Vv[e];delete Vv[e],t()}},Wv=function(e){return function(){Gv(e)}},Yv=function(e){Gv(e.data)},zv=function(e){Sv.postMessage(Hv(e),Ky.protocol+"//"+Ky.host)};Lv&&Nv||(Lv=function(e){Rv(arguments.length,1);var t=kv(e)?e:Bv(e),i=wv(arguments,1);return Vv[++jv]=function(){bv(t,void 0,i)},Gy(jv),jv},Nv=function(e){delete Vv[e]},Ov?Gy=function(e){Mv.nextTick(Wv(e))}:Uv&&Uv.now?Gy=function(e){Uv.now(Wv(e))}:Fv&&!xv?(Yy=(Wy=new Fv).port2,Wy.port1.onmessage=Yv,Gy=Cv(Yy.postMessage,Yy)):Sv.addEventListener&&kv(Sv.postMessage)&&!Sv.importScripts&&Ky&&"file:"!==Ky.protocol&&!Pv(zv)?(Gy=zv,Sv.addEventListener("message",Yv,!1)):Gy=Kv in Av("script")?function(e){Dv.appendChild(Av("script"))[Kv]=function(){Dv.removeChild(this),Gv(e)}}:function(e){setTimeout(Wv(e),0)});var $v,Xv,qv,Zv,Qv,Jv,em,tm,im={set:Lv,clear:Nv},nm=El,rm=/ipad|iphone|ipod/i.test(fc)&&void 0!==nm.Pebble,om=/web0s(?!.*chrome)/i.test(fc),am=El,sm=bp,lm=Tl.f,cm=im.set,um=Tv,hm=rm,dm=om,fm=zy,pm=am.MutationObserver||am.WebKitMutationObserver,gm=am.document,ym=am.process,vm=am.Promise,mm=lm(am,"queueMicrotask"),_m=mm&&mm.value;_m||($v=function(){var e,t;for(fm&&(e=ym.domain)&&e.exit();Xv;){t=Xv.fn,Xv=Xv.next;try{t()}catch(dF){throw Xv?Zv():qv=void 0,dF}}qv=void 0,e&&e.enter()},um||fm||dm||!pm||!gm?!hm&&vm&&vm.resolve?((em=vm.resolve(void 0)).constructor=vm,tm=sm(em.then,em),Zv=function(){tm($v)}):fm?Zv=function(){ym.nextTick($v)}:(cm=sm(cm,am),Zv=function(){cm($v)}):(Qv=!0,Jv=gm.createTextNode(""),new pm($v).observe(Jv,{characterData:!0}),Zv=function(){Jv.data=Qv=!Qv}));var Em=_m||function(e){var t={fn:e,next:void 0};qv&&(qv.next=t),Xv||(Xv=t,Zv()),qv=t},Tm=El,Sm=function(e){try{return{error:!1,value:e()}}catch(dF){return{error:!0,value:dF}}},bm=function(){this.head=null,this.tail=null};bm.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var Cm=bm,km=El.Promise,Im="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Pm=!Im&&!zy&&"object"==typeof window&&"object"==typeof document,Dm=El,wm=km,Am=oc,Rm=of,xm=Ch,Om=mu,Lm=Pm,Nm=Im,Mm=Ec;wm&&wm.prototype;var Um=Om("species"),Bm=!1,Fm=Am(Dm.PromiseRejectionEvent),Hm={CONSTRUCTOR:Rm("Promise",(function(){var e=xm(wm),t=e!==String(wm);if(!t&&66===Mm)return!0;if(!Mm||Mm<51||!/native code/.test(e)){var i=new wm((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((i.constructor={})[Um]=n,!(Bm=i.then((function(){}))instanceof n))return!0}return!t&&(Lm||Nm)&&!Fm})),REJECTION_EVENT:Fm,SUBCLASSING:Bm},jm={},Vm=Nc,Km=TypeError,Gm=function(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw Km("Bad Promise constructor");t=e,i=n})),this.resolve=Vm(t),this.reject=Vm(i)};jm.f=function(e){return new Gm(e)};var Wm,Ym,zm,$m=ff,Xm=zy,qm=El,Zm=Pl,Qm=cd,Jm=Fg,e_=Zy,t_=iv,i_=Nc,n_=oc,r_=lc,o_=function(e,t){if(nv(t,e))return e;throw rv("Incorrect invocation")},a_=dv,s_=im.set,l_=Em,c_=function(e,t){var i=Tm.console;i&&i.error&&(1==arguments.length?i.error(e):i.error(e,t))},u_=Sm,h_=Cm,d_=Wh,f_=km,p_=jm,g_="Promise",y_=Hm.CONSTRUCTOR,v_=Hm.REJECTION_EVENT,m_=Hm.SUBCLASSING,__=d_.getterFor(g_),E_=d_.set,T_=f_&&f_.prototype,S_=f_,b_=T_,C_=qm.TypeError,k_=qm.document,I_=qm.process,P_=p_.f,D_=P_,w_=!!(k_&&k_.createEvent&&qm.dispatchEvent),A_="unhandledrejection",R_=function(e){var t;return!(!r_(e)||!n_(t=e.then))&&t},x_=function(e,t){var i,n,r,o=t.value,a=1==t.state,s=a?e.ok:e.fail,l=e.resolve,c=e.reject,u=e.domain;try{s?(a||(2===t.rejection&&U_(t),t.rejection=1),!0===s?i=o:(u&&u.enter(),i=s(o),u&&(u.exit(),r=!0)),i===e.promise?c(C_("Promise-chain cycle")):(n=R_(i))?Zm(n,i,l,c):l(i)):c(o)}catch(dF){u&&!r&&u.exit(),c(dF)}},O_=function(e,t){e.notified||(e.notified=!0,l_((function(){for(var i,n=e.reactions;i=n.get();)x_(i,e);e.notified=!1,t&&!e.rejection&&N_(e)})))},L_=function(e,t,i){var n,r;w_?((n=k_.createEvent("Event")).promise=t,n.reason=i,n.initEvent(e,!1,!0),qm.dispatchEvent(n)):n={promise:t,reason:i},!v_&&(r=qm["on"+e])?r(n):e===A_&&c_("Unhandled promise rejection",i)},N_=function(e){Zm(s_,qm,(function(){var t,i=e.facade,n=e.value;if(M_(e)&&(t=u_((function(){Xm?I_.emit("unhandledRejection",n,i):L_(A_,i,n)})),e.rejection=Xm||M_(e)?2:1,t.error))throw t.value}))},M_=function(e){return 1!==e.rejection&&!e.parent},U_=function(e){Zm(s_,qm,(function(){var t=e.facade;Xm?I_.emit("rejectionHandled",t):L_("rejectionhandled",t,e.value)}))},B_=function(e,t,i){return function(n){e(t,n,i)}},F_=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=2,O_(e,!0))},H_=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw C_("Promise can't be resolved itself");var n=R_(t);n?l_((function(){var i={done:!1};try{Zm(n,t,B_(H_,i,e),B_(F_,i,e))}catch(dF){F_(i,dF,e)}})):(e.value=t,e.state=1,O_(e,!1))}catch(dF){F_({done:!1},dF,e)}}};if(y_&&(b_=(S_=function(e){o_(this,b_),i_(e),Zm(Wm,this);var t=__(this);try{e(B_(H_,t),B_(F_,t))}catch(dF){F_(t,dF)}}).prototype,(Wm=function(e){E_(this,{type:g_,done:!1,notified:!1,parent:!1,reactions:new h_,rejection:!1,state:0,value:void 0})}).prototype=Qm(b_,"then",(function(e,t){var i=__(this),n=P_(a_(this,S_));return i.parent=!0,n.ok=!n_(e)||e,n.fail=n_(t)&&t,n.domain=Xm?I_.domain:void 0,0==i.state?i.reactions.add(n):l_((function(){x_(n,i)})),n.promise})),Ym=function(){var e=new Wm,t=__(e);this.promise=e,this.resolve=B_(H_,t),this.reject=B_(F_,t)},p_.f=P_=function(e){return e===S_||undefined===e?new Ym(e):D_(e)},n_(f_)&&T_!==Object.prototype)){zm=T_.then,m_||Qm(T_,"then",(function(e,t){var i=this;return new S_((function(e,t){Zm(zm,i,e,t)})).then(e,t)}),{unsafe:!0});try{delete T_.constructor}catch(dF){}Jm&&Jm(T_,b_)}$m({global:!0,constructor:!0,wrap:!0,forced:y_},{Promise:S_}),e_(S_,g_,!1),t_(g_);var j_={},V_=j_,K_=mu("iterator"),G_=Array.prototype,W_=Af,Y_=Bc,z_=Xl,$_=j_,X_=mu("iterator"),q_=function(e){if(!z_(e))return Y_(e,X_)||Y_(e,"@@iterator")||$_[W_(e)]},Z_=Pl,Q_=Nc,J_=qu,eE=Rc,tE=q_,iE=TypeError,nE=Pl,rE=qu,oE=Bc,aE=bp,sE=Pl,lE=qu,cE=Rc,uE=function(e){return void 0!==e&&(V_.Array===e||G_[K_]===e)},hE=bd,dE=dc,fE=function(e,t){var i=arguments.length<2?tE(e):t;if(Q_(i))return J_(Z_(i,e));throw iE(eE(e)+" is not iterable")},pE=q_,gE=function(e,t,i){var n,r;rE(e);try{if(!(n=oE(e,"return"))){if("throw"===t)throw i;return i}n=nE(n,e)}catch(dF){r=!0,n=dF}if("throw"===t)throw i;if(r)throw n;return rE(n),i},yE=TypeError,vE=function(e,t){this.stopped=e,this.result=t},mE=vE.prototype,_E=function(e,t,i){var n,r,o,a,s,l,c,u=i&&i.that,h=!(!i||!i.AS_ENTRIES),d=!(!i||!i.IS_RECORD),f=!(!i||!i.IS_ITERATOR),p=!(!i||!i.INTERRUPTED),g=aE(t,u),y=function(e){return n&&gE(n,"normal",e),new vE(!0,e)},v=function(e){return h?(lE(e),p?g(e[0],e[1],y):g(e[0],e[1])):p?g(e,y):g(e)};if(d)n=e.iterator;else if(f)n=e;else{if(!(r=pE(e)))throw yE(cE(e)+" is not iterable");if(uE(r)){for(o=0,a=hE(e);a>o;o++)if((s=v(e[o]))&&dE(mE,s))return s;return new vE(!1)}n=fE(e,r)}for(l=d?e.next:n.next;!(c=sE(l,n)).done;){try{s=v(c.value)}catch(dF){gE(n,"throw",dF)}if("object"==typeof s&&s&&dE(mE,s))return s}return new vE(!1)},EE=mu("iterator"),TE=!1;try{var SE=0,bE={next:function(){return{done:!!SE++}},return:function(){TE=!0}};bE[EE]=function(){return this},Array.from(bE,(function(){throw 2}))}catch(dF){}var CE=km,kE=Hm.CONSTRUCTOR||!function(e,t){if(!t&&!TE)return!1;var i=!1;try{var n={};n[EE]=function(){return{next:function(){return{done:i=!0}}}},e(n)}catch(dF){}return i}((function(e){CE.all(e).then(void 0,(function(){}))})),IE=Pl,PE=Nc,DE=jm,wE=Sm,AE=_E;ff({target:"Promise",stat:!0,forced:kE},{all:function(e){var t=this,i=DE.f(t),n=i.resolve,r=i.reject,o=wE((function(){var i=PE(t.resolve),o=[],a=0,s=1;AE(e,(function(e){var l=a++,c=!1;s++,IE(i,t,e).then((function(e){c||(c=!0,o[l]=e,--s||n(o))}),r)})),--s||n(o)}));return o.error&&r(o.value),i.promise}});var RE=ff,xE=Hm.CONSTRUCTOR,OE=km,LE=hc,NE=oc,ME=cd,UE=OE&&OE.prototype;if(RE({target:"Promise",proto:!0,forced:xE,real:!0},{catch:function(e){return this.then(void 0,e)}}),NE(OE)){var BE=LE("Promise").prototype.catch;UE.catch!==BE&&ME(UE,"catch",BE,{unsafe:!0})}var FE=Pl,HE=Nc,jE=jm,VE=Sm,KE=_E;ff({target:"Promise",stat:!0,forced:kE},{race:function(e){var t=this,i=jE.f(t),n=i.reject,r=VE((function(){var r=HE(t.resolve);KE(e,(function(e){FE(r,t,e).then(i.resolve,n)}))}));return r.error&&n(r.value),i.promise}});var GE=Pl,WE=jm;ff({target:"Promise",stat:!0,forced:Hm.CONSTRUCTOR},{reject:function(e){var t=WE.f(this);return GE(t.reject,void 0,e),t.promise}});var YE=qu,zE=lc,$E=jm,XE=function(e,t){if(YE(e),zE(t)&&t.constructor===e)return t;var i=$E.f(e);return(0,i.resolve)(t),i.promise},qE=ff,ZE=Hm.CONSTRUCTOR,QE=XE;hc("Promise"),qE({target:"Promise",stat:!0,forced:ZE},{resolve:function(e){return QE(this,e)}});var JE=ff,eT=km,tT=Sl,iT=hc,nT=oc,rT=dv,oT=XE,aT=cd,sT=eT&&eT.prototype;if(JE({target:"Promise",proto:!0,real:!0,forced:!!eT&&tT((function(){sT.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=rT(this,iT("Promise")),i=nT(e);return this.then(i?function(i){return oT(t,e()).then((function(){return i}))}:e,i?function(i){return oT(t,e()).then((function(){throw i}))}:e)}}),nT(eT)){var lT=iT("Promise").prototype.finally;sT.finally!==lT&&aT(sT,"finally",lT,{unsafe:!0})}var cT=bl,uT=gf,hT=TypeError,dT=Object.getOwnPropertyDescriptor,fT=cT&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(dF){return dF instanceof TypeError}}(),pT=Rc,gT=TypeError,yT=ff,vT=eu,mT=md,_T=pd,ET=bd,TT=fT?function(e,t){if(uT(e)&&!dT(e,"length").writable)throw hT("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},ST=vf,bT=Zf,CT=Tf,kT=function(e,t){if(!delete e[t])throw gT("Cannot delete property "+pT(t)+" of "+pT(e))},IT=tp("splice"),PT=Math.max,DT=Math.min;yT({target:"Array",proto:!0,forced:!IT},{splice:function(e,t){var i,n,r,o,a,s,l=vT(this),c=ET(l),u=mT(e,c),h=arguments.length;for(0===h?i=n=0:1===h?(i=0,n=c-u):(i=h-2,n=DT(PT(_T(t),0),c-u)),ST(c+i-n),r=bT(l,n),o=0;o<n;o++)(a=u+o)in l&&CT(r,o,l[a]);if(r.length=n,i<n){for(o=u;o<c-n;o++)s=o+i,(a=o+n)in l?l[s]=l[a]:kT(l,s);for(o=c;o>c-n+i;o--)kT(l,o-1)}else if(i>n)for(o=c-n;o>u;o--)s=o+i-1,(a=o+n-1)in l?l[s]=l[a]:kT(l,s);for(o=0;o<i;o++)l[o+u]=arguments[o+2];return TT(l,c-n+i),r}});var wT=pd,AT=Hp,RT=Ql,xT=RangeError,OT=ff,LT=Fl,NT=pd,MT=Gg,UT=function(e){var t=AT(RT(this)),i="",n=wT(e);if(n<0||n==1/0)throw xT("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(i+=t);return i},BT=Sl,FT=RangeError,HT=String,jT=Math.floor,VT=LT(UT),KT=LT("".slice),GT=LT(1..toFixed),WT=function(e,t,i){return 0===t?i:t%2==1?WT(e,t-1,i*e):WT(e*e,t/2,i)},YT=function(e,t,i){for(var n=-1,r=i;++n<6;)r+=t*e[n],e[n]=r%1e7,r=jT(r/1e7)},zT=function(e,t){for(var i=6,n=0;--i>=0;)n+=e[i],e[i]=jT(n/t),n=n%t*1e7},$T=function(e){for(var t=6,i="";--t>=0;)if(""!==i||0===t||0!==e[t]){var n=HT(e[t]);i=""===i?n:i+VT("0",7-n.length)+n}return i};OT({target:"Number",proto:!0,forced:BT((function(){return"0.000"!==GT(8e-5,3)||"1"!==GT(.9,0)||"1.25"!==GT(1.255,2)||"1000000000000000128"!==GT(0xde0b6b3a7640080,0)}))||!BT((function(){GT({})}))},{toFixed:function(e){var t,i,n,r,o=MT(this),a=NT(e),s=[0,0,0,0,0,0],l="",c="0";if(a<0||a>20)throw FT("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return HT(o);if(o<0&&(l="-",o=-o),o>1e-21)if(i=(t=function(e){for(var t=0,i=e;i>=4096;)t+=12,i/=4096;for(;i>=2;)t+=1,i/=2;return t}(o*WT(2,69,1))-69)<0?o*WT(2,-t,1):o/WT(2,t,1),i*=4503599627370496,(t=52-t)>0){for(YT(s,0,i),n=a;n>=7;)YT(s,1e7,0),n-=7;for(YT(s,WT(10,n,1),0),n=t-1;n>=23;)zT(s,1<<23),n-=23;zT(s,1<<n),YT(s,1,1),zT(s,2),c=$T(s)}else YT(s,0,i),YT(s,1<<-t,0),c=$T(s)+VT("0",a);return c=a>0?l+((r=c.length)<=a?"0."+VT("0",a-r)+c:KT(c,0,r-a)+"."+KT(c,r-a)):l+c}}),ff({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var XT=Sl,qT=El.RegExp,ZT=XT((function(){var e=qT("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),QT=ZT||XT((function(){return!qT("a","y").sticky})),JT={BROKEN_CARET:ZT||XT((function(){var e=qT("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:QT,UNSUPPORTED_Y:ZT},eS={},tS=bl,iS=Yu,nS=Wu,rS=qu,oS=tc,aS=Np;eS.f=tS&&!iS?Object.defineProperties:function(e,t){rS(e);for(var i,n=oS(t),r=aS(t),o=r.length,a=0;o>a;)nS.f(e,i=r[a++],n[i]);return e};var sS,lS=qu,cS=eS,uS=Nd,hS=Rh,dS=mv,fS=Ou,pS="prototype",gS="script",yS=Ah("IE_PROTO"),vS=function(){},mS=function(e){return"<"+gS+">"+e+"</"+gS+">"},_S=function(e){e.write(mS("")),e.close();var t=e.parentWindow.Object;return e=null,t},ES=function(){try{sS=new ActiveXObject("htmlfile")}catch(dF){}var e,t,i;ES="undefined"!=typeof document?document.domain&&sS?_S(sS):(t=fS("iframe"),i="java"+gS+":",t.style.display="none",dS.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(mS("document.F=Object")),e.close(),e.F):_S(sS);for(var n=uS.length;n--;)delete ES[pS][uS[n]];return ES()};hS[yS]=!0;var TS,SS,bS=Object.create||function(e,t){var i;return null!==e?(vS[pS]=lS(e),i=new vS,vS[pS]=null,i[yS]=e):i=ES(),void 0===t?i:cS.f(i,t)},CS=Sl,kS=El.RegExp,IS=CS((function(){var e=kS(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),PS=Sl,DS=El.RegExp,wS=PS((function(){var e=DS("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),AS=Pl,RS=Fl,xS=Hp,OS=ng,LS=JT,NS=bS,MS=Wh.get,US=IS,BS=wS,FS=Zc("native-string-replace",String.prototype.replace),HS=RegExp.prototype.exec,jS=HS,VS=RS("".charAt),KS=RS("".indexOf),GS=RS("".replace),WS=RS("".slice),YS=(SS=/b*/g,AS(HS,TS=/a/,"a"),AS(HS,SS,"a"),0!==TS.lastIndex||0!==SS.lastIndex),zS=LS.BROKEN_CARET,$S=void 0!==/()??/.exec("")[1];(YS||$S||zS||US||BS)&&(jS=function(e){var t,i,n,r,o,a,s,l=this,c=MS(l),u=xS(e),h=c.raw;if(h)return h.lastIndex=l.lastIndex,t=AS(jS,h,u),l.lastIndex=h.lastIndex,t;var d=c.groups,f=zS&&l.sticky,p=AS(OS,l),g=l.source,y=0,v=u;if(f&&(p=GS(p,"y",""),-1===KS(p,"g")&&(p+="g"),v=WS(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==VS(u,l.lastIndex-1))&&(g="(?: "+g+")",v=" "+v,y++),i=new RegExp("^(?:"+g+")",p)),$S&&(i=new RegExp("^"+g+"$(?!\\s)",p)),YS&&(n=l.lastIndex),r=AS(HS,f?i:l,v),f?r?(r.input=WS(r.input,y),r[0]=WS(r[0],y),r.index=l.lastIndex,l.lastIndex+=r[0].length):l.lastIndex=0:YS&&r&&(l.lastIndex=l.global?r.index+r[0].length:n),$S&&r&&r.length>1&&AS(FS,r[0],i,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&d)for(r.groups=a=NS(null),o=0;o<d.length;o++)a[(s=d[o])[0]]=r[s[1]];return r});var XS=jS;ff({target:"RegExp",proto:!0,forced:/./.exec!==XS},{exec:XS});var qS=_p,ZS=cd,QS=XS,JS=Sl,eb=mu,tb=uh,ib=eb("species"),nb=RegExp.prototype,rb=function(e,t,i,n){var r=eb(e),o=!JS((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),a=o&&!JS((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[ib]=function(){return i},i.flags="",i[r]=/./[r]),i.exec=function(){return t=!0,null},i[r](""),!t}));if(!o||!a||i){var s=qS(/./[r]),l=t(r,""[e],(function(e,t,i,n,r){var a=qS(e),l=t.exec;return l===QS||l===nb.exec?o&&!r?{done:!0,value:s(t,i,n)}:{done:!0,value:a(i,t,n)}:{done:!1}}));ZS(String.prototype,e,l[0]),ZS(nb,r,l[1])}n&&tb(nb[r],"sham",!0)},ob=Xp.charAt,ab=function(e,t,i){return t+(i?ob(e,t).length:1)},sb=Fl,lb=eu,cb=Math.floor,ub=sb("".charAt),hb=sb("".replace),db=sb("".slice),fb=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,pb=/\$([$&'`]|\d{1,2})/g,gb=Pl,yb=qu,vb=oc,mb=Kl,_b=XS,Eb=TypeError,Tb=function(e,t){var i=e.exec;if(vb(i)){var n=gb(i,e,t);return null!==n&&yb(n),n}if("RegExp"===mb(e))return gb(_b,e,t);throw Eb("RegExp#exec called on incompatible receiver")},Sb=vv,bb=Pl,Cb=Fl,kb=rb,Ib=Sl,Pb=qu,Db=oc,wb=Xl,Ab=pd,Rb=Td,xb=Hp,Ob=Ql,Lb=ab,Nb=Bc,Mb=function(e,t,i,n,r,o){var a=i+e.length,s=n.length,l=pb;return void 0!==r&&(r=lb(r),l=fb),hb(o,l,(function(o,l){var c;switch(ub(l,0)){case"$":return"$";case"&":return e;case"`":return db(t,0,i);case"'":return db(t,a);case"<":c=r[db(l,1,-1)];break;default:var u=+l;if(0===u)return o;if(u>s){var h=cb(u/10);return 0===h?o:h<=s?void 0===n[h-1]?ub(l,1):n[h-1]+ub(l,1):o}c=n[u-1]}return void 0===c?"":c}))},Ub=Tb,Bb=mu("replace"),Fb=Math.max,Hb=Math.min,jb=Cb([].concat),Vb=Cb([].push),Kb=Cb("".indexOf),Gb=Cb("".slice),Wb="$0"==="a".replace(/./,"$0"),Yb=!!/./[Bb]&&""===/./[Bb]("a","$0");kb("replace",(function(e,t,i){var n=Yb?"$":"$0";return[function(e,i){var n=Ob(this),r=wb(e)?void 0:Nb(e,Bb);return r?bb(r,e,n,i):bb(t,xb(n),e,i)},function(e,r){var o=Pb(this),a=xb(e);if("string"==typeof r&&-1===Kb(r,n)&&-1===Kb(r,"$<")){var s=i(t,o,a,r);if(s.done)return s.value}var l=Db(r);l||(r=xb(r));var c=o.global;if(c){var u=o.unicode;o.lastIndex=0}for(var h=[];;){var d=Ub(o,a);if(null===d)break;if(Vb(h,d),!c)break;""===xb(d[0])&&(o.lastIndex=Lb(a,Rb(o.lastIndex),u))}for(var f,p="",g=0,y=0;y<h.length;y++){for(var v=xb((d=h[y])[0]),m=Fb(Hb(Ab(d.index),a.length),0),_=[],E=1;E<d.length;E++)Vb(_,void 0===(f=d[E])?f:String(f));var T=d.groups;if(l){var S=jb([v],_,m,a);void 0!==T&&Vb(S,T);var b=xb(Sb(r,void 0,S))}else b=Mb(v,a,m,_,T,r);m>=g&&(p+=Gb(a,g,m)+b,g=m+v.length)}return p+Gb(a,g)}]}),!!Ib((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!Wb||Yb);var zb=lc,$b=Kl,Xb=mu("match"),qb=function(e){var t;return zb(e)&&(void 0!==(t=e[Xb])?!!t:"RegExp"==$b(e))},Zb=md,Qb=bd,Jb=Tf,eC=Array,tC=Math.max,iC=function(e,t,i){for(var n=Qb(e),r=Zb(t,n),o=Zb(void 0===i?n:i,n),a=eC(tC(o-r,0)),s=0;r<o;r++,s++)Jb(a,s,e[r]);return a.length=s,a},nC=vv,rC=Pl,oC=Fl,aC=rb,sC=qu,lC=Xl,cC=qb,uC=Ql,hC=dv,dC=ab,fC=Td,pC=Hp,gC=Bc,yC=iC,vC=Tb,mC=XS,_C=Sl,EC=JT.UNSUPPORTED_Y,TC=4294967295,SC=Math.min,bC=[].push,CC=oC(/./.exec),kC=oC(bC),IC=oC("".slice);aC("split",(function(e,t,i){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,i){var n=pC(uC(this)),r=void 0===i?TC:i>>>0;if(0===r)return[];if(void 0===e)return[n];if(!cC(e))return rC(t,n,e,r);for(var o,a,s,l=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,h=new RegExp(e.source,c+"g");(o=rC(mC,h,n))&&!((a=h.lastIndex)>u&&(kC(l,IC(n,u,o.index)),o.length>1&&o.index<n.length&&nC(bC,l,yC(o,1)),s=o[0].length,u=a,l.length>=r));)h.lastIndex===o.index&&h.lastIndex++;return u===n.length?!s&&CC(h,"")||kC(l,""):kC(l,IC(n,u)),l.length>r?yC(l,0,r):l}:"0".split(void 0,0).length?function(e,i){return void 0===e&&0===i?[]:rC(t,this,e,i)}:t,[function(t,i){var r=uC(this),o=lC(t)?void 0:gC(t,e);return o?rC(o,t,r,i):rC(n,pC(r),t,i)},function(e,r){var o=sC(this),a=pC(e),s=i(n,o,a,r,n!==t);if(s.done)return s.value;var l=hC(o,RegExp),c=o.unicode,u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(EC?"g":"y"),h=new l(EC?"^(?:"+o.source+")":o,u),d=void 0===r?TC:r>>>0;if(0===d)return[];if(0===a.length)return null===vC(h,a)?[a]:[];for(var f=0,p=0,g=[];p<a.length;){h.lastIndex=EC?0:p;var y,v=vC(h,EC?IC(a,p):a);if(null===v||(y=SC(fC(h.lastIndex+(EC?p:0)),a.length))===f)p=dC(a,p,c);else{if(kC(g,IC(a,f,p)),g.length===d)return g;for(var m=1;m<=v.length-1;m++)if(kC(g,v[m]),g.length===d)return g;p=f=y}}return kC(g,IC(a,f)),g}]}),!!_C((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var i="ab".split(e);return 2!==i.length||"a"!==i[0]||"b"!==i[1]})),EC);var PC=vh.PROPER,DC=Sl,wC=Wg,AC=ey.trim;ff({target:"String",proto:!0,forced:function(e){return DC((function(){return!!wC[e]()||"​…᠎"!=="​…᠎"[e]()||PC&&wC[e].name!==e}))}("trim")},{trim:function(){return AC(this)}});var RC=Rp.filter;ff({target:"Array",proto:!0,forced:!tp("filter")},{filter:function(e){return RC(this,e,arguments.length>1?arguments[1]:void 0)}});var xC=Pl,OC=qu,LC=Xl,NC=Td,MC=Hp,UC=Ql,BC=Bc,FC=ab,HC=Tb;rb("match",(function(e,t,i){return[function(t){var i=UC(this),n=LC(t)?void 0:BC(t,e);return n?xC(n,t,i):new RegExp(t)[e](MC(i))},function(e){var n=OC(this),r=MC(e),o=i(t,n,r);if(o.done)return o.value;if(!n.global)return HC(n,r);var a=n.unicode;n.lastIndex=0;for(var s,l=[],c=0;null!==(s=HC(n,r));){var u=MC(s[0]);l[c]=u,""===u&&(n.lastIndex=FC(r,NC(n.lastIndex),a)),c++}return 0===c?null:l}]}));var jC=Wu.f,VC=bl,KC=El,GC=Fl,WC=of,YC=Kg,zC=uh,$C=ud.f,XC=dc,qC=qb,ZC=Hp,QC=cg,JC=JT,ek=function(e,t,i){i in e||jC(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})},tk=cd,ik=Sl,nk=nu,rk=Wh.enforce,ok=iv,ak=IS,sk=wS,lk=mu("match"),ck=KC.RegExp,uk=ck.prototype,hk=KC.SyntaxError,dk=GC(uk.exec),fk=GC("".charAt),pk=GC("".replace),gk=GC("".indexOf),yk=GC("".slice),vk=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,mk=/a/g,_k=/a/g,Ek=new ck(mk)!==mk,Tk=JC.MISSED_STICKY,Sk=JC.UNSUPPORTED_Y,bk=VC&&(!Ek||Tk||ak||sk||ik((function(){return _k[lk]=!1,ck(mk)!=mk||ck(_k)==_k||"/a/i"!=ck(mk,"i")})));if(WC("RegExp",bk)){for(var Ck=function(e,t){var i,n,r,o,a,s,l=XC(uk,this),c=qC(e),u=void 0===t,h=[],d=e;if(!l&&c&&u&&e.constructor===Ck)return e;if((c||XC(uk,e))&&(e=e.source,u&&(t=QC(d))),e=void 0===e?"":ZC(e),t=void 0===t?"":ZC(t),d=e,ak&&"dotAll"in mk&&(n=!!t&&gk(t,"s")>-1)&&(t=pk(t,/s/g,"")),i=t,Tk&&"sticky"in mk&&(r=!!t&&gk(t,"y")>-1)&&Sk&&(t=pk(t,/y/g,"")),sk&&(o=function(e){for(var t,i=e.length,n=0,r="",o=[],a={},s=!1,l=!1,c=0,u="";n<=i;n++){if("\\"===(t=fk(e,n)))t+=fk(e,++n);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:dk(vk,yk(e,n+1))&&(n+=2,l=!0),r+=t,c++;continue;case">"===t&&l:if(""===u||nk(a,u))throw new hk("Invalid capture group name");a[u]=!0,o[o.length]=[u,c],l=!1,u="";continue}l?u+=t:r+=t}return[r,o]}(e),e=o[0],h=o[1]),a=YC(ck(e,t),l?this:uk,Ck),(n||r||h.length)&&(s=rk(a),n&&(s.dotAll=!0,s.raw=Ck(function(e){for(var t,i=e.length,n=0,r="",o=!1;n<=i;n++)"\\"!==(t=fk(e,n))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+fk(e,++n);return r}(e),i)),r&&(s.sticky=!0),h.length&&(s.groups=h)),e!==d)try{zC(a,"source",""===d?"(?:)":d)}catch(dF){}return a},kk=$C(ck),Ik=0;kk.length>Ik;)ek(Ck,ck,kk[Ik++]);uk.constructor=Ck,Ck.prototype=uk,tk(KC,"RegExp",Ck,{constructor:!0})}ok("RegExp");var Pk="undefined"!=typeof window&&window.location.href.indexOf("loggerdebug")>-1;function Dk(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=0,i=0;i<e.length;i++){var n=e[i].end,r=e[i].begin;Number.isNaN(Number(n))||Number.isNaN(Number(r))||r<0||n<0||n<r||(t+=e[i].end-e[i].begin)}return t=parseInt(1e3*t,10)}function wk(e){if(null==e||""===e||"string"!=typeof e)return"";var t=e.split("/"),i="";return t.length>3&&t[2]&&(i=t[2]),i}function Ak(e){var t={};if(e instanceof window.XMLHttpRequest)try{e.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var i=e.split(": "),n=i.shift(),r=i.join(": ");t[n]=r}))}catch(dF){return t}return t}function Rk(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];Pk&&(t=console).log.apply(t,["[logger]",e].concat(n))}function xk(){try{return Math.round(window.performance.now())}catch(dF){return(new Date).getTime()}}function Ok(){return(new Date).getTime()}function Lk(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(i,n){try{e||n(new Error("url is undefined"));var r=xk(),o=r,a={},s=new window.XMLHttpRequest;s.open("get",e),s.onreadystatechange=function(){2===s.readyState&&(a.headers=Ak(s),a.connectTime=xk()-o,a.status=s.status,a.statusText=s.statusText,r=xk())},s.onload=function(){i(a)},s.onprogress=function(e){var t,i=xk()-r;t=parseInt(e.loaded/1e3/(i/1e3),10),a.speed=0|t,a.costTime=i},s.onerror=function(){a.status||(a.status=-1,a.costTime=xk()-r),n(a)},s.ontimeout=function(){a.status||(a.status=-2,a.costTime=xk()-r),i(a)},s.onabort=function(){i(a)},s.responseType="arraybuffer",s.timeout=t.timeout||1e4,s.setRequestHeader("Range","bytes=".concat(t.range||"0-1048576")),s.send()}catch(ds){n(ds)}}))}function Nk(e){return!e||window.location.href.indexOf(e)>-1}function Mk(e){return!!e&&/^blob:/.test(e)}var Uk={x_response_sinfo:"x-response-sinfo",x_response_cache:"x-response-cache",x_response_cinfo:"x-response-cinfo"};function Bk(e){if(!e)return{};var t={};return Object.keys(Uk).map((function(i){if(e[i]||"string"!=typeof Uk[i]){if(!e[i]&&Uk[i]instanceof Array){var n=Uk[i].filter((function(t){return void 0!==e[t]}));n.length>0?t[i]=e[n[0]]:t[i]=""}}else t[i]=e[Uk[i]]||""})),t}function Fk(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function Hk(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(ds){var i=e.className&&"object"===dl(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)".concat(t,"(\\s|$)")))}}function jk(e){return"String"===Fk(e)?e.replace("P","p"):e?"Number"===Fk(e)?"".concat(e):void 0:""}function Vk(e){try{return JSON.stringify(e)}catch(ds){return""}}var Kk=0,Gk=1,Wk=2;function Yk(e,t){return Math.round(t/e*1e3*100)}var zk=[];"undefined"!=typeof window&&function(){try{var e=new window.PerformanceObserver((function(e){var t=e.getEntriesByType("resource");zk.length>30&&zk.splice(0,zk.length-30);for(var i=0;i<t.length;i++)zk.push(t[i])}));e.observe({entryTypes:["resource"]})}catch(ds){console.warn("PerformanceObserver not support",ds)}}();var $k="videoplayer_oneplay",Xk="videoplayer_oneopera",qk="videoplayer_oneerror",Zk="videoplayer_oneevent",Qk="videoplayer_onetemp",Jk={data:1e3,runtime:1002,parse:1004,network:1003,no_error_handler:9997,custom_error:9998,other:9999,notSupport:1005},eI={1:-499991,2:-499992,3:-499993,4:-499994,5:-499995},tI=0,iI=1,nI=2,rI=3,oI=4,aI=0,sI=1,lI=2,cI=3,uI=1,hI=2,dI=3,fI=4,pI=5,gI=6,yI=7,vI="error_retry",mI="oneerror",_I="oneevent",EI="onetemp",TI=0,SI=1,bI=864e5,CI=36e5,kI=["tag","subtag","device_type"],II={NO_FULLSCREEN:0,FULLSCREEN:1,CSS:2};var PI=function(){try{return"undefined"!=typeof localStorage&&"setItem"in window.localStorage&&!!window.localStorage.setItem}catch(ds){return!1}}()&&!function(){var e="_localstorage_support_test";try{return window.localStorage.setItem(e,!0),window.localStorage.removeItem(e),!1}catch(ds){return!0}}()?window.localStorage:{},DI="__xgplayerlogkey",wI={set:function(e){try{var t=this.get();t.push(e),PI.setItem(DI,JSON.stringify(t))}catch(dF){}},get:function(){try{var e=PI.getItem(DI);return e=e?JSON.parse(e):[]}catch(dF){return[]}},remove:function(){try{PI.removeItem(DI)}catch(dF){}},clear:function(){try{PI.clear()}catch(dF){}}},AI={},RI=Kl,xI=tc,OI=ud.f,LI=iC,NI="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];AI.f=function(e){return NI&&"Window"==RI(e)?function(e){try{return OI(e)}catch(dF){return LI(NI)}}(e):OI(xI(e))};var MI={},UI=mu;MI.f=UI;var BI=El,FI=nu,HI=MI,jI=Wu.f,VI=Pl,KI=hc,GI=mu,WI=cd,YI=ff,zI=El,$I=Pl,XI=Fl,qI=bl,ZI=bc,QI=Sl,JI=nu,eP=dc,tP=qu,iP=tc,nP=wu,rP=Hp,oP=Ll,aP=bS,sP=Np,lP=ud,cP=AI,uP=Bd,hP=Tl,dP=Wu,fP=eS,pP=Dl,gP=cd,yP=Zc,vP=Rh,mP=lu,_P=mu,EP=MI,TP=function(e){var t=BI.Symbol||(BI.Symbol={});FI(t,e)||jI(t,e,{value:HI.f(e)})},SP=function(){var e=KI("Symbol"),t=e&&e.prototype,i=t&&t.valueOf,n=GI("toPrimitive");t&&!t[n]&&WI(t,n,(function(e){return VI(i,this)}),{arity:1})},bP=Zy,CP=Wh,kP=Rp.forEach,IP=Ah("hidden"),PP="Symbol",DP="prototype",wP=CP.set,AP=CP.getterFor(PP),RP=Object[DP],xP=zI.Symbol,OP=xP&&xP[DP],LP=zI.TypeError,NP=zI.QObject,MP=hP.f,UP=dP.f,BP=cP.f,FP=pP.f,HP=XI([].push),jP=yP("symbols"),VP=yP("op-symbols"),KP=yP("wks"),GP=!NP||!NP[DP]||!NP[DP].findChild,WP=qI&&QI((function(){return 7!=aP(UP({},"a",{get:function(){return UP(this,"a",{value:7}).a}})).a}))?function(e,t,i){var n=MP(RP,t);n&&delete RP[t],UP(e,t,i),n&&e!==RP&&UP(RP,t,n)}:UP,YP=function(e,t){var i=jP[e]=aP(OP);return wP(i,{type:PP,tag:e,description:t}),qI||(i.description=t),i},zP=function(e,t,i){e===RP&&zP(VP,t,i),tP(e);var n=nP(t);return tP(i),JI(jP,n)?(i.enumerable?(JI(e,IP)&&e[IP][n]&&(e[IP][n]=!1),i=aP(i,{enumerable:oP(0,!1)})):(JI(e,IP)||UP(e,IP,oP(1,{})),e[IP][n]=!0),WP(e,n,i)):UP(e,n,i)},$P=function(e,t){tP(e);var i=iP(t),n=sP(i).concat(QP(i));return kP(n,(function(t){qI&&!$I(XP,i,t)||zP(e,t,i[t])})),e},XP=function(e){var t=nP(e),i=$I(FP,this,t);return!(this===RP&&JI(jP,t)&&!JI(VP,t))&&(!(i||!JI(this,t)||!JI(jP,t)||JI(this,IP)&&this[IP][t])||i)},qP=function(e,t){var i=iP(e),n=nP(t);if(i!==RP||!JI(jP,n)||JI(VP,n)){var r=MP(i,n);return!r||!JI(jP,n)||JI(i,IP)&&i[IP][n]||(r.enumerable=!0),r}},ZP=function(e){var t=BP(iP(e)),i=[];return kP(t,(function(e){JI(jP,e)||JI(vP,e)||HP(i,e)})),i},QP=function(e){var t=e===RP,i=BP(t?VP:iP(e)),n=[];return kP(i,(function(e){!JI(jP,e)||t&&!JI(RP,e)||HP(n,jP[e])})),n};ZI||(gP(OP=(xP=function(){if(eP(OP,this))throw LP("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?rP(arguments[0]):void 0,t=mP(e),i=function(e){this===RP&&$I(i,VP,e),JI(this,IP)&&JI(this[IP],t)&&(this[IP][t]=!1),WP(this,t,oP(1,e))};return qI&&GP&&WP(RP,t,{configurable:!0,set:i}),YP(t,e)})[DP],"toString",(function(){return AP(this).tag})),gP(xP,"withoutSetter",(function(e){return YP(mP(e),e)})),pP.f=XP,dP.f=zP,fP.f=$P,hP.f=qP,lP.f=cP.f=ZP,uP.f=QP,EP.f=function(e){return YP(_P(e),e)},qI&&(UP(OP,"description",{configurable:!0,get:function(){return AP(this).description}}),gP(RP,"propertyIsEnumerable",XP,{unsafe:!0}))),YI({global:!0,constructor:!0,wrap:!0,forced:!ZI,sham:!ZI},{Symbol:xP}),kP(sP(KP),(function(e){TP(e)})),YI({target:PP,stat:!0,forced:!ZI},{useSetter:function(){GP=!0},useSimple:function(){GP=!1}}),YI({target:"Object",stat:!0,forced:!ZI,sham:!qI},{create:function(e,t){return void 0===t?aP(e):$P(aP(e),t)},defineProperty:zP,defineProperties:$P,getOwnPropertyDescriptor:qP}),YI({target:"Object",stat:!0,forced:!ZI},{getOwnPropertyNames:ZP}),SP(),bP(xP,PP),vP[IP]=!0;var JP=bc&&!!Symbol.for&&!!Symbol.keyFor,eD=ff,tD=hc,iD=nu,nD=Hp,rD=Zc,oD=JP,aD=rD("string-to-symbol-registry"),sD=rD("symbol-to-string-registry");eD({target:"Symbol",stat:!0,forced:!oD},{for:function(e){var t=nD(e);if(iD(aD,t))return aD[t];var i=tD("Symbol")(t);return aD[t]=i,sD[i]=t,i}});var lD=ff,cD=nu,uD=wc,hD=Rc,dD=JP,fD=Zc("symbol-to-string-registry");lD({target:"Symbol",stat:!0,forced:!dD},{keyFor:function(e){if(!uD(e))throw TypeError(hD(e)+" is not a symbol");if(cD(fD,e))return fD[e]}});var pD=ff,gD=hc,yD=vv,vD=Pl,mD=Fl,_D=Sl,ED=gf,TD=oc,SD=lc,bD=wc,CD=_v,kD=bc,ID=gD("JSON","stringify"),PD=mD(/./.exec),DD=mD("".charAt),wD=mD("".charCodeAt),AD=mD("".replace),RD=mD(1..toString),xD=/[\uD800-\uDFFF]/g,OD=/^[\uD800-\uDBFF]$/,LD=/^[\uDC00-\uDFFF]$/,ND=!kD||_D((function(){var e=gD("Symbol")();return"[null]"!=ID([e])||"{}"!=ID({a:e})||"{}"!=ID(Object(e))})),MD=_D((function(){return'"\\udf06\\ud834"'!==ID("\udf06\ud834")||'"\\udead"'!==ID("\udead")})),UD=function(e,t){var i=CD(arguments),n=t;if((SD(t)||void 0!==e)&&!bD(e))return ED(t)||(t=function(e,t){if(TD(n)&&(t=vD(n,this,e,t)),!bD(t))return t}),i[1]=t,yD(ID,null,i)},BD=function(e,t,i){var n=DD(i,t-1),r=DD(i,t+1);return PD(OD,e)&&!PD(LD,r)||PD(LD,e)&&!PD(OD,n)?"\\u"+RD(wD(e,0),16):e};ID&&pD({target:"JSON",stat:!0,arity:3,forced:ND||MD},{stringify:function(e,t,i){var n=CD(arguments),r=yD(ND?UD:ID,null,n);return MD&&"string"==typeof r?AD(r,xD,BD):r}});var FD=Bd,HD=eu;ff({target:"Object",stat:!0,forced:!bc||Sl((function(){FD.f(1)}))},{getOwnPropertySymbols:function(e){var t=FD.f;return t?t(HD(e)):[]}});var jD=ff,VD=bl,KD=El,GD=Fl,WD=nu,YD=oc,zD=dc,$D=Hp,XD=Wu.f,qD=Xd,ZD=KD.Symbol,QD=ZD&&ZD.prototype;if(VD&&YD(ZD)&&(!("description"in QD)||void 0!==ZD().description)){var JD={},ew=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:$D(arguments[0]),t=zD(QD,this)?new ZD(e):void 0===e?ZD():ZD(e);return""===e&&(JD[t]=!0),t};qD(ew,ZD),ew.prototype=QD,QD.constructor=ew;var tw="Symbol(test)"==String(ZD("test")),iw=GD(QD.valueOf),nw=GD(QD.toString),rw=/^Symbol\((.*)\)[^)]+$/,ow=GD("".replace),aw=GD("".slice);XD(QD,"description",{configurable:!0,get:function(){var e=iw(this);if(WD(JD,e))return"";var t=nw(e),i=tw?aw(t,7,-1):ow(t,rw,"$1");return""===i?void 0:i}}),jD({global:!0,constructor:!0,forced:!0},{Symbol:ew})}var sw=[{key:"QQBrowser",reg:/(qqbrowser)\/([\d.]+)/},{key:"QIHU360EE",reg:/qihu 360ee/},{key:"QIHU360SE",reg:/qihu 360se/},{key:"2345Explorer",reg:/(2345explorer)\/([\d.]+)/},{key:"Sogou",reg:/(metasr)/},{key:"Wexin",reg:/(micromessenger)\/([\d.]+)/},{key:"Openlanguage",reg:/(openlanguage)\/([\d.]+)/},{key:"NewsArticle",reg:/(newsarticle)\/([\d.]+)/},{key:"VideoArticle",reg:/(videoarticle)\/([\d.]+)/},{key:"Hotsoon",reg:/(live_stream)_([\d.]+)/},{key:"Aweme",reg:/(aweme)_([\d.]+)/},{key:"Lark",reg:/(lark)\/([\d.]+)/},{key:"PlayStation",reg:/(playstation)/},{key:"BingPreview",reg:/(bingpreview)\/([\d.]+)/},{key:"Baiduspider",reg:/(baiduspider-render)\/([\d.]+)/},{key:"YandexBot",reg:/(yandexbot)\/([\d.]+)/},{key:"Chrome",reg:/(chrome)\/([\d.]+)/},{key:"Safari",reg:/(version)\/([\d.]+)\s*(safari)/}],lw=[{key:"Trident",reg:/(rv:)([\d.]+)/},{key:"Trident",reg:/(msie)\s*([\d.]+)/}],cw=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"];var uw=["Baiduspider","YandexBot"],hw=["Baiduspider","googlebot","360Spider","haosouspider","YoudaoBot","Sogou News Spider","Yisouspider","Googlebot","Headless","Applebot","Bingbot","PetalBot"];var dw="undefined"!=typeof navigator&&function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e=e.toLocaleLowerCase();var t=/(iphone)/.test(e)||/(ipad)/.test(e),i=/(android)/.test(e),n=/(windows phone)/.test(e),r=t||i||n,o={isIOS:t,isAndroid:i,isMobile:r,isPC:!r,isPad:/(ipad)/.test(e)},a=function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;var t=document.createElement("video");return"function"==typeof t.canPlayType?(cw.map((function(i){"probably"===t.canPlayType('video/mp4; codecs="'.concat(i,'"'))&&(e.isSupport=!0,e.mime+="||".concat(i))})),e):(t=null,e)}();o.isSupportMP4=a.isSupport,o.mime=a.mime;var s="",l=0,c=[],u=sw;/trident/.test(e)&&(u=lw);for(var h=0;h<u.length;h++)if(c=u[h].reg.exec(e)){s=u[h].key,l=c.length>2?c[2]:"";break}if(s)o["is".concat(s)]=!0,o.name=s,o.appVersion=l;else{var d=function(){var e=navigator.mimeTypes;if(e){for(var t=0;t<e.length;t++){if(e[t].type&&e[t].type.indexOf("360")>-1)return!0;if(e[t].type&&e[t].type.indexOf("application/vnd.chromium.remoting-viewer")>-1)return!0;if(e[t].description&&e[t].description.indexOf("360")>-1)return!0}return!1}}();d&&(o.name="360EE")}return o.name&&"Trident"!==o.name&&/(trident)/.exec(e)&&(o.name=o.name?"".concat(o.name,"_Trident"):"Trident"),o.isSpider=function(e,t){var i=!1;uw.map((function(t){t===e&&(i=!0)}));for(var n=0;n<hw.length;n++){var r=hw[n];if(-1!==t.indexOf(r)){i=!0;break}}return i}(o.name,e),o}(navigator.userAgent);function fw(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))}var pw=[1,1,1,1,1];function gw(){return parseInt(pw.join(""),10)}pw[0]=dw.isSupportMP4?pw[1]+1:pw[1],pw[1]=fw()?pw[1]+1:pw[1],function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var i=e.video||{},n=e.audio||{};try{var r=MediaSource.isTypeSupported(i.contentType),o=MediaSource.isTypeSupported(n.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(ds){return Promise.resolve(t)}}({type:"file",video:{contentType:'video/mp4;codecs="hev1.1.6.L120.90"',width:1920,height:1080,bitrate:1e4,framerate:30}}).then((function(e){e&&e.supported?pw[2]=pw[2]+1:pw[2]=1})).catch((function(){pw[2]=pw[2]-1}));var yw={range:"0-1048576",timer:6e4,timeout:15e3},vw=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};fl(this,e),Object.keys(yw).map((function(e){void 0!==t[e]&&null!==t[e]||(t[e]=yw[e])})),this.options=t,this._headers={},this.intervalId=null,this.ishangUp=!1,this._data={contentLength:0,statusText:"",status:-1,speed:0,costTime:0,connectTime:0,contentType:""},this.url=[]}return gl(e,[{key:"setData",value:function(e){var t=this;if(Object.keys(e).map((function(i){"headers"!==i&&(t._data[i]=e[i])})),e.headers&&Object.keys(e.headers).length>0){this._headers=Bk(e.headers),e.headers["content-type"]&&(this._data.contentType=e.headers["content-type"]);var i=(e.headers["content-range"]||"").split("/");i&&i.length>1&&(this._data.contentLength=parseInt(i[1]))}}},{key:"contentLength",get:function(){return this._data.length||0}},{key:"trigger",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start",n=this.options;this.url=e,!this.url||"start"!==i&&(this.ishangUp||this.intervalId)?Rk("task>>cant`t trigger url",this.ishangUp,this.intervalId):(Rk("task>>trigger url ",e),this.ishangUp=!0,this.intervalId&&this.clear(),this.intervalId=setTimeout((function(){t.clear()}),"start"===i?500:n.timer),Lk(this.url,{range:"start"===i?"0-1024":n.range,timeout:n.timeout}).then((function(e){Rk("getXhr>>check result ",e),t.setData(e||{}),t.ishangUp=!1})).catch((function(e){Rk("getXhr>>error ",e),t.ishangUp=!1,t._data.status=-1})))}},{key:"url",get:function(){return this.options.url},set:function(e){e&&(this.options.url=e)}},{key:"serverIp",get:function(){return this._headers.x_response_sinfo||""}},{key:"headers",get:function(){return this._headers||{}}},{key:"status",get:function(){return this._data.status||-1}},{key:"speed",get:function(){return this._data.speed}},{key:"clear",value:function(){clearTimeout(this.intervalId),this.intervalId=null}}]),e}(),mw="ProgressInfo";var _w=function(){function e(){fl(this,e),this._init()}return gl(e,[{key:"_init",value:function(){this.played=[],this.playedSize=0,this.cachedSize=0,this.pcdnCached=0,this.cachedVideoSize=0,this.pcdnVideoCached=0,this.file={audio:0,video:0},this.lastBitrate=null,this.curBitrate={vBitrate:0,aBitrate:0,cdnSize:0,pcdnSize:0,definition:"",fileid:""},this.nextBitrate={start:-1},this.currentTime=0,this.buffered=[],this.cachedTime=0,this.duration=0}},{key:"reset",value:function(){this._init()}},{key:"getFileSize",value:function(e){var t=this.curBitrate,i=t.vBitrate,n=t.aBitrate;return{audio:Math.round(e*n/8),video:Math.round(e*i/8),total:Math.round(e*(i+n)/8)}}},{key:"updatePlayed",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=this.played,n=i.length;if(0===t||n<1){var r=n>0?i[n-1]:null,o=this.curBitrate,a=o.vBitrate,s=o.aBitrate;r&&(r.end<0||r.end-r.start<1)?(r.end<0?r.start=e:r.end=e,r.vBitrate=a,r.aBitrate=s):i.push({start:e,end:-1,vBitrate:a,aBitrate:s})}else i[n-1].end=e}},{key:"calculatePlaySize",value:function(){var e=this.played,t=this.curBitrate,i=function(e){for(var t=0,i=0;i<e.length;i++){var n=e[i];n.end<0||(t+=n.end-n.start)}return t}(e),n=Math.round((t.aBitrate+t.vBitrate)*i/8);return this.playedSize+=n,Rk(mw,"calculatePlaySize","duration: ".concat(i," playedSize:").concat(this.playedSize),this.played),this.played=[],this.playedSize}},{key:"copyBitrateInfo",value:function(e,t){return["aBitrate","vBitrate","definition","fileid","cdnSize","pcdnSize"].forEach((function(i){e[i]&&(t[i]=e[i])})),t.cdnSize=e.cdnSize,t.pcdnSize=e.pcdnSize,t}},{key:"checkNextBitrate",value:function(e){var t=this.nextBitrate;if(t.start>-1&&e>=t.start){var i=this.curBitrate;this.calculatePlaySize(),Rk(mw,"checkNextBitrate",e,t.start,this.cachedSize),this.copyBitrateInfo(t,i),this.updatePlayed(e,0),t.start=-1,t.fileid="",["vBitrate","aBitrate","cdnSize","pcdnSize"].forEach((function(e){t[e]=0}))}}},{key:"updateLastDefInfo",value:function(){var e=this.curBitrate;if(e.vBitrate>0){var t={};this.copyBitrateInfo(e,t),this.lastBitrate=t}}},{key:"updateDefInfo",value:function(e,t){Rk(mw,"updateDefInfo",t,this.curBitrate.vBitrate,e);var i=e.mediaType,n=e.start,r=e.bitrate,o=e.definition,a=e.fileid,s={cdnSize:0,pcdnSize:0};"audio"===i?s.aBitrate=r:(s.vBitrate=r,s.definition=o,s.fileid=a,this.updateLastDefInfo()),s.start=n,this.nextBitrate=s,this.checkNextBitrate(t)}},{key:"upDateDownload",value:function(e){var t=e.cdn_size,i=e.pcdn_size,n=e.mediaType,r=this.curBitrate,o=this.nextBitrate,a=0,s=0;i?(a=1,s=i):t&&(s=t),this.cachedSize+=s,"video"===n&&(this.cachedVideoSize+=s,a>0&&(this.pcdnVideoCached+=s)),a>0&&(this.pcdnCached+=s);var l=o.start>=0?o:r;l.cdnSize+=s,a>0&&(l.pcdnSize+=s)}},{key:"updateBuffered",value:function(e){var t=function(e){var t=[];if(!e||e.length<1)return t;for(var i=0;i<e.length;i++){var n=parseInt(1e3*e.start(i),10)/1e3,r=parseInt(1e3*e.end(i),10)/1e3;t.push({start:n,end:r})}return t}(e),i=0;t.forEach((function(e){var t,n;i+=(t=e.end,n=e.start,parseInt(1e3*t-1e3*n,10)/1e3)})),this.buffered=t,this.cachedTime=i}},{key:"isDefInfoFirstChange",value:function(){return!(this.curBitrate&&this.curBitrate.vBitrate>0)}}]),e}();const Ew="0.12.10";var Tw=["try_req_num","req_node_succ","conn_req_num","has_ret_node","conn_fail_num","conn_jump_num"];Rk("xgVodLogger version is ".concat(Ew));var Sw,bw=(Sw="Object",function(e){return Object.prototype.toString.call(e)==="[object ".concat(Sw,"]")}),Cw=1300,kw="__tea_cache_tokens_".concat(Cw),Iw="",Pw=null,Dw=function(){function e(t,i){var n=this;if(fl(this,e),yl(this,"initializeUrlLog",(function(e){var t=e&&e.url?e.url:"String"===Fk(e)?e:"";"String"!==Fk(t)&&(t=""),n.urlLog={initial_url:t,initial_host:wk(t),initial_ip:""}})),yl(this,"onXgLogCache",(function(){var e,t=n._getLogCache();t&&(n._templog={vtype:null===(e=n.player)||void 0===e?void 0:e.vtype,log:t},n.onOneTemp())})),yl(this,"onPrfDataSize",(function(e){n._progressInfo.upDateDownload(e)})),yl(this,"onDegrade",(function(e){e&&(e.local_time=(new Date).getTime(),n.onOneEvent({end_type:"degrade"},e))})),yl(this,"onMediaFormatError",(function(e){n.onOneEvent({end_type:"".concat(e.error_type||"","Error")})})),yl(this,"onReplayBtnClick",(function(){n.resetLoggerParams()})),yl(this,"onBeforeDefinitionChange",(function(){n.resLogs.ldst=xk(),n._endType="switch"})),yl(this,"onDefinitionChangeDetail",(function(e){var t=n._progressInfo;t.updateDefInfo(e,n.player.currentTime),t.lastBitrate&&"video"===e.mediaType&&n.sendSwitchOpera("changedetail")})),yl(this,"onDefinitionChange",(function(e){var t=e.from,i=e.to;n.changeResolution({from:t,to:i,startTime:n.resLogs.ldst,operaType:"switch"}),Rk("onDefinitionChange from:".concat(t,", to:").concat(i))})),yl(this,"onDefiChangeSuccess",(function(){Rk("onDefinitionChangeSuccess"),n.updateVideoSize(),n.triggerTask("start")})),yl(this,"onAbrChange",(function(e){var t=e.prev,i=e.cur,r=e.abrInfo;if(n.player.abrInstance){var o=n.player.abrInstance.eventInfo;Rk("abrChange",o),o.last_definition=t,o.now_definition=i,n.abrInfo.abr_event_info.video_switch.push(o),n.changeResolution({from:t,to:i,startTime:xk(),operaType:"abr_switch",abrInfo:r})}})),yl(this,"onTimeUpdate",(function(){var e=n.playlogs,t=n.resLogs,i=n.player;if(n.errorLog.try_err_c=0,e.vt||1!==n.startStep||(e.vt=Ok(),Rk("onTimeUpdate: first frame inited","currentTime11:".concat(i.currentTime," vt-pt:").concat(e.vt-e.pt," vt-nt:").concat(e.vt-e.nt," vt-rt:").concat(e.vt-e.rt)),n.startStep=2),!t.initial_resolution){var r=i.currentDefitionFromPlayer&&i.currentDefitionFromPlayer.definition?i.currentDefitionFromPlayer.definition:i.config.defaultDefinition||"".concat(i.video.videoHeight,"p")||"";r=jk(r),t.initial_resolution=r}t.final_resolution||(t.final_resolution=t.initial_resolution);var o=e.played.length;o<1?e.played.push({begin:i.currentTime,end:-1}):e.played[o-1].end=i.currentTime,n._progressInfo.updatePlayed(i.currentTime),n._progressInfo.checkNextBitrate(i.currentTime);var a=t.played.length;a<1?t.played.push({begin:i.currentTime,end:-1}):t.played[a-1].end=i.currentTime,n.lastVideoTime=i.currentTime||0})),yl(this,"onVideoProgress",(function(){n.updateBuffers(),n._progressInfo.updateBuffered(n.player.buffered)})),yl(this,"onCanplay",(function(){Rk("onCanplay","this.startStep:".concat(n.startStep," ").concat(Ok())),n.setVt()})),yl(this,"onLoadeddata",(function(){Rk("onLoadeddata","this.startStep:".concat(n.startStep," ").concat(Ok())),n.setVt(),n.updateVideoSize()})),yl(this,"onLoadStart",(function(){n.commonParams.web_url=location.href;var e=Nk(n.player.currentSrc);n.triggerTask("start"),Rk("onLoadStart","this.startStep:".concat(n.startStep," ").concat(Ok()," isSrcEmpty:").concat(e," player.src:").concat(n.player.src)),0!==n.startStep||e||"visible"!==document.visibilityState||n.setPt()})),yl(this,"onBufferedChange",(function(){var e=n.player.video&&n.player.video.buffered;if(e){var t=e.length;t>0&&e.end(t-1)+1>n.player.duration&&(n.bft=Ok())}})),yl(this,"onPlayerInited",(function(){Rk("player init"),n._playerCreatedTime=Ok(),n.playlogs.rt=Ok()})),yl(this,"onNotAutoPlay",(function(){Rk("onNotAutoPlay","autoplay:".concat(n.isAutoplay)),0===n.isAutoplay?n.isAutoplay=2:1===n.isAutoplay&&(n.isAutoplay=3)})),yl(this,"onPlayerError",(function(e){e=e||{};var t=n.errorLog,i=n.player;if(Rk("onPlayerError","this.player.type:".concat(n.player.type," this.player.replayRunning:").concat(n.player.replayRunning," isSupportMP4:").concat(dw.isSupportMP4," isPC:").concat(dw.isPC)),Rk("onPlayerError",e),n.load_state=cI,n._endType="error",n.suspendWaitingStatus("onPlayerError"),n._progressInfo.calculatePlaySize(),"dash"!==i.type||!i.replayRunning){if(e.url||(e.url=n.player.currentSrc),dw.isPC&&!dw.isSupportMP4||dw.isSpider)return t.errc=eI[5],t.errt=Jk.notSupport,n.onOneError({errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0),void(n._isOnePlayReport=!0);t.errt=e.errorTypeCode||(e.errorType&&Jk[e.errorType]?Jk[e.errorType]:9999),t.message=e.message||"",e.errorCode?t.errc=e.errorCode>0&&eI[e.errorCode]?eI[e.errorCode]:e.errorCode:e.code&&(t.errc=e.code>0&&eI[e.code]?eI[e.code]:e.code),t.last_errors.push(t.errc),0===t.fir_errc&&(t.fir_errc=t.errc),n.sendSwitchOpera(uI),n.onOnePlay(uI),n.onOneTemp(uI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade);var r=!1,o=e.mediaError;o&&n._options.needXhrCheck&&(4===o.code||2===o)&&(r=!0),n.onOneError({endState:yI,errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0,r),n.sendEventsQueue()}})),yl(this,"onPlayInterfaceInfo",(function(e){Rk("onPlayInterfaceInfo",e);var t=n.errorLog,i=n.apiLog,r=n.playlogs;if(e&&Object.keys(e).map((function(t){"code"===t?i.vsc=e[t]:"message"===t?i.vsc_message=e.message||"success,视频可正常播放":i[t]=e[t]})),r.at=e.timestamep||(new Date).getTime(),(!e.error||-9988!==e.error.errc)&&(i.vsc=e.code||10,i.vsc_message=e.message||"success,视频可正常播放",e.error)){var o=e.error;t.errt=1e3,t.errc=o.errc||-9998,t.last_errors.push(o.errc||-9998),0===t.fir_errc&&(t.fir_errc=o.errc||-9998),t.accu_errc++,1===t.accu_errc&&(t.fir_errt=xk()),n.onOneError({errorType:1e3,code:o.errc||-9998,url:"",headers:{}})}})),yl(this,"onProgressEvent",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.netLog;if(e.speed){var i=e.speed>1e6?Math.floor(e.speed/1e3):e.speed;t.downloadSpeed=i,t.totalSpeed+=i,t.rqCount++}"oversize"!==e.type&&t.requestCount++,e.connectTime&&(t.connectCost=e.connectTime);var r=t.rqCount<7?100:e.costTime>=5e3?20:10;if(!("success"===e.type&&parseInt(100*Math.random(),10)<=r)){var o=function(e){var t={};try{e=e.replace(/^http:|^https:/,"");for(var i=zk||[],n=function(n){if(i[n].name.replace(/^http:|^https:/,"")===e)return["domainLookupEnd","domainLookupStart","startTime","requestStart","responseEnd","responseStart","connectStart","connectEnd","fetchStart"].map((function(e){t[e]=Math.round(i[n][e])})),t.url=i[n].name,t.duration=Math.round(i[n].duration),t.domainDuration=t.domainLookupEnd-t.domainLookupStart,t.connectDuration=t.connectEnd-t.connectStart,"break"},r=i.length-1;r>=0&&"break"!==n(r);r--);return t}catch(ds){return t}}(e.cdnUrl),a=e.xhr||{},s=e.type?"progress_".concat(e.type):"progress",l=e.headers;l||(l=Ak(a));var c=hl(hl({},l=Bk(l)),{},{download_speed:t.downloadSpeed,connect_cost:t.connectCost,c_dur:o.connectDuration||0,d_dur:o.domainDuration||0,r_dur:o.duration||0,rqtt:(new Date).getTime(),x_cache:l.x_response_cache||"",server_ip:l.x_response_sinfo});e.status?t.status=e.status:a&&a instanceof window.XMLHttpRequest&&(t.status=a.status||0),c.status=t.status;var u=e.cdnUrl||e.url;"error"===e.type&&n.merror.cdn.push(hl(hl({costTime:e.costTime,cur_play_pos:e.pos,cdn_url:u,cdn_host:wk(u)},c),l)),n.onOneEvent({costTime:e.costTime,vid:e.vid,end_type:s,cur_play_pos:e.pos,cdn_url:u,cdn_host:wk(u)},c,"error"===e.type?0:2)}})),yl(this,"onNext",(function(){if(Rk("onNext:startStep:",n.startStep),n.startStep>0){if(n._reportInvalidVV(hI))return;n.sendSwitchOpera(hI),n.onOnePlay(hI),n.onOneTemp(hI),n.sendEventsQueue()}n.vtype=null,n.playlogs.lc=0,n.resetLoggerParams()})),yl(this,"onNextEnded",(function(){var e=n.player,t=n.resLogs,i=jk(e.config.defaultDefinition||"");t.initial_resolution=i,t.final_resolution=i})),yl(this,"onXgLogWaiting",(function(e){var t=n.playlogs,i=n.resLogs,r=n.stall;if(n._options.checkByInnerLog&&0===e.type){Rk("onXgLogWaiting",e);var o=e.endType,a=e.costTime,s=e.start,l={download_speed:n.realSpeed,avg_speed:n.avgSpeed,mse_op:n.mp4MseOpLength,mp4_load_range:n.mp4LoadSegmentTimeRange,bitrate:n.curBitrate};if("waitingStart"===e.eventType)return n.onOneEvent({costTime:a,end_type:"waitstart"},l,2),void n.appendStallInfo("start",s);if("waitingEnd"===e.eventType){var c=xk();Rk("onXgLogWaiting>>".concat(o,"|costTime:").concat(a," vt:").concat(t.vt)),n.appendStallInfo("end",c,o),t.bc++,n.checkInBuffer(n.player.currentTime)?(t.de_bu_acu_t+=a,t.dbc++):(t.nbc++,t.n_bu_acu_t+=a),i.bc++,t.bu_acu_t+=a,i.bu_acu_t+=a,r.end=n.cur_play_pos,r.cost=a,r.acc+=r.cost,1===r.sc&&(r.endf=n.cur_play_pos),n.onOneEvent({costTime:a,end_type:"waitend"},l,2)}}})),yl(this,"onSeeking",(function(){if(!Nk(n.player.src)){var e=n.resLogs,t=n.playlogs,i=n.player,r=n.seekLog;Rk("onSeeking","currentTime:".concat(i.currentTime)),0===n.startStep&&n.setPt(),n.suspendWaitingStatus("seek"),n.isSeeking&&n.suspendSeekStatus("seek",!1),n.isSeeking=!0,t.played.push({begin:i.currentTime,end:-1}),e.played.push({begin:i.currentTime,end:-1}),n._progressInfo.updatePlayed(i.currentTime,0),r.lastSeekStartTime=xk(),r.seekBefore=n.lastVideoTime.toString(),r.buf_include=n.checkInBuffer(n.player.currentTime)?1:0,r.intervalId=setTimeout((function(){n.isSeeking&&n.suspendSeekStatus("seekTimeout",!0)}),6e4)}})),yl(this,"onSeeked",(function(){Nk(n.player.src)||n.isSeeking&&n.suspendSeekStatus("seeked",!0)})),yl(this,"onPlaying",(function(){n.suspendWaitingStatus("play"),n.load_state=sI;var e=xk();n.pauseLog.isPausing&&(n.pauseLog.isPausing=!1,n.pauseLog.pause_acu_t+=e-n.pauseLog.pause_start)})),yl(this,"onPlayCatch",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorTypeCode:0,errorCode:0,url:"",headers:{},status:0};if(Rk("onPlayCatch",e,t),e){switch(e){case"mp42dash":n.vtype="DASH_2";break;case"dash2mp4":n.vtype="MP4_2";break;case"dash1mp4":n.vtype="MP4_1";break;default:n.vtype=e}var i=n.errorLog,r=n.playlogs;n.merror.playCatch.push(hl({errc:t.errorCode,errt:t.errorType},t.headers)),n.setBr("playcatch"),i.accu_errc++,i.try_err_c++,i.fir_errc=t.errorCode,t.errorCode&&i.last_errors.push(t.errorCode),n.suspendWaitingStatus("playcatch"),n.suspendSeekStatus("playcatch"),n.sendDegradeLog("playCatch",r.degrade,{cdn_url:t.url}),r.degrade=e,n.onOneError({errorType:t.errorTypeCode,code:t.errorCode,url:t.url||"",status:t.httpCode||t.status,headers:t.headers||{},vid:t.vid||n.vid,preload_hit:t.preloadHit||0,preload_cached:t.preloadCached||0,endState:gI,costTime:t.costTime,message:t.errorMessage||t.message,interval_time:t.timerStep||0},0)}})),yl(this,"onMediaExpied",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{errorType:"",errorTypeCode:0,errorCode:0,url:"",headers:{},status:0},t=n.errorLog,i=n.playlogs;Rk("onMediaExpied",e),n.suspendWaitingStatus("expied"),n.setBr("expied"),t.accu_errc++,t.try_err_c++,t.last_errors.push(e.errorCode),i.at=(new Date).getTime(),n.merror.expied.push(hl({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status},Bk(e.headers||{}))),n.onOneError({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status,headers:e.headers||{}},0)})),yl(this,"onLog",(function(e){Rk("onLog",e);var t=e.type;if(delete e.type,t)switch(t){case vI:break;case EI:n._templog||(n._templog={}),n._templog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object.keys(t).map((function(n){var r,o;e[n]="append"===i?(r=e[n],o=t[n],!r||"string"!=typeof o&&"number"!=typeof o?o:"".concat(r," ").concat(o)):t[n]})),e}(n._templog,e.data,e.action),n._templog.preload_hit&&(n._cacheFile=SI);break;case mI:var i=n.errorLog;i.accu_errc++,i.try_err_c++,n.setBr("mp4error"),i.last_errors.push(e.code),n.onOneError(e,0);break;case _I:var r=function(e,t){var i={ext:e.ext||{},data:{}};return Object.keys(e).map((function(n){t[n]?i.data[t[n]]=e[n]:"ext"!==n&&(i.ext[n]=e[n])})),i}(e,{costTime:"costTime",vid:"vid",end_type:"end_type",pos:"cur_play_pos",cdnUrl:"cdn_url"});r.ext&&["start","end"].map((function(e){r.ext[e]&&(r.ext["ext_".concat(e)]=r.ext[e],delete r.ext[e])})),n.onOneEvent(r.data,r.ext,2)}})),yl(this,"onPlay",(function(){Rk("onPlay","this.startStep :".concat(n.startStep," this.isEnded:").concat(n.isEnded)),n.isEnded&&(n.resetLoggerParams(),n.setPt())})),yl(this,"onPause",(function(){Rk("onPause");var e=n.pauseLog;e.isPausing=!0,e.pause_start=xk()})),yl(this,"onWaiting",(function(){var e=n._options;n.updateCurBuffer("onWaiting"),e.checkByInnerLog||(Rk("onWaiting>","isSeeking:".concat(n.isSeeking," startStep:").concat(n.startStep," intervalId:").concat(n.stallIntervalId)),n.wait_buf_include=n.checkInBuffer(n.player.currentTime,-1e3)?1:0,n.isSeeking||0===n.playlogs.vt||n.inWaitingStart>0||(n.stallIntervalId&&(window.clearTimeout(n.stallIntervalId),n.stallIntervalId=null),n.inWaitingStart=xk(),n.waitStartTime=n.cur_play_pos,n.stallIntervalId=window.setTimeout((function(){var e=n.stall;Rk("this.stallIntervalId>>".concat(n.stallIntervalId," cost: ").concat(xk()-n.inWaitingStart)),n._endType="wait",n.load_state=lI,n.vtype.indexOf("MP4")>-1&&n.player.currentTime>10&&n.task&&(n.triggerTask("waiting",n.initial_url),n.requestCount++),e.start=n.waitStartTime,e.bc++,1===e.bc&&(e.startf=n.waitStartTime),window.clearTimeout(n.stallIntervalId),n.stallIntervalId=null,n.startWaitingStatus(n.inWaitingStart,xk()-n.inWaitingStart),n.stallIntervalId=setTimeout((function(){n.inWaitingStart>0&&n.suspendWaitingStatus("timeout")}),6e4)}),200)))})),yl(this,"onEnded",(function(){if(n.initial_url){Rk("onEnded","watchDur:".concat(n.watchDur," vt:").concat(n.vt," pt:").concat(n.pt)),n.isEnded=!0;var e=n.resLogs.df,t=n._progressInfo;t.calculatePlaySize(),t.cachedSize<1?n.changeResolution({from:e,to:e,startTime:xk(),operaType:"leave_switch",endType:"ended"}):n.sendSwitchOpera(dI),n.onOnePlay(dI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade),n.onOneTemp(dI),n.sendEventsQueue(),n.playlogs.lc++}})),yl(this,"onUnload",(function(){0!==n.startStep&&n.initial_url&&(n.onOneTemp(fI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade),n._reportInvalidVV(fI)||(n.sendSwitchOpera(fI),n.onOnePlay(fI,!0)))})),yl(this,"onVisibilitychange",(function(){var e=n.playlogs.vt;"visible"===document.visibilityState&&(e||n.setPt())})),yl(this,"onDestroy",(function(){Rk("onDestroy:this.startStep:".concat(n.startStep," initial_url:").concat(n.initial_url," ").concat(!!n.initial_url)),n.onOnePlay(pI),n.startStep>0&&n.initial_url&&(n.onOneTemp(pI),n.sendDegradeLog("playCatch_end",n.playlogs.degrade));var e=n.resLogs.df;n._progressInfo.cachedSize<1?n.changeResolution({from:e,to:e,startTime:xk(),operaType:"leave_switch",endType:"destroy"}):n.sendSwitchOpera(dI),n.sendEventsQueue(),dw.isPC?window.removeEventListener("beforeunload",n.onUnload):(dw.isMobile||dw.isPad)&&window.removeEventListener("pagehide",n.onUnload),document.removeEventListener("visibilitychange",n.onVisibilitychange),n.listeners.forEach((function(e){n.player.off(e.evt,e.handler)})),n.clearTimers(),n.player.off("destroy",n.onDestroy),n.task&&n.task.clear()})),yl(this,"onOnePlay",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Rk("onOnePlay _isOnePlayReport:".concat(n._isOnePlayReport," isLeave: ").concat(t," endState:").concat(e)),!n._isOnePlayReport){var i=n.errorLog,r=n.playlogs,o=n.abrInfo,a=n.resLogs,s=n.player,l=n.apiLog,c=n.pauseLog,u=n.stall,h=n.netLog,d=n.watchDur;n._isOnePlayReport=!0;var f=Ok();n.getBufferTime(s);var p=n.getFrameInfo(),g=n.getPerformance(),y=i.errc,v=n._progressInfo,m=v.playedSize,_=v.cachedSize,E=v.pcdnCached,T=v.cachedVideoSize,S=v.pcdnVideoCached,b=n._progressInfo.getFileSize(s.duration),C=n.seekLog,k=C.sc,I=C.sat,P={bc:Yk(d,n.bc),bu_acu_t:Yk(d,n.bu_acu_t),sc:Yk(d,k),sat:Yk(d,I)};n.setExt();var D=n._getCompatibilityInfo();n.setNovv(null,e);var w=hl(hl(hl(hl({local_time:(new Date).getTime(),log_type:"video_playq",plugin_exception:0,player_create_exception:"",v:n.vid,initial_url:n.initial_url,initial_host:n.initial_host,initial_ip:n.curHeaders.x_response_sinfo||0,initial_type:n.initial_type},n.curHeaders),{},{initial_resolution:a.initial_resolution,final_resolution:a.final_resolution,pt:n.pt,prepare_start_time:r.nt,prepare_end_time:r.rt||Ok(),vt:n.vt,lt:n.lt,lpt:n.lpt,fvt:n.fvt,nvt:n.nvt,bft:n.bft,sc:k,sat:I,bc:n.bc,dbc:r.dbc||0,nbc:r.nbc||0,video_net_s:n.videoNetworkState,status:n.curStatus,first_buf_startt:u.startf,first_buf_endt:u.endf,lc:r.lc,bu_acu_t:n.bu_acu_t,de_bu_acu_t:r.de_bu_acu_t||0,n_bu_acu_t:r.n_bu_acu_t||0,pause_acu_t:c.pause_acu_t,cur_play_pos:n.cur_play_pos,load_state:n.load_state,play_speed:n.playbackRate,playback_state:n.playback_state,end_state:e,watch_dur:d,switch_resolution_c:n.switchResolutionCount,is_start_play_automatically:n.isAutoplay,start_time:n.start_time,finish:n.finish,errt:i.errt,errc:y,vsc:l.vsc,vsc_message:i.message||l.vsc_message,api_str:l.api_str,auth:l.auth||l.logid,width:n.videoWidth,height:n.videoHeight,vd:n.vd,video_length:b.video,audio_length:b.audio,df:n.resolution,lf:a.lf,play_c:0,player_created_t:n.player_created_t,fir_errt:i.fir_errt,fir_errc:i.fir_errc,lv_method:0,ldst:a.ldst,ldet:a.ldet,is_disable_short_seek:0,mute:n.mute,volume:n.volume,download_speed:n.realSpeed?n.realSpeed:n.task&&n.task.speed?n.task.speed:h.downloadSpeed,avg_speed:n.avgSpeed?n.avgSpeed:h.rqCount>0?parseInt(h.totalSpeed/h.rqCount,10):0,bitrate:n.curBitrate,preload_state:n.preloadState,preload_hit:n.preLoadData.hit||0,preload_cached:n.preLoadData.duration||n.preLoadData.byteLength||0,mdl_req_num:h.requestCount,watingcost:n.watingCost,br:r.br,fbrt:r.fbrt,try_err_c:i.try_err_c,accu_errc:i.accu_errc,merror:Vk(n.merror),ex:Vk(n.exInfo),perf:Vk(g),bufs:Vk(n.buffers.allBuffer),vds:_,pvds:E,vps:m,vvds:T,pvvds:S,pcdn:Vk(n.getPCDNStat())},n.buffers.curBuffer),{},{degrade:r.degrade,cache_file:n._cacheFile},p),{},{fullScreen:n._getFullScreenType(),encryptedInfo:Vk(n.encryptedInfo),per100_info:Vk(P)},D);0!==n.vt&&(w.et=f);var A=n._logstrcache||n._getLogCache();0===w.fvt&&A&&(w.log=A,n._logstrcache=null),null!=s&&s.softDecoder&&(w.soft_decoder=s.softDecoder),s&&s.dashState&&(w.dash_state=s.dashState),null!=s&&s.softDecoder&&(w.soft_decoder=s.softDecoder),o.abr_init_opts=s.config.autoBitrateOpts||{},w.abr_info=Vk(n.abrInfo);var R=D.is_support_mp4&&D.is_support_mse_mp4;if(D.is_spider||dw.isPC&&!R&&0===n.fvt)Rk("is_spider",D.is_spider,"is_support_mp4",D.is_support_mp4);else if(t){var x=!n._options.disableLocalCache;n.reportLog($k,w,x?1:0)}else n.reportLog($k,w)}})),yl(this,"onOneEvent",(function(e){var t=e.costTime,i=e.vid,r=e.end_type,o=e.cur_play_pos,a=e.cdn_url,s=e.cdn_host,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2?arguments[2]:void 0;Rk("onOneEvent",r);var u=n.buffers,h=u.curBuffer,d=u.allBuffer,f=n.getFrameInfo(),p=hl(hl({local_time:(new Date).getTime(),v:i||n.vid,cost_time:t,end_type:r||n.end_type,cdn_url:a||n.url,cdn_host:s||"",initial_type:n.initial_type,resolution:n.resolution,play_speed:n.playbackRate,first_frame_interval:xk()-n.pt,last_switch_interval:n.getLastInterval("lastSwitchStartTime",n.resLogs,!1),last_seek_interval:n.updateSeekPt(!1),last_event_interval:n.getLastInterval("lastEventTime"),cur_play_pos:o||n.cur_play_pos,video_ready_s:n.videoReadyState,video_seeking:n.videoSeeking,video_paused:n.videoPaused,bufs:Vk(d),retry_count:n._retryCount,at:n.playlogs.at,bc:n.stall.bc,stay_seconds:parseInt(((new Date).getTime()-n.playlogs.at)/1e3,10),preload_state:n.preloadState,preload_hit:n.preLoadData.hit,preload_cached:n.preLoadData.duration||n.preLoadData.byteLength},h),f);r.indexOf("waitend")>=0&&t>3e3&&(p.log=n._getLogCache());var g=n.player,y=g.currentTime,v=g.duration-y;if(r.indexOf("waitstart")>=0&&v<=1){var m=p.local_time,_=p.v,E=p.cost_time,T=p.cdn_url,S=p.first_frame_interval,b=p.cur_play_pos,C=p.video_ready_s,k=p.video_seeking,I=p.video_paused,P=p.bufs,D=p.bc,w=p.preload_hit;n.reportLog(Zk,hl({end_type:"longwait",local_time:m,v:_,cost_time:E,cdn_url:T,first_frame_interval:S,cur_play_pos:b,video_ready_s:C,video_seeking:k,video_paused:I,bufs:P,bc:D,preload_hit:w},h),c)}if("waitstart"===r&&"function"==typeof n._options.getPageFPS){var A=n._options.getPageFPS();p.cur_fps=A.curFPS||0,p.avg_fps=A.avgFPS||0}r.indexOf("wait")>-1&&(p.buf_include=n.wait_buf_include),r.indexOf("timeout")>-1&&p.cost_time>CI&&(p.cost_time=CI);var R=n.player;R&&R.dashState&&(p.dash_state=n.player.dashState),Object.keys(l).forEach((function(e){p[e]=l[e]})),p.ex=Vk(n.getPlayerExt()),n.addIfExist("drm_type",n._options,p),n.reportLog(Zk,p,c)})),yl(this,"onOneTemp",(function(){if(Rk("onOneTemp>>",!n._templog),n._templog){var e=n.player,t=n.playlogs,i=n.pauseLog,r=n.errorLog,o=n.resLogs,a=n.watchDur,s=hl(hl(hl({local_time:(new Date).getTime()},n._templog),{},{v:n.vid,initial_type:n.initial_type,pt:n.pt,vt:n.vt,lt:n.lt,fvt:n.fvt,bc:n.bc,bu_acu_t:n.bu_acu_t>bI?0:n.bu_acu_t,pause_acu_t:i.pause_acu_t,cur_play_pos:n.cur_play_pos,watch_dur:a>bI?0:a,finish:n.finish,errt:r.errt,errc:r.errc,vd:n.vd,df:n.resolution,lf:o.lf,br:t.br,fbrt:t.fbrt,try_err_c:r.try_err_c,accu_errc:r.accu_errc,dash_break:2===e.dashBufferBreak?1:0,bufs:Vk(n.buffers.allBuffer),vs:o.vs,vds:o.vds,vps:o.vps},n.buffers.curBuffer),{},{degrade:t.degrade});0!==n.vt&&(s.et=Ok()),["drm_type","dynamic_type"].forEach((function(e){n.addIfExist(e,n._options,s)})),n.reportLog(Qk,s,0),n._templog=null}})),this.player=t,void 0===this.player||null===this.player)throw new Error("player is ".concat(this.player));if(i&&i.line_app_id){i.isTask&&(this.task=new vw),this.eventQueue=[],this._instanceCreateTime=(new Date).getTime(),i.codec_type=i.codec_type||"h264",this._envInfo=i.envInfo||{},this._options=i,!this._options.maxQueueCount&&(this._options.maxQueueCount=5),this.line_app_id=parseInt(i.line_app_id,10)||0,this.line_user_id=(i.line_user_id||"").toString(),this.playerCoreVersion=t.version,this.playerVersion=i.playerVersion,this.closeSeekLog=i.closeSeekLog||!1,this.start_time=1e3*(i.start_time||0),this._initial_resolution="",this.__vtype=null,this.__dt="",this._progressInfo=new _w,this.resetLoggerParams();try{this.initializeTracker(),this.sendLocalLog(),this.bindEvt(),Rk("logger constructor:".concat(this.player.video))}catch(ds){console.error(ds)}}else console.warn("player.config.vodLogOpts.line_app_id is necessary for plugin xgVodLogger")}return gl(e,[{key:"resetLoggerParams",value:function(){Rk("resetLoggerParams");var e=this.playlogs?this.playlogs.lc:0;this.playlogs={nt:Ok(),vt:0,rt:this.isEnded?Ok():0,at:0,pt:0,bu_acu_t:0,bc:0,br:0,fbrt:"",dbc:0,de_bu_acu_t:0,nbc:0,n_bu_acu_t:0,played:[{begin:0,end:-1}],degrade:"none",lc:e},this.degradeLog={bu_acu_t:0,bc:0,watch_dur:0,hasSendEnd:!1},this.buffers={allBuffer:[],curBuffer:{buf_diff:0,buf_s_pos:0,buf_e_pos:0,buf_include:0}},this.netLog={downloadSpeed:0,requestCount:0,connectCost:0,totalSpeed:0,rqCount:0,status:0},this.merror={cdn:[],player:[],playCatch:[],expied:[]},this.exInfo={stall:[]},this._templog=null,this._isOnePlayReport=!1,this.startStep=0,this.bft=0,this._progressInfo.reset(),this._novv={log_pt:Ok()},this.initializeLogDatas(),this.initializeUrlLog()}},{key:"setNovv",value:function(e,t){!this._novv||this.fvt>0||(e&&(this._novv.errc=e.code,this._novv.errt=e.errorType,this._novv.errorMessage=e.message),this._novv.end_state=t,this._novv.novv_pt||(this._novv.novv_pt=Ok(),this._novv.novv_lpt=Ok()-this._novv.log_pt),this.player&&(this._novv.vtype=this.player.vtype,this.player.novv=this._novv))}},{key:"initializeLogDatas",value:function(){this.startStep=0,this.inWaitingStart=0,this.waitStartTime=0,this.lastVideoTime=0,this._endType="",this._retryCount=0,this.lastOperaTime=-1,this.lastEventTime=-1,this.stallIntervalId=null,this.seekLog={intervalId:0,lastSeekStartTime:xk(),seekBefore:0,sat:0,sc:0,buf_include:0},this.resLogs={lastSwitchStartTime:-1,switch_count:0,abr_switch_count:0,initial_resolution:"",final_resolution:"",ldst:0,ldet:0,df:"",lf:"",played:[],bc:0,bu_acu_t:0,sc:0,sat:0,buf:0,lbuf:0,lplayed:0,vs:0,vds:0,vps:0,vis:0,bitrate:0},this.apiLog={code:0,message:"",logid:"",api:"",auth:"",error:{}},this.errorLog={accu_errc:0,try_err_c:0,errt:0,errc:0,fir_errt:0,fir_errc:dw.isSupportMP4?0:1005,last_errors:[],message:""},this.pauseLog={pause_acu_t:0,isPausing:!1,pause_start:0},this.stall={sc:0,startf:0,endf:0,start:0,end:0,cost:0,acc:0},this._playerCreatedTime=0,this.load_state=aI,this.lv_method=6,this.isSeeking=!1,this.isEnded=!1,this.startStep=0,this.isAutoplay=this.player.config&&this.player.config.autoplay?1:0,this.abrInfo={abr_general_info:{},abr_event_info:{video_switch:[],video_stall:[],video_exit:{}},abr_play_info:{start_play_time_ms:0,is_hint:0,playback_info:{internet_speed_record:[],play_bitrate_record:[],buffer_length_record:[],play_speed_record:[]}},abr_user_info:{cancel_abr:0},abr_init_opts:this.player.config.autoBitrateOpts||{}},this._cacheFile=TI}},{key:"initSessionId",value:function(){var e="0";try{e=window.localStorage.getItem(kw).web_id||"0"}catch(dF){e="0"}this._sessionId=function(e){var t=(new Date).getTime();try{e=parseInt(e)}catch(ds){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=window.performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?i:3&i|8).toString(16)}))}(e),Rk("sessionId ".concat(this._sessionId))}},{key:"initializeTracker",value:function(){var e=this,t=this._options;if(window.__xgplayer_vod_log__)this.tracker=window.__xgplayer_vod_log__;else{this.tracker=window.__xgplayer_vod_log__=new Pw("tracker");var i=t.channel||"cn",n={app_id:"cn"===(i="va"===i||"sg"===i?i:"cn")?Cw:1300===Cw?323254:Cw,channel:i,log:!1,disable_sdk_monitor:!0,disable_heartbeat:!0};t.channelDomain&&(n.channel_domain=t.channelDomain),n.enable_ab_test=!!t.enableAbTest,this.tracker.init(n)}this.initSessionId();var r=navigator?navigator.hardwareConcurrency:0,o=navigator?navigator.deviceMemory:0;this.commonParams={play_type:0,source_type:"vid",sdk_version:Ew,pc:this.playerCoreVersion,pv:this.playerVersion,line_app_id:this.line_app_id,line_user_id:this.line_user_id,app_version:t.appVersion||"",platform:dw.isPad?"pad":dw.isMobile?"mobile":"pc",cpu_core:Number(r)||0,memory_size:Number(o)||0,support:gw(),webdriver:navigator&&navigator.webdriver?1:0,player_sessionid:this.sessionId,web_url:window.location.href,user_agent:navigator.userAgent};var a=t.trackerConfig||{};Rk("commonParams ",this.commonParams,a);var s=hl({evtParams:this.commonParams,disable_auto_pv:!0},a);!dw.name||dw.isChrome||dw.isSafari||(s.browser=dw.name,dw.appVersion&&(s.browser_version=dw.appVersion)),this.line_user_id&&(s.user_unique_id=this.line_user_id,!t.enableTeaWebId&&(s.web_id=this.line_user_id)),t.referrer&&(s.referrer=t.referrer,s.referrer_host=wk(t.referrer)),t.ext&&Object.keys(t.ext).map((function(i){e.exInfo[i]=t.ext[i]})),Rk("trackConfig",s),this.tracker.config(s),this.tracker.start()}},{key:"resetDefiInfo",value:function(){var e=this.resLogs;e.played=[],e.bc=0,e.bu_acu_t=0,e.sc=0,e.sat=0}},{key:"sendLocalLog",value:function(){var e=this,t=wI.get();wI.remove(),t.map((function(t){Object.keys(t).map((function(i){if(Rk("sendLocalLog",i,t[i]),e.player){e.player.emit("abLog",i,t[i]);var n=e._options.sendLocalCallback;n&&"function"==typeof n&&n(i,t[i])}e._track(i,t[i])}))}))}},{key:"_track",value:function(e,t){"function"==typeof this.tracker?this.tracker(e,t):this._options.enableBeacon&&e===$k?this.tracker.beaconEvent(e,t):this.tracker.event(e,t)}},{key:"bindEvt",value:function(){var e=this;this.listeners=[{evt:"play",handler:this.onPlay},{evt:"playing",handler:this.onPlaying},{evt:"pause",handler:this.onPause},{evt:"waiting",handler:this.onWaiting},{evt:"playInterfaceInfo",handler:this.onPlayInterfaceInfo},{evt:"ended",handler:this.onEnded},{evt:"loadeddata",handler:this.onLoadeddata},{evt:"loadstart",handler:this.onLoadStart},{evt:"canplay",handler:this.onCanplay},{evt:"progress",handler:this.onVideoProgress},{evt:"autoplay_was_prevented",handler:this.onNotAutoPlay},{evt:"seeking",handler:this.onSeeking},{evt:"seeked",handler:this.onSeeked},{evt:"complete",handler:this.onPlayerInited},{evt:"timeupdate",handler:this.onTimeUpdate},{evt:"bufferedChange",handler:this.onBufferedChange},{evt:"beforeDefinitionChange",handler:this.onBeforeDefinitionChange},{evt:"definitionChange",handler:this.onDefinitionChange},{evt:"definitionChangeSuccess",handler:this.onDefiChangeSuccess},{evt:"replayBtnClick",handler:this.onReplayBtnClick},{evt:"initialUrl",handler:this.initializeUrlLog},{evt:"ABR_CHANGE",handler:this.onAbrChange},{evt:"playCatch",handler:this.onPlayCatch},{evt:"log",handler:this.onLog},{evt:"progress_event",handler:this.onProgressEvent},{evt:"logger_next",handler:this.onNext},{evt:"playnext",handler:this.onNext},{evt:"nextEnded",handler:this.onNextEnded},{evt:"media_format_error",handler:this.onMediaFormatError},{evt:"xglog",handler:this.onXgLogWaiting},{evt:"xglog_cache",handler:this.onXgLogCache},{evt:"degrade",handler:this.onDegrade},{evt:"definitionChangeDetail",handler:this.onDefinitionChangeDetail},{evt:"prf_data_size",handler:this.onPrfDataSize}];var t=this.player.config.errorKey;Rk(">>>errorKey",t);var i={evt:"error",handler:this.onPlayerError};t&&(i.evt=t),this.listeners.push(i),this.listeners.forEach((function(t){e.player.on(t.evt,t.handler)})),this.bindUnload()}},{key:"_getLogCache",value:function(){var e,t;return(null===(e=this.player)||void 0===e?void 0:e.logCache)||(null===(t=this.player)||void 0===t?void 0:t.getLogCache)}},{key:"addIfExist",value:function(e,t,i){if(bw(t)){var n=t[e];!(null==n)&&(i[e]=n)}}},{key:"sendSwitchOpera",value:function(e){var t=this._progressInfo,i=t.lastBitrate,n=t.curBitrate,r=t.nextBitrate,o={costTime:0,operaType:"detail_switch",stateBefore:"",stateAfter:"",endType:e},a=null;if("changedetail"===e){if(!i)return;a=i,o.stateBefore=i.definition,o.stateAfter=r.definition}else a=n,o.stateBefore=n.definition,o.stateAfter="";var s={vds:a.cdnSize,pvds:a.pcdnSize,fileid:a.fileid};this.onOneOperator(o,s)}},{key:"changeResolution",value:function(e){var t=e.from,i=e.to,n=e.startTime,r=e.operaType,o=e.abrInfo,a=e.endType,s=void 0===a?"":a,l=this.resLogs;t=jk(t),i=jk(i),l.ldet=xk(),l.df=i,l.lf=t,l.final_resolution=i,l.switch_count++;var c=l.ldet-n,u={bc:l.bc,bu_acu_t:l.bu_acu_t,sc:l.sc,sat:l.sat,watch_dur:Dk(l.played)};o&&(u.abrInfo=o),this.updateVds(),this.resetDefiInfo(),this._options.closeResolutionLog||this.onOneOperator({costTime:c,operaType:r,endType:s,stateBefore:t,stateAfter:i},u,0)}},{key:"getLastInterval",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=t[e],r=xk(),o=-1===n?-1:r-n;return i&&(t[e]=r),o}},{key:"updateSeekPt",value:function(e){return this.getLastInterval("lastSeekStartTime",this.seekLog,e)}},{key:"_reportInvalidVV",value:function(e){return!!this._isInvaidVV()&&(this.onOneError({endState:e,errorType:9998,code:-1,url:this.player.currentSrc,headers:{}},0),this._isOnePlayReport=!0,!0)}},{key:"_isInvaidVV",value:function(){return 0===this.vt&&-1===this.curStatus}},{key:"bindUnload",value:function(){dw.isPC?window.addEventListener("beforeunload",this.onUnload):(dw.isMobile||dw.isPad)&&window.addEventListener("pagehide",this.onUnload),document.addEventListener("visibilitychange",this.onVisibilitychange),this.player.once("destroy",this.onDestroy)}},{key:"clearTimers",value:function(){var e=this.seekLog;e.intervalId&&window.clearTimeout(e.intervalId),this.stallIntervalId&&window.clearTimeout(this.stallIntervalId)}},{key:"sendDegradeLog",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"playCatch",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Rk("sendDegradeLog",e,t,i);var n=this.degradeLog;if(!(n.hasSendEnd||"playCatch_end"===e&&"none"===t)){"playCatch_end"===e&&(n.hasSendEnd=!0);var r=this.bu_acu_t-n.bu_acu_t;this.onOneEvent({costTime:this.vd,vid:this.vid,end_type:e,cur_play_pos:this.player.currentTime,cdn_url:i.url},hl({degrade:t,vt:this.vt,pt:this.pt,fvt:this.fvt,bc:this.bc-n.bc,bu_acu_t:r>bI?0:r,watch_dur:this.watchDur-n.watch_dur},i),0)}}},{key:"_getFullScreenType",value:function(){return this.player.isFullscreen?II.FULLSCREEN_TYPE:this.player.isCssfullScreen?II.CSS:II.NO_FULLSCREEN}},{key:"getBufferTime",value:function(e){var t=0,i=0,n=e.video&&e.video.buffered;if(n){for(var r=n.length,o=0,a=0;a<r;a++)o+=n.end(a)-n.start(a);t=i=1e3*o}return{video:t,audio:i}}},{key:"updateAbrInfo",value:function(e,t,i){e.abr_general_info=t.generalInfo,e.abr_event_info.video_exit={local_time_ms:(new Date).getTime(),buffer_length:t.bufferLength,internet_speed:t.downloadSpeed,now_bitrate:t.nowBitrate,play_speed:i},t.getAbrPlayInfo&&(e.abr_play_info=t.getAbrPlayInfo())}},{key:"getPerformance",value:function(){return this.player.performance||{}}},{key:"setExt",value:function(){var e=this,t=this.player.ext||{};t.performance&&delete t.performance,Object.keys(t).map((function(i){"performance"!==i&&(e.exInfo[i]=t[i])}))}},{key:"onOneOperator",value:function(e){var t=e.costTime,i=e.operaType,n=e.stateBefore,r=e.stateAfter,o=e.endType,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,l=this.getLastInterval("lastOperaTime"),c={local_time:(new Date).getTime(),v:this.vid,opera_type:i,state_before:n,state_after:r,cost_time:t,end_type:o||this.end_type,cdn_url:this.url,resolution:this.resolution,last_interval:l,bufs:Vk(this.buffers.allBuffer),cur_play_pos:this.cur_play_pos,retry_count:this._retryCount};"seek"===i&&(c.buf_include=this.seekLog.buf_include,this.seekLog.buf_include=0);var u=this.player;u&&u.dashState&&(c.dash_state=this.player.dashState),Object.keys(a).forEach((function(e){c[e]=a[e]})),this.addIfExist("drm_type",this._options,c),this.reportLog(Xk,c,s)}},{key:"onOneError",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{errorType:0,code:0,url:"",headers:{},costTime:0,vid:"",message:"",preload_hit:0,preload_cached:0,interval_time:0},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Rk("onOneError",t);var r=this.errorLog,o=this.apiLog,a=this.resLogs,s=this.player,l=this.playlogs,c=Bk(t.headers||{}),u=this.getPerformance(),h=t.code>0?0-t.code:t.code;this.setExt();var d=this._getCompatibilityInfo();this.setNovv(t,t.endState||uI);var f=hl(hl(hl({v:t.vid||this.vid,video_pos:this.cur_play_pos,local_time:(new Date).getTime(),cost_time:t&&t.costTime?t.costTime:0,errt:t.errorType,errc:h,es:this.es,cdn_url:t.url||this.url,bufs:Vk(this.buffers.allBuffer),resolution:a.final_resolution,last_errors:r.last_errors.join(";"),vsc:o.vsc,vsc_message:t.message||o.vsc_message,server_ip:c.x_response_sinfo||0,initial_url:this.initial_url,initial_host:this.initial_host},c),{},{cur_play_pos:this.cur_play_pos},this.buffers.curBuffer),{},{degrade:l.degrade,end_state:t.endState||uI,preload_hit:t.preload_hit||0,preload_cached:t.preload_cached||0,ex:Vk(this.exInfo),pref:Vk(u),video_ready_s:this.videoReadyState,interval_time:t.interval_time||0},d);s&&s.dashState&&(f.dash_state=s.dashState);var p=this.player.currentSrc,g=Mk(p)?Mk(t.url)?this.initial_url:t.url:p,y={connectTime:0,status:0,statusText:"",isexpired:0,isBlob:Mk(p)?1:0};if(n&&"String"===Fk(g)){var v={};Lk(g,{range:"0-8",timeout:2e3}).then((function(e){Rk("getXhr>>check result ",e);var t=Bk(e.headers||{});f.server_ip=t.x_response_sinfo,v=hl(hl({},y),{},{statusText:e.statusText||"",status:e.status||0,connectTime:0|e.connectTime,sinfo:t.x_response_sinfo||"",cinfo:t.x_response_cinfo||""})})).catch((function(e){v=hl(hl({},y),{},{statusText:-2===e.status?"timeout":"error",status:e.status})})).finally((function(){var t=function(e){if(!e||"String"!==Fk(e))return 0;var t=0;try{var i=new RegExp("(\\?|&)x-tos-expires=([^&]*)(&|$)"),n=e.match(i);if(null!==n)t=parseInt(n[2],10);else{var r=e.split("/");r.length>5&&8===r[4].length&&(t=parseInt(r[4],16))}return t>0?t<parseInt((new Date).getTime()/1e3,10)?Gk:Wk:Kk}catch(ds){return Kk}}(g);v.isexpired=t,f.net=Vk(v),e.reportLog(qk,f,i)}))}else f.net=Vk(y),this.reportLog(qk,f,i)}},{key:"_getCompatibilityInfo",value:function(){var e=function(){if("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)return{support:!1,message:"MediaSource API not support"};for(var e=!1,t="",i=0;i<cw.length;i++){var n='video/mp4; codecs="'.concat(cw[i],'"'),r=MediaSource.isTypeSupported(n);t+="".concat(n," is ").concat(r," "),r&&(e=!0)}return{support:e,message:t}}();return{is_spider:dw.isSpider?1:0,is_support_mp4:dw.isSupportMP4?1:0,is_support_hevc:fw()?1:0,is_support_mse_mp4:e.support?1:0,support_mse_mp4:e.message}}},{key:"reportLog",value:function(t,i,n){var r=this,o=this._options,a=this.player.ABTestTag,s=this.commonParams;i.dynamic_type=this.dynamicType;var l="Array"===Fk(o.absdkVersion)?o.absdkVersion.join(","):o.absdkVersion;i.absdkVersion=l||e.AB_SDK_VERSION,null!=a&&(i.abtest_tag=a);var c=this._options;i.codec_type=this.codecType,bw(c)&&(kI.forEach((function(e){r.addIfExist(e,c,i)})),Object.keys(s).forEach((function(e){r.addIfExist(e,s,i)})),i.vtype=this.vtype),i.env_info=Vk(this._envInfo||{}),i.support=gw(),i.visible="undefined"==typeof document?0:"visible"===document.visibilityState?1:0;var u=function(){if(1===n){var e={};return e[t]=i,void wI.set(e)}2!==n?(r.player&&r.player.emit("abLog",t,i),r._track(t,i)):r.addEventsQueue(t,i)};if("function"==typeof o.onReportLog){var h=o.onReportLog(t,i);null!=h&&h.then?h.finally((function(){return u()})):u()}else u()}},{key:"addEventsQueue",value:function(e,t){this.eventQueue.push({event:e,params:t}),this.eventQueue.length>=this._options.maxQueueCount&&this.sendEventsQueue()}},{key:"sendEventsQueue",value:function(){for(;this.eventQueue.length>0;){var e=this.eventQueue.pop();this._track(e.event,e.params)}}},{key:"startWaitingStatus",value:function(e,t){this.appendStallInfo("start",e),this.updateCurBuffer("startWaitingStatus"),this.onOneEvent({costTime:t,end_type:"waitstart"},{},2)}},{key:"triggerTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"start",t=arguments.length>1?arguments[1]:void 0;Rk("triggerTask>>",e),!Nk(t=t||this.player.src)&&this.vtype.indexOf("MP4")>-1&&this.task&&this.task.trigger(t,e)}},{key:"appendStallInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"start",t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;this.exInfo.stall||(this.exInfo.stall=[]);var n=this.exInfo.stall;if("start"===e){n.length>6&&n.splice(0,n.length-6);var r=this.buffers.curBuffer;n.push({start:t,end:-1,endType:"waitstart",cost:0,cur:this.cur_play_pos,buf_s:r.buf_s_pos,buf_e:r.buf_e_pos,buf_i:r.buf_include})}else if("end"===e){var o=n.length-1;if(o<0)return;n[o].end<0&&(n[o].end=t,n[o].endType=i,n[o].cost=t-n[o].start)}Rk("appendStallInfo",n)}},{key:"suspendWaitingStatus",value:function(e){var t=xk(),i=this.playlogs,n=this.resLogs,r=this.stall,o=this.inWaitingStart;if(!(o<=0||this.isSeeking||i.vt<=0)){if(Rk("suspendWaitingStatus>>".concat(e,"|costTime:").concat(t-o," isSeeking:").concat(this.isSeeking)),this.appendStallInfo("end",t,e),t-o>200){var a=t-this.inWaitingStart;if(i.bc++,this.checkInBuffer(this.player.currentTime)?(i.de_bu_acu_t+=a,i.dbc++):(i.nbc++,i.n_bu_acu_t+=a),n.bc++,i.bu_acu_t+=a,n.bu_acu_t+=a,r.end=this.cur_play_pos,r.cost=a,r.acc+=r.cost,1===r.sc&&(r.endf=this.cur_play_pos),this.player.abrInstance&&!this.isSeeking&&this.playlogs.vt){var s=this.player.abrInstance;this.abrInfo.abr_event_info.video_stall.push({local_time_ms:(new Date).getTime(),stall_duration:parseFloat((a/1e3).toFixed(2)),buffer_length:s.bufferLength,internet_speed:s.downloadSpeed,now_bitrate:s.nowBitrate,play_speed:this.player.playbackRate,is_abr:s.isCurrentInAbr?1:0})}this.onOneEvent({costTime:a,end_type:"waitend_".concat(e)||"waitend"},{},2)}this._endType="",this.load_state=sI,this.inWaitingStart=0,this.waitStartTime=0,window.clearTimeout(this.stallIntervalId),this.stallIntervalId=null}}},{key:"suspendSeekStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isSeeking){var i=this.seekLog,n=this.resLogs,r=this.player,o=xk()-i.lastSeekStartTime;Rk("suspendSeekStatus>>","".concat(e," currentTime:").concat(r.currentTime," costTime:").concat(o," sat:").concat(i.sat," resLogs.sat:").concat(n.sat)),i.intervalId&&window.clearTimeout(i.intervalId),i.intervalId=null,this.isSeeking=!1;var a=this._endType="seek",s=i.seekBefore,l=(r.currentTime||0).toString();i.sc++,i.sat+=o>CI?0:o,n.sc++,n.sat+=o>CI?0:o,o>CI&&(o=CI),this.updateSeekPt(!0),!this.closeSeekLog&&t&&this.onOneOperator({costTime:o,operaType:a,stateBefore:s,stateAfter:l,endType:e})}}},{key:"setPt",value:function(){var e=this.playlogs;this.startStep=1,!e.pt&&this.player.currentTime&&(this.isSeeking=!0),e.pt||(e.pt=Ok(),Rk("setPt","init pt :".concat(e.pt,", document.visibilityState:").concat(document.visibilityState)))}},{key:"setVt",value:function(){var e=this.playlogs;1===this.startStep&&(e.vt||(e.vt=Ok(),Rk("setVt: first frame inited","vt-pt:".concat(e.vt-e.pt," vt-nt:").concat(e.vt-e.nt))),this.startStep=2)}},{key:"setBr",value:function(e){var t=this.playlogs;t.vt>0&&(0===t.br&&(t.fbrt=e||""),t.br++)}},{key:"codecType",get:function(){var e=this.player;return e&&e.config&&e.config.codecType?e.config.codecType:this._options.codec_type||"h264"}},{key:"url",get:function(){var e=this.player;return e&&e.config?e.config.url:""}},{key:"vid",get:function(){var e=this.player;return e&&e.config?e.config.vid:""}},{key:"bc",get:function(){return this.playlogs.bc}},{key:"bu_acu_t",get:function(){var e=this.playlogs.bu_acu_t;return e>bI?0:e}},{key:"pt",get:function(){return this.playlogs.pt||Ok()}},{key:"vt",get:function(){var e=this.playlogs,t=e.vt;return e.pt>0?t:0}},{key:"fvt",get:function(){var e=this.playlogs,t=e.vt,i=e.pt,n=0;return t>0&&i>0&&(n=parseInt(t-i,10)),n>6e4?6e4:n}},{key:"nvt",get:function(){var e=this.playlogs,t=e.vt,i=e.nt;return t>0&&i>0?parseInt(t-i,10):0}},{key:"getFrameInfo",value:function(){if(this.player&&this.player.videoFrameInfo){var e=this.player.videoFrameInfo,t=e.dropped,i=e.corrupted,n=e.droppedRate;return{f_total:e.total,drop_count:t,drop_rate:n,corrupted:i}}return{f_total:0,drop_count:0,drop_rate:0,corrupted:0}}},{key:"vd",get:function(){var e=this.player;return e.duration&&"number"==typeof e.duration&&e.duration>0?parseInt(1e3*e.duration,10):e.config.duration&&"number"==typeof e.config.duration?parseInt(1e3*e.config.duration,10):0}},{key:"cur_play_pos",get:function(){return parseInt(1e3*this.player.currentTime,10)}},{key:"volume",get:function(){return this.player.volume}},{key:"buffer_time",get:function(){var e=0;try{var t=this.player.getBufferedRange();e=t[1]-t[0]}catch(ds){e=0}return e}},{key:"player_created_t",get:function(){return this._playerCreatedTime}},{key:"playbackRate",get:function(){return this.player.playbackRate}},{key:"mute",get:function(){return this.player.muted?0:1}},{key:"videoWidth",get:function(){var e=this.player;return e&&e.video?e.video.videoWidth:0}},{key:"videoHeight",get:function(){var e=this.player;return e&&e.video?e.video.videoHeight:0}},{key:"preload",get:function(){var e=this.player;return!(!e||!e.video)&&e.video.preload}},{key:"initial_url",get:function(){var e=this.player.currentSrc;return e.indexOf("blob:")>-1&&this.urlLog.initial_url?this.urlLog.initial_url:Nk(e)?"":e}},{key:"initial_host",get:function(){var e=this.player.currentSrc;return e.indexOf("blob:")>-1&&this.urlLog.initial_host?this.urlLog.initial_host:wk(Nk(e)?"":e)}},{key:"curHeaders",get:function(){var e=this.player,t=this.task;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?Bk(e.__dash__.curReqVideoSegInfo.headers||{}):t?t.headers:{}}},{key:"curStatus",get:function(){var e=this.task,t=this.vtype,i=this.netLog;return t.indexOf("MP4")>-1?e?e.status:0:i.status}},{key:"play_type",get:function(){return 0}},{key:"resolution",get:function(){var e=this.player.curDefinition;return e?"".concat(e.definition):this.resLogs.df}},{key:"sessionId",get:function(){return this._sessionId}},{key:"finish",get:function(){return this.isEnded?1:0}},{key:"end_type",get:function(){return this._endType}},{key:"avgSpeed",get:function(){return this.player&&this.player.avgSpeed?this.player.avgSpeed:0}},{key:"realSpeed",get:function(){return this.player&&this.player.realTimeSpeed?this.player.realTimeSpeed:0}},{key:"mp4MseOpLength",get:function(){if(!this.player||!this.player.plugins)return-1;var e=this.player.plugins.mp4encryptplayer;return e?e.opQueueLen||0:-1}},{key:"mp4LoadSegmentTimeRange",get:function(){if(!this.player||!this.player.plugins)return"";var e=this.player.plugins.mp4encryptplayer;return e?e.loadSegmentTimeRange.join(","):""}},{key:"preLoadData",get:function(){if(!this.player||!this.player.plugins)return[];var e=this.player.plugins.mp4encryptplayer;if(e&&e.preLoadData)return{hit:1,duration:e.preLoadData.duration,length:e.preLoadData.byteLength};var t=this.player.stat||{};if(t.preLoadData){var i=t.preLoadData.length;return{hit:i>0,length:i}}return{hit:0,duration:0,length:0}}},{key:"preloadState",get:function(){if(!this.player||!this.player.plugins)return 0;if(void 0!==this.player.preloadState)return this.player.preloadState||0;var e=this.player.plugins.mp4encryptplayer;return e&&e.preloadState?e.preloadState:0}},{key:"curBitrate",get:function(){var e=this.player,t=e.config,i=e.curDefinition;return i&&i.bitrate?i.bitrate:t.defaultBitrate?t.defaultBitrate:0}},{key:"videoReadyState",get:function(){var e=this.player;return e&&e.video?e.video.readyState:-1}},{key:"videoSeeking",get:function(){var e=this.player;return e&&e.video&&e.video.seeking?1:0}},{key:"videoPaused",get:function(){var e=this.player;return e&&e.video&&e.video.paused?1:0}},{key:"switchResolutionCount",get:function(){return this.resLogs.switch_count}},{key:"isError",get:function(){return this.player._isError||this.player.video.error}},{key:"isPlaying",get:function(){return Hk(this.player.root,"xgplayer-playing")}},{key:"isStop",get:function(){return Hk(this.player.root,"xgplayer-ended")||Hk(this.player.root,"xgplayer-nostart")}},{key:"isPause",get:function(){return Hk(this.player.root,"xgplayer-pause")}},{key:"isLoading",get:function(){return Hk(this.player.root,"xgplayer-isloading")}},{key:"es",get:function(){return this.isPlaying?"playing":"beforePlay"}},{key:"lt",get:function(){var e=0;return 0===this.vt&&(Rk("lt init",this.playlogs.lt),e=Ok()),e}},{key:"lpt",get:function(){return this.lt?this.lt-this.pt:0}},{key:"playback_state",get:function(){return this.isError?rI:this.isStop?tI:this.isPause?nI:this.isLoading?oI:iI}},{key:"is_start_play_automatically",get:function(){return"".concat(this.isAutoplay)}},{key:"watchDur",get:function(){var e=this.player,t=this.playlogs,i=e.cumulateTime?e.cumulateTime:Dk(t.played);return i>=0?i>bI?bI:i:0}},{key:"vtype",get:function(){if(this.__vtype)return this.__vtype;var e=this.player?this.player.vtype||this.player.config.vtype:"";return e||(this.player.dash?"DASH":this._options.vtype||"MP4")},set:function(e){this.__vtype=e}},{key:"envInfo",get:function(){return this._envInfo},set:function(e){e&&(this._envInfo=e)}},{key:"getPlayerExt",value:function(){var e=this.player.ext;if(e)return e}},{key:"watingCost",get:function(){if(this.inWaitingStart>0){var e=xk()-this.inWaitingStart;return e>CI?0:e}return 0}},{key:"videoNetworkState",get:function(){var e=this.player;return e&&e.video?e.video.networkState:-1}},{key:"eagleid",get:function(){var e=this.player;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?(e.__dash__.curReqVideoSegInfo.headers||{}).eagleid:""}},{key:"initial_type",get:function(){var e=this.player.config||{};return e&&e.vodLogOpts&&void 0!==e.vodLogOpts.currentDashType?parseInt(e.vodLogOpts.currentDashType,10):-1}},{key:"dynamicType",get:function(){var e=this.player;return this.__dt?this.__dt:e&&e.__dash__&&e.__dash__.dash&&e.__dash__.dash.mpd?(this.__dt=e.__dash__.dash.mpd.dashType,this.__dt):""}},{key:"updateBuffers",value:function(){var e=this.player.buffered,t=[];if(!e||e.length<1)this.buffers.allBuffer=[];else{for(var i=0;i<e.length;i++){var n=parseInt(1e3*e.start(i),10),r=parseInt(1e3*e.end(i),10);t.push({s:n,e:r})}this.buffers.allBuffer=t}}},{key:"updateCurBuffer",value:function(e){var t=this.player,i=t.buffered,n=t.currentTime,r={buf_s_pos:0,buf_e_pos:0,buf_include:0,buf_diff:0};if(!i||i.length<1)return r;for(var o=-1,a=-1,s=parseInt(1e3*n,10),l=i.length-1;l>-1;l--){var c=parseInt(1e3*i.start(l),10),u=parseInt(1e3*i.end(l),10);if(s>=c&&s<=u){r.buf_include=1,r.buf_s_pos=c,r.buf_e_pos=u,r.buf_diff=u-s;break}s<c&&(o<0||c-s<o)?(o=c-s,a=l):s>u&&(o<0||s-u<o)&&(o=s-u,a=l)}1!==r.buf_include&&(a<0&&(a=i.length-1),r.buf_s_pos=parseInt(1e3*i.start(a),10),r.buf_e_pos=parseInt(1e3*i.end(a),10)),this.buffers.curBuffer=r}},{key:"checkInBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.player.buffered;if(!i)return!1;e=parseInt(1e3*e,10);for(var n=0;n<i.length;n++){var r=parseInt(1e3*i.start(n),10),o=parseInt(1e3*i.end(n),10)+t;if(e>r&&e<o)return!0}return!1}},{key:"getPCDNStat",value:function(){if(this.player&&this.player.pcdnVVStat){var e=this.player.pcdnVVStat,t=e.try_req_num,i=e.req_node_succ,n=e.conn_req_num;return hl({try_req:t,req_succ:i,has_ret:e.has_ret_node,conn_req:n,conn_fail:e.conn_fail_num,conn_jump:e.conn_jump_num},vl(e,Tw))}return{}}},{key:"updateVideoSize",value:function(){var e=this._options,t=this.player,i=this.resLogs,n=0,r=0;if(t.__dash__&&t.__dash__.dash&&t.__dash__.dash.mpd.mediaList){var o=t.__dash__.dash.mpd.mediaList.video,a=o[o.selectedIdx];Rk("updateVideoSize》》videoItem",a),r=a?a.bitrate||a.bandwidth:0,n=a?a.size:0}else{var s=this.player.curDefinition;s?(r=s.bitrate||t.config.bitrate||0,n=parseInt(s.bitrate*t.duration/8,10)):(n=e.videoSize||t.config.videoSize||0,r=e.bitrate||t.config.bitrate||0)}Rk("updateVideoSize","bitrate:".concat(r,", vs:").concat(n)),n&&(i.vs=n,i.vis=parseInt(n/t.duration,10),i.bitrate=r||i.vis)}},{key:"updateVds",value:function(){var e=this.resLogs,t=this.playlogs,i=this.player;if(0!==e.vis){for(var n=parseInt(Dk(t.played)/1e3,10),r=i.buffered,o=0,a=0;a<r.length;a++)o+=parseInt(r.end(a)-r.start(a),10);Rk("updateVds","pdur:".concat(n," bdur:").concat(o," \n lbuf:").concat(e.lbuf," lplayed:").concat(e.lplayed," bitrate: ").concat(e.bitrate," vis:").concat(e.vis," vs:").concat(e.vs)),e.lplayed=n,e.lbuf=o}else Rk("updateVds","vis:".concat(e.vis))}},{key:"encryptedInfo",get:function(){return this.player.encryptedInfo||{encryptedType:0}}}],[{key:"TEA_ID",get:function(){return Cw},set:function(e){kw="__tea_cache_tokens_".concat(Cw=e)}},{key:"AB_SDK_VERSION",get:function(){return Iw},set:function(e){Iw="Array"===Fk(e)?e.join(","):e}},{key:"Collector",set:function(e){Pw=e}},{key:"defaultConfig",value:function(){return{line_app_id:"",line_user_id:"",isTask:!1,codec_type:"",playerCoreVersion:"",playerVersion:"",start_time:0,maxQueueCount:5,channel:"cn",channelDomain:"",absdkVersion:"",checkByInnerLog:!0,drm_type:0,vtype:"MP4",tag:"普通视频",subtag:"",dynamic_type:"",sendLocalCallback:function(){},disableLocalCache:!1,closeResolutionLog:!1,closeSeekLog:!1,needXhrCheck:!1,trackerConfig:{},envInfo:{},enableTeaWebId:!1,enableBeacon:!1}}}]),e}();const ww=null==(e=nl())?void 0:e.__LOG_TEA_ID__;function Aw(e){let t={};const i=(i,n)=>{const r=(e=>Object.assign({},t,null!=e?e:{}))(n);ss.log("veplayer sendLog",i,r),e(i,r)};function n(e,t){i(e,t)}return n.init=e=>{},n.config=e=>{const i=null==e?void 0:e.evtParams;i&&"object"==typeof i&&(t=c({},i))},n.start=()=>{},n.event=(e,t)=>{i(e,t)},n.beaconEvent=(e,t)=>{i(e,t)},n}function Rw(){var e;const t=null==(e=mB.ttDramaEnv)?void 0:e.sendLog;return"function"==typeof t?t:void 0}Dw.TEA_ID=ww,Dw.Collector=function(e){const t=Rw();if(t)return Aw(t);const i=Fs();return i?new i(e):void 0};const xw="beforePlayerCreate.authtoken.getVideoInfo.getVideos",Ow=`${xw}.getDramaInfoViaJSB.perfInfo`,Lw={prepareCost:`${Ow}.prepareCost`,requestCost:`${Ow}.requestCost`,parseCost:`${Ow}.parseCost`,totalCost:`${Ow}.totalCost`};function Nw(e,t){var i;const n=null==(i=null==e?void 0:e.timingMap)?void 0:i[t];return Number.isFinite(n)?n:0}const Mw=function(e){if(e&&e.player){const t=(t,i)=>d(this,null,(function*(){var n,r,o;const a=e.player;i.player_sum_num=function(e){var t,i;let n=0;return null==(i=null==(t=null==e?void 0:e.instManager)?void 0:t.forEach)||i.call(t,(()=>(n++,!0))),n}(a),i.is_mse=Ns(a),i.drm_encrypt_type=sl(a)||"",i.initial_url=Ur.isBlob(i.initial_url)&&a.config.url||i.initial_url,i.album_id=a.config.albumId||"",i.episode_id=a.config.episodeId||"",i.client_key=(null==(n=mB.ttDramaEnv)?void 0:n.clientKey)||"";const s=function(e){var t,i;return null==(i=null==(t=null==e?void 0:e.sdk)?void 0:t.getCreatePlayerPerfReport)?void 0:i.call(t)}(a),l=Nw(s,xw);const c=function(e){const t=null==e?void 0:e.totalDuration;return Number.isFinite(t)?t:0}(s);if(i.server_fetch_duration=l,Object.assign(i,function(e){return{server_fetch_prepare_cost:Nw(e,Lw.prepareCost),server_fetch_request_cost:Nw(e,Lw.requestCost),server_fetch_parse_cost:Nw(e,Lw.parseCost),server_fetch_total_cost:Nw(e,Lw.totalCost)}}(s)),i.create_player_total_duration=c,i.prepare_play=c-l,i.is_preload_enabled=2===mB.preloaderStatus,t===$k||t===qk){const e=null==a?void 0:a.veError;0!==i.errc&&e?(i.ve_error_code=(null==e?void 0:e.veErrorCode)||0,i.ve_error_type=(null==e?void 0:e.veErrorType)||"",i.ve_error_message=(null==e?void 0:e.veErrorMessage)||"",i.ve_error_ext=JSON.stringify((null==e?void 0:e.ext)||"")):(i.ve_error_code=0,i.ve_error_type="",i.ve_error_message="",i.ve_error_ext=""),i.licenseStatus=(null==(r=null==a?void 0:a.licenseLogInfo)?void 0:r.licenseStatus)||"",i.licenseType=(null==(o=null==a?void 0:a.licenseLogInfo)?void 0:o.licenseType)||""}})),i=Object.assign({onReportLog:t},e.player.config.vodLogOpts||{});e.player.vodLogger=new Dw(e.player,i),e.player.plugins.xgVodLogger=e.player.vodLogger}else this.vodLogger=new Dw(this,this.config.vodLogOpts||{})};Mw.pluginName="__xgVodLogger",Mw.playerConfig={},Mw.Collector=Dw.Collector,Mw.setABSdkVersion=e=>{Dw.AB_SDK_VERSION=e};const Uw=Ui((function(e,t,i){Ii(e,t,i)}));class Bw{constructor(e){this.isLive=e.configs.isLive,this.playerData=e.playerData,this.streamType=e.streamType}}const Fw={"@byted/streamprobe":"1.0.2","@byted/volcengine-vestrategy":"1.1.0-rc.71","@byted/volcengine-vestrategy-adapt-range":"1.1.0-rc.0","@byted/volcengine-vestrategy-h265":"1.1.0-rc.0","@byted/volcengine-vestrategy-preload":"1.1.0-rc.3","@byted/xgplayer-encrypt":"3.5.29-rc.1","@byted/xgplayer-encrypt-hls":"4.2.0","@byted/xgplayer-encrypt-mp4":"3.0.31-alpha.1","@byted/xgplayer-vod-abralgo":"1.0.5","@byted/xgplayer-vod-preload":"1.0.9-rc.3","@byted/xgplayer-xgvideo":"0.2.5-rc.3","xgplayer-flv":"3.0.23-rc.6","xgplayer-hls":"3.0.24-rc.18"};var Hw=(e=>(e.HLS="hls",e.HLSJS="hlsjs",e.FLV="flv",e.XGVideo="XGVideo",e.HLSEncrypt="hlsEncrypt",e.DASH="dash",e.MP4Encrypt="mp4Encrypt",e.DanmuJS="danmujs",e.DanmuMask="danmuMask",e.StreamProbe="streamprobe",e.VeStrategy="vestrategy",e.VeStrategyH265="vestrategy_h265",e.VeStrategyPreload="vestrategy_preload",e.VeStrategyAdaptRange="vestrategy_adapt_range",e.DashAbralgo="DashAbralgo",e.Preloader="preloader",e.HLSjsPro="hlsjsPro",e))(Hw||{});const jw={[Hw.HLS]:{name:"HlsPlayer",pluginName:"hls",packageName:"xgplayer-hls",devPath:`xgplayer-hls@${Fw["xgplayer-hls"]}/dist/index.min.js`},[Hw.FLV]:{name:"FlvPlayer",pluginName:"flv",packageName:"xgplayer-flv",devPath:`xgplayer-flv@${Fw["xgplayer-flv"]}/dist/index.min.js`},[Hw.XGVideo]:{name:"XGVideo",packageName:"@byted/xgplayer-xgvideo",devPath:`@byted/xgplayer-xgvideo@${Fw["@byted/xgplayer-xgvideo"]}/dist/index.min.js`},[Hw.HLSEncrypt]:{name:"EncryptHlsPlugin",pluginName:"EncryptHlsPlugin",packageName:"@byted/xgplayer-encrypt-hls",devPath:`@byted/xgplayer-encrypt-hls@${Fw["@byted/xgplayer-encrypt-hls"]}/dist/index.min.js`},[Hw.DASH]:{name:"DashPlugin",pluginName:"DASHPlugin",packageName:"@byted/xgplayer-encrypt",devPath:`@byted/xgplayer-encrypt@${Fw["@byted/xgplayer-encrypt"]}/dist/index.min.js`},[Hw.MP4Encrypt]:{name:"Mp4EncryptPlayer",pluginName:"Mp4EncryptPlayer",packageName:"@byted/xgplayer-encrypt-mp4",devPath:`@byted/xgplayer-encrypt-mp4@${Fw["@byted/xgplayer-encrypt-mp4"]}/dist/index.min.js`},[Hw.StreamProbe]:{name:"StreamProbe",pluginName:"streamprobe",packageName:"@byted/streamprobe",devPath:`@byted/streamprobe@${Fw["@byted/streamprobe"]}/dist/index.min.js`},[Hw.VeStrategyH265]:{name:"__VESTRATEGY_STRATEGY_H265__",packageName:"@byted/volcengine-vestrategy-h265",devPath:`@byted/volcengine-vestrategy-h265@${Fw["@byted/volcengine-vestrategy-h265"]}/umd/vestrategy.strategy.h265.production.js`},[Hw.VeStrategy]:{name:"VeStrategy",packageName:"@byted/volcengine-vestrategy",devPath:`@byted/volcengine-vestrategy@${Fw["@byted/volcengine-vestrategy"]}/umd/vestrategy.production.js`},[Hw.VeStrategyPreload]:{name:"__VESTRATEGY_STRATEGY_PRELOAD__",packageName:"@byted/volcengine-vestrategy-preload",devPath:`@byted/volcengine-vestrategy-preload@${Fw["@byted/volcengine-vestrategy-preload"]}/umd/vestrategy.strategy.preload.production.js`},[Hw.VeStrategyAdaptRange]:{name:"__VESTRATEGY_STRATEGY_ADAPT_RANGE__",packageName:"@byted/volcengine-vestrategy-adapt-range",devPath:`@byted/volcengine-vestrategy-adapt-range@${Fw["@byted/volcengine-vestrategy-adapt-range"]}/umd/vestrategy.strategy.adapt-range.production.js`},[Hw.DashAbralgo]:{name:"DashAbralgo",packageName:"@byted/xgplayer-vod-abralgo",devPath:`@byted/xgplayer-vod-abralgo@${Fw["@byted/xgplayer-vod-abralgo"]}/dist/index.min.js`},[Hw.Preloader]:{name:"XGPlayerPreload",packageName:"@byted/xgplayer-vod-preload",devPath:`@byted/xgplayer-vod-preload@${Fw["@byted/xgplayer-vod-preload"]}/dist/index.min.js`},[Hw.HLSjsPro]:{name:"EncryptHlsjsPlugin",packageName:"@byted/xgplayer-encrypt-hls",devPath:`@byted/xgplayer-encrypt-hls@${Fw["@byted/xgplayer-encrypt-hls"]}/dist/hlsjs.min.js`}},Vw={h265:Hw.VeStrategyH265,preload:Hw.VeStrategyPreload,adaptRange:Hw.VeStrategyAdaptRange},Kw={setImportedPlugins(e,t){e.importedPlugins=t},prepareStrategyLoad(e){"undefined"!=typeof window&&window.VeStrategy&&(window.__VESTRATEGY_BASE__||(window.__VESTRATEGY_BASE__=window.VeStrategy),window.__VESTRATEGY_STRATEGY_PRELOAD__||e.clearPluginCache(Hw.VeStrategyPreload))},loadVeStrategy(e){return d(this,null,(function*(){return e.loadPlugins(Hw.VeStrategy)}))},loadStrategy(e,t){return d(this,null,(function*(){return e.loadPlugins(Vw[t])}))},loadPreloader(e){return d(this,null,(function*(){return e.loadPlugins(Hw.Preloader)}))},loadMp4Encrypt(e){return d(this,null,(function*(){return e.loadPlugins(Hw.MP4Encrypt)}))},loadHlsjsPro(e){return d(this,null,(function*(){return e.loadPlugins(Hw.HLSjsPro)}))}};let Gw=!1;class Ww extends Bw{constructor(e){super(e)}applyAbrPluginConfig(e,t){e.Mp4EncryptPlayer=u(c({},e.Mp4EncryptPlayer),{autoBitrateOpts:t})}prepareAbrModule(e,t){return d(this,null,(function*(){var i;const n=null==(i=e.configs)?void 0:i.autoBitrateOpts;e.isOpenABR()&&!(null==n?void 0:n.module)&&e.updateConfigs({autoBitrateOpts:u(c({},n),{module:yield t.loadPlugins(Hw.DashAbralgo)})})}))}needAbrAutoDefinition(){return!1}setAbrDefaultDefiWithAuto(){return!1}generatePlaylistFromServer(e){Gw=!0;const{playList:t=[]}=e||{};return[...t||[]]}useNativeAbr(){return!1}canOpenAbr(e){var t;if(this.playerData.isVidPlay()&&e){const{playList:t=[]}=e;if(!(t.length>1))return Gw&&ss.warn("The obtained media information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether there are more than 1 video."),Gw=!1,!1}return!((null==(t=Kr.os)?void 0:t.isIos)&&!Js())}canAdaptRangeEnable(){var e;return!((null==(e=Kr.os)?void 0:e.isIos)&&!Js())}adaptRangeDefaultOptions(){return{maxTargetCacheDur:30,minTargetCacheDur:12,rangeMaxDuration:15,rangeMinDuration:5,cacheSafeFactor:2,estPTcontrol:!0,estPlayTime:12,minBandwidth:1e6,minDangerThreshold:3,rangeControl:!0,rangeMinSize:409600,safeFactor:.1,targetCacheControl:!0}}applyAdaptRangePluginConfig(e,t){e.Mp4EncryptPlayer=u(c({},e.Mp4EncryptPlayer),{adaptRange:t})}applyAdaptRangeStrategy(e,t){var i,n;e.Mp4EncryptPlayer=u(c({},e.Mp4EncryptPlayer),{adaptRange:c(c(c({},this.adaptRangeDefaultOptions()),null!=(n=null==(i=e.Mp4EncryptPlayer)?void 0:i.adaptRange)?n:{}),t)})}getPlugins(e){return d(this,null,(function*(){var t;const{configs:i,openSoftDecoding:n,isVidEncrypt:r,drmType:o}=this.playerData,a=[or.PRIVATE_ENCRYPT_UPGRADE,or.PRIVATE_ENCRYPT].includes(o);if(i.enableMp4MSE||r||(null==(t=null==i?void 0:i.autoBitrateOpts)?void 0:t.enable)||n||a){return[yield Kw.loadMp4Encrypt(e)]}return[]}))}setPluginConfigInVid(e,t){var i;const{vid:n,defaultDefinitionData:r}=e,{config:o,privateDrmAuthToken:a,sessionId:s,useUnionInfoDRM:l}=t,u=!!r.kid,{autoBitrateOpts:h,Mp4EncryptPlayer:d,enableMp4MSE:f}=this.playerData.configs,p=this.playerData.drmType===or.PRIVATE_ENCRYPT_UPGRADE;if(u||(null==h?void 0:h.enable)||d||f){const{kid:e,secretKey:t}=r,h=null==(i=this.playerData.configs)?void 0:i.Mp4EncryptPlayer,d="object"==typeof h?h:{};if(u){if(p)this.playerData.options.Mp4EncryptPlayer=c({vid:n,kid:e,isEncrypt:!0,rangeMaxDuration:10,keyTokenExpiredDuration:9999999,retryCount:3,useUnionInfoDRM:!0,sessionId:this.playerData.encryptSessionId,drmType:or.PRIVATE_ENCRYPT_UPGRADE,preferMMS:!0,secretKey:t},d);else if(a&&s){const t=Es(a),i=parseInt(""+t["X-Expires"]),r=isNaN(i)?30:i;this.playerData.options.Mp4EncryptPlayer=c({vid:n,kid:e,isEncrypt:!0,rangeMaxDuration:10,retryCount:3,drmKeyToken:a,useUnionInfoDRM:l,keyTokenExpiredDuration:r,preferMMS:!0,sessionId:s,playDomain:o.playDomain||this.playerData.playDomain},d)}}else this.playerData.options.Mp4EncryptPlayer=c({vid:n,retryCount:3,preferMMS:!0},d)}}}let Yw=!1;class zw extends Bw{applyAbrPluginConfig(e,t){e.DASHPlugin=u(c({},e.DASHPlugin),{autoBitrateOpts:t})}prepareAbrModule(e,t){return d(this,null,(function*(){var i;const n=null==(i=e.configs)?void 0:i.autoBitrateOpts;e.isOpenABR()&&!(null==n?void 0:n.module)&&e.updateConfigs({autoBitrateOpts:u(c({},n),{module:yield t.loadPlugins(Hw.DashAbralgo)})})}))}needAbrAutoDefinition(){return!1}setAbrDefaultDefiWithAuto(){return!1}useNativeAbr(){return!1}canOpenAbr(e){if(this.playerData.isVidPlay()&&e){const{enableAdaptive:t,adaptiveBitrateStreamingInfo:i,playList:n=[]}=e;if(!(n.length>2&&t&&i))return Yw&&ss.warn("The obtained media information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether the video contains ABR transcoding products."),Yw=!1,!1}return!0}canAdaptRangeEnable(){var e;return!(null==(e=Kr.os)?void 0:e.isIos)}generatePlaylistFromServer(e){Yw=!0;const{playList:t=[]}=e||{};return t.filter((e=>e.FileType===vs.VIDEO))}adaptRangeDefaultOptions(){return{maxTargetCacheDur:60,minTargetCacheDur:50,rangeMaxDuration:15,rangeMinDuration:5,cacheSafeFactor:2,estPTcontrol:!0,estPlayTime:12,minBandwidth:1e6,minDangerThreshold:3,rangeControl:!0,rangeMinSize:409600,safeFactor:.1,targetCacheControl:!0}}applyAdaptRangePluginConfig(e,t){var i;e.DASHPlugin=u(c({},null!=(i=e.DASHPlugin)?i:{}),{adaptRange:t})}applyAdaptRangeStrategy(e,t){var i,n;e.DASHPlugin=u(c({},e.DASHPlugin),{adaptRange:c(c(c({},this.adaptRangeDefaultOptions()),null!=(n=null==(i=e.DASHPlugin)?void 0:i.adaptRange)?n:{}),t)})}getPlugins(e){return d(this,null,(function*(){var t,i;const n=yield e.loadPlugins(Hw.DASH);return(null==(i=null==(t=null==n?void 0:n.encryptUtils)?void 0:t.isSupported)?void 0:i.call(t))?[n]:(ss.warn("current browser is not supported DASHPlugin"),[])}))}setPluginConfigInVid(e,t){var i;const{vid:n,playList:r=[],dashOpts:o,defaultDefinitionData:a}=e||{},{config:s,privateDrmAuthToken:l,sessionId:u,useUnionInfoDRM:h}=t,d=c({},(null==(i=this.playerData.configs)?void 0:i.DASHPlugin)||{}),{kid:f,secretKey:p}=a,g=this.playerData.drmType===or.PRIVATE_ENCRYPT_UPGRADE,y=o.Data.PlayInfoList.reduce(((e,t)=>{const i=t.Definition||t.Quality;let n="";const o=r.find((e=>e.Definition===i||e.Quality===i));return o&&(n=o.definition),e[i]=n,e}),{});if(this.playerData.dashOpts=o,g)this.playerData.options.DASHPlugin=c({playInfoType:"TOP",useEME:!0,keyTokenExpiredDuration:9999999,useUnionInfoDRM:!0,defaultFormat:"dash",replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3,vid:n,definitionText:y,defaultDefinition:a.definition,kid:f,dashOpts:o,drmType:or.PRIVATE_ENCRYPT_UPGRADE,secretKey:p,sessionId:this.playerData.encryptSessionId,playDomain:s.playDomain||this.playerData.playDomain},d);else if(l&&u&&this.playerData.drmType!==or.DRM_ENCRYPT){const e=Es(l),t=parseInt(""+e["X-Expires"]),i=isNaN(t)?30:t;this.playerData.options.DASHPlugin=c({playInfoType:"TOP",vid:n,dashOpts:o,defaultFormat:"dash",definitionText:y,defaultDefinition:a.definition,useUnionInfoDRM:h,kid:f,keyTokenExpiredDuration:i,sessionId:u,drmKeyToken:l,playDomain:s.playDomain||this.playerData.playDomain,replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3},d)}else this.playerData.options.DASHPlugin=c({vid:n,dashOpts:o,playInfoType:"TOP",defaultFormat:"dash",definitionText:y,defaultDefinition:a.definition,replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3},d)}}var $w=/\s/;var Xw=/^\s+/;function qw(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&$w.test(e.charAt(t)););return t}(e)+1).replace(Xw,""):e}var Zw=NaN,Qw=/^[-+]0x[0-9a-f]+$/i,Jw=/^0b[01]+$/i,eA=/^0o[0-7]+$/i,tA=parseInt;function iA(e){if("number"==typeof e)return e;if(Cn(e))return Zw;if(A(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=A(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=qw(e);var i=Jw.test(e);return i||eA.test(e)?tA(e.slice(2),i?2:8):Qw.test(e)?Zw:+e}const nA=function(){return _.Date.now()};var rA="Expected a function",oA=Math.max,aA=Math.min;function sA(e,t,i){var n,r,o,a,s,l,c=0,u=!1,h=!1,d=!0;if("function"!=typeof e)throw new TypeError(rA);function f(t){var i=n,o=r;return n=r=void 0,c=t,a=e.apply(o,i)}function p(e){var i=e-l;return void 0===l||i>=t||i<0||h&&e-c>=o}function g(){var e=nA();if(p(e))return y(e);s=setTimeout(g,function(e){var i=t-(e-l);return h?aA(i,o-(e-c)):i}(e))}function y(e){return s=void 0,d&&n?f(e):(n=r=void 0,a)}function v(){var e=nA(),i=p(e);if(n=arguments,r=this,l=e,i){if(void 0===s)return function(e){return c=e,s=setTimeout(g,t),u?f(e):a}(l);if(h)return clearTimeout(s),s=setTimeout(g,t),f(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=iA(t)||0,A(i)&&(u=!!i.leading,o=(h="maxWait"in i)?oA(iA(i.maxWait)||0,t):o,d="trailing"in i?!!i.trailing:d),v.cancel=function(){void 0!==s&&clearTimeout(s),c=0,n=l=r=s=void 0},v.flush=function(){return void 0===s?a:y(nA())},v}const lA=class{static registerModules(e){for(const[t,i]of Object.entries(e)){if(!Object.values(Hw).includes(t))throw new Error(`Unknown UMD key: ${t}`);if(void 0===i)throw new Error(`Registered UMD module ${t} must not be undefined`)}Object.assign(lA.registeredModules,e)}clearPluginCache(e){const t=`${this.pluginPublicPath}_${e}_load`;delete lA.jsLoadMap[t],delete lA.jsLoadPromiseMap[t]}constructor(){this.umdMap=jw,this.backupUmdUrlMap={},this.region={}.__DEFAULT_REGION__,this.customPluginPublicPath=""}get pluginPublicPath(){var e;return this.customPluginPublicPath||(null==(e=nl(this.userRegion,this.region))?void 0:e.__UMD_PRE_PATH__)}updateBackupMap(e){this.backupUmdUrlMap=e}loadExtraCdn(e,t=!0){return new Promise(((i,n)=>{const r=t?document.createElement("script"):document.createElement("link");t?r.src=e:(r.rel="stylesheet",r.type="text/css",r.href=e),r.onerror=()=>{n(`url: ${e}`)},r.onload=r.onreadystatechange=function(){(null==this?void 0:this.readyState)&&"loaded"!==(null==this?void 0:this.readyState)&&"complete"!==(null==this?void 0:this.readyState)||(r.onload=r.onreadystatechange=null,i())},document.body.appendChild(r)}))}loadPlugins(e,t){return new Promise((i=>{var n;const r=`${this.pluginPublicPath}_${e}_load`;if(Object.prototype.hasOwnProperty.call(lA.registeredModules,e))return this.triggerSuccessCallback(t),i(lA.registeredModules[e]);if(Reflect.get(lA.jsLoadMap,r))return i(lA.jsLoadMap[r]);const o=this.umdMap[e];if((null==(n=this.importedPlugins)?void 0:n.length)>0&&o.pluginName){const e=this.importedPlugins.find((e=>e.pluginName===o.pluginName));if(e)return i(e)}if(!o)return ss.error(`${e} umd info not exit`),this.handleLoadError(e,void 0,i);const{name:a,devPath:s}=o,l=a?Vn(window,a):null;if(l)return lA.jsLoadMap[r]=l,this.triggerSuccessCallback(t),i(l);const c=`${this.pluginPublicPath}/${e+".js"}`;let u=lA.jsLoadPromiseMap[r];ss.log(`umdLoader cache hit ${r}=${!!u}`),u||(u=Zs((()=>this.loadExtraCdn(c,!0)),2),lA.jsLoadPromiseMap[r]=u),u.then((()=>this.handleLoadSuccess(r,a,t,i))).catch((n=>this.handleLoadCatch(n,e,r,a,t,i)))}))}handleLoadSuccess(e,t,i,n){const r=t?Vn(window,t):null;lA.jsLoadMap[e]=null==r||r,this.triggerSuccessCallback(i),null==n||n(r)}handleLoadError(e,t,i){this.failCallback&&"function"==typeof this.failCallback&&this.failCallback(e,t),i(null)}handleLoadCatch(e,t,i,n,r,o){const a=this.backupUmdUrlMap[t];a?this.loadBackupUrl(a,t,i,n,r,o):(ss.error(`load ${t} error, ${e}`),this.handleLoadError(t,e,o))}loadBackupUrl(e,t,i,n,r,o){if(!((a=e)&&a.indexOf&&/^(?:http|data:|\/)/.test(a)))return ss.error(`umdMap.${t} isn't a valid url`),this.handleLoadError(t,void 0,o);var a;this.loadExtraCdn(e).then((()=>this.handleLoadSuccess(i,n,r,o))).catch((e=>{ss.error(`load ${t} error, ${e}`),this.handleLoadError(t,void 0,o)}))}triggerSuccessCallback(e){e&&e()}};let cA=lA;cA.jsLoadMap={},cA.jsLoadPromiseMap={},cA.registeredModules={};const uA=new cA;var hA=(e=>(e.H265="h265",e.PRELOAD="preload",e.ADAPT_RANGE="adaptRange",e))(hA||{});function dA(e){if(!e||"boolean"==typeof e)return{config:{}};const t=e,{Strategy:i,disabled:n,config:r}=t,o=h(t,["Strategy","disabled","config"]);return u(c({},e),{config:c(c({},o),null!=r?r:{})})}var fA=(e=>(e[e.DISABLED=0]="DISABLED",e[e.INITIALIZING=1]="INITIALIZING",e[e.READY=2]="READY",e[e.FAILED=3]="FAILED",e))(fA||{});class pA{constructor(e){this.strategyKey=hA.PRELOAD,this.preloaderStatus=1,this.preloadCacheConfig={},this.preloadCacheList=[],this._strategyManager=e,this.sdkUmdLoader=new cA}init(e){return d(this,null,(function*(){var t,i,n,r,o,a,s,l,h;const f=null==(t=null==e?void 0:e.strategies)?void 0:t[hA.PRELOAD],p="boolean"==typeof f;if(!f||!p&&(null==f?void 0:f.disabled))return this.preloaderStatus=0,!1;const g=null==(i=dA(f))?void 0:i.config,y=null==(a=null==(o=null==(r=null==(n=this._strategyManager.config)?void 0:n.strategies)?void 0:r[hA.PRELOAD])?void 0:o.Strategy)?void 0:a.preloader;if(!(null==y?void 0:y.register))return this.preloaderStatus=3,!1;y.init((()=>d(this,null,(function*(){ss.log("preloader init");const[e,t]=yield Promise.all([Kw.loadPreloader(this.sdkUmdLoader),p||"hls"!==(null==f?void 0:f.format)?Kw.loadMp4Encrypt(this.sdkUmdLoader):Kw.loadHlsjsPro(this.sdkUmdLoader)]);if(!(null==e?void 0:e.PreloaderManager)||!t)return this.preloaderStatus=3,void ss.error("preloader init error");const i=(null==t?void 0:t.Mp4Preloader)||(null==t?void 0:t.HlsPreloader);return u(c({},g),{PreloaderModule:e.PreloaderManager,loaders:[i].filter((e=>!!e)),playPlugins:[t]})}))));const v=yield y.prepare();if(!v)return this.preloaderStatus=3,void ss.warn("preloader prepare fail",v);this.preloaderStatus=2,null==(h=null==(l=null==(s=y.inst)?void 0:s.call(y))?void 0:l.on)||h.call(l,"prf_data_size",(e=>{var t,i;null==(i=null==(t=this._strategyManager.tea)?void 0:t.event)||i.call(t,"veplayer_preload_prf_data_size",c({},e))})),this.preloader=y,this.initPreloaderConfig()}))}addPreloadList(e){if(1===this.preloaderStatus)return this.preloadCacheList=this.preloadCacheList.concat(null!=e?e:[]),void ss.log("preloader add preload cache list",e);2!==this.preloaderStatus?this.preloadCacheList=[]:this.preloader.addPreloadList(e)}setPreloadList(e){return d(this,null,(function*(){if(1===this.preloaderStatus)return this.preloadCacheList=null!=e?e:[],void ss.log("preloader set preload cache list",e);2!==this.preloaderStatus?this.preloadCacheList=[]:this.preloader.setPreloadList(null!=e?e:[])}))}setPreloadScene(e,t){if([1,0].includes(e))return 1===this.preloaderStatus?(this.preloadCacheScene!==e&&(this.preloadCacheList=[],ss.log("preloader reset preload cache list")),this.preloadCacheScene=e,this.preloadCacheConfig=c(c({},this.preloadCacheConfig),null!=t?t:{}),void ss.log("preloader set preload cache config",this.preloadCacheScene,this.preloadCacheConfig)):void(2!==this.preloaderStatus||this.preloader.setPreloadScene(e,t))}initPreloaderConfig(){var e,t,i,n;"undefined"!==this.preloadCacheScene&&this.preloader.setPreloadScene(this.preloadCacheScene,null!=(e=this.preloadCacheConfig)?e:{}),(null==(t=this.preloadCacheList)?void 0:t.length)&&(this.preloader.setPreloadList(this.preloadCacheList),null==(n=(i=this.preloader).checkPreloadData)||n.call(i),this.preloadCacheList=[])}}class gA{constructor(e){this.strategyKey=hA.H265,this._strategyManager=e}init(){return d(this,null,(function*(){return!0}))}isHevcRecommended(){var e,t;return!!(null==(t=null==(e=this._strategyManager.getStrategyRecommendations().result)?void 0:e[hA.H265])?void 0:t.enableH265Hardware)}}const yA=new class{constructor(){var e,t;this.teaId=null==(e=nl())?void 0:e.__LOG_TEA_ID__,this.teaChannel=null==(t=nl())?void 0:t.__LOG_CHANNEL__,this.status=0,this.initUmdLoader()}get preloader(){var e;return null==(e=this.preloadWrapper)?void 0:e.preloader}get preloaderStatus(){var e,t;return null!=(t=null==(e=this.preloadWrapper)?void 0:e.preloaderStatus)?t:fA.INITIALIZING}initUmdLoader(){this.sdkUmdLoader=new cA}fetchWebId(){return d(this,null,(function*(){var e,t;return(null==(e=this.config)?void 0:e.deviceId)?Promise.resolve(null==(t=this.config)?void 0:t.deviceId):new Promise((e=>{var t;return(null==(t=this.tea)?void 0:t.getToken)?this.tea.getToken((t=>e(null==t?void 0:t.web_id))):e("default_web_id")})).then((e=>(this.config=u(c({},this.config),{deviceId:e}),this.webId)))}))}initTea(e){var t,i;const n=this.collector;n&&(e&&(this.teaId=null==(t=nl(e))?void 0:t.__LOG_TEA_ID__,this.teaChannel=null==(i=nl(e))?void 0:i.__LOG_CHANNEL__),this.tea=new n(`${this.teaId}_vestrategy_tracker`),this.tea.init({app_id:this.teaId,channel:this.teaChannel}),this.tea.start())}fetchVeStrategy(){return d(this,null,(function*(){if(this.config.Module)return;const e=yield Kw.loadVeStrategy(this.sdkUmdLoader);e&&(this.config=u(c({},this.config),{Module:e}))}))}fetchStrategies(){return d(this,null,(function*(){const e={};return Kw.prepareStrategyLoad(this.sdkUmdLoader),yield Promise.all(Object.keys(this.config.strategies).map((t=>d(this,null,(function*(){if(!this.config.strategies[t])return;!0===this.config.strategies[t]&&(this.config.strategies[t]={});const{Strategy:i}=this.config.strategies[t];if(i)e[t]=this.config.strategies[t];else{const i=t;if(!["h265","preload","adaptRange"].includes(i))return;const n=yield Kw.loadStrategy(this.sdkUmdLoader,i);n&&(e[t]=u(c({},this.config.strategies[t]),{Strategy:n}))}e[t]=dA(e[t])}))))),this.config.strategies=e,e}))}initOnce(e){return d(this,null,(function*(){if(!e||!e.appId)return;this.collector=Fs(),this.initTea(e.region),this.status=1,this.config=e;try{yield Promise.all([this.fetchWebId(),this.fetchVeStrategy()]),yield this.fetchStrategies()}catch(ds){}const{appId:t,deviceId:i,Module:n}=this.config;if(t&&i&&n){this.Module=n;const e=this.collector;yield n.bootstrap(u(c(u(c({},this.config),{strategies:this.config.strategies}),e?{tracker:{Collector:e,enableABVersion:!1}}:{}),{log:{logger:ss}})),this.status=2,this.preloadWrapper=new pA(this),this.h265Wrapper=new gA(this)}else this.status=3;return this.isReady()}))}init(e){return d(this,null,(function*(){var t,i;const n=e;return this.initPromise?(null==(i=this.config)?void 0:i.serviceConfigMode)&&(null==n?void 0:n.serviceConfigMode)&&this.config.serviceConfigMode!==n.serviceConfigMode&&ss.warn("[VeStrategy] Ignoring conflicting serviceConfigMode after initialization has started."):((null==(t=null==e?void 0:e.plugins)?void 0:t.length)&&Kw.setImportedPlugins(this.sdkUmdLoader,e.plugins),this.initPromise=this.initOnce(n).then((t=>d(this,null,(function*(){var i,n;return t&&(yield Promise.all([null==(i=this.preloadWrapper)?void 0:i.init(e),null==(n=this.h265Wrapper)?void 0:n.init()])),t}))))),this.initPromise}))}addPreloadList(e){this.preloadWrapper&&this.preloadWrapper.addPreloadList(e)}setPreloadList(e){return d(this,null,(function*(){if(this.preloadWrapper)return this.preloadWrapper.setPreloadList(e)}))}setPreloadScene(e,t){this.preloadWrapper&&this.preloadWrapper.setPreloadScene(e,t)}prepare(){return this.initPromise||Promise.resolve(this.isReady())}getDeviceId(){var e;return null==(e=this.config)?void 0:e.deviceId}isReady(){return 2===this.status}getStrategyRecommendations(e=void 0,t=void 0){if(!this.isReady())return{plugins:[],pluginConfiguration:{}};const i=this.config.Module.rec(e,t)||{};return ss.log("strategy recommendations:",i),i}getStrategyRecommendationsAsync(e=void 0,t=void 0){return d(this,null,(function*(){if(!this.isReady())return{plugins:[],pluginConfiguration:{}};const i=yield this.config.Module.recAsync(e,t);return ss.log("strategy recommendations:",i),i}))}isHevcRecommended(){var e,t;return this.h265Wrapper?this.h265Wrapper.isHevcRecommended():!!(null==(t=null==(e=this.getStrategyRecommendations().result)?void 0:e[hA.H265])?void 0:t.enableH265Hardware)}};let vA=!1;class mA extends Bw{constructor(e){super(e)}applyAbrPluginConfig(e,t){var i;e.EncryptHlsPlugin=u(c({},e.EncryptHlsPlugin),{autoBitrateOpts:t,maxBufferLength:(null==(i=e.EncryptHlsPlugin)?void 0:i.maxBufferLength)||40})}prepareAbrModule(e,t){return d(this,null,(function*(){var i;const n=null==(i=e.configs)?void 0:i.autoBitrateOpts;!e.isOpenABR()||(null==n?void 0:n.module)||this.useNativeAbr()||e.updateConfigs({autoBitrateOpts:u(c({},n),{module:yield t.loadPlugins(Hw.DashAbralgo)})})}))}needAbrAutoDefinition(){return!0}setAbrDefaultDefiWithAuto(){return!this.useNativeAbr()}generatePlaylistFromServer(e,t){var i,n,r;vA=!0;const{vid:o,playList:a=[],enableAdaptive:s,adaptiveBitrateStreamingInfo:l}=e||{};if(t&&(null==l?void 0:l.MainPlayUrl))return[{vid:o,url:null==l?void 0:l.MainPlayUrl,_mainURL:l.MainPlayUrl,_backupURL:l.BackupPlayUrl,streamType:l.AbrFormat,backupUrl:l.BackupPlayUrl,backUrlList:[l.BackupPlayUrl],isMasterM3u8:!0}];const c=[...a||[]];if(this.useNativeAbr()&&(null==(r=null==(n=null==(i=this.playerData)?void 0:i.configs)?void 0:n.autoBitrateOpts)?void 0:r.enable)&&s&&l&&c.length){const e={url:l.MainPlayUrl,definition:"auto",streamType:"hls",format:"hls",backupUrl:l.BackupPlayUrl,backUrlList:[l.BackupPlayUrl],vid:o};c.push(e)}return c}useNativeAbr(){return Kr.os.isIos||"safari"===Kr.browser&&this.playerData.drmType===or.DRM_ENCRYPT}canOpenAbr(e){if(this.playerData.isVidPlay()&&e){const{enableAdaptive:t,adaptiveBitrateStreamingInfo:i,playList:n=[]}=e;if(!(n.length>1&&t&&i))return vA&&ss.warn("The obtained media information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether the video contains ABR transcoding products."),vA=!1,!1}return!0}canAdaptRangeEnable(){return!1}adaptRangeDefaultOptions(){}applyAdaptRangePluginConfig(e,t){}applyAdaptRangeStrategy(e,t){}getPlugins(e){return d(this,null,(function*(){var t,i,n;if(null==(i=null==(t=yA.config)?void 0:t.strategies)?void 0:i[hA.PRELOAD]){return[yield e.loadPlugins(Hw.HLSjsPro)]}const{configs:r,options:o,useHlsPluginForSafari:a,enableHlsJs:s,isVidEncrypt:l,isLive:c,openSoftDecoding:u,isMobile:h,drmType:d}=this.playerData,f=d===or.DRM_ENCRYPT,p=[or.PRIVATE_ENCRYPT_UPGRADE,or.PRIVATE_ENCRYPT].includes(d),g=$s(r,"EncryptHlsPlugin");if(!!(null==g?void 0:g.keyToken)||l&&!f||p||this.playerData.isOpenABR()&&!(null==(n=null==this?void 0:this.useNativeAbr)?void 0:n.call(this))){return[yield e.loadPlugins(Hw.HLSEncrypt)]}{const t=$s(o,"Subtitle"),i=c&&t,n=(Qs()||window.WebAssembly)&&u,l=r.enableHlsMSE,d=r.enableMobileHlsPlugin&&(Kr.os.isAndroid&&Qs()||Kr.os.isIos&&Js()),p=f&&Kr.os.isAndroid,g=f&&il,y=h&&!document.createElement("video").canPlayType("application/vnd.apple.mpegurl");if(h&&(n||i||l||d||p||y)||!(h||il&&!a||g)){return[yield e.loadPlugins(s?Hw.HLSjsPro:Hw.HLS)]}}}))}setPluginConfigInVid(e,t){var i;const{vid:n,defaultDefinitionData:r}=e,{config:o,privateDrmAuthToken:a,sessionId:s,useUnionInfoDRM:l}=t,{playDomain:u,keyToken:h,getKeyType:d}=o,f=!!r.kid,p=this.playerData.drmType===or.DRM_ENCRYPT,g=this.playerData.drmType===or.PRIVATE_ENCRYPT_UPGRADE;if(f&&!p){const e=null==(i=this.playerData.configs)?void 0:i.EncryptHlsPlugin,t="object"==typeof e?e:{},{kid:o,secretKey:f}=r;if(h)this.playerData.options.EncryptHlsPlugin=c({keyToken:h,playDomain:u||this.playerData.playDomain,getKeyType:d||"TOP",preferMMS:!0,preferMMSStreaming:!0},t);else if(g)this.playerData.options.EncryptHlsPlugin=c({vid:n,kid:o,useUnionInfoDRM:!0,sessionId:this.playerData.encryptSessionId,drmType:or.PRIVATE_ENCRYPT_UPGRADE,keyTokenExpiredDuration:9999999,secretKey:f,preferMMS:!0,preferMMSStreaming:!0},t);else if(a&&s){const e=Es(a),i=parseInt(""+e["X-Expires"]),r=isNaN(i)?30:i;this.playerData.options.EncryptHlsPlugin=c({vid:n,kid:o,keyTokenExpiredDuration:r,drmKeyToken:a,useUnionInfoDRM:l,sessionId:s,playDomain:u||this.playerData.playDomain,preferMMS:!0,preferMMSStreaming:!0},t)}}}}class _A extends Bw{applyAbrPluginConfig(e,t){}needAbrAutoDefinition(){return!1}prepareAbrModule(e,t){}setAbrDefaultDefiWithAuto(){return!1}generatePlaylistFromServer(e,...t){const{playList:i=[]}=e||{};return[...i||[]]}useNativeAbr(){return!1}canOpenAbr(){return!1}canAdaptRangeEnable(){return!1}adaptRangeDefaultOptions(){}applyAdaptRangePluginConfig(e,t){}applyAdaptRangeStrategy(e,t){}getPlugins(){return Promise.resolve([])}setPluginConfigInVid(){}}var EA=(e=>(e.EDITION_STANDARD="standard_edition",e.EDITION_PREMIUM="premium_edition",e.EDITION_NONE="none_edition",e))(EA||{}),TA=(e=>(e.SDK_VOD_PLAY="web_vod_play",e.SDK_LIVE_PULL="web_live_pull",e))(TA||{}),SA=(e=>(e.H265="h265",e.PRELOAD="preload",e.ADAPT_RANGE="adaptRange",e.ABR="abr",e))(SA||{}),bA=(e=>(e[e.LICENSE_STATUS_INVALID=0]="LICENSE_STATUS_INVALID",e[e.LICENSE_STATUS_OK=1]="LICENSE_STATUS_OK",e[e.LICENSE_STATUS_EXPIRED=2]="LICENSE_STATUS_EXPIRED",e[e.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH=401]="LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH",e))(bA||{});const CA={setLicenseConfig:e=>d(exports,null,(function*(){})),checkLicense:()=>d(exports,null,(function*(){return"premium_edition"})),checkModuleList:()=>d(exports,null,(function*(){return Object.values(SA)})),checkLicenseStatus:()=>d(exports,null,(function*(){return 1})),checkLicenseModuleAuth:(e,t)=>d(exports,null,(function*(){return!0})),renderLogo:e=>{}};class kA{constructor(e,t){var i,n;this.id="",this.type="",this.isLive=!1,this.options=null,this.isMobile=!1,this.playList=[],this.plugins=[],this.openSoftDecoding=!1,this.current={lineId:0,language:"",definition:"",streamType:"",codec:tr.UNKNOWN,kid:"",secretKey:"",drmType:void 0},this.strategiesPlugins=[],this.strategiesPluginConfigs={},this.urlCheckData={enableUrlExpireCheck:!1,urlExpireTimestamp:qa,urlExpireDiff:60,urlCheckExpireInterval:400},this.isAutoBitrateEnable=!1,this.isVidEncrypt=!1,this.drmType=void 0;const r=e,{options:o,type:a,isLive:s,id:l,root:c,plugins:u=[],defaultConfig:d,languages:f,codec:p,isMobile:g=!1,enableH265Degrade:y=!1,onMediaExpired:v,onTokenExpired:m,unionId:_,isMusic:E=!1,sdkPlugins:T=[],useHlsPluginForSafari:S=!0,enableHlsJs:b=!0,enableMenu:C=!1,region:k={}.__DEFAULT_REGION__,userRegion:I,debug:P=!1,licensSupportModuleList:D=Object.values(SA),encryptSessionId:w}=r,A=h(r,["options","type","isLive","id","root","plugins","defaultConfig","languages","codec","isMobile","enableH265Degrade","onMediaExpired","onTokenExpired","unionId","isMusic","sdkPlugins","useHlsPluginForSafari","enableHlsJs","enableMenu","region","userRegion","debug","licensSupportModuleList","encryptSessionId"]);this.configs=e,this.sdk=t,P&&(ss.config.debug=3),this.options=Object.assign({},o,A),this.options.poster="string"==typeof this.options.poster?function(e){const t=""+e,i=cl.exec(t);if(!i)return t;let n,r,o="",a=0;for(r=i.index;r<t.length;r++){switch(t.charCodeAt(r)){case 34:n="&quot;";break;case 38:n="&amp;";break;case 39:n="&#x27;";break;case 60:n="&lt;";break;case 62:n="&gt;";break;default:continue}a!==r&&(o+=t.substring(a,r)),a=r+1,o+=n}return a!==r?o+t.substring(a,r):o}(this.options.poster):this.options.poster,this.options.icons=(e=>{const t={};return e&&Object.entries(e).forEach((([e,i])=>{i&&"string"!=typeof i&&(t[e]=i)})),t})(this.options.icons),this.id=l,this.root=c,this.type=a,this.isLive=!!(null!=s?s:"live"===a),this.defaultConfig=d,this.languageData=this.initI18nData(f),this.isMobile=g||"mobile"===Kr.device,this.openSoftDecoding=null==(i=this.configs)?void 0:i.useSoftDecoding,this.enableH265Degrade=y,this.codec=p||tr.UNKNOWN,this.onMediaExpired=v,this.onTokenExpired=m,null==(n=this.setVodPlayListConfig)||n.call(this,this.configs),this.current=hr.observe(this.current),this.plugins=[...u],this.isMusic=E,this.unionId=_,this.sdkPlugins=T,this.useHlsPluginForSafari=S,this.enableHlsJs=b,this.enableMenu=C,C&&(this.options.enableContextmenu=!0,this.options.closeVideoStopPropagation=!0),this.region=k,this.userRegion=I,this.setVodTeaId(),this.playDomainDegrade=!1,this.dashOpts=null,this.encryptSessionId=w,this.initPlayData(this.configs),hr.subscribeProperty(this.current,"definition",this.updateCheckExpireData.bind(this))}initPlayData(e){const t=this.initPlaylistAndGetCurrent(e);this.initCurrent(t)}initPlaylistAndGetCurrent(e){var t,i;const{url:n,playList:r=[],streamType:o="",definitionText:a,definitionTextKey:s,urlExpireTimestamp:l,playAuth:h,playAuthId:d}=e,f=e.defaultDefinition||this.configs.defaultDefinition,p=e.codec||tr.UNKNOWN;(null==e?void 0:e.autoBitrateOpts)&&this.updateConfigs({autoBitrateOpts:c(c({},null!=(t=this.configs.autoBitrateOpts)?t:{}),e.autoBitrateOpts)});let g=null;const y=fi([...r].filter((e=>e.url)).map(((e,t)=>u(c({},e),{bitrate:e.bitrate||e.Bitrate||1e3*(t+1),secretKey:e.playAuth,kid:e.playAuthId}))));if(n)if(0===y.length){const e=c(u(c({},this.current),{url:n,streamType:o,definitionTextKey:s,codec:p,secretKey:h,kid:d,urlExpireTimestamp:l}),s||a?{definition:a}:{definition:"HD"});this.playList=[e],this.defaultDefinition=e.definition}else{this.playList=y;const e=this.getUrlList({url:n});e.length>0?g=e[0]:ss.warn("default url is not match Playlist")}else this.playList=y;e.drmType&&this.setDrmType(e.drmType);let v=this.getCurrentByDefaultConfig();v?this.defaultDefinition=v.definition:(v=g||(f&&(null==(i=this.getUrlList({definition:f}))?void 0:i[0])||this.playList[0]),this.defaultDefinition=null==v?void 0:v.definition);const m=this.getTargetStreamType(v);if(this.adapter=function(e,t){const i=u(c({},t),{streamType:e});switch(null==e?void 0:e.toLowerCase()){case"mp4":case"m4a":return new Ww(i);case"dash":return new zw(i);case"hls":return new mA(i);default:return ss.log(`no adapter match ${e}, use others adapter by default`),new _A(i)}}(m,{configs:this.configs,playerData:this}),this.isAutoBitrateEnable=this.checkAutoBitratePlayList(),this.isOpenABR()){const e=this.getABRStreamInfo(m,v);v=e.defaultStream,this.playList=e.playList,this.defaultDefinition=e.defaultDefinition}return this.playList.forEach((e=>{(null==e?void 0:e.streamType)&&(e.vtype=e.streamType.toUpperCase()),(null==e?void 0:e.codec)&&(e.codecType=e.codec)})),v}checkAutoBitratePlayList(){var e,t;return!(Kr.os.isIos&&this.adapter.needAbrAutoDefinition()&&!(null==(t=null==(e=this.playList)?void 0:e.find((e=>this.isAutoDefinition(null==e?void 0:e.definition))))?void 0:t.url))}getABRStreamInfo(e,t){var i,n,r,o,a;let s=this.defaultDefinition;const l=(null==(n=null==(i=this.playList)?void 0:i.concat)?void 0:n.call(i))||[];let c=t;const u=l.findIndex((e=>this.isAutoDefinition(null==e?void 0:e.definition))),h=-1!==u?l.splice(u,1)[0]:void 0,d={definition:null!=(r=null==h?void 0:h.definition)?r:"auto",bitrate:void 0,definitionTextKey:(null==h?void 0:h.definitionTextKey)||(null==(a=null==(o=this.configs)?void 0:o.autoBitrateOpts)?void 0:a.definitionTextKey)||"DEFINITION_AUTO",url:(null==h?void 0:h.url)||"__auto__",name:"auto",streamType:e||this.configs.streamType};return this.isAutoDefinition(this.configs.defaultDefinition)||(d.bitrate=null==c?void 0:c.bitrate,s=null==c?void 0:c.definition),this.isPlayAutoDefinition()&&(c=d,this.adapter.setAbrDefaultDefiWithAuto()&&(s=d.definition)),l.push(d),{defaultDefinition:s,defaultStream:c,playList:l}}isCurrentH265(){if(this.codec){return this.codec.replace(".","").toLowerCase()===tr.H265}return!1}setDrmType(e){this.drmType=e}getCurrentByDefaultConfig(){if(!this.defaultConfig)return;const{type:e,isLive:t,lineId:i="",definition:n=""}=this.defaultConfig;if((null!=t?t:"live"===e)!==this.isLive)return;if(!i&&!n)return ss.warn("默认配置未设置默认线路或默认清晰度"),void(this.isHitDefault=!1);const r=this.getUrlList({lineId:i,definition:n});return r.length>0?(this.isHitDefault=!0,r[0]):(ss.warn("playlist中没有满足默认配置的流"),void(this.isHitDefault=!1))}initCurrent(e){var t,i,n;Object.keys(this.current).forEach((t=>{this.current[t]=null==e?void 0:e[t]}));const r=null==e?void 0:e.codec;this.codec=r&&Object.values(tr).includes(r)?r:tr.UNKNOWN,(null==(t=this.current)?void 0:t.drmType)&&this.setDrmType(null==(i=this.current)?void 0:i.drmType),this.isVidEncrypt=!!(null==(n=this.current)?void 0:n.kid),this.initCheckExpireData()}initCheckExpireData(){const{enableUrlExpireCheck:e,urlExpireDiff:t,urlCheckExpireInterval:i}=this.configs;Uw(this.urlCheckData,{enableUrlExpireCheck:e,urlExpireDiff:t,urlCheckExpireInterval:i}),this.updateCheckExpireData()}updateCheckExpireData(){var e;const t=null==(e=this.getCurrentStreams())?void 0:e[0];if(t){const{url:e,urlExpireTimestamp:i}=t;if(!e)return;const n=al(""+(i||this.configs.urlExpireTimestamp));n?this.urlCheckData.urlExpireTimestamp=n:this.urlCheckData.enableUrlExpireCheck&&(this.urlCheckData.urlExpireTimestamp=qa,ss.warn("not provide urlExpireTimestamp, url expire check will not work")),ss.log("update urlCheckData to:",this.urlCheckData)}}initI18nData(e){const t=[Ja,es],i=e&&Object.entries(e).reduce(((e,[i,n])=>(za.includes(i)?e.push({LANG:"zh"===i?"zh-cn":i,TEXT:n}):t.push({LANG:i,TEXT:n}),e)),[]);return{extraLangList:t,extendLangList:i}}getCurrentUrl(){var e;return null==(e=this.getCurrentStreams()[0])?void 0:e.url}getTargetStreamType(e){var t;return e?e.streamType||this.configs.streamType||Ws(e.url):this.configs.streamType||Ts(null==(t=this.configs)?void 0:t.getVideoByToken)}getCurrentStreamType(){const e=this.getCurrentStreams();if(e.length){const{url:t,streamType:i}=e[0];return i||this.configs.streamType||Ws(t)||"mp4"}return this.configs.streamType||"mp4"}getStreamType(){var e;return this.getCurrentStreamType()||Ts(null==(e=this.configs)?void 0:e.getVideoByToken)}isOpenABR(){var e,t,i,n,r;if(!this.isAutoBitrateEnable||!(null==(t=null==(e=this.configs)?void 0:e.autoBitrateOpts)?void 0:t.enable)||!(null==(i=this.configs)?void 0:i.isLive)&&!(null==(r=null==(n=this.configs)?void 0:n.licensSupportModuleList)?void 0:r.includes(SA.ABR)))return!1;const o=this.sdk.getSdkPlugin("AuthToken");return this.adapter.canOpenAbr(null==o?void 0:o.playInfo)}showRealDefinition(){var e,t;return!!(null==(t=null==(e=this.configs)?void 0:e.autoBitrateOpts)?void 0:t.showRealDefinition)}isAutoDefinition(e){return["auto","自动"].includes(e)}isPlayAutoDefinition(e=""){var t;return this.isAutoDefinition(e||this.defaultDefinition)||(null==(t=this.configs.autoBitrateOpts)?void 0:t.startWithAuto)}isDefinitionMatch(e,t){return!(!this.isAutoDefinition(e)||!this.isAutoDefinition(t))||e===t}getCurrentStreams(){const e=this.current;return this.getUrlList(e)}getLineList(){return fi(er(this.playList,"lineId"))}getLineListByLineId(e){return this.playList.filter((t=>{var i;return(null==e?void 0:e.toString())===(null==(i=t.lineId)?void 0:i.toString())}))}getDefinitionListByLineId(e){return fi(er(this.getLineListByLineId(e),"definition"))}getUrlList(e){return this.playList.filter((t=>Object.keys(e).every((i=>{var n,r;if("url"===i){const i=null==e?void 0:e.url,n=null==t?void 0:t.url;return"string"==typeof i?i===(null==n?void 0:n.toString()):!(!Array.isArray(i)||!Array.isArray(n))&&i.map((e=>e.src)).join("")===n.map((e=>e.src)).join("")}{const o=(null==(n=e[i])?void 0:n.toString())===(null==(r=t[i])?void 0:r.toString()),a=!e[i];return o||a}}))))}getNextDefinition(e=!0,t){var i,n,r;const o=e?"next":"prev",{definition:a,lineId:s}=this.current;if(!a)return;const l=null==(i=this.getCurrentStreams())?void 0:i[0],c="auto"===a?l.mapDefinition:a,u=(e=>(null==e?void 0:e.length)&&e.reduce(((t,i,n)=>(t[i]={next:n+1>=e.length?null:e[n+1],pre:0===n?null:e[n-1]},t)),{}))(t)||Ya;if(!Object.keys(u).includes(c))return;let h=null==(n=u[c])?void 0:n[o];const d=this.getDefinitionListByLineId(s);for(;0===d.filter((e=>e.definition===h)).length&&h;)h=null==(r=u[h])?void 0:r[o];if(h)return"auto"===a&&h&&(l.mapDefinition=h),this.getUrlList({lineId:s,definition:h});ss.log("已经降至最低级")}get apiMap(){var e;const t="sg",i=null==(e=mB.ttDramaEnv)?void 0:e.channel,n={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}},r={cn:{__PLAY_DOMAIN__:"https://vod.volcengineapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.volcengineapi.com"},mya:{__PLAY_DOMAIN__:"https://vod.ap-southeast-1.volcengineapi.com"}};let o,a=t;"byteplus"===i&&n?(o=n,a="sg"):"volcengine"===i&&r?(o=r,a=o[t]?t:"cn"):o={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}};const s=o[this.region]||o[a];return{playDomain:s.__PLAY_DOMAIN__,backupPlayDomain:null==s?void 0:s.__BACKUP_PLAY_DOMAIN__}}get playDomain(){var e;return this.playDomainDegrade&&null!=(e=this.apiMap.backupPlayDomain)?e:this.apiMap.playDomain}setVodTeaId(){const e=nl(this.userRegion,this.region);!function(e){Dw.TEA_ID=e}(this.configs.logTeaAppId||e.__LOG_TEA_ID__||4951)}getMergedConfigs(e){const t=fi(this.configs);return Bi(t,fi(e),((e,t)=>{if(ge(e))return t})),t}updateConfigs(e){Bi(this.configs,fi(e),((e,t)=>{if(ge(e))return t}))}updatePlayList(){const{url:e,playList:t=[],urlExpireTimestamp:i}=this.configs,n=[...t].filter((e=>e.url));if(e&&!n.length){const t=u(c({},this.current),{url:e,urlExpireTimestamp:i});this.playList=[t]}else this.playList=n}isVidPlay(){var e,t;return!!(null==(t=null==(e=this.configs)?void 0:e.getVideoByToken)?void 0:t.playAuthToken)}}class IA{}IA.isSupported=()=>!1,IA.isSupportedH264=e=>!1;var PA=function(){function e(t){gr(this,e),this.config=t.config,this.parent=t.root,this.root=Ur.createDom("ul","",{},"xg-options-list xg-list-slide-scroll ".concat(this.config.className)),t.root.appendChild(this.root);var i=this.config.maxHeight;i&&this.setStyle({maxHeight:i}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var n="touch"===this.config.domEventType?"touchend":"click";this._delegates=ba.delegate.call(this,this.root,"li",n,this.onItemClick)}return vr(e,[{key:"renderItemList",value:function(e){var t=this,i=this.config,n=this.root;e?i.data=e:e=i.data,i.style&&Object.keys(i.style).map((function(e){n.style[e]=i[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,i){var n=e.selected?"option-item selected":"option-item";e["data-index"]=i,t.root.appendChild(Ur.createDom("li","<span>".concat(e.showText,"</span>"),e,n))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&Ur.hasClass(t,"selected"))return!1;var i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");Ur.addClass(t,"selected"),n&&Ur.removeClass(n,"selected"),i(e,{from:n?this.getAttrObj(n,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var i={};t.map((function(t){i[t]=e.getAttribute(t)}));var n=e.getAttribute("data-index");return n&&(i.index=Number(n)),i}},{key:"show",value:function(){Ur.removeClass(this.root,"hide"),Ur.addClass(this.root,"active")}},{key:"hide",value:function(){Ur.removeClass(this.root,"active"),Ur.addClass(this.root,"hide")}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.root.style[i]=e[i]}))}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map((function(e){e.destroy&&e.destroy()})),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),e}(),DA="side",wA="middle",AA="default",RA="click",xA="hover";var OA="mobile"===Kr.device,LA=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"onEnter",(function(e){e.stopPropagation(),n.emit("icon_mouseenter",{pluginName:n.pluginName}),n.switchActiveState(e)})),mr(Sr(n),"switchActiveState",(function(e){e.stopPropagation(),n.config.toggleMode===RA?n.toggle(!n.isActive):n.toggle(!0)})),mr(Sr(n),"onLeave",(function(e){e.stopPropagation(),n.emit("icon_mouseleave",{pluginName:n.pluginName}),n.config.listType!==DA&&n.isActive&&n.toggle(!1)})),mr(Sr(n),"onListEnter",(function(e){n.enterType=2})),mr(Sr(n),"onListLeave",(function(e){n.enterType=0,n.isActive&&n.toggle(!1)})),n.isIcons=!1,n.isActive=!1,n.curValue=null,n.curIndex=0,n}return vr(i,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.initIcons(),(OA=OA||"touch"===this.domEventType)&&"mobile"===Kr.device&&t.listType===AA&&(t.listType=DA),t.hidePortrait&&Ur.addClass(this.root,"portrait"),this.on([Ro,Io],(function(){e._resizeList()})),this.once(no,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),OA&&this.on(ho,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),OA?(t.toggleMode=RA,this.activeEvent="touchend"):this.activeEvent=t.toggleMode===RA?"click":"mouseenter",t.toggleMode===RA?this.bind(this.activeEvent,this.switchActiveState):(this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave)),this.isIcons&&this.bind("click",this.onIconClick)}},{key:"initIcons",value:function(){var e=this,t=this.icons,i=Object.keys(t),n=!1;i.length>0&&(i.forEach((function(i){e.appendChild(".xgplayer-icon",t[i]),!n&&(n=t[i])})),this.isIcons=n),n||(this.appendChild(".xgplayer-icon",Ur.createDom("span","",{},"icon-text")),Ur.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||Ur.addClass(this.root,"show")}},{key:"hide",value:function(){Ur.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,i){if(void 0===e)return"";var n=this.config.list;!i&&(i=this.player.lang),t=!t||Ur.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=n[e]);try{return"object"===pr(e[t])?e[t][i]||e[t].en:e[t]}catch(r){return console.warn(r),""}}},{key:"toggle",value:function(e){if(e!==this.isActive&&!this.config.disable){var t=this.player.controls,i=this.config.listType;e?(i===DA?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):(i===DA?t.focus():t.focusAwhile(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.stopPropagation();var i=this.config,n=i.listType,r=i.list;this.curIndex=t.to.index,this.curItem=r[this.curIndex],this.changeCurrentText(),(this.config.isItemClickHide||OA||n===DA)&&this.toggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0];t&&(this.find(".icon-text").innerHTML=this.getTextByLang(t,"iconText"))}}},{key:"renderItemList",value:function(e,t){var i=this,n=this.config,r=this.optionsList,o=this.player;if("number"==typeof t&&(this.curIndex=t,this.curItem=n.list[t]),r)return r.renderItemList(e),void this.changeCurrentText();var a,s,l={config:{data:e||[],className:(a=n.listType,s=n.position,a===DA?s===ma.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""),onItemClick:function(e,t){i.onItemClick(e,t)},domEventType:OA?"touch":"mouse"},root:n.listType===DA?o.innerContainer||o.root:this.root};if(this.config.isShowIcon){var c=this.player.root.getBoundingClientRect().height,u=n.listType===wA?c-50:c;u&&n.heightLimit&&(l.config.maxHeight="".concat(u,"px")),this.optionsList=new PA(l),this.changeCurrentText(),this.show()}this._resizeList()}},{key:"_resizeList",value:function(){if(this.config.heightLimit){var e=this.player.root.getBoundingClientRect().height,t=this.config.listType===wA?e-50:e;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(t,"px")})}}},{key:"destroy",value:function(){this.config.toggleMode===RA?this.unbind(this.activeEvent,this.switchActiveState):(this.unbind(this.activeEvent,this.onEnter),this.unbind("mouseleave",this.onLeave)),this.isIcons&&this.unbind("click",this.onIconClick),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null)}},{key:"render",value:function(){if(this.config.isShowIcon)return'<xg-icon class="xg-options-icon '.concat(this.config.className||"",'">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>')}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:100,list:[],listType:"default",listStyle:{},hidePortrait:!0,isShowIcon:!1,isItemClickHide:!0,toggleMode:xA,heightLimit:!0}}}]),i}();const NA={READY:"ready",COMPLETE:"complete",URL_CHANGE:"urlchange",PLAYER_FOCUS:"focus",PLAYER_BLUR:"blur",FULLSCREEN_CHANGE:"fullscreen_change",CSS_FULLSCREEN_CHANGE:"cssFullscreen_change",MINI_STATE_CHANGE:"mini_state_change",DESTROY:"destroy",REPLAY:"replay",RETRY:"retry",DEFINITION_CHANGE:"definition_change",Before_DEFINITION_CHANGE:"before_definition_change",AFTER_DEFINITION_CHANGE:"after_definition_change",VIDEO_RESIZE:"video_resize",PIP_CHANGE:"pip_change",ROTATE:"rotate",SHORTCUT:"shortcut",SEI_PARSED:"SEI_PARSED",USER_ACTION:"user_action",AUTOPLAY_STARTED:"autoplay_started",AUTOPLAY_PREVENTED:"autoplay_was_prevented",READY_CREATE_PLAYER:"ready_create_player",PLAYER_CREATED_FINISH:"player_create_finish",CREATE_PLAYER_PERF:"create_player_perf",PLAYER_REBUILD:"player_rebuild",NOT_SUPPORT_HARDWARE_DECODER:"not_support_hardware_decoder",NOT_SUPPORT_SOFT_DECODER:"not_support_soft_decoder",TOKEN_EXPIRED:"playAuthToken_expired",UMD_LOAD_FAIL:"umd_load_fail",PLAYNEXT:"playnext",URL_NULL:"urlNull",LEAVE_PLAYER:"leaveplayer",ENTER_PLAYER:"enterplayer",RESET:"reset",SOURCE_ERROR:"source_error",SOURCE_SUCCESS:"source_success",LICENSE_STATUS_WARNING:"license_status_warning",AUDIO_TRACKS_UPDATED:"audio_tracks_updated",AUDIO_TRACK_CHANGE:"audio_track_change"},MA=u(c({DANMU_CHANGE:"danmu_change",TIME_SHIFT_CHANGE:"time_shift_change",AI_SUBTITLE_LANG_CHANGE:"ai_subtitle_lang_change",AI_SUBTITLE_MATCH:"ai_subtitle_match",CANCEL_UNMUTE:"cancel_unmute",REFRESH_CLICK:"refresh_click",PLAY_BACKUP_CHANGE:"play_backup_change",PLAY_BACKUP_CHANGE_FINISH:"play_backup_change_finish",PLAY_ERROR_BUTTON_CLICK:"play_error_button_click",PlAY_URL_CHANGE:"play_url_change",SHOW_PLAY_ERROR:"show_play_error",PLAYER_EXTEND_BUTTON:"player_extend_button",LONG_WAITING:"long_waiting",OFTEN_WAITING:"often_waiting",DEFINITION_DEMOTE:"definition_demote",LARKWINDOW_CHANGE:"larkWindow_change",PANEL_MODE_CHANGE:"panel_mode_change",INNER_DEFINITION_CHANGE:"inner_definition_change",LINE_CHANGE:"line_change",GET_PLAY_URL_ERR:"get_play_url_err",MEDIA_EXPIRED:"MEDIA_EXPIRED",MIRROR_CHANGE:"mirror_change"},{}),{AUTOPLAY_SUCCESS:"autoplay_success",AUTOPLAY_FAILED:"autoplay_failed",MENU_LOG:"MENU_LOG",MENU_REPORT:"MENU_REPORT",PLAY_LIST_CHANGE:"play_list_change",PLAY_LIST_ITEM_CHANGE:"play_list_item_change",PLAY_NEXT_START:"play_next_start",PLAY_NEXT_END:"play_next_end",ABR_AUTO_DESC_CHANGE:"ABR_AUTO_DESC_CHANGE",CORE_EVENT:"core_event",PRELOAD_INFO:"PRELOAD_INFO"}),UA=c(c(c({},{ABORT:"abort",CANPLAY:"canplay",CANPLAY_THROUGH:"canplaythrough",DURATION_CHANGE:"durationchange",EMPITED:"empited",EMPTIED:"emptied",ENDED:"ended",ERROR:"error",LOADED_DATA:"loadeddata",LOADED_META_DATA:"loadedmetadata",LOAD_START:"loadstart",PAUSE:"pause",PLAY:"play",PLAYING:"playing",PROGRESS:"progress",RATE_CHANGE:"ratechange",SEEKED:"seeked",SEEKING:"seeking",STALLED:"stalled",SUSPEND:"suspend",TIME_UPDATE:"timeupdate",VOLUME_CHANGE:"volumechange",WAITING:"waiting"}),NA),MA),BA={SDKEvents:NA,PluginEvents:MA},FA=UA,HA=70,jA=30,VA=50,KA=60,GA=20,WA=e=>class extends e{constructor(e){super(e),this._playTimer=null,this.handleABRDescChange=(...e)=>{this._autoRealDefinition=e[1]||void 0,this.refreshDefinitionList()},this.handleResourceReady=(e=[])=>{var t,i;const{list:n}=this.getCurrentDefinitionInfo(this.player),r=n.filter((t=>{var i;const n=t&&e.find((e=>this.playerData.isDefinitionMatch(e.definition,t.definition)));return n&&"dash"===(null==(i=this.playerData.getStreamType())?void 0:i.toLowerCase())&&(t.url=n.url),n})),o=e.find((e=>null==e?void 0:e.selected))||this.playerData.current,a=r.find((e=>this.playerData.isDefinitionMatch(e.definition,null==o?void 0:o.definition)));this.playerData.playList=r,(null==a?void 0:a.definition)&&(null==(t=this.playerData.current)?void 0:t.definition)!==a.definition&&(this.playerData.current.definition=null==a?void 0:a.definition),null==(i=this.refreshDefinitionList)||i.call(this)},this.getAutoDefRealLevel=()=>{var e;if(this.playerData.isAutoDefinition(null==(e=this.playerData.current)?void 0:e.definition)){const{videoWidth:e,videoHeight:t}=this.player.media;if(e&&t){const{list:i=[]}=this.getCurrentDefinitionInfo(this.player),n=i.find((i=>{const n=i.vwidth||i.width,r=i.vheight||i.height;return n&&r&&n===e&&r===t}));(null==n?void 0:n.definition)&&this._autoRealDefinition!==n.definition&&(this._autoRealDefinition=n.definition,this.refreshDefinitionList(),"mobile"===Kr.device&&(null==this||this.updatePanel()))}}},this.clientType=e.clientType,this.playerData=e.player.config.playerData,this.toastInfo={},this.dataMonitoring()}afterCreate(){var e,t,i,n,r;super.afterCreate(),this._autoRealDefinition=void 0,null==(e=this.refreshDefinitionList)||e.call(this),(this.playerData.isOpenABR()||"dash"===(null==(t=this.playerData.getStreamType())?void 0:t.toLowerCase()))&&this.on("resourceReady",this.handleResourceReady),this.playerData.isOpenABR()&&(this.on("ABR_AUTO_DESC_CHANGE",this.handleABRDescChange),((null==(r=null==(n=null==(i=this.playerData)?void 0:i.adapter)?void 0:n.useNativeAbr)?void 0:r.call(n))||this.player.plugins.dashplugin||this.player.plugins.mp4encryptplayer)&&(this.autoDefDetectTimer=new js,this.autoDefDetectTimer.repeat(this.getAutoDefRealLevel,1e3))),this.on(MA.PLAY_NEXT_START,(()=>{this.definitionSubscribeId&&hr.unsubscribeProperty(this.playerData.current,"definition",this.definitionSubscribeId),this.playListSubscribeId&&hr.unsubscribeProperty(this.playerData,"playList",this.playListSubscribeId)})),this.on(MA.PLAY_NEXT_END,(()=>{var e,t;null==(e=this.dataMonitoring)||e.call(this),null==(t=this.refreshDefinitionList)||t.call(this)}))}getShowText(e={},t,i){var n,r;if(t)return this.playerData.isOpenABR()&&this.playerData.isAutoDefinition(t.definition)?(null==(r=null==(n=this.playerData.configs)?void 0:n.autoBitrateOpts)?void 0:r.autoDefinitionText)||e[t.definitionTextKey]||t.definition:e[t.definitionTextKey]||t.definition||t.definitionTextKey||i||"HD"}getCurrentDefinitionInfo(e){const t={list:[],defaultDefinition:""},i=e.config.playerData,{current:{lineId:n,definition:r}}=i,o=i.getDefinitionListByLineId(n);return Array.isArray(o)&&o.length>0&&(t.list=o.map((t=>(t.text||(t.text=this.getShowText(e.i18n,t,t.definition)),t)))),t.defaultDefinition=r,t}showToast(e,t){var i,n;const r=null==(i=this.player)?void 0:i.getPlugin("sdkToastPlugin");if(!r)return;const o=this.getShowText(this.i18n,e,t);this.toastInfo&&(clearTimeout(this.toastInfo.timer),null==(n=null==r?void 0:r.remove)||n.call(r,this.toastInfo.id),this.player.off(Ao,this.toastInfo.remove),this.player.off(Qr,this.toastInfo.remove)),this.toastInfo={id:r.add(`${this.langText.switching} ${o}...`,0,!0),showTime:Date.now(),delayClose:!1},this.toastInfo.timer=setTimeout((()=>{r.remove(this.toastInfo.id),clearTimeout(this.toastInfo.timer)}),2e3),this.toastInfo.remove=()=>{if(!this.toastInfo.id)return;Date.now()-this.toastInfo.showTime>2e3?r.remove(this.toastInfo.id):this.toastInfo.delayClose=!0},this.player.once(Ao,this.toastInfo.remove),this.player.once(Qr,this.toastInfo.remove)}selectDefinition(e){var t,i,n;const r=null==(n=null==(i=null==(t=this.renderList)?void 0:t.find)?void 0:i.call(t,(t=>this.playerData.isDefinitionMatch(t.definition,e.definition))))?void 0:n.definitionTextKey;this.config.showToastOnManualClick&&this.showToast(u(c({},e),{definitionTextKey:r}),e.definition),this.playerData.current.definition=e.definition,this.playerData.isAutoDefinition(e.definition)||(this._autoRealDefinition=void 0)}showRealDefinition(e){return e.selected&&this.playerData.isAutoDefinition(e.definition)&&this.playerData.showRealDefinition()&&this._autoRealDefinition&&!this.playerData.isAutoDefinition(this._autoRealDefinition)}dataMonitoring(){this.playerData&&(this.definitionSubscribeId=hr.subscribeProperty(this.playerData.current,"definition",((e,t)=>{if(e&&t&&e!==t&&this.player){const{list:i}=this.getCurrentDefinitionInfo(this.player),n=i.find((e=>e.definition===t));n&&n.url&&(this.player.changeDefinition(u(c({kid:n.playAuthId},n),{secretKey:n.secretKey,definition:t,url:n.url})),"MOBILE"===this.clientType&&this.updatePanel(),this.player.emit(MA.INNER_DEFINITION_CHANGE,{from:e,to:t,url:n.url}),this.player.emit(MA.PlAY_URL_CHANGE,{url:n.url,from:MA.INNER_DEFINITION_CHANGE}),"PC"===this.clientType&&this.renderItemList(t),this.player.config.isLive&&(this._playTimer=setTimeout((()=>{this.player.ended?this.player.replay():this.player.paused&&this.player.play()}),1e3)))}})),this.playListSubscribeId=hr.subscribeProperty(this.playerData,"playList",(()=>{this.refreshDefinitionList()})))}onItemClick(...e){super.onItemClick(...e)}destroy(){clearTimeout(this.toastInfo.timer),clearTimeout(this._playTimer),this.autoDefDetectTimer&&(this.autoDefDetectTimer.clear(),this.autoDefDetectTimer=null,this.getAutoDefRealLevel=null),this.off("resourceReady",this.handleResourceReady),this.off("ABR_AUTO_DESC_CHANGE",this.handleABRDescChange)}};class YA extends(WA(LA)){constructor(e){const t=e.config.className;super(u(c({},e),{config:c(c({},e.config),t?{className:`${t} xgplayer-definition-plugin-pc`}:{}),clientType:"PC"})),this.onItemClick=function(e,t,i){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return A(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),sA(e,t,{leading:n,maxWait:t,trailing:r})}(this.onItemClick.bind(this),1e3,{trailing:!0})}static get pluginName(){return"sdkDefinitionPlugin"}static get defaultConfig(){return{position:ba.POSITIONS.CONTROLS_RIGHT,index:jA,list:[],defaultDefinition:"",hidePortrait:!1,disable:!1,showToastOnManualClick:!0,className:"xgplayer-definition xgplayer-definition-plugin-pc",isShowIcon:!0,isNeedAuto:!0,allowedSize:null,alwaysShowDefinition:!1}}registerLanguageTexts(){return{switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}afterCreate(){super.afterCreate()}refreshDefinitionList(){var e;(null==(e=this.player.config)?void 0:e.alwaysShowDefinition)&&(this.config.alwaysShowDefinition=!0);const{defaultDefinition:t,list:i}=this.getCurrentDefinitionInfo(this.player);this.config.defaultDefinition=t,this.config.list=i.map(((e,t)=>u(c({},e),{itemIndex:t}))),this.config.list&&this.config.list.length>0&&(this.config.list.length<2?this.config.alwaysShowDefinition?(this.renderItemList(),this.show()):this.hide():(this.renderItemList(),this.show()))}show(){var e;!this.config.list||(null==(e=this.config.list)?void 0:e.length)<2&&!this.config.alwaysShowDefinition||Ur.addClass(this.root,"show")}afterPlayerInit(){}renderItemList(e){if(Array.isArray(e))return;const{list:t,defaultDefinition:i}=this.config;let n=0;const r=t.map(((t,r)=>{var o;const a={url:t.url,definition:t.definition||"",definitionTextKey:t.definitionTextKey,showText:this.getShowText(this.i18n,t,t.definition),isCurrent:!1,selected:!1,isDefinitionAuto:!1},s="string"==typeof e?t.definition===e:void 0===e&&t.definition===i;if(!Ur.isUndefined(t.definition)&&s&&(a.isCurrent=!0,a.selected=!0,n=r),this.showRealDefinition(a)){const e=null==(o=this.renderList)?void 0:o.find((e=>this.playerData.isDefinitionMatch(null==e?void 0:e.definition,this._autoRealDefinition))),t=this.getShowText(this.i18n,e,null==e?void 0:e.definition);a.showText=t?`${a.showText}(${t})`:a.showText}return a.isDefinitionAuto=this.playerData.isAutoDefinition(t.definition),a}));this.renderList=r,super.renderItemList(r,n)}onItemClick(e,t){var i;if(t.to.definition!==this.playerData.current.definition){const n=null==(i=this.playerData.getCurrentStreams())?void 0:i[0];this.emitUserAction(e,"change_definition",{from:n,to:t.to}),this.selectDef(t.to)}}selectDef(e){this.selectDefinition(e),"ontouchstart"in window&&this.optionsList.hide()}changeDefinition(e){const t=this.renderList.find((t=>this.playerData.isDefinitionMatch(t.definition,e)));t&&this.selectDef(t)}destroy(){super.destroy()}}function zA(e){const t={};for(const i of["lang","name"]){const n=e[i];void 0!==n&&(t[i]=n)}return t}function $A(e,t){if(!(t<0||t>=e.length))for(let i=0;i<e.length;i++)e[i].enabled=i===t}function XA(e,t){const i=e;if("function"==typeof i.setAudioOption)i.setAudioOption(zA(t));else{const{id:i,lang:n,name:r}=t,o=e.audioTracks.find((e=>e.id===i&&((void 0===n||e.lang===n)&&(void 0===r||e.name===r))));if(!o||e.audioTrack===o.id)return;e.audioTrack=o.id}}const qA={zh:"中文","zh-cn":"普通话","zh-hk":"粤語","zh-tw":"繁體中文","zh-sg":"普通话",en:"English",ja:"日本語",ko:"한국어",th:"ภาษาไทย",vi:"Tiếng Việt",id:"Bahasa Indonesia",ms:"Bahasa Melayu",fil:"Filipino",tl:"Filipino",my:"မြန်မာဘာသာ",km:"ភាសាខ្មែរ",lo:"ພາສາລາວ",hi:"हिन्दी",bn:"বাংলা",ta:"தமிழ்",te:"తెలుగు",mr:"मराठी",ur:"اردو",fr:"Français",de:"Deutsch",es:"Español","es-419":"Español (Latinoamérica)",it:"Italiano",pt:"Português","pt-br":"Português (Brasil)","pt-pt":"Português (Portugal)",nl:"Nederlands",sv:"Svenska",da:"Dansk",no:"Norsk",fi:"Suomi",ca:"Català",ru:"Русский",pl:"Polski",uk:"Українська",cs:"Čeština",sk:"Slovenčina",ro:"Română",hu:"Magyar",bg:"Български",hr:"Hrvatski",sr:"Српски",sl:"Slovenščina",el:"Ελληνικά",ar:"العربية",fa:"فارسی",he:"עברית",tr:"Türkçe",az:"Azərbaycan",kk:"Қазақша",mn:"Монгол",sw:"Kiswahili"};function ZA(e){var t;return null!=(t=qA[e.toLowerCase()])?t:e.toUpperCase()}function QA(e,t){var i;const n=null!=(i=e.name)?i:"",r=e.lang?ZA(e.lang):"";return[r||n||`Track ${e.id+1}`,!1!==(null==t?void 0:t.showNameSuffix)&&r&&n?`(${n})`:""].filter(Boolean).join(" ")}function JA(e,t,i){var n;const r=null!=(n=e.label)?n:"",o=e.language?ZA(e.language):"";return[o||r||`Track ${t+1}`,!1!==(null==i?void 0:i.showNameSuffix)&&o&&r?`(${r})`:""].filter(Boolean).join(" ")}class eR extends LA{constructor(){super(...arguments),this._nativeMode=!1,this._nativeAddTrackHandler=null,this._nativeChangeHandler=null,this._nativeRemoveTrackHandler=null,this._nativeChangeRaf=null}static get pluginName(){return"AudioTrack"}static get defaultConfig(){return u(c({},LA.defaultConfig),{position:ba.POSITIONS.CONTROLS_RIGHT,index:HA,list:[],className:"xgplayer-audio-track",hidePortrait:!1,isShowIcon:!0,showNameSuffix:!0})}registerIcons(){return{}}afterPlayerInit(){var e;super.afterPlayerInit(),this.on("hlsAudioTracksUpdated",(e=>{this._onAudioTracksUpdated(e.audioTracks)})),this.on("hlsAudioTrackSwitched",(e=>{this._updateSelection(e.id)}));const t=this._getHls();(null==(e=null==t?void 0:t.audioTracks)?void 0:e.length)>1?this._onAudioTracksUpdated(t.audioTracks):t?this.hide():this._initNativeAudioTracks()}onItemClick(e,t){if(super.onItemClick(e,t),this._nativeMode){const e=this._getNativeTrackList();if(!e)return;$A(e,t.to.id)}else{const e=this._getHls();if(!e)return;XA(e,t.to)}}destroy(){var e;null!==this._nativeChangeRaf&&cancelAnimationFrame(this._nativeChangeRaf),this._unbindNativeAudioTracks(),null==(e=super.destroy)||e.call(this)}_getHls(){var e,t;const i=this.player.plugins;return(null==(e=null==i?void 0:i.encrypthlsplugin)?void 0:e.hls)||(null==(t=null==i?void 0:i.hls)?void 0:t.hls)}_getNativeTrackList(){var e,t;return null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks}_initNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeMode=!0,this._nativeAddTrackHandler=()=>this._onNativeTracksChanged(),this._nativeChangeHandler=()=>{null===this._nativeChangeRaf&&(this._nativeChangeRaf=requestAnimationFrame((()=>{this._nativeChangeRaf=null,this._onNativeTrackEnabled()})))},this._nativeRemoveTrackHandler=()=>this._onNativeTracksChanged(),e.addEventListener("addtrack",this._nativeAddTrackHandler),e.addEventListener("change",this._nativeChangeHandler),e.addEventListener("removetrack",this._nativeRemoveTrackHandler),e.length>1?this._onNativeTracksChanged():this.hide())}_unbindNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeAddTrackHandler&&e.removeEventListener("addtrack",this._nativeAddTrackHandler),this._nativeChangeHandler&&e.removeEventListener("change",this._nativeChangeHandler),this._nativeRemoveTrackHandler&&e.removeEventListener("removetrack",this._nativeRemoveTrackHandler))}_onNativeTracksChanged(){const e=this._getNativeTrackList();!e||e.length<=1?this.hide():(this._renderNativeTracks(e),this.show())}_onNativeTrackEnabled(){const e=this._getNativeTrackList();e&&this._renderNativeTracks(e)}_renderNativeTracks(e){const t={showNameSuffix:!1!==this.config.showNameSuffix},i=[];for(let r=0;r<e.length;r++){const n=e[r],o=JA(n,r,t);i.push({id:r,name:o,showText:o,iconText:o,selected:n.enabled,default:n.enabled})}const n=i.findIndex((e=>e.selected));this.config.list=i,super.renderItemList(i,n>-1?n:0)}_onAudioTracksUpdated(e){!e||e.length<=1?this.hide():(this._renderTracks(e),this.show())}_updateSelection(e){const t=this._getHls();t&&this._renderTracks(t.audioTracks,e)}_renderTracks(e,t){var i;const n=this._getHls(),r=null!=(i=null!=t?t:null==n?void 0:n.audioTrack)?i:-1,o={showNameSuffix:!1!==this.config.showNameSuffix},a=e.find((e=>e.default)),s=e.map((e=>u(c({},e),{showText:QA(e,o),iconText:QA(e,o),selected:e.id===r})));if(-1===r&&a){const e=s.findIndex((e=>e.id===a.id));e>-1&&(s[e].selected=!0)}const l=s.findIndex((e=>e.selected));this.config.list=s,super.renderItemList(s,l>-1?l:0)}}function tR(){return(new DOMParser).parseFromString('<svg width="19" height="16" viewBox="0 0 19 15" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_18_7532)" filter="url(#filter0_d_18_7532)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M9.33333 3.19115C9.33333 2.79702 8.91856 2.54067 8.56604 2.71694L4.66668 4.66662C4.66667 4.66662 4.66667 4.66663 4.66667 4.66663C4.66667 4.66664 4.66666 4.66665 4.66665 4.66665H3.19685C2.90404 4.66665 2.66666 4.90402 2.66666 5.19684V9.4698C2.66666 9.76261 2.90404 9.99998 3.19685 9.99998H4.55791C4.62971 9.99998 4.70076 10.0146 4.76676 10.0429L8.5943 11.6832C8.94415 11.8332 9.33333 11.5765 9.33333 11.1959V3.19115Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M13 6.87773L14.8934 4.7138C14.9485 4.6509 15.0377 4.6509 15.0927 4.7138L15.2921 4.94158C15.3471 5.00448 15.3471 5.10646 15.2921 5.16936L13.3986 7.33329L15.2921 9.49722C15.3471 9.56012 15.3471 9.6621 15.2921 9.725L15.0927 9.95278C15.0377 10.0157 14.9485 10.0157 14.8934 9.95278L13 7.78886L11.1066 9.95278C11.0515 10.0157 10.9623 10.0157 10.9073 9.95278L10.7079 9.725C10.6529 9.6621 10.6529 9.56012 10.7079 9.49722L12.6014 7.33329L10.7079 5.16936C10.6529 5.10646 10.6529 5.00448 10.7079 4.94158L10.9073 4.7138C10.9623 4.6509 11.0515 4.6509 11.1066 4.7138L13 6.87773Z" fill="white" stroke="white" stroke-width="0.530187"/>\n </g>\n <defs>\n <filter id="filter0_d_18_7532" x="-0.666667" y="0" width="19.3333" height="19.3333" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n <feFlood flood-opacity="0" result="BackgroundImageFix"/>\n <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n <feOffset dy="2.66667"/>\n <feGaussianBlur stdDeviation="1.33333"/>\n <feComposite in2="hardAlpha" operator="out"/>\n <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>\n <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_18_7532"/>\n <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_18_7532" result="shape"/>\n </filter>\n <clipPath id="clip0_18_7532">\n <rect width="14" height="14" fill="white" transform="translate(2)"/>\n </clipPath>\n </defs>\n</svg>\n\n',"image/svg+xml").firstChild}const{isWeixin:iR,os:nR,device:rR}=Kr,oR=nR.isAndroid,aR=nR.isIos,sR="mobile"===rR;let lR=0,cR=!1;class uR extends ba{constructor(e){super(e),this.state={mode:0,showUnmuteBt:!1},this.wxCanPlayFn=()=>{window.WeixinJSBridge&&window.WeixinJSBridge.invoke("getNetworkType",{},(()=>{this.wxTimer=setTimeout((()=>{this.wxTimer&&clearTimeout(this.wxTimer);const e=this.player.play();e&&e.then?e.then((()=>{ss.log("wechat autoplay success")})).catch((e=>{ss.warn("wechat autoplay fail:",e),this.state.showUnmuteBt=!1,this.renderUnmuteBt()})):ss.warn("wechat browser no play promise")}))}))},this.wxPlay=()=>{this.player.readyState>=2?this.wxCanPlayFn():oR?this.player.once(no,this.wxCanPlayFn):aR&&this.player.once(mo,this.wxCanPlayFn)},this.userClickPlay=()=>{if(cR)return;const e=this.player.play();e&&e.then?e.then((()=>{ss.log("user action autoplay success"),cR=!0})).catch((e=>{ss.warn("user action autoplay fail:",e)})):(ss.warn("no play promise"),cR=!0)},this.handleAutoplayPrevented=()=>0===this.state.mode?(ss.warn("unmute autoplay fail"),this.player.emit(MA.AUTOPLAY_FAILED,{mode:"unmute"}),oR&&iR?void(this.state.mode=2):void(this.config.enableDegradeMuteAutoplay&&this.changeMuteMode())):1===this.state.mode?(ss.warn("mute autoplay fail"),this.player.emit(MA.AUTOPLAY_FAILED,{mode:"mute"}),void(this.state.mode=2)):2===this.state.mode?(this.player.emit(MA.AUTOPLAY_FAILED,{mode:"noSupport"}),void ss.warn("not support autoplay")):void 0,this.handleAutoplayStart=()=>{if(0!==this.state.mode)return 1===this.state.mode?(this.player.emit(MA.AUTOPLAY_SUCCESS,{mode:"mute"}),this.state.showUnmuteBt=!0,void this.renderUnmuteBt()):2===this.state.mode?(this.player.emit(MA.AUTOPLAY_SUCCESS,{mode:"click"}),this.player.muted=!1,this.state.showUnmuteBt=!1,void this.renderUnmuteBt()):void 0;this.player.emit(MA.AUTOPLAY_SUCCESS,{mode:"unmute"})},this.handleVolumechange=()=>{this.state.showUnmuteBt&&(this.state.showUnmuteBt=!1,this.renderUnmuteBt(),this.player.paused&&this.player.readyState>=1&&this.player.play())},this.cancelUnmute=e=>{const t=Date.now();t-lR>200&&(lR=t,this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt(),this.emitUserAction(e,"cancel_mute"))}}static get pluginName(){return"AutoplayPlugin"}static get defaultConfig(){return{position:ba.POSITIONS.ROOT,enableDegradeMuteAutoplay:!1,enableWxJsBridgeAutoplay:!1,userActionDom:window.document.body,enableUserActionAutoplay:!1,showUnmuteBtn:!0}}afterCreate(){this.initState(),this.initEvents(),this.setWXAutoPlay()}registerLanguageTexts(){return{unmute:{jp:"ミュートを解除する",en:"Click to unmute",zh:"点击取消静音","zh-hk":"點擊取消靜音"},muted:{jp:"ミュート",en:"muted",zh:"已静音","zh-hk":"已靜音"}}}registerIcons(){return{muted:{icon:tR,class:"xgplayer-muted-svg"}}}updateLang(){this.renderUnmuteBt()}initState(){const{enableDegradeMuteAutoplay:e,enableWxJsBridgeAutoplay:t,enableUserActionAutoplay:i}=this.player.config;e&&(this.config.enableDegradeMuteAutoplay=!0),t&&(this.config.enableWxJsBridgeAutoplay=!0),i&&(this.config.enableUserActionAutoplay=!0),this.state.mode=this.player.muted?1:0}initEvents(){this.player.on(vo,this.handleAutoplayPrevented),this.player.on(yo,this.handleAutoplayStart),this.player.on(oo,this.handleVolumechange),this.setUserActionAutoPlay()}setWXAutoPlay(){iR&&this.player.config.autoplay&&this.config.enableWxJsBridgeAutoplay&&(window.WeixinJSBridge?this.wxPlay():document.addEventListener("WeixinJSBridgeReady",this.wxPlay,!1))}setUserActionAutoPlay(){var e;(null==(e=this.config)?void 0:e.enableUserActionAutoplay)&&this.player.once(MA.AUTOPLAY_FAILED,(()=>{this.hasSetUserAutoplay=!0;(this.config.userActionDom instanceof window.Node?this.config.userActionDom:window.document.body).addEventListener("click",this.userClickPlay,!1)}))}changeMuteMode(){this.player.muted=!0,this.state.showUnmuteBt=!0,this.state.mode=1,this.renderUnmuteBt(),this.timer=setTimeout((()=>{this.timer&&clearTimeout(this.timer);const e=this.player.play();e&&e.then?e.then((()=>{ss.log("degrade mute autoplay success")})).catch((e=>{ss.warn("degrade mute autoplay fail:",e),this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt()})):ss.warn("no play promise")}))}renderUnmuteBt(){var e,t,i;const n=this.root;if(n&&(n.innerHTML="",this.state.showUnmuteBt&&this.config.showUnmuteBtn)){const r=this.langText.unmute||(null==(i=null==(t=null==(e=this.registerLanguageTexts)?void 0:e.call(this))?void 0:t.unmute)?void 0:i.en),o=Ur.createDom("div",r,void 0,"xgplayer-unmute-bt");n.appendChild(o),this.bind(".xgplayer-unmute-bt","click",this.cancelUnmute),this.bind(".xgplayer-unmute-bt","touchend",this.cancelUnmute)}}destroy(){if(this.player.off(vo,this.handleAutoplayPrevented),this.player.off(yo,this.handleAutoplayStart),this.player.off(oo,this.handleVolumechange),this.timer&&window.clearTimeout(this.timer),this.wxTimer&&window.clearTimeout(this.wxTimer),document.removeEventListener("WeixinJSBridgeReady",this.wxPlay,!1),this.hasSetUserAutoplay){const e=sR?"touch":"click";(this.config.userActionDom instanceof window.Node?this.config.userActionDom:window.document.body).removeEventListener(e,this.userClickPlay,!1)}}render(){return'<div class="xgplayer-unmute"></div>'}}const hR=void 0;function dR(){return(new DOMParser).parseFromString('<svg width="18" height="18" viewBox="0 0 23 22" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M5.75 11C5.75 11.9665 4.9665 12.75 4 12.75C3.0335 12.75 2.25 11.9665 2.25 11C2.25 10.0335 3.0335 9.25 4 9.25C4.9665 9.25 5.75 10.0335 5.75 11ZM13.25 11C13.25 11.9665 12.4665 12.75 11.5 12.75C10.5335 12.75 9.75 11.9665 9.75 11C9.75 10.0335 10.5335 9.25 11.5 9.25C12.4665 9.25 13.25 10.0335 13.25 11ZM19 12.75C19.9665 12.75 20.75 11.9665 20.75 11C20.75 10.0335 19.9665 9.25 19 9.25C18.0335 9.25 17.25 10.0335 17.25 11C17.25 11.9665 18.0335 12.75 19 12.75Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}class fR extends ba{constructor(e){super(e),this.panel=null,this.panelContainer=null}static get pluginName(){return"MoreButtonPlugin"}static get defaultConfig(){return{position:ba.POSITIONS.ROOT_TOP,iconPlugins:[],maxShowNum:2}}beforePlayerInit(){}afterPlayerInit(){}afterCreate(){this.renderMoreIcon()}updateLang(e){if(!this.panelContainer)return;const t=this.panelContainer.querySelectorAll(".panel-icon-bt-text"),i=this.getAndSplitList().extraList;t.forEach((t=>{var n,r;const o=Number(t.getAttribute("plugin-index"));(null==(r=null==(n=i[o])?void 0:n.textTips)?void 0:r[e])&&(t.innerHTML=i[o].textTips[e])}))}registerIcons(){return{more:{icon:dR,class:"xgplayer-more-svg"}}}getAndSplitList(){var e;let t,i;const n=(null!=(e=this.player.config.ignores)?e:[]).map((e=>e.toLowerCase())),r=this.config.iconPlugins.filter((e=>!n.includes(e.pluginName.toLowerCase())));return r.length>this.config.maxShowNum+1?(t=r.slice(0,this.config.maxShowNum),i=r.slice(-(r.length-this.config.maxShowNum))):t=[...r],{list:null!=t?t:[],extraList:null!=i?i:[]}}children(){const e=this.getAndSplitList().list,t={};return e.forEach((e=>{t[e.pluginName]={plugin:e,options:{root:this.root}}})),t}renderMoreIcon(){const e=this.getAndSplitList().extraList;if(0===e.length)return;const t=this.root,i=Ur.createDom("div","",{},"xgplayer-icon");i.appendChild(this.icons.more),i.addEventListener("click",(()=>{this.renderPanel(e)}));const n=Ur.createDom("xg-icon","",{"data-index":0},"xgplayer-more");n.appendChild(i),t.appendChild(n)}renderPanel(e){this.panelContainer||(this.panelContainer=Ur.createDom("div","",{},"panel-content"),e.forEach(((e,t)=>{var i,n;const r=Ur.createDom("div","",{},"panel-icon-bt"),o=Ur.createDom("div","",{},"panel-icon-svg");r.appendChild(o),this.registerExtraPlugin(e,o);const a="zh-cn"===this.player.lang?"zh":this.player.lang,s=null!=(n=null==(i=e.textTips)?void 0:i[a])?n:e.pluginName;r.appendChild(Ur.createDom("span",s,{"plugin-index":t},"panel-icon-bt-text")),this.panelContainer.appendChild(r)}))),this.player.panel.showPanel(this.panelContainer)}registerExtraPlugin(e,t){this.player.registerPlugin({plugin:e,options:{root:t}})}destroy(){}render(){return'<div class="xgplayer-rightTop-iconList"></div>'}}function pR(){return(new DOMParser).parseFromString('<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M68 40C68 55.464 55.464 68 40 68C24.536 68 12 55.464 12 40C12 24.536 24.536 12 40 12C55.464 12 68 24.536 68 40ZM34.75 34.05C34.75 35.7897 33.5747 37.2 32.125 37.2C30.6753 37.2 29.5 35.7897 29.5 34.05C29.5 32.3103 30.6753 30.9 32.125 30.9C33.5747 30.9 34.75 32.3103 34.75 34.05ZM40.2276 43.7334C36.2145 43.7334 32.6052 45.4732 30.1709 48.2331C29.5316 48.9579 29.6009 50.0638 30.3258 50.7031C31.0506 51.3424 32.1565 51.2731 32.7958 50.5483C34.5802 48.5252 37.2407 47.2334 40.2276 47.2334C43.2213 47.2334 45.8871 48.531 47.6715 50.562C48.3094 51.288 49.4152 51.3594 50.1412 50.7215C50.8673 50.0836 50.9387 48.9778 50.3008 48.2518C47.8663 45.481 44.2498 43.7334 40.2276 43.7334ZM47.8352 37.2C49.2849 37.2 50.4602 35.7897 50.4602 34.05C50.4602 32.3103 49.2849 30.9 47.8352 30.9C46.3854 30.9 45.2102 32.3103 45.2102 34.05C45.2102 35.7897 46.3854 37.2 47.8352 37.2Z" fill="#ffffff" fill-opacity="0.15"/>\n</svg>\n',"image/svg+xml").firstChild}var gR=(e=>(e.NETWORK="NETWORK",e.NETWORK_TIMEOUT="NETWORK_TIMEOUT",e.NETWORK_FORBIDDEN="NETWORK_FORBIDDEN",e.NETWORK_NOTFOUND="NETWORK_NOTFOUND",e.NETWORK_RANGE_NOT_SATISFIABLE="NETWORK_RANGE_NOT_SATISFIABLE",e.NETWORK_PROTOCOL="NETWORK_PROTOCOL",e.NETWORK_URL_EXPIRE="NETWORK_URL_EXPIRE",e.NETWORK_URL_SIGN="NETWORK_URL_SIGN",e.NETWORK_ENCRYPT_HLS_ERR="NETWORK_ENCRYPT_HLS_ERR",e.MEDIA_ERR="MEDIA_ERR",e.MEDIA_ERR_ABORTED="MEDIA_ERR_ABORTED",e.MEDIA_ERR_NETWORK="MEDIA_ERR_NETWORK",e.MEDIA_ERR_DECODE="MEDIA_ERR_DECODE",e.MEDIA_ERR_SRC_NOT_SUPPORTED="MEDIA_ERR_SRC_NOT_SUPPORTED",e.MEDIA_ERR_NOT_SUPPORTED="MEDIA_ERR_NOT_SUPPORTED",e.MEDIA_ERR_URL_EMPTY="MEDIA_ERR_URL_EMPTY",e.MEDIA_ERR_FILE_NOT_SUPPORTED="MEDIA_ERR_FILE_NOT_SUPPORTED",e.MEDIA_ERR_PLAY_ERR="MEDIA_ERR_PLAY_ERR",e.MEDIA_SOURCE_CANNOT_PLAY_TYPE="MEDIA_SOURCE_CANNOT_PLAY_TYPE",e.BUSINESS_DRM_NOT_SUPPORT="BUSINESS_DRM_NOT_SUPPORT",e.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD="BUSINESS_DRM_NOT_SUPPORT_UN_RECORD",e.BUSINESS_DRM_LACK_MEDIA_KEY="BUSINESS_DRM_LACK_MEDIA_KEY",e.BUSINESS_DRM_LACK_KEY_SESSION="BUSINESS_DRM_LACK_KEY_SESSION",e.BUSINESS_DRM_GENERATE_REQUEST_FAIL="BUSINESS_DRM_GENERATE_REQUEST_FAIL",e.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH="BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH",e.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH="BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH",e.BUSINESS_DRM_LICENSE_FAIL="BUSINESS_DRM_LICENSE_FAIL",e.BUSINESS_DRM_KEY_ERROR="BUSINESS_DRM_KEY_ERROR",e.BUSINESS_DRM_CERT_FAIL="BUSINESS_DRM_CERT_FAIL",e.PRIVATE_DRM_KEY_GET_FAILED="PRIVATE_DRM_KEY_GET_FAILED",e.PRIVATE_DRM_CRYPTO_NOT_SUPPORT="PRIVATE_DRM_CRYPTO_NOT_SUPPORT",e.PRIVATE_DRM_RSA_FAIL="PRIVATE_DRM_RSA_FAIL",e.OTHER="OTHER",e.VOD_LOG_NOT_CONFIGURED="VOD_LOG_NOT_CONFIGURED",e.PLAY_AUTH_TOKEN_EXPIRED="PLAY_AUTH_TOKEN_EXPIRED",e.HLS_KEY_TOKEN_EXPIRED="HLS_KEY_TOKEN_EXPIRED",e.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED="THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED",e.GET_PLAY_INFO_ERR="GET_PLAY_INFO_ERR",e.GET_HLS_DECRYPTION_KEY_ERR="GET_HLS_DECRYPTION_KEY_ERR",e.LICENSE_VALIDATE_FAIL="LICENSE_VALIDATE_FAIL",e.DEFINITION_AUTO="DEFINITION_AUTO",e.LICENSE_STATUS_INVALID="LICENSE_STATUS_INVALID",e.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH="LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH",e.BASE_LICENSE_NOT_SUPPORT_265="BASE_LICENSE_NOT_SUPPORT_265",e.BASE_LICENSE_NOT_SUPPORT_ABR="BASE_LICENSE_NOT_SUPPORT_ABR",e.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER="BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER",e.BASE_LICENSE_NOT_SUPPORT_PRELOAD="BASE_LICENSE_NOT_SUPPORT_PRELOAD",e.EXPIRED_LICENSE_NOT_SUPPORT_265="EXPIRED_LICENSE_NOT_SUPPORT_265",e.EXPIRED_LICENSE_NOT_SUPPORT_ABR="EXPIRED_LICENSE_NOT_SUPPORT_ABR",e.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER="EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER",e.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD="EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD",e.DRAMA_INVALID_PARAM="DRAMA_INVALID_PARAM",e.DRAMA_NO_INFO_FOUND="DRAMA_NO_INFO_FOUND",e.DRAMA_NOT_SUBMITTED="DRAMA_NOT_SUBMITTED",e.DRAMA_UNDER_REVIEW="DRAMA_UNDER_REVIEW",e.DRAMA_FAILED_REVIEW="DRAMA_FAILED_REVIEW",e.DRAMA_WITHDRAWN_REVIEW="DRAMA_WITHDRAWN_REVIEW",e.DRAMA_FAILED_TO_QUERY="DRAMA_FAILED_TO_QUERY",e.DRAMA_INVALID_TTOP_TOKEN="DRAMA_INVALID_TTOP_TOKEN",e.DRAMA_NOT_ON_SHELF="DRAMA_NOT_ON_SHELF",e.DRAMA_FAILED_GET_EPISODE_INFO="DRAMA_FAILED_GET_EPISODE_INFO",e))(gR||{});const yR={NETWORK:{code:2100,message:"Network error",textKey:gR.NETWORK},NETWORK_TIMEOUT:{code:2101,message:"Network timeout",textKey:gR.NETWORK_TIMEOUT},NETWORK_FORBIDDEN:{code:2103,message:"Block access to this media",textKey:gR.NETWORK_FORBIDDEN},NETWORK_NOTFOUND:{code:2104,message:"Media not found",textKey:gR.NETWORK_NOTFOUND},NETWORK_RANGE_NOT_SATISFIABLE:{code:2116,message:"Media fetch range not satisfiable",textKey:gR.NETWORK_RANGE_NOT_SATISFIABLE},NETWORK_PROTOCOL:{code:2190,message:"The current page protocol is https, but video url protocol is http",textKey:gR.NETWORK_PROTOCOL},NETWORK_URL_EXPIRE:{code:2191,message:"Media url has expired",textKey:gR.NETWORK_URL_EXPIRE},NETWORK_URL_SIGN:{code:2192,message:"Media url signature parameter error",textKey:gR.NETWORK_URL_SIGN},NETWORK_ENCRYPT_HLS_ERR:{code:2193,message:"Get m3u8 file or encrypt key fail",textKey:gR.NETWORK_ENCRYPT_HLS_ERR},MEDIA_ERR_ABORTED:{code:5101,message:"User or browser abort the media",textKey:gR.NETWORK_URL_SIGN},MEDIA_ERR_NETWORK:{code:5102,message:"Network error",textKey:gR.MEDIA_ERR_NETWORK},MEDIA_ERR_DECODE:{code:5103,message:"Media decode error",textKey:gR.MEDIA_ERR_DECODE},MEDIA_ERR_SRC_NOT_SUPPORTED:{code:5104,message:"Media is not supported or url is not available",textKey:gR.MEDIA_ERR_SRC_NOT_SUPPORTED},MEDIA_ERR_NOT_SUPPORTED:{code:5105,message:"Media not support play",textKey:gR.MEDIA_ERR_NOT_SUPPORTED},MEDIA_ERR_URL_EMPTY:{code:5106,message:"Media url empty",textKey:gR.MEDIA_ERR_URL_EMPTY},MEDIA_ERR_FILE_NOT_SUPPORTED:{code:5901,message:"Media file not supported",textKey:gR.MEDIA_ERR_FILE_NOT_SUPPORTED},MEDIA_ERR_PLAY_ERR:{code:5902,message:"Media play error",textKey:gR.MEDIA_ERR_PLAY_ERR},BUSINESS_DRM_NOT_SUPPORT:{code:7101,message:"DRM encrypted playback is not supported",textKey:gR.BUSINESS_DRM_NOT_SUPPORT},BUSINESS_DRM_NOT_SUPPORT_UN_RECORD:{code:7102,message:"Anti-screen recording is not supported",textKey:gR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD},BUSINESS_DRM_LACK_MEDIA_KEY:{code:7103,message:"The video data lacks the corresponding MediaKey",textKey:gR.BUSINESS_DRM_LACK_MEDIA_KEY},BUSINESS_DRM_LACK_KEY_SESSION:{code:7104,message:"The browser does not support the corresponding DRM KeySession",textKey:gR.BUSINESS_DRM_LACK_KEY_SESSION},BUSINESS_DRM_GENERATE_REQUEST_FAIL:{code:7105,message:"Decryption playback error",textKey:gR.BUSINESS_DRM_GENERATE_REQUEST_FAIL},BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH:{code:7106,message:"Missing DRM certificate request link",textKey:gR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH},BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH:{code:7107,message:"Missing DRM License request link",textKey:gR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH},BUSINESS_DRM_LICENSE_FAIL:{code:7108,message:"Failed to request or update a license",textKey:gR.BUSINESS_DRM_LICENSE_FAIL},BUSINESS_DRM_KEY_ERROR:{code:7109,message:"Decryption Error",textKey:gR.BUSINESS_DRM_KEY_ERROR},BUSINESS_DRM_CERT_FAIL:{code:7110,message:"Failed to request DRM certificate",textKey:gR.BUSINESS_DRM_CERT_FAIL},PRIVATE_DRM_GET_KEY_FAILED:{code:7200,message:"Private DRM key get failed",textKey:gR.PRIVATE_DRM_KEY_GET_FAILED},PRIVATE_DRM_CRYPTO_NOT_SUPPORT:{code:7201,message:"Web cryptography API is not supported",textKey:gR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT},PRIVATE_DRM_RSA_FAIL:{code:7202,message:"Decryption by RSA-OAEP failed",textKey:gR.PRIVATE_DRM_RSA_FAIL},OTHER:{code:8e3,message:"Other error",textKey:gR.OTHER},VOD_LOG_NOT_CONFIGURED:{code:8999,message:"Log options not configured correctly",textKey:gR.VOD_LOG_NOT_CONFIGURED},PLAY_AUTH_TOKEN_EXPIRED:{code:10001,message:"playAuthToken has expired",textKey:gR.PLAY_AUTH_TOKEN_EXPIRED},HLS_KEY_TOKEN_EXPIRED:{code:10003,message:"keyToken has expired",textKey:gR.HLS_KEY_TOKEN_EXPIRED},THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED:{code:10003,message:"thirdPartyDrmAuthToken has expired",textKey:gR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED},GET_PLAY_INFO_ERR:{code:11001,message:"Failed to get play info",textKey:gR.GET_PLAY_INFO_ERR},GET_HLS_DECRYPTION_KEY_ERR:{code:11002,message:"Failed to get the HLS decryption key",textKey:gR.GET_HLS_DECRYPTION_KEY_ERR},LICENSE_STATUS_INVALID:{code:12001,message:"License validation is invalid",textKey:gR.LICENSE_STATUS_INVALID},LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH:{code:12002,message:"License domain name does not match",textKey:gR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH}},vR={BASE_LICENSE_NOT_SUPPORT_265:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12111,message:"The basic license does not support H265",textKey:gR.BASE_LICENSE_NOT_SUPPORT_265},BASE_LICENSE_NOT_SUPPORT_ABR:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12112,message:"The basic license does not support ABR",textKey:gR.BASE_LICENSE_NOT_SUPPORT_ABR},BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12113,message:"The basic license does not support dynamic buffer",textKey:gR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER},BASE_LICENSE_NOT_SUPPORT_PRELOAD:{type:"ERROR_LICENSE_EDITION_NEED_UPLOAD",code:12114,message:"The basic license does not support preload",textKey:gR.BASE_LICENSE_NOT_SUPPORT_PRELOAD},EXPIRED_LICENSE_NOT_SUPPORT_265:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12211,message:"Expired license does not support H265",textKey:gR.EXPIRED_LICENSE_NOT_SUPPORT_265},EXPIRED_LICENSE_NOT_SUPPORT_ABR:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12212,message:"Expired license does not support ABR",textKey:gR.EXPIRED_LICENSE_NOT_SUPPORT_ABR},EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12213,message:"The expired license does not support dynamic buffer",textKey:gR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER},EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD:{type:"ERROR_LICENSE_HAS_EXPIRED",code:12214,message:"Expired license does not support preloading",textKey:gR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD}};var mR=(e=>(e[e.manifest=1]="manifest",e[e.network=2]="network",e[e.demux=3]="demux",e[e.remux=4]="remux",e[e.media=5]="media",e[e.decoder=6]="decoder",e[e.drm=7]="drm",e[e.other=8]="other",e[e.runtime=9]="runtime",e[e.token=10]="token",e[e.serve=11]="serve",e[e.license=12]="license",e[e.ad=13]="ad",e))(mR||{});const _R={INVALID_PARAM:{code:9301,message:"Invalid parameter in short drama environment",textKey:gR.DRAMA_INVALID_PARAM},NO_INFO_FOUND:{code:9302,message:"No information found for this Episode",textKey:gR.DRAMA_NO_INFO_FOUND},NOT_SUBMITTED:{code:9303,message:"Episode not submitted for review",textKey:gR.DRAMA_NOT_SUBMITTED},UNDER_REVIEW:{code:9304,message:"Episode under for review",textKey:gR.DRAMA_UNDER_REVIEW},FAILED_REVIEW:{code:9305,message:"Episode failed review",textKey:gR.DRAMA_FAILED_REVIEW},WITHDRAWN_REVIEW:{code:9306,message:"Episode withdrawn from review",textKey:gR.DRAMA_WITHDRAWN_REVIEW},FAILED_TO_QUERY:{code:9307,message:"Failed to query video playback information",textKey:gR.DRAMA_FAILED_TO_QUERY},INVALID_TTOP_TOKEN:{code:9308,message:"Invalid playAuthToken or failed to verify TTOP token",textKey:gR.DRAMA_INVALID_TTOP_TOKEN},NOT_ON_SHELF:{code:9310,message:"Video is not on shelf",textKey:gR.DRAMA_NOT_ON_SHELF},FAILED_GET_EPISODE_INFO:{code:9399,message:"Failed get episode info",textKey:gR.DRAMA_FAILED_GET_EPISODE_INFO}};const ER={SUCCESS:0,NOT_SUBMITTED:1,UNDER_REVIEW:2,FAILED_REVIEW:3,WITHDRAWN:4,NOT_ON_SHELF:5},TR=1002305;class SR{constructor(){this.actions={}}addMiddleware(e,t){this.actions[e]?this.actions[e].push(t):this.actions[e]=[t]}removeMiddleware(e,t){const i=this.actions[e]||[],n=i.findIndex((e=>e===t));n>-1&&(i.splice(n,1),this.actions[e]=i)}removeAllMiddlewareByKey(e){this.actions[e]=[]}removeAllMiddleware(){this.actions={}}applyMiddleware(e){const t=this;return function(i,n){return d(this,null,(function*(){const{eventName:r}=i,o=t.actions[e]||[],a=[];o.forEach((e=>{try{const t=e(i);a.push(Ys(t))}catch(t){throw a.push(Ys(null)),t}})),Promise.all([...a]).then((e=>{e.every((e=>!e))&&n(r,i)})).catch((e=>{ss.error(e),n(r,e)}))}))}}}const bR="xgplayer-error-analysing",CR="xgplayer-error-retrying",kR="ve_error",IR={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},PR={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},DR="http:",wR="https:";let AR=null;function RR(e){var t;const i=null==(t=null==window?void 0:window.location)?void 0:t.protocol;if(e.startsWith(DR)&&i===wR){if(new URL(e).protocol===DR)return xR.getVeErrorInfo(yR.NETWORK_PROTOCOL)}}class xR{constructor(e,t){this.retryTimestamps=[],this.totalRetryCount=0,this.retrying=!1,this.retryTimer=null,this.userInvokedPlay=!1,this._playIntentHook=()=>{this.userInvokedPlay=!0},this._onError=e=>d(this,null,(function*(){var t;this.player.addClass(bR);const i=yield this.transformToVeError(e);this.player.veError=i,ss.error("error: ",i),this.player.removeClass(bR),(null==(t=this.config.ignoreErrorCodes)?void 0:t.includes(null==i?void 0:i.veErrorCode))?ss.log("ignore errorCode",null==i?void 0:i.veErrorCode):this.player.emit(kR,i)})),this.player=e,this.config={},t&&Object.keys(xR.defaultConfig).forEach((e=>{void 0===t[e]?this.config[e]=xR.defaultConfig[e]:this.config[e]=t[e]})),this.init()}static get defaultConfig(){return{oriErrRetryCount:3,oriErrRetryCycle:1e4,oriErrRetryBaseDelay:500,oriErrMaxTotalRetry:0,enableOriErrRetry:!0,needSyncAnalyzeError:!0,analyzeTimeout:3e3,ignoreErrorCodes:[],clientKey:void 0}}createVeError(e={}){var t,i;const{errorType:n,errorCode:r=0,errorMessage:o="",originError:a="",ext:s={},mediaError:l=null}=e,h=(null==(i=null==(t=this.player)?void 0:t.i18n)?void 0:i.ERROR_TYPES)||{},d=this.player.media;if(d){const t=l||d.error||{},{duration:i,currentTime:h,ended:f,src:p,currentSrc:g}=this.player,{readyState:y,networkState:v}=d;let m=r||t.code;IR[m]&&(m=IR[m]);const{code:_,message:E,textKey:T}=e.veError||{},S=o||t.message,b=_||m,C=xR.getErrorType(e),k=E||S,I=T||(e=>{for(const[t,{code:i,textKey:n}]of Object.entries(yR))if(i===e)return n})(b)||function(e){for(const t of Object.values(_R))if(t.code===e)return t.textKey}(b),P=this.player.i18n[I]||k||this.player.i18n[gR.MEDIA_ERR]||"unknown error",D=this.player.config,w=this.config.clientKey?{clientKey:this.config.clientKey}:{},A=this.config.clientKey?{albumId:D.albumId||D.album_id,episodeId:D.episodeId||D.episode_id||D.episodeID}:{};return u(c({playerVersion:"1.18.0",currentTime:h,duration:i,ended:f,readyState:y,networkState:v,src:p||g,errorType:n,errorCode:m,httpCode:e.httpCode,message:S,mediaError:t,originError:a?a.stack:"",host:Ur.getHostFromUrl(p||g),veErrorCode:b,veErrorType:C,veErrorMessage:k,displayMessage:P},w),{videoInfo:c({isMSE:Ns(this.player),vtype:this.player.url?this.player.vtype:"",drmEncryptType:sl(this.player)||"",vid:D.vid},A),ext:s})}if(arguments.length>1){const e={playerVersion:"1.18.0",domain:document.domain,ex:null},t=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"];for(let i=0;i<arguments.length;i++)e[t[i]]=arguments[i];return e.ex=h?(h[arguments[0]]||{}).msg:"",e}}static getErrorType(e){const{veError:t,mediaError:i}=e||{},n=t||(null==i?void 0:i.veError);if(null==n?void 0:n.code){const e=n.code+"";return n.code>=1e4?mR[e.slice(0,2)]:mR[e.slice(0,1)]}if(null==i?void 0:i.code)return PR[i.code]||"other"}static getVeErrorInfo(e,t){const{code:i,message:n,textKey:r}=e;return{code:i,message:t||n,textKey:r}}init(){var e,t;AR||(AR=this.player.errorHandler),function(e,t){for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&"function"==typeof t[i]&&Object.defineProperty(e,i,{configurable:!0,value:t[i]})}(this.player,(e=this.player,t=this,{errorHandler(i,n){var r;ss.log("errorHandler, err: ",n);const o=e;if(o.media&&(o.media.error||n)){let e=o.media.error||n;const a=e.code?Wr[e.code]:"other";let s=e.message;"xg-video"===(null==(r=null==o?void 0:o.config)?void 0:r.mediaType)||o.media.currentSrc||o.media.srcObject||(s="empty_src",e={code:6,message:s}),o.emit(i,t.createVeError({errorType:a,errorCode:e.code,errorMessage:e.message||"",mediaError:e,veError:n.veError,originError:n}))}}})),this.setErrorEventMiddleWare(),this.player.on(Qr,this._onError),this.player.useHooks("play",this._playIntentHook)}destroy(){this.player.off(Qr,this._onError),this.player.removeHooks("play",this._playIntentHook),this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null,this.retrying=!1,this.player.removeClass(CR))}shouldOriRetryReloadOnly(){var e;if(this.userInvokedPlay)return!1;const t=this.player.config;if(!t||t.autoplay||t.autoplayMuted)return!1;const i=this.player.media;return!!i&&0===(null==(e=i.played)?void 0:e.length)}setErrorEventMiddleWare(){this.eventMiddleware=new SR,this.eventMiddleware.addMiddleware(Qr,this.defaultErrorMiddleWare.bind(this)),this.player.setEventsMiddleware({error:this.eventMiddleware.applyMiddleware(Qr)})}defaultErrorMiddleWare(e){return d(this,null,(function*(){var t,i;if(!Ur.isMSE(this.player.media)){const{error:n}=e||{};if(!n)return ss.error("invalid media error: ",e),!1;const{code:r}=n||{};if((2===r||3===r||4===r)&&(null==(i=null==(t=this.player)?void 0:t.config)?void 0:i.url)){const t=Date.now();this.retryTimestamps=this.retryTimestamps.filter((e=>t-e<=this.config.oriErrRetryCycle));const{oriErrRetryCount:i,oriErrMaxTotalRetry:n}=this.config,o=n>0&&this.totalRetryCount>=n,a=this.retryTimestamps.length>=i,s=!1!==this.config.enableOriErrRetry;if(s&&!o&&!a)return this.oriVideoRetry(!this.shouldOriRetryReloadOnly());if(s&&(o?ss.warn(`max total retry count ${n} reached, stop retrying`):ss.warn(`retry count in window ${this.config.oriErrRetryCycle}ms reached ${i}, stop retrying`)),3===r)this.config.needSyncAnalyzeError&&(yield this.analyseStream());else{const t=ol(ll(this.player));if(t){const i=RR(t);if(i)return e.error.veError=i,!1;this.config.needSyncAnalyzeError&&(e.error.veError=yield this.analyseNet(t,e.error,this.config.analyzeTimeout))}}}}return!1}))}oriVideoRetry(e=!0){if(this.retrying)return!0;this.retrying=!0;const t=this.config.oriErrRetryBaseDelay*Math.pow(2,this.retryTimestamps.length);return ss.warn(`origin video play error, retry in ${t}ms (window: ${this.retryTimestamps.length+1}/${this.config.oriErrRetryCount}, total: ${this.totalRetryCount+1})`),this.player.addClass(CR),clearTimeout(this.retryTimer),this.retryTimer=setTimeout((()=>{this.retryTimestamps.push(Date.now()),this.totalRetryCount++,e?this.player.retry():this.oriVideoReloadWithoutPlay(),this.player.removeClass(CR),this.retrying=!1}),t),!0}oriVideoReloadWithoutPlay(){const e=this.player;e.removeClass("xgplayer-is-error"),e.addClass("xgplayer-isloading"),e.runHooks("retry",(()=>{const t=e.currentTime,i="string"==typeof e.config.url?e.config.url:"",n=Ur.isMSE(e.media)?{url:i}:e.preProcessUrl(i);e.src=n.url,e.config.isLive||(e.currentTime=t)}))}analyseNet(e,t,i){return d(this,null,(function*(){const n=t.code||t.errorCode,r=t.message||t.errorMessage||t.msg;try{const t=yield Ls(e,{range:"0-8",timeout:i});ss.log("xhr result",t);const{status:o,response:a}=t;if(403===o){if("string"==typeof a){if(a.includes("expire"))return xR.getVeErrorInfo(yR.NETWORK_URL_EXPIRE);if(a.includes("sign"))return xR.getVeErrorInfo(yR.NETWORK_URL_SIGN)}return xR.getVeErrorInfo(yR.NETWORK_FORBIDDEN)}if(416===o)return xR.getVeErrorInfo(yR.NETWORK_RANGE_NOT_SATISFIABLE);if(404===o)return xR.getVeErrorInfo(yR.NETWORK_NOTFOUND);if(o===Os.TIMEOUT)return xR.getVeErrorInfo(yR.NETWORK_TIMEOUT);if(o===Os.ERROR)return xR.getVeErrorInfo(yR.NETWORK,r);if(200===o||206===o){if(4===n)return r?xR.getVeErrorInfo(yR.MEDIA_ERR_PLAY_ERR,r):xR.getVeErrorInfo(yR.MEDIA_ERR_FILE_NOT_SUPPORTED);if(3===n)return xR.getVeErrorInfo(yR.MEDIA_ERR_DECODE,r);if(2===n)return xR.getVeErrorInfo(yR.MEDIA_ERR_NETWORK,r);if(1===n)return xR.getVeErrorInfo(yR.MEDIA_ERR_ABORTED,r);if(-9996===n){return sl(this.player)===or.PRIVATE_ENCRYPT_UPGRADE?xR.getVeErrorInfo(yR.PRIVATE_DRM_GET_KEY_FAILED):xR.getVeErrorInfo(yR.GET_HLS_DECRYPTION_KEY_ERR)}}return}catch(o){return ss.warn("Failed to analyze the network. If the domain of the video address has been configured with CORS, it means that the playback error is caused by the failure of the video request. If the domain of the video address is not configured with CORS, the real reason for the playback error cannot be determined because the video request cannot be analyzed."),xR.getVeErrorInfo(yR.NETWORK)}}))}analyseStream(){return d(this,null,(function*(){}))}handle2100Error(e){return d(this,arguments,(function*({error:e,errorCode:t,httpCode:i,response:n,finalMessage:r}){const o={errorType:mR.network,errorCode:t,httpCode:i,errorMessage:r,originError:e};if(i){if(404===i)o.veError=xR.getVeErrorInfo(yR.NETWORK_NOTFOUND);else if(416===i)o.veError=xR.getVeErrorInfo(yR.NETWORK_RANGE_NOT_SATISFIABLE);else if(403===i){try{const e=yield function(e){return(t=e)&&"object"==typeof t&&"responseText"in t&&"status"in t&&"statusText"in t?e.responseText:function(e){return!(!e||"object"!=typeof e)&&"json"in e&&"text"in e&&"status"in e}(e)?e.text():e;var t}(n);if("string"==typeof e)return e.includes("expire")?o.veError=xR.getVeErrorInfo(yR.NETWORK_URL_EXPIRE):e.includes("sign")?o.veError=xR.getVeErrorInfo(yR.NETWORK_URL_SIGN):o.veError=xR.getVeErrorInfo(yR.NETWORK_FORBIDDEN),this.createVeError(o)}catch(a){ss.warn("get response text error")}return o.veError=xR.getVeErrorInfo(yR.NETWORK_FORBIDDEN),this.createVeError(o)}}else{const e=ol(ll(this.player));if(e){const t=RR(e);t&&(o.veError=t)}}return this.createVeError(o)}))}handle9991Error({error:e,errorCode:t,httpCode:i,finalMessage:n}){return this.createVeError({errorType:mR.serve,errorCode:t||yR.OTHER.code,httpCode:i,errorMessage:n,originError:e,veError:xR.getVeErrorInfo(yR.GET_HLS_DECRYPTION_KEY_ERR)})}handleNetError(e){return d(this,arguments,(function*({error:e,errorCode:t,httpCode:i,finalMessage:n}){try{const r=ol(ll(this.player)),o=yield this.analyseNet(r,e,3e3);return o?this.createVeError({errorType:mR.network,errorCode:t||yR.OTHER.code,httpCode:i,errorMessage:n,originError:e,veError:o}):this.createVeError({errorCode:t||yR.NETWORK_ENCRYPT_HLS_ERR.code,httpCode:i,errorMessage:n,originError:e,veError:xR.getVeErrorInfo(yR.NETWORK_ENCRYPT_HLS_ERR)})}catch(r){return ss.warn("analyse fail of the net error of encrypt hls m3u8 file"),this.createVeError({errorCode:t||yR.NETWORK_ENCRYPT_HLS_ERR.code,httpCode:i,errorMessage:n,originError:e,veError:xR.getVeErrorInfo(yR.NETWORK_ENCRYPT_HLS_ERR)})}}))}handleStuckError({error:e,errorCode:t,httpCode:i,finalMessage:n}){const r={errorType:mR.network,errorCode:t,httpCode:i,errorMessage:n,originError:e},{currentTime:o,duration:a,buffered:s}=this.player,l=!s||0===s.length||!a,c=this.player.checkBuffer(o,{startDiff:0,endDiff:.1});if(l||!c)return r.veError=xR.getVeErrorInfo(yR.NETWORK),this.createVeError(r);this.createVeError(r)}transformToVeError(e){return d(this,null,(function*(){if((null==e?void 0:e.veErrorCode)&&!this.player.getPlugin("Mp4EncryptPlayer"))return e;const{httpCode:t,errorMessage:i,message:n,msg:r,response:o}=e||{},a=(null==e?void 0:e.code)||(null==e?void 0:e.errorCode),s=i||n||("string"==typeof r?r:"other error");if(2100===a)return this.handle2100Error({error:e,errorCode:a,httpCode:t,response:o,finalMessage:s});if(-9991===a)this.handle9991Error({error:e,errorCode:a,httpCode:t,finalMessage:s});else{if([2103,5104,5102].includes(a)&&this.player.getPlugin("Mp4EncryptPlayer")||-9996===a&&this.player.getPlugin("EncryptHlsPlugin"))return this.handleNetError({error:e,errorCode:a,httpCode:t,finalMessage:s});if([9002,9003].includes(a))return this.handleStuckError({error:e,errorCode:a,httpCode:t,finalMessage:s})}return this.createVeError(c({errorCode:a||yR.OTHER.code,httpCode:t,errorMessage:s,originError:e},e||{}))}))}}const OR=new Set(Object.values(_R).map((e=>e.code)));let LR=class extends ba{constructor(e){super(e),this._errDetailList=[],this._errorDomMode=null,this.state={showError:!1,retryTimes:0,idx:0},this.handleError=e=>d(this,null,(function*(){this.isVodLogConError=(null==e?void 0:e.errorCode)===yR.VOD_LOG_NOT_CONFIGURED.code,this.player&&this.player.pause(),this.config.isNeedDemoteBack?(this.state.showError=!1,this.changeMainOrBackup()):this.state.showError=!0,this.renderError(e)})),this.handleEnd=()=>{},this.handleRefreshClick=()=>{var e,t;null==(e=this.player)||e.emit(MA.PLAY_ERROR_BUTTON_CLICK),this.player.removeClass(Pa.PAUSED),this.closeError(),null==(t=this.player)||t.retry()},this.closeError=()=>{this.state.showError&&(this.state.showError=!1,this.renderError())},this.playerData=e.player.config.playerData}static get pluginName(){return"sdkErrorPlugin"}static get defaultConfig(){return{showError:!0,errorImg:!0,errorTips:!0,isNeedRefreshButton:!0,isNeedCopyButton:!0,isNeedDemoteBack:!1,retryLoopNum:1,errorTipsText:null,position:ba.POSITIONS.ROOT}}afterCreate(){var e,t,i;this.initEvents();const n=Object.values(yR).reduce(((e,t)=>{const{code:i,textKey:n}=t;return e[i]=this.i18n[n],e}),{});this.errNoteMap=c({other:null!=(i=null==(t=null==(e=this.i18n.ERROR_TYPES)?void 0:e.other)?void 0:t.msg)?i:"error",1:this.i18n.MEDIA_ERR_ABORTED,2:this.i18n.MEDIA_ERR_NETWORK,3:this.i18n.MEDIA_ERR_DECODE},n)}registerLanguageTexts(){return{clickButton:{jp:"リフレッシュ",en:"Refresh",zh:"刷新","zh-hk":"刷新"},errorTips:{jp:"再生中にエラーが発生しました。[更新]をクリックして試してください",en:"An error occurred while playing, click refresh to try",zh:"播放发生错误,点击刷新试试吧","zh-hk":"播放發生錯誤,點擊刷新試試吧"},errorCode:{jp:"コード",en:"code",zh:"错误码","zh-hk":"錯誤碼"},did:{jp:"デバイスID",en:"deviceID",zh:"设备 ID","zh-hk":"設備 ID"},playTime:{jp:"遊び時間",en:"playTime",zh:"播放时间","zh-hk":"播放時間"},copyError:{jp:"コピーエラー",en:"Copy error",zh:"复制错误信息","zh-hk":"複製錯誤訊息"},copySuccess:{jp:"コピー成功",en:"Copy success",zh:"复制成功","zh-hk":"複製成功"}}}registerIcons(){return{errorImg:{icon:pR,class:"xgplayer-error-svg"}}}updateLang(){var e,t;if(!this.$errorDom)return;const i=this.$errorDom.querySelector(".xgplayer-error-tips");if(i){const n=null!=(t=null==(e=this.config.errorTipsText)?void 0:e[this.lang])?t:this.langText.errorTips;i.innerHTML=n}const n=this.$errorDom.querySelector(".xgplayer-error-button");n&&(n.innerHTML=this.langText.clickButton)}initEvents(){this.player.on(kR,this.handleError),this.on(no,this.closeError),this.on(Xr,this.closeError)}getRetryList(){var e;const t=this.playerData.getCurrentStreams()[0];return[null==t?void 0:t.url,...null!=(e=null==t?void 0:t.backUrlList)?e:[]]}changeMainOrBackup(){this.player.addClass(Pa.ENTER);const e=this.getRetryList(),t=this.config.retryLoopNum*e.length,i=(e.indexOf(this.player.config.url)+1)%e.length;this.state.idx=i;const n=e[i];if(!n||this.state.retryTimes===t)return this.player.removeClass(Pa.ENTER),this.state.retryTimes===t&&this.player.emit(MA.PLAY_BACKUP_CHANGE_FINISH),this.state.showError=!0,this.renderError(),void this.resetTimes();this.player.once("canplay",(()=>{this.state.retryTimes=0})),ss.log(`retry times: ${this.state.retryTimes}`,n),this.player.emit(MA.PLAY_BACKUP_CHANGE,{currentUrl:this.player.config.url,nextUrl:n,retryTimes:this.state.retryTimes}),this.changeUrl(n),this.state.retryTimes=this.state.retryTimes+1}changeUrl(e){this.player.config.url=e,this.player.switchURL(e,!1),this.player.emit(MA.PlAY_URL_CHANGE,{url:e,from:MA.PLAY_BACKUP_CHANGE})}resetTimes(){this.state.retryTimes=0,this.state.idx=0}renderError(e){if(!this.config.showError)return;const t=this.root;t&&(t.innerHTML="",t.style.display="none",(this.state.showError||this.isVodLogConError)&&(this.player.emit(MA.SHOW_PLAY_ERROR),t.style.display="block",t.appendChild(this.getErrorDom(e))),this.isVodLogConError&&(this.player.blur(),this.player.pause()))}addErrDetail(e){Array.isArray(e)?this._errDetailList=[...this._errDetailList,...e]:this._errDetailList.push(e)}getErrorInfo(e){var t,i,n,r,o;const a=e.veErrorCode||e.errorCode,s=null==(t=this.player)?void 0:t.vodLogger,l=(null==(o=null==(r=null==(n=null==(i=null==s?void 0:s.tracker)?void 0:i.getConfig)?void 0:n.call(i))?void 0:r.user)?void 0:o.user_unique_id)||(null==s?void 0:s.line_user_id);return{code:a,appId:null==s?void 0:s.line_app_id,did:l||"unknown",playTime:cs().format("YYYY-MM-DD HH:mm:ss")}}getErrorInfoDom(e){const{code:t,did:i,playTime:n}=this.getErrorInfo(e),r=Ur.createDom("div","",void 0,"xgplayer-error-info-wrap"),o=`<p class="xgplayer-error-info-p">\n <span class="xgplayer-error-info-title">${this.langText.errorCode||"code"}</span>\n <span class="xgplayer-error-info-content">${t}</span>\n </p>`;r.appendChild(Ur.createDomFromHtml(o));const a=`<p class="xgplayer-error-info-p">\n <span class="xgplayer-error-info-title">${this.langText.did||"deviceID"}</span>\n <span class="xgplayer-error-info-content">${i}</span>\n </p>`;r.appendChild(Ur.createDomFromHtml(a));const s=`<p class="xgplayer-error-info-p">\n <span class="xgplayer-error-info-title">${this.langText.playTime||"playTime"}</span>\n <span class="xgplayer-error-info-content">${n}</span>\n </p>`;return r.appendChild(Ur.createDomFromHtml(s)),r}handleCopyBtnClick(e){const{did:t,playTime:i,appId:n}=this.getErrorInfo(e);try{const r=JSON.stringify(u(c({},e),{playTime:i,deviceID:t,appId:n}));navigator.clipboard.writeText(r).then((()=>{!function(e,t=1e3){const i=document.createElement("div");i.className="veplayer-toast",i.textContent=e,document.body.appendChild(i),setTimeout((()=>i.classList.add("show")),10),setTimeout((()=>{i.classList.remove("show"),setTimeout((()=>null==i?void 0:i.remove()),300)}),t)}(this.langText.copySuccess||"copySuccess")}))}catch(r){ss.error("copy error info err ",r)}}getActionDom(e){const t=e.errorType,i=Ur.createDomFromHtml('<div class="xgplayer-error-action-wrap"></div>'),n=!(t&&[mR[10],mR[11],mR[12]].includes(t));if(this.config.isNeedRefreshButton&&n){const e=Ur.createDom("div",this.langText.clickButton||"Refresh",void 0,"xgplayer-error-button refresh-button");this.bind(".refresh-button","click",this.handleRefreshClick),i.appendChild(e)}if(this.config.isNeedCopyButton){const t=Ur.createDom("div",this.langText.copyError||"CopyError",void 0,"xgplayer-error-button copy-button");this.bind(".copy-button","click",this.handleCopyBtnClick.bind(this,e)),i.appendChild(t)}return i}getErrorDom(e){var t,i,n,r,o,a;const{errorCode:s,message:l,displayMessage:c}=e,u=null!=(t=null==e?void 0:e.veErrorCode)?t:null==e?void 0:e.errorCode,h=!!mB.ttDramaEnv,d="number"==typeof u&&OR.has(u);if("drama"===(h&&d?"drama":"normal")){if(!this.$errorDom){this.$errorDom=Ur.createDom("div","",void 0,"xgplayer-error-cover xgplayer-drama-error-cover");const e=Ur.createDom("div","Video isn't available",void 0,"xgplayer-drama-error-toast");this.$errorDom.appendChild(e),this.emit("sdkerrorplugin_render",this.$errorDom)}return this.$errorDom}if(!this.$errorDom){if(this.$errorDom=Ur.createDom("div","",void 0,"xgplayer-error-cover"),this.config.errorImg){const e=Ur.createDom("div","",void 0,"xgplayer-error-img");e.appendChild(this.icons.errorImg),this.$errorDom.appendChild(e)}if(this.config.errorTips){let t="";t=(null==(n=null==(i=this.config)?void 0:i.errorTipsText)?void 0:n[this.lang])?null==(r=this.config.errorTipsText)?void 0:r[this.lang]:e?c||this.errNoteMap[s]||this.player.errorNote&&this.i18n[this.player.errorNote]||l||this.errNoteMap.other||"error":this.langText.errorTips;const o=Ur.createDom("div",t,void 0,"xgplayer-error-tips");this.$errorDom.appendChild(o)}this.$errorDom.appendChild(this.getErrorInfoDom(e)),this.$errorDom.appendChild(this.getActionDom(e)),(null==(o=this._errDetailList)?void 0:o.length)&&(null==(a=this._errDetailList)||a.forEach((e=>{const t="function"==typeof e?e():e;if(t){const e=Ur.createDom("div",`${t.label}: ${t.value}`,void 0,"xgplayer-error-detail-info");this.$errorDom.appendChild(e)}}))),this.emit("sdkerrorplugin_render",this.$errorDom)}return this.$errorDom}destroy(){this.player.off(Qr,this.handleError)}render(){return this.config.showError?'<xgplayer-error class="xgplayer-error"></xgplayer-error>':""}};function NR(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function MR(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?NR(Object(i),!0).forEach((function(t){jR(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):NR(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function UR(e){return(UR="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})(e)}function BR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FR(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,ex(n.key),n)}}function HR(e,t,i){return t&&FR(e.prototype,t),i&&FR(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function jR(e,t,i){return(t=ex(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function VR(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&GR(e,t)}function KR(e){return(KR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function GR(e,t){return(GR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function WR(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(ds){return!1}}function YR(e,t,i){return(YR=WR()?Reflect.construct.bind():function(e,t,i){var n=[null];n.push.apply(n,t);var r=new(Function.bind.apply(e,n));return i&&GR(r,i.prototype),r}).apply(null,arguments)}function zR(e){var t="function"==typeof Map?new Map:void 0;return zR=function(e){if(null===e||(i=e,-1===Function.toString.call(i).indexOf("[native code]")))return e;var i;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return YR(e,arguments,KR(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),GR(n,e)},zR(e)}function $R(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XR(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $R(e)}function qR(e){var t=WR();return function(){var i,n=KR(e);if(t){var r=KR(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return XR(this,i)}}function ZR(){return ZR="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=KR(e)););return e}(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},ZR.apply(this,arguments)}function QR(e){return function(e){if(Array.isArray(e))return JR(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return JR(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return JR(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function JR(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function ex(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var tx=["b","i","u","span","c","ruby","rt","v","lang"],ix=["br"];var nx=/^WEBVTT/i,rx=/^\d+\r?\n\d{2}:\d{2}:\d{2},\d{3}\s*-->/m,ox=/^STYLE+$/,ax=/^\:\:cue/,sx=/^}+$/,lx=/^\[Script Info\].*/,cx=[/[0-9]{1,3}:[0-9]{2}:[0-9]{2}\.[0-9]{1,3}-->[0-9]{1,3}:[0-9]{2}:[0-9]{2}\.[0-9]{1,3}/,/[0-9]{1,3}:[0-9]{2}\.[0-9]{1,3}-->[0-9]{1,3}:[0-9]{2}\.[0-9]{1,3}/,/[0-9]{1,3}\.[0-9]{1,3}-->[0-9]{1,2}\.[0-9]{1,3}/,/[0-9]{1,3}:[0-9]{2}:[0-9]{2},[0-9]{1,3}\s*-->\s*[0-9]{1,3}:[0-9]{2}:[0-9]{2},[0-9]{1,3}/],ux=/^Format:\s/,hx=/^Style:\s/,dx=/^Dialogue:\s/,fx=/^([0-5]?\d)[.,](\d{1,3})$/;function px(e){var t=fx.exec(e);return t?(1e3*Number(t[1])+Number(t[2]))/1e3:0}function gx(e){var t=e.length;return 3===t?60*(60*Number(e[0])+Number(e[1]))+px(e[2]):2===t?60*Number(e[0])+px(e[1]):px(e[0])}function yx(e){return/^(\-|\+)?\d+(\.\d+)?$/.test(e)}function vx(e){return null==e?"":String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function mx(e,t){return e>=0&&e<t.length?t[e]:""}function _x(e){return t=function(e){return String(e||"").trim().split(/[\s.]/)[0].toLowerCase()}(e),tx.includes(t)||ix.includes(t);var t}var Ex=function(){function e(){BR(this,e)}return HR(e,null,[{key:"parseJson",value:function(e){for(var t=[],i=0,n=0;n<e.length;n++){if(i>=50&&(i=0),0===i){var r={start:e[n].start,list:[e[n]],end:e[n].end};t.push(r)}else t[t.length-1].list.push(e[n]),t[t.length-1].end=e[n].end;i++}return t}},{key:"parse",value:function(t,i){var n=e.checkFormat(t);try{var r;i({format:n,list:(r="ass"===n?e.parseASS(t):e.parseVTT(t)).list,styles:r.styles})}catch(dF){console.error(dF),i({format:n},dF)}}},{key:"parseASSItem",value:function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(","),i={},n="";try{var r=t.length-e.length;return n=vx(n=(n=r>0?t.splice(e.length-1,r+1).join(",")+"":t[t.length-1]+"").replace(/\\n+/g,"")),t[e.length-1]=n,e.map((function(e,n){"end"===e||"start"===e?i[e]=gx(t[n].split(":")):"text"===e?i[e]=[t[n]]:"layer"===e?(i[e]=[t[n]],i.textTag=[t[n]]):i[e]="style"===e?[t[n]]:Number(t[n])?Number(t[n]):t[n]})),i}catch(dF){return console.error(dF),{}}}},{key:"parseASS",value:function(t){for(var i=t.split("\n"),n=[],r=0,o=0,a=[],s=[],l=null;r<i.length;){if(ux.test(i[r]))s=(s=i[r].replace(ux,"").replace(/\s+/g,"").split(",")).map((function(e){return e.toLocaleLowerCase()}));else if(hx.test(i[r]))a.push(i[r].replace(hx,"").replace(/\s+/g,""));else if(dx.test(i[r])){var c=e.parseASSItem(i[r].replace(dx,""),s);if(l&&c.start===l.start&&c.end===l.end)try{var u=l,h=u.text,d=u.textTag,f=u.style;h.push(c.text[0]),d.push(c.textTag[0]),f.push(c.style[0])}catch(dF){console.error(dF)}else{l=c;var p=null;o%50==0?((p={start:l.start,end:l.end,list:[]}).list.push(l),n.push(p)):((p=n[n.length-1]).end=l.end,p.list.push(l)),o++}}r++}return{list:n,styles:[]}}},{key:"parseVTTStyle",value:function(e,t){var i=e.split(":");if(i.length>1){var n=i[0].trim().split("-"),r="";n.length>1?n.map((function(e,t){r+=0===t?e:e.charAt(0).toUpperCase()+e.slice(1)})):r=n[0],t[r]=i[1].trim().replace(/;$/,"")}return t}},{key:"parseVTT",value:function(e){for(var t=(e=e.replace(nx,"")).split("\n"),i=[],n=0,r=0,o=null,a=!1,s=!1,l=null,c=null,u=[];n<t.length;){var h=mx(n,t).trim();if(!h||a&&yx(h))a=!h;else if(ax.test(h)&&ox.test(mx(n-1,t).trim())){s=!0;var d=/\((.+?)\)/g.exec(h);c=d?d[1]:"",l=""}else if(s)sx.test(h)?(u.push({key:c||"",style:l||""}),l=null,c=null,s=!1):l+=h;else if(h){a=!1;var f=this.checkIsTime(t[n]);if(f){var p=this.parseVttTime(f);if(!o||p.start!==o.start||p.end!==o.end){(o=p).text=[],o.textTag=[];var g=null;r%50==0?((g={start:o.start,end:o.end,list:[]}).list.push(o),i.push(g)):((g=i[i.length-1]).end=o.end,g.list.push(o)),r++}}else if(o){var y=o,v=y.text,m=y.textTag,_=this.parseVttText(t[n]);v.push(_.text),m.push(_.tag)}a=!1}n++}return{list:i,styles:u}}},{key:"checkIsTime",value:function(e){e=e.replace(/\s+/g,"");for(var t=0,i=null;t<cx.length&&!(i=cx[t].exec(e));)t++;return i?i[0]:null}},{key:"parseVttText",value:function(e){var t=/^(<?.+?>)/g.exec(e),i="",n="default";if(t){if(_x(n=t[0].replace(/\<|\>|\&/g,"")))return{tag:"default",text:vx(e.replace(/\\n+/g,"<br/>"))};var r=RegExp("^<".concat(n,">(([\\s\\S])*?)</").concat(n,">$")).exec(e);r?i=r[1]:(i=e,n="")}else i=e;for(var o=/<(\w+)\.(\w+)>/g,a=o.exec(i);a&&a.length>2;)i=i.replace(a[0],"<".concat(a[1],' class="').concat(a[2],'">')),a=o.exec(i);return{tag:n,text:vx(i.replace(/\\n+/g,"<br/>"))}}},{key:"parseVttTime",value:function(e){var t=e.split("--\x3e"),i=0,n=0;if(2===t.length){var r=t[0].split(":"),o=t[1].split(":");i=gx(r),n=gx(o)}return{start:i,end:n,time:e}}},{key:"isVTT",value:function(e){return nx.test(e)}},{key:"isASS",value:function(e){return lx.test(e)}},{key:"checkFormat",value:function(e){return e?nx.test(e)?"vtt":lx.test(e)?"ass":rx.test(e)?"srt":"":""}}]),e}(),Tx=[{code:0,msg:"SUCCESS"},{code:1,msg:"LOAD_ERROR"},{code:2,msg:"PARSER_ERROR"},{code:3,msg:"FORMAT_NOT_SUPPORTED"},{code:4,msg:"ID_OR_LANGUAGE_NOT_EXIST"},{code:5,msg:"PARAMETERS_ERROR"},{code:6,msg:"ABORT"},{code:7,msg:"UNKNOWN"},{code:8,msg:"DATA_ERROR:subtitle.url is null"},{code:9,msg:"DATA_ERROR:subtitle.url length is 0"}],Sx=function(e){VR(i,zR(Error));var t=qR(i);function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return BR(this,i),e||(e=Tx[r||7].msg),(n=t.call(this,e)).code=r||7,n.message=e,n.type=Tx[r||7].msg,n.orgError=o||null,n.data=a||null,n}return HR(i)}();function bx(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,n={code:Tx[e].code,msg:Tx[e].msg,message:Tx[e].msg,id:i&&i.id||"",language:i&&i.language||""};return Object.keys(t).map((function(e){n[e]=t[e]})),n}var Cx=HR((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.url,n=t.method,r=void 0===n?"GET":n,o=t.type,a=void 0===o?"arraybuffer":o,s=t.timeout,l=void 0===s?1e4:s,c=t.data,u=void 0===c?{}:c,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return BR(this,e),new Promise((function(e,t){var n=new window.XMLHttpRequest,o=r.toUpperCase(),s=[];if(a&&(n.responseType=a),l&&(n.timeout=l),Object.keys(u).forEach((function(e){s.push("k=".concat(u[e]))})),n.onload=function(){200===n.status||206===n.status?e({context:h,res:n}):t(new Error({context:h,res:n,type:"error"}))},n.onerror=function(e){t(new Error({context:h,res:n,type:"error"}))},n.ontimeout=function(e){t(new Error({context:h,res:n,type:"error"}))},n.onabort=function(){t(new Error({context:h,res:n,type:"error"}))},"GET"===o)n.open(o,"".concat(i)),n.send();else{if("post"!==o)throw new Error("xhr ".concat(o," is not supported"));n.open(o,i),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.send(s.join("&"))}}))})),kx=function(){function e(){var t,i;BR(this,e);var n=new Promise((function(e,n){t=e,i=n}));return n.resolve=function(e){t(e),n.state="fulfilled"},n.reject=function(e){i(e),n.state="rejected",n.isBreak="DESTROYED"===e},n.state="pending",n}return HR(e,[{key:"resolve",value:function(e){}},{key:"reject",value:function(e){}}]),e}();function Ix(e,t){if(!e)return!1;if(e.classList)return Array.prototype.some.call(e.classList,(function(e){return e===t}));var i=e.className&&"object"===UR(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function Px(e,t){e&&(e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):Ix(e,t)||(e.className&&"object"===UR(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t))}function Dx(e,t,i){var n=t.length;if(n<1)return-1;if(t[i=i<0?0:i>=n?n-1:i].start<=e&&e<t[i].end)return i;for(var r=t[i].end<=e?i+1:0;r<n;r++){if(t[r].start<=e&&e<t[r].end)return r;if(e>t[r].end&&r+1<n&&e<t[r+1].start)return-1;if(e>t[r].end&&r+1>=n)return-1}return-1}function wx(e,t,i){var n=t.length;if(n<1)return[];var r=[];if((i=i<0?0:i>=n?n-1:i)<n)for(var o=t[i].end<=e?i:0;o<n&&(t[o].start<=e&&e<t[o].end&&r.push(o),!(e<t[o].start));o++);return r}function Ax(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function Rx(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=n,r.innerHTML=t,Object.keys(i).forEach((function(t){var n=t,o=i[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(n,o):r.setAttribute(n,o)})),r}function xx(e){return e&&e instanceof window.HTMLMediaElement}function Ox(e,t,i){if(i||(i=new kx),"json"===t){var n=Ex.parseJson(e);i.resolve({list:n,format:"json"})}else"string"===t&&Ex.parse(e,(function(e,t){if(t){var n=bx(2,t);i.reject(n,{format:e.format})}else if(e.format||e.list&&0!==e.list.length)i.resolve({styles:e.styles,list:e.list,format:e.format});else{var r=bx(3);i.reject(r)}}));return i}function Lx(e,t){t||(t=new kx);var i=[];"String"===Ax(e.url)?i=[e.url]:"Array"===Ax(e.url)&&(i=QR(e.url));return function n(){var r=i.shift();if(r)new Cx({url:r,type:"text"}).then((function(i){Ox(i.res.response,"string").then((function(i){t.resolve(MR(MR({},i),e))})).catch((function(e){t.reject(e)}))})).catch((function(o){if(i.length>0)n();else{var a=bx(1,MR({statusText:o.statusText,status:o.status,type:o.type,message:"http load error",url:r},e));t.reject(a)}}));else{var o=bx(1,MR({message:"http load error",url:e.url},e));t.reject(o)}}(),t}function Nx(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if("number"==typeof e)return Number.isFinite(e)?Math.trunc(e):t;if("string"==typeof e){var i=e.trim();if(!i)return t;var n=parseInt(i,10);return Number.isNaN(n)?t:n}return t}function Mx(e,t){return!(!e||!t)&&!!(e.id&&t.id&&e.id===t.id||e.language&&t.language&&e.language===t.language)}function Ux(e){return null!==e&&""!==e.trim()&&/^[a-zA-Z]+$/.test(e)}function Bx(e){return!!/[\x21-\x2f\x3a-\x40\x5b-\x60\x7B-\x7F]/.test(e)}var Fx=function(){function e(){var t=this;BR(this,e),this.__handlers=[],window.ResizeObserver&&(this.observer=new window.ResizeObserver((function(e){t.__trigger(e)})))}return HR(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var i=this.__handlers,n=-1,r=0;r<i.length;r++)i[r]&&e===i[r].target&&(n=r);n>-1?this.__handlers[n].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(i,n){e===i.target&&(t=n)})),this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e,t){for(var i=this.__handlers,n=0;n<i.length;n++)if(i[n]&&e===i[n].target){i[n].handler&&i[n].handler.forEach((function(i){try{i(e,t)}catch(dF){console.error(dF)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){var i=e.contentRect;t.__runHandler(e.target,i)}))}}]),e}(),Hx=null;var jx="resize",Vx="change",Kx="off",Gx="update",Wx="error",Yx=/^[A-Za-z0-9_-]+$/,zx=/^[A-Za-z]{1,8}(?:-[A-Za-z0-9]{1,8})*$/;function $x(e,t){t&&String(t).split(/(?:\\[nN]|\r\n|\r|\n)+/).forEach((function(t,i){i>0&&e.appendChild(document.createElement("br")),t&&e.appendChild(document.createTextNode(t))}))}function Xx(e){var t=e.slice(1,-1).trim();if(!t||"!"===t[0]||"?"===t[0])return null;if("/"===t[0]){var i=/^\/\s*([A-Za-z][\w:-]*)/.exec(t),n=i&&i[1].toLowerCase();return n&&tx.includes(n)?{closing:!0,tagName:n}:null}var r=/\/\s*$/.test(t),o=t.replace(/\/\s*$/,""),a=/^([A-Za-z][\w:-]*(?:\.[^\s/>.]+)*)([\s\S]*)$/.exec(o);if(!a)return null;var s=a[1].split("."),l=s.shift().toLowerCase();if(!tx.includes(l)&&!ix.includes(l))return null;var c,u=function(e){var t=e.trim(),i={};if(!t||!/(?:^|\s)[^\s=]+\s*=/.test(t))return{attrs:i,annotation:t};for(var n=/([^\s=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,r=n.exec(t);r;)i[r[1].toLowerCase()]=r[2]||r[3]||r[4]||"",r=n.exec(t);return{attrs:i,annotation:""}}(a[2]),h=u.attrs;return{attrs:h,annotation:u.annotation,closing:!1,className:(c="".concat(s.join(" ")," ").concat(h.class||""),String(c||"").split(/\s+/).filter((function(e){return Yx.test(e)})).join(" ")),selfClosing:r,tagName:l}}function qx(e){var t="c"===e.tagName||"v"===e.tagName||"lang"===e.tagName?"span":e.tagName,i=document.createElement(t);e.className&&(i.className=e.className);var n=function(e){var t=String(e||"").trim();return zx.test(t)?t:""}(e.attrs.lang||("lang"===e.tagName?e.annotation:""));return n&&i.setAttribute("lang",n),"v"===e.tagName&&e.annotation&&i.setAttribute("data-voice",e.annotation),i}function Zx(e,t){for(var i=function(e){return null==e?"":String(e).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;|&apos;/g,"'").replace(/&amp;/g,"&")}(t),n=[{dom:e,tagName:""}],r=/<[^>]*>/g,o=0,a=r.exec(i);a;){$x(n[n.length-1].dom,i.slice(o,a.index));var s=a[0],l=Xx(s);if(l)if(l.closing){var c=n.map((function(e){return e.tagName})).lastIndexOf(l.tagName);c>0?n.length=c:$x(n[n.length-1].dom,s)}else if("br"===l.tagName)n[n.length-1].dom.appendChild(document.createElement("br"));else{var u=qx(l);n[n.length-1].dom.appendChild(u),l.selfClosing||n.push({dom:u,tagName:l.tagName})}else $x(n[n.length-1].dom,s);o=r.lastIndex,a=r.exec(i)}$x(n[n.length-1].dom,i.slice(o))}function Qx(e){var t=[];if(e&&"String"===Ax(e))t.push({url:[e],index:0,start:-1,end:-1});else if("Array"===Ax(e)){if(0===e.length)return t;"String"===Ax(e[0])?t.push({url:QR(e),index:0,start:-1,end:-1}):e.forEach((function(e,i){t.push({url:e.url||e.src||"",index:i,start:e.start||-1,end:e.end||-1})}))}return t}var Jx=!1,eO=function(e){VR(i,Rr);var t=qR(i);function i(e){var n,r,o,a,s,l,c;return BR(this,i),jR($R(n=t.call(this)),"_onPause",(function(){n.stopRender()})),jR($R(n),"_onPlay",(function(){n._curRenderTask.length>0&&n.startRender(-1)})),jR($R(n),"_onTimeupdate",(function(){if(n._isOpen){if(n.config.domRender){var e=n.player.media?n.player.media:n.player,t=e.videoWidth,i=e.videoHeight;!n._videoMeta.scale&&t&&i&&n._onResize(n.player.root)}var r=n._getPlayerCurrentTime();Math.round(Math.abs(1e3*r-n._ctime))<200||(n._ctime=1e3*r,n.currentText&&n.currentText.list&&("live"===n.config.updateMode?n._liveUpdate(r):n._update(r)))}})),jR($R(n),"_onResize",(function(e){var t=$R(n),i=t._videoMeta;if(t.config.domRender){if(e&&e instanceof window.Element||(e=n.player.root),n._iId&&(clearTimeout(n._iId),n._iId=null),!i.scale){if(!n.player.video)return;var r=n.player.video,o=r.videoWidth,a=r.videoHeight;if(!o||!a)return;i.videoWidth=o,i.videoHeight=a,i.scale=Nx(a/o*100)}n.__startResize(e)}})),jR($R(n),"_onCoreEvents",(function(e){try{switch(e.eventName){case"core.subtitlesegments":n._onSubtitleSegment(e.list||[]);break;case"core.subtitleplaylist":n._onSubtitlePlaylist(e.list||[]);break;case"core.seipayloadtime":n._onCoreSeiintime(e)}}catch(t){console.error(t)}})),jR($R(n),"startRender",(function(e){if(e>0&&n._renderIntervalId&&(window.cancelAnimationFrame(n._renderIntervalId),n._renderIntervalId=-1),n.textTrack){var t=$R(n)._curRenderTask;n._lastTimeStamp=(new Date).getTime();var i=[];t.forEach((function(t,r){var o=t.lastTime,a=t.wordList,s=t.interval,l=t.dom,c=t.ids;if(e<0||n._lastTimeStamp<0||n._lastTimeStamp-o>=s){var u=a.shift();u&&l.appendData(u),t.lastTime=n._lastTimeStamp}a.length<1&&i.push({index:r,ids:c})})),n._log(">>>>_renderByWords emptyArr",i.length,t.length),i.forEach((function(e){t.splice(e.index,1),n._log(">>>_renderByWords remove emptyArr",e.index,t.length)})),t.length>0&&(n._renderIntervalId=window.requestAnimationFrame(n.startRender))}})),jR($R(n),"destroy",(function(){n.detachPlayer(),n.removeAllListeners(),n.player=null,n.textTrack=null,n._curRenderTask=[],n.stopRender()})),r=navigator.userAgent,o=/(?:Windows Phone)/.test(r),a=/(?:SymbianOS)/.test(r)||o,s=/(?:Android)/.test(r),l=/(?:Firefox)/.test(r),c=/(?:iPad|PlayBook)/.test(r)||s&&!/(?:Mobile)/.test(r)||l&&/(?:Tablet)/.test(r),Jx=/(?:iPhone)/.test(r)&&!c||s||a||c,n.currentText=null,n.currentExtText=null,n.textTrack=[],n._cid=-1,n._gid=-1,n._cids=[],n._iId=null,n._iC=0,n.player=null,n.root=null,n.config={line:"double",bottom:0,mode:"stroke",defaultOpen:!1,baseSizeX:49,baseSizeY:28,minSize:16,minMobileSize:13,fitVideo:!0,offsetBottom:2,fontColor:"#fff",domRender:!0,updateMode:"vod",renderMode:"",debugger:!1},n._ctime=0,n._loadingTrack={},n.seiTime=0,n.lastSeiTime=0,n._curTexts=[],n._curRenderTask=[],n._renderIntervalId=-1,n._lastTimeStamp=-1,Object.keys(n.config).map((function(t){void 0!==e[t]&&null!==e[t]&&(n.config[t]=e[t])})),n._isOpen=n.config.defaultOpen||!1,n._videoMeta={scale:0,videoHeight:0,videoWidth:0,lwidth:0,lheight:0,vWidth:0,vHeight:0,vBottom:0,vLeft:0,marginBottom:0},e.subTitles&&"Array"===Ax(e.subTitles)?(e.player&&n.attachPlayer(e.player),n.setSubTitles(e.subTitles,n.config.defaultOpen),n):XR(n)}return HR(i,[{key:"version",get:function(){return"3.0.25-rc.11"}},{key:"setSubTitles",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this._isOpen||i;n&&this.innerRoot&&this.switchOff(),!t||t.length<1?this.switchOff():(this.currentText=null,this.textTrack=[],t.forEach((function(t){var i={};Object.keys(t).map((function(e){i[e]=t[e]})),i.url=Qx(i.url),i.isDefault&&(e.currentText=i),e.textTrack.push(i)})),this._log("setSubTitles",r),r&&(this.currentText||(this.currentText=this.textTrack[0]),this.switch().catch((function(t){e.emitError(t),e._log("[switch]",t)}))),this.currentText&&this._loadTrack(this.currentText).then((function(t){e.addStyles(t)})).catch((function(t){e.emitError(t),e._log("[_loadTrack] error",t)})),this.emit("reset",{type:"reset",list:this.textTrack,isOpen:r}))}},{key:"updateSubTitle",value:function(e){for(var t=this,i=-1,n=0;n<this.textTrack.length;n++)if(Mx(e,this.textTrack[n])){i=n;break}if(this._log("updateSubTitle",i,e),i>-1){var r=Mx(this.currentText,this.textTrack[i]);if(this._log("updateSubTitle","_isCurrent",r,"this.isOpen",this.isOpen,this.currentText),!r)return;var o=Qx(e.url);this.isOpen?(o.forEach((function(e){t.textTrack[i].url.push(e)})),this._log("updateSubTitle _loadTrackUrls",this.textTrack[i]),this._loadTrackUrls(this.currentText,2)):this.textTrack[i].url=o}}},{key:"addStyles",value:function(e){var t=e.styles,i=e.format;t&&"vtt"===i&&(t.map((function(e){e.key||(e.key="xg-text-track-span")})),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i="";e.map((function(e){i+=" ".concat(t," ").concat(e.key," {").concat(e.style,"}")}));var n=document.head||document.getElementsByTagName("head")[0],r="xg-text-track-style",o=document.getElementById(r);if(o||((o=document.createElement("style")).type="text/css",o.id=r,n.appendChild(o)),o.styleSheet){var a=function(){try{o.styleSheet.cssText=(o.styleSheet.cssText||"")+i}catch(ds){}};o.styleSheet.disabled?setTimeout(a,10):a()}else{var s=document.createTextNode(i);o.appendChild(s)}}(t,".xg-text-track"))}},{key:"attachPlayer",value:function(e){var t=this;if(this._log("attachPlayer"),e&&e!==this.player){this.player&&this.detachPlayer();var i,n,r=this.config,o=r.fontColor,a=r.mode,s=r.fitVideo,l=r.domRender;if(this.player=e,l&&(this.root=document.createElement("xg-text-track"),this.root.className="xg-text-track",!this._isOpen&&Px(this.root,"text-track-hide"),!s&&Px(this.root,"text-track-no-fitvideo"),a&&Px(this.root,"text-track-".concat(a)),this.innerRoot=document.createElement("xg-text-track-inner"),this.root.appendChild(this.innerRoot),o&&(this.root.style.color=o),this.currentText&&["language","id","label"].map((function(e){t.root.setAttribute("data-".concat(e),t.currentText[e]||"")})),this.player.root&&this.player.root.appendChild(this.root),this.player.root&&(i=e.root,n=this._onResize,Hx||(Hx=new Fx),Hx.addObserver(i,n))),xx(this.player))this.player.addEventListener("timeupdate",this._onTimeupdate),this.player.addEventListener("pause",this._onPause),this.player.addEventListener("play",this._onPlay);else{if("function"!=typeof this.player.on)return;this.player.on("destroy",this.destroy),this.player.on("timeupdate",this._onTimeupdate),this.player.on("pause",this._onPause),this.player.on("play",this._onPlay),this.player.on("core_event",this._onCoreEvents)}this._isOpen&&this.switch().catch((function(e){t._log("[switch]",e)}))}}},{key:"detachPlayer",value:function(){var e,t,i=this.player,n=this.config;i&&(xx(i)?(i.removeEventListener("timeupdate",this._onTimeupdate),i.removeEventListener("pause",this._onPause),i.removeEventListener("play",this._onPlay)):"function"==typeof i.off&&(i.off("destroy",this.destroy),i.off("timeupdate",this._onTimeupdate),i.off("pause",this._onPause),i.off("play",this._onPlay),i.off("core_event",this._onCoreEvents)),n.domRender&&(i.root&&(e=i.root,Hx&&Hx.unObserver(e,t),this.root&&i.root.contains(this.root)&&i.root.removeChild(this.root)),this.innerRoot=null,this.root=null),this.player=null)}},{key:"switch",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};return this._log("switch",t),this._loadingTrack=t,new Promise((function(i,n){if(!t.id&&!t.language){if(e.currentText)return e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),void i({message:"switch default subtitle success",code:0});var r=new Sx("no default subtitle",5);return e.emitError(r),void n(r)}if(e.currentText&&Mx(t,e.currentText))e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),i(bx(0));else{var o=null;e.__removeByTime(e._curTexts,0);for(var a=0;a<e.textTrack.length;a++)if(Mx(t,e.textTrack[a])){o=e.textTrack[a];break}if(e._log("nextSubtitle",o),o)e._emitPlayerSwitch(e.currentText,o),o.list?(e._loadingTrack={},e._updateCurrent(o),e.switchOn(),i(bx(0))):(e._log("this._loadTrack",o),e._updateCurrent(o),e._loadTrack(o).then((function(r){if(e.addStyles(r),e._loadingTrack.id===o.id||e._loadingTrack.language===r.language)e._loadingTrack={},e._updateCurrent(r),e.switchOn(),i(bx(0));else{var a=new Sx("check _loadingTrack fail id: ".concat(e._loadingTrack.id," nextSubtitle:").concat(r.id),6,null,t);e.emitError(a),n(a)}})).catch((function(t){e.emitError(t),n(t)})));else{var s=new Sx("The is no subtitle with id:[{".concat(t.id,"}] or language:[").concat(t.language,"]"),4,null,t);e.emitError(s),n(s)}}}))}},{key:"switchExt",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};return new Promise((function(i,n){if(t.id||t.language){for(var r=null,o=0;o<e.textTrack.length;o++)if(Mx(t,e.textTrack[o])){r=e.textTrack[o];break}r&&!Mx(r,e.currentText)&&e._loadTrack(r).then((function(t){e.currentExtText=t,i(bx(0))})).catch((function(t){e.emitError(t)}))}else e.currentExtText=null,i(bx(0))}))}},{key:"emitError",value:function(e){this.emit(Wx,{type:Wx,error:e})}},{key:"switchOn",value:function(){this._log("switchOn"),this._isOpen=!0,this.show();var e=this.currentText||{},t=e.id,i=e.language;this.emit(Vx,{type:Vx,isOpen:!0,id:t,language:i,texts:[]})}},{key:"switchOff",value:function(){if(this._isOpen=!1,this.hide(),this.currentText){var e=this.currentText,t=e.id,i=e.language;this.emit(Kx,{type:Kx,id:t,language:i,texts:[],isOpen:!1})}}},{key:"isOpen",get:function(){return this._isOpen}},{key:"_log",value:function(){if(this.config.debugger){for(var e,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];(e=console).log.apply(e,["[xgSubtitle]"].concat(i))}}},{key:"_loadTrack",value:function(e){var t=this;this._log("_loadTrack",e.language,e);var i=new kx,n="",r="";if(e.json?(n="json",r=e.json):!e.stringContent||e.url&&0!==e.url.length||(n="string",r=e.stringContent),r)return Ox(r,n).then((function(t){e.format=t.format,e.styles=t.styles,e.list=t.list,i.resolve(e)})).catch((function(e){t.emitError(e),i.reject(e)})),i;var o=e.url;return 0===o.length?(i.resolve(e),i):(Lx(o.splice(0,1)[0]).then((function(n){e.format=n.format,e.styles=n.styles,e.list||(e.list=[]),t._pushList(e.list,n.list),o.length>0&&t._loadTrackUrls(e,2),i.resolve(e)})).catch((function(e){t.emitError(e),i.reject(e)})),i)}},{key:"_emitPlayerSwitch",value:function(e,t){e&&"live"===this.config.updateMode&&(e.list=[],e.url=[]);var i=MR({lang:t.language},t);this._log("emit subtile_switch ",t,i),this.player&&"function"==typeof this.player.emit&&this.player.emit("switch_subtitle",i)}},{key:"_loadTrackUrls",value:function(e,t,i){var n=this,r=e.url.length,o=r>t?e.url.splice(0,t):e.url.splice(0,r),a=o.length;this._log("_loadTrackUrls",e.language,r,o.length,a),o.forEach((function(t,r){Lx(MR(MR({},t),{},{index:r})).then((function(t){e.format=t.format,e.styles=t.styles,e.list||(e.list=[]),n._pushList(e.list,t.list),a--})).catch((function(e){a--})).finally((function(t){0===a&&(i&&i.resolve(e),n._loadTrackUrls(e,2))}))}))}},{key:"_freshUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{url:""},i=-1;e.url.forEach((function(e,n){e.url===t.url&&(i=n)})),i>-1&&e.url.splice(i,1)}},{key:"_pushList",value:function(e,t){if(!t||0===t.length)return e;var i=t[0].start,n=t[t.length-1].end;if(0===e.length||i>=e[e.length-1].end)t.forEach((function(t){e.push(t)}));else{for(var r=-1,o=0;o<e.length;o++)if(e[o].start>n){r=o;break}r>-1&&t.forEach((function(t,i){e.splice(r+i,0,t)}))}return e}},{key:"_updateCurrent",value:function(e){var t=this;this.currentText=e,this.config.domRender&&this.root&&(["language","id","label"].map((function(e){t.root.setAttribute("data-".concat(e),t.currentText[e]||"")})),this.__remove(this._cids)),this._cids=[],this._gid=-1,this._cid=-1,this._curTexts=[];var i=this._getPlayerCurrentTime();i&&("live"===this.config.updateMode?this._liveUpdate(i):this._update(i))}},{key:"__loadAll",value:function(){var e=this;this.textTrack.forEach((function(t){e._loadTrack(t)}))}},{key:"getDelCid",value:function(e,t){for(var i=[],n=0;n<e.length;n++)t.includes(e[n])||i.push(e[n]);return i}},{key:"getNewCid",value:function(e,t){for(var i=[],n=0;n<t.length;n++)e.includes(t[n])||i.push(t[n]);return i}},{key:"_liveUpdate",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var i=[],n=Dx(e,this.currentText.list,this._gid);if(n>-1&&(i=wx(e,this.currentText.list[n].list,this._cid)),this.__removeByTime(this._curTexts,e),this._log("_liveUpdate",e,n,i,this.currentText.list[0].list[0].start,this.currentText.list[0].list[0].end),i.length>0){var r=function(e,t,i){if(0===e.length||t<0||t>e.length-1)return[];var n=e[t].list;if(0===i.length)return[];var r=n.splice(i[0],i.length);return t>0&&e.splice(0,t),0===n.length&&e.splice(0,1),r}(this.currentText.list,n,i),o=this._curTexts.length,a=o>0?this._curTexts[o-1].index:0;r.forEach((function(e,i){e.index=i+a,t._curTexts.push(e)})),this.__render(r)}this.emit(Gx,this.getUpdateData(this._curTexts,0,this.currentText))}}},{key:"_update",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var i=Dx(e,this.currentText.list,this._gid),n=[];if(i>-1&&(n=wx(e,this.currentText.list[i].list,this._cid)),n.length<1)return this._cids.length>0&&this.config.domRender&&this.__remove(this._cids),this._cids=[],this._curTexts.length>0&&this.emit(Gx,this.getUpdateData([],e,this.currentText)),void(this._curTexts=[]);if(this._cids.join("")!==n.join("")||i!==this._gid){this._gid=i,this._cid=n[0];var r=this.getDelCid(this._cids,n),o=this.getNewCid(this._cids,n);this._cids=n,this.config.domRender&&this.__remove(r);var a=[];o.map((function(e){var n=t.currentText.list[i].list[e];n.index=e,a.push(n)})),this.currentExtText&&o.map((function(e){var n=t.currentText.list[i].list[e];n.index=e,a.push(n)})),this._log("update",a,e),this._curTexts=a,this.emit(Gx,this.getUpdateData(a,e,this.currentText)),this.__render(a,e)}}}},{key:"getUpdateData",value:function(e,t,i){var n=i.id,r=i.language;return{type:Gx,currentTime:0|t,id:n,language:r,texts:e,isOpen:this._isOpen}}},{key:"_getPlayerCurrentTime",value:function(){if(!this.player)return 0;var e=this.player.currentTime;return Nx(1e3*(void 0===e?0:e)+1e3*this.seiTime-1e3*this.lastSeiTime)/1e3}},{key:"_onSubtitlePlaylist",value:function(e){this._log("_onSubtitlePlaylist",e);var t=e.map((function(e){return{label:e.name,language:e.lang,id:e.id,isDefault:e.default,url:[],mUrl:e.url}}));this.setSubTitles(t)}},{key:"_onSubtitleSegment",value:function(e){if(this._log("_onSubtitleSegment",e.length,e[0].lang,e[0].sn,e[e.length-1].sn,e[0].start,e[e.length-1].end),e&&0!==e.length){var t={language:e[0].lang,url:e.map((function(e){return{id:e.sn,url:e.url,duration:e.duration,start:e.start,end:e.end}}))};Mx(t,this.currentText)&&this.updateSubTitle(t)}}},{key:"_onCoreSeiintime",value:function(e){try{var t=e.time/1e3;this._log("_onCoreSeiintime sei",t,this.seiTime,this.lastSeiTime),this.seiTime=t,this.lastSeiTime=this.player?this.player.currentTime:0}catch(i){}}},{key:"resize",value:function(e,t){var i,n=this,r=this.config,o=r.baseSizeX,a=r.baseSizeY,s=r.minMobileSize,l=r.minSize,c=r.fitVideo,u=r.offsetBottom,h=this._videoMeta.scale;this._videoMeta.lwidth=e,this._videoMeta.lheight=t;var d=0;t/e*100>=h?(d=Nx(h*e)/100,i=e):(d=t,i=Nx(t/h*100)),this._videoMeta.vWidth=i,this._videoMeta.vHeight=d;var f=0,p=0;p=Nx(h>120?(f=a)*d/1080:(f=o)*i/1920);var g=Jx?s:l,y={fontSize:p=p<g?g:p>f?f:p},v=Nx((t-d)/2),m=Nx((e-i)/2),_=Nx(d*u)/100;this._videoMeta.vBottom=v,this._videoMeta.vLeft=m,this._videoMeta.marginBottom=_,c&&(y.bottom=v+_,y.left=y.right=m),Object.keys(y).map((function(e){n.root.style[e]="".concat(y[e],"px")})),this.emit(jx,{vLeft:m,vBottom:v,marginBottom:_,vWidth:i,vHeight:d,fontSize:p,scale:h})}},{key:"__startResize",value:function(e){var t=this,i=e.getBoundingClientRect(),n=this._videoMeta,r=i.width,o=i.height;if(this._iId&&(clearTimeout(this._iId),this._iId=null),r>0&&o>0&&(r!==n.lwidth||o!==n.lheight))this._iC=0,this.resize(r,o);else{if(this._iC>=5)return void(this._iC=0);this._iC++,this._iId=setTimeout((function(){t.__startResize(e)}),50)}}},{key:"__removeByTime",value:function(e,t){for(var i=[],n=0;n<e.length;n++)(!t||e[n].end<t)&&i.push(n);0!==i.length&&(e.splice(i[0],i.length),this.config.domRender&&this.__remove(i))}},{key:"__remove",value:function(e){var t=this;if(e&&!(e.length<1)){this._log(">>>>_renderByWords__remove",e);for(var i=this.innerRoot.children,n=[],r=0;r<i.length;r++){var o=Number(i[r].getAttribute("data-index"));e.includes(o)&&n.push(i[r])}n.map((function(e){t.innerRoot.removeChild(e)}))}}},{key:"__render",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._log("__render",t.length,this.config.domRender);var i=this.config,n=i.renderMode,r=i.domRender;t.length>0&&r&&t.forEach((function(t){var i="text-track-".concat(e.config.line);t.text.forEach((function(r,o){o>0&&(i+=" text-track-deputy");var a={"data-start":t.start,"data-end":t.end,"data-index":t.index},s=Rx("xg-text-track-span","",a,i);if(e.innerRoot.appendChild(s),"step"===n){var l=Rx("xg-text-track-span","",a,"".concat(i," text-track-space"));e.innerRoot.appendChild(l),Zx(l,r),setTimeout((function(){e._renderByWords(s,o,t.start,t.end,r)}),600)}else Zx(s,r)}))}))}},{key:"_renderByWords",value:function(e,t,i,n,r){var o=document.createTextNode("");e.appendChild(o);var a,s,l=function(e){for(var t=e.split(""),i=[],n=!1,r=0;r<t.length;r++){var o=t[r];if(Ux(o))if(n){var a=i.length-1;i[a]="".concat(i[a]).concat(o)}else i.push(o),n=!0;else if(o.match(/^[ ]*$/)||Bx(o)||/[\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|\uffe5]/.test(o)){n=!1;var s=i.length-1;s>=0?i[s]="".concat(i[s]).concat(o):i.push(o)}else n=!1,i.push(o)}return i}((a=r,Zx(s=document.createElement("span"),a),s.textContent||"")),c=this._getPlayerCurrentTime(),u=Nx(1e3*(n-c));if(!(c>=n)){i>=c&&(c=i),u>300&&(u-=50);var h={dom:o,ids:t,wordList:l,interval:u/l.length,start:c,end:n,duration:u,lastTime:0};this._log(">>>>_renderByWords",u,h);for(var d=this._curRenderTask,f=-1,p=0;p<d.length;p++)if(d[p].ids===t){f=p;break}f>-1&&d.slice(f,1),d.push(h),this.startRender(-1)}}},{key:"stopRender",value:function(){this._renderIntervalId&&window.cancelAnimationFrame(this._renderIntervalId)}},{key:"show",value:function(){var e,t;this.config.domRender&&(e=this.root,t="text-track-hide",e&&(e.classList?t.split(/\s+/g).forEach((function(t){e.classList.remove(t)})):Ix(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===UR(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))))}},{key:"hide",value:function(){this.config.domRender&&(Px(this.root,"text-track-hide"),this.innerRoot&&(this.innerRoot.innerHTML=""))}},{key:"emit",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=ZR(KR(i.prototype),"emit",this)).call.apply(n,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=ZR(KR(i.prototype),"on",this)).call.apply(n,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=ZR(KR(i.prototype),"once",this)).call.apply(n,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=ZR(KR(i.prototype),"off",this)).call.apply(n,[this,e,t].concat(o))}},{key:"offAll",value:function(){ZR(KR(i.prototype),"removeAllListeners",this).call(this)}},{key:"marginBottom",get:function(){var e=this._videoMeta,t=e.vBottom,i=e.marginBottom;return this.config.fitVideo?t+i:i}}]),i}();class tO extends Rr{constructor(e){super(),this._onChange=e=>{const t=this._media.textTracks;if(!t||0===t.length)return;const i=[],n=[];let r=-1;for(let o=0;o<t.length;o++){const e=t[o];"subtitles"===e.kind&&(i.push({id:e.id||e.language,language:e.language,text:e.label,isDefault:"showing"===e.mode}),-1===r&&"showing"===e.mode&&(r=o),n.push(e.language))}n.join("|")!==this._languages?(this._languages=n.join("|"),this.emit("reset",{list:i,isOpen:r>-1})):-1===r?this.emit("off"):this.curIndex!==r&&this.emit("change",i[r]),this.curIndex=r},this._media=e,this._list=[],this._languages="",this.curIndex=-1,this._init()}_init(){const e=this._media.textTracks;e?(e.addEventListener("change",this._onChange),e.addEventListener("addtrack",this._onChange)):ss.warn("current browser not support native subtitle")}switch(e){return new Promise(((t,i)=>{if(!e)return i({code:1,message:"no subtitle data"});const n=this._media.textTracks;for(let r=0;r<n.length;r++){const t=n[r];t.language===e.language?t.mode="showing":"showing"===t.mode&&(t.mode="disabled")}return t({code:0})}))}switchOff(){const e=this._media.textTracks;for(let t=0;t<e.length;t++)e[t].mode="disabled";this.curIndex=-1}destroy(){this._media.textTracks.removeEventListener("change",this._onChange),this._media=null,this._list=[],this._languages="",this.curIndex=-1}}function iO(){return(new DOMParser).parseFromString('<svg width="18" height="16" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2 0.5C0.895431 0.5 0 1.39543 0 2.5V13.5C0 14.6046 0.89543 15.5 2 15.5H16C17.1046 15.5 18 14.6046 18 13.5V2.5C18 1.39543 17.1046 0.5 16 0.5H2ZM7.49634 11.0454C8.00741 10.606 8.29061 10.0037 8.34595 9.23877H6.8811C6.84855 9.67171 6.71997 9.99235 6.49536 10.2007C6.27401 10.4058 5.93709 10.5083 5.48462 10.5083C4.98332 10.5083 4.61548 10.3309 4.3811 9.97607C4.14998 9.62126 4.03442 9.05973 4.03442 8.2915V7.75439C4.04093 7.01872 4.16463 6.47673 4.40552 6.12842C4.64966 5.77686 5.01587 5.60107 5.50415 5.60107C5.95337 5.60107 6.28703 5.70524 6.50513 5.91357C6.72648 6.11865 6.85506 6.45068 6.89087 6.90967H8.35571C8.27759 6.1154 7.98787 5.49854 7.48657 5.05908C6.98527 4.61963 6.32446 4.3999 5.50415 4.3999C4.9117 4.3999 4.39087 4.53988 3.94165 4.81982C3.49569 5.09652 3.15226 5.49528 2.91138 6.01611C2.67049 6.53695 2.55005 7.13916 2.55005 7.82275V8.25732C2.55005 9.32829 2.81047 10.1714 3.3313 10.7866C3.85539 11.3986 4.57316 11.7046 5.48462 11.7046C6.31795 11.7046 6.98853 11.4849 7.49634 11.0454ZM14.5393 11.0454C15.0504 10.606 15.3336 10.0037 15.3889 9.23877H13.9241C13.8915 9.67171 13.7629 9.99235 13.5383 10.2007C13.317 10.4058 12.9801 10.5083 12.5276 10.5083C12.0263 10.5083 11.6584 10.3309 11.4241 9.97607C11.193 9.62126 11.0774 9.05973 11.0774 8.2915V7.75439C11.0839 7.01872 11.2076 6.47673 11.4485 6.12842C11.6926 5.77686 12.0588 5.60107 12.5471 5.60107C12.9963 5.60107 13.33 5.70524 13.5481 5.91357C13.7695 6.11865 13.898 6.45068 13.9338 6.90967H15.3987C15.3206 6.1154 15.0308 5.49854 14.5295 5.05908C14.0282 4.61963 13.3674 4.3999 12.5471 4.3999C11.9547 4.3999 11.4338 4.53988 10.9846 4.81982C10.5387 5.09652 10.1952 5.49528 9.95435 6.01611C9.71346 6.53695 9.59302 7.13916 9.59302 7.82275V8.25732C9.59302 9.32829 9.85343 10.1714 10.3743 10.7866C10.8984 11.3986 11.6161 11.7046 12.5276 11.7046C13.3609 11.7046 14.0315 11.4849 14.5393 11.0454Z" fill="white"/>\n</svg>',"image/svg+xml").firstChild}function nO(){return(new DOMParser).parseFromString('<svg width="18" height="16" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.49609 11.0454C8.00716 10.606 8.29037 10.0037 8.3457 9.23877H6.88086C6.84831 9.67171 6.71973 9.99235 6.49512 10.2007C6.27376 10.4058 5.93685 10.5083 5.48438 10.5083C4.98307 10.5083 4.61523 10.3309 4.38086 9.97607C4.14974 9.62126 4.03418 9.05973 4.03418 8.2915V7.75439C4.04069 7.01872 4.16439 6.47673 4.40527 6.12842C4.64941 5.77686 5.01562 5.60107 5.50391 5.60107C5.95312 5.60107 6.28678 5.70524 6.50488 5.91357C6.72624 6.11865 6.85482 6.45068 6.89062 6.90967H8.35547C8.27734 6.1154 7.98763 5.49854 7.48633 5.05908C6.98503 4.61963 6.32422 4.3999 5.50391 4.3999C4.91146 4.3999 4.39062 4.53988 3.94141 4.81982C3.49544 5.09652 3.15202 5.49528 2.91113 6.01611C2.67025 6.53695 2.5498 7.13916 2.5498 7.82275V8.25732C2.5498 9.32829 2.81022 10.1714 3.33105 10.7866C3.85514 11.3986 4.57292 11.7046 5.48438 11.7046C6.31771 11.7046 6.98828 11.4849 7.49609 11.0454Z" fill="white"/>\n<path d="M14.5391 11.0454C15.0501 10.606 15.3333 10.0037 15.3887 9.23877H13.9238C13.8913 9.67171 13.7627 9.99235 13.5381 10.2007C13.3167 10.4058 12.9798 10.5083 12.5273 10.5083C12.026 10.5083 11.6582 10.3309 11.4238 9.97607C11.1927 9.62126 11.0771 9.05973 11.0771 8.2915V7.75439C11.0837 7.01872 11.2074 6.47673 11.4482 6.12842C11.6924 5.77686 12.0586 5.60107 12.5469 5.60107C12.9961 5.60107 13.3298 5.70524 13.5479 5.91357C13.7692 6.11865 13.8978 6.45068 13.9336 6.90967H15.3984C15.3203 6.1154 15.0306 5.49854 14.5293 5.05908C14.028 4.61963 13.3672 4.3999 12.5469 4.3999C11.9544 4.3999 11.4336 4.53988 10.9844 4.81982C10.5384 5.09652 10.195 5.49528 9.9541 6.01611C9.71322 6.53695 9.59277 7.13916 9.59277 7.82275V8.25732C9.59277 9.32829 9.85319 10.1714 10.374 10.7866C10.8981 11.3986 11.6159 11.7046 12.5273 11.7046C13.3607 11.7046 14.0312 11.4849 14.5391 11.0454Z" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M0 2.5C0 1.39543 0.895431 0.5 2 0.5H16C17.1046 0.5 18 1.39543 18 2.5V13.5C18 14.6046 17.1046 15.5 16 15.5H2C0.89543 15.5 0 14.6046 0 13.5V2.5ZM2 2.3H16C16.1105 2.3 16.2 2.38954 16.2 2.5V13.5C16.2 13.6105 16.1105 13.7 16 13.7H2C1.88954 13.7 1.8 13.6105 1.8 13.5V2.5C1.8 2.38954 1.88954 2.3 2 2.3Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}const{POSITIONS:rO}=ba,oO="mobile"===Kr.device,aO="text-close";function sO(e=[]){let t=-1;return e.map(((e,i)=>{e.id||e.language||(e.id=""+i),!e.url&&(e.url=e.src),!e.text&&(e.text=e.label),!e.language&&(e.language=e.srclang),void 0===e.isDefault&&(e.isDefault=e.default),(e.isDefault||e.default)&&(t<0?t=i:e.isDefault=e.default=!1)})),t}class lO extends ba{constructor(e){super(e),this.isOpenState=!0,this.optionList=null,this.currentLang="",this._onOff=()=>{this.noShowSubtitle()},this._onChange=e=>{const t=this.getSubTitleIndex(this.config.list,e);t<0||this.updateCurItem(t,e)},this._onListReset=e=>{this.updateList(e)},this.handleButtonChange=e=>{e.preventDefault(),e.stopPropagation(),e.delegateTarget||(oO?this.showMobilePanel():this.isOpenState?this.switchOffSubtitle():this.openSubtitle().then((()=>this.showList())))},this.onEnter=e=>{e.stopPropagation(),this.emit("icon_mouseenter",{pluginName:this.pluginName}),this.showList()},this.onLeave=e=>{e.stopPropagation(),this.emit("icon_mouseleave",{pluginName:this.pluginName}),this.hideList()},this.handlerClickSwitch=(e,t)=>{e.stopPropagation(),e.preventDefault(),this.subTitles&&(t.type===aO?this.switchOffSubtitle():this.switchSubTitle({language:t.language,id:t.id}))},this.onPlayerFocus=e=>{this.subTitles&&this.config.style.follow&&this.rePosition()},this.onPlayerBlur=e=>{this.subTitles&&this.config.style.follow&&!this.playerConfig.marginControls&&this.subTitles.root&&(this.subTitles.root.style.transform="translate(0, 0)")};const{player:t,config:i}=e;t.config.isLive&&(e.config.updateMode="live",Kr.os.isIos&&(e.config.mode="native"))}static get pluginName(){return"Subtitle"}static get defaultConfig(){return{position:rO.CONTROLS_RIGHT,index:KA,list:[],isDefaultOpen:!0,style:{follow:!0,mode:"stroke",followBottom:50,fitVideo:!0,offsetBottom:4,baseSizeX:49,baseSizeY:28,minSize:16,minMobileSize:13,line:"double",fontColor:"#fff"},isShowIcon:!0,mode:"external",updateMode:"vod"}}afterCreate(){const{list:e=[]}=this.config;this.curIndex=-1,this.curItem=null;const t=sO(e);super.afterCreate(),"native"===this.config.mode?this._initNativeSubtitle(t):this._initExtSubTitle(t),e.length||this.hide()}_initNativeSubtitle(e){const{player:t}=this;t._subTitles||(t._subTitles=new tO(t.video)),this.subTitles=t._subTitles,this.subTitles.on("off",this._onOff),this.subTitles.on("change",this._onChange),this.subTitles.on("reset",this._onListReset),this._renderList(e)}_initExtSubTitle(e){const{list:t=[],style:i,isDefaultOpen:n,updateMode:r,renderMode:o}=this.config,a={subTitles:t,defaultOpen:n,debugger:!1,renderMode:o,updateMode:r};this.isOpenState=n,Object.keys(i).map((e=>{a[e]=i[e]}));!this.playerConfig.marginControls&&this.player.controls.root&&(this.on(ho,this.onPlayerFocus),this.on(fo,this.onPlayerBlur));const{player:s}=this;s._subTitles?s._subTitles._isOpen&&(e=this.getSubTitleIndex(this.config.list,s._subTitles.currentText)):(s._subTitles=new eO(a),s._subTitles.attachPlayer(this.player),this.changeTipText()),this.subTitles=s._subTitles,this.subTitles.on("off",this._onOff),this.subTitles.on("change",this._onChange),this.subTitles.on("reset",this._onListReset),i.follow&&this.subTitles.root&&Ur.addClass(this.subTitles.root,"follow-control"),this._renderList(e)}_renderList(e){const{list:t=[],isDefaultOpen:i}=this.config;t.length&&(e<0?(t[0].isDefault=!0,this.curIndex=0,this.curItem=t[0]):(this.curIndex=e,this.curItem=t[e])),this.appendChild(".xgplayer-icon",this.icons.vttSubOpen),this.appendChild(".xgplayer-icon",this.icons.vttSubClose),this.creatOptionList(),this.initEvents(),this.isOpenState?Ur.addClass(this.root,"isOpen"):Ur.addClass(this.root,"isClose"),!1===this.config.isShowIcon&&this.hide()}updateCurItem(e,t){this.curIndex=e,this.curItem=this.config.list[e],this.renderItemList(),this.emit("subtitle_change",c({off:!1,isListUpdate:!1,list:[]},t))}initEvents(){this.bind(["click"],this.handleButtonChange),this.bind(["mouseenter"],this.onEnter),this.bind(["mouseleave"],this.onLeave),this._delegates=[]}showList(){var e;!oO&&this.isOpenState&&(null==(e=this.optionList)||e.show())}hideList(){var e;!oO&&this.isOpenState&&(null==(e=this.optionList)||e.hide())}openSubtitle(){return this.curIndex<0&&(this.curIndex=0,this.curItem=this.config.list[0]),this.curIndex>-1&&this.curItem?this.switchSubTitle(this.curItem):Promise.resolve(void 0)}getSubTitleIndex(e,t={id:"",language:""}){let i=-1;return t&&(t.id||t.language)?(e.forEach(((e,n)=>{e.id!==t.id&&e.language!==t.language||(i=n)})),i):i}registerIcons(){return{vttSubOpen:{icon:iO,class:"xgplayer-vttsub-open-svg"},vttSubClose:{icon:nO,class:"xgplayer-vttsub-close-svg"}}}registerLanguageTexts(){return{sub:{jp:"字幕",en:"Subtitles",zh:"字幕","zh-hk":"字幕"},subOpen:{jp:"字幕をオンにする",en:"Show subtitles",zh:"开启字幕","zh-hk":"開啟字幕"},subClose:{jp:"クローズドキャプション",en:"Hide subtitles",zh:"关闭字幕","zh-hk":"關閉字幕"}}}creatOptionList(){if(oO)return;const e={config:{data:this.getList(),className:"",onItemClick:(e,t)=>{this.handlerClickSwitch(e,null==t?void 0:t.to)}},root:this.root};this.optionList=new PA(e)}getList(){return this.config.list.map(((e,t)=>(t===this.curIndex&&this.isOpenState?(e.isCurrent=!0,e.selected=!0):(e.isCurrent=!1,e.selected=!1),e.showText=this.getTextByLang(e),e)))}renderOptionList(){this.optionList.renderItemList(this.getList())}switchSubTitle(e={id:"",language:""}){let t=-1;return e&&(e.id||e.language)?(this.config.list.map(((i,n)=>{i.id+""==e.id+""&&i.language+""==e.language+""&&(t=n)})),t<0||this.isOpenState&&t===this.curIndex?Promise.resolve(void 0):this.subTitles.switch(e).then((i=>{0===i.code&&(e.off=!1,e.isListUpdate=!1,e.list=[],this.curIndex=t,this.curItem=this.config.list[t],this.isOpenState=!0,Ur.removeClass(this.root,"isClose"),Ur.addClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),this.emit("subtitle_change",e))})).catch((e=>ss.error("switch subtitle err: ",e)))):Promise.resolve(void 0)}switchOffSubtitle(){this.subTitles.switchOff(),this.noShowSubtitle()}noShowSubtitle(){var e;this.emit("subtitle_change",{off:!0,isListUpdate:!1,list:[]}),this.isOpenState=!1,Ur.addClass(this.root,"isClose"),Ur.removeClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),null==(e=this.optionList)||e.hide()}renderItemList(){oO?this.updatePanel():this.renderOptionList()}updateSubtitles(e=[],t=!0){if(!e)return;const i=this.curIndex>-1||this.config.isDefaultOpen;this.updateList({list:e,isOpen:i}),this.subTitles&&this.subTitles.setSubTitles(this.config.list,i,t)}updateList(e={}){var t,i,n,r;if(!e.list)return;e.list.length>0&&!1!==this.config.isShowIcon&&this.show();const o=[];e.list.map((e=>{o.push(e)}));const a=sO(o);e.isOpen?(this.isOpenState=!0,this.curIndex=a,this.curItem=a>-1?o[a]:null,Ur.removeClass(this.root,"isClose"),Ur.addClass(this.root,"isOpen")):(this.isOpenState=!1,this.curIndex=-1,this.curItem=null,Ur.removeClass(this.root,"isOpen"),Ur.addClass(this.root,"isClose"),this.changeTipText(),null==(t=this.optionList)||t.hide()),this.config.list=o,o.length>0?oO||null==(i=this.optionList)||i.hide():(this.switchOffSubtitle(),oO?this.showMobilePanel():null==(n=this.optionList)||n.show(),oO||null==(r=this.optionList)||r.hide(),this.hide()),this.renderItemList()}changeTipText(){this.isOpenState?this.find(".xg-tips").innerHTML=this.langText.subClose:this.find(".xg-tips").innerHTML=this.langText.subOpen}showMobilePanel(){var e;const t=this.renderPanel();null==(e=this.player.panel)||e.showPanel(t,this.langText.sub,!0)}updatePanel(){var e;const t=this.renderPanel();null==(e=this.player.panel)||e.updatePanel(t)}renderPanel(){const e=[...this.config.list],t=Ur.createDom("div","",{},"ai-panel-content");e.map(((e,i)=>{const n=c({language:e.language||e.srclang,"data-id":e.id,selected:this.isOpenState&&this.curIndex===i,showText:this.getTextByLang(e)},e),r=this.renderPanelItem(n);t.appendChild(r)}));const i={showText:this.langText.subClose,"data-type":aO,selected:!this.isOpenState};return t.appendChild(this.renderPanelItem(i)),t}renderPanelItem(e){const{showText:t,selected:i}=e,n=Ur.createDom("div","",{language:e.language,"data-id":e["data-id"],"data-type":e["data-type"]},"panel-Item "+(i?"select-in":""));n.innerHTML=t;const r=oO?"touchend":"click",o=ba.delegate(n,".panel-Item",r,(t=>{e["data-type"]===aO?(t.stopPropagation(),t.preventDefault(),this.switchOffSubtitle()):this.handlerClickSwitch(t,e)}));return this._delegates.push(o),n}getTextByLang(e,t,i){if(void 0===e)return"";const{list:n}=this.config;return!i&&(i=this.player.lang),t=!t||Ur.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=n[e]),"object"==typeof e[t]?e[t][i]||e[t].zh:e[t]||""}rePosition(){const{fitVideo:e}=this.config.style,t=0-this.player.controls.root.getBoundingClientRect().height;if(!e)return void(this.subTitles.root.style.transform=`translate(0, ${t}px)`);const{video:i,root:n}=this.player,{height:r,width:o}=n.getBoundingClientRect(),{videoHeight:a,videoWidth:s}=i;let l=parseInt(a/s*100,10)*o/100;l>r&&(l=r);const c=(r-l)/2-t;c<0&&(this.subTitles.root.style.transform=`translate(0, ${c}px)`)}destroy(){var e;this.subTitles&&(this.subTitles.destroy(),this.subTitles=null),this.unbind(["click"],this.handleButtonChange.bind(this)),this.unbind(["mouseenter"],this.showList.bind(this)),this.unbind(["mouseleave"],this.hideList.bind(this)),null==(e=this.optionList)||e.destroy(),this._delegates&&this._delegates.length>0&&(this._delegates.map((e=>{Array.isArray(e)&&e.map((e=>{e.destroy&&e.destroy()})),e.destroy&&e.destroy()})),this._delegates=null),super.destroy()}render(){var e;return`\n <xg-icon class="xgplayer-vttsub"${!1===this.config.isShowIcon||!(null==(e=this.config.list)?void 0:e.length)?' style="display: none;"':""}>\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="vttSubOpen">${this.langText.subOpen}</div>\n </xg-icon>\n `}}const cO=class extends ba{constructor(e){super(e),this.toastNumber=0,this.toastMaps={}}static get pluginName(){return"sdkToastPlugin"}static get defaultConfig(){return{index:5}}beforePlayerInit(){}afterPlayerInit(){}afterCreate(){}destroy(){}add(e,t=2e3,i=!1){const n=this.toastNumber+1;this.toastNumber=n;const r=this.renderToast(e,i,n);return this.root.appendChild(r),this.toastMaps[n]=r,t&&setTimeout((()=>{this.remove(n)}),t),n}remove(e){const t=this.toastMaps[e];t&&(this.root.contains(t)&&this.root.removeChild(t),delete this.toastMaps[e])}renderToast(e,t,i){const n=Ur.createDom("div","",void 0,"toast-container"),r=Ur.checkIsObject(e)?e:Ur.createDom("div",e,void 0,"toast-txt");if(n.appendChild(r),t){const e=Ur.createDom("span","×",void 0,"toast-close-bt");e.addEventListener("click",(()=>{this.remove(i)})),n.appendChild(e)}return n}render(){return'<xg-sdk-toast class="xgplayer-sdk-toast"></xg-sdk-toast>'}};function uO(){return(new Date).getTime()}var hO="loadstart",dO="loadeddata",fO="firstFrame",pO="waitingStart",gO="waitingEnd",yO="seekStart",vO="seekEnd",mO=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"_onTimeupdate",(function(){e._state.isTimeUpdate=!0,e._state.autoplayStart&&(Nr.logInfo("[xgLogger]".concat(e.player.playerId," _onTimeupdate")),e._sendFF("onTimeupdate"))})),mr(Sr(e),"_onAutoplayStart",(function(){Nr.logInfo("[xgLogger]".concat(e.player.playerId," _onAutoplayStart")),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),mr(Sr(e),"_onReset",(function(){e._state={autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1},e.vt=0,e.pt=0,e.fvt=0,e.newPointTime=uO(),e.loadedCostTime=0,e.startCostTime=0,e._isSeeking=!1,e.seekingStart=0,e.waitingStart=0,e.fixedWaitingStart=0,e._isWaiting=!1,e._waitTimer&&Ur.clearTimeout(Sr(e),e._waitTimer),e._waittTimer&&Ur.clearTimeout(Sr(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),mr(Sr(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=uO(),e.emitLog(yO,{start:uO()}))})),mr(Sr(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),mr(Sr(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=uO(),e.fixedWaitingStart=uO(),e._waitType=1,e.emitLog(pO,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),mr(Sr(e),"_onWaiting",(function(){!e._isWaiting&&e.vt&&(e._isWaiting=!0,e.vt?e.seekingStart?e._waitType=2:e._waitType=0:e._waitType=1,e.fixedWaitingStart=uO(),e._waitTimer=Ur.setTimeout(Sr(e),(function(){e._isWaiting&&(e.waitingStart=uO(),Ur.clearTimeout(Sr(e),e._waitTimer),e._waitTimer=null,e._startWaitTimeout(),e.emitLog(pO,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing"}))}),200))})),mr(Sr(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),mr(Sr(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return vr(i,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=uO(),this.loadedCostTime=0,this.startCostTime=0,this.on(co,(function(){var t=e._state,i=t.autoplayStart,n=t.isFFSend;e.startCostTime=uO()-e.newPointTime,Nr.logInfo("[xgLogger]".concat(e.player.playerId," LOAD_START"),"autoplayStart:".concat(i," isFFSend:").concat(n," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),n||(!t.isLs&&e.emitLog(hO,{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=uO(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())})),this.on(ao,(function(){e.vt=uO(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime;var t=e._state,i=t.isTimeUpdate,n=t.isFFSend,r=t.autoplayStart;Nr.logInfo("[xgLogger]".concat(e.player.playerId," LOADED_DATA"),"fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(i||r)&&e._sendFF("loadedData"),n||e.emitLog(dO,{}),e.suspendWaitingStatus("loadeddata")})),this.on(Jr,this._onSeeking),this.on(eo,this._onSeeked),this.on(Eo,(function(){e.endState("destroy")})),this.on(To,(function(){e.endState("urlChange"),Nr.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()})),this.on([Xr,no],this._onPlaying),this.on(io,this._onWaiting),this.on(Qr,this._onError),this.on(Fo,(function(){Nr.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()}))}},{key:"_initOnceEvents",value:function(){this.off(yo,this._onAutoplayStart),this.off(to,this._onTimeupdate),this.once(yo,this._onAutoplayStart),this.once(to,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=uO();var t=this._state,i=t.isFFLoading,n=t.isFFSend;Nr.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(i," !isFFSend:").concat(!n)),this.vt>0&&i&&!n&&(Nr.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(fO,{fvt:this.fvt,costTime:this.fvt,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&Ur.clearTimeout(this,this._waittTimer),this._waittTimer=Ur.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),Ur.clearTimeout(e,e._waittTimer),e._waittTimer=null}),this.config.waitTimeout)}},{key:"endState",value:function(e){this.suspendWaitingStatus(e),this.suspendSeekingStatus(e)}},{key:"suspendSeekingStatus",value:function(e){if(this.seekingStart){var t=uO(),i=t-this.seekingStart;this.seekingStart=0,this.emitLog(vO,{end:t,costTime:i,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(Ur.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(Ur.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var t=uO(),i=t-this.waitingStart,n=t-this.fixedWaitingStart,r=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(gO,{fixedCostTime:n>r?r:n,costTime:i>r?r:i,type:"loadeddata"===e?1:this._waitType,endType:2===this._waitType?"seek":e})}}},{key:"emitLog",value:function(e,t){var i=this.player;this.emit(Uo,fr({t:uO(),host:Ur.getHostFromUrl(i.currentSrc),vtype:i.vtype,eventType:e,currentTime:this.player.currentTime,readyState:i.video.readyState,networkState:i.video.networkState},t))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),i}();function _O(){return(new DOMParser).parseFromString('<svg class="xgplayer-replay-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78 78" width="78" height="78">\n <path fill="#fff" transform="translate(20, 20)" d="M8.22708362,13.8757234 L11.2677371,12.6472196 C11.7798067,12.4403301 12.3626381,12.6877273 12.5695276,13.1997969 L12.9441342,14.1269807 C13.1510237,14.6390502 12.9036264,15.2218816 12.3915569,15.4287712 L6.8284538,17.6764107 L5.90126995,18.0510173 C5.38920044,18.2579068 4.80636901,18.0105096 4.5994795,17.49844 L1.97723335,11.0081531 C1.77034384,10.4960836 2.0177411,9.91325213 2.52981061,9.70636262 L3.45699446,9.33175602 C3.96906396,9.12486652 4.5518954,9.37226378 4.75878491,9.88433329 L5.67885163,12.1615783 C7.99551726,6.6766934 13.3983951,3 19.5,3 C27.7842712,3 34.5,9.71572875 34.5,18 C34.5,26.2842712 27.7842712,33 19.5,33 C15.4573596,33 11.6658607,31.3912946 8.87004692,28.5831991 C8.28554571,27.9961303 8.28762719,27.0463851 8.87469603,26.4618839 C9.46176488,25.8773827 10.4115101,25.8794641 10.9960113,26.466533 C13.2344327,28.7147875 16.263503,30 19.5,30 C26.127417,30 31.5,24.627417 31.5,18 C31.5,11.372583 26.127417,6 19.5,6 C14.4183772,6 9.94214483,9.18783811 8.22708362,13.8757234 Z"></path>\n</svg>\n',"image/svg+xml").firstChild}var EO=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"registerIcons",value:function(){return{replay:_O}}},{key:"afterCreate",value:function(){var e=this;ba.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayClick",(function(){e.player.replay()}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on(qr,(function(){if(e.playerConfig.loop||Ur.addClass(e.player.root,"replay"),!e.config.disable){e.show();var t=e.root.querySelector("path");if(t){var i=window.getComputedStyle(t).getPropertyValue("transform");if("string"==typeof i&&i.indexOf("none")>-1)return null;t.setAttribute("transform",i)}}})),this.on($r,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),Ur.removeClass(this.player.root,"replay")}},{key:"show",value:function(e){this.config.disable||(this.root.style.display="flex")}},{key:"enable",value:function(){this.config.disable=!1}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){this.unbind(".xgplayer-replay",["click","touchend"],this.__handleReplay)}},{key:"render",value:function(){return'<xg-replay class="xgplayer-replay">\n <xg-replay-txt class="xgplayer-replay-txt" lang-key="'.concat(this.i18nKeys.REPLAY,'">').concat(this.i18n.REPLAY,"</xg-replay-txt>\n </xg-replay>")}}],[{key:"pluginName",get:function(){return"replay"}},{key:"defaultConfig",get:function(){return{disable:!1}}}]),i}();function TO(){return(new DOMParser).parseFromString('<svg class="play" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M576,363L810,512L576,661zM342,214L576,363L576,661L342,810z"></path>\n</svg>\n',"image/svg+xml").firstChild}function SO(){return(new DOMParser).parseFromString('<svg class="pause" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598,214h170v596h-170v-596zM256 810v-596h170v596h-170z"></path>\n</svg>\n',"image/svg+xml").firstChild}var bO={};function CO(e){e?window.clearTimeout(e):Object.keys(bO).map((function(e){window.clearTimeout(bO[e].id),delete bO[e]}))}var kO=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"onPlayerReset",(function(){n.autoPlayStart=!1;var e="auto"===n.config.mode?"auto-hide":"hide";n.setAttr("data-state","play"),Ur.removeClass(n.root,e),n.show()})),mr(Sr(n),"onAutoplayStart",(function(){if(!n.autoPlayStart){var e="auto"===n.config.mode?"auto-hide":"hide";Ur.addClass(n.root,e),n.autoPlayStart=!0,n.toggleTo("play")}})),n.autoPlayStart=!1,n}return vr(i,[{key:"afterCreate",value:function(){var e=this.playerConfig;this.initIcons(),this.listenEvents(),this.bindClickEvents(),e.autoplay||this.show()}},{key:"listenEvents",value:function(){var e=this,t=this.player,i=this.playerConfig;this.once(po,(function(){i&&(i.lang&&"en"===i.lang?Ur.addClass(t.root,"lang-is-en"):"jp"===i.lang&&Ur.addClass(t.root,"lang-is-jp"))})),this.on(yo,this.onAutoplayStart),this.on(vo,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),Ur.removeClass(e.root,t),e.show()})),this.on($r,(function(){e.toggleTo("play")})),this.on(Zr,(function(){e.toggleTo("pause")})),this.on(Fo,(function(){e.onPlayerReset()}))}},{key:"bindClickEvents",value:function(){var e=this;this.clickHandler=this.hook("startClick",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation();var i=e.player.paused;e.emitUserAction(t,"switch_play_pause",{props:"paused",from:i,to:!i})}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:TO,class:"xg-icon-play"},startPause:{icon:SO,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild("xg-start-inner",e.startPlay),this.appendChild("xg-start-inner",e.startPause)}},{key:"hide",value:function(){Ur.addClass(this.root,"hide")}},{key:"show",value:function(e){Ur.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){Ur.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){Ur.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(e){e?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(e){var t=this;this._animateId=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};return bO[e]&&window.clearTimeout(bO[e].id),bO[e]={},i.start&&i.start(),bO[e].id=window.setTimeout((function(){i.end&&i.end(),window.clearTimeout(bO[e].id),delete bO[e]}),t),bO[e].id}("pauseplay",400,{start:function(){Ur.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){Ur.removeClass(t.root,"interact"),!e&&t.hide(),t._animateId=null}})}},{key:"endAnimate",value:function(){Ur.removeClass(this.root,"interact"),CO(this._animateId),this._animateId=null}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.state<Na.READY)||(this.player.paused||t.state!==Na.RUNNING?t.play():t.pause())}},{key:"onPlayPause",value:function(e){this.toggleTo(e)}},{key:"toggleTo",value:function(e){var t=this.config,i=this.player;if(i&&!(i.state<Na.RUNNING)&&this.autoPlayStart){if("show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&i.paused&&!i.ended||t.isShowEnd&&i.ended)return this.switchStatus(),this.show(),void this.endAnimate();if(t.disableAnimate)return this.switchStatus(),void this.hide();if("play"===e)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||i.ended)return;this.animate()}}else this.switchStatus()}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),CO(this._animateId)}},{key:"render",value:function(){var e=this.playerConfig.autoplay?"auto"===this.config.mode?"auto-hide":"hide":"";return'\n <xg-start class="xgplayer-start '.concat(e,'">\n <xg-start-inner></xg-start-inner>\n </xg-start>')}}],[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}]),i}(),IO=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"render",value:function(){var e=this.config.innerHtml,t=Ur.createDom("xg-enter","",{},"xgplayer-enter");if(e&&e instanceof window.HTMLElement)t.appendChild(e);else if(e&&"string"==typeof e)t.innerHTML=e;else{for(var i="",n=1;n<=12;n++)i+='<div class="xgplayer-enter-bar'.concat(n,'"></div>');t.innerHTML='<div class="xgplayer-enter-spinner">'.concat(i,"</div>")}return t}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),i}();function PO(e,t,i){try{return' <div class="xg-tips '.concat(i?"hide":" ",'" lang-key="').concat(e.i18nKeys[t],'">\n ').concat(e.i18n[t],"\n </div>")}catch(ds){return'<div class="xg-tips hide"></div>'}}var DO=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"afterCreate",value:function(){this.getMini=this.getMini.bind(this),this.exitMini=this.exitMini.bind(this),this.bind("click",this.getMini)}},{key:"getMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"exitMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.getMini)}},{key:"render",value:function(){var e="MINISCREEN";return'\n <xg-icon class="xgplayer-miniicon">\n <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</span></div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:10}}}]),i}();function wO(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var AO=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],RO=AO.length;function xO(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===pr(e)&&e.nodeType){var t=function(e){return window.getComputedStyle(e)}(e);if("none"===t.display)return function(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0;t<RO;t++)e[AO[t]]=0;return e}();var i={};i.width=e.offsetWidth,i.height=e.offsetHeight;for(var n=i.isBorderBox="border-box"===t.boxSizing,r=0;r<RO;r++){var o=AO[r],a=t[o],s=parseFloat(a);i[o]=Number.isNaN(s)?0:s}var l=i.paddingLeft+i.paddingRight,c=i.paddingTop+i.paddingBottom,u=i.marginLeft+i.marginRight,h=i.marginTop+i.marginBottom,d=i.borderLeftWidth+i.borderRightWidth,f=i.borderTopWidth+i.borderBottomWidth,p=n,g=wO(t.width);!1!==g&&(i.width=g+(p?0:l+d));var y=wO(t.height);return!1!==y&&(i.height=y+(p?0:c+f)),i.innerWidth=i.width-(l+d),i.innerHeight=i.height-(c+f),i.outerWidth=i.width+u,i.outerHeight=i.height+h,i}}function OO(e,t){for(var i=0;i<e.length;i++){var n=e[i];if(n.identifier===t)return n}}var LO="dragStart",NO="dragMove",MO="dragEnded",UO={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},BO=function(e){_r(i,Rr);var t=Cr(i);function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return gr(this,i),(n=t.call(this)).isEnabled=!0,n.isDragging=!1,n.isDown=!1,n.position={},n.downPoint={},n.dragPoint={x:0,y:0},n.startPos={x:0,y:0},n._root=e instanceof Element?e:document.querySelector(e),n._handlerDom=r.handle instanceof Element?r.handle:document.querySelector(r.handle),n._root&&n._handlerDom?(n._bindStartEvent(),n):br(n)}return vr(i,[{key:"_bindStartEvent",value:function(){var e=this;"ontouchstart"in window?this._startKey="touchstart":this._startKey="mousedown",this["on".concat(this._startKey)]=this["on".concat(this._startKey)].bind(this),this._handlerDom.addEventListener(this._startKey,this["on".concat(this._startKey)]),UO[this._startKey].map((function(t){e["on".concat(t)]=e["on".concat(t)].bind(e)}))}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(e){var t=this;if(e){var i=UO[this._startKey];i.map((function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=i}}},{key:"_unbindPostStartEvents",value:function(){var e=this;this._boundPointerEvents&&(this._boundPointerEvents.map((function(t){window.removeEventListener(t,e["on".concat(t)])})),delete this._boundPointerEvents)}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1,this.isDragging&&this.onUp()}},{key:"onDocUp",value:function(e){this.onUp()}},{key:"animate",value:function(){var e=this;this.isDragging&&(this.positionDrag(),window.requestAnimationFrame((function(){e.animate()})))}},{key:"positionDrag",value:function(){var e="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=e,this._root.style.webKitTransform=e}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(e){this.dragStart(e,e)}},{key:"onmousemove",value:function(e){this.dragMove(e,e)}},{key:"onmouseup",value:function(e){this.dragEnd(e,e)}},{key:"ontouchstart",value:function(e){var t=e.changedTouches[0];this.dragStart(e,t),this.touchIdentifier=void 0!==t.pointerId?t.pointerId:t.identifier,e.preventDefault()}},{key:"ontouchmove",value:function(e){var t=OO(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=OO(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=OO(e.changedTouches,this.touchIdentifier);t&&this.dragCancel(e,t)}},{key:"dragStart",value:function(e,t){if(this._root&&!this.isDown&&this.isEnabled){this.downPoint=t,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var i=xO(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-i.height,this.startPos.maxX=window.innerWidth-i.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,t){this.isDragging=!0,this.animate(),this.emit(LO,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(MO)),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,t){var i={x:t.pageX-this.downPoint.pageX,y:t.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(i)&&this.dragRealStart(e,t),i}},{key:"dragMove",value:function(e,t){if(e=e||window.event,this.isDown){var i=this.startPos,n=i.x,r=i.y,o=this._dragPointerMove(e,t),a=o.x,s=o.y;a=this.checkContain("x",a,n),s=this.checkContain("y",s,r),this.position.x=n+a,this.position.y=r+s,this.dragPoint.x=a,this.dragPoint.y=s,this.emit(NO,this.position)}}},{key:"dragCancel",value:function(e,t){this.dragEnd(e,t)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,t,i){return t+i<0?0-i:"x"===e&&t+i>this.startPos.maxX?this.startPos.maxX-i:"y"===e&&t+i>this.startPos.maxY?this.startPos.maxY-i:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),i=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(i)?0:i,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var i=t.split(","),n=0===t.indexOf("matrix3d")?12:4,r=parseInt(i[n],10),o=parseInt(i[n+1],10);this.position.x+=r,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var i=xO(this._root.parentNode);return i?parseFloat(e)/100*i[t]:0}return parseInt(e,10)}}]),i}(),FO=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;gr(this,i),mr(Sr(n=t.call(this,e)),"onCancelClick",(function(e){n.exitMini(),n.isClose=!0})),mr(Sr(n),"onCenterClick",(function(e){var t=Sr(n).player;t.paused?t.play():t.pause()})),mr(Sr(n),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-n.pos.scrollY)<50)){var t=parseInt(Ur.getCss(n.player.root,"height"));t+=n.config.scrollTop,n.pos.scrollY=window.scrollY,window.scrollY>t+5?!n.isMini&&!n.isClose&&n.getMini():window.scrollY<=t&&(n.isMini&&n.exitMini(),n.isClose=!1)}})),n.isMini=!1,n.isClose=!1;var r=Sr(n).config;return n.pos={left:r.left<0?window.innerWidth-r.width-20:r.left,top:r.top<0?window.innerHeight-r.height-20:r.top,height:n.config.height,width:n.config.width,scrollY:window.scrollY||0},n.lastStyle=null,n}return vr(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.mini&&(e.config.isShowIcon=e.player.config.mini)}},{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.on(Zr,(function(){e.setAttr("data-state","pause")})),this.on($r,(function(){e.setAttr("data-state","play")}))}},{key:"onPluginsReady",value:function(){var e=this,t=this.player;if(!this.config.disable){if(this.config.isShowIcon){var i={config:{onClick:function(){e.getMini()}}};t.controls.registerPlugin(DO,i,DO.pluginName)}var n=Ur.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",n,this.onCancelClick),this.bind(".play-icon",n,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new BO(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:TO,class:"xg-icon-play"},pause:{icon:SO,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".play-icon",e.play),this.appendChild(".play-icon",e.pause)}},{key:"getMini",value:function(){var e=this;if(!this.isMini){var t=this.player,i=this.playerConfig,n=this.config.target||this.player.root;this.lastStyle={},Ur.addClass(t.root,"xgplayer-mini"),["width","height","top","left"].map((function(t){e.lastStyle[t]=n.style[t],n.style[t]="".concat(e.pos[t],"px")})),i.fluid&&(n.style["padding-top"]=""),this.emit(Do,!0),t.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var t=this.player,i=this.playerConfig,n=this.config.target||this.player.root;Ur.removeClass(t.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map((function(t){n.style[t]=e.lastStyle[t]})),this.lastStyle=null,i.fluid&&(t.root.style.width="100%",t.root.style.height="0",t.root.style["padding-top"]="".concat(100*i.height/i.width,"%")),this.emit(Do,!1),this.isMini=t.isMini=!1}},{key:"updatePos",value:function(e){this.pos=Object.assign(this.pos,e),this.isMini&&(this.player.root.style.left="".concat(this.pos.left,"px"),this.player.root.style.top="".concat(this.pos.top,"px"),this.player.root.style.width="".concat(this.pos.width,"px"),this.player.root.style.height="".concat(this.pos.height,"px"))}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=Ur.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",e,this.onCancelClick),this.unbind(".play-icon",e,this.onCenterClick),this._draggabilly&&this._draggabilly.destroy(),this._draggabilly=null,this.exitMini()}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-mini-layer class="xg-mini-layer">\n <xg-mini-header class="xgplayer-mini-header">\n '.concat(PO(this,"MINI_DRAG",this.playerConfig.isHideTips),'\n </xg-mini-header>\n <div class="mini-cancel-btn">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">\n <path fill="#fff" fill-rule="evenodd" d="M3.99 3.49a1 1 0 0 1 1.414 0L10 8.085l4.596-4.595a1 1 0 1 1 1.414 1.414L11.414 9.5l4.596 4.596a1 1 0 0 1 .084 1.32l-.084.094a1 1 0 0 1-1.414 0L10 10.914 5.404 15.51a1 1 0 0 1-1.414-1.414L8.585 9.5 3.99 4.904a1 1 0 0 1-.084-1.32z"></path>\n </svg>\n </div>\n <div class="play-icon">\n </div>\n </xg-mini-layer>')}}],[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}]),i}(),HO={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},jO=["videoClick","videoDbClick"],VO=function(e){_r(i,ua);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var i=Sr(e),n=i.player,r=i.playerConfig;n.isActive||(n.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&n.media.focus())})),mr(Sr(e),"onMouseEnter",(function(t){var i=Sr(e),n=i.playerConfig,r=i.player;!n.closeFocusVideoFocus&&r.media.focus(),n.closeDelayBlur?r.focus({autoHide:!1}):r.focus(),e.emit(Co)})),mr(Sr(e),"onMouseLeave",(function(t){var i=e.playerConfig,n=i.closePlayerBlur,r=i.leavePlayerTime,o=i.closeDelayBlur;n||o||(r?e.player.focus({autoHide:!0,delay:r}):e.player.blur({ignorePaused:!0})),e.emit(bo)})),mr(Sr(e),"onVideoClick",(function(t){var i=Sr(e),n=i.player,r=i.playerConfig;t.target&&r.closeVideoClick||t.target!==n.root&&t.target!==n.media&&t.target!==n.innerContainer&&t.target!==n.media.__canvas||(t.preventDefault(),r.closeVideoStopPropagation||t.stopPropagation(),e._clickCount++,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),e.clickTimer=setTimeout((function(){e._clickCount&&(e._clickCount--,la(Sr(e),jO[0],(function(t,i){e.switchPlayPause(i.e)}),{e:t,paused:n.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),mr(Sr(e),"onVideoDblClick",(function(t){var i=Sr(e),n=i.player,r=i.playerConfig;r.closeVideoDblclick||!t.target||t.target!==n.media&&t.target!==n.media.__canvas||(!r.closeVideoClick&&e._clickCount<2?e._clickCount=0:(e._clickCount=0,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),t.preventDefault(),t.stopPropagation(),la(Sr(e),jO[1],(function(t,i){e.emitUserAction(i.e,"switch_fullscreen",{props:"fullscreen",from:n.fullscreen,to:!n.fullscreen}),n.fullscreen?n.exitFullscreen():n.getFullscreen()}),{e:t,fullscreen:n.fullscreen})))})),e}return vr(i,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,jO.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===Kr.device&&!Kr.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,t=this.player,i=t.media,n=t.root,r=this.playerConfig.enableContextmenu;n&&n.addEventListener("click",this.onVideoClick,!1),n&&n.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(HO).map((function(t){n.addEventListener(t,e[HO[t]],!1)})),!r&&i&&i.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var t=this.player;this.emitUserAction(e,"switch_play_pause",{props:"paused",from:t.paused,to:!t.paused}),t.ended?t.duration!==1/0&&t.duration>0&&t.replay():t.paused?t.play():t.pause()}},{key:"onContextmenu",value:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e=this,t=this.player,i=t.video,n=t.root;this.clickTimer&&clearTimeout(this.clickTimer),n.removeEventListener("click",this.onVideoClick,!1),n.removeEventListener("dblclick",this.onVideoDblClick,!1),i.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(HO).map((function(t){n.removeEventListener(t,e[HO[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),i}(),KO="press",GO="pressend",WO="doubleclick",YO="click",zO="touchmove",$O="touchstart",XO="touchend",qO={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},ZO={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function QO(e){return e&&e.length>0?e[e.length-1]:null}var JO=function(){function e(t){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};gr(this,e),mr(this,"onTouchStart",(function(e){var t=i._pos,n=i.root,r=QO(e.touches);t.x=r?parseInt(r.pageX,10):e.pageX,t.y=r?parseInt(r.pageX,10):e.pageX,t.start=!0,i.__setPress(e),n.addEventListener(i.events.end,i.onTouchEnd),n.addEventListener(i.events.cancel,i.onTouchCancel),n.addEventListener(i.events.move,i.onTouchMove),i.trigger($O,e)})),mr(this,"onTouchCancel",(function(e){i.onTouchEnd(e)})),mr(this,"onTouchEnd",(function(e){var t=i._pos,n=i.root;i.__clearPress(),n.removeEventListener(i.events.cancel,i.onTouchCancel),n.removeEventListener(i.events.end,i.onTouchEnd),n.removeEventListener(i.events.move,i.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&i.trigger(GO,e),i.trigger(XO,e),!t.press&&!t.moving&&i.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),mr(this,"onTouchMove",(function(e){var t=i._pos,n=i.config,r=QO(e.touches),o=r?parseInt(r.pageX,10):e.pageX,a=r?parseInt(r.pageY,10):e.pageX,s=o-t.x,l=a-t.y;Math.abs(l)<n.miniStep&&Math.abs(s)<n.miniStep||(i.__clearPress(),t.press&&i.trigger(GO,e),t.press=!1,t.moving=!0,i.trigger(zO,e))})),this._pos={moving:!1,start:!1,x:0,y:0},this.config={pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0},Object.keys(n).map((function(e){i.config[e]=n[e]})),this.root=t,this.events="mouse"===n.eventType?ZO:qO,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return vr(e,[{key:"_initEvent",value:function(){this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(e){var t=this,i=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout((function(){t.trigger(KO,e),t._pos.press=!0,t.__clearPress()}),i.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(e){var t=this,i=this.config;if(this.dbIntrvalId)return this.__clearDb(),void this.trigger(WO,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(YO,e)}),i.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(e,t){this.__handlers[e]||(this.__handlers[e]=[]),this.__handlers[e].push(t)}},{key:"off",value:function(e,t){if(this.__handlers[e]){for(var i=this.__handlers[e],n=-1,r=0;r<i.length;r++)if(i[r]===t){n=r;break}n>=0&&this.__handlers[e].splice(n,1)}}},{key:"trigger",value:function(e,t){this.__handlers[e]&&this.__handlers[e].map((function(i){try{i(t)}catch(dF){console.error("trigger>>:".concat(e),dF)}}))}},{key:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).forEach((function(i){e.root.removeEventListener(i,e[t[i]])}))}}]),e}();function eL(){return(new DOMParser).parseFromString('<svg width="20" height="9" viewBox="0 0 8 9" fill="none" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <path opacity="0.54"\n d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z"\n fill="white" />\n <path transform="translate(5 0)" d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z" fill="white"/>\n</svg>',"image/svg+xml").firstChild}var tL="auto",iL="seeking",nL="playbackrate",rL=["videoClick","videoDbClick"],oL=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"onTouchStart",(function(e){var t=Sr(n),i=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=n.getTouche(e);if(s&&!r.disableGesture&&n.duration>0&&!i.ended){o.isStart=!0,n.timer&&clearTimeout(n.timer),Ur.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),n.find(".xg-dur").innerHTML=Ur.format(n.duration);var l=n.root.getBoundingClientRect();90===i.rotateDeg?(o.top=l.left,o.left=l.top,o.width=l.height,o.height=l.width):(o.top=l.top,o.left=l.left,o.width=l.width,o.height=l.height);var c=parseInt(s.pageX-o.left,10),u=parseInt(s.pageY-o.top,10);o.x=90===i.rotateDeg?u:c,o.y=90===i.rotateDeg?c:u,o.scopeL=r.scopeL*o.width,o.scopeR=(1-r.scopeR)*o.width,o.scopeM1=o.width*(1-r.scopeM)/2,o.scopeM2=o.width-o.scopeM1}})),mr(Sr(n),"onTouchMove",(function(e){var t=n.getTouche(e),i=Sr(n),r=i.pos,o=i.config,a=i.player;if(t&&!o.disableGesture&&n.duration&&r.isStart){var s=o.miniMoveStep,l=o.hideControlsActive,c=parseInt(t.pageX-r.left,10),u=parseInt(t.pageY-r.top,10),h=90===a.rotateDeg?u:c,d=90===a.rotateDeg?c:u;if(Math.abs(h-r.x)>s||Math.abs(d-r.y)>s){var f=h-r.x,p=d-r.y,g=r.scope;if(-1===g&&(0===(g=n.checkScope(h,d,f,p,r))&&(l?a.blur():a.focus({autoHide:!1}),!r.time&&(r.time=parseInt(1e3*a.currentTime,10)+1e3*n.timeOffset)),r.scope=g),-1===g||g>0&&!o.gestureY||0===g&&!o.gestureX)return;n.executeMove(f,p,g,r.width,r.height),r.x=h,r.y=d}}})),mr(Sr(n),"onTouchEnd",(function(e){var t=Sr(n),i=t.player,r=t.pos,o=t.playerConfig;if(setTimeout((function(){i.getPlugin("progress")&&i.getPlugin("progress").resetSeekState()}),10),r.isStart){r.scope>-1&&e.cancelable&&e.preventDefault();var a=n.config,s=a.disableGesture,l=a.gestureX;!s&&l?n.endLastMove(r.scope):r.time=0,r.scope=-1,n.resetPos(),Ur.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),n.changeAction(tL)}})),mr(Sr(n),"onRootTouchMove",(function(e){!n.config.disableGesture&&n.config.gestureX&&n.checkIsRootTarget(e)&&(e.stopPropagation(),n.pos.isStart?n.onTouchMove(e):n.onTouchStart(e))})),mr(Sr(n),"onRootTouchEnd",(function(e){n.pos.scope>-1&&n.onTouchEnd(e)})),n.pos={isStart:!1,x:0,y:0,time:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1},n.timer=null,n}return vr(i,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"registerIcons",value:function(){return{seekTipIcon:{icon:eL,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;rL.map((function(t){e.__hooks[t]=null}));var t=this.playerConfig,i=this.config,n=this.player;!0===t.closeVideoDblclick&&(i.closedbClick=!0),this.resetPos(),Ur.isUndefined(t.disableGesture)||(i.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=Ur.createDom("xg-mask","",{},"xgmask"),n.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new JO(this.root,{eventType:r,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",(function(e){e.preventDefault()})),n.root.addEventListener("touchmove",this.onRootTouchMove,!0),n.root.addEventListener("touchend",this.onRootTouchEnd,!0),n.root.addEventListener("touchcancel",this.onRootTouchEnd,!0);var o=this.player.controls;o&&o.center&&(o.center.addEventListener("touchmove",this.onRootTouchMove,!0),o.center.addEventListener("touchend",this.onRootTouchEnd,!0),o.center.addEventListener("touchcancel",this.onRootTouchEnd,!0)),this.on(ro,(function(){var t=e.player,i=e.config;t.duration>0&&1e3*t.duration<i.moveDuration&&(i.moveDuration=1e3*t.duration)})),this.on([no,qr],(function(){var t=e.pos,i=t.time;!t.isStart&&i>0&&(e.pos.time=0)}));var a={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(a).map((function(t){e.touch.on(t,(function(i){e[a[t]](i)}))})),!i.disableActive){var s=n.plugins.progress;s&&(s.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),["dragend","click"].forEach((function(t){s.addCallBack(t,(function(){e.changeAction(tL)}))})))}}},{key:"registerThumbnail",value:function(){var e=this.player.plugins.thumbnail;if(e&&e.usable){this.thumbnail=e.createThumbnail(null,"mobile-thumbnail");var t=this.find(".time-preview");t.insertBefore(this.thumbnail,t.children[0])}}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle,t=e.playedColor,i=e.progressColor,n=e.timePreviewStyle,r=e.curTimeColor,o=e.durationColor;if(t&&(this.find(".xg-curbar").style.backgroundColor=t),i&&(this.find(".xg-bar").style.backgroundColor=i),n){var a=this.find(".time-preview");Object.keys(n).forEach((function(e){a.style[e]=n[e]}))}var s=r||t,l=o;s&&(this.find(".xg-cur").style.color=s),l&&(this.find(".xg-dur").style.color=l),this.config.disableTimeProgress&&Ur.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map((function(t){e.pos[t]=0}))):this.pos={isStart:!1,x:0,y:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1,time:0}}},{key:"changeAction",value:function(e){var t=this.player;this.root.setAttribute("data-xg-action",e);var i=t.plugins.start;i&&i.recover()}},{key:"getTouche",value:function(e){this.player.rotateDeg;var t=e.touches&&e.touches.length>0?e.touches[e.touches.length-1]:e;return{pageX:t.pageX,pageY:t.pageY}}},{key:"checkScope",value:function(e,t,i,n,r){var o=r.width,a=-1;if(e<0||e>o)return a;var s=0===n?Math.abs(i):Math.abs(i/n);return Math.abs(i)>0&&s>=1.73&&e>r.scopeM1&&e<r.scopeM2?a=0:(0===Math.abs(i)||s<=.57)&&(a=e<r.scopeL?1:e>r.scopeR?2:3),a}},{key:"executeMove",value:function(e,t,i,n,r){switch(i){case 0:this.updateTime(e/n*this.config.scopeM);break;case 1:this.updateBrightness(t/r);break;case 2:Kr.os.isIos||this.updateVolume(t/r)}}},{key:"endLastMove",value:function(e){var t=this,i=this.pos,n=this.player,r=this.config,o=(i.time-this.timeOffset)/1e3;if(0===e)n.seek(Number(o).toFixed(1)),r.hideControlsEnd?n.blur():n.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500);this.changeAction(tL)}},{key:"checkIsRootTarget",value:function(e){var t=this.player.plugins||{};return(!t.progress||!t.progress.root.contains(e.target))&&(t.start&&t.start.root.contains(e.target)||t.controls&&t.controls.root.contains(e.target))}},{key:"sendUseAction",value:function(e){var t=this.player.paused;this.emitUserAction(e,"switch_play_pause",{prop:"paused",from:t,to:!t})}},{key:"clickHandler",value:function(e){var t=this.player,i=this.config,n=this.playerConfig;t.state<Na.RUNNING?n.closeVideoClick||(this.sendUseAction(Ur.createEvent("click")),t.play()):!i.closedbClick||n.closeVideoClick?t.isActive?t.blur():t.focus():n.closeVideoClick||((t.isActive||i.focusVideoClick)&&(this.sendUseAction(Ur.createEvent("click")),this.switchPlayPause()),t.focus())}},{key:"dbClickHandler",value:function(e){var t=this.config,i=this.player;!t.closedbClick&&i.state>=Na.RUNNING&&(this.sendUseAction(Ur.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,i=this.player;la(this,rL[0],(function(e,i){t.clickHandler(i.e)}),{e:e,paused:i.paused})}},{key:"onDbClick",value:function(e){var t=this,i=this.player;la(this,rL[1],(function(e,i){t.dbClickHandler(i.e)}),{e:e,paused:i.paused})}},{key:"onPress",value:function(e){var t=this.pos,i=this.config,n=this.player;i.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{prop:"playbackRate",from:n.playbackRate,to:i.pressRate}),n.playbackRate=i.pressRate,this.changeAction(nL))}},{key:"onPressEnd",value:function(e){var t=this.pos,i=this.config,n=this.player;i.disablePress||(this.emitUserAction("pressend","change_rate",{prop:"playbackRate",from:n.playbackRate,to:t.rate}),n.playbackRate=t.rate,t.rate=1,this.changeAction(tL))}},{key:"updateTime",value:function(e){var t=this.player,i=this.config,n=this.player.duration;e=Number(e.toFixed(4));var r=parseInt(e*i.moveDuration,10)+this.timeOffset;r=(r+=this.pos.time)<0?0:r>1e3*n?1e3*n-200:r,t.getPlugin("time")&&t.getPlugin("time").updateTime(r/1e3),t.getPlugin("progress")&&t.getPlugin("progress").updatePercent(r/1e3/this.duration,!0),this.activeSeekNote(r/1e3,e>0),i.isTouchingSeek&&t.seek(Number((r-this.timeOffset)/1e3).toFixed(1)),this.pos.time=r}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.player,i=this.pos;if(e=parseInt(100*e,10),i.volume+=e,!(Math.abs(i.volume)<10)){var n=parseInt(10*t.volume,10)-parseInt(i.volume/10,10);n=n>10?10:n<1?0:n,t.volume=n/10,i.volume=0}}},{key:"updateBrightness",value:function(e){var t=this.pos,i=this.config,n=this.xgMask;if(i.darkness){this.player.rotateDeg&&(e=-e);var r=t.light+.8*e;r=r>i.maxDarkness?i.maxDarkness:r<0?0:r,n&&(n.style.backgroundColor="rgba(0,0,0,".concat(r,")")),t.light=r}}},{key:"activeSeekNote",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.player,n=this.config,r=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!r&&!n.disableActive){e<0?e=0:e>i.duration&&(e=i.duration-.2),this.changeAction(iL);var o=i.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=Ur.format(this.duration),this.find(".xg-cur").innerHTML=Ur.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?Ur.removeClass(this.find(".xg-seek-show"),"xg-back"):Ur.addClass(this.find(".xg-seek-show"),"xg-back"),this.updateThumbnails(e)}}},{key:"updateThumbnails",value:function(e){var t=this.player.plugins.thumbnail;t&&t.usable&&this.thumbnail&&t.update(this.thumbnail,e,160,90)}},{key:"switchPlayPause",value:function(){var e=this.player;if(e.state<Na.ATTACHED)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!0}},{key:"enableGesture",value:function(){this.config.disableGesture=!1}},{key:"destroy",value:function(){var e=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,e.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,e.root.removeEventListener("touchmove",this.onRootTouchMove,!0),e.root.removeEventListener("touchend",this.onRootTouchEnd,!0),e.root.removeEventListener("touchcancel",this.onRootTouchEnd,!0);var t=this.player.controls;t&&t.center&&(t.center.removeEventListener("touchmove",this.onRootTouchMove,!0),t.center.removeEventListener("touchend",this.onRootTouchEnd,!0),t.center.removeEventListener("touchcancel",this.onRootTouchEnd,!0))}},{key:"render",value:function(){var e="normal"!==this.config.gradient?"gradient ".concat(this.config.gradient):"gradient";return'\n <xg-trigger class="trigger">\n <div class="'.concat(e,'"></div>\n <div class="time-preview">\n <div class="xg-seek-show ').concat(this.config.disableSeekIcon?" hide-seek-icon":"",'">\n <i class="xg-seek-icon"></i>\n <span class="xg-cur">00:00</span>\n <span class="xg-separator">/</span>\n <span class="xg-dur">00:00</span>\n </div>\n <div class="xg-bar xg-timebar">\n <div class="xg-curbar"></div>\n </div>\n </div>\n <div class="xg-playbackrate xg-top-note">\n <span><i>').concat(this.config.pressRate,"X</i>").concat(this.i18n.FORWARD,"</span>\n </div>\n </xg-trigger>\n ")}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{index:0,disableGesture:!1,gestureX:!0,gestureY:!0,gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:36e4,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),i}();function aL(e){e.preventDefault(),e.returnValue=!1}function sL(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}var lL=function(e){_r(i,ua);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){if(e.player){var i=t||window.event,n=i.keyCode,r=Sr(e),o=r._keyState,a=r.player,s=e.config,l=s.disable,c=s.disableBodyTrigger,u=s.isIgnoreUserActive;l||c||!a.isUserActive&&!u||sL(i.target)||!e.checkIsVisible()||i.metaKey||i.altKey||i.ctrlKey?o.isBodyKeyDown=!1:(t.repeat||o.isKeyDown||((i.target===document.body||e.config.isGlobalTrigger&&!sL(i.target))&&e.checkCode(n,!0)&&(o.isBodyKeyDown=!0),document.addEventListener("keyup",e.onBodyKeyUp)),o.isBodyKeyDown&&e.handleKeyDown(i))}})),mr(Sr(e),"onBodyKeyUp",(function(t){e.player&&(document.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))})),mr(Sr(e),"onKeydown",(function(t){if(e.player){var i=t||window.event,n=Sr(e)._keyState;if(!i.repeat){if(e.config.disable||e.config.disableRootTrigger||i.metaKey||i.altKey||i.ctrlKey)return;!i||37!==i.keyCode&&!e.checkCode(i.keyCode)||i.target!==e.player.root&&i.target!==e.player.video&&i.target!==e.player.controls.el||(n.isKeyDown=!0),e.player.root.addEventListener("keyup",e.onKeyup)}n.isKeyDown&&e.handleKeyDown(i)}})),mr(Sr(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return vr(i,[{key:"mergekeyCodeMap",value:function(){var e=this,t=this.config.keyCodeMap;t&&Object.keys(t).map((function(i){e.keyCodeMap[i]?["keyCode","action","disable","pressAction","disablePress","isBodyTarget"].map((function(n){t[i][n]&&(e.keyCodeMap[i][n]=t[i][n])})):e.keyCodeMap[i]=t[i]}))}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e="function"==typeof this.config.seekStep?this.config.seekStep(this.player):this.config.seekStep;e&&"number"==typeof e&&(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:"playPause",disable:!1,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.config[i]=e[i]}))}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),t=e.height,i=e.top,n=e.bottom,r=window.innerHeight;return!(i<0&&i<0-.9*t||n>0&&n-r>.9*t)}},{key:"checkCode",value:function(e,t){var i=this,n=!1;return Object.keys(this.keyCodeMap).map((function(r){i.keyCodeMap[r]&&e===i.keyCodeMap[r].keyCode&&!i.keyCodeMap[r].disable&&(n=!t||t&&!i.keyCodeMap[r].noBodyTarget)})),n}},{key:"downVolume",value:function(e){var t=this.player;if(!(t.volume<=0)){var i=parseFloat((t.volume-.1).toFixed(1)),n={volume:{from:t.volume,to:i}};this.emitUserAction(e,"change_volume",{props:n}),t.volume=i>=0?i:0}}},{key:"upVolume",value:function(e){var t=this.player;if(!(t.volume>=1)){var i=parseFloat((t.volume+.1).toFixed(1)),n={volume:{from:t.volume,to:i}};this.emitUserAction(e,"change_volume",{props:n}),t.volume=i<=1?i:1}}},{key:"seek",value:function(e){var t=this.player,i=t.currentTime,n=t.offsetCurrentTime,r=t.duration,o=t.offsetDuration,a=t.timeSegments,s=n>-1?n:i,l=o||r,c=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep;s+c<=l?s+=c:s=l;var u=Ur.getCurrentTimeByOffset(s,a),h={currentTime:{from:i,to:u}};this.emitUserAction(e,"seek",{props:h}),this.player.currentTime=u}},{key:"seekBack",value:function(e){var t=this.player,i=t.currentTime,n=t.offsetCurrentTime,r=t.timeSegments,o=(n>-1?n:i)-(e.repeat?parseInt(this.seekStep/2,10):this.seekStep);o<0&&(o=0);var a={currentTime:{from:i,to:o=Ur.getCurrentTimeByOffset(o,r)}};this.emitUserAction(e,"seek",{props:a}),this.player.currentTime=o}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,i=this.config,n=this.player;0===t.playbackRate&&(t.playbackRate=n.playbackRate,n.playbackRate=i.playbackRate)}},{key:"playPause",value:function(e){var t=this.player;t&&(this.emitUserAction(e,"switch_play_pause"),t.paused?t.play():t.pause())}},{key:"exitFullscreen",value:function(e){var t=this.player,i=t.fullscreen,n=t.cssfullscreen;i&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:i,to:!i}),t.exitFullscreen()),n&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:n,to:!n}),t.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var t=this._keyState;if(e.repeat){t.isPress=!0;var i=Date.now();if(i-t.tt<200)return;t.tt=i}this.handleKeyCode(e.keyCode,e,t.isPress)}},{key:"handleKeyUp",value:function(e){var t=this._keyState;t.playbackRate>0&&(this.player.playbackRate=t.playbackRate,t.playbackRate=0),t.isKeyDown=!1,t.isPress=!1,t.tt=0}},{key:"handleKeyCode",value:function(e,t,i){for(var n=Object.keys(this.keyCodeMap),r=0;r<n.length;r++){var o=this.keyCodeMap[n[r]],a=o.action,s=o.keyCode,l=o.disable,c=o.pressAction,u=o.disablePress;if(s===e){if(!(l||i&&u)){var h=i&&c||a;"function"==typeof h?a(t,this.player,i):"string"==typeof h&&"function"==typeof this[h]&&this[h](t,this.player,i),this.emit(Mo,fr({key:n[r],target:t.target,isPress:i},this.keyCodeMap[n[r]]))}aL(t),t.stopPropagation();break}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!0,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!0}}}]),i}();function cL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="-5 -5 110 110">\n <path d="M100,50A50,50,0,1,1,50,0" stroke-width="5" stroke="#ddd" stroke-dasharray="236" fill="none"></path>\n</svg>\n',"image/svg+xml").firstChild}var uL=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"registerIcons",value:function(){return{loadingIcon:cL}}},{key:"afterCreate",value:function(){this.appendChild("xg-loading-inner",this.icons.loadingIcon)}},{key:"render",value:function(){return'\n <xg-loading class="xgplayer-loading">\n <xg-loading-inner></xg-loading-inner>\n </xg-loading>'}}],[{key:"pluginName",get:function(){return"loading"}},{key:"defaultConfig",get:function(){return{position:ma.ROOT}}}]),i}(),hL=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],dL=function(){function e(t){gr(this,e),this.fragments=t.fragments||[],0===this.fragments.length&&this.fragments.push({percent:1}),this._callBack=t.actionCallback,this.fragConfig={fragFocusClass:t.fragFocusClass||"inner-focus-point",fragAutoFocus:!!t.fragAutoFocus,fragClass:t.fragClass||""},this.style=t.style||{playedColor:"",cachedColor:"",progressColor:""},this.duration=0,this.cachedIndex=0,this.playedIndex=0,this.focusIndex=-1}return vr(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var i=0,n=this.fragments;this.fragments=n.map((function(e){return e.start=parseInt(i,10),e.end=parseInt(i+e.percent*t.duration,10),e.duration=parseInt(e.percent*t.duration,10),i+=e.percent*t.duration,e}))}},{key:"updateProgress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},i=this.progressList,n=this.fragments;if(!(i.length<1)){var r=t.newIndex,o=t.curIndex,a=t.millisecond;r!==o&&i.map((function(t,i){i<r?t[e].style.width="100%":i>r&&(t[e].style.width=0)}));var s=n[r],l=0===a?0:(a-s.start)/s.duration;i[r][e].style.width=l<0?0:"".concat(100*l,"%")}}},{key:"updateFocus",value:function(e){if(this.fragConfig.fragAutoFocus&&!(this.fragments.length<2))if(e){var t=this.findIndex(1e3*e.currentTime,this.focusIndex);if(t>=0&&t!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(t);var i={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(i)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var n={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(n),this.focusIndex=-1}}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(parseInt(1e3*t,10))}var i=this.playedIndex,n=this.cachedIndex;if("Undefined"!==Ur.typeOf(e.played)){var r=this.findIndex(1e3*e.played,i);if(r<0)return;this.updateProgress("played",{newIndex:r,curIndex:i,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=r}if("Undefined"!==Ur.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,n);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:n,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(e,t){var i=this.fragments;if(!i||0===i.length)return-1;if(1===i.length)return 0;if(t>-1&&t<i.length&&e>i[t].start&&e<i[t].end)return t;if(e>i[i.length-1].start)return i.length-1;for(var n=0;n<i.length;n++)if(e>i[n].start&&e<=i[n].end){t=n;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(Ur.hasClass(e[t],this.fragConfig.fragFocusClass))return{dom:e[t],pos:e[t].getBoundingClientRect()}}},{key:"findFragment",value:function(e){var t=this.root.children;return e<0||e>=t.length?null:{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"unHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)Ur.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return Ur.addClass(t[e],this.fragConfig.fragFocusClass),{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"reset",value:function(e){var t=this;if(Object.keys(this.fragConfig).forEach((function(i){void 0!==e[i]&&(t.fragConfig[i]=e[i])})),e.fragments){if(this.fragments=0===e.fragments.length?[{percent:1}]:e.fragments,this.updateDuration(this.duration),this.playedIndex=0,this.cachedIndex=0,this.root)for(var i=this.root.children;i.length>0;)this.root.removeChild(i[0]);this.render()}}},{key:"render",value:function(){var e=this,t=this.style.progressColor;if(this.root||(this.root=Ur.createDom("xg-inners","",{},"progress-list")),this.fragments){var i=this.fragConfig,n=i.fragClass,r=i.fragFocusClass;this.progressList=this.fragments.map((function(i){var o=Ur.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(i.percent):"flex: ".concat(i.percent)},"".concat(i.isFocus?r:""," xgplayer-progress-inner ").concat(n));return e.root.appendChild(o),hL.forEach((function(t){o.appendChild(Ur.createDom(t.tag,"",{style:t.styleKey?"background: ".concat(e.style[t.styleKey],"; width:0;"):"width:0;"},t.className))})),{cached:o.children[0],played:o.children[1]}}))}return this.root}}]),e}(),fL={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},pL=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"onMoveOnly",(function(e,t){var i=Sr(n),r=i.pos,o=i.config,a=i.player,s=t;if(e){Ur.event(e);var l=Ur.getEventPos(e,a.zoom),c=90===a.rotateDeg?l.clientY:l.clientX;if(r.moving&&Math.abs(r.x-c)<o.miniMoveStep)return;r.moving=!0,r.x=c,s=n.computeTime(e,c)}n.triggerCallbacks("dragmove",s,e),n._updateInnerFocus(s)})),mr(Sr(n),"onBodyClick",(function(e){n.pos.isLocked&&(n.pos.isLocked=!1,e.preventDefault(),e.stopPropagation())})),mr(Sr(n),"_mouseDownHandler",(function(e,t){n._state.time=t.currentTime,n.updateWidth(t.currentTime,t.seekTime,t.percent,0),n._updateInnerFocus(t)})),mr(Sr(n),"_mouseUpHandler",(function(e,t){Sr(n).pos.moving&&n.updateWidth(t.currentTime,t.seekTime,t.percent,2)})),mr(Sr(n),"_mouseMoveHandler",(function(e,t){var i=Sr(n),r=i._state,o=i.pos,a=i.config,s=i.player;r.time<t.currentTime?t.forward=!0:t.forward=!1,r.time=t.currentTime,o.isDown&&!o.moving&&(o.moving=!0,a.isPauseMoving&&s.pause(),n.triggerCallbacks("dragstart",t,e),n.emitUserAction("drag","dragstart",t)),n.updateWidth(t.currentTime,t.seekTime,t.percent,1),n.triggerCallbacks("dragmove",t,e),n._updateInnerFocus(t)})),mr(Sr(n),"onMouseDown",(function(e){var t=Sr(n),i=t._state,r=t.player,o=t.pos,a=t.config,s=t.playerConfig,l=Ur.getEventPos(e,r.zoom),c=90===r.rotateDeg?l.clientY:l.clientX;if(!(r.isMini||a.closeMoveSeek||!s.allowSeekAfterEnded&&r.ended)){if(r.duration||r.isPlaying){e.stopPropagation(),n.focus(),Ur.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),Ur.checkIsFunction(a.onMoveStart)&&a.onMoveStart(),Ur.event(e),o.x=c,o.isDown=!0,o.moving=!1,i.prePlayTime=r.currentTime,r.focus({autoHide:!1}),n.isProgressMoving=!0,Ur.addClass(n.progressBtn,"active");var u=n.computeTime(e,c);return u.prePlayTime=i.prePlayTime,n._mouseDownHandlerHook(e,u),"touchstart"===e.type?(n.root.addEventListener("touchmove",n.onMouseMove),n.root.addEventListener("touchend",n.onMouseUp),n.root.addEventListener("touchcancel",n.onMouseUp)):(n.unbind("mousemove",n.onMoveOnly),document.addEventListener("mousemove",n.onMouseMove,!1),document.addEventListener("mouseup",n.onMouseUp,!1)),!0}r.play()}})),mr(Sr(n),"onMouseUp",(function(e){var t=Sr(n),i=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=t._state;if(o){e.stopPropagation(),e.preventDefault(),Ur.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),Ur.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),Ur.event(e),Ur.removeClass(n.progressBtn,"active");var l=n.computeTime(e,o.x);l.prePlayTime=s.prePlayTime,o.moving?(n.triggerCallbacks("dragend",l,e),n.emitUserAction("drag","dragend",l)):(n.triggerCallbacks("click",l,e),n.emitUserAction("click","click",l)),n._mouseUpHandlerHook(e,l),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,o.isLocked=!0,s.prePlayTime=0,s.time=0;var c=e.type;"touchend"===c||"touchcancel"===c?(n.root.removeEventListener("touchmove",n.onMouseMove),n.root.removeEventListener("touchend",n.onMouseUp),n.root.removeEventListener("touchcancel",n.onMouseUp),n.blur()):(document.removeEventListener("mousemove",n.onMouseMove,!1),document.removeEventListener("mouseup",n.onMouseUp,!1),o.isEnter?"mobile"!==a.isMobileSimulateMode&&n.bind("mousemove",n.onMoveOnly):n.onMouseLeave(e)),Ur.setTimeout(Sr(n),(function(){n.resetSeekState()}),1),i.focus()}})),mr(Sr(n),"onMouseMove",(function(e){var t=Sr(n),i=t._state,r=t.pos,o=t.player,a=t.config;Ur.checkTouchSupport()&&e.preventDefault(),Ur.event(e);var s=Ur.getEventPos(e,o.zoom),l=90===o.rotateDeg?s.clientY:s.clientX,c=Math.abs(r.x-l);if(!(r.moving&&c<a.miniMoveStep||!r.moving&&c<a.miniStartStep)){r.x=l;var u=n.computeTime(e,l);u.prePlayTime=i.prePlayTime,n._mouseMoveHandlerHook(e,u)}})),mr(Sr(n),"onMouseOut",(function(e){n.triggerCallbacks("mouseout",null,e)})),mr(Sr(n),"onMouseOver",(function(e){n.triggerCallbacks("mouseover",null,e)})),mr(Sr(n),"onMouseEnter",(function(e){var t=Sr(n),i=t.player,r=t.pos;if(!(r.isDown||r.isEnter||i.isMini||!i.config.allowSeekAfterEnded&&i.ended)){r.isEnter=!0,n.bind("mousemove",n.onMoveOnly),n.bind("mouseleave",n.onMouseLeave),Ur.event(e);var o=Ur.getEventPos(e,i.zoom),a=90===i.rotateDeg?o.clientY:o.clientX,s=n.computeTime(e,a);n.triggerCallbacks("mouseenter",s,e),n.focus()}})),mr(Sr(n),"onMouseLeave",(function(e){n.triggerCallbacks("mouseleave",null,e),n.unlock(),n._updateInnerFocus(null)})),mr(Sr(n),"onVideoResize",(function(){var e=n.pos,t=e.x,i=e.isDown;if(e.isEnter&&!i){var r=n.computeTime(null,t);n.onMoveOnly(null,r)}})),n.useable=!1,n.isProgressMoving=!1,n.__dragCallBacks=[],n._state={now:-1,direc:0,time:0,prePlayTime:-1},n._disableBlur=!1,"boolean"==typeof n.config.isDragingSeek&&(console.warn("[XGPLAYER] 'isDragingSeek' is deprecated, please use 'isDraggingSeek' instead"),n.config.isDraggingSeek=n.config.isDragingSeek),n}return vr(i,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i+this.timeOffset}},{key:"changeState",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.useable=e}},{key:"show",value:function(e){this.root&&(this.root.style.display="flex")}},{key:"_initInner",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var n=fr(fr({fragments:t},i),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(n):(this.innerList=new dL(n),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map((function(t){e[t]=e.innerList[t].bind(e.innerList)})))}},{key:"_updateInnerFocus",value:function(e){this.innerList&&this.innerList.updateFocus(e)}},{key:"afterCreate",value:function(){if(!this.config.disable&&!this.playerConfig.isLive){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1,isLocked:!1},this.outer=this.find("xg-outer");var e=this.config,t=e.fragFocusClass,i=e.fragAutoFocus,n=e.fragClass;this._initInner(this.config.fragments,{fragFocusClass:t,fragAutoFocus:i,fragClass:n,style:this.playerConfig.commonStyle||{}}),"mobile"===Kr.device&&(this.config.isDraggingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.listenEvents(),this.bindDomEvents(),this.initCustomStyle()}}},{key:"listenEvents",value:function(){var e=this;this.on(ro,(function(){e.onMouseLeave()})),this.on(to,(function(){e.onTimeupdate()})),this.on(eo,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(lo,(function(){e.onCacheUpdate()})),this.on(qr,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(uo,(function(){e.onReset()})),this.on(Ro,(function(){e.onVideoResize()}))}},{key:"setConfig",value:function(e){var t=this,i=null;Object.keys(e).forEach((function(n){t.config[n]=e[n],"fragments"===n&&(i=e[n])})),i&&this._initInner(i,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===pr(e)&&Object.keys(e).map((function(i){t.style[i]=e[i]})))}},{key:"triggerCallbacks",value:function(e,t,i){this.__dragCallBacks.length>0&&this.__dragCallBacks.map((function(n){if(n&&n.handler&&n.type===e)try{n.handler(t,i)}catch(dF){console.error("[XGPLAYER][triggerCallbacks] ".concat(n," error"),dF)}}))}},{key:"addCallBack",value:function(e,t){t&&"function"==typeof t&&this.__dragCallBacks.push({type:e,handler:t})}},{key:"removeCallBack",value:function(e,t){var i=this.__dragCallBacks,n=-1;i.map((function(i,r){i&&i.type===e&&i.handler===t&&(n=r)})),n>-1&&i.splice(n,1)}},{key:"unlock",value:function(){var e=this.player,t=this.pos;t.isEnter=!1,t.isLocked=!1,e.isMini||(this.unbind("mousemove",this.onMoveOnly),t.isDown?this.unbind("mouseleave",this.onMouseLeave):this.blur())}},{key:"bindDomEvents",value:function(){var e=this.player.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),"touch"!==this.domEventType&&"compatible"!==this.domEventType||this.root.addEventListener("touchstart",this.onMouseDown),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==e.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut),this.player.root.addEventListener("click",this.onBodyClick,!0))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),Ur.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),Ur.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,i,n){var r=this.config,o=this.player;if(!r.isCloseClickSeek||0!==n){var a=t=t>=o.duration?o.duration-r.endedDiff:Number(t).toFixed(1);this.updatePercent(i),this.updateTime(e),(1!==n||r.isDraggingSeek&&"audio"!==o.config.mediaType)&&(this._state.now=a,this._state.direc=a>o.currentTime?0:1,o.seek(a))}}},{key:"computeTime",value:function(e,t){var i,n,r=this.player,o=this.root.getBoundingClientRect(),a=o.width,s=o.height,l=o.top,c=o.left,u=t;90===r.rotateDeg?(i=s,n=l):(i=a,n=c);var h=u-n,d=(h=h>i?i:h<0?0:h)/i;d=d<0?0:d>1?1:d,Number.isNaN(d)&&(d=this.player.currentTime/this.offsetDuration);var f=parseInt(d*this.offsetDuration*1e3,10)/1e3;return{percent:d,currentTime:f,seekTime:Ur.getCurrentTimeByOffset(f,r.timeSegments),offset:h,width:i,left:n,e:e}}},{key:"updateTime",value:function(e){var t=this.player,i=this.duration;e>i?e=i:e<0&&(e=0);var n=t.plugins.time;n&&n.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,t){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(100*e,"%"),this.innerList.update({played:e*this.offsetDuration},this.offsetDuration);var i=this.player.plugins.miniprogress;i&&i.update({played:e*this.offsetDuration},this.offsetDuration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,i=this._state,n=this.offsetDuration;if(!(t.isSeeking&&t.media.seeking||this.isProgressMoving)&&t.hasStart){if(i.now>-1){var r=parseInt(1e3*i.now,10)-parseInt(1e3*t.currentTime,10);if(0===i.direc&&r>300||1===i.direc&&r>-300)return void(i.now=-1);i.now=-1}var o=this.currentTime;o=Ur.adjustTimeByDuration(o,n,e),this.innerList.update({played:o},n),this.progressBtn.style.left="".concat(o/n*100,"%")}}},{key:"onCacheUpdate",value:function(e){var t=this.player,i=this.duration;if(t){var n=t.bufferedPoint.end;n=Ur.adjustTimeByDuration(n,i,e),this.innerList.update({cached:n},i)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0),this.progressBtn.style.left="0%"}},{key:"destroy",value:function(){var e=this.player;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var t=this.domEventType;"touch"!==t&&"compatible"!==t||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),this.root.removeEventListener("touchcancel",this.onMouseUp)),"mouse"!==t&&"compatible"!==t||(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),this.unbind("mouseleave",this.onMouseLeave),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),e.root.removeEventListener("click",this.onBodyClick,!0))}},{key:"render",value:function(){if(!this.config.disable&&!this.playerConfig.isLive){var e=this.player.controls?this.player.controls.config.mode:"";return'\n <xg-progress class="xgplayer-progress '.concat("bottom"===e?"xgplayer-progress-bottom":"",'">\n <xg-outer class="xgplayer-progress-outer">\n <xg-progress-btn class="xgplayer-progress-btn"></xg-progress-btn>\n </xg-outer>\n </xg-progress>\n ')}}}],[{key:"pluginName",get:function(){return"progress"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_CENTER,index:0,disable:!1,isDraggingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:fL.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return fL}}]),i}(),gL=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),mr(Sr(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return vr(i,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave),this.config.disable&&this.disable()}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),i}(),yL=function(e){_r(i,gL);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"btnClick",(function(t){t.preventDefault(),t.stopPropagation();var i=Sr(e).player;return e.emitUserAction(t,"switch_play_pause",{prop:"paused",from:i.paused,to:!i.paused}),i.ended?i.replay():i.paused?(i.play(),e.animate(!1)):(i.pause(),e.animate(!0)),!1})),e}return vr(i,[{key:"afterCreate",value:function(){kr(Er(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.initIcons(),this.bind(["touchend","click"],this.btnClick),this.listenEvents(),this.animate(!0))}},{key:"listenEvents",value:function(){var e=this,t=this.player;this.on([$r,Zr,Qr,uo],(function(){e.animate(t.paused)}))}},{key:"registerIcons",value:function(){return{play:{icon:TO,class:"xg-icon-play"},pause:{icon:SO,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.play),this.appendChild(".xgplayer-icon",e.pause)}},{key:"animate",value:function(e){if(this.player){var t=this.i18nKeys,i=this.find(".xg-tips");e?(this.setAttr("data-state","pause"),i&&this.changeLangTextKey(i,t.PLAY_TIPS)):(this.setAttr("data-state","play"),i&&this.changeLangTextKey(i,t.PAUSE_TIPS))}}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n '.concat(PO(this,"PLAY_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_LEFT,index:0,disable:!1}}}]),i}();function vL(){return(new DOMParser).parseFromString('<svg width="32px" height="40px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M11.2374369,14 L17.6187184,7.61871843 C17.9604272,7.27700968 17.9604272,6.72299032 17.6187184,6.38128157 C17.2770097,6.03957281 16.7229903,6.03957281 16.3812816,6.38128157 L9.38128157,13.3812816 C9.03957281,13.7229903 9.03957281,14.2770097 9.38128157,14.6187184 L16.3812816,21.6187184 C16.7229903,21.9604272 17.2770097,21.9604272 17.6187184,21.6187184 C17.9604272,21.2770097 17.9604272,20.7229903 17.6187184,20.3812816 L11.2374369,14 L11.2374369,14 Z" fill="#FFFFFF"></path>\n </g>\n</svg>',"image/svg+xml").firstChild}var mL=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.onClick=function(t){t.preventDefault(),t.stopPropagation(),e.config.onClick(t)},this.bind(["click","touchend"],this.onClick)}},{key:"registerIcons",value:function(){return{screenBack:{icon:vL,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){Ur.addClass(this.root,"show")}},{key:"hide",value:function(){Ur.removeClass(this.root,"show")}},{key:"render",value:function(){return'<xg-icon class="xgplayer-back">\n </xg-icon>'}}],[{key:"pluginName",get:function(){return"topbackicon"}},{key:"defaultConfig",get:function(){return{position:ma.ROOT_TOP,index:0}}}]),i}();function _L(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598 214h212v212h-84v-128h-128v-84zM726 726v-128h84v212h-212v-84h128zM214 426v-212h212v84h-128v128h-84zM298 598v128h128v84h-212v-212h84z"></path>\n</svg>\n',"image/svg+xml").firstChild}function EL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M682 342h128v84h-212v-212h84v128zM598 810v-212h212v84h-128v128h-84zM342 342v-128h84v212h-212v-84h128zM214 682v-84h212v212h-84v-128h-128z"></path>\n</svg>\n',"image/svg+xml").firstChild}var TL=function(e){_r(i,gL);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"_onOrientationChange",(function(t){e.player.fullscreen&&e.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?e.player.setRotateDeg(0):e.player.setRotateDeg(90))})),e}return vr(i,[{key:"afterCreate",value:function(){var e=this;kr(Er(i.prototype),"afterCreate",this).call(this);var t=this.config,n=this.playerConfig;if(!t.disable){t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var r=Ur.getFullScreenEl();n.fullscreenTarget===r&&this.player.getFullscreen().catch((function(e){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreenChange",this.toggleFullScreen,{pre:function(t){var i=e.player.fullscreen;e.emitUserAction(t,"switch_fullscreen",{prop:"fullscreen",from:i,to:!i})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(Io,(function(t){var i=e.find(".xg-tips");i&&e.changeLangTextKey(i,t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t)})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:mL,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===Kr.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:_L,class:"xg-get-fullscreen"},exitFullscreen:{icon:EL,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===Kr.device?"touchend":"click",this.handleFullscreen),"mobile"===Kr.device&&window.removeEventListener("orientationchange",this._onOrientationChange)}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.fullscreen),this.appendChild(".xgplayer-icon",e.exitFullscreen)}},{key:"toggleFullScreen",value:function(e){e instanceof Event&&(e.preventDefault(),e.stopPropagation());var t=this.player,i=this.config;!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.useCssFullscreen()?(t.fullscreen?t.exitCssFullscreen():t.getCssFullscreen(),this.animate(t.fullscreen)):i.rotateFullscreen?(t.fullscreen?t.exitRotateFullscreen():t.getRotateFullscreen(),this.animate(t.fullscreen)):i.switchCallback&&"function"==typeof i.switchCallback?i.switchCallback(t.fullscreen):t.fullscreen?(t.exitFullscreen(),i.useScreenOrientation&&this.unlockScreen()):(t.getFullscreen().catch((function(e){})),i.useScreenOrientation&&t.aspectRatio>1&&this.lockScreen(i.lockOrientationType))}},{key:"animate",value:function(e){e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(e?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"render",value:function(){if(!this.config.disable){return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n '.concat(PO(this,"FULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}},{key:"lockScreen",value:function(e){try{screen.orientation.lock(e).catch((function(e){}))}catch(ds){}}},{key:"unlockScreen",value:function(){try{screen.orientation.unlock().catch((function(e){}))}catch(ds){}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,useScreenOrientation:!1,lockOrientationType:"landscape",switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),i}(),SL=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),(n=t.call(this,e)).isActiving=!1,n}return vr(i,[{key:"duration",get:function(){var e=this.player,t=e.offsetDuration,i=e.duration;return this.playerConfig.customDuration||t||i}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"afterCreate",value:function(){var e=this.player.controls.config.mode;this.mode="flex"===e?"flex":"normal",this.config.disable||("flex"===this.mode&&(this.createCenterTime(),this.root.style.display="none"),this.durationDom=this.find(".time-duration"),this.timeDom=this.find(".time-current"),this.listenEvents())}},{key:"listenEvents",value:function(){var e=this;this.on([ro,eo,to],(function(t){"durationchange"===t.eventName&&(e.isActiving=!1),e.onTimeUpdate()})),this.on(qr,(function(){e.onTimeUpdate(!0)})),this.on(uo,(function(){e.onReset()}))}},{key:"show",value:function(e){if("flex"===this.mode)return this.centerCurDom&&(this.centerCurDom.style.display="block"),void(this.centerDurDom&&(this.centerDurDom.style.display="block"));this.root.style.display="block"}},{key:"hide",value:function(){if("flex"===this.mode)return this.centerCurDom&&(this.centerCurDom.style.display="none"),void(this.centerDurDom&&(this.centerDurDom.style.display="none"));this.root.style.display="none"}},{key:"onTimeUpdate",value:function(e){var t=this.player,i=this.config,n=this.duration;if(!i.disable&&!this.isActiving&&t.hasStart){var r=this.currentTime+this.timeOffset;r=Ur.adjustTimeByDuration(r,n,e),"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(Ur.format(r)),n!==1/0&&n>0&&(this.centerDurDom.innerHTML=Ur.format(n))):(this.timeDom.innerHTML=this.minWidthTime(Ur.format(r)),n!==1/0&&n>0&&(this.durationDom.innerHTML=Ur.format(n)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(Ur.format(0)),this.centerDurDom.innerHTML=Ur.format(0)):(this.timeDom.innerHTML=this.minWidthTime(Ur.format(0)),this.durationDom.innerHTML=Ur.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=Ur.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-left"),this.centerDurDom=Ur.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-right"),t.children.length>0?t.insertBefore(this.centerCurDom,t.children[0]):t.appendChild(this.centerCurDom),t.appendChild(this.centerDurDom),this.extraEls=[this.centerCurDom,this.centerDurDom]}}},{key:"afterPlayerInit",value:function(){var e=this.config;this.duration===1/0||this.playerConfig.isLive?(Ur.hide(this.durationDom),Ur.hide(this.timeDom),Ur.hide(this.find(".time-separator")),Ur.show(this.find(".time-live-tag"))):Ur.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(Ur.hide(this.durationDom),Ur.hide(this.timeDom),Ur.hide(this.find(".time-separator")),Ur.show(this.find(".time-live-tag"))):(Ur.hide(this.find(".time-live-tag")),Ur.show(this.find(".time-separator")),Ur.show(this.durationDom),Ur.show(this.timeDom))}},{key:"updateTime",value:function(e){this.isActiving=!0,!e&&0!==e||e>this.duration||("flex"!==this.mode?this.timeDom.innerHTML=this.minWidthTime(Ur.format(e)):this.centerCurDom.innerHTML=this.minWidthTime(Ur.format(e)))}},{key:"minWidthTime",value:function(e){return e.split(":").map((function(e){return'<span class="time-min-width">'.concat(e,"</span>")})).join(":")}},{key:"resetActive",value:function(){var e=this,t=this.player,i=function(){e.isActiving=!1};this.off(eo,i),t.isSeeking&&t.media.seeking?this.once(eo,i):this.isActiving=!1}},{key:"destroy",value:function(){var e=this.player.controls.center;this.centerCurDom&&e.removeChild(this.centerCurDom),this.centerCurDom=null,this.centerDurDom&&e.removeChild(this.centerDurDom),this.centerDurDom=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-time">\n <span class="time-current">00:00</span>\n <span class="time-separator">/</span>\n <span class="time-duration">00:00</span>\n <span class="time-live-tag">'.concat(this.i18n.LIVE_TIP,"</span>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"time"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_LEFT,index:2,disable:!1}}}]),i}(),bL=function(e){_r(i,ua);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"_onDurationChange",(function(){e.updateSegments();var t=e.player,i=t.currentTime,n=t.timeSegments;if(e._checkIfEnabled(n)){var r=Ur.getIndexByTime(i,n),o=Ur.getOffsetCurrentTime(i,n,r);e.player.offsetCurrentTime=o,e.changeIndex(r,n)}})),mr(Sr(e),"_onLoadedData",(function(){var t=e.player.timeSegments;if(e._checkIfEnabled(t)){var i=Ur.getOffsetCurrentTime(0,t);e.player.offsetCurrentTime=i,e.changeIndex(0,t),e.curPos.start>0&&(e.player.currentTime=e.curPos.start)}})),mr(Sr(e),"_onTimeupdate",(function(){var t=e.player,i=t.currentTime,n=t.timeSegments;if(e._checkIfEnabled(n)){var r=n.length;e.lastCurrentTime=i;var o=Ur.getIndexByTime(i,n);o!==e.curIndex&&e.changeIndex(o,n);var a=Ur.getOffsetCurrentTime(i,n,o);if(e.player.offsetCurrentTime=a,e.curPos){var s=e.curPos,l=s.start,c=s.end;i<l?e.player.currentTime=l:i>c&&o>=r-1&&e.player.pause()}}})),mr(Sr(e),"_onSeeking",(function(){var t=e.player,i=t.currentTime,n=t.timeSegments;if(e._checkIfEnabled(n))if(i<n[0].start)e.player.currentTime=n[0].start;else if(i>n[n.length-1].end)e.player.currentTime=n[n.length-1].end;else{var r=Ur.getIndexByTime(i,n);if(r>=0){var o=e.getSeekTime(i,e.lastCurrentTime,r,n);o>=0&&(e.player.currentTime=o)}}})),mr(Sr(e),"_onPlay",(function(){var t=e.player,i=t.currentTime,n=t.timeSegments;e._checkIfEnabled(n)&&i>=n[n.length-1].end&&(e.player.currentTime=n[0].start)})),e}return vr(i,[{key:"afterCreate",value:function(){this.curIndex=-1,this.curPos=null,this.lastCurrentTime=0,this.updateSegments(),this.on(ro,this._onDurationChange),this.on(ao,this._onLoadedData),this.on(to,this._onTimeupdate),this.on(Jr,this._onSeeking),this.on($r,this._onPlay)}},{key:"setConfig",value:function(e){var t=this;if(e){var i=Object.keys(e);i.length<1||(i.forEach((function(i){t.config[i]=e[i]})),this.updateSegments())}}},{key:"updateSegments",value:function(){var e=this.config,t=e.disable,i=e.segments,n=this.player;if(t||!i||0===i.length)n.timeSegments=[],n.offsetDuration=0,n.offsetCurrentTime=-1;else{var r=this.formatTimeSegments(i,n.duration);n.timeSegments=r,n.offsetDuration=r.length>0?r[r.length-1].duration:0}}},{key:"formatTimeSegments",value:function(e,t){var i=[];return e?(e.sort((function(e,t){return e.start-t.start})),e.forEach((function(e,n){var r={};if(r.start=e.start<0?0:e.start,r.end=t>0&&e.end>t?t:e.end,!(t>0&&r.start>t)){i.push(r);var o=r.end-r.start;if(0===n)r.offset=e.start,r.cTime=0,r.segDuration=o,r.duration=o;else{var a=i[n-1];r.offset=a.offset+(r.start-a.end),r.cTime=a.duration+a.cTime,r.segDuration=o,r.duration=a.duration+o}}})),i):[]}},{key:"getSeekTime",value:function(e,t,i,n){var r=-1,o=n[i],a=o.start,s=o.end;if(e>=a&&e<=s)return r;var l=e-t;if(l<0&&e<a){var c=t>a?t-a:0;return r=i-1>=0?n[i-1].end+l+c:0}return-1}},{key:"_checkIfEnabled",value:function(e){return!(!e||e.length<1)}},{key:"changeIndex",value:function(e,t){this.curIndex=e,e>=0&&t.length>0?this.curPos=t[e]:this.curPos=null}}],[{key:"pluginName",get:function(){return"TimeSegmentsControls"}},{key:"defaultConfig",get:function(){return{disable:!0,segments:[]}}}]),i}();function CL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M940.632 837.632l-72.192-72.192c65.114-64.745 105.412-154.386 105.412-253.44s-40.299-188.695-105.396-253.424l-0.016-0.016 72.192-72.192c83.639 83.197 135.401 198.37 135.401 325.632s-51.762 242.434-135.381 325.612l-0.020 0.020zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>\n</svg>\n',"image/svg+xml").firstChild}function kL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>\n</svg>\n',"image/svg+xml").firstChild}function IL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M920.4 439.808l-108.544-109.056-72.704 72.704 109.568 108.544-109.056 108.544 72.704 72.704 108.032-109.568 108.544 109.056 72.704-72.704-109.568-108.032 109.056-108.544-72.704-72.704-108.032 109.568z"></path>\n</svg>\n',"image/svg+xml").firstChild}var PL=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var i=Sr(e).player,n=e.find(".xgplayer-bar");Ur.event(t);var r=n.getBoundingClientRect(),o=Ur.getEventPos(t,i.zoom),a=r.height-(o.clientY-r.top);if(o.h=a,o.barH=r.height,e.pos=o,!(a<-2))return e.updateVolumePos(a,t),document.addEventListener("mouseup",e.onBarMouseUp),e._d.isStart=!0,!1})),mr(Sr(e),"onBarMouseMove",(function(t){var i=Sr(e)._d;if(i.isStart){var n=Sr(e),r=n.pos,o=n.player;t.preventDefault(),t.stopPropagation(),Ur.event(t);var a=Ur.getEventPos(t,o.zoom);i.isMoving=!0;var s=r.h-a.clientY+r.clientY;s>r.barH||e.updateVolumePos(s,t)}})),mr(Sr(e),"onBarMouseUp",(function(t){Ur.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var i=Sr(e)._d;i.isStart=!1,i.isMoving=!1})),mr(Sr(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),mr(Sr(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),mr(Sr(e),"onVolumeChange",(function(t){if(e.player){var i=e.player,n=i.muted,r=i.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=n||0===r?"4px":"".concat(100*r,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(n,r)}})),e}return vr(i,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:kL,class:"xg-volume-small"},volumeLarge:{icon:CL,class:"xg-volume"},volumeMuted:{icon:IL,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;if(this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},!this.config.disable){this.initIcons();var t=this.playerConfig,i=t.commonStyle,n=t.volume;i.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=i.volumeColor),this.changeMutedHandler=this.hook("mutedChange",(function(t){e.changeMuted(t)}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),"mobile"!==Kr.device&&"mobile"!==this.playerConfig.isMobileSimulateMode&&(this.bind("mouseenter",this._onMouseenterHandler),this.bind(["blur","mouseleave"],this._onMouseleaveHandler),this.bind(".xgplayer-slider","mousedown",this.onBarMousedown),this.bind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.bind(".xgplayer-slider","mouseup",this.onBarMouseUp)),this.bind(".xgplayer-icon",["touchend","click"],this.changeMutedHandler),this.on(oo,this.onVolumeChange),this.once(ao,this.onVolumeChange),"Number"!==Ur.typeOf(n)&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,t){var i=this.player,n=this.find(".xgplayer-drag"),r=this.find(".xgplayer-bar");if(r&&n){var o=parseInt(e/r.getBoundingClientRect().height*1e3,10);n.style.height="".concat(e,"px");var a=Math.max(Math.min(o/1e3,1),0),s={volume:{from:i.volume,to:a}};i.muted&&(s.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:i.muted,volume:i.volume,props:s}),i.volume=Math.max(Math.min(o/1e3,1),0),i.muted&&(i.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,i=e.muted,n=this.find(".xgplayer-value-label"),r=Math.max(Math.min(t,1),0);n.innerText=i?0:Math.round(100*r)}},{key:"focus",value:function(){this.player.focus({autoHide:!1}),this._timerId&&(Ur.clearTimeout(this,this._timerId),this._timerId=null),Ur.addClass(this.root,"slide-show")}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this._d,o=this.player;r.isActive||(this._timerId&&(Ur.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=Ur.setTimeout(this,(function(){r.isActive||(i?o.blur():o.focus(),Ur.removeClass(e.root,"slide-show"),r.isStart&&e.onBarMouseUp(n)),e._timerId=null}),t))}},{key:"changeMuted",value:function(e){e&&e.stopPropagation();var t=this.player;this._d.isStart&&this.onBarMouseUp(e),this.emitUserAction(e,"change_muted",{muted:t.muted,volume:t.volume,props:{muted:{from:t.muted,to:!t.muted}}}),t.volume>0&&(t.muted=!t.muted),t.volume<.01&&(t.volume=this.config.miniVolume)}},{key:"animate",value:function(e,t){e||0===t?this.setAttr("data-state","mute"):t<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.volumeSmall),this.appendChild(".xgplayer-icon",e.volumeLarge),this.appendChild(".xgplayer-icon",e.volumeMuted)}},{key:"destroy",value:function(){this._timerId&&(Ur.clearTimeout(this,this._timerId),this._timerId=null),this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-slider","mousedown",this.onBarMousedown),this.unbind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.unbind(".xgplayer-slider","mouseup",this.onBarMouseUp),document.removeEventListener("mouseup",this.onBarMouseUp),this.unbind(".xgplayer-icon","mobile"===Kr.device?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){if(!this.config.disable){var e=this.config.default||this.player.volume,t=this.config.showValueLabel;return'\n <xg-icon class="xgplayer-volume" data-state="normal">\n <div class="xgplayer-icon">\n </div>\n <xg-slider class="xgplayer-slider">\n '.concat(t?'<div class="xgplayer-value-label">'.concat(100*e,"</div>"):"",'\n <div class="xgplayer-bar">\n <xg-drag class="xgplayer-drag" style="height: ').concat(100*e,'%"></xg-drag>\n </div>\n </xg-slider>\n </xg-icon>')}}}],[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),i}();function DL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="-4 -6 40 40" fill="none">\n <g>\n <path transform="scale(1.5 1.5)" d="M11.6665 9.16663H4.1665C2.78579 9.16663 1.6665 10.2859 1.6665 11.6666V15.8333C1.6665 17.214 2.78579 18.3333 4.1665 18.3333H11.6665C13.0472 18.3333 14.1665 17.214 14.1665 15.8333V11.6666C14.1665 10.2859 13.0472 9.16663 11.6665 9.16663Z" fill="white"/>\n <path transform="scale(1.5 1.5)" fill-rule="evenodd" clip-rule="evenodd" d="M3.88148 4.06298C3.75371 4.21005 3.67667 4.40231 3.67749 4.61242C3.67847 4.87253 3.79852 5.10435 3.98581 5.25646L6.99111 8.05895C7.32771 8.37283 7.85502 8.35443 8.16891 8.01782C8.48279 7.68122 8.46437 7.15391 8.12778 6.84003L6.62061 5.43457L9.8198 5.4224C9.82848 5.42239 9.8372 5.42221 9.84591 5.4219C10.9714 5.38233 12.0885 5.6285 13.0931 6.13744C14.0976 6.64635 14.957 7.40148 15.5908 8.33234C16.2246 9.2632 16.6122 10.3394 16.7177 11.4606C16.823 12.5819 16.6427 13.7115 16.1934 14.7442C16.0098 15.1661 16.203 15.6571 16.6251 15.8408C17.0471 16.0243 17.5381 15.8311 17.7216 15.4091C18.2833 14.1183 18.5087 12.7063 18.3771 11.3047C18.2453 9.90318 17.7607 8.55792 16.9684 7.39433C16.1761 6.23073 15.1021 5.28683 13.8463 4.65065C12.5946 4.01651 11.203 3.70872 9.80072 3.75583L6.43415 3.76862L7.96326 2.12885C8.27715 1.79225 8.25872 1.26494 7.92213 0.951061C7.58553 0.63718 7.05822 0.655585 6.74433 0.99219L3.90268 4.0395C3.89545 4.04724 3.88841 4.05509 3.88154 4.06303L3.88148 4.06298Z" fill="white"/>\n </g>\n <defs>\n <clipPath>\n <rect width="40" height="40" fill="white"/>\n </clipPath>\n </defs>\n</svg>\n',"image/svg+xml").firstChild}var wL=function(e){_r(i,gL);var t=Cr(i);function i(e){var n;return gr(this,i),(n=t.call(this,e)).rotateDeg=n.config.rotateDeg||0,n}return vr(i,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){kr(Er(i.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.onBtnClick=this.onBtnClick.bind(this),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(Ro,(function(){e.rotateDeg&&e.config.innerRotate&&Ur.setTimeout(e,(function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)}),100)}));var t=this.player.root;this.rootWidth=t.style.width||t.offsetWidth||t.clientWidth,this.rootHeight=t.style.height||t.offsetHeight||t.clientHeight,this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate)}}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{key:"onBtnClick",value:function(e){e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"rotate"),this.rotate(this.config.clockwise,this.config.innerRotate,1)}},{key:"updateRotateDeg",value:function(e,t){if(e||(e=0),t)this.player.videoRotateDeg=e;else{var i=this.player,n=this.rootWidth,r=this.rootHeight,o=i.root,a=i.innerContainer,s=i.media,l=o.offsetWidth,c=a&&t?a.offsetHeight:o.offsetHeight,u=n,h=r,d=0,f=0;.75!==e&&.25!==e||(u="".concat(c,"px"),h="".concat(l,"px"),d=-(c-l)/2,f=-(l-c)/2);var p="translate(".concat(d,"px,").concat(f,"px) rotate(").concat(e,"turn)"),g={transformOrigin:"center center",transform:p,webKitTransform:p,height:h,width:u},y=t?s:o,v=t?i.getPlugin("poster"):null;Object.keys(g).map((function(e){y.style[e]=g[e],v&&v.root&&(v.root.style[e]=g[e])}))}}},{key:"rotate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.player;this.rotateDeg||(this.rotateDeg=0);var r=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*r*i)%1,this.updateRotateDeg(this.rotateDeg,t),n.emit(Oo,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:DL}}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n '.concat(PO(this,"ROTATE_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),i}();function AL(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}function RL(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M9.4998 7.7C9.77595 7.7 9.9998 7.47614 9.9998 7.2V6.5C9.9998 6.22386 9.77595 6 9.4998 6H5.5402L5.52754 6.00016H5.5C5.22386 6.00016 5 6.22401 5 6.50016V10.4598C5 10.7359 5.22386 10.9598 5.5 10.9598H6.2C6.47614 10.9598 6.7 10.7359 6.7 10.4598V8.83005L8.76983 10.9386C8.96327 11.1357 9.27984 11.1386 9.47691 10.9451L9.97645 10.4548C10.1735 10.2613 10.1764 9.94476 9.983 9.7477L7.97289 7.7H9.4998Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}var xL="picture-in-picture",OL="inline",LL="fullscreen",NL=function(e){_r(i,gL);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"switchPIP",(function(t){if(!e.isPIPAvailable())return!1;t.stopPropagation&&t.stopPropagation(),e.isPip?(e.exitPIP(),e.emitUserAction(t,"change_pip",{props:"pip",from:!0,to:!1}),e.setAttr("data-state","normal")):4===e.player.media.readyState&&(e.requestPIP(),e.emitUserAction(t,"change_pip",{props:"pip",from:!1,to:!0}),e.setAttr("data-state","pip"))})),e}return vr(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.pip&&(e.config.showIcon=e.player.config.pip)}},{key:"afterCreate",value:function(){var e=this;this.isPIPAvailable()&&(kr(Er(i.prototype),"afterCreate",this).call(this),this.pMode=OL,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(mo,(function(){e.config.showIcon&&(Ur.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:AL,class:"xg-get-pip"},pipIconExit:{icon:RL,class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.pipIcon),this.appendChild(".xgplayer-icon",e.pipIconExit)}},{key:"initPipEvents",value:function(){var e=this,t=this.player;this.leavePIPCallback=function(){var i=t.paused;Ur.setTimeout(e,(function(){!i&&t.mediaPlay()}),0),!i&&t.mediaPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(xo,!1)},this.enterPIPCallback=function(i){t.emit(xo,!0),null!=i&&i.pictureInPictureWindow&&(e.pipWindow=i.pictureInPictureWindow),e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(i){var n=t.media.webkitPresentationMode;e.pMode===LL&&n!==LL&&t.onFullscreenChange(null,!1),e.pMode=n,n===xL?e.enterPIPCallback(i):n===OL&&e.leavePIPCallback(i)},t.media&&(t.media.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.media.addEventListener("leavepictureinpicture",this.leavePIPCallback),i.checkWebkitSetPresentationMode(t.media)&&t.media.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"copyStyleIntoPiPWindow",value:function(e){var t=Ir(document.styleSheets).map((function(t){try{return Ir(t.cssRules).map((function(e){return e.cssText})).join("")}catch(ds){var i=document.createElement("link");i.rel="stylesheet",i.type=t.type,i.media=t.media,i.href=t.href,e.document.head.appendChild(i)}return""})).filter(Boolean).join("\n"),i=document.createElement("style");i.textContent=t,e.document.head.appendChild(i)}},{key:"requestPIP",value:function(){var e=this,t=this.player,n=this.playerConfig,r=this.config;if(this.isPIPAvailable()&&!this.isPip)try{var o=n.poster;if(o&&(t.media.poster="String"===Ur.typeOf(o)?o:o.poster),r.preferDocument&&this.isDocPIPAvailable()){var a={};if(r.width&&r.height)a.width=r.width,a.height=r.height;else{var s=t.root.getBoundingClientRect();a.width=s.width,a.height=s.height}documentPictureInPicture.requestWindow(a).then((function(i){var n=r.docPiPNode,o=r.docPiPStyle;e.enterPIPCallback();var a=n||t.root,s=a.parentElement,l=a.previousSibling,c=a.nextSibling;e.copyStyleIntoPiPWindow(i);var u=document.createElement("style");if(u.append("body{padding:0; margin:0;}"),o){var h="";"string"==typeof o?h=o:"function"==typeof o&&(h=o.call(r)),h&&u.append(h)}else a===t.root&&u.append("\n .xgplayer{width: 100%!important; height: 100%!important;}\n ");i.document.head.append(u),i.document.body.append(a),i.addEventListener("pagehide",(function(t){s&&(c?s.insertBefore(a,c):l?s.insertBefore(a,l.nextSibling):s.appendChild(a)),e.leavePIPCallback()}),{once:!0})}))}else i.checkWebkitSetPresentationMode(t.media)?t.media.webkitSetPresentationMode("picture-in-picture"):t.media.requestPictureInPicture();return!0}catch(l){return console.error("requestPiP",l),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{var t;if(this.isPIPAvailable()&&this.isPip)this.isDocPIPAvailable()&&null!==(t=documentPictureInPicture)&&void 0!==t&&t.window?documentPictureInPicture.window.close():i.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("inline"):document.exitPictureInPicture();return!0}catch(n){return console.error("exitPIP",n),!1}}},{key:"isPip",get:function(){var e,t=this.player;return!(!this.isDocPIPAvailable()||null===(e=documentPictureInPicture)||void 0===e||!e.window)||document.pictureInPictureElement&&document.pictureInPictureElement===t.media||t.media.webkitPresentationMode===xL}},{key:"isPIPAvailable",value:function(){var e=this.player.media;return"Boolean"===Ur.typeOf(document.pictureInPictureEnabled)&&document.pictureInPictureEnabled&&("Boolean"===Ur.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===Ur.typeOf(e.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this);var e=this.player;e.media.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.media.removeEventListener("leavepictureinpicture",this.leavePIPCallback),i.checkWebkitSetPresentationMode(e.media)&&e.media.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.exitPIP(),this.unbind("click",this.btnClick)}},{key:"render",value:function(){if(this.config.showIcon&&this.isPIPAvailable())return'<xg-icon class="xgplayer-pip">\n <div class="xgplayer-icon xg-icon-disable">\n </div>\n '.concat(PO(this,"PIP",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:6,showIcon:!1,preferDocument:!1,width:void 0,height:void 0,docPiPNode:void 0,docPiPStyle:void 0}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}]),i}();function ML(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="40" viewBox="10 0 24 40">\n <path transform="scale(0.038 0.028)" d="M800 380v768h-128v-352l-320 320v-704l320 320v-352z"></path>\n</svg>\n',"image/svg+xml").firstChild}var UL=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"playNext",(function(e){var t=Sr(n).player;e.preventDefault(),e.stopPropagation(),n.idx+1<n.config.urlList.length?(n.idx++,n.nextHandler(n.config.urlList[n.idx],n.idx),t.emit(No,n.idx+1)):(n.nextHandler(),t.emit(No))})),n.idx=-1,n}return vr(i,[{key:"afterCreate",value:function(){this.config.urlList&&0!==this.config.urlList.length&&(this.appendChild(".xgplayer-icon",this.icons.playNext),this.initEvents())}},{key:"registerIcons",value:function(){return{playNext:ML}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("nextClick",this.changeSrc);var e="mobile"===Kr.device?"touchend":"click";this.bind(e,this.playNext),this.show()}},{key:"changeSrc",value:function(e){var t=this.player;e&&(t.pause(),t.currentTime=0,t.switchURL?t.switchURL(e):t.src=e,t.config.url=e,t.play())}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.playNext)}},{key:"render",value:function(){if(this.config.urlList&&0!==this.config.urlList.length)return'\n <xg-icon class="xgplayer-playnext">\n <div class="xgplayer-icon">\n </div>\n '.concat(PO(this,"PLAYNEXT_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),i}(),BL={exports:{}};BL.exports=function e(t,i,n){var r,o,a=window,s="application/octet-stream",l=n||s,c=t,u=!i&&!n&&c,h=document.createElement("a"),d=function(e){return String(e)},f=a.Blob||a.MozBlob||a.WebKitBlob||d,p=i||"download";if(f=f.call?f.bind(a):Blob,"true"===String(this)&&(l=(c=[c,l])[0],c=c[1]),u&&u.length<2048&&(p=u.split("/").pop().split("?")[0],h.href=u,-1!==h.href.indexOf(u))){var g=new XMLHttpRequest;return g.open("GET",u,!0),g.responseType="blob",g.onload=function(t){e(t.target.response,p,s)},setTimeout((function(){g.send()}),0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(c)){if(!(c.length>2096103.424&&f!==d))return navigator.msSaveBlob?navigator.msSaveBlob(_(c),p):E(c);l=(c=_(c)).type||s}else if(/([\x80-\xff])/.test(c)){for(var y=0,v=new Uint8Array(c.length),m=v.length;y<m;++y)v[y]=c.charCodeAt(y);c=new f([v],{type:l})}function _(e){for(var t=e.split(/[:;,]/),i=t[1],n=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),r=n.length,o=0,a=new Uint8Array(r);o<r;++o)a[o]=n.charCodeAt(o);return new f([a],{type:i})}function E(e,t){if("download"in h)return h.href=e,h.setAttribute("download",p),h.className="download-js-link",h.innerHTML="downloading...",h.style.display="none",document.body.appendChild(h),setTimeout((function(){h.click(),document.body.removeChild(h),!0===t&&setTimeout((function(){a.URL.revokeObjectURL(h.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var i=document.createElement("iframe");document.body.appendChild(i),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),i.src=e,setTimeout((function(){document.body.removeChild(i)}),333)}if(r=c instanceof f?c:new f([c],{type:l}),navigator.msSaveBlob)return navigator.msSaveBlob(r,p);if(a.URL)E(a.URL.createObjectURL(r),!0);else{if("string"==typeof r||r.constructor===d)try{return E("data:"+l+";base64,"+a.btoa(r))}catch(T){return E("data:"+l+","+encodeURIComponent(r))}(o=new FileReader).onload=function(e){E(this.result)},o.readAsDataURL(r)}return!0};const FL=lr(BL.exports);function HL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-488.000000, -340.000000)" fill="#FFFFFF">\n <g id="Group-2">\n <g id="volme_big-copy" transform="translate(488.000000, 340.000000)">\n <rect id="Rectangle-18" x="11" y="4" width="2" height="12" rx="1"></rect>\n <rect id="Rectangle-2" x="3" y="18" width="18" height="2" rx="1"></rect>\n <rect id="Rectangle-2" transform="translate(4.000000, 17.500000) rotate(90.000000) translate(-4.000000, -17.500000) " x="1.5" y="16.5" width="5" height="2" rx="1"></rect><rect id="Rectangle-2-Copy-3" transform="translate(20.000000, 17.500000) rotate(90.000000) translate(-20.000000, -17.500000) " x="17.5" y="16.5" width="5" height="2" rx="1"></rect>\n <path d="M9.48791171,8.26502656 L9.48791171,14.2650266 C9.48791171,14.8173113 9.04019646,15.2650266 8.48791171,15.2650266 C7.93562696,15.2650266 7.48791171,14.8173113 7.48791171,14.2650266 L7.48791171,7.26502656 C7.48791171,6.71274181 7.93562696,6.26502656 8.48791171,6.26502656 L15.4879117,6.26502656 C16.0401965,6.26502656 16.4879117,6.71274181 16.4879117,7.26502656 C16.4879117,7.81731131 16.0401965,8.26502656 15.4879117,8.26502656 L9.48791171,8.26502656 Z" id="Combined-Shape" transform="translate(11.987912, 10.765027) scale(1, -1) rotate(45.000000) translate(-11.987912, -10.765027) "></path>\n </g>\n </g>\n </g>\n </g>\n</svg>\n',"image/svg+xml").firstChild}var jL=function(e){_r(i,gL);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"download",(function(e){if(!n.isLock){n.emitUserAction(e,"download");var t=n.playerConfig.url,i="";"String"===Ur.typeOf(t)?i=t:"Array"===Ur.typeOf(t)&&t.length>0&&(i=t[0].src);var r=n.getAbsoluteURL(i);FL(r),n.isLock=!0,n.timer=window.setTimeout((function(){n.isLock=!1,window.clearTimeout(n.timer),n.timer=null}),300)}})),n.timer=null,n.isLock=!1,n}return vr(i,[{key:"afterCreate",value:function(){kr(Er(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.download),this._handler=this.hook("click",this.download,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(["click","touchend"],this._handler))}},{key:"registerIcons",value:function(){return{download:HL}}},{key:"getAbsoluteURL",value:function(e){if(!e.match(/^https?:\/\//)){var t=document.createElement("div");t.innerHTML='<a href="'.concat(e,'">x</a>'),e=t.firstChild.href}return e}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.download),window.clearTimeout(this.timer),this.timer=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-download">\n <div class="xgplayer-icon">\n </div>\n '.concat(PO(this,"DOWNLOAD_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:3,disable:!0}}}]),i}(),VL=function(e){_r(i,gL);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){kr(Er(i.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var e=this.config;this.initSize=function(t){e.fitVideo&&(e.width=t.vWidth,e.height=t.vHeight)},this.once(Ro,this.initSize)}},{key:"onPluginsReady",value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind(["click","touchend"],this.onClickBtn)}},{key:"saveScreenShot",value:function(e,t){var i,n=document.createElement("a");n.href=e,n.download=t;try{"undefined"!=typeof MouseEvent?i=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}):(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}catch(ds){console.error("MouseEvent unsupported",ds)}i&&n.dispatchEvent(i)}},{key:"createCanvas",value:function(e,t){var i=document.createElement("canvas"),n=i.getContext("2d");this.canvasCtx=n,this.canvas=i,i.width=e||this.config.width,i.height=t||this.config.height,n.imageSmoothingEnabled=!0,n.imageSmoothingEnabled&&(n.imageSmoothingQuality="high")}},{key:"onClickBtn",value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot");var i=this.config;this.shot(i.width,i.height).then((function(e){t.emit(Lo,e),i.saveImg&&t.saveScreenShot(e,i.name+i.format)}))}},{key:"shot",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},r=this.config,o=this.player,a=n.quality||r.quality,s=n.type||r.type;return new Promise((function(n,l){var c,u=null;if(o.media.canvas)u=o.media.canvas;else{i.canvas?(i.canvas.width=e||r.width,i.canvas.height=t||r.height):i.createCanvas(e,t),u=i.canvas,c=i.canvasCtx;var h,d,f,p,g=o.media.videoWidth/o.media.videoHeight,y=u.width/u.height,v=o.media.videoWidth,m=o.media.videoHeight;g>y?(f=u.width,p=u.width/g,h=0,d=Math.round((u.height-p)/2)):g===y?(f=u.width,p=u.height,h=0,d=0):g<y&&(f=u.height*g,p=u.height,h=Math.round((u.width-f)/2),d=0),c.drawImage(o.media,0,0,v,m,h,d,f,p)}var _=u.toDataURL(s,a).replace(s,"image/octet-stream");n(_=_.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(Ro,this.initSize)}},{key:"render",value:function(){if(!this.config.disable){var e=this.icons.screenshotIcon?"xgplayer-icon":"xgplayer-icon btn-text",t="SCREENSHOT";return'\n <xg-icon class="xgplayer-shot">\n <div class="'.concat(e,'">\n ').concat(this.icons.screenshotIcon?"":'<span lang-key="'.concat(this.i18nKeys[t],'">').concat(this.i18n[t],"</span>"),"\n </div>\n </xg-icon>")}}}],[{key:"pluginName",get:function(){return"screenShot"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,saveImg:!0,fitVideo:!0,disable:!1,name:"screenshot"}}}]),i}(),KL=function(e){_r(i,LA);var t=Cr(i);function i(e){var n;return gr(this,i),(n=t.call(this,e)).curTime=0,n.isPaused=!0,n}return vr(i,[{key:"beforeCreate",value:function(e){var t=e.config.list;Array.isArray(t)&&t.length>0&&(e.config.list=t.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})))}},{key:"afterCreate",value:function(){var e=this;kr(Er(i.prototype),"afterCreate",this).call(this),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(wo,(function(t){e.renderItemList(e.config.list,t.to)})),this.player.definitionList.length<2&&this.hide()}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||Ur.addClass(this.root,"show")}},{key:"initDefinition",value:function(){var e=this.config,t=e.list,i=e.defaultDefinition;if(t.length>0){var n=null;t.map((function(e){e.definition===i&&(n=e)})),n||(n=t[0]),this.changeDefinition(n)}}},{key:"renderItemList",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.list||[],n=arguments.length>1?arguments[1]:void 0,r=n&&n.definition?n.definition:this.config.defaultDefinition;n&&t.forEach((function(e){e.selected=!1}));var o=0,a=t.map((function(t,i){var n=fr(fr({},t),{},{showText:e.getTextByLang(t)||t.definition,selected:!1});return(t.selected||t.definition&&t.definition==r)&&(n.selected=!0,o=i),n}));kr(Er(i.prototype),"renderItemList",this).call(this,a,o)}},{key:"changeDefinitionList",value:function(e){Array.isArray(e)&&(this.config.list=e.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})),this.renderItemList(),this.config.list.length<2?this.hide():this.show())}},{key:"changeDefinition",value:function(e,t){this.player.changeDefinition(e,t)}},{key:"onItemClick",value:function(e,t){var n=this.player.definitionList;kr(Er(i.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var r=0;r<n.length;r++)t.to&&n[r].definition===t.to.definition&&(t.to.url=n[r].url),t.from&&n[r].definition===t.from.definition&&(t.from.url=n[r].url);this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return fr(fr({},LA.defaultConfig),{},{position:ma.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),i}(),GL=function(e){_r(i,LA);var t=Cr(i);function i(e){var n;return gr(this,i),(n=t.call(this,e)).curRate=1,n}return vr(i,[{key:"beforeCreate",value:function(e){var t=e.player.config.playbackRate,i=t?Array.isArray(t)?t:e.config.list:[];Array.isArray(i)&&(e.config.list=i.map((function(e){return"number"==typeof e?e={rate:e,text:"".concat(e,"x")}:!e.text&&e.rate&&(e.text="".concat(e.rate,"x")),e})))}},{key:"afterCreate",value:function(){var e=this;kr(Er(i.prototype),"afterCreate",this).call(this),this.on(so,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(e){this.config.list&&0!==this.config.list.length&&kr(Er(i.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){kr(Er(i.prototype),"onItemClick",this).call(this,e,t);var n=e.delegateTarget,r=Number(n.getAttribute("rate"));if(!r||r===this.curValue)return!1;var o={playbackRate:{from:this.player.playbackRate,to:r}};this.emitUserAction(e,"change_rate",{props:o}),this.curValue=r,this.player.playbackRate=r}},{key:"renderItemList",value:function(){var e=this,t=this.player.playbackRate||1;this.curValue=t;var n=-1,r=this.config.list.map((function(i,r){var o={rate:i.rate};return o.rate===t&&(o.selected=!0,n=r),o.showText=e.getTextByLang(i),o}));kr(Er(i.prototype),"renderItemList",this).call(this,r,n)}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0],i="";i=!t||this.curIndex<0?"".concat(this.player.playbackRate,"x"):this.getTextByLang(t,"iconText"),this.find(".icon-text").innerHTML=i}}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return fr(fr({},LA.defaultConfig),{},{position:ma.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),i}();function WL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">\n <path fill="#fff" transform="scale(1.3, 1.3)" class=\'path_full\' d="M9,10v1a.9.9,0,0,1-1,1,.9.9,0,0,1-1-1V9A.9.9,0,0,1,8,8h2a.9.9,0,0,1,1,1,.9.9,0,0,1-1,1Zm6,4V13a1,1,0,0,1,2,0v2a.9.9,0,0,1-1,1H14a1,1,0,0,1,0-2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>\n</svg>\n',"image/svg+xml").firstChild}function YL(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">\n <path fill="#fff" transform="scale(1.3, 1.3)" d="M9,10V9a.9.9,0,0,1,1-1,.9.9,0,0,1,1,1v2a.9.9,0,0,1-1,1H8a.9.9,0,0,1-1-1,.9.9,0,0,1,1-1Zm6,4v1a1,1,0,0,1-2,0V13a.9.9,0,0,1,1-1h2a1,1,0,0,1,0,2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>\n</svg>\n',"image/svg+xml").firstChild}var zL=function(e){_r(i,gL);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.cssFullscreen&&(e.config.disable=!e.player.config.cssFullscreen)}},{key:"afterCreate",value:function(){var e=this;kr(Er(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(Po,(function(t){e.animate(t)})),this.btnClick=this.btnClick.bind(this),this.handleCssFullscreen=this.hook("cssFullscreen_change",this.btnClick,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(["click","touchend"],this.handleCssFullscreen))}},{key:"initIcons",value:function(){var e=this.icons,t=this.find(".xgplayer-icon");t.appendChild(e.cssFullscreen),t.appendChild(e.exitCssFullscreen)}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.player.isCssfullScreen;this.emitUserAction(e,"switch_cssfullscreen",{cssfullscreen:t}),t?this.player.exitCssFullscreen():this.player.getCssFullscreen()}},{key:"animate",value:function(e){this.root&&(e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.switchTips(e))}},{key:"switchTips",value:function(e){var t=this.i18nKeys,i=this.find(".xg-tips");i&&this.changeLangTextKey(i,e?t.EXITCSSFULLSCREEN_TIPS:t.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:WL,class:"xg-get-cssfull"},exitCssFullscreen:{icon:YL,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){kr(Er(i.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return"<xg-icon class='xgplayer-cssfullscreen'>\n <div class=\"xgplayer-icon\">\n </div>\n ".concat(PO(this,"CSSFULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:ma.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),i}(),$L=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"afterCreate",value:function(){var e=this;this.clickHandler=this.hook("errorRetry",this.errorRetry,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.onError=this.hook("showError",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(Qr,(function(t){e.onError(t)}))}},{key:"errorRetry",value:function(e){this.emitUserAction(e,"error_retry",{}),this.player.retry()}},{key:"handleError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.player,i=e.errorType,n=t.errorNote?this.i18n[t.errorNote]:"";if(!n)switch(i){case"decoder":n=this.i18n.MEDIA_ERR_DECODE;break;case"network":n=this.i18n.MEDIA_ERR_NETWORK;break;default:n=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=n,this.find(".xgplayer-error-tips").innerHTML="".concat(this.i18n.REFRESH_TIPS,'<span class="xgplayer-error-refresh">').concat(this.i18n.REFRESH,"</span>")}},{key:"destroy",value:function(){this.unbind(".xgplayer-error-refresh","click",this.clickHandler)}},{key:"render",value:function(){return'<xg-error class="xgplayer-error">\n <div class="xgplayer-errornote">\n <span class="xgplayer-error-text"></span>\n <span class="xgplayer-error-tips"><em class="xgplayer-error-refresh"></em></span>\n </div>\n </xg-error>'}}],[{key:"pluginName",get:function(){return"error"}}]),i}(),XL=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"afterCreate",value:function(){var e=this;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],(function(t){(e.config.onClick||e.customOnClick)&&(t.preventDefault(),t.stopPropagation(),e.customOnClick?e.customOnClick(t):e.config.onClick(t))})),this.player.showPrompt=function(){e.showPrompt.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).map((function(i){t.root.style[i]=e[i]}))}},{key:"showPrompt",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){this.customOnClick=n;var r=this.config.interval;if(this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),Ur.addClass(this.root,"show"),"arrow"===i.mode&&Ur.addClass(this.root,"arrow"),this.find(".xgplayer-prompt-detail").innerHTML="string"==typeof e?e:"".concat(e.text||"")+"".concat(e.highlight?'<i class="highlight">'.concat(e.highlight,"</i>"):""),i.style&&this.setStyle(i.style),"boolean"==typeof i.autoHide?i.autoHide:this.config.autoHide){var o=i.interval||r;this.intervalId=setTimeout((function(){t.hide()}),o)}}}},{key:"hide",value:function(){Ur.removeClass(this.root,"show"),Ur.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(Pa.CONTROLS_FOLLOW,'">\n <span class="xgplayer-prompt-detail"></span>\n </xg-prompt>')}}],[{key:"pluginName",get:function(){return"prompt"}},{key:"defaultConfig",get:function(){return{interval:3e3,style:{},mode:"arrow",autoHide:!0,detail:{text:"",highlight:""},onClick:function(){}}}}]),i}(),qL={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function ZL(e){Object.keys(qL).map((function(t){void 0===e[t]&&(e[t]=qL[t])}))}var QL={_updateDotDom:function(e,t){if(t){var i=this.calcuPosition(e.time,e.duration),n=e.style||{};n.left="".concat(i.left,"%"),n.width="".concat(i.width,"%"),t.setAttribute("data-text",e.text),t.setAttribute("data-time",e.time),i.isMini?Ur.addClass(t,"mini"):Ur.removeClass(t,"mini"),Object.keys(n).map((function(e){t.style[e]=n[e]}))}},initDots:function(){var e=this;this._ispots.map((function(t){e.createDot(t,!1)})),this.ispotsInit=!0},createDot:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.player.plugins.progress;if(i&&(t&&(ZL(e),this._ispots.push(e)),this.ispotsInit||!t)){var n=this.calcuPosition(e.time,e.duration),r=e.style||{};r.left="".concat(n.left,"%"),r.width="".concat(n.width,"%");var o="xgspot_".concat(e.id," xgplayer-spot");n.isMini&&(o+=" mini");var a=e.template?'<div class="xgplayer-spot-pop">'.concat(e.template,"</div>"):"",s=Ur.createDom("xg-spot",a,{"data-text":e.text,"data-time":e.time,"data-id":e.id},o);Object.keys(r).map((function(e){s.style[e]=r[e]})),i.outer&&i.outer.appendChild(s),this.positionDot(s,e.id)}},findDot:function(e){if(this.player.plugins.progress){var t=this._ispots.filter((function(t,i){return t.id===e}));return t.length>0?t[0]:null}},updateDot:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.player.plugins.progress;if(i){var n=this.findDot(e.id);if(n&&Object.keys(e).map((function(t){n[t]=e[t]})),this.ispotsInit){var r=i.find('xg-spot[data-id="'.concat(e.id,'"]'));r&&(this._updateDotDom(e,r),t&&this.showDot(e.id))}}},deleteDot:function(e){var t=this._ispots,i=this.player.plugins.progress;if(i){for(var n=[],r=0;r<t.length;r++)t[r].id===e&&n.push(r);for(var o=n.length-1;o>=0;o--)if(t.splice(n[o],1),this.ispotsInit){var a=i.find('xg-spot[data-id="'.concat(e,'"]'));a&&a.parentElement.removeChild(a)}}},deleteAllDots:function(){var e=this.player.plugins.progress;if(e)if(this.ispotsInit){for(var t=e.root.getElementsByTagName("xg-spot"),i=t.length-1;i>=0;i--)e.outer.removeChild(t[i]);this._ispots=[]}else this._ispots=[]},updateAllDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this.player.plugins.progress;if(i)if(this.ispotsInit){this._ispots=[];var n=i.root.getElementsByTagName("xg-spot"),r=n.length;if(r>t.length)for(var o=r-1;o>t.length-1;o--)i.outer.removeChild(n[o]);t.forEach((function(t,i){i<r?(n[i].setAttribute("data-id","".concat(t.id)),e._ispots.push(t),e.updateDot(t)):e.createDot(t)}))}else this._ispots=t},positionDots:function(){var e=this,t=this._ispots,i=this.playerSize,n=this.player.sizeInfo,r=this.player.plugins.progress;r&&n.width!==i.width&&(i.width=n.width,i.left=n.left,t.forEach((function(t){var i=r.find('xg-spot[data-id="'.concat(t.id,'"]'));i&&e.positionDot(i,t.id)})))},positionDot:function(e,t){var i=Ur.findDom(e,".xgplayer-spot-pop");if(i){var n=this.playerSize,r=e.getBoundingClientRect(),o=i.getBoundingClientRect(),a=r.left-n.left,s=n.width-a-r.width/2;if(a<o.width/2||n.width<o.width){var l=o.width/2-a;i.style.left="".concat(l,"px")}else if(s<o.width/2){var c=s-o.width/2+r.width/2;i.style.left="".concat(c,"px")}else i.style.left="50%"}},updateDuration:function(){var e=this,t=this.player.plugins.progress;t&&this._ispots.forEach((function(i){var n=t.find('xg-spot[data-id="'.concat(i.id,'"]'));e._updateDotDom(i,n)}))},getAllDotsDom:function(){var e=this.player.plugins.progress;return e?e.root.getElementsByTagName("xg-spot"):[]},getDotDom:function(e){var t=this.player.plugins.progress;if(t)return t.find('xg-spot[data-id="'.concat(e,'"]'))}};var JL={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseOver"},eN=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),mr(Sr(n=t.call(this,e)),"onMousemove",(function(e){n.config.disable||(Ur.hasClass(e.target,"xg-spot-content")&&n.config.isHideThumbnailHover?n.player.plugins.progress.onMouseLeave(e):(n._state.f||Ur.hasClass(e.target,"xg-spot-content"))&&(Ur.event(e),e.stopPropagation()))})),mr(Sr(n),"onMousedown",(function(e){n.config.disable||(n._state.f||Ur.hasClass(e.target,"xg-spot-content"))&&(Ur.event(e),e.stopPropagation())})),mr(Sr(n),"onMouseup",(function(e){if(n.isDrag){var t=n.player.plugins.progress;t&&t.pos&&(t.onMouseUp(e),!t.pos.isEnter&&t.onMouseLeave(e))}})),mr(Sr(n),"onDotMouseLeave",(function(e){if(!n.config.disable){n._curDot.removeEventListener("mouseleave",n.onDotMouseLeave),n.blurDot(e.target),n._curDot=null;var t=n.player.plugins.progress;t&&t.enableBlur(),n.show()}})),mr(Sr(n),"onProgressMouseOver",(function(e,t){if(!n.config.disable&&Ur.hasClass(t.target,"xgplayer-spot")&&!n._curDot){n._curDot=t.target,n.focusDot(t.target),n._curDot.children.length>0&&n.hide();var i=n.player.plugins.progress;i&&i.disableBlur(),n._curDot.addEventListener("mouseleave",n.onDotMouseLeave)}})),n._ispots=[],n.videoPreview=null,n.videothumbnail=null,n.thumbnail=null,n.timeStr="",n._state={now:0,f:!1},n}return vr(i,[{key:"beforeCreate",value:function(e){var t=e.player.plugins.progress;t&&(e.root=t.root)}},{key:"afterCreate",value:function(){var e=this;this._curDot=null,this.handlerSpotClick=this.hook("spotClick",(function(t,i){i.seekTime&&e.player.seek(i.seekTime)})),this.transformTimeHook=this.hook("transformTime",(function(t){e.setTimeContent(Ur.format(t))})),function(e){var t=e.config,i=e.player;Object.keys(QL).map((function(t){e[t]=QL[t].bind(e)}));var n=i.config.progressDot||t.ispots||[];e._ispots=n.map((function(e){return ZL(e),e})),e.ispotsInit=!1,e.playerSize={left:i.sizeInfo.left,width:i.sizeInfo.width},e.on(ro,(function(){e.ispotsInit?e.updateDuration():e.initDots()})),e.on(Ro,(function(){e.positionDots()}))}(this),this.on(ro,(function(){e.show()})),this.config.disable&&this.disable(),this.extTextRoot=this.find(".xg-spot-ext-text")}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(i){t.config[i]=e[i]}))}},{key:"onPluginsReady",value:function(){this.player.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,t=this.player.plugins.progress;if(t&&(Object.keys(JL).map((function(i){e[JL[i]]=e[JL[i]].bind(e),t.addCallBack(i,e[JL[i]])})),"mobile"!==Kr.device)){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var i=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(n){n.stopPropagation(),i(parseInt(1e3*e._state.now,10)/1e3,n),t&&t.onMouseUp(n)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragStart",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!0,this.videoPreview&&Ur.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&Ur.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){this.config.disable||Ur.hasClass(t.target,"xgplayer-spot")&&(t.stopPropagation(),t.preventDefault(),["time","id","text"].map((function(i){e[i]=t.target.getAttribute("data-".concat(i))})),e.time&&(e.time=Number(e.time)),this.handlerSpotClick(t,e))}},{key:"updateLinePos",value:function(e,t){var i=this.root,n=this.previewLine,r=this.player,o=this.config,a="flex"===r.controls.mode,s=i.getBoundingClientRect().width;if(s||!this._hasThumnail){var l,c=e-(s=this._hasThumnail&&s<o.width?o.width:s)/2;c<0&&!a?(c=0,l=e-s/2):c>t-s&&!a?(l=c-(t-s),c=t-s):l=0,void 0!==l&&(n.style.transform="translateX(".concat(l.toFixed(2),"px)")),i.style.transform="translateX(".concat(c.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var t=this.timeText,i=this.timePoint;t.innerHTML=e,!this.thumbnail&&(i.innerHTML=e)}},{key:"updatePosition",value:function(e,t,i,n){var r=this.root,o=this.config,a=this._state;if(r){a.now=i,this.transformTimeHook(i);var s=this.timeStr;n&&n.target&&Ur.hasClass(n.target,"xgplayer-spot")?(this.showTips(n.target.getAttribute("data-text"),!1,s),this.focusDot(n.target),a.f=!0,o.isFocusDots&&a.f&&(a.now=parseInt(n.target.getAttribute("data-time"),10))):o.defaultText?(a.f=!1,this.showTips(o.defaultText,!0,s)):(a.f=!1,this.hideTips("")),this.updateTimeText(s),this.updateThumbnails(a.now),this.updateLinePos(e,t)}}},{key:"setTimeContent",value:function(e){this.timeStr=e}},{key:"updateThumbnails",value:function(e){var t=this.player,i=this.videoPreview,n=this.config,r=t.plugins.thumbnail;if(r&&r.usable){this.thumbnail&&r.update(this.thumbnail,e,n.width,n.height);var o=i&&i.getBoundingClientRect();this.videothumbnail&&r.update(this.videothumbnail,e,o.width,o.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==Kr.device){var t=this.player,i=this.config,n=t.getPlugin("thumbnail");if(n&&n.setConfig(e),n&&n.usable&&i.isShowThumbnail){Ur.removeClass(this.root,"short-line no-thumbnail"),"short"===i.mode&&Ur.addClass(this.root,"short-line"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.thumbnail=n.createThumbnail(r,"progress-thumbnail"),i.isShowCoverPreview&&(this.videoPreview=Ur.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=n.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else Ur.addClass(this.root,"short-line no-thumbnail")}}},{key:"calcuPosition",value:function(e,t){var i=this.player.plugins.progress,n=this.player,r=i.root.getBoundingClientRect().width,o=n.duration/r*6;return e+t>n.duration&&(t=n.duration-e),n.duration,n.duration,{left:e/n.duration*100,width:t/n.duration*100,isMini:t<o}}},{key:"showDot",value:function(e){var t=this.findDot(e);if(t){var i=this.root.getBoundingClientRect().width,n=t.time/this.player.duration*i;this.updatePosition(n,i,t.time)}}},{key:"focusDot",value:function(e,t){e&&(t||(t=e.getAttribute("data-id")),Ur.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(Ur.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";Ur.addClass(this.root,"no-timepoint"),e&&(Ur.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(Ur.addClass(this.root,"product"),this.tipText.textContent=e):(Ur.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(i," ").concat(e)))}},{key:"hideTips",value:function(){Ur.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",Ur.removeClass(this.find(".xg-spot-content"),"show-text"),Ur.removeClass(this.root,"product")}},{key:"hide",value:function(){Ur.addClass(this.root,"hide")}},{key:"show",value:function(e){Ur.removeClass(this.root,"hide")}},{key:"enable",value:function(){var e=this.config,t=this.playerConfig;this.config.disable=!1,this.show(),!this.thumbnail&&e.isShowThumbnail&&this.registerThumbnail(t.thumbnail||{})}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){var e=this,t=this.player.plugins.progress;t&&Object.keys(JL).map((function(i){t.removeCallBack(i,e[JL[i]])})),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return"mobile"===Kr.device||"mobile"===this.playerConfig.isMobileSimulateMode?"":'<div class="xg-spot-info hide '.concat("short"===this.config.mode?"short-line":"",'">\n <div class="xg-spot-content">\n <div class="xg-spot-thumbnail">\n <span class="xg-spot-time"></span>\n </div>\n <div class="xg-spot-text"><span class="spot-inner-text"></span></div>\n </div>\n <div class="xgplayer-progress-point">00:00</div>\n <div class="xg-spot-ext-text"></div>\n <div class="xg-spot-line"></div>\n </div>')}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90}}}]),i}(),tN=function(e){_r(i,ba);var t=Cr(i);function i(e){var n;return gr(this,i),(n=t.call(this,e)).ratio=1,n.interval=null,n._preloadMark={},n}return vr(i,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([ro],(function(){var t=e.config,i=t.pic_num,n=t.interval;e.usable&&(e.interval=n>0?n:Math.round(1e3*e.player.duration/i)/1e3)}))}},{key:"setConfig",value:function(e){var t=this;if(e){var i=Object.keys(e);i.length<1||(i.forEach((function(i){t.config[i]=e[i]})),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,t=e.urls,i=e.pic_num;return t&&t.length>0&&i>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,i=e.height,n=e.pic_num,r=e.interval;this.ratio=t/i*100,this.interval=r||Math.round(this.player.duration/n),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e<this.config.urls.length?this.config.urls[e]:""}},{key:"preload",value:function(e){var t=this;if(!this._preloadMark[e]){var i=this.config.urls,n=i.length,r=[];e>0&&r.push(e-1),r.push(e),e>0&&e<n-1&&r.push(e+1),r.map((function(e){!t._preloadMark[e]&&e>=0&&e<n&&(t._preloadMark[e]=1,Ur.preloadImg(i[e],(function(){t._preloadMark[e]=2})))}))}}},{key:"getPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.config,r=n.pic_num,o=n.row,a=n.col,s=n.width,l=n.height;this.interval=Math.round(this.player.duration/r);var c=Math.ceil(e/this.interval),u=(c=c>r?r:c)<o*a?0:Math.ceil(c/(o*a))-1,h=c-u*(a*o),d=h>0?Math.ceil(h/a)-1:0,f=h>0?h-d*a-1:0,p=0,g=0;t&&i?t/i<s/l?p=(g=i)*(s/l):g=(p=t)/(s/l):i?t||(p=(g=i||l)*(s/l)):g=(p=t||s)/(s/l);var y=this.getUrlByIndex(u);return{urlIndex:u,rowIndex:d,colIndex:f,url:y,height:g,width:p,style:{backgroundImage:"url(".concat(y,")"),backgroundSize:"".concat(p*a,"px auto"),backgroundPosition:"-".concat(f*p,"px -").concat(d*g,"px"),width:"".concat(p,"px"),height:"".concat(g,"px")}}}},{key:"update",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=this.config,a=o.pic_num,s=o.urls;if(!(a<=0)&&s&&0!==s.length){var l=this.getPosition(t,i,n);this.preload(l.urlIndex),Object.keys(l.style).map((function(t){e.style[t]=l.style[t]})),Object.keys(r).map((function(t){e.style[t]=r[t]}))}}},{key:"changeConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setConfig(e)}},{key:"createThumbnail",value:function(e,t){var i=Ur.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(i),i}}],[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}]),i}();function iN(e){return e?"background:".concat(e,";"):""}var nN=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onTimeupdate",(function(){var t=e.player.ended,i=Sr(e).offsetDuration,n=e.currentTime;n=Ur.adjustTimeByDuration(n,i,t),e.update({played:n},i)})),e}return vr(i,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i}},{key:"afterCreate",value:function(){var e=this;this.root&&(this.on(to,this.onTimeupdate),this.on(uo,(function(){e.reset()})))}},{key:"reset",value:function(){this.update({played:0,cached:0},0)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;t&&this.root&&(e.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(e.cached/t*100,"%")),e.played&&(this.find("xg-mini-progress-played").style.width="".concat(e.played/t*100,"%")))}},{key:"render",value:function(){var e=this.playerConfig,t=e.commonStyle;if(e.miniprogress){var i=this.config,n=i.mode,r=i.height,o={cached:iN(t.cachedColor),played:iN(t.playedColor),progress:iN(t.progressColor),height:r>0&&2!==r?"height: ".concat(r,"px;"):""};return'<xg-mini-progress class="xg-mini-progress '.concat("show"===n?"xg-mini-progress-show":"",'" style="').concat(o.progress," ").concat(o.height,'">\n <xg-mini-progress-cache class="xg-mini-progress-cache" style="').concat(o.cached,'"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played" style="').concat(o.played,'"></xg-mini-progress-played>\n </xg-mini-progress>')}}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{mode:"auto",height:2}}}]),i}(),rN="realtime",oN="firstframe",aN="poster";var sN=null,lN=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onLoadedData",(function(t){e.player&&(e._frameCount=e.config.startFrameCount,e.stop(),e.renderOnTimeupdate(t),e.off(to,e.renderOnTimeupdate),e.on(to,e.renderOnTimeupdate))})),mr(Sr(e),"onVisibilitychange",(function(t){"visible"===document.visibilityState?e._checkIfCanStart()&&e.start():"hidden"===document.visibilityState&&e.stop()})),mr(Sr(e),"renderOnTimeupdate",(function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(to,e.renderOnTimeupdate);var i=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(0,i)}})),mr(Sr(e),"start",(function(t,i){var n=e.player.video,r=function(){try{return parseInt(window.performance.now(),10)}catch(ds){return(new Date).getTime()}}(),o=e.checkVideoIsSupport(n);o&&e.canvasCtx&&(i||(i=e.interval),e.stop(),n.videoWidth&&n.videoHeight&&(e.videoPI=n.videoHeight>0?parseInt(n.videoWidth/n.videoHeight*100,10):0,(e.config.mode===rN||r-e.preTime>=i)&&(n&&n.videoWidth&&e.update(o,e.videoPI),e.preTime=r)),e.frameId="timer"===e._loopType?Ur.setTimeout(Sr(e),e.start,i):Ur.requestAnimationFrame(e.start))})),mr(Sr(e),"stop",(function(){e.frameId&&("timer"===e._loopType?Ur.clearTimeout(Sr(e),e.frameId):Ur.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return vr(i,[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),i.isSupport||(this.config.disable=!0);var t=this.config,n=t.disable,r=t.mode,o=t.frameRate;n||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this._isLoaded=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/o,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this._loopType=this.config.mode!==rN&&this.interval>=1e3?"timer":"animation",this.once(mo,(function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())})),r!==aN&&(r!==oN&&(this.on(uo,(function(){e.stop()})),this.on($r,(function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(0,t)})),this.on(Zr,(function(){e.stop()}))),this.on(ao,this.onLoadedData),this.on(co,(function(){e._isLoaded=!1,e.stop()})),document.addEventListener("visibilitychange",this.onVisibilitychange)))}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){"root"===i&&e[i]!==t.config[i]?t.reRender(e[i]):"frameRate"===i?t.interval=parseInt(1e3/e[i],10):"disable"===i&&e[i]&&t.stop(),t.config[i]=e[i]}))}},{key:"init",value:function(e){var t=this.player,n=this.config;this.canvasFilter=i.supportCanvasFilter();try{var r=e||n.root;r||(r=n.isInnerRender&&t.innerContainer||t.root),r.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(n.index,'"><canvas>\n </canvas><xgmask></xgmask></div>')),this.root=r.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=n.filter,this.canvas.style.webkitFilter=n.filter),this.mask=this.find("xgmask"),n.addMask&&(this.mask.style.background=n.maskBg),this.canvasCtx=this.canvas.getContext("2d")}catch(ds){Nr.logError("plugin:DynamicBg",ds)}}},{key:"reRender",value:function(e){if(this.config.disable||this.root){this.stop();var t=this.root?this.root.parentElement:null;if(t!==e&&t.removeChild(this.root),e){this.init(e),this.renderOnce();var i=this.config.startInterval;this._checkIfCanStart()&&this.start(0,i)}else this.root=null}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var t=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(t&&("safari"!==Kr.browser||!Ur.isMSE(t)))return t;var i=t?t.tagName.toLowerCase():"";return"canvas"===i||"img"===i?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===Ur.typeOf(e)?e:"String"===Ur.typeOf(e.poster)?e.poster:null;this.updateImg(t)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&!this.player.paused&&e!==oN&&e!==aN}},{key:"renderOnce",value:function(){var e=this.player.video;if(e.videoWidth&&e.videoHeight){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var t=this.checkVideoIsSupport(e);t&&this.update(t,this.videoPI)}}},{key:"updateImg",value:function(e){var t=this;if(e){var i=this.canvas.getBoundingClientRect(),n=i.width,r=i.height,o=new window.Image;o.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=r,t.canvas.width=n;var e=parseInt(n/r*100,10);t.update(o,e),o=null}},o.src=e}}},{key:"update",value:function(e,t){if(this.canvas&&this.canvasCtx&&t)try{var i=this._pos,n=this.config,r=this.canvas.getBoundingClientRect(),o=r.width,a=r.height;if(o!==i.width||a!==i.height||i.pi!==t){var s=parseInt(o/a*100,10);i.pi=t,i.width!==o&&(i.width=this.canvas.width=o),i.height!==a&&(i.height=this.canvas.height=a);var l=a,c=o;s<t?c=parseInt(a*t/100,10):s>t&&(l=parseInt(100*o/t,10)),i.rwidth=c*n.multiple,i.rheight=l*n.multiple,i.x=(o-i.rwidth)/2,i.y=(a-i.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=n.filter),this.canvasCtx.drawImage(e,i.x,i.y,i.rwidth,i.rheight)}catch(ds){Nr.logError("plugin:DynamicBg",ds)}}},{key:"destroy",value:function(){this.stop(),document.removeEventListener("visibilitychange",this.onVisibilitychange),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,index:-1,mode:"framerate",frameRate:10,filter:"blur(50px)",startFrameCount:2,startInterval:0,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof sN?sN:sN=function(){try{return!!document.createElement("canvas").getContext}catch(ds){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===Kr.browser||"firefox"===Kr.browser)}}]),i}(),cN="info",uN=Ko,hN=function(e){_r(i,ua);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"_recordUserActions",(function(t){var i=e._getTime(),n=Object.assign({},t,{msg:t.msg||t.action});e._stats[cN].push(fr(fr({type:"userAction"},i),{},{payload:n}))})),mr(Sr(e),"_onReset",(function(){e.reset()})),mr(Sr(e),"_recordInfo",(function(t){e.info(t)})),mr(Sr(e),"_downloadStats",(function(){var t=e.getStats(),i=new Blob([JSON.stringify(t)],{type:"application/json"}),n=window.URL.createObjectURL(i),r=document.createElement("a");r.style.display="none",r.href=n,r.download="player.txt",r.disabled=!1,r.click()})),e}return vr(i,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(Bo,this._recordUserActions),this.on(uN.STATS_INFO,this._recordInfo),this.on(uN.STATS_DOWNLOAD,this._downloadStats),this.on(uN.STATS_RESET,this._onReset)}},{key:"destroy",value:function(){this.offAll()}},{key:"downloadStats",value:function(){this._downloadStats()}},{key:"info",value:function(e){e.profile?this._infoProfile(e):this._info(e)}},{key:"_info",value:function(e){var t=this._getTime();this._stats[cN].push(fr(fr({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=fr({cat:"function",dur:Date.now()-e.startMs,name:e.name||e.msg,ph:"X",pid:0,tid:0,ts:e.startMs,profile:!0},e);this._info(t)}else console.warn("infoProfile need object data, include startMs")}},{key:"reset",value:function(){var e;this._stats=(mr(e={},cN,[]),mr(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player.media,t=[],i=0;i<e.buffered.length;i++)t.push({start:e.buffered.start(i),end:e.buffered.end(i)});var n={currentTime:e.currentTime,readyState:e.readyState,buffered:t,paused:e.paused,ended:e.ended};return this._stats.media=n,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){return this._stats[cN].map((function(e){var t=e.payload.data,i="";try{t instanceof Error?i=t.msg:void 0!==t&&(i=JSON.stringify(t))}catch(dF){console.log("err",dF)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(i," ")}))}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats[cN].forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),i}(),dN=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=Sr(e),n=t.player,r=t.config;if(n.media.readyState!==HTMLMediaElement.HAVE_NOTHING){if(n.media.seeking){if(!e.seekingEventReceived)return}else e.seekingEventReceived=!1;if(!n.media.paused||0===n.media.currentTime||!e.hasPlayed){var o=n.media.buffered,a=r.smallGapLimit||.5,s=r.gapDetectionThreshold||.3,l=n.media.currentTime,c=e._getIndex(o,l,s);if(null!==c&&0!==c){console.log("GapJump bufferRange ",o.start(c),o.end(c));var u=o.start(c)+.1;if(!(u>n.media.duration)){var h=u-l,d=h<=a;h<i.BROWSER_GAP_TOLERANCE||d&&(!1!==r.useGapJump&&(n.media.currentTime=e.isSafari?u+.1:u),e.player&&e.player.emit("detectGap"),console.log("gapJump gapIndex",c," isGapSamll:",d," currentTime:",n.media.currentTime," jumpSize:",l-n.media.currentTime),.08!==u&&n&&n.emit("log",{type:"oneevent",end_type:"gap",vid:n.config.vid,ext:{video_postion:Math.floor(1e3*u)}}))}}}}})),e}return vr(i,[{key:"afterCreate",value:function(){var e=this;!1!==this.config.useGapJump&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(io,this.onGapJump),this.on($r,(function(){e.hasPlayed=!0})),this.on(Jr,(function(){e.seekingEventReceived=!0})))}},{key:"_getIndex",value:function(e,t,i){if(!e||!e.length)return null;if(1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var n=this._getBuffered(e),r=null,o=0;o<n.length;o++){if(n[o].start>t&&(0===o||n[o-1].end-t<=i)){r=o;break}}return r}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),i}();dN.BROWSER_GAP_TOLERANCE=.001;var fN=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=Sr(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),mr(Sr(e),"onJump",(function(){var t=Sr(e),i=t.player,n=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>n.jumpCntMax||!1===n.useWaitingTimeoutJump||i.media.paused&&0!==i.media.currentTime&&e.hasPlayed)){e.jumpSize=n.jumpSize*(e.jumpCnt+1),e.jumpCnt===n.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var r=i.currentTime+e.jumpSize;r>i.media.duration||(e.jumpCnt++,i.currentTime=r)}})),e}return vr(i,[{key:"afterCreate",value:function(){var e=this,t=this.config,i=t.useWaitingTimeoutJump,n=t.jumpSize;!1!==i&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=n,this.on(io,this.onWaiting),this.on([Xr,no],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on($r,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),i}(),pN="cdn",gN=["cdn"],yN=function(e){_r(i,ba);var t=Cr(i);function i(){var e;gr(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return mr(Sr(e=t.call.apply(t,[this].concat(r))),"getSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pN;if(!e.speedListCache||!e.speedListCache[t])return 0;if(e.speedListCache[t].length<=0)return 0;var i=0;return e.speedListCache[t].map((function(e){i+=e})),Math.floor(i/e.speedListCache[t].length)})),mr(Sr(e),"startTimer",(function(){Ur.isMSE(e.player.video)||(e.initSpeedList(),e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),mr(Sr(e),"initSpeedList",(function(){e.speedListCache={},gN.forEach((function(t){e.speedListCache[t]=[]}))})),mr(Sr(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.type||pN)})),mr(Sr(e),"testSpeed",(function(){if(clearTimeout(e.timer),e.timer=null,e.player&&e.config.openSpeed){var t=e.config,i=t.url,n=t.loadSize,r=t.testCnt,o=t.testTimeStep,a=i+(i.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(e.cnt>=r)){e.cnt++;try{var s=(new Date).getTime(),l=null,c=new XMLHttpRequest;e.xhr=c,c.open("GET",a);var u={},h=Math.floor(10*Math.random());u.Range="bytes="+h+"-"+(n+h),u&&Object.keys(u).forEach((function(e){c.setRequestHeader(e,u[e])})),c.onreadystatechange=function(){if(4===c.readyState){e.xhr=null,l=(new Date).getTime();var t=c.getResponseHeader("Content-Length")/1024*8,i=Math.round(1e3*t/(l-s));e.appendList(i),e.timer=setTimeout(e.testSpeed,o)}},c.send()}catch(ds){console.error(ds)}}}})),mr(Sr(e),"appendList",(function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pN;if(e.speedListCache&&e.speedListCache[i]){var n=e.config.saveSpeedMax;e.speedListCache[i].length>=n&&e.speedListCache[i].shift(),e.speedListCache[i].push(t);var r=Sr(e).player;r&&(i===pN?r.realTimeSpeed=t:r[e.getSpeedName("realTime",i)]=t),e.updateSpeed(i)}})),mr(Sr(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pN,i=e.getSpeed(t),n=Sr(e).player;if(n)if(t===pN)n.avgSpeed&&i===n.avgSpeed||(n.avgSpeed=i,n.emit(So,{speed:i,realTimeSpeed:n.realTimeSpeed}));else{var r=e.getSpeedName("avg",t);n[r]&&i===n[r]||(n[r]=i,n.emit(So,{speed:i,realTimeSpeed:n.realTimeSpeed}))}})),e}return vr(i,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,i=e.addSpeedTypeList;(null==i?void 0:i.length)>0&&gN.push.apply(gN,Ir(i)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,t&&this.on([ao,_o],this.startTimer)}},{key:"getSpeedName",value:function(e,t){return e+"Speed"+t.toUpperCase()}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer)return clearTimeout(this.timer),void(this.timer=null);if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){var e=this;this.off("real_time_speed",this._onRealSpeedChange),this.off([ao,_o],this.startTimer),gN.forEach((function(t){e.speedListCache&&e.speedListCache[t]&&(e.speedListCache[t]=[])})),this.speedListCache&&(this.speedListCache={}),clearTimeout(this.timer),this.timer=null,this.xhr&&4!==this.xhr.readyState&&(this.xhr.cancel&&this.xhr.cancel(),this.xhr=null)}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:204800,testTimeStep:3e3,url:"",saveSpeedMax:5,addSpeedTypeList:[]}}}]),i}(),vN=function(e){_r(i,ba);var t=Cr(i);function i(){return gr(this,i),t.apply(this,arguments)}return vr(i,[{key:"afterCreate",value:function(){var e=this,t=this.player,i=this.config,n=t.media||t.video;(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],i.disabled)||n.getVideoPlaybackQuality&&(this.on($r,(function(){e._startTick()})),this.on(Zr,(function(){e._stopTick()})),this.on(qr,(function(){e._stopTick()})),this.on(uo,(function(){e._stopTick()})))}},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._timer=setTimeout((function(){e._checkDecodeFPS(),e._startTick()}),this.config.tick)}},{key:"_stopTick",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"_checkBuffer",value:function(e,t){for(var i=!1,n=[],r=0;r<t.length;r++){var o=t.start(r),a=t.end(r);if(n.push({start:o,end:a}),o<=e&&e<=a-1){i=!0;break}}return{enoughBuffer:i,buffers:n}}},{key:"_checkStuck",value:function(e,t,i,n){var r=this.player.media||this.player.video,o=document.hidden,a=r.paused,s=r.readyState,l=r.currentTime,c=r.buffered;if(!(o||a||s<4)){var u=this._checkBuffer(l,c),h=u.enoughBuffer,d=u.buffers;h&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:l,buffers:d,curDecodedFrames:e,totalVideoFrames:t,droppedVideoFrames:i,checkInterval:n}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(Go,this._payload),this._reset())):this._reset())}}},{key:"_reset",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_checkDecodeFPS",value:function(){var e=this.player.media||this.player.video;if(e){var t=e.getVideoPlaybackQuality(),i=t.totalVideoFrames,n=t.droppedVideoFrames,r=performance.now();if(i&&this._lastCheckPoint){var o=i-this._lastDecodedFrames,a=r-this._lastCheckPoint;this._checkStuck(o,i,n,a)}this._lastDecodedFrames=i,this._lastCheckPoint=r}}},{key:"destroy",value:function(){this._stopTick()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),i}();const mN=class extends ba{static get pluginName(){return"poster"}static get defaultConfig(){return{isEndedShow:!0,hideCanplay:!1,notHidden:!1,poster:"",fillMode:"fixWidth"}}set isEndedShow(e){this.config.isEndedShow=e}get isEndedShow(){return this.config.isEndedShow}hide(){Ur.addClass(this.root,"hide")}show(){return Ur.removeClass(this.root,"hide"),""}beforeCreate(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}afterCreate(){this.on(qr,(()=>{this.isEndedShow&&Ur.removeClass(this.root,"hide")})),this.config.hideCanplay?(this.once(to,(()=>{this.onTimeUpdate()})),this.on(To,(()=>{Ur.removeClass(this.root,"hide"),Ur.addClass(this.root,"xg-showplay"),this.once(to,(()=>{this.onTimeUpdate()}))}))):this.on($r,(()=>{Ur.addClass(this.root,"hide")}))}onTimeUpdate(){this.player.currentTime?Ur.removeClass(this.root,"xg-showplay"):this.once(to,(()=>{this.onTimeUpdate()}))}update(e){e&&(this.config.poster=e,this.root.style.backgroundImage=`url(${e})`)}setConfig(e){"string"==typeof e?this.config.poster=e:"object"==typeof e&&Object.keys(this.config).forEach((t=>{Object.keys(e).includes(t)&&(this.config[t]=e[t])})),this.update(this.config.poster)}getBgSize(e){let t="";switch(e){case"cover":t="cover";break;case"contain":t="contain";break;case"fixHeight":t="auto 100%";break;case"fixWidth":t="100% auto";break;default:t=""}return t?`background-size: ${t};`:""}render(){const{poster:e,hideCanplay:t,fillMode:i,notHidden:n}=this.config,r=this.getBgSize(i);return`<xg-poster class="xgplayer-poster ${n?"xg-not-hidden":t?"xg-showplay":""} ${e?"active":""}" style="${e?`background-image:url(${e});${r}`:r}">\n </xg-poster>`}};La.use({LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}});class _N{constructor(e,t){const i=t&&"mobile"===t.isMobileSimulateMode,{isLive:n}=t,r=[...n?[]:[bL,pL,nN,eN,SL],yL,TL,wL,UL,KL,GL,jL,VL,PL,NL],o=[EO,mN,kO,uL,IO,$L,XL,tN,FO];this.plugins=[hN,mO,...r,...o,dN,fN];const a=i?"mobile":Kr.device;switch(a){case"pc":this.plugins.push(lL,VO,zL,yN,vN);break;case"mobile":this.plugins.push(oL);break;default:this.plugins.push(lL,VO,zL)}(Kr.os.isIpad||"pc"===a)&&this.plugins.push(lN),this.ignores=[],this.i18n=[]}}function EN(e,t){return d(this,arguments,(function*({isLive:e=!1,streamType:t,isMobile:i=!1,getSoftOptionTask:n,playerData:r},o){const a=[_N,TN()],{openSoftDecoding:s,isMusic:l}=r,c=[],u=[];if(i?a.push(function({isLive:e,playerData:t}){const i=["error","playbackRate"],n=t.configs,r=$s(n,"EncryptHlsPlugin");(null==r?void 0:r.playAuthToken)||i.push("definition");const o=[fR];return class{constructor(){this.plugins=o,this.ignores=[...i]}}}({isLive:e,playerData:o.playerData})):a.push(function({isLive:e,playerData:t}){const i=["cssfullscreen"],n=[eR],r=t.configs,o=$s(r,"EncryptHlsPlugin");(null==o?void 0:o.playAuthToken)||(i.push("definition"),n.push(YA));return class{constructor(){this.plugins=n,this.ignores=[...i]}}}({isLive:e,playerData:o.playerData})),"flv"===t)u.push((()=>d(this,null,(function*(){if(i){if(Qs()||Js()||s){const e=yield o.sdkUmdLoader.loadPlugins(Hw.FLV);c.push(e)}}else{const e=yield o.sdkUmdLoader.loadPlugins(Hw.FLV);c.push(e)}})))());$s(o.playerData.options,"Subtitle")&&o.playerData.plugins.every((e=>"subtitle"!==e.pluginName.toLowerCase()))&&c.push(lO);const[h,f]=yield Promise.all([n(),SN({playerData:o.playerData},o),...u]);return{presets:a,softDecodingOption:h,plugins:[...c,...f].filter(Boolean)}}))}function TN(e){const t=[LR,cO,uR];return class{constructor(){this.plugins=t,this.ignores=["error"]}}}function SN(e,t){return d(this,arguments,(function*({playerData:e},t){var i,n,r;const o=[];e.options,e.drmType,or.DRM_ENCRYPT;const a=(yield null==(r=null==(n=null==(i=t.playerData)?void 0:i.adapter)?void 0:n.getPlugins)?void 0:r.call(n,t.sdkUmdLoader))||[];return o.push(...a),Boolean(Rw()||Fs())&&o.push(Mw),e.enableMenu&&o.push(hR),o}))}function bN(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="0" height="0"/>\n',"image/svg+xml").firstChild}function CN(){return(new DOMParser).parseFromString('<svg width="72" height="72" viewBox="0 0 72 72" xmlns="http://www.w3.org/2000/svg"><g fill="#FFF" fill-rule="evenodd"><circle fill-opacity=".3" cx="36" cy="36" r="36"/><path d="M40.167 32.667a.833.833 0 01-.834-.834v-1.666c0-.46.373-.834.834-.834h5.409a11.653 11.653 0 00-9.576-5c-6.443 0-11.667 5.224-11.667 11.667S29.557 47.667 36 47.667c5.285 0 9.749-3.514 11.183-8.333h3.445C49.112 46.014 43.138 51 36 51c-8.284 0-15-6.716-15-15 0-8.284 6.716-15 15-15 4.713 0 8.918 2.173 11.668 5.572l-.001-4.739c0-.46.373-.833.833-.833h1.667c.46 0 .833.373.833.833V31c0 .879-.68 1.598-1.542 1.662l-.125.005h-9.166z"/></g></svg>',"image/svg+xml").firstChild}function kN(){return(new DOMParser).parseFromString('<svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="60" height="60" rx="30" fill="#000" fill-opacity=".4"/><path d="M40.243 28.3a2 2 0 010 3.401L24.06 41.712c-1.332.825-3.052-.134-3.052-1.7V19.988c0-1.566 1.72-2.525 3.052-1.7l16.184 10.01z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function IN(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.867 2.5h.55c.44 0 .799.34.83.771l.003.062v13.334c0 .44-.34.799-.771.83l-.062.003h-.55a.833.833 0 01-.444-.128l-.064-.045-4.867-3.744a.831.831 0 01-.322-.59l-.003-.07V7.077c0-.235.099-.458.271-.615l.054-.045L9.36 2.673a.832.832 0 01.43-.17l.078-.003h.55-.55zm6.767 2.278A7.474 7.474 0 0118.75 10a7.477 7.477 0 01-2.128 5.234.4.4 0 01-.57-.004l-.587-.586a.442.442 0 01.005-.617A5.812 5.812 0 0017.083 10c0-1.557-.61-2.97-1.603-4.017a.442.442 0 01-.003-.615l.586-.586a.4.4 0 01.57-.004zM2.5 6.667c.23 0 .417.186.417.416v5.834c0 .23-.187.416-.417.416h-.833a.417.417 0 01-.417-.416V7.083c0-.23.187-.416.417-.416H2.5zm11.768.46A4.153 4.153 0 0115.417 10c0 1.12-.442 2.137-1.162 2.886a.388.388 0 01-.555-.007l-.577-.578c-.176-.176-.156-.467.009-.655A2.49 2.49 0 0013.75 10a2.49 2.49 0 00-.61-1.636c-.163-.188-.182-.477-.006-.653l.578-.578a.388.388 0 01.556-.006z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function PN(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.045 2.5h.55c.44 0 .8.34.831.771l.003.062v13.334c0 .44-.34.799-.771.83l-.063.003h-.55a.833.833 0 01-.443-.128l-.065-.045-4.866-3.744a.831.831 0 01-.323-.59l-.003-.07V7.077c0-.235.1-.458.272-.615l.054-.045 4.866-3.744a.832.832 0 01.43-.17l.078-.003h.55-.55zM2.68 6.667c.23 0 .416.186.416.416v5.834c0 .23-.186.416-.416.416h-.834a.417.417 0 01-.416-.416V7.083c0-.23.186-.416.416-.416h.834zm10.467.294a.417.417 0 01.59 0l1.767 1.768L17.27 6.96a.417.417 0 01.589 0l.59.59a.417.417 0 010 .589L16.68 9.908l1.768 1.767c.15.15.162.387.035.55l-.035.04-.589.589a.417.417 0 01-.59 0l-1.767-1.768-1.768 1.768a.417.417 0 01-.59 0l-.588-.59a.417.417 0 010-.589l1.767-1.768-1.767-1.767a.417.417 0 01-.035-.55l.035-.04.589-.589z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function DN(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.867 2.5h.55c.44 0 .799.34.83.771l.003.062v13.334c0 .44-.34.799-.771.83l-.062.003h-.55a.833.833 0 01-.444-.128l-.064-.045-4.867-3.744a.831.831 0 01-.322-.59l-.003-.07V7.077c0-.235.099-.458.271-.615l.054-.045L9.36 2.673a.832.832 0 01.43-.17l.078-.003h.55-.55zM2.5 6.667c.23 0 .417.186.417.416v5.834c0 .23-.187.416-.417.416h-.833a.417.417 0 01-.417-.416V7.083c0-.23.187-.416.417-.416H2.5zm11.768.46A4.153 4.153 0 0115.417 10c0 1.12-.442 2.137-1.162 2.886a.388.388 0 01-.555-.007l-.577-.578c-.176-.176-.156-.467.009-.655A2.49 2.49 0 0013.75 10a2.49 2.49 0 00-.61-1.636c-.163-.188-.182-.477-.006-.653l.578-.578a.388.388 0 01.556-.006z" fill="#fff"/></svg>',"image/svg+xml").firstChild}const wN=u(c({startPlay:kN,play:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.121 8.299a2 2 0 010 3.402l-7.94 4.91c-1.332.825-3.051-.133-3.051-1.7V5.09c0-1.567 1.72-2.525 3.052-1.701l7.939 4.911z" fill="#fff"/></svg>',"image/svg+xml").firstChild},pause:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="5.313" y="3.75" width="3.125" height="12.5" rx=".625" fill="#fff"/><rect x="11.563" y="3.75" width="3.125" height="12.5" rx=".625" fill="#fff"/></svg>',"image/svg+xml").firstChild},fullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.778 2h4.444v1.778H3.778v4.444H2V3.778C2 2.796 2.796 2 3.778 2zM2 11.778v4.444C2 17.204 2.796 18 3.778 18h4.444v-1.778H4.823l2.313-2.313a.9.9 0 00-1.272-1.273l-2.086 2.086v-2.944H2zm14.222 0v4.444h-4.444V18h4.444c.982 0 1.778-.796 1.778-1.778v-4.444h-1.778zM18 8.222V3.778C18 2.796 17.204 2 16.222 2h-4.444v1.778h2.945l-2.587 2.586a.9.9 0 101.273 1.273l2.813-2.813v3.398H18z" fill="#fff"/></svg>',"image/svg+xml").firstChild},exitFullscreen:function(){return(new DOMParser).parseFromString('<svg width="21" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.892 2h4.445v1.778H3.892v4.444H2.114V3.778C2.114 2.796 2.91 2 3.892 2zm4.445 16v-4.444c0-.982-.796-1.778-1.778-1.778H2.114v1.778h2.944L2.264 16.35a.9.9 0 001.272 1.273l2.988-2.987a.918.918 0 00.035-.037V18h1.778zm8-6.222v4.444h-4.445V18h4.445c.981 0 1.777-.796 1.777-1.778v-4.444h-1.777zM11.892 2v4.445c0 .981.796 1.777 1.778 1.777h4.444V6.445H15.17l2.568-2.568a.9.9 0 10-1.273-1.273L13.67 5.4V2h-1.778z" fill="#fff"/></svg>',"image/svg+xml").firstChild},playNext:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.03 8.312a2 2 0 010 3.376l-7.642 4.858c-1.332.847-3.073-.11-3.073-1.687V5.14c0-1.577 1.741-2.534 3.073-1.687l7.642 4.858z" fill="#fff"/><path d="M13 3.5a.5.5 0 01.5-.5h1a.5.5 0 01.5.5v13a.5.5 0 01-.5.5h-1a.5.5 0 01-.5-.5v-13z" fill="#fff"/></svg>',"image/svg+xml").firstChild},replay:CN,refresh:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 2.488a7.48 7.48 0 00-4.154 1.253.908.908 0 101.005 1.512 5.695 5.695 0 018.844 4.746h-.908a.33.33 0 00-.264.528l1.816 2.422a.33.33 0 00.529 0l1.815-2.422A.33.33 0 0018.42 10h-.908A7.511 7.511 0 0010 2.49zM2.489 10a7.511 7.511 0 0011.665 6.26.908.908 0 00-1.005-1.513A5.695 5.695 0 014.305 10h.908a.33.33 0 00.264-.528L3.66 7.05a.33.33 0 00-.528 0L1.317 9.47a.33.33 0 00.264.53h.908z" fill="#fff"/></svg>',"image/svg+xml").firstChild}},{}),{volumeLarge:IN,volumeMuted:PN,volumeSmall:DN}),AN={whitelist:[""],widescreen:!0,width:"100%",height:"100%",lang:Xs(),fitVideoSize:!1,inactive:2e3,playsinline:!0,keyShortcut:"off",closeVideoClick:!0,closeVideoDblclick:!0,closePlayerBlur:!1,closeControlsBlur:!1,closePlayVideoFocus:!0,leavePlayerTime:0,mini:!1,pip:{position:"controlsRight",index:2.5,showIcon:!0},volume:{index:2.6},miniscreen:{left:window.innerWidth-360,top:window.innerHeight-450},time:{index:3},icons:c({},wN),flv:{retryCount:0,preferMMS:!0,preferMMSStreaming:!0},hls:{retryCount:3,allowedStreamTrackChange:!1,preferMMS:!0,preferMMSStreaming:!0},Mp4EncryptPlayer:{retryCount:3},DASHPlugin:{disableBufferBreakCheck:!1},gapJump:{smallGapLimit:1},EncryptHlsPlugin:{preferMMS:!0,preferMMSStreaming:!0}},RN={isLive:!0,closeVideoClick:!0,autoplay:!0,autoplayMuted:!0,preloadTime:8,start:{isShowPause:!1,isShowEnd:!1,mode:"hide",disableAnimate:!0},retry:{count:0}},xN={isLive:!1,closeVideoClick:!1,defaultPlaybackRate:1,closeVideoStopPropagation:!0,autoplay:!1,autoplayMuted:!1,playbackRate:[2,1.5,1.25,{rate:1,iconText:{zh:"倍速",en:"Speed",jp:"Speed"}},.75,.5],start:{isShowPause:!0,isShowEnd:!1,mode:"hide",disableAnimate:!0},progresspreview:{isShowCoverPreview:!0},progress:{isPauseMoving:!0}};const ON=u(c({startPlay:kN,play:function(){return(new DOMParser).parseFromString('<svg style="\n height: 18px;\n width: 18px;\n" width="28" height="28" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg"><path d="M19.77 11.619c1.768 1.094 1.768 3.668 0 4.762L8.653 23.257c-1.865 1.154-4.273-.188-4.273-2.381V7.125c0-2.194 2.408-3.536 4.273-2.382L19.77 11.62z" fill="#fff"/></svg>',"image/svg+xml").firstChild},pause:function(){return(new DOMParser).parseFromString('<svg style="\n height: 18px;\n width: 18px;\n" width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="7.438" y="5.25" width="4.375" height="17.5" rx=".875" fill="#fff"/><rect x="16.188" y="5.25" width="4.375" height="17.5" rx=".875" fill="#fff"/></svg>',"image/svg+xml").firstChild},fullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.125 3a.375.375 0 00-.375.375v.75c0 .207.168.375.375.375H15.5v3.375c0 .207.168.375.375.375h.75A.375.375 0 0017 7.875v-4.5A.375.375 0 0016.625 3h-4.5zm0 12.5a.375.375 0 00-.375.375v.75c0 .207.168.375.375.375h4.5a.375.375 0 00.375-.375v-4.5a.375.375 0 00-.375-.375h-.75a.375.375 0 00-.375.375V15.5h-3.375zM3 3.375C3 3.168 3.168 3 3.375 3h4.5c.207 0 .375.168.375.375v.75a.375.375 0 01-.375.375H4.5v3.375a.375.375 0 01-.375.375h-.75A.375.375 0 013 7.875v-4.5zM7.875 15.5H4.5v-3.375a.375.375 0 00-.375-.375h-.75a.375.375 0 00-.375.375v4.5c0 .207.168.375.375.375h4.5a.375.375 0 00.375-.375v-.75a.375.375 0 00-.375-.375z" fill="#fff"/></svg>\n',"image/svg+xml").firstChild},exitFullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M17.5 8.333h-4.167c-.92 0-1.666-.746-1.666-1.666V2.5h1.666v4.167H17.5v1.666zM2.5 6.667v1.666h4.167c.92 0 1.666-.746 1.666-1.666V2.5H6.667v4.167H2.5zM2.5 13.333h4.167V17.5h1.666v-4.167c0-.92-.746-1.666-1.666-1.666H2.5v1.666zM13.333 17.5v-4.167H17.5v-1.666h-4.167c-.92 0-1.666.746-1.666 1.666V17.5h1.666z" fill="#fff"/></svg>\n',"image/svg+xml").firstChild},playNext:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M4.77 4.124l8.358 5.07c.38.23.486.704.238 1.056a.807.807 0 01-.238.22L4.77 15.543c-.38.231-.889.132-1.137-.221a.723.723 0 01-.134-.417V4.762c0-.421.368-.762.822-.762.159 0 .316.042.449.124z" stroke="#fff" stroke-width="1.5"/><path d="M15.5 4.5A.5.5 0 0116 4h.5a.5.5 0 01.5.5v11a.5.5 0 01-.5.5H16a.5.5 0 01-.5-.5v-11z" fill="#fff"/></svg>',"image/svg+xml").firstChild},replay:CN,refresh:function(){return(new DOMParser).parseFromString('<svg width="18" height="18" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M0 0h18v18H0z"/><path d="M10.875 7.5a.375.375 0 01-.375-.375v-.75c0-.207.168-.375.375-.375h2.434a5.25 5.25 0 10.723 4.5h1.55a6.75 6.75 0 11-1.332-5.743V2.626c0-.207.168-.375.375-.375h.75c.207 0 .375.168.375.375V6.75a.75.75 0 01-.694.748L15 7.5h-4.125z" fill="#FFF"/></g></svg>',"image/svg+xml").firstChild}},{}),{volumeLarge:IN,volumeMuted:PN,volumeSmall:DN}),LN=u(c({width:"100%",height:"100%",lang:Xs(),playsinline:!0,closeVideoClick:!0,closeVideoTouch:!0,whitelist:[""],"x5-video-player-type":"h5-page","x5-video-player-fullscreen":!1,"x5-video-orientation":"landscape|portrait",enterTips:{background:"linear-gradient(90deg,#000,#49e6d3,#49e6d3,#138afc,#000)"},retainPlay:!0,start:{isShowPause:!0,isShowEnd:!0,disableAnimate:!1},fullscreen:{useCssFullscreen:!1},plugins:[],time:{mode:"pc",index:2.5},controls:{mode:"flex"}},{}),{cusPlaybackRatePlugin:{needCheck:!0,needPanel:!1},icons:c({},ON),flv:{innerDegrade:1,retryCount:0,preferMMS:!0,preferMMSStreaming:!0},hls:{innerDegrade:1,retryCount:3,allowedStreamTrackChange:!1,preferMMS:!0,preferMMSStreaming:!0},Mp4EncryptPlayer:{retryCount:3},DASHPlugin:{disableBufferBreakCheck:!1},gapJump:{smallGapLimit:1},EncryptHlsPlugin:{preferMMS:!0,preferMMSStreaming:!0}}),NN={isLive:!0,closeVideoClick:!0,autoplay:!0,autoplayMuted:!0,start:{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"},retry:{count:0},longwaiting:{duration:3e4},mobile:{gestureY:!1,gestureX:!1,disableActive:!0}},MN={isLive:!1,closeVideoClick:!1,autoplay:!1,autoplayMuted:!1,playbackRate:[2,1.5,1.25,{rate:1,iconText:"倍速",en:"speed",jp:"speed"},.75,.5],defaultPlaybackRate:1,closeVideoStopPropagation:!0,mobile:{gestureY:!1},start:{isShowPause:!0,isShowEnd:!1,disableAnimate:!1,mode:"hide"}};const{POSITIONS:UN}=ba,BN=e=>{const t="mobile"===Kr.device,{pluginName:i=`ExtendPlugin${Math.random().toString().slice(-5)}`,type:n=(t?"inner":"normal"),position:r=UN.CONTROLS_LEFT,icon:o=bN,index:a=1,hideAtFullScreen:s=!0,tips:l={jp:"custom",en:"custom",zh:"自定义","zh-hk":"自定义"}}=e;return class extends ba{static get isExtendPlugin(){return!0}static get type(){return n}static get textTips(){return l}static get pluginName(){return i}static get defaultConfig(){return{position:r,index:a}}afterCreate(){var e;this.appendChild(".xgplayer-icon",this.icons[i]),this.initEvents(),s&&(null==(e=this.player)?void 0:e.fullscreen)&&this.handleFullScreenChange()}registerIcons(){return{[i]:{icon:o,class:"xgplayer-extendicon-svg"}}}updateIcons(e){const t=this.find(".xgplayer-icon");t&&(t.innerHTML=e)}registerLanguageTexts(){return{[i]:l}}initEvents(){var e;this.handleCallback=sA(this.handleCallback.bind(this),200);const t="mobile"===Kr.device?"touchend":"click";this.bind(t,this.handleCallback),this.show(),s&&(null==(e=this.player)||e.on(Io,this.handleFullScreenChange.bind(this)))}handleFullScreenChange(){var e;const t=this.player;null==(e=this.player)||e.changePluginsIcon(i,!(null==t?void 0:t.fullscreen))}handleCallback(e){const{player:t}=this;t&&(e.preventDefault(),e.stopPropagation(),t.emit(MA.PLAYER_EXTEND_BUTTON,i))}destroy(){var e;this.unbind(["touchend","click"],this.handleCallback),s&&(null==(e=this.player)||e.off(Io,this.handleFullScreenChange.bind(this)))}render(){return`\n <xg-icon class="xgplayer-extend-icon">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="${i}">${this.langText[i]}</div>\n </xg-icon>\n `}}};class FN{constructor(e){var t,i,n;const{config:r,root:o,player:a}=e;this.config=r,this.parent=o,this.player=a;let s=null!=(t=null==r?void 0:r.mode)?t:$a.INNER;Object.values($a).includes(s)||(s=$a.INNER),this.mode=s,this.isAutoChange=null!=(i=null==r?void 0:r.isAutoChange)&&i,this.isShow=!1,this.showCancelBtn=null!=(n=null==r?void 0:r.showCancelBtn)&&n,this.initEvents(),this.renderPanel()}initEvents(){var e;this.isAutoChange&&(window.addEventListener("orientationchange",this.handleOrientationChange.bind(this)),null==(e=this.player)||e.on(Io,this.handleOrientationChange.bind(this)))}handleOrientationChange(){var e,t,i;const n=[90,-90,"90","-90"].includes(window.orientation);(null==(e=this.player)?void 0:e.fullscreen)&&n?this.changeMode($a.FULLSCREEN):this.changeMode(null!=(i=null==(t=this.config)?void 0:t.mode)?i:$a.INNER)}changeConfig(e){this.config=e}changeMode(e){this.mode=e,this.player.emit(MA.PANEL_MODE_CHANGE,{mode:e}),this.destroy(),this.renderPanel()}renderPanel(){const e=`xg-mobile-panel panel-${["normal","inner","fullscreen"][this.mode]}`;switch(this.root=Ur.createDom("div","",{},e),this.parent&&(this.parent.appendChild(this.root),this.hide()),this.bind("click",this.handleHide.bind(this)),this.mode){case $a.NORMAL:{const e=Ur.createDom("div","",{},"xg-mobile-panel-content "+(this.showCancelBtn?"xg-mobile-panel-cancel-mode":""));if(this.root.appendChild(e),this.showCancelBtn){const e="zh-cn"===this.player.lang?"zh":this.player.lang,t=Ur.createDom("div",Za[e],{},"xg-mobile-panel-cancel");this.root.appendChild(t)}this.container=e,e.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()}));break}case $a.INNER:this.container=this.root;break;case $a.FULLSCREEN:{const e=Ur.createDom("div","",{},"xg-mobile-panel-content");this.root.appendChild(e),this.container=e,e.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()}));break}}}showPanel(e,t="",i=!1){return d(this,null,(function*(){if(i&&Ur.addClass(e,"item-list-panel-content"),this.setTitle(t),this.children)return yield this.hide(),void setTimeout((()=>{this.children=e,this.container&&(this.title&&this.container.appendChild(this.title),this.container.appendChild(e)),this.show()}));this.children=e,this.container&&(this.title&&this.container.appendChild(this.title),this.container.appendChild(e)),this.show()}))}updatePanel(e){this.children&&Ur.hasClass(this.children,"item-list-panel-content")&&Ur.addClass(e,"item-list-panel-content"),this.children=e,this.container&&(this.container.innerHTML="",this.title&&this.container.appendChild(this.title),this.container.appendChild(e))}setTitle(e){e&&this.mode!==$a.INNER?this.title?this.title.innerHTML=e:this.title=this.renderTitle(e):this.title=void 0}renderTitle(e){return Ur.createDom("div",e,{},"xg-mobile-panel-title")}show(){this.isShow=!0,Ur.removeClass(this.root,"hide"),Ur.addClass(this.root,"active")}hide(){this.isShow=!1,Ur.removeClass(this.root,"active"),Ur.addClass(this.root,"hide"),this.container&&(this.container.innerHTML="")}handleHide(e){e.stopPropagation(),e.preventDefault(),this.hide()}bind(e,t,i=!1){this.root&&`on${e}`in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,i)}destroy(){var e;this.parent&&this.root&&this.parent.contains(this.root)&&(this.parent.removeChild(this.root),this.root=null),window.removeEventListener("orientationchange",this.handleOrientationChange.bind(this)),null==(e=this.player)||e.off(Io,this.handleOrientationChange.bind(this))}}function HN(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M16 3.8001H4C3.55817 3.8001 3.2 4.15827 3.2 4.6001V12.6001C3.2 13.0419 3.55817 13.4001 4 13.4001H16C16.4418 13.4001 16.8 13.0419 16.8 12.6001V4.6001C16.8 4.15827 16.4418 3.8001 16 3.8001ZM4 2.6001C2.89543 2.6001 2 3.49553 2 4.6001V12.6001C2 13.7047 2.89543 14.6001 4 14.6001H16C17.1046 14.6001 18 13.7047 18 12.6001V4.6001C18 3.49553 17.1046 2.6001 16 2.6001H4ZM5.0249 6.24509V11.6001H5.9024V9.23009H8.6174V11.6001H9.4949V6.24509H8.6174V8.48009H5.9024V6.24509H5.0249ZM10.5474 6.24509V11.6001H12.5049C13.3749 11.6001 14.0274 11.3601 14.4774 10.8801C14.9049 10.4226 15.1224 9.77009 15.1224 8.92259C15.1224 8.06759 14.9049 7.41509 14.4774 6.96509C14.0274 6.48509 13.3749 6.24509 12.5049 6.24509H10.5474ZM11.4249 6.99509H12.3399C13.0074 6.99509 13.4949 7.14509 13.8024 7.45259C14.1024 7.75259 14.2524 8.24759 14.2524 8.92259C14.2524 9.58259 14.1024 10.0701 13.8024 10.3851C13.4949 10.6926 13.0074 10.8501 12.3399 10.8501H11.4249V6.99509ZM4.15 16.1001C3.79101 16.1001 3.5 16.3911 3.5 16.7501C3.5 17.1091 3.79101 17.4001 4.15 17.4001H15.85C16.209 17.4001 16.5 17.1091 16.5 16.7501C16.5 16.3911 16.209 16.1001 15.85 16.1001H4.15Z" fill="#ffffff"/>\n</svg>',"image/svg+xml").firstChild}const{POSITIONS:jN}=ba;class VN extends(WA(ba)){constructor(e){super(u(c({},e),{clientType:"MOBILE"})),this.handleButtonChange=()=>{const e=this.renderItemList();this.renderPanel(e)}}static get pluginName(){return"DefinitionMobilePlugin"}static get textTips(){return{jp:"明快さ",en:"Definition",zh:"清晰度","zh-hk":"清晰度"}}static get defaultConfig(){return{position:jN.CONTROLS_RIGHT,index:3,showToastOnManualClick:!0,alwaysShowDefinition:!1}}afterCreate(){super.afterCreate()}refreshDefinitionList(){var e;const{current:{lineId:t}}=this.playerData,i=this.playerData.getDefinitionListByLineId(t);(null==(e=this.player.config)?void 0:e.alwaysShowDefinition)&&(this.config.alwaysShowDefinition=!0),i.length>1||this.config.alwaysShowDefinition?(this.appendChild(".xgplayer-icon",this.icons.definition),this.initEvents()):this.hide(),this.renderItemList()}registerIcons(){return{definition:{icon:HN,class:"xgplayer-definition-svg"}}}registerLanguageTexts(){return{definition:{jp:"明快さ",en:"Definition",zh:"清晰度","zh-hk":"清晰度"},definitionSelect:{jp:"クラリティセレクション",en:"Definition Choose",zh:"清晰度选择","zh-hk":"清晰度選擇"},switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}afterPlayerInit(){}initEvents(){this.unbind(["click"],this.handleButtonChange),this.bind(["click"],this.handleButtonChange)}renderItemList(){const{defaultDefinition:e,list:t}=this.getCurrentDefinitionInfo(this.player),i=Ur.createDom("div","",{},"definition-panel-content");return t.forEach((t=>{t.selected=e===t.definition,t.isDefinitionAuto=this.playerData.isAutoDefinition(t.definition);const n=this.renderItem(t);i.appendChild(n)})),this.renderList=t,i}renderItem(e){var t;const{current:{definition:i}}=this.playerData,n=Ur.createDom("div","",{},"panel-Item "+(i===e.definition?"select-in":""));let r=this.getShowText(this.i18n,e,i);if(this.showRealDefinition(e)){const e=null==(t=this.renderList)?void 0:t.find((e=>this.playerData.isDefinitionMatch(null==e?void 0:e.definition,this._autoRealDefinition))),i=this.getShowText(this.i18n,e,null==e?void 0:e.definition);r=i?`${r}(${i})`:r}return n.innerHTML=r,n.addEventListener("click",(t=>{var n;if(t.stopPropagation(),t.preventDefault(),e.definition!==this.playerData.current.definition){const r=null==(n=this.playerData.getCurrentStreams())?void 0:n[0];this.emitUserAction(t,"change_definition",{from:r,to:e}),this.config.showToastOnManualClick&&this.showToast(e,i),this.playerData.current.definition=e.definition}})),n}selectDef(e){this.selectDefinition(e)}changeDefinition(e){const t=this.renderList.find((t=>this.playerData.isDefinitionMatch(t.definition,e)));t&&this.selectDef(t)}renderPanel(e){var t,i;null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(e,this.langText.definitionSelect,!0)}updatePanel(){var e,t,i,n,r,o,a;if((null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&(null==(r=null==(n=null==(i=this.player)?void 0:i.panel)?void 0:n.title)?void 0:r.innerHTML)!==this.langText.definitionSelect)return;const s=this.renderItemList();null==(a=null==(o=this.player)?void 0:o.panel)||a.updatePanel(s)}destroy(){super.destroy(),this.unbind(["click"],this.handleButtonChange)}render(){return'\n <xg-icon class="xgplayer-mobile-definition">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}function KN(){return(new DOMParser).parseFromString('<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M12.7123 1C11.85 1 11.1173 1.55472 10.8516 2.32675L4.94973 2.32675C3.16413 2.32675 1.71662 3.77427 1.71662 5.55987C1.71662 7.34547 3.16413 8.79298 4.94973 8.79298L11.0483 8.79298L11.1134 8.79418C11.9936 8.82748 12.697 9.55166 12.697 10.44C12.697 11.3497 11.9596 12.0871 11.05 12.0871H5.01323C4.67882 11.4781 4.03143 11.0654 3.28763 11.0654C2.20111 11.0654 1.32031 11.9462 1.32031 13.0327C1.32031 14.1192 2.20111 15 3.28763 15C4.14992 15 4.88264 14.4452 5.14834 13.6732H11.05C12.8356 13.6732 14.2831 12.2256 14.2831 10.44C14.2831 8.65444 12.8356 7.20693 11.05 7.20693L4.94973 7.20693C4.04009 7.20693 3.30267 6.46951 3.30267 5.55987C3.30267 4.65022 4.04009 3.91281 4.94973 3.91281L10.9866 3.91281C11.321 4.52183 11.9685 4.93464 12.7123 4.93464C13.7988 4.93464 14.6796 4.05384 14.6796 2.96732C14.6796 1.8808 13.7988 1 12.7123 1ZM12.7123 2.18954C12.2827 2.18954 11.9345 2.53777 11.9345 2.96732C11.9345 3.39688 12.2827 3.7451 12.7123 3.7451C13.1418 3.7451 13.4901 3.39688 13.4901 2.96732C13.4901 2.53777 13.1418 2.18954 12.7123 2.18954ZM2.50986 13.0327C2.50986 12.6031 2.85808 12.2549 3.28763 12.2549C3.71719 12.2549 4.06541 12.6031 4.06541 13.0327C4.06541 13.4622 3.71719 13.8105 3.28763 13.8105C2.85808 13.8105 2.50986 13.4622 2.50986 13.0327Z" fill="#FFFFFF"/>\n</svg>',"image/svg+xml").firstChild}const{POSITIONS:GN}=ba;class WN extends ba{constructor(e){super(e),this.playerData=e.player.config.playerData,this.dataMonitoring()}static get pluginName(){return"LineMobilePlugin"}static get textTips(){return{jp:"ライン",en:"Line",zh:"线路","zh-hk":"線路"}}static get defaultConfig(){return{position:GN.CONTROLS_RIGHT,index:4}}dataMonitoring(){this.playerData&&hr.subscribeProperty(this.playerData.current,"definition",((e,t)=>{if(e!==t&&this.player){const e=this.playerData.getCurrentUrl();this.player.changeDefinition({definition:t,url:e}),this.updatePanel(),setTimeout((()=>{this.player.paused&&this.player.play()}),1e3)}}))}registerIcons(){return{line:{icon:KN,class:"xgplayer-line-svg"}}}registerLanguageTexts(){return{line:{jp:"ライン",en:"Line",zh:"线路","zh-hk":"線路"},lineSelect:{jp:"ライン選ぶ",en:"Line Choose",zh:"线路选择","zh-hk":"線路選擇"}}}afterCreate(){this.appendChild(".xgplayer-icon",this.icons.line),this.initEvents()}afterPlayerInit(){}initEvents(){this.bind(["click"],this.handleButtonChange.bind(this))}handleButtonChange(){const e=this.renderItemList();this.renderPanel(e)}renderItemList(){const e=this.playerData.getLineList(),t=Ur.createDom("div","",{},"line-panel-content");return e.forEach((e=>{const i=this.renderItem(e);t.appendChild(i)})),t}renderItem(e){const{current:{lineId:t}}=this.playerData,i=Ur.createDom("div","",{},"panel-Item "+(t===e.lineId?"select-in":""));return i.innerHTML=this.i18n[e.lineTextKey]||e.lineTextKey,i.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.player.emit(MA.LINE_CHANGE,{from:this.playerData.current.lineId,to:e.lineId}),this.playerData.current.lineId=e.lineId,this.player.emit(NA.PLAYER_REBUILD)})),i}renderPanel(e){var t,i;null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(e,this.langText.lineSelect,!0)}updatePanel(){var e;const t=this.renderItemList();null==(e=this.player)||e.panel.updatePanel(t)}destroy(){this.unbind(["click"],this.handleButtonChange.bind(this))}render(){return'\n <xg-icon class="xgplayer-mobile-line">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}function YN(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M14.6879 3.64579C14.7387 3.60575 14.7387 3.52868 14.6879 3.48864L13.3089 2.40296C13.2433 2.35132 13.147 2.39805 13.147 2.48153V4.6529C13.147 4.73639 13.2433 4.78312 13.3089 4.73147L14.6879 3.64579ZM4 2.61914H11.3001V3.91914H4C3.6134 3.91914 3.3 4.23254 3.3 4.61914V15.6191C3.3 16.0057 3.6134 16.3191 4 16.3191H16C16.3866 16.3191 16.7 16.0057 16.7 15.6191V6.75253H18V15.6191C18 16.7237 17.1046 17.6191 16 17.6191H4C2.89543 17.6191 2 16.7237 2 15.6191V4.61914C2 3.51457 2.89543 2.61914 4 2.61914ZM17.7879 3.48864C17.8388 3.52868 17.8388 3.60575 17.7879 3.64579L16.4089 4.73147C16.3433 4.78312 16.2471 4.73639 16.2471 4.6529V2.48153C16.2471 2.39805 16.3433 2.35132 16.4089 2.40296L17.7879 3.48864Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}const{POSITIONS:zN}=ba;class $N extends ba{constructor(e){super(e),this.state={currentRate:1,isSupport:!0},this.playerData=e.player.config.playerData}static get pluginName(){return"PlaybackRateMobilePlugin"}static get textTips(){return{jp:"倍速",en:"PlaybackRate",zh:"倍速","zh-hk":"倍速"}}static get defaultConfig(){return{position:zN.CONTROLS_RIGHT,index:5,list:[2,1.5,1.25,1,.75,.5],default:1}}registerIcons(){return{playbackRate:{icon:YN,class:"xgplayer-rate-svg"}}}registerLanguageTexts(){return{rate:{jp:"倍速",en:"PlaybackRate",zh:"倍速","zh-hk":"倍速"},rateSelect:{jp:"倍速選ぶ",en:"PlaybackRate",zh:"倍速选择","zh-hk":"倍速選擇"}}}afterCreate(){this.appendChild(".xgplayer-icon",this.icons.playbackRate),this.initEvents(),this.state.currentRate=this.player.playbackRate||1,this.changeIconText()}afterPlayerInit(){}initEvents(){this.bind(["click"],this.renderList.bind(this)),this.on(so,(()=>{var e,t;this.state.currentRate!==this.player.playbackRate&&(this.state.currentRate=this.player.playbackRate,(null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&this.updatePanel(),this.changeIconText())}))}renderList(){const e=this.renderItemList();this.renderPanel(e)}renderItemList(){const e=Ur.createDom("div","",{},"playbackRate-panel-content");return this.config.list.forEach((t=>{const i=this.renderItem(t);e.appendChild(i)})),e}renderItem(e){const t=A(e)?e:{textKey:e+"X",value:e},i=Ur.createDom("div","",{},"panel-Item "+(this.state.currentRate===t.value?"select-in":""));return i.innerHTML=this.i18n[t.textKey]||t.textKey,i.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault();const i={playbackRate:{from:this.player.playbackRate,to:t.value}};this.emitUserAction(e,"change_rate",{props:i}),this.state.currentRate=t.value,this.player.playbackRate=t.value,this.updatePanel(),this.changeIconText()})),i}renderPanel(e){var t,i;null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(e,this.langText.rateSelect,!0)}updatePanel(){var e;const t=this.renderItemList();null==(e=this.player)||e.panel.updatePanel(t)}changeIconText(){let e;const t=this.state.currentRate,i=t%1==0?t.toFixed(1):t+"";switch(i.length){case 1:case 2:case 3:default:e=.7;break;case 4:e=.5}const n=this.find(".icon-text");n.style.transform=`scale(${e})`,n.innerHTML=i}destroy(){this.unbind(["click"],this.renderList.bind(this))}render(){return'\n <xg-icon class="xgplayer-mobile-playBackRate">\n <div class="xgplayer-icon">\n <div class="icon-text"></div>\n </div>\n </xg-icon>\n '}}function XN(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M16.8881 11.8208C16.812 11.6153 16.5213 11.6153 16.4452 11.8208L16.0985 12.7579C15.8115 13.5334 15.2001 14.1448 14.4246 14.4318L13.4875 14.7786C13.2819 14.8546 13.2819 15.1454 13.4875 15.2214L14.4246 15.5682C15.2001 15.8551 15.8115 16.4666 16.0985 17.2421L16.4452 18.1792C16.5213 18.3847 16.812 18.3847 16.8881 18.1792L17.2348 17.2421C17.5218 16.4666 18.1332 15.8551 18.9087 15.5682L19.8458 15.2214C20.0514 15.1454 20.0514 14.8546 19.8458 14.7786L18.9087 14.4318C18.1332 14.1448 17.5218 13.5334 17.2348 12.7579L16.8881 11.8208Z" fill="white"/>\n<rect x="9.5" y="2" width="1.5" height="16" rx="0.75" fill="white"/>\n<rect x="5.75" y="5" width="1.5" height="10" rx="0.75" fill="white"/>\n<rect x="2" y="7" width="1.5" height="6" rx="0.75" fill="white"/>\n<path d="M16.5 7.75C16.5 7.33579 16.8358 7 17.25 7C17.6642 7 18 7.33579 18 7.75V9.18934C18 9.85752 17.1921 10.1921 16.7197 9.71967C16.579 9.57902 16.5 9.38825 16.5 9.18934V7.75Z" fill="white"/>\n<path d="M12.75 5.75C12.75 5.33579 13.0858 5 13.5 5C13.9142 5 14.25 5.33579 14.25 5.75V11.3229C14.25 11.4394 14.2229 11.5542 14.1708 11.6584C13.8169 12.3662 12.75 12.1144 12.75 11.3229V5.75Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}const{POSITIONS:qN}=ba;class ZN extends ba{constructor(){super(...arguments),this._nativeMode=!1,this._nativeAddTrackHandler=null,this._nativeChangeHandler=null,this._nativeRemoveTrackHandler=null,this._clickHandler=null,this._nativePanelUpdateRaf=null}static get pluginName(){return"AudioTrackMobile"}static get textTips(){return{en:"Audio",zh:"音频","zh-hk":"音頻",jp:"オーディオ"}}static get defaultConfig(){return{position:qN.CONTROLS_RIGHT,index:2.6,isShowIcon:!0,showNameSuffix:!0}}registerIcons(){return{audiotrack:{icon:XN,class:"xgplayer-audiotrack-svg"}}}afterPlayerInit(){var e;this.on("hlsAudioTracksUpdated",(e=>{this._onAudioTracksUpdated(e.audioTracks)})),this.on("hlsAudioTrackSwitched",(e=>{var t,i;(null==(i=null==(t=this.player)?void 0:t.panel)?void 0:i.isShow)&&this._updateHlsPanel(e.id)}));const t=this._getHls();(null==(e=null==t?void 0:t.audioTracks)?void 0:e.length)>1?this._onAudioTracksUpdated(t.audioTracks):t||this._initNativeAudioTracks()}destroy(){this._clickHandler&&this.unbind(["click"],this._clickHandler),null!==this._nativePanelUpdateRaf&&cancelAnimationFrame(this._nativePanelUpdateRaf),this._unbindNativeAudioTracks()}render(){return this.config.isShowIcon?'\n <xg-icon class="xgplayer-mobile-audiotrack">\n <div class="xgplayer-icon"></div>\n </xg-icon>\n ':""}_getHls(){var e,t;const i=this.player.plugins;return(null==(e=null==i?void 0:i.encrypthlsplugin)?void 0:e.hls)||(null==(t=null==i?void 0:i.hls)?void 0:t.hls)}_getNativeTrackList(){var e,t;return null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks}_onAudioTracksUpdated(e){!e||e.length<=1||this._bindClickOnce()}_renderList(){this._nativeMode?this._renderNativePanel():this._renderHlsPanel()}_getLabelOpts(){return{showNameSuffix:!1!==this.config.showNameSuffix}}_renderHlsPanel(){var e,t,i;const n=this._getHls();if(!n)return;const r=n.audioTracks;if(!(null==r?void 0:r.length))return;const o=null!=(e=n.audioTrack)?e:-1,a=r.find((e=>e.default)),s=this._getLabelOpts(),l=Ur.createDom("div","",{},"audiotrack-panel-content");r.forEach((e=>{let t=e.id===o;t||-1!==o||(null==a?void 0:a.id)!==e.id||(t=!0);const i=Ur.createDom("div","",{},"panel-Item "+(t?"select-in":""));i.innerHTML=QA(e,s),i.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this._switchHlsTrack(n,e)})),l.appendChild(i)})),null==(i=null==(t=this.player)?void 0:t.panel)||i.showPanel(l,this._panelTitle(),!0)}_updateHlsPanel(e){var t,i;const n=this._getHls();if(!n)return;const r=n.audioTracks;if(!(null==r?void 0:r.length))return;const o=this._getLabelOpts(),a=Ur.createDom("div","",{},"audiotrack-panel-content");r.forEach((t=>{const i=Ur.createDom("div","",{},"panel-Item "+(t.id===e?"select-in":""));i.innerHTML=QA(t,o),i.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault(),this._switchHlsTrack(n,t)})),a.appendChild(i)})),null==(i=null==(t=this.player)?void 0:t.panel)||i.updatePanel(a)}_switchHlsTrack(e,t){XA(e,t)}_initNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeMode=!0,this._nativeAddTrackHandler=()=>this._onNativeTracksChanged(),this._nativeChangeHandler=()=>{var e,t;(null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&null===this._nativePanelUpdateRaf&&(this._nativePanelUpdateRaf=requestAnimationFrame((()=>{var e,t;this._nativePanelUpdateRaf=null,(null==(t=null==(e=this.player)?void 0:e.panel)?void 0:t.isShow)&&this._renderNativePanel(!0)})))},this._nativeRemoveTrackHandler=()=>this._onNativeTracksChanged(),e.addEventListener("addtrack",this._nativeAddTrackHandler),e.addEventListener("change",this._nativeChangeHandler),e.addEventListener("removetrack",this._nativeRemoveTrackHandler),e.length>1&&this._onNativeTracksChanged())}_unbindNativeAudioTracks(){const e=this._getNativeTrackList();e&&(this._nativeAddTrackHandler&&e.removeEventListener("addtrack",this._nativeAddTrackHandler),this._nativeChangeHandler&&e.removeEventListener("change",this._nativeChangeHandler),this._nativeRemoveTrackHandler&&e.removeEventListener("removetrack",this._nativeRemoveTrackHandler))}_bindClickOnce(){this._clickHandler||(this.appendChild(".xgplayer-icon",this.icons.audiotrack),this._clickHandler=this._renderList.bind(this),this.bind(["click"],this._clickHandler))}_onNativeTracksChanged(){const e=this._getNativeTrackList();!e||e.length<=1||this._bindClickOnce()}_renderNativePanel(e=!1){var t;const i=this._getNativeTrackList();if(!i)return;const n=this._getLabelOpts(),r=Ur.createDom("div","",{},"audiotrack-panel-content");for(let a=0;a<i.length;a++){const e=i[a],t=JA(e,a,n),o=Ur.createDom("div","",{},"panel-Item "+(e.enabled?"select-in":""));o.innerHTML=t,o.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault();const t=this._getNativeTrackList();t&&$A(t,a)})),r.appendChild(o)}const o=null==(t=this.player)?void 0:t.panel;e?null==o||o.updatePanel(r):null==o||o.showPanel(r,this._panelTitle(),!0)}_panelTitle(){var e;return null!=(e=ZN.textTips[this.player.lang||"en"])?e:ZN.textTips.en}}class QN{constructor(e){this.__args=null,this.sdk=null,this.playerData=null,this.player=null,this._emitter=null,this.beforeCreate&&"function"==typeof this.beforeCreate&&this.beforeCreate(),this.__args=e,this.pluginName="",this.__init(e)}static defineGetterOrSetter(e,t){for(const i in t)Object.defineProperty(e,i,t[i])}static get pluginName(){return"pluginName"}beforeCreate(){}afterCreate(){}beforePlayerCreate(){}afterPlayerCreate(){}destroy(){}__init(e){QN.defineGetterOrSetter(this,{sdk:{get:()=>e.sdk,configurable:!0},player:{get:()=>e.sdk.getPlayerInstance(),configurable:!0},playerData:{get:()=>e.sdk.playerData,configurable:!0},pluginName:{get:()=>e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),configurable:!0},_emitter:{get:()=>e.sdk._emitter,configurable:!0}})}__destroy(){const e=this.sdk,t=this.pluginName;this.destroy&&"function"==typeof this.destroy&&this.destroy(),["sdk","player","playerData","pluginName","_emitter"].map((e=>{Object.defineProperty(this,e,{writable:!0})})),Object.keys(this).map((e=>{this[e]=null,delete this[e]})),Object.setPrototypeOf&&Object.setPrototypeOf(this,null),delete e._sdkPlugins[t]}}const JN=18e5,eM=1e3,tM="media_info",iM="ttdrama_media_info",nM="[mediaInfoCache]";let rM=c({},{enable:!1,expireTime:JN,cacheType:"memory",maxEntries:100});const oM=new Map,aM=new Map;function sM(e,t={}){ss.log(`${nM} ${e}`,t)}function lM(e){var t;return{vid:null==e?void 0:e.vid,playListLength:(null==(t=null==e?void 0:e.playList)?void 0:t.length)||0,hasValidPlayUrl:dM(e)}}function cM(){return c({},rM)}function uM(){const e=oM.size,t=aM.size;oM.clear(),aM.clear();const i=function(){const e=mM();if(!e)return 0;const t=[`${Ps}${tM}_`,`${Ps}${iM}_`],i=[];for(let n=0;n<e.length;n++){const r=e.key(n);r&&t.some((e=>r.startsWith(e)))&&i.push(r)}return i.forEach((t=>e.removeItem(t))),i.length}();sM("clear success",{memoryCacheCount:e,prefetchedCacheCount:t,localStorageCacheCount:i})}function hM(e){return"string"==typeof e?e.trim():""}function dM(e){var t;return!!(null==(t=null==e?void 0:e.playList)?void 0:t.some((e=>!!(null==e?void 0:e.url))))}function fM(e){let t=5381;for(let i=0;i<e.length;i++)t=33*t^e.charCodeAt(i);return(t>>>0).toString(36)}function pM(e){const t=gM(e);return t.playAuthTokenHash?fM(JSON.stringify(t)):""}function gM(e){const t=hM(e.playAuthToken);return{playAuthTokenHash:t?fM(t):"",reqParams:yM(e.reqParams),urlQueryParams:e.urlQueryParams,needThumbs:e.needThumbs,needBarrageMask:e.needBarrageMask}}function yM(e){if(!e)return;const t=c({},e);return delete t.Vid,delete t.vid,Object.keys(t).length?t:void 0}const vM={getItem:e=>oM.get(e)||null,setItem(e,t){oM.delete(e),oM.set(e,t)},removeItem(e){oM.delete(e)}};function mM(){try{return"undefined"!=typeof localStorage?localStorage:null==window?void 0:window.localStorage}catch(ds){return}}function _M(e){return e.startsWith(`${Ps}${tM}_`)||e.startsWith(`${Ps}${iM}_`)}function EM(){if("memory"===rM.cacheType)return Array.from(oM.keys()).filter(_M);const e=mM();return e?function(e){const t=[];for(let i=0;i<e.length;i++){const n=e.key(i);n&&_M(n)&&t.push(n)}return t}(e):[]}function TM(){return"memory"===rM.cacheType?vM:mM()}function SM(e){try{return JSON.parse(e)}catch(ds){return}}function bM(e){const t=hM(e.moduleName),i=hM(e.cacheKey);return t&&i?`${Ps}${t}_${i}`:""}function CM(e){const t=(e.playList||[]).map((e=>function(e){const t=Number(e);if(Number.isFinite(t)&&!(t<=0))return t>s(10,12)?t:1e3*t}(e.urlExpireTimestamp||e.MainUrlExpire||e.mainUrlExpire||e.main_url_expire))).filter((e=>!!e));if(t.length)return Math.min(...t)}function kM(e,t){const i=Date.now()+t,n=CM(e);return n?Math.min(i,n-eM):i}function IM(e){const t=hM(e.moduleName),i=hM(e.cacheKey);return t&&i?`${t}:${i}`:""}function PM(e){const t=IM(e),i=t?aM.get(t):void 0;if(i){if(!(Date.now()>=i.expireAt))return i.lastAccessedAt=Date.now(),i.mediaInfo;aM.delete(t)}}function DM(e,t){const i=IM(e);if(!i||!dM(t))return;const n=kM(t,rM.expireTime);n<=Date.now()||(aM.set(i,{mediaInfo:t,expireAt:n,lastAccessedAt:Date.now()}),function(){const e=aM.size-rM.maxEntries;e<=0||[...aM.entries()].sort((([,e],[,t])=>e.lastAccessedAt-t.lastAccessedAt)).slice(0,e).forEach((([e])=>aM.delete(e)))}())}function wM(e){return{moduleName:hM(e.moduleName),cacheKey:hM(e.cacheKey),cacheKeyInfo:e.cacheKeyInfo,cacheType:rM.cacheType}}function AM(e){const t=TM(),i=bM(e),n=wM(e);if(!t)return void sM("get skip no storage",n);if(!i)return void sM("get skip empty storage key",n);const r=t.getItem(i)||"";if(!r)return void sM("get miss empty cache",n);const o=SM(r);if(!o)return void sM("get miss parse failed",n);const a=null==o?void 0:o.mediaInfo;if(a&&o.expireAt)return Date.now()>=o.expireAt?(t.removeItem(i),void sM("get miss expired and removed",u(c({},n),{expireAt:o.expireAt,now:Date.now()}))):(sM("get hit",c(u(c({},n),{cacheKeyInfo:o.cacheKeyInfo,expireAt:o.expireAt,ttl:o.expireAt-Date.now()}),lM(a))),function(e,t,i,n){try{e.setItem(t,JSON.stringify(u(c({},i),{lastAccessedAt:Date.now()})))}catch(dF){sM("touch failed",u(c({},n),{error:dF}))}}(t,i,o,n),a);sM("get miss invalid cache payload",n)}function RM(e,t,i=JN){const n=TM(),r=bM(e),o=wM(e);if(!n)return void sM("set skip no storage",c(c({},o),lM(t)));if(!r)return void sM("set skip empty storage key",c(c({},o),lM(t)));if(!dM(t))return void sM("set skip invalid media info",c(c({},o),lM(t)));const a=kM(t,i);if(a<=Date.now())return void sM("set skip expired media info",c(u(c({},o),{expireTime:i,expireAt:a}),lM(t)));const s={createdAt:Date.now(),expireAt:a,lastAccessedAt:Date.now(),cacheKeyInfo:e.cacheKeyInfo,mediaInfo:t};try{n.setItem(r,JSON.stringify(s)),function(e){const t=EM(),i=rM.maxEntries;if(t.length<=i)return;const n=t.map((t=>{const i=SM(e.getItem(t)||"");return{key:t,lastAccessedAt:(null==i?void 0:i.lastAccessedAt)||(null==i?void 0:i.createdAt)||0}})).sort(((e,t)=>e.lastAccessedAt-t.lastAccessedAt)),r=t.length-i;n.slice(0,r).forEach((t=>e.removeItem(t.key))),sM("prune success",{removeCount:r,maxEntries:i,cacheType:rM.cacheType})}(n),sM("set success",c(u(c({},o),{cacheKeyInfo:s.cacheKeyInfo,expireTime:i,expireAt:a}),lM(t)))}catch(dF){sM("set failed",c(u(c({},o),{error:dF}),lM(t)))}}function xM(e){if(rM.enable)return function(e){return AM({moduleName:tM,cacheKey:pM(e),cacheKeyInfo:gM(e)})}(e)}function OM(e){return PM({moduleName:tM,cacheKey:pM(e),cacheKeyInfo:gM(e)})||xM(e)}function LM(e,t){rM.enable&&function(e,t,i=JN){RM({moduleName:tM,cacheKey:pM(e),cacheKeyInfo:gM(e)},t,i)}(e,t,rM.expireTime)}const NM=[["format","format"],["codec","codec"],["definition","definition"],["fileType","file_type"],["needThumbs","need_thumbs"],["needBarrageMask","need_barrage_mask"],["unionInfo","union_info"],["quality","quality"],["drmKek","drm_kek"],["jsPlayer","js_player"]];function MM(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function UM(e){if(!e)return;const t={};return NM.forEach((([i,n])=>{const r=e[i];"string"==typeof r&&(t[n]=r)})),t}function BM(e){return fM(JSON.stringify(UM(e)||{}))}function FM(e){return!0===(null==e?void 0:e.canIUseGetDramaInfoTranscodeParam)}function HM(e){switch(e){case ER.NOT_SUBMITTED:return"NOT_SUBMITTED";case ER.UNDER_REVIEW:return"UNDER_REVIEW";case ER.FAILED_REVIEW:return"FAILED_REVIEW";case ER.WITHDRAWN:return"WITHDRAWN_REVIEW";case ER.NOT_ON_SHELF:return"NOT_ON_SHELF";default:return"FAILED_GET_EPISODE_INFO"}}function jM(e,t){return void 0!==t?HM(t):(null==e?void 0:e.includes("not found"))||(null==e?void 0:e.includes("未查询"))?"NO_INFO_FOUND":(null==e?void 0:e.includes("query"))||(null==e?void 0:e.includes("查询"))?"FAILED_TO_QUERY":"FAILED_GET_EPISODE_INFO"}function VM(e,t){return e&&t?`${e}${-1===e.indexOf("?")?"?":"&"}${i=t,Object.entries(i).map((([e,t])=>Array.isArray(t)?t.map((t=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&"):`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&")}`:e;var i}function KM(e,t=10,i=0){const n=parseInt(`${e}`,t);return Number.isNaN(n)?i:n}function GM(e){var t;return hM(e.defaultDefinition||(null==(t=e.getVideoByToken)?void 0:t.defaultDefinition))}function WM(e){var t,i;const n="sg",r={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}},o={cn:{__PLAY_DOMAIN__:"https://vod.volcengineapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.volcengineapi.com"},mya:{__PLAY_DOMAIN__:"https://vod.ap-southeast-1.volcengineapi.com"}};let a={sg:{__PLAY_DOMAIN__:"https://vod.byteplusapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.byteplusapi.com"}},s=n;return"byteplus"===e&&r?(a=r,s="sg"):"volcengine"===e&&o&&(a=o,s=a[n]?n:"cn"),(null==(t=null==a?void 0:a[n])?void 0:t.__PLAY_DOMAIN__)||(null==(i=null==a?void 0:a[s])?void 0:i.__PLAY_DOMAIN__)||""}function YM(e){return hM(e.albumId||e.album_id)}function zM(e){return hM(e.episodeId||e.episode_id||e.episodeID)}function $M(e,t){const i={episodeId:zM(e)};return!MM(e,"transcodeParam")||t&&!FM(t)||(i.transcodeParam=e.transcodeParam),i}function XM(e){const t=hM(e.episodeId);return t?MM(e,"transcodeParam")?`${t}_${BM(e.transcodeParam||{})}`:t:""}function qM(e){const t={episodeId:hM(e.episodeId)};return MM(e,"transcodeParam")&&(t.transcodeParamHash=BM(e.transcodeParam||{})),t}function ZM(e){const t={moduleName:iM,cacheKey:XM(e),cacheKeyInfo:qM(e)};return PM(t)||function(e){if(rM.enable)return AM(e);sM("get skip disabled",u(c({},wM(e)),{config:cM()}))}(t)}function QM(e,t){!function(e,t){rM.enable?RM(e,t,rM.expireTime):sM("set skip disabled",c(u(c({},wM(e)),{config:cM()}),lM(t)))}({moduleName:iM,cacheKey:XM(e),cacheKeyInfo:qM(e)},t)}function JM(e){return OM(eU(e))}function eU(e){const t=e.getVideoByToken||{};return u(c({},t),{defaultDefinition:GM(e),reqParams:c({},t.reqParams||{}),urlQueryParams:t.urlQueryParams||e.urlQueryParams})}function tU(e,t){const i=eU(e);return u(c({},i),{playDomain:i.playDomain||WM(null==t?void 0:t.channel)})}function iU(e,t={}){var i,n,r;const o=(e,t,i)=>{for(const n of t)if(e&&void 0!==e[n])return e[n];return i},a=o(e,["PlayInfoList","playInfoList","play_info_list"],[]),s=o(e,["PosterUrl","posterUrl","poster_url"],""),l=o(e,["Vid","vid"],""),h=o(e,["Duration","duration"],0),d=o(e,["BarrageMaskUrl","barrageMaskUrl","barrage_mask_url"],""),f=o(e,["ThumbInfoList","thumbInfoList","thumb_info_list"],[]),p=o(e,["EnableAdaptive","enableAdaptive","enable_adaptive"],void 0),g=o(e,["AdaptiveBitrateStreamingInfo","adaptiveBitrateStreamingInfo","adaptive_bitrate_streaming_info"],void 0),y=null==t?void 0:t.urlQueryParams,{definitionMap:v,autoDemoteDefinition:m,autoDemoteDefinitionTextKey:_}=t||{},E=a.map((e=>{const t=(t,i)=>o(e,t,i),i=t(["MainPlayUrl","mainPlayUrl","main_play_url"],""),n=t(["BackupPlayUrl","backupPlayUrl","backup_play_url"],""),r=VM(i,y),a=VM(n,y),s=t(["Format","format"],"");return c(c({vid:l,url:r,_mainURL:r,_backupURL:a,streamType:s,backupUrl:a,backUrlList:[a],fileType:t(["FileType","fileType","file_type"]),format:s,bitrate:t(["Bitrate","bitrate"]),size:t(["Size","size"]),kid:t(["PlayAuthId","playAuthId","play_auth_id"]),playAuthId:t(["PlayAuthId","playAuthId","play_auth_id"]),playAuth:t(["PlayAuth","playAuth","play_auth"]),secretKey:t(["PlayAuth","playAuth","play_auth"]),vwidth:t(["Width","width"]),vheight:t(["Height","height"]),vtype:null==s?void 0:s.toLocaleUpperCase(),codec:t(["Codec","codec"]),urlExpireTimestamp:KM(t(["MainUrlExpire","mainUrlExpire","main_url_expire"]),10,qa),drmType:t(["DrmType","drmType","drm_type"])},e),Hs(e,{definitionMap:v,autoDemoteDefinition:m,autoDemoteDefinitionTextKey:_}))})).sort(bs);return{playList:E,type:(null==(i=E[0])?void 0:i.Format)||(null==(n=E[0])?void 0:n.format)||(null==(r=E[0])?void 0:r.streamType),poster:s||"",vid:l,duration:h||0,dashOpts:{Data:u(c({},e),{VideoID:l})},thumbs:f||[],barrageMaskUrl:d||"",enableAdaptive:p,adaptiveBitrateStreamingInfo:g}}function nU(e){var t;return"string"==typeof e?e:(null==(t=null==e?void 0:e[0])?void 0:t.src)||""}function rU(e,t){var i,n;const r=GM(t),o=function(e,t){const i=e.playList||[];return t&&i.find((e=>{var i;const n=e.mapDefinition||e.definition||e.Definition;return(null==(i=null==n?void 0:n.toLocaleLowerCase)?void 0:i.call(n))===t.toLocaleLowerCase()}))||i[0]}(e,r),a=nU(null==o?void 0:o.url);if(!o||!a)return;const s=o.mapDefinition||o.definition||o.Definition||r,l=o.streamType||o.format||o.Format||e.type||"",c=(o.codec||(null==(n=null==(i=o.Codec)?void 0:i.toLowerCase)?void 0:n.call(i))||tr.H264).toLowerCase();return{vid:e.vid||o.vid||t.vid||"",url:a,definition:s,streamType:l,codec:c,bitrate:KM(o.bitrate||o.Bitrate),duration:KM(o.duration||o.Duration||e.duration),size:KM(o.size||o.Size)}}let oU=!1;const aU=["url","src","_mainURL","_backupURL","backupUrl","MainPlayUrl","mainPlayUrl","main_play_url","BackupPlayUrl","backupPlayUrl","backup_play_url"];function sU(e,t){if(!e)return e;const i=e.indexOf("#"),n=-1===i?"":e.slice(i),r=-1===i?e:e.slice(0,i),o=r.indexOf("?"),a=-1===o?r:r.slice(0,o),s=-1===o?"":r.slice(o+1),l=s?s.split("&").filter((e=>{const t=e.split("=")[0];try{return"t"!==decodeURIComponent(t||"")}catch(ds){return"t"!==t}})):[];return l.push(`t=${encodeURIComponent(t)}`),`${a}?${l.join("&")}${n}`}function lU(e,t){return"string"==typeof e?sU(e,t):Array.isArray(e)?e.map((e=>"string"==typeof e?sU(e,t):e&&"object"==typeof e&&"string"==typeof e.src?u(c({},e),{src:sU(e.src,t)}):e)):e}function cU(e,t=Date.now()){if(!oU||!e)return e;const i=c({},e);return aU.forEach((e=>{i[e]&&(i[e]=lU(i[e],t))})),Array.isArray(i.backUrlList)&&(i.backUrlList=i.backUrlList.map((e=>lU(e,t)))),i}function uU(e,t=Date.now()){return oU&&e?u(c({},e),{playList:(e.playList||[]).map((e=>cU(e,t)))}):e}const hU=[{id:1,tag:"cmn-Hans-CN",label:"简体中文"},{id:2,tag:"eng-US",label:"English"},{id:3,tag:"jpn-JP",label:"日本語"},{id:4,tag:"kor-KR",label:"한국어"},{id:5,tag:"cmn-Hans-CN|eng-US",label:"中英双语"},{id:6,tag:"rus-RU",label:"Русский"},{id:7,tag:"fra-FR",label:"Français"},{id:8,tag:"por-PT",label:"Português"},{id:9,tag:"spa-ES",label:"Español"},{id:10,tag:"vie-VN",label:"Tiếng Việt"},{id:11,tag:"afr-ZA",label:"Afrikaans"},{id:12,tag:"ben-BD",label:"বাংলা"},{id:13,tag:"bul-BG",label:"Български"},{id:14,tag:"mya-MM",label:"မြန်မာဘာသာ"},{id:15,tag:"ces-CZ",label:"Čeština"},{id:16,tag:"dan-DK",label:"Dansk"},{id:17,tag:"hrv-HR",label:"Hrvatski"},{id:18,tag:"nld-NL",label:"Nederlands"},{id:19,tag:"fin-FI",label:"Suomi"},{id:20,tag:"deu-DE",label:"Deutsch"},{id:21,tag:"ell-GR",label:"Ελληνικά"},{id:22,tag:"hun-HU",label:"Magyar"},{id:23,tag:"ind-ID",label:"Bahasa Indonesia"},{id:24,tag:"gle-IE",label:"Gaeilge"},{id:25,tag:"isl-IS",label:"Íslenska"},{id:26,tag:"ita-IT",label:"Italiano"},{id:27,tag:"nor-NO",label:"Norsk"},{id:28,tag:"pol-PL",label:"Polski"},{id:29,tag:"swe-SE",label:"Svenska"},{id:30,tag:"tha-TH",label:"ภาษาไทย"},{id:31,tag:"tur-TR",label:"Türkçe"},{id:32,tag:"ukr-UA",label:"Українська"},{id:33,tag:"urd-PK",label:"اردو"},{id:34,tag:"ara-SA",label:"العربية"},{id:35,tag:"fra-CA",label:"Français (Canada)"},{id:36,tag:"cmn-Hant-CN",label:"繁體中文"},{id:37,tag:"msa-MY",label:"Bahasa Melayu"},{id:38,tag:"heb-IL",label:"עברית"},{id:39,tag:"jva-ID",label:"Basa Jawa"},{id:40,tag:"ron-RO",label:"Română"},{id:41,tag:"fil-PH",label:"Filipino"},{id:42,tag:"hin-IN",label:"हिन्दी"},{id:43,tag:"ben-IN",label:"বাংলা (ভারত)"},{id:44,tag:"khm-KH",label:"ភាសាខ្មែរ"},{id:45,tag:"bos-PH",label:"Bosanski"},{id:46,tag:"est-EE",label:"Eesti"},{id:47,tag:"lav-LV",label:"Latviešu"},{id:48,tag:"slk-SK",label:"Slovenčina"},{id:49,tag:"lit-LT",label:"Lietuvių"},{id:50,tag:"uyg-CN",label:"ئۇيغۇرچە"}],dU=new Map,fU=new Map;for(const fF of hU)dU.set(fF.id,fF.label),fU.set(fF.tag.toLowerCase(),fF.label);function pU(...e){for(const t of e){if("string"!=typeof t)continue;const e=t.trim();if(e)return e}return null}function gU(e){return{albumId:pU(null==e?void 0:e.album_id,null==e?void 0:e.albumId),episodeId:pU(null==e?void 0:e.episode_id,null==e?void 0:e.episodeId,null==e?void 0:e.episodeID)}}const yU=xR.getVeErrorInfo,vU={playAuthToken:"",needDefinitionList:!0},mU=(e,t,i,n=!1)=>{for(const r of t){const t=null==e?void 0:e[r];if(void 0!==t&&(!n||""!==t))return t}return i},_U=(e,t="")=>null==e?t:`${e}`;class EU extends QN{constructor(e){super(e),this.isPlayByToken=!1,this.isEncrypt=!1,this.config=null,this.useUnionInfoDRM=!0,this.retryCount=1,this.init()}static get pluginName(){return"AuthToken"}beforePlayerCreate(){return d(this,null,(function*(){if(this.isPlayByToken){const e=yield this.getVideoInfo();e&&this.playerData.initPlayData(e)}}))}getVideoInfo(e){return d(this,null,(function*(){var t;const i=null==(t=this.sdk)?void 0:t._createPlayerPerf,n=()=>d(this,null,(function*(){var t,n,r,o,a,s,l,c,u,h,f,p,g;try{const y=this.isMinisDramaMode&&(null==(t=null==mB?void 0:mB.ttDramaEnv)?void 0:t.canIUseGetDramaInfo);if(!y&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.checkPlayAuthTokenValid",(()=>this.checkPlayAuthTokenValid())):this.checkPlayAuthTokenValid()))return;if(!!this.keyTokenInfo&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.checkKeyTokenValid",(()=>this.checkKeyTokenValid())):this.checkKeyTokenValid()))return;if(!!this.thirdPartyDrmAuthTokenInfo&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.checkDrmAuthTokenValid",(()=>this.checkDrmAuthTokenValid())):this.checkDrmAuthTokenValid()))return;const v=((null==i?void 0:i.measureAsync)?yield i.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getVideos",(()=>d(this,null,(function*(){return yield this.getVideos(e)})))):yield this.getVideos(e))||{};if(!(null==(n=null==v?void 0:v.playList)?void 0:n.length))return void ss.error("get no media info");ss.log("getVideo res: ",v);const{type:m,poster:_,vid:E,dashOpts:T,thumbs:S,barrageMaskUrl:b}=v||{},C=v.playList||[];null==(o=null==(r=this.sdk)?void 0:r.assertLiteConfig)||o.call(r,{type:m,playList:C,rtm:v.rtm}),this.playInfo=v,this.setSubtitleConfig(v);const k=m||Ts(this.config);this.getPrivateDrmInfo&&((null==i?void 0:i.measureAsync)?yield i.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo",(()=>d(this,null,(function*(){return yield this.getPrivateDrmInfo(C,E,k)})))):yield this.getPrivateDrmInfo(C,E,k)),this.playerData.options.vid=E;if(_&&(this.config.needPoster||this.isMinisDramaMode)&&("string"==typeof this.playerData.options.poster?this.playerData.options.poster=_:"object"==typeof this.playerData.options.poster?this.playerData.options.poster.poster=_:this.playerData.options.poster=_),this.config.needThumbs&&S.length>0&&((null==i?void 0:i.measure)?i.measure("beforePlayerCreate.authtoken.getVideoInfo.getThumbnailConfig",(()=>this.getThumbnailConfig(S))):this.getThumbnailConfig(S)),C.length>0){(null==(a=C[0])?void 0:a.drmType)&&this.playerData.setDrmType(C[0].drmType);const t=(null==(l=null==(s=this.playerData)?void 0:s.adapter)?void 0:l.generatePlaylistFromServer(v,this.config.useMasterM3u8))||[...C],n=this.config.defaultDefinition||(null==e?void 0:e.defaultDefinition)||this.playerData.configs.defaultDefinition;let r=t[0];if(n){const e=t.find((e=>(e.mapDefinition||e.definition||e.Definition).toLocaleLowerCase()===n.toLocaleLowerCase()));e&&(r=e)}const o=this.config.needDefinitionList?t:[r];this.isEncrypt=!!(null==o?void 0:o[0].kid);const d=(null==(c=C[0])?void 0:c.codec)||(null==(h=null==(u=C[0])?void 0:u.Codec)?void 0:h.toLowerCase())||(null==(p=null==(f=this.tokenInfo)?void 0:f.Codec)?void 0:p.toLowerCase())||tr.H264,y={vid:E,dashOpts:T,codec:d,playList:o,defaultDefinitionData:r};return(null==i?void 0:i.measure)?(i.measure("beforePlayerCreate.authtoken.getVideoInfo.getDrmConfig",(()=>this.getDrmConfig(y))),i.measure("beforePlayerCreate.authtoken.getVideoInfo.setPluginConfigInVid",(()=>{var e;return null==(e=this.playerData.adapter)?void 0:e.setPluginConfigInVid(y,this)}))):(this.getDrmConfig(y),null==(g=this.playerData.adapter)||g.setPluginConfigInVid(y,this)),{vid:E,playList:o,codec:d,defaultDefinition:r.definition}}ss.error("get no media info")}catch(y){if(ss.error(y),"VEPLAYER_LITE_UNSUPPORTED_FEATURE"===(null==y?void 0:y.code))throw y}}));return(null==i?void 0:i.measureAsync)?yield i.measureAsync("beforePlayerCreate.authtoken.getVideoInfo",n):yield n()}))}getDramaInfoViaJSB(e){return d(this,null,(function*(){var t,i;const n=mB.ttDramaEnv,r=e||(null==(t=this.playerData)?void 0:t.configs)||{},{albumId:o,episodeId:a}=gU(r),s=r.vid||"";if((null==n?void 0:n.getDramaInfo)&&o&&a)return new Promise((e=>{const t={clientKey:n.clientKey,albumId:o,episodeId:a,vid:s};!0===n.canIUseGetDramaInfoTranscodeParam&&Object.prototype.hasOwnProperty.call(r,"transcodeParam")&&(t.transcodeParam=UM(r.transcodeParam)||{});const i=t=>{var i;ss.error("getDramaInfo error:",t);const n={errorType:"drama",errorCode:_R.FAILED_GET_EPISODE_INFO.code,veError:yU({code:_R.FAILED_GET_EPISODE_INFO.code,message:_R.FAILED_GET_EPISODE_INFO.message,textKey:_R.FAILED_GET_EPISODE_INFO.textKey}),errorMessage:_R.FAILED_GET_EPISODE_INFO.message,ext:{originError:t},originError:t};null==(i=this.sdk)||i.delayError.push(n),e(void 0)};try{n.getDramaInfo((t=>{var n,r,l,c;try{if(ss.log("getDramaInfoViaJSB res:",t),this.reportGetDramaInfoPerf(t,{albumId:o,episodeId:a,vid:s}),!(null==t?void 0:t.is_success)){ss.error("getDramaInfoViaJSB invalid response:",t);const i=jM(null==(n=null==t?void 0:t.error)?void 0:n.error_msg,void 0),o=_R[i]||_R.FAILED_GET_EPISODE_INFO,a={errorType:"drama",errorCode:o.code,veError:yU({code:o.code,message:o.message,textKey:o.textKey}),errorMessage:o.message,ext:{jsbError:null==t?void 0:t.error},originError:t};return null==(r=this.sdk)||r.delayError.push(a),void e(void 0)}const{data:i}=t;if((null==i?void 0:i.status)!==ER.SUCCESS){ss.error("getDramaInfoViaJSB invalid response:",t);const n=HM(null==i?void 0:i.status),r=_R[n]||_R.FAILED_GET_EPISODE_INFO,o={errorType:"drama",errorCode:r.code,veError:yU({code:r.code,message:r.message,textKey:r.textKey}),errorMessage:r.message,ext:{status:null==i?void 0:i.status},originError:t};return null==(l=this.sdk)||l.delayError.push(o),void e(void 0)}if(!(null==i?void 0:i.video_info)){ss.error("getDramaInfoViaJSB invalid response:",t);const n={errorType:"drama",errorCode:_R.FAILED_TO_QUERY.code,veError:yU({code:_R.FAILED_TO_QUERY.code,message:_R.FAILED_TO_QUERY.message,textKey:_R.FAILED_TO_QUERY.textKey}),errorMessage:_R.FAILED_TO_QUERY.message,ext:{status:null==i?void 0:i.status},originError:t};return null==(c=this.sdk)||c.delayError.push(n),void e(void 0)}ss.log("videoInfoRes before transformDramaVideoInfoToRes",i.video_info);const u=this.transformDramaVideoInfoToRes(i.video_info,this.config);ss.log("videoInfoRes after transformDramaVideoInfoToRes",u),e(u)}catch(u){i(u)}}),t)}catch(l){i(l)}}));{const e=_R.INVALID_PARAM;null==(i=this.sdk)||i.delayError.push({errorType:mR.network,errorCode:e.code,veError:yU({code:e.code,message:e.message,textKey:e.textKey}),errorMessage:e.message,ext:{},originError:void 0})}}))}mapReviewStatusToErrorCode(e){return HM(e)}mapDramaErrorCode(e,t){return jM(e,t)}transformDramaVideoInfoToRes(e,t){return iU(e,t)}callOnGetMediaInfo(e,t){var i,n,r;if(e)try{null==(r=null==(n=null==(i=this.playerData)?void 0:i.configs)?void 0:n.onGetMediaInfo)||r.call(n,{data:e,fromCache:t})}catch(o){ss.error("onGetMediaInfo callback error:",o)}}reportGetDramaInfoPerf(e,t){var i,n,r,o;const a=null==(i=null==e?void 0:e.data)?void 0:i.perf_info;a&&(null==(o=null==(n=this.sdk)?void 0:n.recordGetDramaInfoPerf)||o.call(n,{perfInfo:a,albumId:t.albumId,episodeId:t.episodeId,vid:t.vid,isSuccess:!!(null==e?void 0:e.is_success),status:null==(r=null==e?void 0:e.data)?void 0:r.status,fromCache:!1,timestamp:Date.now()}))}getVideos(e){return d(this,null,(function*(){var t,i,n,r,o,a;const s=null==(t=this.sdk)?void 0:t._createPlayerPerf;if(ss.log("tt drama info: ",this.isMinisDramaMode,null==mB?void 0:mB.ttDramaEnv),this.isMinisDramaMode&&(null==(i=null==mB?void 0:mB.ttDramaEnv)?void 0:i.canIUseGetDramaInfo)){const t=u(c({},e||(null==(n=this.playerData)?void 0:n.configs)||{}),{defaultDefinition:(null==e?void 0:e.defaultDefinition)||(null==(o=null==(r=this.playerData)?void 0:r.configs)?void 0:o.defaultDefinition)||(null==(a=this.config)?void 0:a.defaultDefinition),getVideoByToken:this.config}),i=ZM($M(t,mB.ttDramaEnv));if(i){const e=uU(i);return this.callOnGetMediaInfo(e,!0),e}const l=e=>{QM($M(t,mB.ttDramaEnv),e);const i=uU(e);return this.callOnGetMediaInfo(i,!1),i};if(null==s?void 0:s.measureAsync){return l(yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getVideos.getDramaInfoViaJSB",(()=>d(this,null,(function*(){return yield this.getDramaInfoViaJSB(e)})))))}return l(yield this.getDramaInfoViaJSB(e))}const l=e=>{var t,i,n;try{const i=JSON.parse(e.response);if(100006===Vn(i,"ResponseMetadata.Error.CodeN")){ss.error("playAuthToken is invalid or expired, please check or update your playAuthToken");const i={errorType:"token",errorCode:9101,veError:yU(yR.PLAY_AUTH_TOKEN_EXPIRED),errorMessage:"playAuthToken has expired",ext:{serveResponse:"string"==typeof(null==e?void 0:e.response)?null==e?void 0:e.response:"",serveStatus:null==e?void 0:e.status,playAuthToken:this.config.playAuthToken,config:this.config},originError:e};return null==(t=this.sdk)?void 0:t.delayError.push(i)}}catch(o){ss.log(o)}null==(i=this._emitter)||i.emit(MA.GET_PLAY_URL_ERR,e);const r={errorType:"token",errorCode:9100,errorMessage:"get play url error by playAuthToken, please check the playAuthToken",veError:yU(yR.GET_PLAY_INFO_ERR),ext:{serveResponse:"string"==typeof(null==e?void 0:e.response)?null==e?void 0:e.response:"",serveStatus:null==e?void 0:e.status,playAuthToken:this.config.playAuthToken},originError:e};null==(n=this.sdk)||n.delayError.push(r)},h=e=>d(this,null,(function*(){if(!this.config.playDomain&&502===(null==e?void 0:e.status)&&this.playerData.apiMap.backupPlayDomain)return this.playerData.playDomainDegrade=!0,yield ks((()=>Cs(c({playDomain:this.playerData.playDomain},this.config))),this.retryCount,(e=>502===e.status),l);l(e)})),f=()=>d(this,null,(function*(){var e,t;const i=c({playDomain:this.config.playDomain||this.playerData.playDomain},this.config),n=pM(i),r=OM(i);if(r){ss.log("[mediaInfoCache] authToken use cached media info",{cacheKey:n,vid:r.vid,playListLength:(null==(e=r.playList)?void 0:e.length)||0});const t=uU(r);return this.callOnGetMediaInfo(t,!0),t}ss.log("[mediaInfoCache] authToken request media info",{cacheKey:n,retryCount:this.retryCount,playDomain:i.playDomain});const o=yield ks((()=>Cs(i)),this.retryCount,(e=>502===e.status),h);LM(i,o);const a=uU(o);return ss.log("[mediaInfoCache] authToken request finished",{cacheKey:n,vid:null==o?void 0:o.vid,playListLength:(null==(t=null==o?void 0:o.playList)?void 0:t.length)||0,mediaInfo:o}),this.callOnGetMediaInfo(a,!1),a}));return(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getVideos.getPlayInfoByAuthToken",f):yield f()}))}getPrivateDrmInfo(e,t,i){return d(this,null,(function*(){var n,r,o,a;const s=null==(n=this.sdk)?void 0:n._createPlayerPerf;if(this.config.getDrmAuthToken&&"function"==typeof this.config.getDrmAuthToken&&this.playerData.unionId){let n;if(this.sessionId=(new Date).getTime().toString(),"hls"===i){const e=(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.loadPlugins.hlsEncrypt",(()=>d(this,null,(function*(){return yield this.sdk.sdkUmdLoader.loadPlugins(Hw.HLSEncrypt)})))):yield this.sdk.sdkUmdLoader.loadPlugins(Hw.HLSEncrypt);n=null==(r=null==e?void 0:e.updateUnionInfo)?void 0:r.call(e,this.playerData.unionId,this.sessionId)}else if("dash"===i){const e=(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.loadPlugins.dash",(()=>d(this,null,(function*(){return yield this.sdk.sdkUmdLoader.loadPlugins(Hw.DASH)})))):yield this.sdk.sdkUmdLoader.loadPlugins(Hw.DASH);n=null==(o=null==e?void 0:e.updateUnionInfo)?void 0:o.call(e,this.playerData.unionId,this.sessionId)}else if(["mp4","m4a"].includes(i)){const e=(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.loadPlugins.mp4Encrypt",(()=>d(this,null,(function*(){return yield Kw.loadMp4Encrypt(this.sdk.sdkUmdLoader)})))):yield Kw.loadMp4Encrypt(this.sdk.sdkUmdLoader);n=null==(a=null==e?void 0:e.updateUnionInfo)?void 0:a.call(e,this.playerData.unionId,this.sessionId)}if(!n)return void ss.error("updateUnionInfo fail");const c=[...new Set(e.map((e=>e.kid)))].join(",");try{const i=(null==s?void 0:s.measureAsync)?yield s.measureAsync("beforePlayerCreate.authtoken.getVideoInfo.getPrivateDrmInfo.getDrmAuthToken",(()=>d(this,null,(function*(){return yield qs(Ys(this.config.getDrmAuthToken(c,t,n)),200,"The execution time of obtaining privateDrmAuthToken by getDrmAuthToken function of options has exceeded more than 200ms")})))):yield qs(Ys(this.config.getDrmAuthToken(c,t,n)),200,"The execution time of obtaining privateDrmAuthToken by getDrmAuthToken function of options has exceeded more than 200ms");if(i&&"string"==typeof i){this.privateDrmAuthToken=i;const t=Es(i);(null==t?void 0:t.DrmType)&&(this.useUnionInfoDRM="webdevice"===(null==t?void 0:t.DrmType)),e.forEach((e=>{e.drmKeyToken=this.privateDrmAuthToken}))}}catch(l){ss.error("get privaterDrmToken fail")}}}))}getThumbnailConfig(e){const t=e[0],i=c({},this.playerData.configs.thumbnail||{});this.playerData.options.thumbnail=c({pic_num:t.CaptureNum,urls:t.StoreUrls,width:t.CellWidth,height:t.CellHeight,col:t.ImgXLen,row:t.ImgYLen},i)}getBarrageMaskUrl(e){var t,i;const n=null==(t=this.playerData.configs)?void 0:t.DanmuPlugin,r="object"==typeof n?n:{},o=c({},(null==r?void 0:r.maskConfig)||{});this.playerData.configs.DanmuPlugin?(this.playerData.options.DanmuPlugin.maskActive=null==(i=r.maskActive)||i,this.playerData.options.DanmuPlugin.maskConfig=c({maskUrl:e},o)):this.playerData.options.DanmuPlugin={active:!0,maskActive:!0,maskConfig:c({maskUrl:e},o)}}setSubtitleConfig(e){var t,i,n,r,o,a,s,l,h;if(!(null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.autoSubtitle)||!e)return;const d=this.getAutoSubtitleList(e),f=null==(n=this.playerData.options)?void 0:n.Subtitle,p=null==(r=this.playerData.configs)?void 0:r.Subtitle,g="object"==typeof f&&f?f:"object"==typeof p&&p?p:{};this.playerData.options.Subtitle=u(c({},g),{list:d}),null==(h=null==(l=null==(s=null==(a=null==(o=this.sdk)?void 0:o.player)?void 0:a.plugins)?void 0:s.subtitle)?void 0:l.updateSubtitles)||h.call(l,d)}getAutoSubtitleList(e){const t=this.getSubtitleSourceData(e),i=mU(t,["SubtitleInfoList","subtitleInfoList","subtitle_info_list"],[]);if(!Array.isArray(i))return[];const n=i.map(((e,t)=>this.getAutoSubtitleItem(e,t))).filter((e=>Boolean(e)));return n.some((e=>void 0!==e._subtitleOrder))&&n.sort(((e,t)=>{var i,n;return(null!=(i=e._subtitleOrder)?i:1/0)-(null!=(n=t._subtitleOrder)?n:1/0)})),n.forEach((e=>{delete e._subtitleOrder})),n}getSubtitleSourceData(e){const t=null==e?void 0:e.dashOpts;return(null==t?void 0:t.Data)||(null==t?void 0:t.data)||e}getAutoSubtitleItem(e,t){const i="string"==typeof e?this.getStringAutoSubtitleItem(e,t):this.getObjectAutoSubtitleItem(e,t);if(i)return this.formatAutoSubtitleItem(i,e,t)}getStringAutoSubtitleItem(e,t){const i=`${t+1}`;return c({id:`${t}`,language:`${t}`,label:i,text:i},!/\n/.test(n=e)&&(/^(https?:)?\/\//.test(n)||/^data:/.test(n)||/\.(vtt|srt)([?#].*)?$/i.test(n))?{url:e}:{stringContent:e});var n}getObjectAutoSubtitleItem(e,t){if(!e||"object"!=typeof e)return;const i=mU(e,["SubtitleUrl","subtitleUrl","subtitle_url","url","src"],"",!0),n=mU(e,["StringContent","stringContent","string_content"],"",!0),r=mU(e,["List","list"]);if(!i&&!n&&!r)return;const o=function(e,t){const i="string"==typeof e?parseInt(e,10):e;if("number"==typeof i&&!isNaN(i)){const e=dU.get(i);if(e)return e}if(t){const e=fU.get(t.toLowerCase());if(e)return e}}(mU(e,["LanguageId","languageId","language_id"],void 0,!0),mU(e,["Language","language"],"",!0)),a=o||_U(mU(e,["Title","title","label","text","Language","language","Tag","tag","LanguageId","languageId","language_id"],`${t+1}`,!0),`${t+1}`),s=_U(mU(e,["SubtitleId","subtitleId","subtitle_id","FileId","fileId","file_id","id"],`${t}`,!0),`${t}`),l=_U(mU(e,["Language","language","LanguageId","languageId","language_id","srclang"],`${t}`,!0),`${t}`);return c(c(c(u(c({},e),{id:s,language:l,label:a,text:a}),i?{url:i}:{}),n?{stringContent:n}:{}),r?{list:r}:{})}formatAutoSubtitleItem(e,t,i){var n,r;const o=null==(r=null==(n=this.playerData)?void 0:n.configs)?void 0:r.formatAutoSubtitleItem;if("function"!=typeof o)return e;const a=o(t,i);if(!1!==a&&null!==a){if(!0===a||void 0===a)return e;if("string"==typeof a||"number"==typeof a){const t=`${a}`;return u(c({},e),{label:t,text:t})}if("object"==typeof a){if(!1===a.show||!1===a.visible)return;const t=Object.prototype.hasOwnProperty.call(a,"order"),i=Object.prototype.hasOwnProperty.call(a,"label")||Object.prototype.hasOwnProperty.call(a,"text")?(()=>{var t;const i=_U(null!=(t=a.label)?t:a.text,"");return u(c({},e),{label:i,text:i})})():e;t&&(i._subtitleOrder=a.order);const n=Object.prototype.hasOwnProperty.call(a,"isDefault"),r=Object.prototype.hasOwnProperty.call(a,"default");return(n||r)&&(i.isDefault=n?Boolean(a.isDefault):Boolean(a.default)),i}return e}}getDrmConfig(e){var t,i,n,r,o,a,s,l;const{thirdPartyDrmAuthToken:u,serverCertificatePath:h}=this.config;if(u)try{const{vid:u,playList:d}=e,{kid:f,codec:p}=null==d?void 0:d[0];if(!f||!u)return void ss.warn("get kid or vid fail");const g=null==(t=this.playerData.configs)?void 0:t.drm,y="object"==typeof g?g:{},{playDomain:v}=this.config,m=v||this.playerData.playDomain,_=function(e,t="GetPlayInfoToken"){const i=ms(window.atob(e));return i?i[t]:""}(this.config.thirdPartyDrmAuthToken,"GetThirdPartyDrmAuthToken"),E=c({ignoreLicenseHeader:!1,unRecord:null!=(i=this.config.unRecord)&&i,contentType:ir[p],initDataType:"cenc",[Qa.FAIRPLAY]:{serverProcessSPCPath:Is(Qa.FAIRPLAY,f,m,_),serverCertificatePath:h},[Qa.WIDEVINE]:{serverProcessSPCPath:Is(Qa.WIDEVINE,f,m,_)},[Qa.PLAYREADY]:{serverProcessSPCPath:Is(Qa.PLAYREADY,f,m,_)}},y);(null==(o=null==(r=null==(n=this.sdk)?void 0:n.player)?void 0:r.plugins)?void 0:o.drm)&&(null==(l=null==(s=null==(a=this.sdk)?void 0:a.player)?void 0:s.plugins)||l.drm.updateConfig(E)),this.playerData.options.drm=E}catch(d){ss.error("generate drm config error:",d)}else this.playerData.options.drm={initDataType:"cenc"}}get isMinisDramaMode(){const e=mB.ttDramaEnv;return!!(null==e?void 0:e.getDramaInfo)}init(){const e=this.playerData.configs,{getVideoByToken:t={}}=e;this.initConfig(t)}initConfig(e,t){var i;const n=t||(null==(i=this.playerData)?void 0:i.configs)||{},{albumId:r,episodeId:o}=gU(n),a=!(!r||!o),s=!!mB.ttDramaEnv;if(this.isPlayByToken=!!e.playAuthToken||s&&a,this.isPlayByToken&&(this.config=Object.assign({},vU,e),Object.prototype.hasOwnProperty.call(n,"definitionMap")&&(this.config.definitionMap=n.definitionMap),e.playAuthToken)){if(this.tokenInfo=_s(e.playAuthToken),e.keyToken){const t=(l=e.keyToken,/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/.test(l)?window.atob(e.keyToken):e.keyToken);this.keyTokenInfo=Es(t)}e.thirdPartyDrmAuthToken&&(this.thirdPartyDrmAuthTokenInfo=_s(e.thirdPartyDrmAuthToken,"GetThirdPartyDrmAuthToken")),e.retryCount&&(this.retryCount=e.retryCount)}var l}updateDramaEpisode(e,t){return d(this,null,(function*(){var i,n,r;const o=t||(null==(i=this.playerData)?void 0:i.configs)||{},a=o.getVideoByToken||{},s={config:this.config,isPlayByToken:this.isPlayByToken,tokenInfo:this.tokenInfo,keyTokenInfo:this.keyTokenInfo,thirdPartyDrmAuthTokenInfo:this.thirdPartyDrmAuthTokenInfo,retryCount:this.retryCount};this.initConfig(a,o);const l=yield this.getVideoInfo(o);if(!l)throw this.config=s.config,this.isPlayByToken=s.isPlayByToken,this.tokenInfo=s.tokenInfo,this.keyTokenInfo=s.keyTokenInfo,this.thirdPartyDrmAuthTokenInfo=s.thirdPartyDrmAuthTokenInfo,this.retryCount=s.retryCount,new Error("Failed to get drama media info");if(t&&(this.playerData.configs=t),e)this.playerData.initPlayData(l);else{const e=this.playerData.current.definition,t=(null==(n=l.playList)?void 0:n.find((t=>{var i,n;const r=t.mapDefinition||t.definition||t.Definition;return(null==(i=null==r?void 0:r.toLocaleLowerCase)?void 0:i.call(r))===(null==(n=null==e?void 0:e.toLocaleLowerCase)?void 0:n.call(e))})))||(null==(r=l.playList)?void 0:r[0]),i=(null==t?void 0:t.mapDefinition)||(null==t?void 0:t.definition)||(null==t?void 0:t.Definition);this.playerData.updateConfigs(u(c({},l),{defaultDefinition:i})),this.playerData.updatePlayList(),t&&this.playerData.initCurrent(t),this.playerData.updateCheckExpireData()}}))}updateAuthToken(e,t){return d(this,null,(function*(){const i=Object.assign({},this.config,e);this.initConfig(i);const n=yield this.getVideoInfo();n&&(t?this.playerData.initPlayData(n):(this.playerData.updateConfigs(u(c({},n),{defaultDefinition:this.playerData.current.definition})),this.playerData.updatePlayList(),this.playerData.updateCheckExpireData()))}))}checkPlayAuthTokenValid(){var e,t;if(!this.tokenInfo)return!1;if(Ss(this.tokenInfo)){ss.error("playAuthToken is expired, please check or update your playAuthToken"),null==(e=this.sdk)||e.delayEvents.push({name:NA.TOKEN_EXPIRED,payload:{type:"playAuthToken",token:this.tokenInfo}});const i={errorType:"token",errorCode:9101,veError:yU(yR.PLAY_AUTH_TOKEN_EXPIRED),errorMessage:"playAuthToken has expired",ext:{playAuthToken:this.config.playAuthToken,config:this.config},originError:void 0};return null==(t=this.sdk)||t.delayError.push(i),!0}return!1}checkKeyTokenValid(){var e,t;if(Ss(this.keyTokenInfo)){ss.error("keyToken is expired, please check or update your keyToken"),null==(e=this.sdk)||e.delayEvents.push({name:NA.TOKEN_EXPIRED,payload:{type:"keyToken",token:this.keyTokenInfo}});const i={errorType:"token",errorCode:9102,veError:yU(yR.HLS_KEY_TOKEN_EXPIRED),errorMessage:"keyToken for hls encrypt play has expired",ext:{keyToken:this.config.keyToken,config:this.config},originError:void 0};return null==(t=this.sdk)||t.delayError.push(i),!0}return!1}checkDrmAuthTokenValid(){var e,t;if(Ss(this.thirdPartyDrmAuthTokenInfo)){ss.error("thirdPartyDrmAuthToken is expired, please check or update your thirdPartyDrmAuthToken"),null==(e=this.sdk)||e.delayEvents.push({name:NA.TOKEN_EXPIRED,payload:{type:"thirdPartyDrmAuthToken",token:this.thirdPartyDrmAuthTokenInfo}});const i={errorType:"token",errorCode:9103,errorMessage:"thirdPartyDrmAuthToken for DRM has expired",veError:yU(yR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED),ext:{thirdPartyDrmAuthToken:this.config.thirdPartyDrmAuthToken,config:this.config},originError:void 0};return null==(t=this.sdk)||t.delayError.push(i),!0}return!1}}class TU extends QN{static get pluginName(){return"Abr"}constructor(e){super(e)}static get defaultConfig(){return{autoDefiText:"",isOpenAutoDefi:!1,interval:1e3,hurryThreshold:.25,lowThreshold:.4,highThreshold:.7,noStallCheckTime:5,isOpenHint:!1,method:31}}beforePlayerCreate(){return d(this,null,(function*(){return yield this.prepareAbrModule()}))}prepareAbrModule(){return d(this,null,(function*(){var e,t;return null==(t=null==(e=this.sdk.playerData)?void 0:e.adapter)?void 0:t.prepareAbrModule(this.playerData,this.sdk.sdkUmdLoader)}))}adaptAbrOptions(){var e;const t=null==(e=this.playerData.configs)?void 0:e.autoBitrateOpts;if(t){const e=this.playerData.defaultDefinition;return u(c(c({},TU.defaultConfig),t),{autoDefiText:t.autoDefinitionText||"",isOpenAutoDefi:this.playerData.isOpenABR(),isPlayAutoDefi:this.playerData.isPlayAutoDefinition(e)})}}applyAbrConfig(e){var t,i;const n=this.adaptAbrOptions();n&&(null==(i=null==(t=this.sdk.playerData)?void 0:t.adapter)||i.applyAbrPluginConfig(e,n))}}class SU extends QN{static get pluginName(){return"AdaptRange"}constructor(e){super(e)}adaptRangeOptions(){var e,t,i,n,r,o,a,s;const l=null!=(t=null==(e=this.playerData.configs)?void 0:e.adaptRange)?t:void 0;if(!(null==l?void 0:l.enable)||!(null==(n=null==(i=this.playerData.adapter)?void 0:i.canAdaptRangeEnable)?void 0:n.call(i)))return;const h=this.playerData.adapter.adaptRangeDefaultOptions();return u(c(c({},null!=h?h:{}),l),{minTargetCacheDur:null!=(r=l.minCacheDuration)?r:null==h?void 0:h.minTargetCacheDur,maxTargetCacheDur:null!=(o=l.maxCacheDuration)?o:null==h?void 0:h.maxTargetCacheDur,rangeMinDuration:null!=(a=l.minRangeDuration)?a:null==h?void 0:h.rangeMinDuration,rangeMaxDuration:null!=(s=l.maxRangeDuration)?s:null==h?void 0:h.rangeMaxDuration})}applyRangeConfig(e){const t=this.adaptRangeOptions();t&&e&&this.playerData.adapter.applyAdaptRangePluginConfig(e,t)}}class bU extends QN{static get pluginName(){return"Strategy"}applyFinalStrategy(e){var t,i,n,r;if(yA.isReady()){const o=this.playerData.configs.duration||(null==(i=null==(t=this.playerData.playList)?void 0:t[0])?void 0:i.duration)||-1,a=o>0&&o<=180?"svideo":o>180&&o<=1800?"mvideo":"lvideo",s={vtype:null==(n=this.playerData.adapter)?void 0:n.streamType,duration:o,videoLabel:a},l=yA.getStrategyRecommendations(void 0,s),{result:c}=l;ss.log("VodLogCommon Final StrategyConfig:",c);const u=null==c?void 0:c[hA.ADAPT_RANGE];(null==u?void 0:u.enable)&&(null==u?void 0:u.options)&&(null==(r=this.playerData.adapter)||r.applyAdaptRangeStrategy(e,u.options))}}}const CU={init(e){var t;if(!e)return;const i=e.playerData.sdkPlugins;(null==(t=e.playerData)?void 0:t.isLive)?e.sdkPlugins=[...i]:e.sdkPlugins=[EU,TU,SU,bU,...i],e._sdkPlugins={}},registerPlugin(e,t){if(!e||!t)return;let i=null,n=null;e.plugin&&"function"==typeof e.plugin?(i=e.plugin,n=e.options):(i=e,n={}),n.sdk=t;const r=n.pluginName||i.pluginName;if(!r)throw new Error("The property pluginName is necessary");const o=t._sdkPlugins;try{o[r.toLowerCase()]&&this.unRegister(r);const e=new i(n);return o[r.toLowerCase()]=e,o[r.toLowerCase()].func=i,e&&"function"==typeof e.afterCreate&&e.afterCreate(),e}catch(a){ss.error(a)}},unRegister(e,t){if(e&&t){e=e.toLowerCase();try{const i=t._sdkPlugins[e];i&&(i.pluginName&&i.__destroy(),delete t._sdkPlugins[e])}catch(i){ss.error(i)}}},beforePlayerCreate(e){if(!e)return;e._sdkPlugins||this.init(e);const t=e._sdkPlugins,i=null==e?void 0:e._createPlayerPerf,n=[];for(const r of Object.keys(t))if(t[r]&&t[r].beforePlayerCreate)try{const e=()=>Ys(t[r].beforePlayerCreate());(null==i?void 0:i.measureAsync)?n.push(i.measureAsync(`beforePlayerCreate.${r}`,e)):n.push(e())}catch(ds){throw n.push(Ys(null)),ds}return new Promise(((e,t)=>{Promise.all([...n]).then((()=>{e(null)})).catch((i=>{ss.error(i),"VEPLAYER_LITE_UNSUPPORTED_FEATURE"!==(null==i?void 0:i.code)?e(null):t(i)}))}))},afterPlayerCreate(e){if(!e)return;const t=e._sdkPlugins;for(const i of Object.keys(t))if(t[i]&&t[i].beforePlayerCreate)try{t[i].afterPlayerCreate()}catch(ds){throw ds}},destroy(e){if(!e)return;const t=e._sdkPlugins;if(t){for(const i of Object.keys(t))this.unRegister(i,e);delete e._sdkPlugins}}},kU=CU,IU={[gR.NETWORK]:"Network error",[gR.NETWORK_TIMEOUT]:"Network timeout",[gR.NETWORK_FORBIDDEN]:"The video URL is prohibited from access. Please check the domain name access control",[gR.NETWORK_NOTFOUND]:"The video not found, please check whether the URL is correct",[gR.NETWORK_RANGE_NOT_SATISFIABLE]:"The request range is incorrect, please try again later",[gR.NETWORK_PROTOCOL]:"The request protocol is incorrect, please use the https URL to access",[gR.NETWORK_URL_EXPIRE]:"The video URL has expired",[gR.NETWORK_URL_SIGN]:"The video URL signature is incorrect, please check whether the URL is correct",[gR.NETWORK_ENCRYPT_HLS_ERR]:"Get the m3u8 file or encrypt key fail",[gR.MEDIA_ERR]:"Media error",[gR.MEDIA_ERR_ABORTED]:"Playback was canceled by the user or browser",[gR.MEDIA_ERR_NETWORK]:"Network error",[gR.MEDIA_ERR_DECODE]:"Decoding error",[gR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"Audio/Video format not supported or URL unavailable",[gR.MEDIA_ERR_NOT_SUPPORTED]:"Unsupported video format",[gR.MEDIA_ERR_URL_EMPTY]:"Video URL is empty",[gR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"Video file is not supported in the current browser environment",[gR.MEDIA_ERR_PLAY_ERR]:"Video playback error",[gR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"Unsupported video type",[gR.BUSINESS_DRM_NOT_SUPPORT]:"DRM encrypted playback is not supported",[gR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"Screen recording protection is not supported",[gR.BUSINESS_DRM_LACK_MEDIA_KEY]:"Video data lacks the corresponding MediaKey",[gR.BUSINESS_DRM_LACK_KEY_SESSION]:"Browser does not support the corresponding DRM KeySession",[gR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"Decryption playback error",[gR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"Missing DRM certificate request link",[gR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"Missing DRM License request link",[gR.BUSINESS_DRM_LICENSE_FAIL]:"Request or update License failed",[gR.BUSINESS_DRM_KEY_ERROR]:"Decryption error",[gR.BUSINESS_DRM_CERT_FAIL]:"Request for DRM certificate failed",[gR.PRIVATE_DRM_KEY_GET_FAILED]:"Private DRM get key failed",[gR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"Web cryptography API is not supported, please visit page by https",[gR.PRIVATE_DRM_RSA_FAIL]:"Decryption by RSA-OAEP failed, please check playAuthId",[gR.OTHER]:"Other error",[gR.VOD_LOG_NOT_CONFIGURED]:"Log options not configured correctly",[gR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken has expired",[gR.HLS_KEY_TOKEN_EXPIRED]:"keyToken has expired",[gR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken has expired",[gR.GET_PLAY_INFO_ERR]:"Failed to get media information",[gR.GET_HLS_DECRYPTION_KEY_ERR]:"Failed to get HLS key",[gR.LICENSE_VALIDATE_FAIL]:"License validation failed",[gR.DEFINITION_AUTO]:"Auto",[gR.LICENSE_STATUS_INVALID]:"License validation is invalid",[gR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license domain name does not match",[gR.BASE_LICENSE_NOT_SUPPORT_265]:"The basic license does not support H265",[gR.BASE_LICENSE_NOT_SUPPORT_ABR]:"The basic license does not support ABR",[gR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"The basic license does not support dynamic buffer",[gR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"The basic license does not support preload",[gR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"Expired license does not support H265",[gR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"Expired license does not support ABR",[gR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"The expired license does not support dynamic buffer",[gR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"Expired license does not support preloading",[gR.DRAMA_INVALID_PARAM]:"Invalid parameter",[gR.DRAMA_NO_INFO_FOUND]:"No information found for this episode",[gR.DRAMA_NOT_SUBMITTED]:"Episode has not been submitted for review",[gR.DRAMA_UNDER_REVIEW]:"Episode is under review",[gR.DRAMA_FAILED_REVIEW]:"Episode failed review",[gR.DRAMA_WITHDRAWN_REVIEW]:"Episode review was withdrawn",[gR.DRAMA_FAILED_TO_QUERY]:"Failed to query video playback information",[gR.DRAMA_INVALID_TTOP_TOKEN]:"Invalid playback credential or TTOP signature verification failed",[gR.DRAMA_NOT_ON_SHELF]:"Video is not on shelf",[gR.DRAMA_FAILED_GET_EPISODE_INFO]:"Failed to get episode information"},PU={[gR.NETWORK]:"网络错误",[gR.NETWORK_TIMEOUT]:"网络超时",[gR.NETWORK_FORBIDDEN]:"视频地址禁止访问,请检查域名访问控制",[gR.NETWORK_NOTFOUND]:"视频不存在,请检查视频地址是否正确",[gR.NETWORK_RANGE_NOT_SATISFIABLE]:"请求 range 不正确,请稍后再试",[gR.NETWORK_PROTOCOL]:"请求协议错误,请使用 https 地址访问",[gR.NETWORK_URL_EXPIRE]:"视频地址已过期",[gR.NETWORK_URL_SIGN]:"视频地址签名错误,请检查地址是否正确",[gR.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 文件或密钥获取失败",[gR.MEDIA_ERR]:"播放错误",[gR.MEDIA_ERR_ABORTED]:"播放被用户或浏览器取消",[gR.MEDIA_ERR_NETWORK]:"网络错误",[gR.MEDIA_ERR_DECODE]:"解码错误",[gR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音/视频格式不支持或地址不可用",[gR.MEDIA_ERR_NOT_SUPPORTED]:"不支持的视频格式",[gR.MEDIA_ERR_URL_EMPTY]:"视频地址为空",[gR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"视频文件当前浏览器环境下不支持",[gR.MEDIA_ERR_PLAY_ERR]:"视频播放错误",[gR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"不支持的视频类型",[gR.BUSINESS_DRM_NOT_SUPPORT]:"DRM加密播放不支持",[gR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"不支持防录屏",[gR.BUSINESS_DRM_LACK_MEDIA_KEY]:"视频数据缺少相应 MediaKey",[gR.BUSINESS_DRM_LACK_KEY_SESSION]:"浏览器不支持相应 DRM KeySession",[gR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"解密播放错误",[gR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"缺少 DRM 证书请求链接",[gR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"缺少 DRM License 请求链接",[gR.BUSINESS_DRM_LICENSE_FAIL]:"请求或更新 License 失败",[gR.BUSINESS_DRM_KEY_ERROR]:"解密错误",[gR.BUSINESS_DRM_CERT_FAIL]:"请求DRM证书失败",[gR.PRIVATE_DRM_KEY_GET_FAILED]:"私有加密密钥解析失败",[gR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"当前浏览器不支持Crypto API,请使用https环境访问",[gR.PRIVATE_DRM_RSA_FAIL]:"解密错误,请检查playAuthId是否正确",[gR.OTHER]:"其他错误",[gR.VOD_LOG_NOT_CONFIGURED]:"未正确配置质量日志参数",[gR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken 已过期",[gR.HLS_KEY_TOKEN_EXPIRED]:"keyToken 已过期",[gR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken 已过期",[gR.GET_PLAY_INFO_ERR]:"获取媒体信息失败",[gR.GET_HLS_DECRYPTION_KEY_ERR]:"获取 HLS 密钥失败",[gR.LICENSE_VALIDATE_FAIL]:"license 校验失败",[gR.DEFINITION_AUTO]:"自动",[gR.LICENSE_STATUS_INVALID]:"license 校验无效",[gR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license 域名不匹配",[gR.BASE_LICENSE_NOT_SUPPORT_265]:"基础版license 不支持H265",[gR.BASE_LICENSE_NOT_SUPPORT_ABR]:"基础版license 不支持自适应码率",[gR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基础版license 不支持动态Buffer",[gR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基础版license 不支持预加载",[gR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"已过期版license 不支持H265",[gR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"已过期版license 不支持自适应码率",[gR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"已过期版license 不支持动态Buffer",[gR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"已过期版license 不支持预加载",[gR.DRAMA_INVALID_PARAM]:"参数错误",[gR.DRAMA_NO_INFO_FOUND]:"未查询到该剧集信息",[gR.DRAMA_NOT_SUBMITTED]:"剧集未送审",[gR.DRAMA_UNDER_REVIEW]:"剧集审核中",[gR.DRAMA_FAILED_REVIEW]:"剧集审核不通过",[gR.DRAMA_WITHDRAWN_REVIEW]:"剧集审核撤回",[gR.DRAMA_FAILED_TO_QUERY]:"查询视频播放信息失败",[gR.DRAMA_INVALID_TTOP_TOKEN]:"播放凭证无效或TTOP签名验证失败",[gR.DRAMA_NOT_ON_SHELF]:"视频未上架",[gR.DRAMA_FAILED_GET_EPISODE_INFO]:"查询剧集信息失败"},DU={[gR.NETWORK]:"ネットワークエラー",[gR.NETWORK_TIMEOUT]:"ネットワークタイムアウト",[gR.NETWORK_FORBIDDEN]:"動画のURLへのアクセスが禁止されています。ドメインアクセス制御を確認してください",[gR.NETWORK_NOTFOUND]:"動画が存在しません。動画アドレスが正しいか確認してください",[gR.NETWORK_RANGE_NOT_SATISFIABLE]:"リクエスト範囲が正しくありません。後でもう一度お試しください",[gR.NETWORK_PROTOCOL]:"リクエストプロトコルエラー。httpsアドレスを使用してアクセスしてください",[gR.NETWORK_URL_EXPIRE]:"動画のURLは期限切れです",[gR.NETWORK_URL_SIGN]:"動画のURL署名エラー。アドレスが正しいか確認してください",[gR.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 ファイルまたはキーの取得に失敗しました",[gR.MEDIA_ERR]:"再生エラー",[gR.MEDIA_ERR_ABORTED]:"再生がユーザーまたはブラウザによってキャンセルされました",[gR.MEDIA_ERR_NETWORK]:"ネットワークエラー",[gR.MEDIA_ERR_DECODE]:"デコードエラー",[gR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音声/動画フォーマットがサポートされていないか、アドレスが利用できません",[gR.MEDIA_ERR_NOT_SUPPORTED]:"サポートされていない動画フォーマット",[gR.MEDIA_ERR_URL_EMPTY]:"動画のURLが空です",[gR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"動画ファイルは現在のブラウザ環境でサポートされていません",[gR.MEDIA_ERR_PLAY_ERR]:"動画再生エラー",[gR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"サポートされていない動画の種類",[gR.BUSINESS_DRM_NOT_SUPPORT]:"DRM暗号化再生はサポートされていません",[gR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"録画防止はサポートされていません",[gR.BUSINESS_DRM_LACK_MEDIA_KEY]:"動画データに対応するMediaKeyが不足しています",[gR.BUSINESS_DRM_LACK_KEY_SESSION]:"ブラウザが対応するDRM KeySessionをサポートしていません",[gR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"復号再生エラー",[gR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"DRM証明書リクエストリンクが不足しています",[gR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"DRMライセンスリクエストリンクが不足しています",[gR.BUSINESS_DRM_LICENSE_FAIL]:"ライセンスのリクエストまたは更新に失敗しました",[gR.BUSINESS_DRM_KEY_ERROR]:"復号エラー",[gR.BUSINESS_DRM_CERT_FAIL]:"DRM証明書のリクエストに失敗しました",[gR.PRIVATE_DRM_KEY_GET_FAILED]:"プライベートDRMキーの取得に失敗しました",[gR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"現在のブラウザはCrypto APIをサポートしていません。アクセスするにはhttps環境を使用してください",[gR.PRIVATE_DRM_RSA_FAIL]:"復号化エラー。playAuthIdが正しいかどうかを確認してください",[gR.OTHER]:"その他のエラー",[gR.VOD_LOG_NOT_CONFIGURED]:"品質ログパラメータが正しく設定されていません",[gR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthTokenが期限切れです",[gR.HLS_KEY_TOKEN_EXPIRED]:"keyTokenが期限切れです",[gR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthTokenが期限切れです",[gR.GET_PLAY_INFO_ERR]:"動画情報の取得に失敗しました",[gR.GET_HLS_DECRYPTION_KEY_ERR]:"HLSキーの取得に失敗しました",[gR.LICENSE_VALIDATE_FAIL]:"ライセンスの検証に失敗しました",[gR.DEFINITION_AUTO]:"自動",[gR.LICENSE_STATUS_INVALID]:"ライセンス検証が無効です",[gR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"ライセンスドメイン名が一致しません",[gR.BASE_LICENSE_NOT_SUPPORT_265]:"基本ライセンスはH265をサポートしていません",[gR.BASE_LICENSE_NOT_SUPPORT_ABR]:"基本ライセンスはアダプティブビットレートをサポートしていません",[gR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基本ライセンスはダイナミックバッファをサポートしていません",[gR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基本ライセンスはプリロードをサポートしていません",[gR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"期限切れのライセンスはH265をサポートしていません",[gR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"期限切れのライセンスはアダプティブ ビットレートをサポートしていません",[gR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"期限切れのライセンスは動的バッファをサポートしていません",[gR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"期限切れのライセンスはプリロードをサポートしていません",[gR.DRAMA_INVALID_PARAM]:"パラメータが無効です",[gR.DRAMA_NO_INFO_FOUND]:"このエピソードの情報が見つかりません",[gR.DRAMA_NOT_SUBMITTED]:"エピソードは審査に提出されていません",[gR.DRAMA_UNDER_REVIEW]:"エピソードは審査中です",[gR.DRAMA_FAILED_REVIEW]:"エピソードは審査に不合格でした",[gR.DRAMA_WITHDRAWN_REVIEW]:"エピソードの審査が取り下げられました",[gR.DRAMA_FAILED_TO_QUERY]:"動画再生情報の取得に失敗しました",[gR.DRAMA_INVALID_TTOP_TOKEN]:"再生資格情報が無効か、TTOP署名の検証に失敗しました",[gR.DRAMA_NOT_ON_SHELF]:"動画は未公開です",[gR.DRAMA_FAILED_GET_EPISODE_INFO]:"エピソード情報の取得に失敗しました"},wU=[{LANG:"en",TEXT:IU},{LANG:"zh",TEXT:PU},{LANG:"zh-hk",TEXT:{[gR.NETWORK]:"網路錯誤",[gR.NETWORK_TIMEOUT]:"網路逾時",[gR.NETWORK_FORBIDDEN]:"視頻地址禁止訪問,請檢查域名訪問控制",[gR.NETWORK_NOTFOUND]:"視頻不存在,請檢查視訊地址是否正確",[gR.NETWORK_RANGE_NOT_SATISFIABLE]:"請求範圍不正確,請稍後再試",[gR.NETWORK_PROTOCOL]:"請求協議錯誤,請使用 https 地址訪問",[gR.NETWORK_URL_EXPIRE]:"視頻地址已過期",[gR.NETWORK_URL_SIGN]:"視頻地址簽名錯誤,請檢查地址是否正確",[gR.NETWORK_ENCRYPT_HLS_ERR]:"m3u8 檔案或金鑰取得失敗",[gR.MEDIA_ERR]:"播放錯誤",[gR.MEDIA_ERR_ABORTED]:"播放被用戶或瀏覽器取消",[gR.MEDIA_ERR_NETWORK]:"網路錯誤",[gR.MEDIA_ERR_DECODE]:"解碼錯誤",[gR.MEDIA_ERR_SRC_NOT_SUPPORTED]:"音/視頻格式不支援或地址不可用",[gR.MEDIA_ERR_NOT_SUPPORTED]:"不支援的視頻格式",[gR.MEDIA_ERR_URL_EMPTY]:"視頻地址為空",[gR.MEDIA_ERR_FILE_NOT_SUPPORTED]:"視頻文件在當前瀏覽器環境下不支援",[gR.MEDIA_ERR_PLAY_ERR]:"視頻播放錯誤",[gR.MEDIA_SOURCE_CANNOT_PLAY_TYPE]:"不支援的視頻類型",[gR.BUSINESS_DRM_NOT_SUPPORT]:"不支援 DRM 加密播放",[gR.BUSINESS_DRM_NOT_SUPPORT_UN_RECORD]:"不支援防錄屏",[gR.BUSINESS_DRM_LACK_MEDIA_KEY]:"視頻數據缺少相應 MediaKey",[gR.BUSINESS_DRM_LACK_KEY_SESSION]:"瀏覽器不支援相應 DRM KeySession",[gR.BUSINESS_DRM_GENERATE_REQUEST_FAIL]:"解密播放錯誤",[gR.BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH]:"缺少 DRM 證書請求鏈接",[gR.BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH]:"缺少 DRM License 請求鏈接",[gR.BUSINESS_DRM_LICENSE_FAIL]:"請求或更新 License 失敗",[gR.BUSINESS_DRM_KEY_ERROR]:"解密錯誤",[gR.BUSINESS_DRM_CERT_FAIL]:"請求 DRM 證書失敗",[gR.PRIVATE_DRM_KEY_GET_FAILED]:"私有加密金鑰解析失敗",[gR.PRIVATE_DRM_CRYPTO_NOT_SUPPORT]:"目前瀏覽器不支援Crypto API,請使用https環境訪問",[gR.PRIVATE_DRM_RSA_FAIL]:"解密錯誤,請檢查playAuthId是否正確",[gR.OTHER]:"其他錯誤",[gR.VOD_LOG_NOT_CONFIGURED]:"未正確配置質量日誌參數",[gR.PLAY_AUTH_TOKEN_EXPIRED]:"playAuthToken 已過期",[gR.HLS_KEY_TOKEN_EXPIRED]:"keyToken 已過期",[gR.THIRD_PARTY_DRM_AUTH_TOKEN_EXPIRED]:"thirdPartyDrmAuthToken 已過期",[gR.GET_PLAY_INFO_ERR]:"獲取視頻信息失敗",[gR.GET_HLS_DECRYPTION_KEY_ERR]:"獲取 HLS 密鑰失敗",[gR.LICENSE_VALIDATE_FAIL]:"license 校驗失敗",[gR.DEFINITION_AUTO]:"自動",[gR.LICENSE_STATUS_INVALID]:"license 校驗無效",[gR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH]:"license 域名不匹配",[gR.BASE_LICENSE_NOT_SUPPORT_265]:"基礎版license 不支援H265",[gR.BASE_LICENSE_NOT_SUPPORT_ABR]:"基礎版license 不支援自適應碼率",[gR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"基礎版license 不支援動態Buffer",[gR.BASE_LICENSE_NOT_SUPPORT_PRELOAD]:"基礎版license 不支援預載入",[gR.EXPIRED_LICENSE_NOT_SUPPORT_265]:"已過期版license 不支援H265",[gR.EXPIRED_LICENSE_NOT_SUPPORT_ABR]:"已過期版license 不支援自適應碼率",[gR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER]:"已過期版license 不支援動態Buffer",[gR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD]:"已過期版license 不支援預載入",[gR.DRAMA_INVALID_PARAM]:"參數錯誤",[gR.DRAMA_NO_INFO_FOUND]:"未查詢到該劇集資訊",[gR.DRAMA_NOT_SUBMITTED]:"劇集未送審",[gR.DRAMA_UNDER_REVIEW]:"劇集審核中",[gR.DRAMA_FAILED_REVIEW]:"劇集審核不通過",[gR.DRAMA_WITHDRAWN_REVIEW]:"劇集審核撤回",[gR.DRAMA_FAILED_TO_QUERY]:"查詢視頻播放資訊失敗",[gR.DRAMA_INVALID_TTOP_TOKEN]:"播放憑證無效或TTOP簽名驗證失敗",[gR.DRAMA_NOT_ON_SHELF]:"影片未上架",[gR.DRAMA_FAILED_GET_EPISODE_INFO]:"查詢劇集資訊失敗"}},{LANG:"jp",TEXT:DU}],AU="ignoreServicePreloadConfigEnable";class RU extends Error{constructor(e,t){super(t),this.code=e}}const xU=new Map;function OU(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function LU(e){return!!(e&&YM(e)&&zM(e))}function NU(e){var t;return!!(null==(t=null==e?void 0:e.getVideoByToken)?void 0:t.playAuthToken)}function MU(e,t){return e instanceof RU?e:new RU(t.code,t.message)}function UU(e,t,i){const n=`${t.cacheOptions.moduleName}:${t.cacheOptions.cacheKey}`,r=xU.get(n);if(r)return r;const o="ttDrama"===t.kind?function(e,t){const i=YM(t),n=zM(t);if(!(null==e?void 0:e.getDramaInfo)||!i||!n){const e=_R.INVALID_PARAM;return Promise.reject(new RU(e.code,e.message))}const r={clientKey:e.clientKey,albumId:i,episodeId:n,vid:t.vid||""};return FM(e)&&OU(t,"transcodeParam")&&(r.transcodeParam=UM(t.transcodeParam)||{}),new Promise(((i,n)=>{try{e.getDramaInfo((r=>{var o,a,s,l;try{if(!(null==r?void 0:r.is_success)){const e=jM(null==(o=null==r?void 0:r.error)?void 0:o.error_msg,void 0),t=_R[e];return void n(new RU(t.code,t.message))}if((null==(a=r.data)?void 0:a.status)!==ER.SUCCESS){const e=HM(null==(s=r.data)?void 0:s.status),t=_R[e];return void n(new RU(t.code,t.message))}if(!(null==(l=r.data)?void 0:l.video_info)){const e=_R.FAILED_TO_QUERY;return void n(new RU(e.code,e.message))}const c=iU(r.data.video_info,tU(t,e));if(!dM(c)){const e=_R.FAILED_TO_QUERY;return void n(new RU(e.code,e.message))}i(c)}catch(dF){n(MU(dF,_R.FAILED_GET_EPISODE_INFO))}}),r)}catch(dF){n(MU(dF,_R.FAILED_GET_EPISODE_INFO))}}))}(i,e):function(e,t){return d(this,null,(function*(){const i=tU(e,t);try{const e=_s(i.playAuthToken);if(Ss(e)){const e=yR.PLAY_AUTH_TOKEN_EXPIRED;throw new RU(e.code,e.message)}const t=yield Cs(i);if(!dM(t))throw new RU(yR.GET_PLAY_INFO_ERR.code,yR.GET_PLAY_INFO_ERR.message);return t}catch(dF){throw MU(dF,yR.GET_PLAY_INFO_ERR)}}))}(e,i);xU.set(n,o);const a=()=>{xU.get(n)===o&&xU.delete(n)};return o.then(a,a),o}function BU(e,t){return d(this,null,(function*(){try{const i=function(e,t){if(LU(e)&&!0===(null==t?void 0:t.canIUseGetDramaInfo)){const i=$M(e,t);return{kind:"ttDrama",cacheOptions:{moduleName:iM,cacheKey:XM(i),cacheKeyInfo:qM(i)}}}if(NU(e)){const t=eU(e);return{kind:"playAuthToken",cacheOptions:{moduleName:tM,cacheKey:pM(t),cacheKeyInfo:gM(t)}}}if(LU(e)){const e=_R.INVALID_PARAM;throw new RU(e.code,e.message)}throw new RU(8e3,"Unsupported media info source")}(e,t),n=function(e,t,i){const n=PM(t.cacheOptions);return n||("ttDrama"===t.kind?ZM($M(e,i)):JM(e))}(e,i,t);if(n)return{status:"fulfilled",source:e,data:n,fromCache:!0};const r=yield UU(e,i,t);return DM(i.cacheOptions,r),{status:"fulfilled",source:e,data:r,fromCache:!1}}catch(dF){const i=MU(dF,yR.OTHER);return{status:"rejected",source:e,error:{code:i.code,message:i.message}}}}))}function FU(e,t){const i=tU(e,t);return i.playAuthToken?Cs(i).catch((()=>{})):Promise.resolve(void 0)}function HU(e,t){return d(this,null,(function*(){if(t&&!t.canIUseGetDramaInfo)return jU(e,t);const i=function(e,t){const i=ZM($M(e,t));return i?rU(i,e):void 0}(e,t);if(i)return cU(i);if(!(null==t?void 0:t.canIUseGetDramaInfo))return jU(e,t);const n=yield function(e,t){const i=YM(t),n=zM(t);if(!i||!n)return Promise.resolve(void 0);if(!(null==e?void 0:e.canIUseGetDramaInfo))return FU(t,e);if(!e.getDramaInfo)return Promise.resolve(void 0);const r={clientKey:e.clientKey,albumId:i,episodeId:n,vid:t.vid||""};return FM(e)&&OU(t,"transcodeParam")&&(r.transcodeParam=UM(t.transcodeParam)||{}),new Promise((i=>{try{e.getDramaInfo((n=>{try{if(!(null==n?void 0:n.is_success))return ss.error("[ttdrama] getDramaInfo invalid response",n),void i(void 0);const{data:r}=n;if((null==r?void 0:r.status)!==ER.SUCCESS||!(null==r?void 0:r.video_info))return ss.error("[ttdrama] getDramaInfo invalid response",n),void i(void 0);const o=iU(r.video_info,tU(t,e));i(o)}catch(ds){ss.error("[ttdrama] getDramaInfo invalid response",n),i(void 0)}}),r)}catch(n){ss.error("[ttdrama] getDramaInfo call failed",n),i(void 0)}}))}(t,e);return n?(QM($M(e,t),n),cU(rU(n,e))):void 0}))}function jU(e,t){return d(this,null,(function*(){const i=function(e){const t=JM(e);return t?rU(t,e):void 0}(e);if(i)return cU(i);const n=yield FU(e,t);var r;return n?(r=n,LM(eU(e),r),cU(rU(n,e))):void 0}))}function VU(e,t){return d(this,null,(function*(){if(nU(e.url))return e;if(LU(e)){const i=yield HU(e,t);return i||t||NU(e)?i:e}return NU(e)?jU(e,t):e}))}function KU(e,t){return d(this,null,(function*(){if(!(null==e?void 0:e.length))return e||[];let i;if(Kr.os.isAndroid&&!(null==t?void 0:t.canAndroidBatchGetDramaInfo)){i=[];for(const n of e)i.push(yield VU(n,t))}else i=yield Promise.all(e.map((e=>VU(e,t))));return i.filter(Boolean)}))}const GU=["live","rtm","music","danmu","ad"],WU=["configs","options","defaultConfig","current"],YU=["url","src","playUrl","playURL"],zU=["plugins","sdkPlugins","strategiesPlugins","presets"];class $U extends Error{constructor(e){var t;super(`[VEPLAYER_LITE_UNSUPPORTED_FEATURE] ${e} 功能不受精简版支持,请改用 ${function(e){const t=(e||"").toUpperCase();return t.includes("BYTEPLUS")?"@byteplus/veplayer":t.includes("VOLCENGINE")?"@volcengine/veplayer":"@byted-vcloud/veplayer"}("undefined"==typeof process||null==(t=process.env)?void 0:t.LUX_REGION)}。`),this.code="VEPLAYER_LITE_UNSUPPORTED_FEATURE",this.name="VePlayerLiteUnsupportedFeatureError",this.feature=e,Object.setPrototypeOf(this,$U.prototype)}}class XU extends Error{constructor(){super("[VEPLAYER_LITE_UNSUPPORTED_ENVIRONMENT] 当前环境不支持 Lite 版本使用"),this.code="VEPLAYER_LITE_UNSUPPORTED_ENVIRONMENT",this.name="VePlayerLiteUnsupportedEnvironmentError",Object.setPrototypeOf(this,XU.prototype)}}function qU(e){return"object"==typeof e&&null!==e||"function"==typeof e}function ZU(e,t){if(qU(e))try{return e[t]}catch(ds){return}}function QU(e){try{return Array.isArray(e)}catch(ds){return!1}}function JU(e){if(!QU(e))return[];const t=ZU(e,"length");if("number"!=typeof t||t<0||t>4294967295||Math.floor(t)!==t)return[];const i=[];for(let n=0;n<t;n+=1)i.push(ZU(e,String(n)));return i}function eB(e){return null!=e&&!1!==e}function tB(e){return"string"==typeof e?e.toLowerCase():""}function iB(e){return"string"==typeof e&&e.split(/[?#]/,1)[0].toLowerCase().endsWith(".sdp")}function nB(e){return YU.some((t=>function(e){const t=[e],i=new WeakSet;for(let n=0;n<t.length;n+=1){const e=t[n];if(iB(e))return!0;if(qU(e)&&!i.has(e))if(i.add(e),QU(e))for(const i of JU(e))t.push(i);else for(const i of YU)t.push(ZU(e,i))}return!1}(ZU(e,t))))}function rB(e){if("string"==typeof e)return[e];if(!qU(e))return[];const t=[],i=ZU(e,"pluginName"),n=ZU(e,"name");return"string"==typeof i&&t.push(i),"string"==typeof n&&t.push(n),t}function oB(e,t){return zU.some((i=>JU(ZU(e,i)).some((e=>function(e){const t=rB(e);return t.push(...rB(ZU(e,"plugin"))),t.push(...rB(ZU(e,"preset"))),t}(e).some((e=>function(e,t){const{compact:i,parts:n}=function(e){const t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().replace(/[\s_]+/g,"-").replace(/-+/g,"-");return{compact:t.replace(/-/g,""),parts:t.split("-")}}(t);switch(e){case"live":return"timeshiftplugin"===i||"liveinfopanel"===i||i.startsWith("livesubtitles");case"rtm":return"rtm"===i||"rtmplugin"===i;case"music":return i.includes("music");case"danmu":return i.includes("danmu");case"ad":return n.some((e=>"ad"===e||"ads"===e))||["ad","ads","adplugin","adsplugin"].includes(i)}}(t,e)))))))}function aB(e,t){switch(t){case"live":return!0===ZU(e,"isLive")||"live"===tB(ZU(e,"type"))||eB(ZU(e,"TimeShiftPlugin"))||eB(ZU(e,"LiveInfoPanel"))||eB(ZU(e,"LiveSubtitlesPlugin"))||eB(ZU(e,"LiveSubtitlesIconPlugin"));case"rtm":return"rtm"===tB(ZU(e,"streamType"))||eB(ZU(e,"rtm"))||nB(e);case"music":return!0===ZU(e,"isMusic")||eB(ZU(e,"music"));case"danmu":{const t=ZU(e,"getVideoByToken");return eB(ZU(e,"DanmuPlugin"))||!0===ZU(e,"needBarrageMask")||!0===ZU(t,"needBarrageMask")}case"ad":return eB(ZU(e,"AdsPlugin"))||eB(ZU(e,"AdPlugin"))}}function sB(e){const t=function(e){const t=[],i=[e],n=new WeakSet;for(let r=0;r<i.length;r+=1){const e=i[r];if(qU(e)&&!n.has(e)){n.add(e),t.push(e);for(const t of WU)i.push(ZU(e,t));for(const t of JU(ZU(e,"playList")))i.push(t)}}return t}(e);for(const i of GU)if(t.some((e=>aB(e,i)||oB(e,i))))throw new $U(i)}const lB=()=>Ur.generateSessionId(),cB=e=>"number"==typeof e&&Number.isFinite(e)&&e>=0?e:0,uB=e=>c({},e),hB=(e,t)=>t.lastEnteredPlayingAt-e.lastEnteredPlayingAt||t.sequence-e.sequence,dB=(e,t)=>t.lastPlaybackAt-e.lastPlaybackAt||t.sequence-e.sequence,fB=(e,t)=>t.createdAt-e.createdAt||t.sequence-e.sequence,pB=(e,t,i="creating")=>({playbackSessionId:t,playbackState:i,isEnded:!1,isPaused:!1,isBeforePlayerCreate:!0,albumId:e.albumId,episodeId:e.episodeId,duration:0,currentTime:0});const gB=new class{constructor(e=Date.now,t=lB){this.now=e,this.createPlaybackSessionId=t,this.sessions=new Map,this.transactionResolvers=new WeakMap,this.historical=null,this.sequence=0}register(e,t){const i=this.now(),n=++this.sequence,r=this.createPlaybackSessionId();this.sessions.set(e,{vePlayer:e,playbackSessionId:r,pendingPlaybackSessionId:null,identity:c({},t),pendingIdentity:null,identitySwitchCore:null,pendingTransaction:null,identitySwitchArmed:!1,identitySwitchIsSameCore:!1,useStableSnapshot:!1,core:null,state:"creating",creationFailed:!1,hasEverPlayed:!1,isBuffering:!1,createdAt:i,lastEnteredPlayingAt:0,lastPlaybackAt:0,sequence:n,lastStableSnapshot:pB(t,r)})}has(e){return this.sessions.has(e)}beginCoreCreate(e,t){const i=this.sessions.get(e);i&&(!this.matchesPendingTransaction(i,t)&&i.pendingTransaction||(i.core=null,i.state="creating",i.creationFailed=!1,i.isBuffering=!1,this.matchesPendingTransaction(i,t)&&(i.identitySwitchCore=null,i.identitySwitchArmed=!1,i.identitySwitchIsSameCore=!1)))}failCoreCreate(e,t){const i=this.sessions.get(e);i&&(!this.matchesPendingTransaction(i,t)&&i.pendingTransaction||(i.core=null,i.state="error",i.creationFailed=!0,i.isBuffering=!1,this.matchesPendingTransaction(i,t)&&this.rollbackIdentitySwitch(e,t)))}attachCore(e,t,i){var n;const r=this.sessions.get(e);if(r&&(this.matchesPendingTransaction(r,i)||!r.pendingTransaction)){r.core=t,r.state="ready",r.creationFailed=!1,r.isBuffering=!1,this.matchesPendingTransaction(r,i)&&(r.identitySwitchCore=t,r.identitySwitchArmed=!0,r.identitySwitchIsSameCore=!1);for(const i of["play","playing","waiting","canplay","timeupdate","pause","ended","error"])null==(n=t.on)||n.call(t,i,(()=>this.handleCoreEvent(e,t,i)))}}handleCoreEvent(e,t,i){const n=this.sessions.get(e);if(n&&n.core===t&&("error"!==i&&"canplay"!==i||!n.pendingTransaction||n.identitySwitchArmed||n.identitySwitchCore!==t)){if("play"===i||"playing"===i){const e="playing"!==n.state,t=this.now();return n.hasEverPlayed=!0,n.isBuffering=!1,n.state="playing",n.lastPlaybackAt=t,void(e&&(n.lastEnteredPlayingAt=t))}if("waiting"!==i){if(n.isBuffering=!1,"canplay"===i)return n.pendingTransaction?n.identitySwitchArmed&&n.identitySwitchCore===t&&this.commitIdentitySwitch(e,n.pendingTransaction):(n.useStableSnapshot=!1,n.lastStableSnapshot=null),void(n.hasEverPlayed||(n.state="ready"));if("timeupdate"!==i)if("pause"!==i){if("ended"===i)return n.hasEverPlayed=!0,n.lastPlaybackAt=this.now(),void(n.state="ended");n.state="error",n.pendingTransaction&&n.identitySwitchArmed&&n.identitySwitchCore===t&&this.rollbackIdentitySwitch(e,n.pendingTransaction)}else n.hasEverPlayed&&(n.lastPlaybackAt=this.now(),n.state="paused");else n.hasEverPlayed&&(n.lastPlaybackAt=this.now(),n.state=t.paused?"paused":"playing")}else n.hasEverPlayed&&(n.isBuffering=!0,n.state="buffering")}}beginIdentitySwitch(e,t,i,n=!1,r){const o=this.sessions.get(e);if(!o)return null;if(!!o.pendingIdentity||!!o.pendingPlaybackSessionId){if(!this.matchesPendingTransaction(o,r))return null}else o.lastStableSnapshot=this.snapshotSession(o,null!=i?i:o.core).snapshot,o.identitySwitchCore=null!=i?i:o.core,o.identitySwitchArmed=!1,o.identitySwitchIsSameCore=!0,o.pendingTransaction=this.createIdentitySwitchTransaction();return o.pendingIdentity=c({},t),n&&!o.pendingPlaybackSessionId&&(o.pendingPlaybackSessionId=this.createPlaybackSessionId()),o.useStableSnapshot=!0,o.pendingTransaction}armIdentitySwitch(e,t,i){const n=this.sessions.get(e);return!(!n||n.core!==i||!this.matchesPendingTransaction(n,t))&&(n.identitySwitchCore=i,n.identitySwitchArmed=!0,n.identitySwitchIsSameCore=!0,!0)}hasActiveIdentitySwitch(e){var t;return!!(null==(t=this.sessions.get(e))?void 0:t.pendingTransaction)}commitIdentitySwitch(e,t){const i=this.sessions.get(e);if(!i||!i.pendingIdentity&&!i.pendingPlaybackSessionId||!this.matchesPendingTransaction(i,t))return;i.pendingIdentity&&(i.identity=i.pendingIdentity),i.pendingPlaybackSessionId&&(i.playbackSessionId=i.pendingPlaybackSessionId),i.pendingIdentity=null,i.pendingPlaybackSessionId=null,i.identitySwitchCore=null,i.identitySwitchArmed=!1,i.identitySwitchIsSameCore=!1;const n=i.pendingTransaction;i.pendingTransaction=null,i.useStableSnapshot=!1,i.lastStableSnapshot=null,this.settleTransaction(n)}rollbackIdentitySwitch(e,t){const i=this.sessions.get(e);if(!i||!this.matchesPendingTransaction(i,t))return;const n=!i.identitySwitchIsSameCore&&!!i.core&&i.core===i.identitySwitchCore,r=i.identitySwitchIsSameCore&&!!i.core&&i.core===i.identitySwitchCore;i.pendingIdentity=null,i.pendingPlaybackSessionId=null,i.identitySwitchCore=null,i.identitySwitchArmed=!1,i.identitySwitchIsSameCore=!1;const o=i.pendingTransaction;i.pendingTransaction=null,i.useStableSnapshot=!r&&!!i.lastStableSnapshot,r&&(i.lastStableSnapshot=null),n&&(i.core=null),this.settleTransaction(o)}destroy(e,t){const i=this.sessions.get(e);if(!i)return;const n=i.useStableSnapshot&&i.lastStableSnapshot?this.rank(i,uB(i.lastStableSnapshot)):this.snapshotSession(i,null!=t?t:i.core);n.snapshot=u(c({},n.snapshot),{playbackState:"destroyed",isBeforePlayerCreate:!1}),n.state="destroyed",this.settleTransaction(i.pendingTransaction),this.sessions.delete(e),n.hasEverPlayed&&(!this.historical||dB(n,this.historical)<0)&&(this.historical=n)}query(e){const t=[];for(const o of this.sessions.values()){if((o.pendingIdentity||o.pendingPlaybackSessionId||o.useStableSnapshot)&&o.lastStableSnapshot){t.push(this.rank(o,uB(o.lastStableSnapshot)));continue}const i=e.find((e=>e===o.core&&e.sdk===o.vePlayer));try{const e=this.snapshotSession(o,null!=i?i:null);o.lastStableSnapshot=uB(e.snapshot),t.push(e)}catch(ds){o.lastStableSnapshot&&t.push(this.rank(o,uB(o.lastStableSnapshot)))}}const i=t.filter((e=>"playing"===e.state||"buffering"===e.state)).sort(hB)[0];if(i)return uB(i.snapshot);const n=t.filter((e=>e.hasEverPlayed)).concat(this.historical?[this.historical]:[]).sort(dB)[0];if(n)return uB(n.snapshot);const r=t.sort(fB)[0];return r?uB(r.snapshot):null}resetForTests(){this.sessions.clear(),this.historical=null,this.sequence=0}createIdentitySwitchTransaction(){let e;const t={settled:new Promise((t=>{e=t}))};return this.transactionResolvers.set(t,e),t}settleTransaction(e){if(!e)return;const t=this.transactionResolvers.get(e);t&&(this.transactionResolvers.delete(e),t())}matchesPendingTransaction(e,t){return!!t&&e.pendingTransaction===t}snapshotSession(e,t){if(!t){const t=e.creationFailed?"error":"creating";return this.rank(e,pB(e.identity,e.playbackSessionId,t))}const i=!!t.paused,n=!!t.ended;let r;return r=t.isError||"error"===e.state?"error":n||"ended"===e.state?"ended":e.hasEverPlayed&&i?"paused":e.hasEverPlayed&&e.isBuffering?"buffering":e.hasEverPlayed?"playing":"ready",this.rank(e,{playbackSessionId:e.playbackSessionId,playbackState:r,isEnded:n,isPaused:i,isBeforePlayerCreate:!1,albumId:e.identity.albumId,episodeId:e.identity.episodeId,duration:cB(t.duration),currentTime:cB(t.currentTime)})}rank(e,t){return{snapshot:t,state:t.playbackState,hasEverPlayed:e.hasEverPlayed,createdAt:e.createdAt,lastEnteredPlayingAt:e.lastEnteredPlayingAt,lastPlaybackAt:e.lastPlaybackAt,sequence:e.sequence}}};window.Player||(window.Player=Wa);const yB=class{constructor(e){this.player=null,this.mountingDom=null,this.playerContainer=null,this.mobilePanel=null,this._lastSelectedAudioTrack=null,this._suppressAudioTrackMemory=!1,this._suppressAudioTrackMemoryTimer=null,this._playNextPending=!1,this._isCollectingCreatePlayerPerf=!1,this._getDramaInfoPerfRecords=[],this._isFirstCreated=!0,this.sdkPlugins=[],this._sdkPlugins={},this.delayError=[],this._publicPlayNextOperation=null,this._lifecycleGeneration=0,this._isVolcengine=!1,this._originConfigs={},this.delayEvents=[],this.createPlayer=e=>d(this,null,(function*(){const t=this._lifecycleGeneration||0;gB.beginCoreCreate(this,e);try{const i=yield this._createPlayer(e,t);return this._isStaleLifecycleGeneration(t)?void this._discardStalePlayer(i):i}catch(dF){throw gB.failCoreCreate(this,e),dF}})),this._createPlayer=(e,...t)=>d(this,[e,...t],(function*(e,t=this._lifecycleGeneration||0){var i,n,r,o,a,s,l;this._createPlayerPerf=new Us,this._isCollectingCreatePlayerPerf=!0;const f=this._createPlayerPerf;if(yield f.measureAsync("destroyPlayer",(()=>d(this,null,(function*(){yield this._destroyPlayer()})))),this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();if(yield this.beforePlayerCreate(),this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();sB(this.playerData);const{options:p,plugins:g,isMobile:y,openSoftDecoding:v,configs:m,strategiesPlugins:_,strategiesPluginConfigs:E}=this.playerData,T=!1,S=this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),b=this.playerData.getCurrentStreamType()||Ts(null==m?void 0:m.getVideoByToken);$s(m,"EncryptHlsPlugin")||S&&b||this.playerData.isOpenABR()||(ss.warn(`url is empty or streamType is empty (url:${S}, streamType: ${b})`),this.renderPoster());const C=()=>d(this,null,(function*(){const e=ol(S);return yield this.getSoftDecodingOption(v,e,b)})),k=yield f.measureAsync("createSDKPreset",(()=>d(this,null,(function*(){return yield EN({isLive:T,isMobile:y,streamType:b,playerData:this.playerData,getSoftOptionTask:C},this)}))));if(this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();const{presets:I,softDecodingOption:P,plugins:D}=k,w=y?function(e=!1){const t=c({},LN),i=c({},e?NN:MN);return c(c({},t),i)}(T):function(e=!1){const t=c({},AN),i=c({},e?RN:xN);return c(c({},t),i)}(T),{basicPlugins:A=[],iconPlugins:R=[]}=this._analyzeExtendPlugins(),x=P||{},{plugins:O=[]}=x,L=h(x,["plugins"]),N=this.getDefinitionConfig(),M=Ur.deepMerge(w,p),U=u(c(u(c(c(c({},{errorKey:kR}),M),L||{}),{definition:N,icons:c(c(c({},w.icons),{}),null!=(i=null==p?void 0:p.icons)?i:{}),MoreButtonPlugin:{iconPlugins:[...null!=(r=null==(n=p.MoreButtonPlugin)?void 0:n.iconPlugins)?r:[],...R,$N,VN,ZN]}}),E),{playerData:this.playerData});this.playerData.getLineList().length>1&&U.MoreButtonPlugin.iconPlugins.push(WN),this.setDefaultConfigOptions(U);const B=function(e){const t=[];return e.forEach((e=>{t.find((t=>{var i,n;return(null==(i=null==t?void 0:t.pluginName)?void 0:i.toLowerCase())===(null==(n=null==e?void 0:e.pluginName)?void 0:n.toLowerCase())}))||t.push(e)})),t}([...A,...g,...D,...O,..._]),F=(null!=(o=null==U?void 0:U.ignores)?o:[]).some((e=>"sdkunmuteplugin"===(e+"").toLowerCase()));U.ignores=[...null!=(a=null==U?void 0:U.ignores)?a:[],...F?["AutoplayPlugin"]:[]],this._isFirstCreated?this._isFirstCreated=!1:(U.autoplayMuted=!1,U.ignores=[...null!=(s=null==U?void 0:U.ignores)?s:[],"sdkUnmutePlugin"]),this.setPluginConfig(U);const H={},j=null==(l=yB.ttDramaEnv)?void 0:l.videoSecurityModule;if(null==j?void 0:j.generateSignature){const e=yield f.measureAsync("videoSecuritySignature",(()=>d(this,null,(function*(){return yield j.generateSignature()}))));e&&(H["data-tt-sign"]=e)}if(this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();this._emitter.emit(NA.READY_CREATE_PLAYER);let V,K={};if(yB.shouldCheckLicense()){const e=yield yB.checkLicenseStatus();e!==bA.LICENSE_STATUS_OK&&e!==bA.LICENSE_STATUS_EXPIRED&&(K={progress:{closeMoveSeek:!0,isCloseClickSeek:!0},sdkErrorPlugin:{isNeedRefreshButton:!1}})}if(this._isStaleLifecycleGeneration(t))return this._cancelStalePlayerCreation();if(f.measure("instantiatePlayer",(()=>{var e;V=new Wa(u(c(c({el:this.playerContainer,presets:I,url:S,isLive:!1},U),K),{videoAttributes:c(c({},null!=(e=U.videoAttributes)?e:{}),H),plugins:[...B]}))})),this._isStaleLifecycleGeneration(t))return this._discardStalePlayer(V),this._cancelStalePlayerCreation();this.player=V,V.playerData=this.playerData,V.sdk=this,gB.attachCore(this,V,e);const G=f.finish();return this._isCollectingCreatePlayerPerf=!1,this._lastCreatePlayerPerfReport=G,this.emit(NA.CREATE_PLAYER_PERF,G),ss.log("createPlayer perf: ",G),this._emitter.emit(NA.PLAYER_CREATED_FINISH),this.afterPlayerCreate(),V})),this._onMp4PreloadInfo=e=>{this.emit(MA.PRELOAD_INFO,e)},this._proxyError=e=>this.emit(FA.ERROR,e),this._onError=e=>{var t;const{errorCode:i,httpCode:n,mediaError:r}=e||{};if(Ur.isMSE(null==(t=this.player)?void 0:t.media))n+""!="403"&&i+""!="9203"||this._emitExpireEvent("error",e);else if(4===(null==r?void 0:r.code)||2===(null==r?void 0:r.code)){const t=ol(this.playerData.getCurrentUrl());t&&Ls(t,{range:"0-8",timeout:2e3}).then((t=>{ss.log("xhr result",t);const{status:i,response:n}=t;403===i&&"string"==typeof n&&n.includes("expire")&&this._emitExpireEvent("error",e)})).catch((e=>{ss.log("xhr error",e)}))}},this._onNativeAddTrack=()=>{var e,t;if(this._getHlsInstance())return;this._playNextPending=!1;const i=null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks;if(!i)return;const n=[];for(let r=0;r<i.length;r++){const e=i[r];n.push({id:e.id,name:e.label||e.language||e.id,lang:e.language,default:e.enabled,selected:e.enabled})}this._applyAudioPreferenceNative(i),this._emitter.emit(NA.AUDIO_TRACKS_UPDATED,{audioTracks:n})},this._onNativeTrackChange=()=>{var e,t;if(this._getHlsInstance())return;const i=null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks;if(i)for(let n=0;n<i.length;n++){const e=i[n];if(e.enabled){const t={id:n,name:e.label||e.language||String(n),lang:e.language,default:e.enabled,selected:!0};this._playNextPending||(this._lastSelectedAudioTrack=t),this._emitter.emit(NA.AUDIO_TRACK_CHANGE,{id:n,audioTrack:t});break}}},function(e){if(!e)throw new XU}(Boolean(yB.ttDramaEnv)),this.assertLiteConfig(e),gB.register(this,gU(e)),this._init(e)}static getPlayerPlaybackState(){var e,t,i;const n=null!=(i=null==(t=null==(e=Wa.instManager)?void 0:e.findAll)?void 0:t.call(e,(e=>!!(null==e?void 0:e.sdk)&&gB.has(e.sdk))))?i:[];return gB.query(n)}static registerModules(e){cA.registerModules(e)}static setAppendVideoUrlTimestamp(e=!0){!function(e=!0){oU=!!e}(e)}static getAppendVideoUrlTimestamp(){return oU}static setTTDramaEnv(e){var t;ss.log("TTDramaEnv: ",e);yB.ttDramaEnv=u(c({},e),{channel:null!=(t=e.channel)?t:"byteplus"})}static setMediaInfoCacheConfig(e){!function(e){e?("boolean"==typeof e.enable&&(rM.enable=e.enable),e.cacheType&&(rM.cacheType=e.cacheType),"number"==typeof e.expireTime&&Number.isFinite(e.expireTime)&&e.expireTime>0?rM.expireTime=e.expireTime:void 0!==e.expireTime&&sM("config ignore invalid expireTime",{expireTime:e.expireTime,currentExpireTime:rM.expireTime}),"number"==typeof e.maxEntries&&Number.isFinite(e.maxEntries)&&e.maxEntries>0?rM.maxEntries=Math.floor(e.maxEntries):void 0!==e.maxEntries&&sM("config ignore invalid maxEntries",{maxEntries:e.maxEntries,currentMaxEntries:rM.maxEntries}),sM("config updated",cM())):sM("config skip empty config",{currentConfig:cM()})}(e)}static getMediaInfoCacheConfig(){return cM()}static clearMediaInfoCache(){uM()}static prefetchMediaInfo(e){return function(e,t){return d(this,null,(function*(){if(!Array.isArray(e))throw new TypeError("sources must be an array");if(!e.length)return[];if(Kr.os.isAndroid&&!0===(null==t?void 0:t.canIUseGetDramaInfo)&&!t.canAndroidBatchGetDramaInfo){const i=[];for(const n of e)i.push(yield BU(n,t));return i}return Promise.all(e.map((e=>BU(e,t))))}))}(e,yB.ttDramaEnv)}static setDebug(e){!function(e){ss.config.debug=e?3:1}(e)}static setCollector(e){Bs=e}static shouldCheckLicense(){return!1}static prepare(e){return d(this,null,(function*(){let t=e;const i=Boolean(yB.ttDramaEnv);!(null==t?void 0:t.appId)&&i&&(t=u(c({},t),{appId:TR}));const n=null==t?void 0:t.serviceConfigMode,r=function(e,t){return"remote"===e||"local-only"===e?e:t?"local-only":"remote"}(n,i);void 0!==n&&"remote"!==n&&"local-only"!==n&&ss.warn("[VePlayer.prepare] Invalid serviceConfigMode; using the environment default.");const o=function(e){var t,i;const n=null==(t=null==e?void 0:e.strategies)?void 0:t.preload,r="boolean"==typeof n;if(!n||!r&&(null==n?void 0:n.disabled))return e;const o=r?{}:n;return u(c({},e),{strategies:u(c({},e.strategies),{preload:u(c({},o),{[AU]:!0,config:u(c({},null!=(i=null==o?void 0:o.config)?i:{}),{[AU]:!0})})})})}(u(c({},t),{serviceConfigMode:r}));if(yB.shouldCheckLicense())try{yB.hasInitVeStrategy=!0;const e=yield yB.checkLicenseStatus(),t=yield yB.checkLicense();if(e===bA.LICENSE_STATUS_INVALID)throw new Error("LICENSE_STATUS_INVALID");if(t===EA.EDITION_STANDARD)throw new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(dF){return void ss.error(dF.message)}else yB.hasInitVeStrategy=!0;yield yA.init(o)}))}static setPreloadScene(e,t){return yA.setPreloadScene(e,t)}static get preloader(){return yA.preloader}static get preloaderStatus(){return yA.preloaderStatus}static addPreloadList(e){return KU(e,yB.ttDramaEnv).then((e=>((null==e?void 0:e.length)||ss.warn("[addPreloadList] resolved preloadList is empty"),yA.addPreloadList(e))))}static setPreloadList(e){return KU(e,yB.ttDramaEnv).then((e=>((null==e?void 0:e.length)||ss.warn("[setPreloadList] resolved preloadList is empty"),ss.log("[setPreloadList] resolved preloadList:",JSON.stringify(e)),yA.setPreloadList(e))))}static setLicenseConfig(e){return CA.setLicenseConfig(e)}static checkLicense(){return CA.checkLicense()}static checkModuleList(){return CA.checkModuleList()}static checkLicenseStatus(){return CA.checkLicenseStatus()}static checkLicenseModuleAuth(e,t){return CA.checkLicenseModuleAuth(e,t)}static generateEncryptInfo(e,t){return d(this,null,(function*(){try{const i={hls:Hw.HLSEncrypt,mp4:Hw.MP4Encrypt,dash:Hw.DASH};if(!t||!i[t])return void ss.warn("param of streamType is invalid");const n=(new Date).getTime().toString(),r="mp4"===t?yield Kw.loadMp4Encrypt(uA):yield uA.loadPlugins(i[t]);return null==r?void 0:r.generateEncryptInfo(e,n)}catch(i){ss.error("generate encrypt info error: ",i)}}))}assertLiteConfig(e){sB(e)}_init(e,t){return d(this,null,(function*(){var i;if(yB.ttDramaEnv){!(!e.url&&!e.playList)&&this.delayError.push(this._buildDramaInvalidParamError())}this._emitter=new Rr,this.renderDom({id:null==e?void 0:e.id,root:null==e?void 0:e.root});const n=yB.shouldCheckLicense()&&!(null==e?void 0:e.isLive)?yield yB.checkModuleList():Object.values(SA);this.playerData=hr.observe(new kA(u(c({},e),{licensSupportModuleList:n}),this)),this.adapter=this.playerData.adapter,this.initUmdLoader(e),this.on(NA.TOKEN_EXPIRED,this.onTokenExpiredAction.bind(this)),this.checkVodLogOptions(),this._initSdkPlugins();this.createPlayer(t).catch((e=>{if("VEPLAYER_LITE_UNSUPPORTED_FEATURE"===(null==e?void 0:e.code))return ss.error("createPlayer error:",e),void this.emit(FA.ERROR,e);throw e})),this._initI18N(this.playerData.languageData),this._originConfigs={autoBitrateOpts:{enable:null==(i=null==e?void 0:e.autoBitrateOpts)?void 0:i.enable},useSoftDecoding:null==e?void 0:e.useSoftDecoding}}))}_initSdkPlugins(){kU.init(this);[...this.sdkPlugins].map((e=>kU.registerPlugin(e,this)))}_initCheckExpire(){this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null);const{enableUrlExpireCheck:e,urlCheckExpireInterval:t}=this.playerData.urlCheckData;e&&(this.checkExpireTimer=new js,this.checkExpireTimer.repeat(this._onRepeat.bind(this),t)),this.on(MA.MEDIA_EXPIRED,this._onMediaExpiredAction.bind(this))}initUmdLoader(e){this.sdkUmdLoader=new cA,this.updateUmdLoader(this.sdkUmdLoader,e)}updateUmdLoader(e,t){const{umdUrlMap:i,region:n,userRegion:r,pluginPublicPath:o,plugins:a=[]}=t;e.failCallback=(e,t)=>this.umdLoadErr(e,t),i&&"object"==typeof i&&e.updateBackupMap(t.umdUrlMap),e.region=n,e.userRegion=r,o&&"string"==typeof o&&(e.customPluginPublicPath=o),e.importedPlugins=a}checkVodLogOptions(){var e;const{isLive:t,configs:i}=this.playerData,n=$s(i,"vodLogOpts");if(!t&&!i.disableVodLogOptsCheck){if(null==(e=yB.ttDramaEnv)?void 0:e.clientKey)return;if(!(null==n?void 0:n.line_app_id)){const e={errorType:"log",errorCode:yR.VOD_LOG_NOT_CONFIGURED.code,errorMessage:"vod log options not configured or configured correctly",ext:{},originError:void 0};this.delayError.push(e)}}}umdLoadErr(e,t){this.emit(NA.UMD_LOAD_FAIL,{name:e,error:t})}_onRepeat(){const{urlExpireTimestamp:e,urlExpireDiff:t=60}=this.playerData.urlCheckData;Math.round((new Date).getTime()/1e3)>=e-t&&(this.playerData.urlCheckData.urlExpireTimestamp=qa,this._emitExpireEvent("time"))}_emitExpireEvent(e="error",t){const i=Math.round((new Date).getTime()/1e3),n={errorCode:-499897,errorType:"network",errorMessage:"url expire",url:this.playerData.getCurrentUrl(),httpCode:403,version:"1.18.0",ext:this,detectType:e,urlCheckData:this.playerData.urlCheckData,originError:t,from:"veplayer"};this.emitExpireTimestamp?i-this.emitExpireTimestamp>300&&(this.emitExpireTimestamp=i,ss.warn("media is expired, ",n),this.emit(FA.MEDIA_EXPIRED,n)):(this.emitExpireTimestamp=i,ss.warn("media is expired, ",n),this.emit(FA.MEDIA_EXPIRED,n))}on(e,t){this._emitter.on(e,t)}emit(e,t){this._emitter.emit(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}renderDom({id:e,root:t}){const i=document.createElement("div");this.playerContainer=i;const n=t||document.querySelector(`#${e}`);n&&(n.appendChild(i),this.mountingDom=n)}renderPoster(){if(!this.playerContainer)return;const{poster:e="",width:t,height:i}=this.playerData.options;("string"==typeof e?e:null==e?void 0:e.poster)&&(this.playerContainer.style.cssText=`background: url("${e}");\n background-size: cover;\n width:${t?t+"px":"100%"};\n height:${i?i+"px":"100%"};\n `)}getDefinitionConfig(){var e;const{current:{lineId:t},isVidEncrypt:i,configs:n,options:r}=this.playerData,o="hls"===(this.playerData.getCurrentStreamType()||Ts(null==n?void 0:n.getVideoByToken))&&i&&!!(null==(e=$s(r,"EncryptHlsPlugin"))?void 0:e.keyToken);let a=this.playerData.getDefinitionListByLineId(t).map((e=>o?function(e,t){const i=c({},e);return t.forEach((e=>delete i[e])),i}(e,["secretKey","playAuth"]):e)),s=this.playerData.current.definition;return this.playerData.isOpenABR()&&(s=this.playerData.defaultDefinition,a=(null==a?void 0:a.length)&&!this.adapter.needAbrAutoDefinition()?a.filter((e=>!this.playerData.isAutoDefinition(e.definition))):a),{defaultDefinition:s,list:a}}checkLicenseCallback(){return d(this,null,(function*(){var e,t,i,n,r,o,a,s,l,h,d,f,p;const g=yield yB.checkLicense(),y=yield yB.checkLicenseStatus();if(this.player.licenseLogInfo={licenseStatus:y,licenseType:g},y===bA.LICENSE_STATUS_EXPIRED)CA.renderLogo(this.playerContainer),!this.playerData.isOpenABR()&&(null==(t=null==(e=null==this?void 0:this._originConfigs)?void 0:e.autoBitrateOpts)?void 0:t.enable)&&this.emit(NA.LICENSE_STATUS_WARNING,vR.EXPIRED_LICENSE_NOT_SUPPORT_ABR),(null==(n=null==(i=this.playerData.configs)?void 0:i.adaptRange)?void 0:n.enable)&&this.emit(NA.LICENSE_STATUS_WARNING,vR.EXPIRED_LICENSE_NOT_SUPPORT_ADAPT_BUFFER),!0===yB.hasInitVeStrategy&&this.emit(NA.LICENSE_STATUS_WARNING,vR.EXPIRED_LICENSE_NOT_SUPPORT_PRELOAD);else if(y!==bA.LICENSE_STATUS_OK){null==(r=this.player.plugins.controls)||r.destroy(),null==(o=this.player.plugins.play)||o.destroy(),null==(a=this.player.plugins.sdkdefinitionplugin)||a.hide(),null==(s=this.player.plugins.definitionmobileplugin)||s.destroy(),null==(l=this.player.media)||l.removeAttribute("src");const e=u(c({errorType:mR.license},y===bA.LICENSE_STATUS_INVALID?{errorCode:yR.LICENSE_STATUS_INVALID.code,errorMessage:yR.LICENSE_STATUS_INVALID.message}:{errorCode:yR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH.code,errorMessage:yR.LICENSE_STATUS_ERROR_DOMAIN_NOT_MATCH.message}),{ext:{},originError:void 0});this.delayError.push(e)}else g===EA.EDITION_STANDARD&&(!this.playerData.isOpenABR()&&(null==(d=null==(h=this._originConfigs)?void 0:h.autoBitrateOpts)?void 0:d.enable)&&this.emit(NA.LICENSE_STATUS_WARNING,vR.BASE_LICENSE_NOT_SUPPORT_ABR),(null==(p=null==(f=this.playerData.configs)?void 0:f.adaptRange)?void 0:p.enable)&&this.emit(NA.LICENSE_STATUS_WARNING,vR.BASE_LICENSE_NOT_SUPPORT_ADAPT_BUFFER),!0===yB.hasInitVeStrategy&&this.emit(NA.LICENSE_STATUS_WARNING,vR.BASE_LICENSE_NOT_SUPPORT_PRELOAD))}))}setPluginConfig(e){var t,i,n,r,o;const{apiMap:a,configs:s,unionInfo:l,playList:h,useHlsPluginForSafari:d,isMobile:f}=this.playerData,p=this.playerData.getCurrentStreamType()||Ts(null==s?void 0:s.getVideoByToken),g=$s(s,"EncryptHlsPlugin"),y=$s(e,"EncryptHlsPlugin"),v=$s(s,"Mp4EncryptPlayer"),m=$s(e,"Mp4EncryptPlayer"),_=$s(s,"DASHPlugin"),E=$s(e,"DASHPlugin"),T=$s(s,"vodLogOpts"),S=(null==(t=yB.ttDramaEnv)?void 0:t.clientKey)?{appVersion:yB.ttDramaEnv.appVersion,clientKey:yB.ttDramaEnv.clientKey,line_app_id:TR,line_user_id:Rs(yB.ttDramaEnv.clientKey)}:{},b=!!(null==(i=null==h?void 0:h[0])?void 0:i.kid)||!!g;g&&(e.EncryptHlsPlugin=c(c(c({playDomain:a.playDomain,getKeyType:"TOP",preferMMS:!0,preferMMSStreaming:!0},f||!il||d?{}:{useHls:!1}),y||{}),g)),v&&(e.Mp4EncryptPlayer=c(c({playDomain:a.playDomain,preferMMS:!0,getKeyType:"TOP"},m||{}),v)),_&&(e.DASHPlugin=c(c({playDomain:a.playDomain,getKeyType:"TOP"},E||{}),_));const{vid:C}=s,{encryptSessionId:k,current:I,drmType:P}=this.playerData,{kid:D,secretKey:w}=I;if(P===or.PRIVATE_ENCRYPT_UPGRADE&&k&&w&&("hls"===p?e.EncryptHlsPlugin=c(c({vid:C,kid:D,useUnionInfoDRM:!0,sessionId:k,drmType:or.PRIVATE_ENCRYPT_UPGRADE,keyTokenExpiredDuration:9999999,secretKey:w,preferMMS:!0,preferMMSStreaming:!0},y||{}),g||{}):"dash"===p?e.DASHPlugin=c(c({playInfoType:"TOP",useEME:!0,keyTokenExpiredDuration:9999999,useUnionInfoDRM:!0,defaultFormat:"dash",replayReset:!1,disableBufferBreakCheck:!1,waitingTimeOut:5e3,vid:C,kid:D,drmType:or.PRIVATE_ENCRYPT_UPGRADE,secretKey:w,sessionId:k},E||{}),_||{}):"mp4"===p&&(e.Mp4EncryptPlayer=c(c({vid:C,kid:D,isEncrypt:!0,rangeMaxDuration:10,keyTokenExpiredDuration:9999999,retryCount:3,useUnionInfoDRM:!0,sessionId:k,drmType:or.PRIVATE_ENCRYPT_UPGRADE,secretKey:w,preferMMS:!0},m||{}),v||{}))),s.privateDrmAuthToken&&s.kid&&l&&("hls"===p?e.EncryptHlsPlugin=c(c({kid:s.kid,drmKeyToken:s.privateDrmAuthToken,playDomain:a.playDomain,preferMMS:!0,preferMMSStreaming:!0},y||{}),g||{}):"dash"===p?e.DASHPlugin=c(c({kid:s.kid,drmKeyToken:s.privateDrmAuthToken,playDomain:a.playDomain},E||{}),_||{}):"mp4"===p&&(e.Mp4EncryptPlayer=c(c({kid:s.kid,drmKeyToken:s.privateDrmAuthToken,playDomain:a.playDomain,preferMMS:!0},m||{}),v||{}))),T||S.clientKey){ss.log("codec",this.playerData.codec);const t=nl(this.userRegion,this.region),i=null==t?void 0:t.__LOG_CUSTOM_REGION__,n=null==t?void 0:t.__LOG_CHANNEL_DOMAIN__;e.vodLogOpts=c(c(u(c(c({vtype:(p||"mp4").toUpperCase(),codec_type:this.playerData.codec,drm_type:b?1:0,playerVersion:"1.18.0",channel:null==t?void 0:t.__LOG_CHANNEL__,needXhrCheck:!0,enableTeaWebId:!0},i?{trackerConfig:{log_from_region:null==t?void 0:t.__LOG_CUSTOM_REGION__}}:{}),n?{channelDomain:n}:{}),{ext:this.vodLogCommon}),S),T||{})}null==(n=this.getSdkPlugin("Abr"))||n.applyAbrConfig(e),null==(r=this.getSdkPlugin("AdaptRange"))||r.applyRangeConfig(e),null==(o=this.getSdkPlugin("Strategy"))||o.applyFinalStrategy(e)}detectCodec(e){return d(this,null,(function*(){var t;try{const{LoadProbe:i}=(yield this.sdkUmdLoader.loadPlugins(Hw.StreamProbe))||{};if(i){const n=yield null==(t=new i)?void 0:t.parseUrl(e),{codec:r}=n||{};"bytevc1"===r?this.playerData.codec=tr.H265:"avc"===r&&(this.playerData.codec=tr.H264)}}catch(ds){ss.warn("detect codec error: ",ds)}}))}setDefaultConfigOptions(e){if(!this._isFirstCreated)return;const{defaultConfig:t,isHitDefault:i}=this.playerData;if(!t)return;const{volume:n,startTime:r,DanmuPlugin:o,LiveSubtitlesIconPlugin:a}=null!=t?t:{};n&&(e.volume=e.volume?u(c({},e.volume),{default:n}):n),i&&r&&(e.startTime=r)}getCurrentPlayerConfig(){var e,t;const{isLive:i,current:{lineId:n,definition:r}}=this.playerData,o={type:i?"live":"vod",isLive:i,definition:r,lineId:n,volume:null!=(e=this.player.volume)?e:.6};return i||(o.startTime=null!=(t=this.player.currentTime)?t:0),c({},o)}getStreamType(){var e,t;return this.playerData.getCurrentStreamType()||Ts(null==(t=null==(e=this.playerData)?void 0:e.configs)?void 0:t.getVideoByToken)}_analyzeExtendPlugins(){var e;const{options:t}=this.playerData,i=t.extendPlugin||[],n=null!=(e=null==t?void 0:t.ignore)?e:[],r=[],o=[];return i.forEach((e=>{const t=BN(e);"inner"!==t.type||n[e.pluginName]?r.push(t):o.push(t)})),{basicPlugins:r,iconPlugins:o}}beforePlayerCreate(){return d(this,null,(function*(){const e=this._createPlayerPerf;e?yield e.measureAsync("beforePlayerCreate",(()=>d(this,null,(function*(){yield Promise.all([e.measureAsync("beforePlayerCreate.sdkPlugins",(()=>d(this,null,(function*(){yield kU.beforePlayerCreate(this)})))),e.measureAsync("beforePlayerCreate.prepareStrategies",(()=>d(this,null,(function*(){yield this.prepareStrategies()}))))]),e.measure("beforePlayerCreate.updateConfigByStrategy",(()=>{this.updateConfigByStrategy()}))})))):(yield Promise.all([kU.beforePlayerCreate(this),this.prepareStrategies()]),this.updateConfigByStrategy())}))}getCreatePlayerPerfReport(){return this._lastCreatePlayerPerfReport}recordGetDramaInfoPerf(e){var t,i,n;if(null==e?void 0:e.perfInfo){this._getDramaInfoPerfRecords=this._getDramaInfoPerfRecords||[],this._getDramaInfoPerfRecords.push(e),this._markGetDramaInfoClientPerf(e);try{null==(n=null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.onGetDramaInfoPerf)||n.call(i,e)}catch(r){ss.error("onGetDramaInfoPerf callback error:",r)}}}getDramaInfoPerfRecords(){return[...this._getDramaInfoPerfRecords||[]]}getLastDramaInfoPerf(){const e=this._getDramaInfoPerfRecords||[];return e[e.length-1]}_markGetDramaInfoClientPerf(e){if(!this._isCollectingCreatePlayerPerf||!this._createPlayerPerf)return;const t=e.perfInfo,i=(e,t)=>{var i;"number"==typeof t&&(null==(i=this._createPlayerPerf)||i.markDuration(`beforePlayerCreate.authtoken.getVideoInfo.getVideos.getDramaInfoViaJSB.perfInfo.${e}`,t))};i("prepareCost",t.prepare_cost),i("requestCost",t.request_cost),i("parseCost",t.parse_cost),i("totalCost",t.total_cost)}prepareStrategies(){return d(this,null,(function*(){if(yield yA.prepare()){const{plugins:e,pluginConfiguration:t}=yA.getStrategyRecommendations();this.playerData.strategiesPlugins=e,this.playerData.strategiesPluginConfigs=t}else this.playerData.strategiesPlugins=[],this.playerData.strategiesPluginConfigs={}}))}updateConfigByStrategy(){if(yA.isReady()){const e=yA.getStrategyRecommendations(),{result:t}=e;if(ss.log("vodLogCommon strategyConfig:",t),this.vodLogCommon={strategyResult:t},null==t?void 0:t[hA.H265]){const{configs:e}=this.playerData;if(!e)return;const{url:i,codec:n}=e,r=this.playerData.playList||[],o=r.filter((e=>!e.codec||e.codec===tr.UNKNOWN)),a=r.filter((e=>e.codec===tr.H264)),s=r.filter((e=>e.codec===tr.H265)),l=t[hA.H265].enableH265Hardware,h=er(l?s.concat(a).concat(o):a.concat(o).concat(s),"definition"),d=!l&&!!i&&n===tr.H265&&h.length>0;this.playerData.initPlayData(u(c({},this.playerData.configs),{url:d?null:i,codec:d?tr.UNKNOWN:n,playList:h})),ss.log("hit h265strategy, current playList: ",this.playerData.playList)}}}afterPlayerCreate(){const{isMobile:e,isLive:t}=this.playerData;yB.shouldCheckLicense()&&!t&&this.checkLicenseCallback(),this._setVeError(),this._mountingPlayerPanel(e),this._mountingExtendMethods(),this._bindSdkEvents(),this._bindPlayerEvents(),this._setPlayerInfo(),this._initCheckExpire(),kU.afterPlayerCreate(this)}_setVeError(){var e;const t=this.playerData.configs,i={oriErrRetryCount:t.oriErrRetryCount,oriErrRetryCycle:t.oriErrRetryCycle,oriErrRetryBaseDelay:t.oriErrRetryBaseDelay,oriErrMaxTotalRetry:t.oriErrMaxTotalRetry,enableOriErrRetry:t.enableOriErrRetry,needSyncAnalyzeError:t.needSyncAnalyzeError,analyzeTimeout:t.analyzeTimeout,clientKey:null==(e=yB.ttDramaEnv)?void 0:e.clientKey};this.veErrorIns=new xR(this.player,i)}_emitDelayError(){this.player&&this.delayError.forEach((e=>{this.player.emit(FA.ERROR,e)})),this.delayError=[]}_emitDelayEvent(){this.player&&this.delayEvents.forEach((e=>{const{name:t,payload:i}=e||{};t&&this.emit(t,i)})),this.delayEvents=[]}_setPlayerInfo(){this.player&&(this.player.playerVersion="1.18.0",this.player.vtype=this.getVtype())}getVtype(){var e,t,i;const n=this.getStreamType()||Ts(null==(t=null==(e=this.playerData)?void 0:e.configs)?void 0:t.getVideoByToken),r=Ur.isMSE(this.player.media);return!this.player.playerType&&(this.player.playerType=n,"hls"===(null==n?void 0:n.toLowerCase())&&(null==(i=this.player)?void 0:i.vodLogger))?r?"HLS_MSE":"HLS":n.toUpperCase()}_mountingPlayerPanel(e){var t;const{options:i,isLive:n}=this.playerData;this.player&&e&&(this.mobilePanel=new FN({config:null!=(t=i.panel)?t:{mode:n?$a.INNER:$a.NORMAL,isAutoChange:!0},root:this.player.root,player:this.player}),this.player.panel=this.mobilePanel)}_onPlayerRebuild(){if(!this._publicPlayNextOperation&&!gB.hasActiveIdentitySwitch(this))return this.createPlayer()}_getPlayerRebuildListener(){return this._playerRebuildListener||(this._playerRebuildListener=()=>this._onPlayerRebuild()),this._playerRebuildListener}_bindPlayerEvents(){var e;if(!this.player)return;this.player.on(NA.PLAYER_REBUILD,this._getPlayerRebuildListener()),this.player.once(FA.READY,this._emitDelayError.bind(this)),this.player.once(FA.READY,this._emitDelayEvent.bind(this)),this.player.on(FA.ERROR,this._onError),this.player.on(kR,this._proxyError);const t=null==(e=this.player.plugins)?void 0:e.mp4encryptplayer;t&&t.on(MA.PRELOAD_INFO,this._onMp4PreloadInfo)}_onMediaExpiredAction(){var e,t;if(this.emitExpireTimestamp=Math.round((new Date).getTime()/1e3),(null==(e=this.playerData)?void 0:e.onMediaExpired)&&"function"==typeof(null==(t=this.playerData)?void 0:t.onMediaExpired)){const e=Ys(this.playerData.onMediaExpired());(null==e?void 0:e.then)&&e.then((e=>this.updateMediaSource(e)))}}updateMediaSource(e){try{this.assertLiteConfig(e)}catch(r){return Promise.reject(r)}const{url:t,playList:i,getVideoByToken:n}=e||{};return t||(null==i?void 0:i.length)?new Promise(((t,n)=>{this.playerData.updateConfigs(e),this.playerData.updatePlayList(),this.playerData.updateCheckExpireData();const r=this.playerData.getCurrentUrl();if(this.player.isError||this.player.state<6&&Kr.isWeixin&&Kr.os.isIos){if(!(null==i?void 0:i.length))return this.playNext(c({},e),!1);{const t=this.playerData.current.definition,n=i.find((e=>e.definition===t));if(n&&n.url)return this.playNext(u(c({},e),{url:n.url}),!1)}}else{this.player.setConfig(u(c({},e),{url:r,definition:this.getDefinitionConfig()}));const i=this.player.switchURL(r,{seamless:!0});i&&i.then?(i.then((()=>t(void 0))),i.catch((()=>n()))):t(void 0)}})):(null==n?void 0:n.playAuthToken)?this.updateAuthToken(n):void 0}onTokenExpiredAction(){var e,t;if((null==(e=this.playerData)?void 0:e.onTokenExpired)&&"function"==typeof(null==(t=this.playerData)?void 0:t.onTokenExpired)){const e=Ys(this.playerData.onTokenExpired());(null==e?void 0:e.then)&&e.then((e=>this.updateAuthToken(e)))}}_bindSdkEvents(){const e=Object.values(Wo).filter((e=>e!==Qr)),t=[...Object.values(MA),...Object.values(NA),...e];[...new Set(t.filter((e=>"string"==typeof e)))].forEach((e=>{"string"==typeof e&&this.player.on(e,((...t)=>{this._emitter.emit(e,...t)}))})),this.player.on("hlsAudioTracksUpdated",(e=>{this._applyAudioPreference(e.audioTracks),this._emitter.emit(NA.AUDIO_TRACKS_UPDATED,e)})),this.player.on("hlsAudioTrackSwitched",(e=>{var t,i,n,r,o;const a=this._getHlsInstance(),s=null==(t=null==a?void 0:a.audioTracks)?void 0:t.find((t=>t.id===e.id));if(this._suppressAudioTrackMemory)this._clearSuppressAudioTrackMemory();else{s&&(this._lastSelectedAudioTrack=s);const e=null!=(r=null==(n=null==(i=this.playerData)?void 0:i.configs)?void 0:n.audioTrackSwitchSeekOffset)?r:.1,t=null==(o=this.player)?void 0:o.media;e>0&&t&&!t.paused&&isFinite(t.currentTime)&&(t.currentTime+=e)}this._emitter.emit(NA.AUDIO_TRACK_CHANGE,u(c({},e),{audioTrack:s}))})),this._bindNativeAudioTrackEvents()}_bindNativeAudioTrackEvents(){var e,t;const i=null==(t=null==(e=this.player)?void 0:e.media)?void 0:t.audioTracks;i&&(i.addEventListener("addtrack",this._onNativeAddTrack),i.addEventListener("change",this._onNativeTrackChange),i.addEventListener("removetrack",this._onNativeAddTrack))}_mountingExtendMethods(){this.player&&(this.player.changePluginsIcon=this.changePluginsIcon.bind(this))}_getHlsInstance(){var e,t,i;const n=null==(e=this.player)?void 0:e.plugins;return(null==(t=null==n?void 0:n.encrypthlsplugin)?void 0:t.hls)||(null==(i=null==n?void 0:n.hls)?void 0:i.hls)}_applyAudioPreference(e){var t,i,n,r;if(!(null==e?void 0:e.length))return;const o=this._getHlsInstance();if(!o)return;const a=null!=(r=null!=(n=this._lastSelectedAudioTrack)?n:null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.audioPreference)?r:{};if(0===Object.keys(a).length)return;this._setSuppressAudioTrackMemory();const s=o;if("function"==typeof s.setAudioOption)s.setAudioOption(zA(a));else{const t=a.lang;if(!t)return void this._clearSuppressAudioTrackMemory();const i=e.findIndex((e=>{var i;return(null==(i=e.lang)?void 0:i.toLowerCase())===t.toLowerCase()}));-1!==i&&o.audioTrack!==i?o.audioTrack=i:this._clearSuppressAudioTrackMemory()}}_setSuppressAudioTrackMemory(){this._suppressAudioTrackMemory=!0,null!==this._suppressAudioTrackMemoryTimer&&clearTimeout(this._suppressAudioTrackMemoryTimer),this._suppressAudioTrackMemoryTimer=setTimeout((()=>{this._suppressAudioTrackMemory=!1,this._suppressAudioTrackMemoryTimer=null}),2e3)}_clearSuppressAudioTrackMemory(){this._suppressAudioTrackMemory=!1,null!==this._suppressAudioTrackMemoryTimer&&(clearTimeout(this._suppressAudioTrackMemoryTimer),this._suppressAudioTrackMemoryTimer=null)}_applyAudioPreferenceNative(e){var t,i,n;if(!(null==e?void 0:e.length))return;const r=[this._lastSelectedAudioTrack,null==(i=null==(t=this.playerData)?void 0:t.configs)?void 0:i.audioPreference];for(const o of r){if(!o)continue;const t=o.id,i=o.lang,r=o.name;if(void 0===t&&!i&&!r)continue;let a=-1;for(let o=0;o<e.length;o++){const s=e[o];if((void 0===t||o===Number(t))&&!(i&&(null==(n=s.language)?void 0:n.toLowerCase())!==i.toLowerCase()||r&&s.label!==r)){a=o;break}}if(-1!==a)return void $A(e,a)}}_offPlayerEvents(){var e;if(!this.player)return;this.player.off(NA.PLAYER_REBUILD,this._getPlayerRebuildListener()),this.player.off(FA.ERROR,this._onError),this.player.off(kR,this._proxyError);const t=null==(e=this.player.plugins)?void 0:e.mp4encryptplayer;null==t||t.off(MA.PRELOAD_INFO,this._onMp4PreloadInfo)}changePluginsIcon(e,t){var i;if(!this.player)return;const n=this.player.getPlugin(e);if(!n||!(null==n?void 0:n.root))return;const r=Ur.hasClass(null==n?void 0:n.parent,"panel-icon-svg")?null==(i=null==n?void 0:n.parent)?void 0:i.parentNode:null==n?void 0:n.root;r&&(t?Ur.show(r,"block"):Ur.hide(r))}getSdkPlugin(e){var t;const i=null==(t=this._sdkPlugins)?void 0:t[e.toLowerCase()];return i&&i.pluginName?i:null}switchAuthToken(e,t=!0){try{this.assertLiteConfig({getVideoByToken:e})}catch(i){return Promise.reject(i)}return this._performAuthTokenSwitch(e,t)}_switchAuthToken(e,t,i){return this._performAuthTokenSwitch(e,t,i).then((()=>{i&&gB.commitIdentitySwitch(this,i)})).catch((e=>{throw i&&gB.rollbackIdentitySwitch(this,i),e}))}_performAuthTokenSwitch(e,t,i){const n=t?0:this.player.currentTime,r=this.getSdkPlugin("AuthToken");return r&&this.player?this._runDestroyableSourceSwitch((o=>r.updateAuthToken(e,t).then((()=>(o(),this._playerPlayNext(n,i)))).then((()=>{})))):(ss.error("current is not playAuthToken play or player not created"),Promise.reject())}updateAuthToken(e){try{this.assertLiteConfig({getVideoByToken:e})}catch(i){return Promise.reject(i)}const t=this.getSdkPlugin("AuthToken");return new Promise(((i,n)=>{t&&this.player?t.updateAuthToken(e,!1).then((()=>{if(this.player.isError)this._playerPlayNext(this.player.currentTime).then((()=>i())).catch((()=>n()));else{const e=this.playerData.getCurrentUrl();this.player.setConfig({url:e,definition:this.getDefinitionConfig()});const t=this.player.switchURL(e,{seamless:!0});t&&t.then?(t.then((()=>i())),t.catch((()=>n()))):i()}})).catch((e=>n(e))):(ss.error("current is not playAuthToken play or player not created"),n())}))}_playerPlayNext(e=0,t){const i=this.player;return new Promise(((n,r)=>{var o,a,s;const l=i.paused&&!i.isError;i.addClass(Pa.ENTER);const h=this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),d=u(c(c({},this.playerData.options),this._getDramaConfigPatchForPlayer()),{definition:this.getDefinitionConfig(),startTime:e,autoplay:!0,url:h});d.poster&&i.plugins.poster&&i.plugins.poster.update(d.poster),this.setPluginConfig(d);let f=!t,p=!1,g=()=>{};const y=[],v=(e,t)=>{y.push([e,t]),i.once(e,t)},m=e=>{p||(p=!0,g(),(()=>{for(const[e,t]of y)i.off(e,t);y.length=0})(),e())};g=this._registerSourceSwitchAborter((e=>{m((()=>r(e)))}));const _=(e,t)=>{const i=(...n)=>{f?m((()=>t(...n))):v(e,i)};v(e,i)};_(FA.ERROR,(e=>r(e))),_(FA.CANPLAY,(()=>{l&&i.pause(),n(!0)})),v(FA.EMPTIED,(()=>{!f&&t&&(f=gB.armIdentitySwitch(this,t,i))}));try{if(i.plugins.dashplugin){const e=c(c({},$s(i.config,"DASHPlugin")),this.playerData.options.DASHPlugin||{});e.dashOpts=this.playerData.dashOpts,e.vid=null==(a=null==(o=this.playerData.dashOpts)?void 0:o.Data)?void 0:a.Vid,i.plugins.drm&&(null==(s=i.plugins.drm)||s.restart()),i.setConfig(d),i.plugins.dashplugin.next(i.currentTime,"NEXT",e)}else i.playNext(d)}catch(dF){m((()=>r(dF)))}}))}get src(){var e,t;return(null==(e=this.player)?void 0:e.currentSrc)||(null==(t=this.player)?void 0:t.src)}set src(e){this.player&&(this.player.src=e)}switchURL(e){try{this.assertLiteConfig({url:e})}catch(n){return Promise.reject(n)}const t=this.player.switchURL(e,!1),i=this.player.currentTime;return t&&t.then?t:new Promise((e=>{const t=this.player.paused&&!this.player.isError,n=()=>{this.player.currentTime=i,t&&this.player.once(FA.CANPLAY,(()=>{this.player.pause()})),e()};Kr.os.isAndroid?this.once(FA.TIME_UPDATE,(()=>{n()})):this.once(FA.CANPLAY,(()=>{n()})),this.player.play()}))}next(e,t=!0){try{this.assertLiteConfig(e)}catch(i){return Promise.reject(i)}return this._publicPlayNextOperation||gB.hasActiveIdentitySwitch(this)?Promise.reject(this._createPlayNextInProgressError()):this._next(e,t)}_next(e,t=!0,i){var n;const r=this._lifecycleGeneration||0,o=t?0:this.player.currentTime,a=this.playerData.configs,s=this._applyIncomingIdentityAliases(c(u(c({},a),{startTime:o,autoplay:!0}),e),e);(null==(n=null==e?void 0:e.getVideoByToken)?void 0:n.playAuthToken)&&(s.streamType=Ts(null==e?void 0:e.getVideoByToken)||nr.MP4);const l=gB.beginIdentitySwitch(this,gU(s),this.player,t,i);return l?this._teardown(!0).then((()=>{if(this._isStaleLifecycleGeneration(r))throw this._createDestroyedPlaybackSwitchError();return this._init(s,l)})).catch((e=>{if(gB.rollbackIdentitySwitch(this,l),this._isDestroyedPlaybackSwitchError(e))throw e;if(ss.error("next_error",e),"VEPLAYER_LITE_UNSUPPORTED_FEATURE"===(null==e?void 0:e.code))throw e})):Promise.reject(this._createPlayNextInProgressError())}playNext(e,t=!0){try{this.assertLiteConfig(e)}catch(s){return Promise.reject(s)}if(this._publicPlayNextOperation||gB.hasActiveIdentitySwitch(this))return Promise.reject(this._createPlayNextInProgressError());const i={};this._publicPlayNextOperation=i;const n=this.player;try{n.emit(MA.PLAY_NEXT_START)}catch(s){return this._publicPlayNextOperation===i&&(this._publicPlayNextOperation=null),Promise.reject(s)}let r,o=null;try{const i=this._createDramaPlayNextCandidateConfig(e);if(o=gB.beginIdentitySwitch(this,gU(i),this.player,t),!o)throw this._createPlayNextInProgressError();this._lastSelectedAudioTrack=null,this._clearSuppressAudioTrackMemory(),this._playNextPending=!0,r=this._playNext(e,t,o)}catch(s){o&&gB.rollbackIdentitySwitch(this,o),r=Promise.reject(s)}const a=r.catch((e=>{throw o&&gB.rollbackIdentitySwitch(this,o),e}));return o?o.settled.then((()=>{this._publicPlayNextOperation===i&&(this._publicPlayNextOperation=null)})):a.finally((()=>{this._publicPlayNextOperation===i&&(this._publicPlayNextOperation=null)})).catch((()=>{})),a.finally((()=>{n.emit(MA.PLAY_NEXT_END)})).catch((()=>{})),a}_createPlayNextInProgressError(){return new Error("VePlayer playNext is already in progress")}_registerSourceSwitchAborter(e){this._sourceSwitchAborters||(this._sourceSwitchAborters=new Set);const t=this._sourceSwitchAborters;return t.add(e),()=>{t.delete(e),0===t.size&&this._sourceSwitchAborters===t&&(this._sourceSwitchAborters=void 0)}}_abortSourceSwitches(){const e=this._sourceSwitchAborters;if(this._sourceSwitchAborters=void 0,!e)return;const t=this._createDestroyedPlaybackSwitchError();for(const i of e)i(t)}_runDestroyableSourceSwitch(e){return new Promise(((t,i)=>{let n=!1,r=()=>{};const o=()=>{if(n)throw this._createDestroyedPlaybackSwitchError()},a=e=>{n||(n=!0,r(),e())};r=this._registerSourceSwitchAborter((e=>{a((()=>i(e)))}));try{Promise.resolve(e(o)).then((e=>a((()=>t(e)))),(e=>a((()=>i(e)))))}catch(dF){a((()=>i(dF)))}}))}_createDestroyedPlaybackSwitchError(){return new Error("VePlayer destroyed during playback switch")}_isDestroyedPlaybackSwitchError(e){return e instanceof Error&&"VePlayer destroyed during playback switch"===e.message}_isStaleLifecycleGeneration(e){return e!==(this._lifecycleGeneration||0)}_cancelStalePlayerCreation(){this._isCollectingCreatePlayerPerf=!1}_discardStalePlayer(e){var t;if(e){this.player===e&&(this.player=null);try{const i=null==(t=e.destroy)?void 0:t.call(e);(null==i?void 0:i.catch)&&i.catch((()=>{}))}catch(i){}}}updatePlayNextSubtitleConfig(e,t){var i,n,r,o;const a=$s(e,"Subtitle"),s=Array.isArray(null==a?void 0:a.list);if(!s&&!t)return;const l=s?a.list:[],h=u(c(c(c({},$s(this.playerData.options,"Subtitle")||{}),$s(this.playerData.configs,"Subtitle")||{}),a||{}),{list:l});e.Subtitle=h,this.playerData.updateConfigs({Subtitle:h}),this.playerData.options.Subtitle=h,null==(o=null==(r=null==(n=null==(i=this.player)?void 0:i.plugins)?void 0:n.subtitle)?void 0:r.updateSubtitles)||o.call(r,l)}_playNext(e,t=!0,i){var n,r,o;if(!e)return Promise.reject();const{url:a,playList:s,getVideoByToken:l}=e,h=this.player.paused&&!this.player.isError,d=t?0:this.player.currentTime;if(a||(null==s?void 0:s.length)){this._applyIncomingIdentityAliases(this.playerData.configs,e),this.playerData.updateConfigs(e),this.playerData.initPlayData(e);const n=this.adapter.canOpenAbr()&&this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),r=this.player,o=r.state,a=this.getDefinitionConfig(),s=u(c({startTime:d},e),{url:n,definition:a});return this.updatePlayNextSubtitleConfig(s,t),this.setPluginConfig(s),new Promise(((e,t)=>{let n=!1,a=!1,l=()=>{};const c=[],u=(e,t)=>{const i=(...i)=>{n||e===FA.EMPTIED?t(...i):u(e,t)};c.push([e,i]),r.once(e,i)},d=e=>{a||(a=!0,l(),(()=>{var e;for(const[t,i]of c)null==(e=r.off)||e.call(r,t,i);c.length=0})(),e())};l=this._registerSourceSwitchAborter((e=>{d((()=>t(e)))})),u(FA.ERROR,(e=>{d((()=>t(e)))})),u(FA.CANPLAY,(()=>{d((()=>{6===o&&h?r.pause():6!==o&&r.config.autoplay&&r.play(),e(void 0)}))}));const f=()=>{n||(n=!i||gB.armIdentitySwitch(this,i,r))};c.push([FA.EMPTIED,f]),r.once(FA.EMPTIED,f);try{r.playNext(s)}catch(p){d((()=>t(p)))}}))}if(yB.ttDramaEnv){if(null==(n=e.getVideoByToken)?void 0:n.playAuthToken){if((this.playerData.getCurrentStreamType()||Ts(null==(r=this.playerData.configs)?void 0:r.getVideoByToken))!==(e.streamType||Ts(null==e?void 0:e.getVideoByToken)||"mp4"))return this._next(e,t,i)}const o=this._createDramaPlayNextCandidateConfig(e);return i?this.switchDramaEpisode(o,t,i):this.switchDramaEpisode(o,t)}if(null==l?void 0:l.playAuthToken){return(this.playerData.getCurrentStreamType()||Ts(null==(o=this.playerData.configs)?void 0:o.getVideoByToken))!==(e.streamType||Ts(null==e?void 0:e.getVideoByToken)||"mp4")?this._next(e,t,i):(this.playerData.updateConfigs(e),this._switchAuthToken(l,t,i))}return this._next(e,t,i)}_applyIncomingIdentityAliases(e,t){const i=e,n=t;for(const r of[["albumId","album_id"],["episodeId","episode_id","episodeID"]]){if(r.some((e=>Object.prototype.hasOwnProperty.call(n,e)))){for(const e of r)delete i[e];for(const e of r)Object.prototype.hasOwnProperty.call(n,e)&&(i[e]=n[e])}}return e}_createDramaPlayNextCandidateConfig(e){const t=this._applyIncomingIdentityAliases(this.playerData.getMergedConfigs(e),e);return Object.prototype.hasOwnProperty.call(e,"transcodeParam")&&(t.transcodeParam=e.transcodeParam),t}_getDramaConfigPatchForPlayer(){const e=this.playerData.configs,t=["albumId","album_id","episodeId","episode_id","episodeID"],i={};for(const n of t){const t=e[n];null!=t&&""!==t&&(i[n]=t)}return i}_buildDramaInvalidParamError(){const e=_R.INVALID_PARAM;return{errorType:mR.network,errorCode:e.code,veError:xR.getVeErrorInfo({code:e.code,message:e.message,textKey:e.textKey}),errorMessage:e.message,ext:{},originError:void 0}}_getDramaAlbumIdFromConfig(e){return gU(e).albumId||""}_getDramaEpisodeIdFromConfig(e){return gU(e).episodeId||""}switchDramaEpisode(e,t=!0,i){const n=t?0:this.player.currentTime,r=this.getSdkPlugin("AuthToken"),o=gB.beginIdentitySwitch(this,gU(e),this.player,t,i);return o?r&&this.player?this._runDestroyableSourceSwitch((i=>r.updateDramaEpisode(t,e).then((()=>(i(),this._playerPlayNext(n,o)))).then((()=>{})))).then((()=>{gB.commitIdentitySwitch(this,o)})).catch((e=>{throw gB.rollbackIdentitySwitch(this,o),e})):(gB.rollbackIdentitySwitch(this,o),ss.error("switchDramaEpisode: AuthToken plugin or player not available"),Promise.reject(new Error("AuthToken plugin or player not available"))):Promise.reject(this._createPlayNextInProgressError())}_destroyPlayer(){return d(this,null,(function*(){var e,t,i;this._offPlayerEvents(),null==(e=this.veErrorIns)||e.destroy(),this.veErrorIns=null,yield null==(t=this.mobilePanel)?void 0:t.destroy(),yield null==(i=this.player)?void 0:i.destroy(),this.player=null}))}getPlayerInstance(){return this.player}getSoftDecodingOption(e,t,i){return d(this,null,(function*(){var n,r;const{enableH265Degrade:o,codec:a,configs:s,isLive:l}=this.playerData,c=function(e){var t,i;if(!(null==e?void 0:e.playAuthToken))return!1;const n=_s(null==e?void 0:e.playAuthToken),r=null!=(i=null==(t=null==n?void 0:n.FileType)?void 0:t.toLowerCase())?i:"video";return!!n&&("evideo"===r||"eaudio"===r)}(null==s?void 0:s.getVideoByToken),u=!!(s.enableMp4MSE||$s(this.playerData.options,"Mp4EncryptPlayer")||"mp4"===i&&(a===tr.H265||c||(null==(n=null==s?void 0:s.autoBitrateOpts)?void 0:n.enable)));if(yB.shouldCheckLicense()&&(null==(r=this._originConfigs)?void 0:r.useSoftDecoding)&&!l)try{const e=yield yB.checkLicenseStatus();if(!(yield yB.checkLicenseModuleAuth(TA.SDK_VOD_PLAY,SA.H265)))throw this.emit(NA.LICENSE_STATUS_WARNING,e===bA.LICENSE_STATUS_EXPIRED?vR.EXPIRED_LICENSE_NOT_SUPPORT_265:vR.BASE_LICENSE_NOT_SUPPORT_265),new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(dF){return void ss.error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}if(e){const e=yield this.sdkUmdLoader.loadPlugins(Hw.XGVideo);if(null==e?void 0:e.isSupported()){if(a&&e.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),u){const e=yield Kw.loadMp4Encrypt(this.sdkUmdLoader);return{mediaType:this.playerData.isCurrentH265()?"xg-video":"video",innerDegrade:1,codecType:null!=a?a:tr.H264,plugins:[e]}}return{mediaType:"xg-video",innerDegrade:1,codecType:null!=a?a:tr.H264}}{this.emit(NA.NOT_SUPPORT_SOFT_DECODER);const e={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0};this.delayError.push(e),ss.error("soft decode is not support by current browser")}}else if(o&&!a&&t&&(yield this.detectCodec(t)),this.playerData.isCurrentH265()&&!function(){const e=window.navigator.userAgent.toLocaleLowerCase(),t=/(iphone)/.test(e)||/(ipad)/.test(e);if(/(VivoBrowser)/.test(e)){const t=e.match(/VivoBrowser\/(\d+)?/);if((null==t?void 0:t[1])>=22)return!0}return!!(t||window.MediaSource&&window.MediaSource.isTypeSupported&&(window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"')))}())if(o){if(yB.shouldCheckLicense()&&!l)try{const e=yield yB.checkLicenseStatus();if(!(yield yB.checkLicenseModuleAuth(TA.SDK_VOD_PLAY,SA.H265)))throw this.emit(NA.LICENSE_STATUS_WARNING,e===bA.LICENSE_STATUS_EXPIRED?vR.EXPIRED_LICENSE_NOT_SUPPORT_265:vR.BASE_LICENSE_NOT_SUPPORT_265),new Error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}catch(dF){return void ss.error("ERROR_LICENSE_EDITION_NEED_UPLOAD")}const e=yield this.sdkUmdLoader.loadPlugins(Hw.XGVideo);if(null==e?void 0:e.isSupported()){if(null==e||e.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),this.playerData.openSoftDecoding=!0,u){const e=yield Kw.loadMp4Encrypt(this.sdkUmdLoader);return{mediaType:this.playerData.isCurrentH265()?"xg-video":"video",innerDegrade:1,codecType:null!=a?a:tr.H264,plugins:[e]}}return{mediaType:"xg-video",innerDegrade:1,codecType:null!=a?a:tr.H264}}{this.emit(NA.NOT_SUPPORT_SOFT_DECODER);const e={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0};this.delayError.push(e),ss.error("soft decode is not support by current browser")}}else{this.emit(NA.NOT_SUPPORT_HARDWARE_DECODER);const e={ext:{},originError:void 0,errorType:"decoder",errorCode:3,errorMessage:"h265 hardware decode is not supported by this browser"};this.delayError.push(e),ss.error("h265 hardware decode is not supported by this browser")}return{}}))}setH265SoftPlayList(){if(this.playerData.isCurrentH265()){const e=this.playerData.playList;e.length>1&&(this.playerData.playList=e.filter((e=>{var t;return(null==(t=null==e?void 0:e.codec)?void 0:t.toLowerCase())===tr.H265}))),this.playerData.initCurrent(this.playerData.playList[0])}}changeDefinition(e){var t,i,n,r,o,a;if((null==(t=this.getDefinitionList())?void 0:t.length)<=1)return;const{sdkdefinitionplugin:s,definitionmobileplugin:l}=(null==(i=this.player)?void 0:i.plugins)||{};if(s||l)e!==this.playerData.current.definition&&(s?null==s||s.changeDefinition(e):l&&(null==l||l.changeDefinition(e)));else{let t;const{current:{lineId:i}}=this.playerData;t=this.playerData.getDefinitionListByLineId(i).find((t=>t.definition===e)),t||(t=null==(a=null==(o=null==(r=null==(n=this.player)?void 0:n.config)?void 0:r.definition)?void 0:o.list)?void 0:a.find((t=>(null==t?void 0:t.definition)===e))),t&&(this.player.changeDefinition(t),t.definition!==this.playerData.current.definition&&(this.playerData.current.definition=t.definition))}}getDefinitionList(){var e;const{sdkdefinitionplugin:t,definitionmobileplugin:i}=(null==(e=this.player)?void 0:e.plugins)||{};return t||i?(null==t?void 0:t.renderList)||(null==i?void 0:i.renderList):this.player.definitionList.map((e=>{var t;const i=this.playerData.isDefinitionMatch(e.definition,null==(t=this.player.curDefinition)?void 0:t.definition),n=e.url===this.player.url,r=e.url===this.player.src;return u(c({},e),{isDefinitionAuto:this.playerData.isAutoDefinition(e.definition),selected:i||(this.playerData.isOpenABR()&&Kr.os.isIos?r:n)})}))}getAudioTracks(){var e,t,i;const n=this._getHlsInstance();if(null==(e=null==n?void 0:n.audioTracks)?void 0:e.length){const e=n.audioTrack;return n.audioTracks.map((t=>u(c({},t),{selected:t.id===e})))}const r=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;if(!(null==r?void 0:r.length))return[];const o=[];for(let a=0;a<r.length;a++){const e=r[a];o.push({id:a,name:e.label||e.language||String(a),lang:e.language,default:e.enabled,selected:e.enabled})}return o}getCurrentAudioTrack(){var e,t,i;const n=this._getHlsInstance();if(null==(e=null==n?void 0:n.audioTracks)?void 0:e.length){const e=n.audioTrack,t=n.audioTracks.find((t=>t.id===e));return t?u(c({},t),{selected:!0}):null}const r=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;if(!r)return null;for(let o=0;o<r.length;o++){const e=r[o];if(e.enabled)return{id:o,name:e.label||e.language||String(o),lang:e.language,default:!0,selected:!0}}return null}switchAudioTrack(e){var t,i;const{id:n}=e,r=this._getHlsInstance();if(r)return void XA(r,e);const o=null==(i=null==(t=this.player)?void 0:t.media)?void 0:i.audioTracks;o&&$A(o,n)}get preLoadData(){var e;if(!this.player||!this.player.plugins)return{hit:0};const t=this.player.plugins.mp4encryptplayer;if(t&&t.preLoadData)return{hit:!0===t.hitpreload?1:0,duration:t.preLoadData.duration,length:t.preLoadData.byteLength};const i=(null==(e=this.player)?void 0:e.stat)||{};if(i.preLoadData){const{length:e,duration:t}=i.preLoadData,n={hit:e>0?1:0,length:e,duration:0};return t>=0&&(n.duration=t),n}return{hit:0,duration:0,length:0}}_initI18N(e){const{extraLangList:t,extendLangList:i}=e;null==t||t.forEach((e=>{La.use(e)})),La.extend(wU),i&&La.extend(i)}get musicMode(){}set musicMode(e){}get musicTimeScale(){}set musicTimeScale(e){}get musicList(){}set musicList(e){}musicAdd(e){}musicRandom(){}musicNext(){}musicPrev(){}musicSetIndex(e){}musicForward(){}musicBackward(){}musicRemove(e){}musicSetAbCycle(e,t,i,n){}musicRemoveAbCycle(){}getLogUserId(){var e,t,i;const n=null==(e=this.player)?void 0:e.vodLogger;if(n){const e=(null==(t=null==n?void 0:n.tracker)?void 0:t.getConfig())||{};return null==(i=null==e?void 0:e.user)?void 0:i.user_unique_id}}get region(){return this.playerData.region}get userRegion(){return this.playerData.userRegion}getPlugin(e){var t;return null==(t=this.player)?void 0:t.getPlugin(e)}getSubtitleList(){var e,t;const i=this.getPlugin("subtitle");return null!=(t=null==(e=null==i?void 0:i.config)?void 0:e.list)?t:[]}switchSubtitle(e){const t=this.getPlugin("subtitle");return t?t.switchSubTitle(e):Promise.reject(new Error("subtitle plugin is not registered"))}showSubtitle(){var e,t;const i=this.getPlugin("subtitle");if(i)if(i.curIndex>-1&&i.curItem)i.switchSubTitle(i.curItem);else{const n=null!=(t=null==(e=i.config)?void 0:e.list)?t:[];n.length>0&&i.switchSubTitle(n[0])}}hideSubtitle(){var e;const t=this.getPlugin("subtitle");null==(e=null==t?void 0:t.switchOffSubtitle)||e.call(t)}_teardown(e){return d(this,null,(function*(){var t;const i=this.player;e||(this._lifecycleGeneration=(this._lifecycleGeneration||0)+1,this._abortSourceSwitches(),gB.destroy(this,i)),yield this._destroyPlayer(),this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null,this._onRepeat=null),this.mountingDom&&this.mountingDom.contains(this.playerContainer)&&this.mountingDom.removeChild(this.playerContainer),null==(t=this._emitter)||t.removeAllListeners(),this._emitter=null,kU.destroy(this)}))}destroy(){return d(this,null,(function*(){yield this._teardown(!1)}))}};let vB=yB;vB.isMSESupported=Qs,vB.veStrategy=yA,vB.sdkVersion="1.18.0",vB.ttDramaEnv=null,vB.isMMSSupported=Js,vB.isRTMSupported=IA.isSupported,vB.hasInitVeStrategy=!1;const mB=vB;function _B(){return La}const EB="function"==typeof Buffer,TB=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),SB=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),bB=(e=>{let t={};return SB.forEach(((e,i)=>t[e]=i)),t})(),CB=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,kB=String.fromCharCode.bind(String),IB=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),PB=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),DB=e=>{let t,i,n,r,o="";const a=e.length%3;for(let s=0;s<e.length;){if((i=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=i<<16|n<<8|r,o+=SB[t>>18&63]+SB[t>>12&63]+SB[t>>6&63]+SB[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},wB="function"==typeof btoa?e=>btoa(e):EB?e=>Buffer.from(e,"binary").toString("base64"):DB,AB=EB?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let i=0,n=e.length;i<n;i+=4096)t.push(kB.apply(null,e.subarray(i,i+4096)));return wB(t.join(""))},RB=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?kB(192|t>>>6)+kB(128|63&t):kB(224|t>>>12&15)+kB(128|t>>>6&63)+kB(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return kB(240|t>>>18&7)+kB(128|t>>>12&63)+kB(128|t>>>6&63)+kB(128|63&t)},xB=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,OB=e=>e.replace(xB,RB),LB=EB?e=>Buffer.from(e,"utf8").toString("base64"):TB?e=>AB(TB.encode(e)):e=>wB(OB(e)),NB=(e,t=!1)=>t?IB(LB(e)):LB(e),MB=e=>{if(e=e.replace(/\s+/g,""),!CB.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,i,n,r="";for(let o=0;o<e.length;)t=bB[e.charAt(o++)]<<18|bB[e.charAt(o++)]<<12|(i=bB[e.charAt(o++)])<<6|(n=bB[e.charAt(o++)]),r+=64===i?kB(t>>16&255):64===n?kB(t>>16&255,t>>8&255):kB(t>>16&255,t>>8&255,255&t);return r},UB=NB;var BB={};!function(e){e._getPrivFilters=function(){var e,t=/</g,i=/"/g,n=/'/g,r=/&/g,o=/\x00/g,a=/(?:^$|[\x00\x09-\x0D "'`=<>])/g,s=/[&<>"'`]/g,l=/(?:\x00|^-*!?>|--!?>|--?!?$|\]>|\]$)/g,c=/&(?:#([xX][0-9A-Fa-f]+|\d+);?|(Tab|NewLine|colon|semi|lpar|rpar|apos|sol|comma|excl|ast|midast|ensp|emsp|thinsp);|(nbsp|amp|AMP|lt|LT|gt|GT|quot|QUOT);?)/g,u={Tab:"\t",NewLine:"\n",colon:":",semi:";",lpar:"(",rpar:")",apos:"'",sol:"/",comma:",",excl:"!",ast:"*",midast:"*",ensp:" ",emsp:" ",thinsp:" ",nbsp:" ",amp:"&",lt:"<",gt:">",quot:'"',QUOT:'"'},h=/^(?:(?!-*expression)#?[-\w]+|[+-]?(?:\d+|\d*\.\d+)(?:r?em|ex|ch|cm|mm|in|px|pt|pc|%|vh|vw|vmin|vmax)?|!important|)$/i,d=/[\x00-\x1F\x7F\[\]{}\\"]/g,f=/[\x00-\x1F\x7F\[\]{}\\']/g,p=/url[\(\u207D\u208D]+/g,g=/['\(\)]/g,y=/\/\/%5[Bb]([A-Fa-f0-9:]+)%5[Dd]/,v={javascript:1,data:1,vbscript:1,mhtml:1,"x-schema":1},m=/(?::|&#[xX]0*3[aA];?|&#0*58;?|&colon;)/,_=/(?:^[\x00-\x20]+|[\t\n\r\x00]+)/g,E={Tab:"\t",NewLine:"\n"},T=function(e,t,i){return void 0===e?"undefined":null===e?"null":e.toString().replace(t,i)},S=String.fromCodePoint||function(e){return 0===arguments.length?"":e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),e%1024+56320))};function b(e){var t=e.split(m,2);return!t[0]||2!==t.length&&e.length===t[0].length?null:t[0]}function C(t,i,n,r){return i=i||u,n=n||c,void 0===t?"undefined":null===t?"null":t.toString().replace(o,"�").replace(n,(function(t,n,o,a){return n?(n=Number(n[0]<="9"?n:"0"+n),r?S(n):128===n?"€":130===n?"‚":131===n?"ƒ":132===n?"„":133===n?"…":134===n?"†":135===n?"‡":136===n?"ˆ":137===n?"‰":138===n?"Š":139===n?"‹":140===n?"Œ":142===n?"Ž":145===n?"‘":146===n?"’":147===n?"“":148===n?"”":149===n?"•":150===n?"–":151===n?"—":152===n?"˜":153===n?"™":154===n?"š":155===n?"›":156===n?"œ":158===n?"ž":159===n?"Ÿ":n>=55296&&n<=57343||13===n?"�":e.frCoPt(n)):i[o||a]||t}))}function k(e){return"\\"+e.charCodeAt(0).toString(16).toLowerCase()+" "}function I(e){return e.replace(p,(function(e){return"-x-"+e}))}function P(t){var i=b(t=e.yufull(C(t)));return i&&v[i.toLowerCase()]?"##"+t:t}return e={frCoPt:function(e){return null==e?"":!isFinite(e=Number(e))||e<=0||e>1114111||e>=1&&e<=8||e>=14&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||11===e||65535==(65535&e)||65534==(65535&e)?"�":S(e)},d:C,yup:function(e){return(e=b(e.replace(o,"")))?C(e,E,null,!0).replace(_,"").toLowerCase():null},y:function(e){return T(e,s,(function(e){return"&"===e?"&amp;":"<"===e?"&lt;":">"===e?"&gt;":'"'===e?"&quot;":"'"===e?"&#39;":"&#96;"}))},ya:function(e){return T(e,r,"&amp;")},yd:function(e){return T(e,t,"&lt;")},yc:function(e){return T(e,l,(function(e){return"\0"===e?"�":"--!"===e||"--"===e||"-"===e||"]"===e?e+" ":e.slice(0,-1)+" >"}))},yavd:function(e){return T(e,i,"&quot;")},yavs:function(e){return T(e,n,"&#39;")},yavu:function(e){return T(e,a,(function(e){return"\t"===e?"&#9;":"\n"===e?"&#10;":"\v"===e?"&#11;":"\f"===e?"&#12;":"\r"===e?"&#13;":" "===e?"&#32;":"="===e?"&#61;":"<"===e?"&lt;":">"===e?"&gt;":'"'===e?"&quot;":"'"===e?"&#39;":"`"===e?"&#96;":"�"}))},yu:encodeURI,yuc:encodeURIComponent,yubl:function(t){return v[e.yup(t)]?"x-"+t:t},yufull:function(t){return e.yu(t).replace(y,(function(e,t){return"//["+t+"]"}))},yublf:function(t){return e.yubl(e.yufull(t))},yceu:function(e){return e=C(e),h.test(e)?e:";-x:'"+I(e.replace(f,k))+"';-v:"},yced:function(e){return I(C(e).replace(d,k))},yces:function(e){return I(C(e).replace(f,k))},yceuu:function(e){return P(e).replace(g,(function(e){return"'"===e?"\\27 ":"("===e?"%28":"%29"}))},yceud:function(e){return P(e)},yceus:function(e){return P(e).replace(n,"\\27 ")}}};var t=e._privFilters=e._getPrivFilters();function i(e,i,n){return t.yubl(i((n||t.yufull)(e)))}e.inHTMLData=t.yd,e.inHTMLComment=t.yc,e.inSingleQuotedAttr=t.yavs,e.inDoubleQuotedAttr=t.yavd,e.inUnQuotedAttr=t.yavu,e.uriInSingleQuotedAttr=function(e){return i(e,t.yavs)},e.uriInDoubleQuotedAttr=function(e){return i(e,t.yavd)},e.uriInUnQuotedAttr=function(e){return i(e,t.yavu)},e.uriInHTMLData=t.yufull,e.uriInHTMLComment=function(e){return t.yc(t.yufull(e))},e.uriPathInSingleQuotedAttr=function(e){return i(e,t.yavs,t.yu)},e.uriPathInDoubleQuotedAttr=function(e){return i(e,t.yavd,t.yu)},e.uriPathInUnQuotedAttr=function(e){return i(e,t.yavu,t.yu)},e.uriPathInHTMLData=t.yu,e.uriPathInHTMLComment=function(e){return t.yc(t.yu(e))},e.uriQueryInSingleQuotedAttr=e.uriPathInSingleQuotedAttr,e.uriQueryInDoubleQuotedAttr=e.uriPathInDoubleQuotedAttr,e.uriQueryInUnQuotedAttr=e.uriPathInUnQuotedAttr,e.uriQueryInHTMLData=e.uriPathInHTMLData,e.uriQueryInHTMLComment=e.uriPathInHTMLComment,e.uriComponentInSingleQuotedAttr=function(e){return t.yavs(t.yuc(e))},e.uriComponentInDoubleQuotedAttr=function(e){return t.yavd(t.yuc(e))},e.uriComponentInUnQuotedAttr=function(e){return t.yavu(t.yuc(e))},e.uriComponentInHTMLData=t.yuc,e.uriComponentInHTMLComment=function(e){return t.yc(t.yuc(e))},e.uriFragmentInSingleQuotedAttr=function(e){return t.yubl(t.yavs(t.yuc(e)))},e.uriFragmentInDoubleQuotedAttr=function(e){return t.yubl(t.yavd(t.yuc(e)))},e.uriFragmentInUnQuotedAttr=function(e){return t.yubl(t.yavu(t.yuc(e)))},e.uriFragmentInHTMLData=e.uriComponentInHTMLData,e.uriFragmentInHTMLComment=e.uriComponentInHTMLComment}(BB);const FB="position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; pointer-events: none; z-index: 9999; font-size: 14px; display: block;",HB={SLOW:.5,MODERATE:1,FAST:2},jB={SLOW:5,MODERATE:3.5,FAST:2},VB={style:{node:FB,wrap:"",img:""},class:{node:"",wrap:"xg-dynamic-watermark",img:""}};function KB(e,t){const i=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.keys(t).forEach((e=>{i.setAttribute(e,t[e])})),i}class GB{constructor(e){this.root=e.root,this.config=e,this.wrap=document.createElement("div"),this.img=document.createElement("img"),this.imgSrc="",this.root&&this.root.appendChild(this.wrap),this.moveTimer=null,this.blinkTimer=null,this.pauseAnimation=!1,this.observer=[]}_getWatermarkDom(){const{content:e="",fontFamily:t}=this.config,i=e,n="string"==typeof this.config.fontSize?`${this.config.fontSize}`:`${this.config.fontSize}px`,r=document.createElement("text");r.style.fontSize=n,r.style.whiteSpace="nowrap",t&&(r.style.fontFamily=t),r.innerHTML=BB.inHTMLData(i),document.body.appendChild(r);const o=KB("svg",{xmlns:"http://www.w3.org/2000/svg",width:r.offsetWidth+2,height:r.offsetHeight}),a=KB("text",c({x:r.offsetWidth/2,y:r.offsetHeight/2,style:`\n fill:${this.config.fontColor};\n text-anchor: middle;\n alignment-baseline:middle;\n opacity: ${this.config.opacity};\n font-size: ${n};\n `},t?{"font-family":t}:{}));return a.innerHTML=BB.inHTMLData(i),document.body.removeChild(r),o.appendChild(a),"data:image/svg+xml;base64, "+UB((new XMLSerializer).serializeToString(o))}_startRender(){switch(this.pauseAnimation=!1,this.config.displayType){case 0:this._fixedRender();break;case 1:this._startMove();break;case 2:this._startBlink()}this.observer[0]=this._attrObserver(this.img,["src","class"],"img"),this.observer[1]=this._attrObserver(this.wrap,["class","style","id"],"node"),this.observer[2]=this._attrObserver(this.root,["class","style"],"wrap"),this.observer[3]=this._domObserver(this.wrap),this.observer[4]=this._domObserver(this.root),this.observer[5]=this._domObserver(this.root.parentElement,!0)}_startMove(){var e;if(!this.img||!(null==(e=this.wrap)?void 0:e.clientWidth))return;const{offsetX:t,offsetY:i}=this._getOffset(),n=HB[this.config.tickerSpeed]||HB.MODERATE;let r=t,o=n,a=i,s=n;clearInterval(this.moveTimer),this.moveTimer=setInterval((()=>{if(this.pauseAnimation)return;const e=this._getOffsetThreshold();r+=o,a+=s,this.wrap.offsetWidth>this.img.offsetWidth&&r>this.wrap.offsetWidth&&(r=this.wrap.offsetWidth-this.img.offsetWidth),this.wrap.offsetHeight>this.img.offsetHeight&&a>this.wrap.offsetHeight&&(a=this.wrap.offsetHeight-this.img.offsetHeight),this.img.setAttribute("style",`position: relative;left:${r}px; top:${a}px`),r>=e.hRight&&(o=-n),r<=e.hLeft&&(o=n),a>=e.vBottom&&(s=-n),a<=e.vTop&&(s=n)}),30)}_startBlink(){const e=jB[this.config.tickerSpeed]||jB.MODERATE;clearInterval(this.blinkTimer),this._blinkRender(e,!0),this.blinkTimer=setInterval((()=>{this.pauseAnimation||this._blinkRender(e)}),1e3*e)}_randomBetween(e,t){const i=t-e+1;return Math.floor(Math.random()*i)+e}_fixedRender(){var e;if(!this.img||!(null==(e=this.wrap)?void 0:e.clientWidth))return;this.img.setAttribute("style","");const{offsetX:t,offsetY:i}=this._getOffset(),n=jB[this.config.tickerSpeed];return n?this.img.setAttribute("style",`opacity: 0.1;transform: translate(${t}px, ${i}px);animation: _xg_animation_blink ${n}s linear infinite;`):this.img.setAttribute("style",`opacity: 1;transform: translate(${t}px, ${i}px);`)}_getOffset(){const{left:e,top:t,right:i,bottom:n}=this.config,{clientWidth:r,clientHeight:o}=this.wrap,{clientWidth:a,clientHeight:s}=this.img;let l=0,c=0;return void 0!==i&&r&&(l=r-a-i),void 0!==e&&r&&(l=e),void 0!==n&&o&&(c=o-s-n),void 0!==t&&o&&(c=t),{offsetX:l,offsetY:c}}_getOffsetThreshold(){const{clientWidth:e,clientHeight:t}=this.wrap,{clientWidth:i,clientHeight:n}=this.img;return{hLeft:e-i>=0?0:e-i,hRight:e-i>=0?e-i:0,vTop:t-n>=0?0:t-n,vBottom:t-n>=0?t-n:0}}_blinkRender(e,t){var i;if(!this.img||!(null==(i=this.wrap)?void 0:i.clientWidth))return;if(this.img.setAttribute("style","opacity: 0.1;"),t){const{offsetX:t,offsetY:i}=this._getOffset();return this.img.setAttribute("style",`opacity: 0.1;transform: translate(${t}px, ${i}px);animation: _xg_animation_blink ${e}s linear 1;`)}const n=this._getOffsetThreshold(),{clientWidth:r,clientHeight:o}=this.wrap,a=r?this._randomBetween(n.hLeft,n.hRight):0,s=o?this._randomBetween(n.vTop,n.vBottom):0;setTimeout((()=>{this.img.setAttribute("style",`opacity: 0.1;transform: translate(${a}px, ${s}px);animation: _xg_animation_blink ${e}s linear 1;`)}),10)}_attrObserver(e,t,i){if(!e||!this.wrap||!window.MutationObserver)return;const n=new window.MutationObserver((t=>{e&&this.wrap&&t.forEach((t=>{if("class"===t.attributeName&&e.getAttribute("class")!=VB.class[i]&&e.setAttribute("class",VB.class[i]),"style"===t.attributeName&&e.getAttribute("style")!=VB.style[i]&&e.setAttribute("style",VB.style[i]),"img"===i&&"src"===t.attributeName){if(((null==e?void 0:e.getAttribute("src"))||"")!==this.imgSrc){const t=this._getWatermarkDom();this.wrap&&t&&(this.imgSrc=t,e.setAttribute("src",t))}}}))}));return n.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:t}),n}_domObserver(e,t){if(!e||!this.wrap)return;const i=new window.MutationObserver((i=>{e&&this.wrap&&i.forEach((i=>{i.removedNodes.forEach((i=>{if(!t)return e.appendChild(i);!e.getElementsByClassName(this.config.rootClassName).length&&e.appendChild(i)}))}))}));return i.observe(e,{childList:!0}),i}update(){const e=this._getWatermarkDom();this.wrap&&this.img&&e&&(this.imgSrc=e,this.img.setAttribute("src",e))}start(){if(!(this.root&&this.wrap&&this.img))return;clearInterval(this.moveTimer),clearInterval(this.blinkTimer),this.observer.forEach((e=>{var t;null==(t=null==e?void 0:e.disconnect)||t.call(e)})),this.wrap.innerHTML="",this.wrap.setAttribute("style",FB);const e=this._getWatermarkDom();e&&(this.img.src=e,this.img.style.opacity="0",this.img.alt="",this.imgSrc=e,this.wrap.appendChild(this.img),setTimeout((()=>this._startRender())))}pause(){this.pauseAnimation=!0}resume(){this.pauseAnimation=!1}resize(){}destroy(){clearInterval(this.moveTimer),clearInterval(this.blinkTimer),this.observer.forEach((e=>{var t;null==(t=null==e?void 0:e.disconnect)||t.call(e)})),this.img=null,this.wrap.innerHTML="",this.wrap=null}}const WB="xg-dynamic-watermark";class YB extends ba{constructor(e){super(e),this.wm=null}static get pluginName(){return"DynamicWatermark"}static get defaultConfig(){return{position:ba.POSITIONS.ROOT,displayType:1,tickerSpeed:void 0,fontSize:12,fontColor:"#ffffff",opacity:.3,enable:!1,top:void 0,left:void 0,right:void 0,bottom:void 0,content:""}}afterCreate(){this.config.enable&&(this._initWatermark(),this.once(to,(()=>{this.start()})),this.on(Ro,(()=>{this.resize()})))}start(){var e,t;null==(t=null==(e=this.wm)?void 0:e.start)||t.call(e)}pause(){var e,t;null==(t=null==(e=this.wm)?void 0:e.pause)||t.call(e)}resume(){var e,t;null==(t=null==(e=this.wm)?void 0:e.resume)||t.call(e)}resize(){var e,t;null==(t=null==(e=this.wm)?void 0:e.resize)||t.call(e)}_initWatermark(){this.wm=new GB(u(c({},this.config),{root:this.root,rootClassName:WB}))}destroy(){var e,t;null==(t=null==(e=this.wm)?void 0:e.destroy)||t.call(e),this.offAll()}render(){return`\n <xg-dynamic-watermark class=${WB} />\n `}}class zB extends ba{constructor(e){super(e),this.waitings=[],this.longWaitingEmitTime=0,this.waitingStartTime=0,this.playerData=null,this.playerData=this.playerConfig.playerData}static get pluginName(){return"DefinitionDemotePlugin"}static get defaultConfig(){return{isNeedAutoDemote:!0,toastShowTime:3e3,demotePriority:[],isNeedShowTips:!0,oftenWaitingCount:3,oftenWaitingTime:5e3,longWaitingTime:5e3}}registerLanguageTexts(){return{definition_demote_txt:{jp:"現在のネットワークは不安定です。に切り替えることをお勧めします",en:"The current network is unstable, it is recommended to switch to ",zh:"当前网络不稳定,建议切换到","zh-hk":"當前網絡不穩定,建議切換到"}}}afterCreate(){this.bindCtx(),this.bindEvents()}bindCtx(){this._count=this._count.bind(this),this._time=this._time.bind(this),this._waiting=this._waiting.bind(this),this._clearTime=this._clearTime.bind(this),this.demote=this.demote.bind(this)}bindEvents(){this.on(io,this._waiting),this.on(Zr,this._clearTime),this.on($r,this._clearTime),this.on(wo,this._clearTime),this.on(MA.PlAY_URL_CHANGE,this._clearTime),this.config.isNeedAutoDemote&&this.player.on(MA.LONG_WAITING,this.demote)}_waiting(){this._count(),this._time()}_count(){const e=Date.now();this.waitings.push(e);const{oftenWaitingCount:t,oftenWaitingTime:i}=this.config;if(this.waitings.length>=t){const n=this.waitings.shift();n&&e-n<=i&&(ss.warn(`stuttering occurred at least ${t} times within ${i}ms`),this.player.emit(MA.OFTEN_WAITING)),this.clearState()}}_time(){if(this.timer)return void ss.log("The stuttering was triggered continuously, and the interval since the last stuttering was ",Date.now()-this.waitingStartTime+"ms");this.waitingStartTime=Date.now();const e=this.player.currentTime;this.timer=setTimeout((()=>{this.player&&this.player.currentTime<=e+.1&&(ss.warn(`stuttering last more than ${this.config.longWaitingTime}ms`),this.player.emit(MA.LONG_WAITING),this.timer&&(clearTimeout(this.timer),this.timer=null),this.waitingStartTime&&(this.waitingStartTime=0))}),this.config.longWaitingTime)}_clearTime(){this.waitingStartTime&&ss.log("stuttering last for ",Date.now()-this.waitingStartTime+"ms"),this.clearState()}clearState(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.waitings.length>0&&(this.waitings=[]),this.waitingStartTime&&(this.waitingStartTime=0)}demote(){if(!this.player.checkBuffer(this.player.currentTime,{endDiff:.5,startDiff:.5})&&!this.player.isSeeking&&this.player.state===Na.RUNNING&&this.player.currentTime>1){if(!this.playerData)return;const e=this.playerData.getNextDefinition(!0,this.config.demotePriority),t=null==e?void 0:e[0];if(!t||!t.url)return;const i=t.definition;if(!i)return;const{current:{definition:n}}=this.playerData;if(this.player.emit(MA.DEFINITION_DEMOTE,{currentDef:n,willChangeDef:i,next:t}),"auto"===n){const e=t.url;ss.log(`auto demote definition to ${t.definition}`),this.changeUrl(e)}else i!==n&&this.showToast(t)}else ss.log("stuttering but not need demote definition")}changeUrl(e){this.player&&e&&(this.player.config.url=e,this.player.switchURL(e,{seamless:!this.player.config.isLive}).then((()=>{ss.log(`auto demote definition switch url(${e}) success`)})),this.player.emit(MA.PlAY_URL_CHANGE,{url:e,from:"definition_demote"}))}showToast(e){var t;const i=null==(t=this.player)?void 0:t.getPlugin("sdkToastPlugin");if(!i)return;if(this.toastId&&(i.remove(this.toastId),this.toastId=null),!this.config.isNeedShowTips)return;const n=this.i18n[e.definitionTextKey]||e.definitionTextKey||e.definition,r=Ur.createDom("div",this.langText.definition_demote_txt,void 0,"toast-txt"),o=Ur.createDom("span",n,void 0,"toast-txt-bt");r.appendChild(o),this.toastId=i.add(r,this.config.toastShowTime,!0),o.addEventListener("click",(()=>{this.playerData&&(this.playerData.current.definition=e.definition,i.remove(this.toastId),this.toastId=null,ss.log(`user handle demote definition to ${e.definition}`))}))}destroy(){this.clearState()}}function $B(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.5 0.199997C8.5 0.0895386 8.5896 0 8.69995 0H9.30005C9.4104 0 9.5 0.0895386 9.5 0.199997V1.8C9.5 1.91046 9.4104 2 9.30005 2H8.69995C8.5896 2 8.5 1.91046 8.5 1.8V0.199997Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M0 1.95424C0 1.85173 0.0773926 1.76582 0.179443 1.75529L7.27954 1.02277C7.34546 1.01596 7.40649 1.04182 7.44751 1.08664C7.47998 1.12207 7.5 1.16936 7.5 1.22171V14.7783C7.5 14.8969 7.39746 14.9894 7.27954 14.9773L0.179443 14.2447C0.0773926 14.2342 0 14.1483 0 14.0458V1.95424ZM1.5 12.873V3.12701L6 2.66273V13.3373L1.5 12.873Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M18 1.95424C18 1.85173 17.9226 1.76582 17.8206 1.75529L10.7205 1.02277C10.6025 1.01059 10.5 1.10313 10.5 1.22171V14.7783C10.5 14.8969 10.6025 14.9894 10.7205 14.9773L17.8206 14.2447C17.9226 14.2342 18 14.1483 18 14.0458V1.95424ZM16.5 3.12701L12 2.66273V13.3373L16.5 12.873V3.12701Z" fill="white"/>\n <path d="M8.69995 3C8.5896 3 8.5 3.08954 8.5 3.2V4.8C8.5 4.91046 8.5896 5 8.69995 5H9.30005C9.32642 5 9.35156 4.9949 9.37451 4.98564C9.39111 4.97896 9.40674 4.97011 9.4209 4.95944C9.46899 4.92293 9.5 4.8651 9.5 4.8V3.2C9.5 3.14664 9.47925 3.09818 9.44507 3.06232C9.40869 3.02393 9.35718 3 9.30005 3H8.69995Z" fill="white"/>\n <path d="M8.5 6.2C8.5 6.08954 8.5896 6 8.69995 6H9.30005C9.34277 6 9.38232 6.01344 9.41479 6.03635C9.46631 6.07254 9.5 6.13234 9.5 6.2V7.8C9.5 7.85072 9.48096 7.89703 9.44995 7.9323C9.41821 7.96826 9.37354 7.99272 9.32373 7.99861C9.31592 7.99953 9.30811 8 9.30005 8H8.69995C8.5896 8 8.5 7.91046 8.5 7.8V6.2Z" fill="white"/>\n <path d="M8.53711 9.08395C8.51367 9.11667 8.5 9.15674 8.5 9.20001V10.8C8.5 10.9105 8.5896 11 8.69995 11H9.30005C9.4104 11 9.5 10.9105 9.5 10.8V9.20001C9.5 9.08954 9.4104 9 9.30005 9H8.69995C8.68384 9 8.66821 9.00189 8.65332 9.00546C8.60571 9.01688 8.5647 9.04529 8.53711 9.08395Z" fill="white"/>\n <path d="M8.5 12.2C8.5 12.1371 8.52905 12.081 8.57446 12.0443C8.60864 12.0166 8.65234 12 8.69995 12H9.30005C9.4104 12 9.5 12.0895 9.5 12.2V13.8C9.5 13.8664 9.46753 13.9253 9.41772 13.9616C9.38477 13.9857 9.34399 14 9.30005 14H8.69995C8.5896 14 8.5 13.9105 8.5 13.8V12.2Z" fill="white"/>\n <path d="M8.69995 15C8.5896 15 8.5 15.0895 8.5 15.2V15.8C8.5 15.9105 8.5896 16 8.69995 16H9.30005C9.4104 16 9.5 15.9105 9.5 15.8V15.2C9.5 15.0895 9.4104 15 9.30005 15H8.69995Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}function XB(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.5 0.2C8.5 0.0895431 8.58954 0 8.7 0H9.3C9.41046 0 9.5 0.0895431 9.5 0.2V1.8C9.5 1.91046 9.41046 2 9.3 2H8.7C8.58954 2 8.5 1.91046 8.5 1.8V0.2Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M0 1.95424C0 1.85173 0.0775055 1.76582 0.179474 1.7553L7.27947 1.02276C7.39742 1.01059 7.5 1.10313 7.5 1.2217V14.7783C7.5 14.8969 7.39742 14.9894 7.27947 14.9773L0.179474 14.2447C0.0775053 14.2342 0 14.1483 0 14.0458V1.95424ZM1.5 12.873V3.12702L6 2.66273V13.3373L1.5 12.873Z" fill="white"/>\n <path d="M17.8205 1.7553C17.9225 1.76582 18 1.85173 18 1.95424V14.0458C18 14.1483 17.9225 14.2342 17.8205 14.2447L10.7205 14.9773C10.6026 14.9894 10.5 14.8969 10.5 14.7783V1.2217C10.5 1.10313 10.6026 1.01059 10.7205 1.02276L17.8205 1.7553Z" fill="white"/>\n <path d="M8.7 3C8.58954 3 8.5 3.08954 8.5 3.2V4.8C8.5 4.91046 8.58954 5 8.7 5H9.3C9.41046 5 9.5 4.91046 9.5 4.8V3.2C9.5 3.08954 9.41046 3 9.3 3H8.7Z" fill="white"/>\n <path d="M8.5 6.2C8.5 6.08954 8.58954 6 8.7 6H9.3C9.41046 6 9.5 6.08954 9.5 6.2V7.8C9.5 7.91046 9.41046 8 9.3 8H8.7C8.58954 8 8.5 7.91046 8.5 7.8V6.2Z" fill="white"/>\n <path d="M8.7 9C8.58954 9 8.5 9.08954 8.5 9.2V10.8C8.5 10.9105 8.58954 11 8.7 11H9.3C9.41046 11 9.5 10.9105 9.5 10.8V9.2C9.5 9.08954 9.41046 9 9.3 9H8.7Z" fill="white"/>\n <path d="M8.5 12.2C8.5 12.0895 8.58954 12 8.7 12H9.3C9.41046 12 9.5 12.0895 9.5 12.2V13.8C9.5 13.9105 9.41046 14 9.3 14H8.7C8.58954 14 8.5 13.9105 8.5 13.8V12.2Z" fill="white"/>\n <path d="M8.7 15C8.58954 15 8.5 15.0895 8.5 15.2V15.8C8.5 15.9105 8.58954 16 8.7 16H9.3C9.41046 16 9.5 15.9105 9.5 15.8V15.2C9.5 15.0895 9.41046 15 9.3 15H8.7Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}const{POSITIONS:qB}=ba,ZB="getMirror",QB="exitMirror";class JB extends ba{constructor(e){super(e),this.isEnableMirror=!0,this.isEnableMirror=this.config.defaultEnable}static get pluginName(){return"mirrorPlugin"}static get defaultConfig(){return{position:qB.CONTROLS_RIGHT,index:VA,disable:!1,defaultEnable:!1}}afterCreate(){this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.updateMirrorState(this.isEnableMirror))}registerIcons(){return{[ZB]:{icon:$B,class:"xg-get-mirror"},[QB]:{icon:XB,class:"xg-exit-mirror"}}}initIcons(){const{icons:e}=this,t=this.find(".xgplayer-icon");t.appendChild(e[ZB]),t.appendChild(e[QB])}registerLanguageTexts(){return{getMirror:{jp:"ミラーを開く",en:"Turn on mirroring",zh:"开启镜像","zh-hk":"開啟鏡像"},exitMirror:{jp:"ミラーを閉じる",en:"Turn off mirroring",zh:"关闭镜像","zh-hk":"關閉鏡像"}}}btnClick(e){e.preventDefault(),e.stopPropagation(),this.isEnableMirror?this.action(!1):this.action(!0)}action(e){this.isEnableMirror=e,this.updateMirrorState(this.isEnableMirror),this.player.emit(MA.MIRROR_CHANGE,this.isEnableMirror)}updateMirrorState(e){const t=this.player;e?t.addClass("xgplayer-mirror"):t.removeClass("xgplayer-mirror"),this.animate(e)}animate(e){this.root&&(e?this.setAttr("data-state","enable"):this.setAttr("data-state","normal"),this.switchTips(e))}switchTips(e){this.changeLangTextKey(this.find(".xg-tips"),e?QB:ZB)}destroy(){this.unbind(["click","touchend"],this.btnClick)}render(){if(!this.config.disable)return`<xg-icon class='xgplayer-mirror-icon'>\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="mirror">${this.langText[ZB]}</div>\n </xg-icon>`}}class eF extends ba{constructor(e){super(e),this.memoryId="",this.shouldShowToast=!1,this.saveTimeFun=Ur.checkIsFunction(this.config.saveTime)?this.config.saveTime:this.saveTimeByStorage,this.getTimeFun=Ur.checkIsFunction(this.config.getTime)?this.config.getTime:this.getTimeByStorage,this.startTime=0,this.memoryId=this.config.memoryId,this.showToast=this.showToast.bind(this),this.saveTime=this.saveTime.bind(this),this.visibilitychangeCallback=this.visibilitychangeCallback.bind(this)}static get pluginName(){return"memoryPlay"}static get defaultConfig(){return{getTime:null,saveTime:null,memoryId:"",minStartTime:1,minEndTime:1}}registerLanguageTexts(){return{preText:{jp:"に位置付けられました",en:"Has located for you to ",zh:"已为您定位至","zh-hk":"已為您定位至"}}}children(){return{toast:cO}}afterCreate(){this.once(eo,this.showToast),this.on(to,(()=>{this.curTime=this.player.currentTime}))}beforePlayerInit(){return this.memoryId||(this.playerConfig.vid?this.memoryId=this.playerConfig.vid:this.player.url&&(this.memoryId=this.player.url.replace(/\?.*$/,""))),this.setSave(),this.getTime()}getTime(){return new Promise((e=>{const t=(i=this.getTimeFun(this.memoryId))&&i.then?i:new Promise((e=>{e(i)}));var i;t.then((t=>{var i,n,r,o,a,s;const l=function(e,t=0){const i=parseFloat(e);return Number.isNaN(i)?t:i}(t);!isNaN(l)&&l>0?(this.startTime=l,this.shouldShowToast=!0,this.playerConfig.startTime=this.startTime,(null==(r=null==(n=null==(i=this.player.plugins)?void 0:i.hls)?void 0:n.hls)?void 0:r.config)&&(this.player.plugins.hls.hls.config.startTime=this.startTime),(null==(s=null==(a=null==(o=this.player.plugins)?void 0:o.encrypthlsplugin)?void 0:a.hls)?void 0:s.config)&&(this.player.plugins.encrypthlsplugin.hls.config.startTime=this.startTime)):ss.warn("the time got is invalid",t),e()})).catch((t=>{ss.error("getTime function occur error",t),e()}))}))}saveTime(){var e;if(!this.player)return;const{minStartTime:t=1,minEndTime:i=1}=this.config,{currentTime:n,duration:r}=this.player,o=null!=(e=null!=n?n:this.curTime)?e:0;r&&(o<t||Math.abs(r-o)<i?this.saveTimeFun(this.memoryId,0):this.saveTimeFun(this.memoryId,o))}visibilitychangeCallback(){"hidden"===document.visibilityState&&this.saveTime()}setSave(){this.on(qr,this.saveTime.bind(this)),this.on(Qr,this.saveTime.bind(this)),document.addEventListener("visibilitychange",this.visibilitychangeCallback.bind(this)),document.addEventListener("pagehide",this.saveTime.bind(this)),window.addEventListener("beforeunload",this.saveTime.bind(this))}showToast(){var e;if(this.shouldShowToast){this.shouldShowToast=!1;const t=null==(e=this.player)?void 0:e.getPlugin("sdkToastPlugin");if(!t)return;if(this.startTime>0){const e=Ur.format(this.startTime);t.add(`${this.langText.preText}${e}`,4e3,!0)}}}saveTimeByStorage(e,t){Ds(e,eF.pluginName,t+"")}getTimeByStorage(e){return ws(e,eF.pluginName)||0}destroy(){this.saveTime(),document.removeEventListener("visibilitychange",this.visibilitychangeCallback),document.removeEventListener("pagehide",this.saveTime),window.removeEventListener("beforeunload",this.saveTime)}}function tF(){return(new DOMParser).parseFromString('<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#filter0_dii_340_912)">\n<path d="M4.00011 7.66678C4.00005 5.82578 5.49245 4.33333 7.33344 4.33333H23.3742H32.6657C34.5066 4.33333 35.999 5.82572 35.999 7.66667V13.5764L35.9998 32.3332C35.9999 34.1742 34.5075 35.6667 32.6665 35.6667H7.33423C5.49332 35.6667 4.00096 34.1743 4.0009 32.3334L4.00011 7.66678Z" fill="url(#paint0_linear_340_912)"/>\n<path d="M4.10011 7.66677C4.10005 5.88101 5.54768 4.43333 7.33344 4.43333H23.3742H32.6657C34.4514 4.43333 35.899 5.88095 35.899 7.66667V13.5764L35.8998 32.3332C35.8999 34.119 34.4523 35.5667 32.6665 35.5667H7.33423C5.54855 35.5667 4.10095 34.1191 4.1009 32.3334L4.10011 7.66677Z" stroke="url(#paint1_linear_340_912)" stroke-width="0.2"/>\n</g>\n<path d="M6.76669 9.66667C6.76669 8.24914 7.91582 7.1 9.33335 7.1H30.6667C32.0842 7.1 33.2334 8.24914 33.2334 9.66667V30.3333C33.2334 31.7509 32.0842 32.9 30.6667 32.9H9.33335C7.91582 32.9 6.76669 31.7509 6.76669 30.3333V9.66667Z" fill="url(#paint2_linear_340_912)" stroke="url(#paint3_linear_340_912)" stroke-width="0.2"/>\n<g filter="url(#filter1_dii_340_912)">\n<path d="M15.4689 18.4428L10.9398 27.4593C10.6614 28.0134 11.0643 28.6667 11.6845 28.6667H27.8647C28.5118 28.6667 28.912 27.9614 28.5801 27.4059L25.3326 21.9703C25.0217 21.4499 24.2769 21.425 23.932 21.9235L21.1839 25.8946C21.1128 25.9973 20.9581 25.9882 20.8996 25.8778L16.9499 18.4266C16.6329 17.8285 15.7728 17.8379 15.4689 18.4428Z" fill="url(#paint4_linear_340_912)"/>\n<path d="M15.4689 18.4428L10.9398 27.4593C10.6614 28.0134 11.0643 28.6667 11.6845 28.6667H27.8647C28.5118 28.6667 28.912 27.9614 28.5801 27.4059L25.3326 21.9703C25.0217 21.4499 24.2769 21.425 23.932 21.9235L21.1839 25.8946C21.1128 25.9973 20.9581 25.9882 20.8996 25.8778L16.9499 18.4266C16.6329 17.8285 15.7728 17.8379 15.4689 18.4428Z" stroke="url(#paint5_linear_340_912)" stroke-width="0.166667"/>\n</g>\n<g filter="url(#filter2_dii_340_912)">\n<circle cx="23.6667" cy="14.6667" r="2" fill="url(#paint6_linear_340_912)"/>\n<circle cx="23.6667" cy="14.6667" r="2" stroke="url(#paint7_linear_340_912)" stroke-width="0.166667"/>\n</g>\n<defs>\n<filter id="filter0_dii_340_912" x="3.8431" y="4.17631" width="32.6278" height="32.1184" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="0.157018" dy="0.314036"/>\n<feGaussianBlur stdDeviation="0.157018"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.0684375 0 0 0 0 0.0704062 0 0 0 0 0.075 0 0 0 0.5 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_340_912"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_340_912" result="shape"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="0.471054" dy="0.471054"/>\n<feGaussianBlur stdDeviation="0.157018"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.355764 0 0 0 0 0.368819 0 0 0 0 0.391667 0 0 0 1 0"/>\n<feBlend mode="normal" in2="shape" result="effect2_innerShadow_340_912"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="-0.471054" dy="-0.471054"/>\n<feGaussianBlur stdDeviation="0.0785089"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.191389 0 0 0 0 0.197708 0 0 0 0 0.216667 0 0 0 1 0"/>\n<feBlend mode="normal" in2="effect2_innerShadow_340_912" result="effect3_innerShadow_340_912"/>\n</filter>\n<filter id="filter1_dii_340_912" x="10.4333" y="17.5669" width="18.6828" height="11.6831" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.0823529 0 0 0 0 0.0901961 0 0 0 0 0.105882 0 0 0 1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_340_912"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_340_912" result="shape"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.930313 0 0 0 0 0.935083 0 0 0 0 0.954167 0 0 0 1 0"/>\n<feBlend mode="normal" in2="shape" result="effect2_innerShadow_340_912"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="-0.166667" dy="-0.333333"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.409097 0 0 0 0 0.443509 0 0 0 0 0.570833 0 0 0 1 0"/>\n<feBlend mode="normal" in2="effect2_innerShadow_340_912" result="effect3_innerShadow_340_912"/>\n</filter>\n<filter id="filter2_dii_340_912" x="21.25" y="12.25" width="4.83329" height="5.00001" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.0823529 0 0 0 0 0.0901961 0 0 0 0 0.105882 0 0 0 1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_340_912"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_340_912" result="shape"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.930313 0 0 0 0 0.935083 0 0 0 0 0.954167 0 0 0 1 0"/>\n<feBlend mode="normal" in2="shape" result="effect2_innerShadow_340_912"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="-0.166667" dy="-0.333333"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.364583 0 0 0 0 0.397828 0 0 0 0 0.520833 0 0 0 1 0"/>\n<feBlend mode="normal" in2="effect2_innerShadow_340_912" result="effect3_innerShadow_340_912"/>\n</filter>\n<linearGradient id="paint0_linear_340_912" x1="30.2254" y1="8.17498" x2="11.4982" y2="41.5657" gradientUnits="userSpaceOnUse">\n<stop stop-color="#434548"/>\n<stop offset="0.855332" stop-color="#3E3F42"/>\n</linearGradient>\n<linearGradient id="paint1_linear_340_912" x1="7.52649" y1="1.8673" x2="25.0283" y2="33.3887" gradientUnits="userSpaceOnUse">\n<stop stop-color="#383838"/>\n<stop offset="0.192009" stop-color="#45484D"/>\n<stop offset="0.703503" stop-color="#37393D"/>\n<stop offset="0.962692" stop-color="#1B1C1E"/>\n</linearGradient>\n<linearGradient id="paint2_linear_340_912" x1="28.5212" y1="10.1877" x2="13.0162" y2="37.9513" gradientUnits="userSpaceOnUse">\n<stop stop-color="#2E2F32"/>\n<stop offset="0.855332" stop-color="#242528"/>\n</linearGradient>\n<linearGradient id="paint3_linear_340_912" x1="9.60543" y1="4.95372" x2="24.0954" y2="31.1622" gradientUnits="userSpaceOnUse">\n<stop stop-color="#1F2124"/>\n<stop offset="0.192009" stop-color="#282B30"/>\n<stop offset="0.703503" stop-color="#27292F"/>\n<stop offset="0.962692" stop-color="#1D1F23"/>\n</linearGradient>\n<linearGradient id="paint4_linear_340_912" x1="16.969" y1="16.5412" x2="22.5457" y2="28.6249" gradientUnits="userSpaceOnUse">\n<stop stop-color="#C7CCE2"/>\n<stop offset="1" stop-color="#8B95BC"/>\n</linearGradient>\n<linearGradient id="paint5_linear_340_912" x1="17.5125" y1="20.3581" x2="20.121" y2="28.4669" gradientUnits="userSpaceOnUse">\n<stop offset="0.181113" stop-color="#B1B7D3"/>\n<stop offset="1" stop-color="#535C80"/>\n</linearGradient>\n<linearGradient id="paint6_linear_340_912" x1="23.0637" y1="12.5093" x2="25.4773" y2="15.7207" gradientUnits="userSpaceOnUse">\n<stop stop-color="#B8BED6"/>\n<stop offset="1" stop-color="#7E88AD"/>\n</linearGradient>\n<linearGradient id="paint7_linear_340_912" x1="23.1781" y1="13.818" x2="24.4392" y2="16.2252" gradientUnits="userSpaceOnUse">\n<stop offset="0.181113" stop-color="#B1B7D3"/>\n<stop offset="1" stop-color="#495274"/>\n</linearGradient>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}class iF{constructor(e){this.config=e.config,this.parent=e.root,this.root=Ur.createDom("ul","",{},`xg-play-list xg-list-slide-scroll ${this.config.className}`);const t="mobile"===Kr.device?"touchend":"click";this.modal=Ur.createDom("div","",{},"xg-play-list-modal"),this.modal.appendChild(this.root),e.root.appendChild(this.modal),this._delegates=ba.delegate.call(this,this.modal,".xg-play-list-modal",t,this.modalClick.bind(this));const{maxHeight:i}=this.config;i&&this.setStyle({maxHeight:i}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList(),this._delegates.concat(ba.delegate.call(this,this.root,"li",t,this.onItemClick))}renderItemList(e){const{config:t,root:i}=this;e?t.data=e:e=t.data,t.style&&Object.keys(t.style).map((e=>{i.style[e]=t[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map(((e,t)=>{const i=e.selected?"xg-play-list-item selected":"xg-play-list-item";e["data-index"]=t;const n=e.duration?Ur.format(e.duration):"",r=`\n <div style="${e.poster?`background-image: url('${e.poster}')`:""}" class="xg-play-list-poster ${e.selected?"is-active":""} ${e.poster?"":"no-poster"}" >\n <div class="bg"></div>\n <div class="icon"></div>\n <div class="duration">${n}</div>\n <duv class="playing">\n <div class="icon-wrap">\n <div class="icon-line"></div>\n <div class="icon-line"></div>\n <div class="icon-line"></div>\n <div class="icon-line"></div>\n </div>\n </duv>\n </div>\n <div class="xg-play-list-title">\n <div class="xg-play-list-title-text">${e.title}</div>\n </div>\n `,o=Ur.createDom("li",r,e,i),a=Ur.findDom(o,".bg"),s=null==tF?void 0:tF();!e.poster&&s&&a.appendChild(s),this.root.appendChild(o)}));const n=e.findIndex((e=>e.selected));if(n>=0){const t=Ur.findDom(this.root,".xg-play-list-item.selected");if(!t)return;const{height:i}=t.getBoundingClientRect(),{height:r}=this.root.getBoundingClientRect(),o=(e.length-n)*i,a=i*e.length;this.root.scrollTop=o<r?a-r:n*i}}onItemClick(e){e.delegateTarget||(e.delegateTarget=e.target);const t=e.delegateTarget;if(t&&Ur.hasClass(t,"selected"))return!1;const i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");Ur.addClass(t,"selected"),n&&Ur.removeClass(n,"selected"),i&&i(e,{from:n?this.getAttrObj(n,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}getAttrObj(e,t){if(!e||!t)return{};const i={};t.map((t=>{i[t]=e.getAttribute(t)}));const n=e.getAttribute("data-index");return n&&(i.index=Number(n)),i}show(){Ur.removeClass(this.modal,"hide"),Ur.addClass(this.modal,"active"),Ur.removeClass(this.root,"hide"),Ur.addClass(this.root,"active")}hide(){Ur.removeClass(this.modal,"active"),Ur.addClass(this.modal,"hide"),Ur.removeClass(this.root,"active"),Ur.addClass(this.root,"hide")}modalClick(e){e.stopPropagation(),this.hide();const t="function"==typeof this.config.onModalClick?this.config.onModalClick:null;t&&t(e)}setStyle(e){Object.keys(e).forEach((t=>{this.root.style[t]=e[t]}))}destroy(){this._delegates&&(this._delegates.map((e=>{e.destroy&&e.destroy()})),this._delegates=null),this.root.parentNode.removeChild(this.root),this.root.innerHTML=null,this.root=null}}function nF(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M12.8499 8.49494C13.7054 8.98885 14.1331 9.23581 14.2767 9.55822C14.4019 9.83944 14.4019 10.1606 14.2767 10.4418C14.1331 10.7642 13.7054 11.0112 12.8499 11.5051L6.65863 15.0796C5.80315 15.5735 5.37542 15.8205 5.02442 15.7836C4.71827 15.7514 4.44016 15.5909 4.25921 15.3418C4.05177 15.0563 4.05177 14.5624 4.05177 13.5746V6.42547C4.05177 5.43765 4.05177 4.94374 4.25921 4.65822C4.44016 4.40917 4.71827 4.2486 5.02442 4.21642C5.37542 4.17953 5.80315 4.42649 6.65863 4.92039L12.8499 8.49494Z" fill="white"/>\n<rect x="13.8274" y="4.02594" width="2.17238" height="11.9481" rx="0.814644" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}function rF(){return(new DOMParser).parseFromString('<svg width="21" height="22" viewBox="0 0 21 22" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#filter0_d_126_721)">\n<path d="M8.18979 6.3414C8.60304 6.57999 8.80967 6.69928 8.87901 6.85503C8.93949 6.99088 8.93949 7.14601 8.87901 7.28186C8.80967 7.4376 8.60304 7.5569 8.18979 7.79549L5.59253 9.29502C5.17928 9.53361 4.97266 9.6529 4.80311 9.63508C4.65522 9.61954 4.52087 9.54197 4.43346 9.42167C4.33325 9.28374 4.33325 9.04515 4.33325 8.56797V5.56891C4.33325 5.09173 4.33325 4.85314 4.43346 4.71522C4.52087 4.59491 4.65522 4.51735 4.80311 4.5018C4.97266 4.48398 5.17928 4.60328 5.59253 4.84187L8.18979 6.3414Z" fill="white"/>\n</g>\n<path d="M11.5264 7.19745H18" stroke="white" stroke-width="1.61843" stroke-linecap="round"/>\n<path d="M5.05273 12.5922L18.0001 12.5922" stroke="white" stroke-width="1.61843" stroke-linecap="round"/>\n<path d="M5.05273 17.9869L18.0001 17.9869" stroke="white" stroke-width="1.61843" stroke-linecap="round"/>\n<defs>\n<filter id="filter0_d_126_721" x="0.736733" y="0.903543" width="11.7841" height="12.3298" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset/>\n<feGaussianBlur stdDeviation="1.79826"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_126_721"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_126_721" result="shape"/>\n</filter>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}const oF="playListNext",aF="playListToggle",sF="mobile"===Kr.device;function lF(e=[]){if(!Array.isArray(e))return[];return e.filter((e=>e.url||e.playAuthToken)).map(((e,t)=>{const i=c({},e||{});return i.vid||(i.vid=""+t),i}))}function cF(e=[],t=0){const i=Number(t),n=Number.isNaN(i)?0:i;let r=0;return r=n<=0?0:n<e.length?n:0,r<0?0:r}kA.prototype.setVodPlayListConfig=function(e){if(!(e.plugins||[]).find((e=>e.pluginName===uF.pluginName)))return;const t=$s(e,"playListPlugin");if(t&&function(e){const t=typeof e;return null!==e&&("object"===t||"function"===t)}(t)){const{list:i=[],defaultIndex:n=0}=t,r=lF(i),o=cF(r,n),a=null==r?void 0:r[o];if(a){const{url:t,poster:i,playAuthToken:n}=a;n?e.getVideoByToken=u(c({},e.getVideoByToken||{}),{playAuthToken:n}):t&&(e.url=t),i&&(e.poster=i)}}};class uF extends ba{constructor(){super(...arguments),this.timer=null,this.onEnter=e=>{e.stopPropagation(),this.emit("icon_mouseenter",{pluginName:this.pluginName}),this.switchActiveState(e)},this.switchActiveState=e=>{e.stopPropagation();const{toggleMode:t}=this.config;"click"===t?this.toggle(!this.isActive):this.toggle(!0)},this.handleNext=e=>{e.stopPropagation(),this.next()},this._onTimeUpdate=()=>{const{player:e}=this;!this.halfPass&&e.currentTime>e.duration/2&&this.confirmOrder()},this._onEnded=()=>{if("order"===this.mode&&this.curIndex+1>=this.list.length)return this.player.pause(),void(this.player.currentTime=0);this.next()},this.onLeave=e=>{e.stopPropagation(),this.emit("icon_mouseleave",{pluginName:this.pluginName}),this.isActive&&this.toggle(!1)}}static get pluginName(){return"playListPlugin"}static get defaultConfig(){return{position:ba.POSITIONS.CONTROLS_LEFT,index:GA,list:[],mode:"order",defaultIndex:0,isItemClickHide:!0,toggleMode:"click"}}beforeCreate(e){Object.values(ba.POSITIONS).includes(e.position)||(e.root=e.player.controls.left,e.config.position=ba.POSITIONS.CONTROLS_LEFT,e.position=ba.POSITIONS.CONTROLS_LEFT)}afterCreate(){const{config:e}=this,{list:t=[],mode:i,defaultIndex:n}=e||{};this.initIcons(),this.halfPass=!1,this.list=lF(t),this.timer=setTimeout((()=>{this.emit(MA.PLAY_LIST_CHANGE,this.list)})),this.disable=!(t.length>0),this.mode=i,this.curIndex=cF(this.list,n),this.curIndex>0?(this.nextIndex=this.curIndex+1<this.list.length?this.curIndex+1:0,this.prevIndex=this.curIndex-1):(this.nextIndex=1,this.prevIndex=this.list.length-1),this.on(to,this._onTimeUpdate),this.on(qr,this._onEnded),this.on([Ro,Io],(()=>{this._resizeList()})),this.once(no,(()=>{this.list&&this.list.length>0&&(this.renderItemList(),this.show())})),sF&&this.on(ho,(()=>{this.isActive&&(this.optionsList&&this.optionsList.hide(),this.isActive=!1)})),sF?(e.toggleMode="click",this.activeEvent="touchend"):this.activeEvent="click"===e.toggleMode?"click":"mouseenter",this.bind(".xg-play-next-btn","click",this.handleNext),"click"===e.toggleMode?this.bind(".xg-play-list-btn",this.activeEvent,this.switchActiveState):(this.bind(".xg-play-list-btn",this.activeEvent,this.onEnter),this.bind(".xg-play-list-btn","mouseleave",this.onLeave))}registerLanguageTexts(){return{playNext:{jp:"次に遊ぶ",en:"play next",zh:"播放下一个","zh-hk":"播放下一個"},playList:{jp:"プレイリスト",en:"playList",zh:"播放列表","zh-hk":"播放清單"}}}registerIcons(){return{[oF]:{icon:nF,class:"xg-play-next-btn"},[aF]:{icon:rF,class:"xg-play-list-btn"}}}initIcons(){const{icons:e}=this;this.appendChild(".xg-play-next-btn",e[oF]),this.appendChild(".xg-play-list-btn",e[aF])}show(){!this.list||this.list.length<1||Ur.addClass(this.root,"show")}hide(){Ur.removeClass(this.root,"show")}prev(){this.disable||(this.halfPass||(this.halfPass=!0,this._prevCompute()),this.curIndex=this.prevIndex,this.change())}next(){this.disable||(this.halfPass||(this.halfPass=!0,this._nextCompute()),this.curIndex=this.nextIndex,this.change())}changeList(e){this.player.currentTime=0,this.list=lF(e),this.nextIndex=0,this.curIndex=0,this.change(),this.disable=!(this.list.length>0),this.emit(MA.PLAY_LIST_CHANGE,this.list)}setIndex(e){e<0||e>=this.list.length||(this.nextIndex=e+1<this.list.length?e+1:0,this.prevIndex=e-1<0?this.list.length-1:e-1,this.curIndex=e,this.change())}change(){if(this.disable)return;const{player:e,list:t,curIndex:i}=this;this.halfPass=!1;const{url:n,playAuthToken:r,title:o="",vid:a="",poster:s=""}=t[i];this.curInfo={url:n,playAuthToken:r,title:o,vid:a,poster:s};const l=e.sdk||e;r?l.playNext({vid:a,poster:s,autoplay:!0,getVideoByToken:{playAuthToken:r}}):l.playNext({vid:a,poster:s,autoplay:!0,url:n}),this.renderItemList(),e.off("timeupdate",this._emitChange.bind(this)),e.once("timeupdate",this._emitChange.bind(this))}confirmOrder(){this.halfPass=!0,this._nextCompute(),this._prevCompute()}_nextCompute(){this.disable||(this.curIndex+1<this.list.length?this.nextIndex=this.curIndex+1:this.nextIndex=0)}_prevCompute(){this.disable||(this.curIndex-1>=0?this.prevIndex=this.curIndex-1:this.prevIndex=this.list.length-1)}_emitChange(){this.emit(MA.PLAY_LIST_ITEM_CHANGE,this.curInfo)}toggle(e){if(e===this.isActive)return;const{controls:t}=this.player;e?(t.blur(),this.optionsList&&this.optionsList.show()):(t.focus(),this.optionsList&&this.optionsList.hide()),this.isActive=e}onItemClick(e,t){e.stopPropagation(),this.curIndex=t.to.index,this.change(),this.toggle(!1)}renderItemList(e){const{list:t,config:i,optionsList:n,player:r}=this;"number"==typeof e&&(this.curIndex=e,this.curInfo=t[e]);const o=t.map(((t,i)=>{const n=u(c({},t),{selected:!1});return i===this.curIndex&&(n.selected=!0,e=i),n}));if(n)return void n.renderItemList(o);const a={config:{data:o,className:"xg-side-play-list",onItemClick:(e,t)=>{this.onItemClick(e,t)},onModalClick:()=>{this.toggle(!1)}},root:r.innerContainer||r.root},{height:s}=this.player.root.getBoundingClientRect(),l=s;l&&i.heightLimit&&(a.config.maxHeight=`${l}px`),this.optionsList=new iF(a),this.show(),this._resizeList()}_resizeList(){if(!this.config.heightLimit)return;const{height:e}=this.player.root.getBoundingClientRect(),t=e;this.optionsList&&this.optionsList.setStyle({maxHeight:`${t}px`})}destroy(){const{config:e}=this;"click"===e.toggleMode?this.unbind(this.activeEvent,this.switchActiveState):(this.unbind(this.activeEvent,this.onEnter),this.unbind("mouseleave",this.onLeave)),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null),this.timer&&(clearTimeout(this.timer),this.timer=null)}set disable(e){this._disable=e,e?(this.hide(),this.optionsList&&this.optionsList.hide()):this.show()}get disable(){return this._disable}render(){if(!this.disable)return`<xg-icon class="xg-options-icon xg-play-list-btn-container ${this.config.className||""}">\n <div class="xgplayer-icon xg-play-next-btn">\n <div class="xg-tips" lang-key="playNext">${this.langText.playNext}</div>\n </div>\n <div class="xgplayer-icon xg-play-list-btn">\n <div class="xg-tips" lang-key="playList">${this.langText.playList}</div>\n </div>\n </xg-icon>`}}const hF=Object.assign(mB,{Events:FA,Event:BA,DefinitionDemotePlugin:zB,MirrorPlugin:JB,MemoryPlay:eF,Subtitle:lO,DynamicWatermarkPlugin:YB,PlayListPlugin:uF,getI18N:_B,BasePlugin:ua,Plugin:ba,Sniffer:Kr,Util:Ur,STATE_CLASS:Pa,I18N:La,STATES:Na});exports.BasePlugin=ua,exports.CodecType=tr,exports.ContentType=ir,exports.DefinitionDemotePlugin=zB,exports.DynamicWatermarkPlugin=YB,exports.EAudioFormat=rr,exports.EDRMTYPE=or,exports.EVideoFormat=nr,exports.Event=BA,exports.Events=FA,exports.I18N=La,exports.MemoryPlay=eF,exports.MirrorPlugin=JB,exports.POSITIONS=ar,exports.PlayListPlugin=uF,exports.Plugin=ba,exports.STATES=Na,exports.STATE_CLASS=Pa,exports.Sniffer=Kr,exports.Subtitle=lO,exports.UmdKeys=Hw,exports.Util=Ur,exports.default=hF,exports.getI18N=_B;