@byteplus/veplayer 1.6.0-alpha.3 → 1.6.3-rc.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/README.md +38 -54
- package/{dist/index.d.ts → index.d.ts} +205 -90
- package/index.min.css +1 -0
- package/index.min.js +2 -0
- package/package.json +5 -81
- package/LICENSE +0 -20
- package/dist/index.min.css +0 -1
- package/dist/index.min.js +0 -2
package/dist/index.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @byteplus/veplayer@1.6.0-alpha.3 Built @Sun, 25 Jun 2023 11:05:25 GMT
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).VePlayer=t()}(this,(function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function t(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach((function(e){c(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function n(){n=function(){return e};var e={},t=Object.prototype,i=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(x){l=function(e,t,n){return e[t]=n}}function c(e,t,n,i){var r,o,a,s,l=t&&t.prototype instanceof d?t:d,c=Object.create(l.prototype),f=new T(i||[]);return c._invoke=(r=e,o=n,a=f,s="suspendedStart",function(e,t){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===e)throw t;return{value:void 0,done:!0}}for(a.method=e,a.arg=t;;){var n=a.delegate;if(n){var i=k(n,a);if(i){if(i===h)continue;return i}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===s)throw s="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s="executing";var l=u(r,o,a);if("normal"===l.type){if(s=a.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:a.done}}"throw"===l.type&&(s="completed",a.method="throw",a.arg=l.arg)}}),c}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(x){return{type:"throw",arg:x}}}e.wrap=c;var h={};function d(){}function f(){}function p(){}var g={};l(g,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(S([])));y&&y!==t&&i.call(y,o)&&(g=y);var m=p.prototype=d.prototype=Object.create(g);function _(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function n(r,o,a,s){var l=u(e[r],e,o);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==typeof h&&i.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(h).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(l.arg)}var r;this._invoke=function(e,i){function o(){return new t((function(t,r){n(e,i,t,r)}))}return r=r?r.then(o,o):o()}}function k(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,k(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var i=u(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var r=i.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(i.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:C}}function C(){return{value:void 0,done:!0}}return f.prototype=p,l(m,"constructor",p),l(p,"constructor",f),f.displayName=l(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},_(b.prototype),l(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var a=new b(c(t,n,i,r),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(m),l(m,s,"Generator"),l(m,o,(function(){return this})),l(m,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},e.values=S,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,i){return a.type="throw",a.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}function i(e){return(i="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 r(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(i,r)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,l,"next",e)}function l(e){r(a,i,o,s,l,"throw",e)}s(void 0)}))}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function l(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(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&&d(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(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 p(e)}function v(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(xX){return!1}}();return function(){var n,i=h(e);if(t){var r=h(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return g(this,n)}}function y(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=h(e)););return e}function m(){return m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=y(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},m.apply(this,arguments)}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var i,r,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(i=n.next()).done)&&(o.push(i.value),!t||o.length!==t);a=!0);}catch(l){s=!0,r=l}finally{try{a||null==n.return||n.return()}finally{if(s)throw r}}return o}(e,t)||k(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||k(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 k(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},T=function(e){return e&&e.Math==Math&&e},S=T("object"==typeof globalThis&&globalThis)||T("object"==typeof window&&window)||T("object"==typeof self&&self)||T("object"==typeof E&&E)||function(){return this}()||Function("return this")(),C={},x=function(e){try{return!!e()}catch(t){return!0}},O=!x((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),P=!x((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),I=P,L=Function.prototype.call,D=I?L.bind(L):function(){return L.apply(L,arguments)},A={},M={}.propertyIsEnumerable,R=Object.getOwnPropertyDescriptor,N=R&&!M.call({1:2},1);A.f=N?function(e){var t=R(this,e);return!!t&&t.enumerable}:M;var j,B,U=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},H=P,F=Function.prototype,G=F.call,V=H&&F.bind.bind(G,G),z=H?V:function(e){return function(){return G.apply(e,arguments)}},W=z,K=W({}.toString),q=W("".slice),Y=function(e){return q(K(e),8,-1)},$=Y,X=z,J=function(e){if("Function"===$(e))return X(e)},Z=x,Q=Y,ee=Object,te=J("".split),ne=Z((function(){return!ee("z").propertyIsEnumerable(0)}))?function(e){return"String"==Q(e)?te(e,""):ee(e)}:ee,ie=function(e){return null==e},re=ie,oe=TypeError,ae=function(e){if(re(e))throw oe("Can't call method on "+e);return e},se=ne,le=ae,ce=function(e){return se(le(e))},ue="object"==typeof document&&document.all,he={all:ue,IS_HTMLDDA:void 0===ue&&void 0!==ue},de=he.all,fe=he.IS_HTMLDDA?function(e){return"function"==typeof e||e===de}:function(e){return"function"==typeof e},pe=fe,ge=he.all,ve=he.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:pe(e)||e===ge}:function(e){return"object"==typeof e?null!==e:pe(e)},ye=S,me=fe,_e=function(e){return me(e)?e:void 0},be=function(e,t){return arguments.length<2?_e(ye[e]):ye[e]&&ye[e][t]},ke=J({}.isPrototypeOf),we=be("navigator","userAgent")||"",Ee=S,Te=we,Se=Ee.process,Ce=Ee.Deno,xe=Se&&Se.versions||Ce&&Ce.version,Oe=xe&&xe.v8;Oe&&(B=(j=Oe.split("."))[0]>0&&j[0]<4?1:+(j[0]+j[1])),!B&&Te&&(!(j=Te.match(/Edge\/(\d+)/))||j[1]>=74)&&(j=Te.match(/Chrome\/(\d+)/))&&(B=+j[1]);var Pe=B,Ie=Pe,Le=x,De=!!Object.getOwnPropertySymbols&&!Le((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ie&&Ie<41})),Ae=De&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Me=be,Re=fe,Ne=ke,je=Object,Be=Ae?function(e){return"symbol"==typeof e}:function(e){var t=Me("Symbol");return Re(t)&&Ne(t.prototype,je(e))},Ue=String,He=function(e){try{return Ue(e)}catch(t){return"Object"}},Fe=fe,Ge=He,Ve=TypeError,ze=function(e){if(Fe(e))return e;throw Ve(Ge(e)+" is not a function")},We=ze,Ke=ie,qe=function(e,t){var n=e[t];return Ke(n)?void 0:We(n)},Ye=D,$e=fe,Xe=ve,Je=TypeError,Ze=function(e,t){var n,i;if("string"===t&&$e(n=e.toString)&&!Xe(i=Ye(n,e)))return i;if($e(n=e.valueOf)&&!Xe(i=Ye(n,e)))return i;if("string"!==t&&$e(n=e.toString)&&!Xe(i=Ye(n,e)))return i;throw Je("Can't convert object to primitive value")},Qe={exports:{}},et=S,tt=Object.defineProperty,nt=function(e,t){try{tt(et,e,{value:t,configurable:!0,writable:!0})}catch(n){et[e]=t}return t},it=nt,rt="__core-js_shared__",ot=S[rt]||it(rt,{}),at=ot;(Qe.exports=function(e,t){return at[e]||(at[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.0",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE",source:"https://github.com/zloirock/core-js"});var st=ae,lt=Object,ct=function(e){return lt(st(e))},ut=ct,ht=J({}.hasOwnProperty),dt=Object.hasOwn||function(e,t){return ht(ut(e),t)},ft=J,pt=0,gt=Math.random(),vt=ft(1..toString),yt=function(e){return"Symbol("+(void 0===e?"":e)+")_"+vt(++pt+gt,36)},mt=S,_t=Qe.exports,bt=dt,kt=yt,wt=De,Et=Ae,Tt=_t("wks"),St=mt.Symbol,Ct=St&&St.for,xt=Et?St:St&&St.withoutSetter||kt,Ot=function(e){if(!bt(Tt,e)||!wt&&"string"!=typeof Tt[e]){var t="Symbol."+e;wt&&bt(St,e)?Tt[e]=St[e]:Tt[e]=Et&&Ct?Ct(t):xt(t)}return Tt[e]},Pt=D,It=ve,Lt=Be,Dt=qe,At=Ze,Mt=TypeError,Rt=Ot("toPrimitive"),Nt=function(e,t){if(!It(e)||Lt(e))return e;var n,i=Dt(e,Rt);if(i){if(void 0===t&&(t="default"),n=Pt(i,e,t),!It(n)||Lt(n))return n;throw Mt("Can't convert object to primitive value")}return void 0===t&&(t="number"),At(e,t)},jt=Nt,Bt=Be,Ut=function(e){var t=jt(e,"string");return Bt(t)?t:t+""},Ht=ve,Ft=S.document,Gt=Ht(Ft)&&Ht(Ft.createElement),Vt=function(e){return Gt?Ft.createElement(e):{}},zt=Vt,Wt=!O&&!x((function(){return 7!=Object.defineProperty(zt("div"),"a",{get:function(){return 7}}).a})),Kt=O,qt=D,Yt=A,$t=U,Xt=ce,Jt=Ut,Zt=dt,Qt=Wt,en=Object.getOwnPropertyDescriptor;C.f=Kt?en:function(e,t){if(e=Xt(e),t=Jt(t),Qt)try{return en(e,t)}catch(n){}if(Zt(e,t))return $t(!qt(Yt.f,e,t),e[t])};var tn={},nn=O&&x((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),rn=ve,on=String,an=TypeError,sn=function(e){if(rn(e))return e;throw an(on(e)+" is not an object")},ln=O,cn=Wt,un=nn,hn=sn,dn=Ut,fn=TypeError,pn=Object.defineProperty,gn=Object.getOwnPropertyDescriptor,vn="enumerable",yn="configurable",mn="writable";tn.f=ln?un?function(e,t,n){if(hn(e),t=dn(t),hn(n),"function"==typeof e&&"prototype"===t&&"value"in n&&mn in n&&!n.writable){var i=gn(e,t);i&&i.writable&&(e[t]=n.value,n={configurable:yn in n?n.configurable:i.configurable,enumerable:vn in n?n.enumerable:i.enumerable,writable:!1})}return pn(e,t,n)}:pn:function(e,t,n){if(hn(e),t=dn(t),hn(n),cn)try{return pn(e,t,n)}catch(i){}if("get"in n||"set"in n)throw fn("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var _n=tn,bn=U,kn=O?function(e,t,n){return _n.f(e,t,bn(1,n))}:function(e,t,n){return e[t]=n,e},wn={exports:{}},En=O,Tn=dt,Sn=Function.prototype,Cn=En&&Object.getOwnPropertyDescriptor,xn=Tn(Sn,"name"),On={EXISTS:xn,PROPER:xn&&"something"===function(){}.name,CONFIGURABLE:xn&&(!En||En&&Cn(Sn,"name").configurable)},Pn=fe,In=ot,Ln=J(Function.toString);Pn(In.inspectSource)||(In.inspectSource=function(e){return Ln(e)});var Dn,An,Mn,Rn=In.inspectSource,Nn=fe,jn=S.WeakMap,Bn=Nn(jn)&&/native code/.test(String(jn)),Un=Qe.exports,Hn=yt,Fn=Un("keys"),Gn=function(e){return Fn[e]||(Fn[e]=Hn(e))},Vn={},zn=Bn,Wn=S,Kn=ve,qn=kn,Yn=dt,$n=ot,Xn=Gn,Jn=Vn,Zn="Object already initialized",Qn=Wn.TypeError,ei=Wn.WeakMap;if(zn||$n.state){var ti=$n.state||($n.state=new ei);ti.get=ti.get,ti.has=ti.has,ti.set=ti.set,Dn=function(e,t){if(ti.has(e))throw Qn(Zn);return t.facade=e,ti.set(e,t),t},An=function(e){return ti.get(e)||{}},Mn=function(e){return ti.has(e)}}else{var ni=Xn("state");Jn[ni]=!0,Dn=function(e,t){if(Yn(e,ni))throw Qn(Zn);return t.facade=e,qn(e,ni,t),t},An=function(e){return Yn(e,ni)?e[ni]:{}},Mn=function(e){return Yn(e,ni)}}var ii={set:Dn,get:An,has:Mn,enforce:function(e){return Mn(e)?An(e):Dn(e,{})},getterFor:function(e){return function(t){var n;if(!Kn(t)||(n=An(t)).type!==e)throw Qn("Incompatible receiver, "+e+" required");return n}}},ri=x,oi=fe,ai=dt,si=O,li=On.CONFIGURABLE,ci=Rn,ui=ii.enforce,hi=ii.get,di=Object.defineProperty,fi=si&&!ri((function(){return 8!==di((function(){}),"length",{value:8}).length})),pi=String(String).split("String"),gi=wn.exports=function(e,t,n){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!ai(e,"name")||li&&e.name!==t)&&(si?di(e,"name",{value:t,configurable:!0}):e.name=t),fi&&n&&ai(n,"arity")&&e.length!==n.arity&&di(e,"length",{value:n.arity});try{n&&ai(n,"constructor")&&n.constructor?si&&di(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(r){}var i=ui(e);return ai(i,"source")||(i.source=pi.join("string"==typeof t?t:"")),e};Function.prototype.toString=gi((function(){return oi(this)&&hi(this).source||ci(this)}),"toString");var vi=fe,yi=tn,mi=wn.exports,_i=nt,bi=function(e,t,n,i){i||(i={});var r=i.enumerable,o=void 0!==i.name?i.name:t;if(vi(n)&&mi(n,o,i),i.global)r?e[t]=n:_i(t,n);else{try{i.unsafe?e[t]&&(r=!0):delete e[t]}catch(a){}r?e[t]=n:yi.f(e,t,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e},ki={},wi=Math.ceil,Ei=Math.floor,Ti=Math.trunc||function(e){var t=+e;return(t>0?Ei:wi)(t)},Si=function(e){var t=+e;return t!=t||0===t?0:Ti(t)},Ci=Si,xi=Math.max,Oi=Math.min,Pi=function(e,t){var n=Ci(e);return n<0?xi(n+t,0):Oi(n,t)},Ii=Si,Li=Math.min,Di=function(e){return e>0?Li(Ii(e),9007199254740991):0},Ai=Di,Mi=function(e){return Ai(e.length)},Ri=ce,Ni=Pi,ji=Mi,Bi=function(e){return function(t,n,i){var r,o=Ri(t),a=ji(o),s=Ni(i,a);if(e&&n!=n){for(;a>s;)if((r=o[s++])!=r)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return!e&&-1}},Ui={includes:Bi(!0),indexOf:Bi(!1)},Hi=dt,Fi=ce,Gi=Ui.indexOf,Vi=Vn,zi=J([].push),Wi=function(e,t){var n,i=Fi(e),r=0,o=[];for(n in i)!Hi(Vi,n)&&Hi(i,n)&&zi(o,n);for(;t.length>r;)Hi(i,n=t[r++])&&(~Gi(o,n)||zi(o,n));return o},Ki=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],qi=Wi,Yi=Ki.concat("length","prototype");ki.f=Object.getOwnPropertyNames||function(e){return qi(e,Yi)};var $i={};$i.f=Object.getOwnPropertySymbols;var Xi=be,Ji=ki,Zi=$i,Qi=sn,er=J([].concat),tr=Xi("Reflect","ownKeys")||function(e){var t=Ji.f(Qi(e)),n=Zi.f;return n?er(t,n(e)):t},nr=dt,ir=tr,rr=C,or=tn,ar=function(e,t,n){for(var i=ir(t),r=or.f,o=rr.f,a=0;a<i.length;a++){var s=i[a];nr(e,s)||n&&nr(n,s)||r(e,s,o(t,s))}},sr=x,lr=fe,cr=/#|\.prototype\./,ur=function(e,t){var n=dr[hr(e)];return n==pr||n!=fr&&(lr(t)?sr(t):!!t)},hr=ur.normalize=function(e){return String(e).replace(cr,".").toLowerCase()},dr=ur.data={},fr=ur.NATIVE="N",pr=ur.POLYFILL="P",gr=ur,vr=S,yr=C.f,mr=kn,_r=bi,br=nt,kr=ar,wr=gr,Er=function(e,t){var n,i,r,o,a,s=e.target,l=e.global,c=e.stat;if(n=l?vr:c?vr[s]||br(s,{}):(vr[s]||{}).prototype)for(i in t){if(o=t[i],r=e.dontCallGetSet?(a=yr(n,i))&&a.value:n[i],!wr(l?i:s+(c?".":"#")+i,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;kr(o,r)}(e.sham||r&&r.sham)&&mr(o,"sham",!0),_r(n,i,o,e)}},Tr=ze,Sr=P,Cr=J(J.bind),xr=function(e,t){return Tr(e),void 0===t?e:Sr?Cr(e,t):function(){return e.apply(t,arguments)}},Or=Y,Pr=Array.isArray||function(e){return"Array"==Or(e)},Ir={};Ir[Ot("toStringTag")]="z";var Lr="[object z]"===String(Ir),Dr=Lr,Ar=fe,Mr=Y,Rr=Ot("toStringTag"),Nr=Object,jr="Arguments"==Mr(function(){return arguments}()),Br=Dr?Mr:function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(n){}}(t=Nr(e),Rr))?n:jr?Mr(t):"Object"==(i=Mr(t))&&Ar(t.callee)?"Arguments":i},Ur=J,Hr=x,Fr=fe,Gr=Br,Vr=Rn,zr=function(){},Wr=[],Kr=be("Reflect","construct"),qr=/^\s*(?:class|function)\b/,Yr=Ur(qr.exec),$r=!qr.exec(zr),Xr=function(e){if(!Fr(e))return!1;try{return Kr(zr,Wr,e),!0}catch(t){return!1}},Jr=function(e){if(!Fr(e))return!1;switch(Gr(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return $r||!!Yr(qr,Vr(e))}catch(t){return!0}};Jr.sham=!0;var Zr=!Kr||Hr((function(){var e;return Xr(Xr.call)||!Xr(Object)||!Xr((function(){e=!0}))||e}))?Jr:Xr,Qr=Pr,eo=Zr,to=ve,no=Ot("species"),io=Array,ro=function(e){var t;return Qr(e)&&(t=e.constructor,(eo(t)&&(t===io||Qr(t.prototype))||to(t)&&null===(t=t[no]))&&(t=void 0)),void 0===t?io:t},oo=function(e,t){return new(ro(e))(0===t?0:t)},ao=xr,so=ne,lo=ct,co=Mi,uo=oo,ho=J([].push),fo=function(e){var t=1==e,n=2==e,i=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=lo(l),g=so(p),v=ao(c,u),y=co(g),m=0,_=h||uo,b=t?_(l,y):n||a?_(l,0):void 0;y>m;m++)if((s||m in g)&&(f=v(d=g[m],m,p),e))if(t)b[m]=f;else if(f)switch(e){case 3:return!0;case 5:return d;case 6:return m;case 2:ho(b,d)}else switch(e){case 4:return!1;case 7:ho(b,d)}return o?-1:i||r?r:b}},po={forEach:fo(0),map:fo(1),filter:fo(2),some:fo(3),every:fo(4),find:fo(5),findIndex:fo(6),filterReject:fo(7)},go=x,vo=Pe,yo=Ot("species"),mo=function(e){return vo>=51||!go((function(){var t=[];return(t.constructor={})[yo]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},_o=po.map;Er({target:"Array",proto:!0,forced:!mo("map")},{map:function(e){return _o(this,e,arguments.length>1?arguments[1]:void 0)}});var bo=Br,ko=String,wo=function(e){if("Symbol"===bo(e))throw TypeError("Cannot convert a Symbol value to a string");return ko(e)},Eo=Si,To=wo,So=ae,Co=RangeError,xo=function(e){var t=To(So(this)),n="",i=Eo(e);if(i<0||i==1/0)throw Co("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n};Er({target:"String",proto:!0},{repeat:xo});var Oo=x,Po=function(e,t){var n=[][e];return!!n&&Oo((function(){n.call(null,t||function(){return 1},1)}))},Io=Er,Lo=Ui.indexOf,Do=Po,Ao=J([].indexOf),Mo=!!Ao&&1/Ao([1],1,-0)<0,Ro=Do("indexOf");Io({target:"Array",proto:!0,forced:Mo||!Ro},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return Mo?Ao(this,e,t)||0:Lo(this,e,t)}});var No,jo=ve,Bo=Y,Uo=Ot("match"),Ho=function(e){var t;return jo(e)&&(void 0!==(t=e[Uo])?!!t:"RegExp"==Bo(e))},Fo=Ho,Go=TypeError,Vo=function(e){if(Fo(e))throw Go("The method doesn't accept regular expressions");return e},zo=Ot("match"),Wo=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[zo]=!1,"/./"[e](t)}catch(i){}}return!1},Ko=Er,qo=J,Yo=C.f,$o=Di,Xo=wo,Jo=Vo,Zo=ae,Qo=Wo,ea=qo("".startsWith),ta=qo("".slice),na=Math.min,ia=Qo("startsWith");Ko({target:"String",proto:!0,forced:!!(ia||(No=Yo(String.prototype,"startsWith"),!No||No.writable))&&!ia},{startsWith:function(e){var t=Xo(Zo(this));Jo(e);var n=$o(na(arguments.length>1?arguments[1]:void 0,t.length)),i=Xo(e);return ea?ea(t,i,n):ta(t,n,n+i.length)===i}});var ra={},oa=Wi,aa=Ki,sa=Object.keys||function(e){return oa(e,aa)},la=O,ca=nn,ua=tn,ha=sn,da=ce,fa=sa;ra.f=la&&!ca?Object.defineProperties:function(e,t){ha(e);for(var n,i=da(t),r=fa(t),o=r.length,a=0;o>a;)ua.f(e,n=r[a++],i[n]);return e};var pa,ga=be("document","documentElement"),va=sn,ya=ra,ma=Ki,_a=Vn,ba=ga,ka=Vt,wa=Gn("IE_PROTO"),Ea=function(){},Ta=function(e){return"<script>"+e+"</"+"script>"},Sa=function(e){e.write(Ta("")),e.close();var t=e.parentWindow.Object;return e=null,t},Ca=function(){try{pa=new ActiveXObject("htmlfile")}catch(i){}var e,t;Ca="undefined"!=typeof document?document.domain&&pa?Sa(pa):((t=ka("iframe")).style.display="none",ba.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Ta("document.F=Object")),e.close(),e.F):Sa(pa);for(var n=ma.length;n--;)delete Ca.prototype[ma[n]];return Ca()};_a[wa]=!0;var xa=Object.create||function(e,t){var n;return null!==e?(Ea.prototype=va(e),n=new Ea,Ea.prototype=null,n[wa]=e):n=Ca(),void 0===t?n:ya.f(n,t)},Oa=Ot,Pa=xa,Ia=tn.f,La=Oa("unscopables"),Da=Array.prototype;null==Da[La]&&Ia(Da,La,{configurable:!0,value:Pa(null)});var Aa,Ma,Ra,Na=function(e){Da[La][e]=!0},ja={},Ba=!x((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Ua=dt,Ha=fe,Fa=ct,Ga=Ba,Va=Gn("IE_PROTO"),za=Object,Wa=za.prototype,Ka=Ga?za.getPrototypeOf:function(e){var t=Fa(e);if(Ua(t,Va))return t[Va];var n=t.constructor;return Ha(n)&&t instanceof n?n.prototype:t instanceof za?Wa:null},qa=x,Ya=fe,$a=ve,Xa=Ka,Ja=bi,Za=Ot("iterator"),Qa=!1;[].keys&&("next"in(Ra=[].keys())?(Ma=Xa(Xa(Ra)))!==Object.prototype&&(Aa=Ma):Qa=!0),(!$a(Aa)||qa((function(){var e={};return Aa[Za].call(e)!==e})))&&(Aa={}),Ya(Aa[Za])||Ja(Aa,Za,(function(){return this}));var es={IteratorPrototype:Aa,BUGGY_SAFARI_ITERATORS:Qa},ts=tn.f,ns=dt,is=Ot("toStringTag"),rs=function(e,t,n){e&&!n&&(e=e.prototype),e&&!ns(e,is)&&ts(e,is,{configurable:!0,value:t})},os=es.IteratorPrototype,as=xa,ss=U,ls=rs,cs=ja,us=function(){return this},hs=function(e,t,n,i){var r=t+" Iterator";return e.prototype=as(os,{next:ss(+!i,n)}),ls(e,r,!1),cs[r]=us,e},ds=fe,fs=String,ps=TypeError,gs=J,vs=sn,ys=function(e){if("object"==typeof e||ds(e))return e;throw ps("Can't set "+fs(e)+" as a prototype")},ms=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=gs(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(i){}return function(n,i){return vs(n),ys(i),t?e(n,i):n.__proto__=i,n}}():void 0),_s=Er,bs=D,ks=fe,ws=hs,Es=Ka,Ts=ms,Ss=rs,Cs=kn,xs=bi,Os=ja,Ps=On.PROPER,Is=On.CONFIGURABLE,Ls=es.IteratorPrototype,Ds=es.BUGGY_SAFARI_ITERATORS,As=Ot("iterator"),Ms="keys",Rs="values",Ns="entries",js=function(){return this},Bs=function(e,t,n,i,r,o,a){ws(n,t,i);var s,l,c,u=function(e){if(e===r&&g)return g;if(!Ds&&e in f)return f[e];switch(e){case Ms:case Rs:case Ns:return function(){return new n(this,e)}}return function(){return new n(this)}},h=t+" Iterator",d=!1,f=e.prototype,p=f[As]||f["@@iterator"]||r&&f[r],g=!Ds&&p||u(r),v="Array"==t&&f.entries||p;if(v&&(s=Es(v.call(new e)))!==Object.prototype&&s.next&&(Es(s)!==Ls&&(Ts?Ts(s,Ls):ks(s[As])||xs(s,As,js)),Ss(s,h,!0)),Ps&&r==Rs&&p&&p.name!==Rs&&(Is?Cs(f,"name",Rs):(d=!0,g=function(){return bs(p,this)})),r)if(l={values:u(Rs),keys:o?g:u(Ms),entries:u(Ns)},a)for(c in l)(Ds||d||!(c in f))&&xs(f,c,l[c]);else _s({target:t,proto:!0,forced:Ds||d},l);return f[As]!==g&&xs(f,As,g,{name:r}),Os[t]=g,l},Us=function(e,t){return{value:e,done:t}},Hs=ce,Fs=Na,Gs=ja,Vs=ii,zs=tn.f,Ws=Bs,Ks=Us,qs=O,Ys="Array Iterator",$s=Vs.set,Xs=Vs.getterFor(Ys),Js=Ws(Array,"Array",(function(e,t){$s(this,{type:Ys,target:Hs(e),index:0,kind:t})}),(function(){var e=Xs(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,Ks(void 0,!0)):Ks("keys"==n?i:"values"==n?t[i]:[i,t[i]],!1)}),"values"),Zs=Gs.Arguments=Gs.Array;if(Fs("keys"),Fs("values"),Fs("entries"),qs&&"values"!==Zs.name)try{zs(Zs,"name",{value:"values"})}catch(w7){}var Qs=Br,el=Lr?{}.toString:function(){return"[object "+Qs(this)+"]"};Lr||bi(Object.prototype,"toString",el,{unsafe:!0});var tl=J,nl=Si,il=wo,rl=ae,ol=tl("".charAt),al=tl("".charCodeAt),sl=tl("".slice),ll=function(e){return function(t,n){var i,r,o=il(rl(t)),a=nl(n),s=o.length;return a<0||a>=s?e?"":void 0:(i=al(o,a))<55296||i>56319||a+1===s||(r=al(o,a+1))<56320||r>57343?e?ol(o,a):i:e?sl(o,a,a+2):r-56320+(i-55296<<10)+65536}},cl={codeAt:ll(!1),charAt:ll(!0)},ul=cl.charAt,hl=wo,dl=ii,fl=Bs,pl=Us,gl="String Iterator",vl=dl.set,yl=dl.getterFor(gl);fl(String,"String",(function(e){vl(this,{type:gl,string:hl(e),index:0})}),(function(){var e,t=yl(this),n=t.string,i=t.index;return i>=n.length?pl(void 0,!0):(e=ul(n,i),t.index+=e.length,pl(e,!1))}));var ml={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},_l=Vt("span").classList,bl=_l&&_l.constructor&&_l.constructor.prototype,kl=bl===Object.prototype?void 0:bl,wl=S,El=ml,Tl=kl,Sl=Js,Cl=kn,xl=Ot,Ol=xl("iterator"),Pl=xl("toStringTag"),Il=Sl.values,Ll=function(e,t){if(e){if(e[Ol]!==Il)try{Cl(e,Ol,Il)}catch(w7){e[Ol]=Il}if(e[Pl]||Cl(e,Pl,t),El[t])for(var n in Sl)if(e[n]!==Sl[n])try{Cl(e,n,Sl[n])}catch(w7){e[n]=Sl[n]}}};for(var Dl in El)Ll(wl[Dl]&&wl[Dl].prototype,Dl);Ll(Tl,"DOMTokenList");var Al=x,Ml=Ot("iterator"),Rl=!Al((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,i){t.delete("b"),n+=i+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[Ml]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),Nl=wn.exports,jl=tn,Bl=function(e,t,n){return n.get&&Nl(n.get,t,{getter:!0}),n.set&&Nl(n.set,t,{setter:!0}),jl.f(e,t,n)},Ul=ke,Hl=TypeError,Fl=function(e,t){if(Ul(t,e))return e;throw Hl("Incorrect invocation")},Gl=O,Vl=J,zl=D,Wl=x,Kl=sa,ql=$i,Yl=A,$l=ct,Xl=ne,Jl=Object.assign,Zl=Object.defineProperty,Ql=Vl([].concat),ec=!Jl||Wl((function(){if(Gl&&1!==Jl({b:1},Jl(Zl({},"a",{enumerable:!0,get:function(){Zl(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=Jl({},e)[n]||Kl(Jl({},t)).join("")!=i}))?function(e,t){for(var n=$l(e),i=arguments.length,r=1,o=ql.f,a=Yl.f;i>r;)for(var s,l=Xl(arguments[r++]),c=o?Ql(Kl(l),o(l)):Kl(l),u=c.length,h=0;u>h;)s=c[h++],Gl&&!zl(a,l,s)||(n[s]=l[s]);return n}:Jl,tc=D,nc=sn,ic=qe,rc=function(e,t,n){var i,r;nc(e);try{if(!(i=ic(e,"return"))){if("throw"===t)throw n;return n}i=tc(i,e)}catch(w7){r=!0,i=w7}if("throw"===t)throw n;if(r)throw i;return nc(i),n},oc=sn,ac=rc,sc=ja,lc=Ot("iterator"),cc=Array.prototype,uc=function(e){return void 0!==e&&(sc.Array===e||cc[lc]===e)},hc=Ut,dc=tn,fc=U,pc=function(e,t,n){var i=hc(t);i in e?dc.f(e,i,fc(0,n)):e[i]=n},gc=Br,vc=qe,yc=ie,mc=ja,_c=Ot("iterator"),bc=function(e){if(!yc(e))return vc(e,_c)||vc(e,"@@iterator")||mc[gc(e)]},kc=D,wc=ze,Ec=sn,Tc=He,Sc=bc,Cc=TypeError,xc=function(e,t){var n=arguments.length<2?Sc(e):t;if(wc(n))return Ec(kc(n,e));throw Cc(Tc(e)+" is not iterable")},Oc=xr,Pc=D,Ic=ct,Lc=function(e,t,n,i){try{return i?t(oc(n)[0],n[1]):t(n)}catch(w7){ac(e,"throw",w7)}},Dc=uc,Ac=Zr,Mc=Mi,Rc=pc,Nc=xc,jc=bc,Bc=Array,Uc=function(e){var t=Ic(e),n=Ac(this),i=arguments.length,r=i>1?arguments[1]:void 0,o=void 0!==r;o&&(r=Oc(r,i>2?arguments[2]:void 0));var a,s,l,c,u,h,d=jc(t),f=0;if(!d||this===Bc&&Dc(d))for(a=Mc(t),s=n?new this(a):Bc(a);a>f;f++)h=o?r(t[f],f):t[f],Rc(s,f,h);else for(u=(c=Nc(t,d)).next,s=n?new this:[];!(l=Pc(u,c)).done;f++)h=o?Lc(c,r,[l.value,f],!0):l.value,Rc(s,f,h);return s.length=f,s},Hc=Pi,Fc=Mi,Gc=pc,Vc=Array,zc=Math.max,Wc=function(e,t,n){for(var i=Fc(e),r=Hc(t,i),o=Hc(void 0===n?i:n,i),a=Vc(zc(o-r,0)),s=0;r<o;r++,s++)Gc(a,s,e[r]);return a.length=s,a},Kc=J,qc=2147483647,Yc=/[^\0-\u007E]/,$c=/[.\u3002\uFF0E\uFF61]/g,Xc="Overflow: input needs wider integers to process",Jc=RangeError,Zc=Kc($c.exec),Qc=Math.floor,eu=String.fromCharCode,tu=Kc("".charCodeAt),nu=Kc([].join),iu=Kc([].push),ru=Kc("".replace),ou=Kc("".split),au=Kc("".toLowerCase),su=function(e){return e+22+75*(e<26)},lu=function(e,t,n){var i=0;for(e=n?Qc(e/700):e>>1,e+=Qc(e/t);e>455;)e=Qc(e/35),i+=36;return Qc(i+36*e/(e+38))},cu=function(e){var t=[];e=function(e){for(var t=[],n=0,i=e.length;n<i;){var r=tu(e,n++);if(r>=55296&&r<=56319&&n<i){var o=tu(e,n++);56320==(64512&o)?iu(t,((1023&r)<<10)+(1023&o)+65536):(iu(t,r),n--)}else iu(t,r)}return t}(e);var n,i,r=e.length,o=128,a=0,s=72;for(n=0;n<e.length;n++)(i=e[n])<128&&iu(t,eu(i));var l=t.length,c=l;for(l&&iu(t,"-");c<r;){var u=qc;for(n=0;n<e.length;n++)(i=e[n])>=o&&i<u&&(u=i);var h=c+1;if(u-o>Qc((qc-a)/h))throw Jc(Xc);for(a+=(u-o)*h,o=u,n=0;n<e.length;n++){if((i=e[n])<o&&++a>qc)throw Jc(Xc);if(i==o){for(var d=a,f=36;;){var p=f<=s?1:f>=s+26?26:f-s;if(d<p)break;var g=d-p,v=36-p;iu(t,eu(su(p+g%v))),d=Qc(g/v),f+=36}iu(t,eu(su(d))),s=lu(a,h,c==l),a=0,c++}}a++,o++}return nu(t,"")},uu=TypeError,hu=function(e,t){if(e<t)throw uu("Not enough arguments");return e},du=bi,fu=function(e,t,n){for(var i in t)du(e,i,t[i],n);return e},pu=Wc,gu=Math.floor,vu=function(e,t){var n=e.length,i=gu(n/2);return n<8?yu(e,t):mu(e,vu(pu(e,0,i),t),vu(pu(e,i),t),t)},yu=function(e,t){for(var n,i,r=e.length,o=1;o<r;){for(i=o,n=e[o];i&&t(e[i-1],n)>0;)e[i]=e[--i];i!==o++&&(e[i]=n)}return e},mu=function(e,t,n,i){for(var r=t.length,o=n.length,a=0,s=0;a<r||s<o;)e[a+s]=a<r&&s<o?i(t[a],n[s])<=0?t[a++]:n[s++]:a<r?t[a++]:n[s++];return e},_u=vu,bu=Er,ku=S,wu=D,Eu=J,Tu=O,Su=Rl,Cu=bi,xu=fu,Ou=rs,Pu=hs,Iu=ii,Lu=Fl,Du=fe,Au=dt,Mu=xr,Ru=Br,Nu=sn,ju=ve,Bu=wo,Uu=xa,Hu=U,Fu=xc,Gu=bc,Vu=hu,zu=_u,Wu=Ot("iterator"),Ku="URLSearchParams",qu="URLSearchParamsIterator",Yu=Iu.set,$u=Iu.getterFor(Ku),Xu=Iu.getterFor(qu),Ju=Object.getOwnPropertyDescriptor,Zu=function(e){if(!Tu)return ku[e];var t=Ju(ku,e);return t&&t.value},Qu=Zu("fetch"),eh=Zu("Request"),th=Zu("Headers"),nh=eh&&eh.prototype,ih=th&&th.prototype,rh=ku.RegExp,oh=ku.TypeError,ah=ku.decodeURIComponent,sh=ku.encodeURIComponent,lh=Eu("".charAt),ch=Eu([].join),uh=Eu([].push),hh=Eu("".replace),dh=Eu([].shift),fh=Eu([].splice),ph=Eu("".split),gh=Eu("".slice),vh=/\+/g,yh=Array(4),mh=function(e){return yh[e-1]||(yh[e-1]=rh("((?:%[\\da-f]{2}){"+e+"})","gi"))},_h=function(e){try{return ah(e)}catch(w7){return e}},bh=function(e){var t=hh(e,vh," "),n=4;try{return ah(t)}catch(w7){for(;n;)t=hh(t,mh(n--),_h);return t}},kh=/[!'()~]|%20/g,wh={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Eh=function(e){return wh[e]},Th=function(e){return hh(sh(e),kh,Eh)},Sh=Pu((function(e,t){Yu(this,{type:qu,iterator:Fu($u(e).entries),kind:t})}),"Iterator",(function(){var e=Xu(this),t=e.kind,n=e.iterator.next(),i=n.value;return n.done||(n.value="keys"===t?i.key:"values"===t?i.value:[i.key,i.value]),n}),!0),Ch=function(e){this.entries=[],this.url=null,void 0!==e&&(ju(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===lh(e,0)?gh(e,1):e:Bu(e)))};Ch.prototype={type:Ku,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,i,r,o,a,s,l=Gu(e);if(l)for(n=(t=Fu(e,l)).next;!(i=wu(n,t)).done;){if(o=(r=Fu(Nu(i.value))).next,(a=wu(o,r)).done||(s=wu(o,r)).done||!wu(o,r).done)throw oh("Expected sequence with length 2");uh(this.entries,{key:Bu(a.value),value:Bu(s.value)})}else for(var c in e)Au(e,c)&&uh(this.entries,{key:c,value:Bu(e[c])})},parseQuery:function(e){if(e)for(var t,n,i=ph(e,"&"),r=0;r<i.length;)(t=i[r++]).length&&(n=ph(t,"="),uh(this.entries,{key:bh(dh(n)),value:bh(ch(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],i=0;i<t.length;)e=t[i++],uh(n,Th(e.key)+"="+Th(e.value));return ch(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var xh=function(){Lu(this,Oh);var e=arguments.length>0?arguments[0]:void 0;Yu(this,new Ch(e))},Oh=xh.prototype;if(xu(Oh,{append:function(e,t){Vu(arguments.length,2);var n=$u(this);uh(n.entries,{key:Bu(e),value:Bu(t)}),n.updateURL()},delete:function(e){Vu(arguments.length,1);for(var t=$u(this),n=t.entries,i=Bu(e),r=0;r<n.length;)n[r].key===i?fh(n,r,1):r++;t.updateURL()},get:function(e){Vu(arguments.length,1);for(var t=$u(this).entries,n=Bu(e),i=0;i<t.length;i++)if(t[i].key===n)return t[i].value;return null},getAll:function(e){Vu(arguments.length,1);for(var t=$u(this).entries,n=Bu(e),i=[],r=0;r<t.length;r++)t[r].key===n&&uh(i,t[r].value);return i},has:function(e){Vu(arguments.length,1);for(var t=$u(this).entries,n=Bu(e),i=0;i<t.length;)if(t[i++].key===n)return!0;return!1},set:function(e,t){Vu(arguments.length,1);for(var n,i=$u(this),r=i.entries,o=!1,a=Bu(e),s=Bu(t),l=0;l<r.length;l++)(n=r[l]).key===a&&(o?fh(r,l--,1):(o=!0,n.value=s));o||uh(r,{key:a,value:s}),i.updateURL()},sort:function(){var e=$u(this);zu(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=$u(this).entries,i=Mu(e,arguments.length>1?arguments[1]:void 0),r=0;r<n.length;)i((t=n[r++]).value,t.key,this)},keys:function(){return new Sh(this,"keys")},values:function(){return new Sh(this,"values")},entries:function(){return new Sh(this,"entries")}},{enumerable:!0}),Cu(Oh,Wu,Oh.entries,{name:"entries"}),Cu(Oh,"toString",(function(){return $u(this).serialize()}),{enumerable:!0}),Ou(xh,Ku),bu({global:!0,constructor:!0,forced:!Su},{URLSearchParams:xh}),!Su&&Du(th)){var Ph=Eu(ih.has),Ih=Eu(ih.set),Lh=function(e){if(ju(e)){var t,n=e.body;if(Ru(n)===Ku)return t=e.headers?new th(e.headers):new th,Ph(t,"content-type")||Ih(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Uu(e,{body:Hu(0,Bu(n)),headers:Hu(0,t)})}return e};if(Du(Qu)&&bu({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return Qu(e,arguments.length>1?Lh(arguments[1]):{})}}),Du(eh)){var Dh=function(e){return Lu(this,nh),new eh(e,arguments.length>1?Lh(arguments[1]):{})};nh.constructor=Dh,Dh.prototype=nh,bu({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Dh})}}var Ah,Mh=Er,Rh=O,Nh=Rl,jh=S,Bh=xr,Uh=J,Hh=bi,Fh=Bl,Gh=Fl,Vh=dt,zh=ec,Wh=Uc,Kh=Wc,qh=cl.codeAt,Yh=function(e){var t,n,i=[],r=ou(ru(au(e),$c,"."),".");for(t=0;t<r.length;t++)n=r[t],iu(i,Zc(Yc,n)?"xn--"+cu(n):n);return nu(i,".")},$h=wo,Xh=rs,Jh=hu,Zh={URLSearchParams:xh,getState:$u},Qh=ii,ed=Qh.set,td=Qh.getterFor("URL"),nd=Zh.URLSearchParams,id=Zh.getState,rd=jh.URL,od=jh.TypeError,ad=jh.parseInt,sd=Math.floor,ld=Math.pow,cd=Uh("".charAt),ud=Uh(/./.exec),hd=Uh([].join),dd=Uh(1..toString),fd=Uh([].pop),pd=Uh([].push),gd=Uh("".replace),vd=Uh([].shift),yd=Uh("".split),md=Uh("".slice),_d=Uh("".toLowerCase),bd=Uh([].unshift),kd="Invalid scheme",wd="Invalid host",Ed="Invalid port",Td=/[a-z]/i,Sd=/[\d+-.a-z]/i,Cd=/\d/,xd=/^0x/i,Od=/^[0-7]+$/,Pd=/^\d+$/,Id=/^[\da-f]+$/i,Ld=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Dd=/[\0\t\n\r #/:<>?@[\\\]^|]/,Ad=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,Md=/[\t\n\r]/g,Rd=function(e){var t,n,i,r;if("number"==typeof e){for(t=[],n=0;n<4;n++)bd(t,e%256),e=sd(e/256);return hd(t,".")}if("object"==typeof e){for(t="",i=function(e){for(var t=null,n=1,i=null,r=0,o=0;o<8;o++)0!==e[o]?(r>n&&(t=i,n=r),i=null,r=0):(null===i&&(i=o),++r);return r>n&&(t=i,n=r),t}(e),n=0;n<8;n++)r&&0===e[n]||(r&&(r=!1),i===n?(t+=n?":":"::",r=!0):(t+=dd(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},Nd={},jd=zh({},Nd,{" ":1,'"':1,"<":1,">":1,"`":1}),Bd=zh({},jd,{"#":1,"?":1,"{":1,"}":1}),Ud=zh({},Bd,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Hd=function(e,t){var n=qh(e,0);return n>32&&n<127&&!Vh(t,e)?e:encodeURIComponent(e)},Fd={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Gd=function(e,t){var n;return 2==e.length&&ud(Td,cd(e,0))&&(":"==(n=cd(e,1))||!t&&"|"==n)},Vd=function(e){var t;return e.length>1&&Gd(md(e,0,2))&&(2==e.length||"/"===(t=cd(e,2))||"\\"===t||"?"===t||"#"===t)},zd=function(e){return"."===e||"%2e"===_d(e)},Wd={},Kd={},qd={},Yd={},$d={},Xd={},Jd={},Zd={},Qd={},ef={},tf={},nf={},rf={},of={},af={},sf={},lf={},cf={},uf={},hf={},df={},ff=function(e,t,n){var i,r,o,a=$h(e);if(t){if(r=this.parse(a))throw od(r);this.searchParams=null}else{if(void 0!==n&&(i=new ff(n,!0)),r=this.parse(a,null,i))throw od(r);(o=id(new nd)).bindURL(this),this.searchParams=o}};ff.prototype={type:"URL",parse:function(e,t,n){var i,r,o,a,s,l=this,c=t||Wd,u=0,h="",d=!1,f=!1,p=!1;for(e=$h(e),t||(l.scheme="",l.username="",l.password="",l.host=null,l.port=null,l.path=[],l.query=null,l.fragment=null,l.cannotBeABaseURL=!1,e=gd(e,Ad,"")),e=gd(e,Md,""),i=Wh(e);u<=i.length;){switch(r=i[u],c){case Wd:if(!r||!ud(Td,r)){if(t)return kd;c=qd;continue}h+=_d(r),c=Kd;break;case Kd:if(r&&(ud(Sd,r)||"+"==r||"-"==r||"."==r))h+=_d(r);else{if(":"!=r){if(t)return kd;h="",c=qd,u=0;continue}if(t&&(l.isSpecial()!=Vh(Fd,h)||"file"==h&&(l.includesCredentials()||null!==l.port)||"file"==l.scheme&&!l.host))return;if(l.scheme=h,t)return void(l.isSpecial()&&Fd[l.scheme]==l.port&&(l.port=null));h="","file"==l.scheme?c=of:l.isSpecial()&&n&&n.scheme==l.scheme?c=Yd:l.isSpecial()?c=Zd:"/"==i[u+1]?(c=$d,u++):(l.cannotBeABaseURL=!0,pd(l.path,""),c=uf)}break;case qd:if(!n||n.cannotBeABaseURL&&"#"!=r)return kd;if(n.cannotBeABaseURL&&"#"==r){l.scheme=n.scheme,l.path=Kh(n.path),l.query=n.query,l.fragment="",l.cannotBeABaseURL=!0,c=df;break}c="file"==n.scheme?of:Xd;continue;case Yd:if("/"!=r||"/"!=i[u+1]){c=Xd;continue}c=Qd,u++;break;case $d:if("/"==r){c=ef;break}c=cf;continue;case Xd:if(l.scheme=n.scheme,r==Ah)l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=Kh(n.path),l.query=n.query;else if("/"==r||"\\"==r&&l.isSpecial())c=Jd;else if("?"==r)l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=Kh(n.path),l.query="",c=hf;else{if("#"!=r){l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=Kh(n.path),l.path.length--,c=cf;continue}l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=Kh(n.path),l.query=n.query,l.fragment="",c=df}break;case Jd:if(!l.isSpecial()||"/"!=r&&"\\"!=r){if("/"!=r){l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,c=cf;continue}c=ef}else c=Qd;break;case Zd:if(c=Qd,"/"!=r||"/"!=cd(h,u+1))continue;u++;break;case Qd:if("/"!=r&&"\\"!=r){c=ef;continue}break;case ef:if("@"==r){d&&(h="%40"+h),d=!0,o=Wh(h);for(var g=0;g<o.length;g++){var v=o[g];if(":"!=v||p){var y=Hd(v,Ud);p?l.password+=y:l.username+=y}else p=!0}h=""}else if(r==Ah||"/"==r||"?"==r||"#"==r||"\\"==r&&l.isSpecial()){if(d&&""==h)return"Invalid authority";u-=Wh(h).length+1,h="",c=tf}else h+=r;break;case tf:case nf:if(t&&"file"==l.scheme){c=sf;continue}if(":"!=r||f){if(r==Ah||"/"==r||"?"==r||"#"==r||"\\"==r&&l.isSpecial()){if(l.isSpecial()&&""==h)return wd;if(t&&""==h&&(l.includesCredentials()||null!==l.port))return;if(a=l.parseHost(h))return a;if(h="",c=lf,t)return;continue}"["==r?f=!0:"]"==r&&(f=!1),h+=r}else{if(""==h)return wd;if(a=l.parseHost(h))return a;if(h="",c=rf,t==nf)return}break;case rf:if(!ud(Cd,r)){if(r==Ah||"/"==r||"?"==r||"#"==r||"\\"==r&&l.isSpecial()||t){if(""!=h){var m=ad(h,10);if(m>65535)return Ed;l.port=l.isSpecial()&&m===Fd[l.scheme]?null:m,h=""}if(t)return;c=lf;continue}return Ed}h+=r;break;case of:if(l.scheme="file","/"==r||"\\"==r)c=af;else{if(!n||"file"!=n.scheme){c=cf;continue}if(r==Ah)l.host=n.host,l.path=Kh(n.path),l.query=n.query;else if("?"==r)l.host=n.host,l.path=Kh(n.path),l.query="",c=hf;else{if("#"!=r){Vd(hd(Kh(i,u),""))||(l.host=n.host,l.path=Kh(n.path),l.shortenPath()),c=cf;continue}l.host=n.host,l.path=Kh(n.path),l.query=n.query,l.fragment="",c=df}}break;case af:if("/"==r||"\\"==r){c=sf;break}n&&"file"==n.scheme&&!Vd(hd(Kh(i,u),""))&&(Gd(n.path[0],!0)?pd(l.path,n.path[0]):l.host=n.host),c=cf;continue;case sf:if(r==Ah||"/"==r||"\\"==r||"?"==r||"#"==r){if(!t&&Gd(h))c=cf;else if(""==h){if(l.host="",t)return;c=lf}else{if(a=l.parseHost(h))return a;if("localhost"==l.host&&(l.host=""),t)return;h="",c=lf}continue}h+=r;break;case lf:if(l.isSpecial()){if(c=cf,"/"!=r&&"\\"!=r)continue}else if(t||"?"!=r)if(t||"#"!=r){if(r!=Ah&&(c=cf,"/"!=r))continue}else l.fragment="",c=df;else l.query="",c=hf;break;case cf:if(r==Ah||"/"==r||"\\"==r&&l.isSpecial()||!t&&("?"==r||"#"==r)){if(".."===(s=_d(s=h))||"%2e."===s||".%2e"===s||"%2e%2e"===s?(l.shortenPath(),"/"==r||"\\"==r&&l.isSpecial()||pd(l.path,"")):zd(h)?"/"==r||"\\"==r&&l.isSpecial()||pd(l.path,""):("file"==l.scheme&&!l.path.length&&Gd(h)&&(l.host&&(l.host=""),h=cd(h,0)+":"),pd(l.path,h)),h="","file"==l.scheme&&(r==Ah||"?"==r||"#"==r))for(;l.path.length>1&&""===l.path[0];)vd(l.path);"?"==r?(l.query="",c=hf):"#"==r&&(l.fragment="",c=df)}else h+=Hd(r,Bd);break;case uf:"?"==r?(l.query="",c=hf):"#"==r?(l.fragment="",c=df):r!=Ah&&(l.path[0]+=Hd(r,Nd));break;case hf:t||"#"!=r?r!=Ah&&("'"==r&&l.isSpecial()?l.query+="%27":l.query+="#"==r?"%23":Hd(r,Nd)):(l.fragment="",c=df);break;case df:r!=Ah&&(l.fragment+=Hd(r,jd))}u++}},parseHost:function(e){var t,n,i;if("["==cd(e,0)){if("]"!=cd(e,e.length-1))return wd;if(t=function(e){var t,n,i,r,o,a,s,l=[0,0,0,0,0,0,0,0],c=0,u=null,h=0,d=function(){return cd(e,h)};if(":"==d()){if(":"!=cd(e,1))return;h+=2,u=++c}for(;d();){if(8==c)return;if(":"!=d()){for(t=n=0;n<4&&ud(Id,d());)t=16*t+ad(d(),16),h++,n++;if("."==d()){if(0==n)return;if(h-=n,c>6)return;for(i=0;d();){if(r=null,i>0){if(!("."==d()&&i<4))return;h++}if(!ud(Cd,d()))return;for(;ud(Cd,d());){if(o=ad(d(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;h++}l[c]=256*l[c]+r,2!=++i&&4!=i||c++}if(4!=i)return;break}if(":"==d()){if(h++,!d())return}else if(d())return;l[c++]=t}else{if(null!==u)return;h++,u=++c}}if(null!==u)for(a=c-u,c=7;0!=c&&a>0;)s=l[c],l[c--]=l[u+a-1],l[u+--a]=s;else if(8!=c)return;return l}(md(e,1,-1)),!t)return wd;this.host=t}else if(this.isSpecial()){if(e=Yh(e),ud(Ld,e))return wd;if(t=function(e){var t,n,i,r,o,a,s,l=yd(e,".");if(l.length&&""==l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(n=[],i=0;i<t;i++){if(""==(r=l[i]))return e;if(o=10,r.length>1&&"0"==cd(r,0)&&(o=ud(xd,r)?16:8,r=md(r,8==o?1:2)),""===r)a=0;else{if(!ud(10==o?Pd:8==o?Od:Id,r))return e;a=ad(r,o)}pd(n,a)}for(i=0;i<t;i++)if(a=n[i],i==t-1){if(a>=ld(256,5-t))return null}else if(a>255)return null;for(s=fd(n),i=0;i<n.length;i++)s+=n[i]*ld(256,3-i);return s}(e),null===t)return wd;this.host=t}else{if(ud(Dd,e))return wd;for(t="",n=Wh(e),i=0;i<n.length;i++)t+=Hd(n[i],Nd);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return Vh(Fd,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&Gd(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,i=e.password,r=e.host,o=e.port,a=e.path,s=e.query,l=e.fragment,c=t+":";return null!==r?(c+="//",e.includesCredentials()&&(c+=n+(i?":"+i:"")+"@"),c+=Rd(r),null!==o&&(c+=":"+o)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+hd(a,"/"):"",null!==s&&(c+="?"+s),null!==l&&(c+="#"+l),c},setHref:function(e){var t=this.parse(e);if(t)throw od(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new pf(e.path[0]).origin}catch(w7){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+Rd(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse($h(e)+":",Wd)},getUsername:function(){return this.username},setUsername:function(e){var t=Wh($h(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=Hd(t[n],Ud)}},getPassword:function(){return this.password},setPassword:function(e){var t=Wh($h(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=Hd(t[n],Ud)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?Rd(e):Rd(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,tf)},getHostname:function(){var e=this.host;return null===e?"":Rd(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,nf)},getPort:function(){var e=this.port;return null===e?"":$h(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=$h(e))?this.port=null:this.parse(e,rf))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+hd(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,lf))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=$h(e))?this.query=null:("?"==cd(e,0)&&(e=md(e,1)),this.query="",this.parse(e,hf)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=$h(e))?("#"==cd(e,0)&&(e=md(e,1)),this.fragment="",this.parse(e,df)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var pf=function(e){var t=Gh(this,gf),n=Jh(arguments.length,1)>1?arguments[1]:void 0,i=ed(t,new ff(e,!1,n));Rh||(t.href=i.serialize(),t.origin=i.getOrigin(),t.protocol=i.getProtocol(),t.username=i.getUsername(),t.password=i.getPassword(),t.host=i.getHost(),t.hostname=i.getHostname(),t.port=i.getPort(),t.pathname=i.getPathname(),t.search=i.getSearch(),t.searchParams=i.getSearchParams(),t.hash=i.getHash())},gf=pf.prototype,vf=function(e,t){return{get:function(){return td(this)[e]()},set:t&&function(e){return td(this)[t](e)},configurable:!0,enumerable:!0}};if(Rh&&(Fh(gf,"href",vf("serialize","setHref")),Fh(gf,"origin",vf("getOrigin")),Fh(gf,"protocol",vf("getProtocol","setProtocol")),Fh(gf,"username",vf("getUsername","setUsername")),Fh(gf,"password",vf("getPassword","setPassword")),Fh(gf,"host",vf("getHost","setHost")),Fh(gf,"hostname",vf("getHostname","setHostname")),Fh(gf,"port",vf("getPort","setPort")),Fh(gf,"pathname",vf("getPathname","setPathname")),Fh(gf,"search",vf("getSearch","setSearch")),Fh(gf,"searchParams",vf("getSearchParams")),Fh(gf,"hash",vf("getHash","setHash"))),Hh(gf,"toJSON",(function(){return td(this).serialize()}),{enumerable:!0}),Hh(gf,"toString",(function(){return td(this).serialize()}),{enumerable:!0}),rd){var yf=rd.createObjectURL,mf=rd.revokeObjectURL;yf&&Hh(pf,"createObjectURL",Bh(yf,rd)),mf&&Hh(pf,"revokeObjectURL",Bh(mf,rd))}Xh(pf,"URL"),Mh({global:!0,constructor:!0,forced:!Nh,sham:!Rh},{URL:pf});var _f="\t\n\v\f\r \u2028\u2029\ufeff",bf=ae,kf=wo,wf=J("".replace),Ef="[\t\n\v\f\r \u2028\u2029\ufeff]",Tf=RegExp("^"+Ef+Ef+"*"),Sf=RegExp(Ef+Ef+"*$"),Cf=function(e){return function(t){var n=kf(bf(t));return 1&e&&(n=wf(n,Tf,"")),2&e&&(n=wf(n,Sf,"")),n}},xf={start:Cf(1),end:Cf(2),trim:Cf(3)},Of=S,Pf=x,If=J,Lf=wo,Df=xf.trim,Af=_f,Mf=Of.parseInt,Rf=Of.Symbol,Nf=Rf&&Rf.iterator,jf=/^[+-]?0x/i,Bf=If(jf.exec),Uf=8!==Mf(Af+"08")||22!==Mf(Af+"0x16")||Nf&&!Pf((function(){Mf(Object(Nf))}))?function(e,t){var n=Df(Lf(e));return Mf(n,t>>>0||(Bf(jf,n)?16:10))}:Mf;Er({global:!0,forced:parseInt!=Uf},{parseInt:Uf});var Hf=TypeError,Ff=function(e){if(e>9007199254740991)throw Hf("Maximum allowed index exceeded");return e},Gf=Er,Vf=x,zf=Pr,Wf=ve,Kf=ct,qf=Mi,Yf=Ff,$f=pc,Xf=oo,Jf=mo,Zf=Pe,Qf=Ot("isConcatSpreadable"),ep=Zf>=51||!Vf((function(){var e=[];return e[Qf]=!1,e.concat()[0]!==e})),tp=Jf("concat"),np=function(e){if(!Wf(e))return!1;var t=e[Qf];return void 0!==t?!!t:zf(e)};Gf({target:"Array",proto:!0,arity:1,forced:!ep||!tp},{concat:function(e){var t,n,i,r,o,a=Kf(this),s=Xf(a,0),l=0;for(t=-1,i=arguments.length;t<i;t++)if(np(o=-1===t?a:arguments[t]))for(r=qf(o),Yf(l+r),n=0;n<r;n++,l++)n in o&&$f(s,l,o[n]);else Yf(l+1),$f(s,l++,o);return s.length=l,s}});var ip=O,rp=Pr,op=TypeError,ap=Object.getOwnPropertyDescriptor,sp=ip&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(w7){return w7 instanceof TypeError}}()?function(e,t){if(rp(e)&&!ap(e,"length").writable)throw op("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},lp=Er,cp=ct,up=Mi,hp=sp,dp=Ff,fp=x((function(){return 4294967297!==[].push.call({length:4294967296},1)})),pp=!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(w7){return w7 instanceof TypeError}}();lp({target:"Array",proto:!0,arity:1,forced:fp||pp},{push:function(e){var t=cp(this),n=up(t),i=arguments.length;dp(n+i);for(var r=0;r<i;r++)t[n]=arguments[r],n++;return hp(t,n),n}});var gp=Ui.includes,vp=Na;Er({target:"Array",proto:!0,forced:x((function(){return!Array(1).includes()}))},{includes:function(e){return gp(this,e,arguments.length>1?arguments[1]:void 0)}}),vp("includes");var yp=po.forEach,mp=Po("forEach")?[].forEach:function(e){return yp(this,e,arguments.length>1?arguments[1]:void 0)},_p=S,bp=ml,kp=kl,wp=mp,Ep=kn,Tp=function(e){if(e&&e.forEach!==wp)try{Ep(e,"forEach",wp)}catch(w7){e.forEach=wp}};for(var Sp in bp)bp[Sp]&&Tp(_p[Sp]&&_p[Sp].prototype);Tp(kp);var Cp=O,xp=J,Op=sa,Pp=ce,Ip=xp(A.f),Lp=xp([].push),Dp=function(e){return function(t){for(var n,i=Pp(t),r=Op(i),o=r.length,a=0,s=[];o>a;)n=r[a++],Cp&&!Ip(i,n)||Lp(s,e?[n,i[n]]:i[n]);return s}},Ap={entries:Dp(!0),values:Dp(!1)},Mp=Ap.values;Er({target:"Object",stat:!0},{values:function(e){return Mp(e)}});var Rp,Np,jp,Bp,Up="process"==Y(S.process),Hp=be,Fp=tn,Gp=O,Vp=Ot("species"),zp=function(e){var t=Hp(e),n=Fp.f;Gp&&t&&!t[Vp]&&n(t,Vp,{configurable:!0,get:function(){return this}})},Wp=Zr,Kp=He,qp=TypeError,Yp=function(e){if(Wp(e))return e;throw qp(Kp(e)+" is not a constructor")},$p=sn,Xp=Yp,Jp=ie,Zp=Ot("species"),Qp=function(e,t){var n,i=$p(e).constructor;return void 0===i||Jp(n=$p(i)[Zp])?t:Xp(n)},eg=P,tg=Function.prototype,ng=tg.apply,ig=tg.call,rg="object"==typeof Reflect&&Reflect.apply||(eg?ig.bind(ng):function(){return ig.apply(ng,arguments)}),og=J([].slice),ag=/(?:ipad|iphone|ipod).*applewebkit/i.test(we),sg=S,lg=rg,cg=xr,ug=fe,hg=dt,dg=x,fg=ga,pg=og,gg=Vt,vg=hu,yg=ag,mg=Up,_g=sg.setImmediate,bg=sg.clearImmediate,kg=sg.process,wg=sg.Dispatch,Eg=sg.Function,Tg=sg.MessageChannel,Sg=sg.String,Cg=0,xg={},Og="onreadystatechange";try{Rp=sg.location}catch(w7){}var Pg=function(e){if(hg(xg,e)){var t=xg[e];delete xg[e],t()}},Ig=function(e){return function(){Pg(e)}},Lg=function(e){Pg(e.data)},Dg=function(e){sg.postMessage(Sg(e),Rp.protocol+"//"+Rp.host)};_g&&bg||(_g=function(e){vg(arguments.length,1);var t=ug(e)?e:Eg(e),n=pg(arguments,1);return xg[++Cg]=function(){lg(t,void 0,n)},Np(Cg),Cg},bg=function(e){delete xg[e]},mg?Np=function(e){kg.nextTick(Ig(e))}:wg&&wg.now?Np=function(e){wg.now(Ig(e))}:Tg&&!yg?(Bp=(jp=new Tg).port2,jp.port1.onmessage=Lg,Np=cg(Bp.postMessage,Bp)):sg.addEventListener&&ug(sg.postMessage)&&!sg.importScripts&&Rp&&"file:"!==Rp.protocol&&!dg(Dg)?(Np=Dg,sg.addEventListener("message",Lg,!1)):Np=Og in gg("script")?function(e){fg.appendChild(gg("script")).onreadystatechange=function(){fg.removeChild(this),Pg(e)}}:function(e){setTimeout(Ig(e),0)});var Ag,Mg,Rg,Ng,jg,Bg,Ug,Hg,Fg={set:_g,clear:bg},Gg=S,Vg=/ipad|iphone|ipod/i.test(we)&&void 0!==Gg.Pebble,zg=/web0s(?!.*chrome)/i.test(we),Wg=S,Kg=xr,qg=C.f,Yg=Fg.set,$g=ag,Xg=Vg,Jg=zg,Zg=Up,Qg=Wg.MutationObserver||Wg.WebKitMutationObserver,ev=Wg.document,tv=Wg.process,nv=Wg.Promise,iv=qg(Wg,"queueMicrotask"),rv=iv&&iv.value;rv||(Ag=function(){var e,t;for(Zg&&(e=tv.domain)&&e.exit();Mg;){t=Mg.fn,Mg=Mg.next;try{t()}catch(w7){throw Mg?Ng():Rg=void 0,w7}}Rg=void 0,e&&e.enter()},$g||Zg||Jg||!Qg||!ev?!Xg&&nv&&nv.resolve?((Ug=nv.resolve(void 0)).constructor=nv,Hg=Kg(Ug.then,Ug),Ng=function(){Hg(Ag)}):Zg?Ng=function(){tv.nextTick(Ag)}:(Yg=Kg(Yg,Wg),Ng=function(){Yg(Ag)}):(jg=!0,Bg=ev.createTextNode(""),new Qg(Ag).observe(Bg,{characterData:!0}),Ng=function(){Bg.data=jg=!jg}));var ov=rv||function(e){var t={fn:e,next:void 0};Rg&&(Rg.next=t),Mg||(Mg=t,Ng()),Rg=t},av=S,sv=function(e){try{return{error:!1,value:e()}}catch(w7){return{error:!0,value:w7}}},lv=function(){this.head=null,this.tail=null};lv.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 cv=lv,uv=S.Promise,hv="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,dv=!hv&&!Up&&"object"==typeof window&&"object"==typeof document,fv=S,pv=uv,gv=fe,vv=gr,yv=Rn,mv=Ot,_v=dv,bv=hv,kv=Pe;pv&&pv.prototype;var wv=mv("species"),Ev=!1,Tv=gv(fv.PromiseRejectionEvent),Sv={CONSTRUCTOR:vv("Promise",(function(){var e=yv(pv),t=e!==String(pv);if(!t&&66===kv)return!0;if(!kv||kv<51||!/native code/.test(e)){var n=new pv((function(e){e(1)})),i=function(e){e((function(){}),(function(){}))};if((n.constructor={})[wv]=i,!(Ev=n.then((function(){}))instanceof i))return!0}return!t&&(_v||bv)&&!Tv})),REJECTION_EVENT:Tv,SUBCLASSING:Ev},Cv={},xv=ze,Ov=TypeError,Pv=function(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw Ov("Bad Promise constructor");t=e,n=i})),this.resolve=xv(t),this.reject=xv(n)};Cv.f=function(e){return new Pv(e)};var Iv,Lv,Dv,Av=Er,Mv=Up,Rv=S,Nv=D,jv=bi,Bv=ms,Uv=rs,Hv=zp,Fv=ze,Gv=fe,Vv=ve,zv=Fl,Wv=Qp,Kv=Fg.set,qv=ov,Yv=function(e,t){var n=av.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))},$v=sv,Xv=cv,Jv=ii,Zv=uv,Qv=Cv,ey="Promise",ty=Sv.CONSTRUCTOR,ny=Sv.REJECTION_EVENT,iy=Sv.SUBCLASSING,ry=Jv.getterFor(ey),oy=Jv.set,ay=Zv&&Zv.prototype,sy=Zv,ly=ay,cy=Rv.TypeError,uy=Rv.document,hy=Rv.process,dy=Qv.f,fy=dy,py=!!(uy&&uy.createEvent&&Rv.dispatchEvent),gy="unhandledrejection",vy=function(e){var t;return!(!Vv(e)||!Gv(t=e.then))&&t},yy=function(e,t){var n,i,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&&wy(t),t.rejection=1),!0===s?n=o:(u&&u.enter(),n=s(o),u&&(u.exit(),r=!0)),n===e.promise?c(cy("Promise-chain cycle")):(i=vy(n))?Nv(i,n,l,c):l(n)):c(o)}catch(w7){u&&!r&&u.exit(),c(w7)}},my=function(e,t){e.notified||(e.notified=!0,qv((function(){for(var n,i=e.reactions;n=i.get();)yy(n,e);e.notified=!1,t&&!e.rejection&&by(e)})))},_y=function(e,t,n){var i,r;py?((i=uy.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),Rv.dispatchEvent(i)):i={promise:t,reason:n},!ny&&(r=Rv["on"+e])?r(i):e===gy&&Yv("Unhandled promise rejection",n)},by=function(e){Nv(Kv,Rv,(function(){var t,n=e.facade,i=e.value;if(ky(e)&&(t=$v((function(){Mv?hy.emit("unhandledRejection",i,n):_y(gy,n,i)})),e.rejection=Mv||ky(e)?2:1,t.error))throw t.value}))},ky=function(e){return 1!==e.rejection&&!e.parent},wy=function(e){Nv(Kv,Rv,(function(){var t=e.facade;Mv?hy.emit("rejectionHandled",t):_y("rejectionhandled",t,e.value)}))},Ey=function(e,t,n){return function(i){e(t,i,n)}},Ty=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,my(e,!0))},Sy=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw cy("Promise can't be resolved itself");var i=vy(t);i?qv((function(){var n={done:!1};try{Nv(i,t,Ey(Sy,n,e),Ey(Ty,n,e))}catch(w7){Ty(n,w7,e)}})):(e.value=t,e.state=1,my(e,!1))}catch(w7){Ty({done:!1},w7,e)}}};if(ty&&(ly=(sy=function(e){zv(this,ly),Fv(e),Nv(Iv,this);var t=ry(this);try{e(Ey(Sy,t),Ey(Ty,t))}catch(w7){Ty(t,w7)}}).prototype,(Iv=function(e){oy(this,{type:ey,done:!1,notified:!1,parent:!1,reactions:new Xv,rejection:!1,state:0,value:void 0})}).prototype=jv(ly,"then",(function(e,t){var n=ry(this),i=dy(Wv(this,sy));return n.parent=!0,i.ok=!Gv(e)||e,i.fail=Gv(t)&&t,i.domain=Mv?hy.domain:void 0,0==n.state?n.reactions.add(i):qv((function(){yy(i,n)})),i.promise})),Lv=function(){var e=new Iv,t=ry(e);this.promise=e,this.resolve=Ey(Sy,t),this.reject=Ey(Ty,t)},Qv.f=dy=function(e){return e===sy||undefined===e?new Lv(e):fy(e)},Gv(Zv)&&ay!==Object.prototype)){Dv=ay.then,iy||jv(ay,"then",(function(e,t){var n=this;return new sy((function(e,t){Nv(Dv,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete ay.constructor}catch(w7){}Bv&&Bv(ay,ly)}Av({global:!0,constructor:!0,wrap:!0,forced:ty},{Promise:sy}),Uv(sy,ey,!1),Hv(ey);var Cy=xr,xy=D,Oy=sn,Py=He,Iy=uc,Ly=Mi,Dy=ke,Ay=xc,My=bc,Ry=rc,Ny=TypeError,jy=function(e,t){this.stopped=e,this.result=t},By=jy.prototype,Uy=function(e,t,n){var i,r,o,a,s,l,c,u=n&&n.that,h=!(!n||!n.AS_ENTRIES),d=!(!n||!n.IS_RECORD),f=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),g=Cy(t,u),v=function(e){return i&&Ry(i,"normal",e),new jy(!0,e)},y=function(e){return h?(Oy(e),p?g(e[0],e[1],v):g(e[0],e[1])):p?g(e,v):g(e)};if(d)i=e.iterator;else if(f)i=e;else{if(!(r=My(e)))throw Ny(Py(e)+" is not iterable");if(Iy(r)){for(o=0,a=Ly(e);a>o;o++)if((s=y(e[o]))&&Dy(By,s))return s;return new jy(!1)}i=Ay(e,r)}for(l=d?e.next:i.next;!(c=xy(l,i)).done;){try{s=y(c.value)}catch(w7){Ry(i,"throw",w7)}if("object"==typeof s&&s&&Dy(By,s))return s}return new jy(!1)},Hy=Ot("iterator"),Fy=!1;try{var Gy=0,Vy={next:function(){return{done:!!Gy++}},return:function(){Fy=!0}};Vy[Hy]=function(){return this},Array.from(Vy,(function(){throw 2}))}catch(w7){}var zy=function(e,t){if(!t&&!Fy)return!1;var n=!1;try{var i={};i[Hy]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(w7){}return n},Wy=uv,Ky=Sv.CONSTRUCTOR||!zy((function(e){Wy.all(e).then(void 0,(function(){}))})),qy=D,Yy=ze,$y=Cv,Xy=sv,Jy=Uy;Er({target:"Promise",stat:!0,forced:Ky},{all:function(e){var t=this,n=$y.f(t),i=n.resolve,r=n.reject,o=Xy((function(){var n=Yy(t.resolve),o=[],a=0,s=1;Jy(e,(function(e){var l=a++,c=!1;s++,qy(n,t,e).then((function(e){c||(c=!0,o[l]=e,--s||i(o))}),r)})),--s||i(o)}));return o.error&&r(o.value),n.promise}});var Zy=Er,Qy=Sv.CONSTRUCTOR,em=uv,tm=be,nm=fe,im=bi,rm=em&&em.prototype;if(Zy({target:"Promise",proto:!0,forced:Qy,real:!0},{catch:function(e){return this.then(void 0,e)}}),nm(em)){var om=tm("Promise").prototype.catch;rm.catch!==om&&im(rm,"catch",om,{unsafe:!0})}var am=D,sm=ze,lm=Cv,cm=sv,um=Uy;Er({target:"Promise",stat:!0,forced:Ky},{race:function(e){var t=this,n=lm.f(t),i=n.reject,r=cm((function(){var r=sm(t.resolve);um(e,(function(e){am(r,t,e).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}});var hm=D,dm=Cv;Er({target:"Promise",stat:!0,forced:Sv.CONSTRUCTOR},{reject:function(e){var t=dm.f(this);return hm(t.reject,void 0,e),t.promise}});var fm=sn,pm=ve,gm=Cv,vm=function(e,t){if(fm(e),pm(t)&&t.constructor===e)return t;var n=gm.f(e);return(0,n.resolve)(t),n.promise},ym=Er,mm=Sv.CONSTRUCTOR,_m=vm;be("Promise"),ym({target:"Promise",stat:!0,forced:mm},{resolve:function(e){return _m(this,e)}});var bm=po.filter;Er({target:"Array",proto:!0,forced:!mo("filter")},{filter:function(e){return bm(this,e,arguments.length>1?arguments[1]:void 0)}});var km=ec;Er({target:"Object",stat:!0,arity:2,forced:Object.assign!==km},{assign:km});var wm,Em,Tm=sn,Sm=function(){var e=Tm(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},Cm=x,xm=S.RegExp,Om=Cm((function(){var e=xm("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Pm=Om||Cm((function(){return!xm("a","y").sticky})),Im=Om||Cm((function(){var e=xm("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),Lm={BROKEN_CARET:Im,MISSED_STICKY:Pm,UNSUPPORTED_Y:Om},Dm=x,Am=S.RegExp,Mm=Dm((function(){var e=Am(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Rm=x,Nm=S.RegExp,jm=Rm((function(){var e=Nm("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Bm=D,Um=J,Hm=wo,Fm=Sm,Gm=Lm,Vm=Qe.exports,zm=xa,Wm=ii.get,Km=Mm,qm=jm,Ym=Vm("native-string-replace",String.prototype.replace),$m=RegExp.prototype.exec,Xm=$m,Jm=Um("".charAt),Zm=Um("".indexOf),Qm=Um("".replace),e_=Um("".slice),t_=(Em=/b*/g,Bm($m,wm=/a/,"a"),Bm($m,Em,"a"),0!==wm.lastIndex||0!==Em.lastIndex),n_=Gm.BROKEN_CARET,i_=void 0!==/()??/.exec("")[1];(t_||i_||n_||Km||qm)&&(Xm=function(e){var t,n,i,r,o,a,s,l=this,c=Wm(l),u=Hm(e),h=c.raw;if(h)return h.lastIndex=l.lastIndex,t=Bm(Xm,h,u),l.lastIndex=h.lastIndex,t;var d=c.groups,f=n_&&l.sticky,p=Bm(Fm,l),g=l.source,v=0,y=u;if(f&&(p=Qm(p,"y",""),-1===Zm(p,"g")&&(p+="g"),y=e_(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==Jm(u,l.lastIndex-1))&&(g="(?: "+g+")",y=" "+y,v++),n=new RegExp("^(?:"+g+")",p)),i_&&(n=new RegExp("^"+g+"$(?!\\s)",p)),t_&&(i=l.lastIndex),r=Bm($m,f?n:l,y),f?r?(r.input=e_(r.input,v),r[0]=e_(r[0],v),r.index=l.lastIndex,l.lastIndex+=r[0].length):l.lastIndex=0:t_&&r&&(l.lastIndex=l.global?r.index+r[0].length:i),i_&&r&&r.length>1&&Bm(Ym,r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&d)for(r.groups=a=zm(null),o=0;o<d.length;o++)a[(s=d[o])[0]]=r[s[1]];return r});var r_=Xm;Er({target:"RegExp",proto:!0,forced:/./.exec!==r_},{exec:r_});var o_=J,a_=bi,s_=r_,l_=x,c_=Ot,u_=kn,h_=c_("species"),d_=RegExp.prototype,f_=function(e,t,n,i){var r=c_(e),o=!l_((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),a=o&&!l_((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[h_]=function(){return n},n.flags="",n[r]=/./[r]),n.exec=function(){return t=!0,null},n[r](""),!t}));if(!o||!a||n){var s=o_(/./[r]),l=t(r,""[e],(function(e,t,n,i,r){var a=o_(e),l=t.exec;return l===s_||l===d_.exec?o&&!r?{done:!0,value:s(t,n,i)}:{done:!0,value:a(n,t,i)}:{done:!1}}));a_(String.prototype,e,l[0]),a_(d_,r,l[1])}i&&u_(d_[r],"sham",!0)},p_=cl.charAt,g_=function(e,t,n){return t+(n?p_(e,t).length:1)},v_=J,y_=ct,m_=Math.floor,__=v_("".charAt),b_=v_("".replace),k_=v_("".slice),w_=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,E_=/\$([$&'`]|\d{1,2})/g,T_=D,S_=sn,C_=fe,x_=Y,O_=r_,P_=TypeError,I_=function(e,t){var n=e.exec;if(C_(n)){var i=T_(n,e,t);return null!==i&&S_(i),i}if("RegExp"===x_(e))return T_(O_,e,t);throw P_("RegExp#exec called on incompatible receiver")},L_=rg,D_=D,A_=J,M_=f_,R_=x,N_=sn,j_=fe,B_=ie,U_=Si,H_=Di,F_=wo,G_=ae,V_=g_,z_=qe,W_=function(e,t,n,i,r,o){var a=n+e.length,s=i.length,l=E_;return void 0!==r&&(r=y_(r),l=w_),b_(o,l,(function(o,l){var c;switch(__(l,0)){case"$":return"$";case"&":return e;case"`":return k_(t,0,n);case"'":return k_(t,a);case"<":c=r[k_(l,1,-1)];break;default:var u=+l;if(0===u)return o;if(u>s){var h=m_(u/10);return 0===h?o:h<=s?void 0===i[h-1]?__(l,1):i[h-1]+__(l,1):o}c=i[u-1]}return void 0===c?"":c}))},K_=I_,q_=Ot("replace"),Y_=Math.max,$_=Math.min,X_=A_([].concat),J_=A_([].push),Z_=A_("".indexOf),Q_=A_("".slice),eb="$0"==="a".replace(/./,"$0"),tb=!!/./[q_]&&""===/./[q_]("a","$0"),nb=!R_((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}));M_("replace",(function(e,t,n){var i=tb?"$":"$0";return[function(e,n){var i=G_(this),r=B_(e)?void 0:z_(e,q_);return r?D_(r,e,i,n):D_(t,F_(i),e,n)},function(e,r){var o=N_(this),a=F_(e);if("string"==typeof r&&-1===Z_(r,i)&&-1===Z_(r,"$<")){var s=n(t,o,a,r);if(s.done)return s.value}var l=j_(r);l||(r=F_(r));var c=o.global;if(c){var u=o.unicode;o.lastIndex=0}for(var h=[];;){var d=K_(o,a);if(null===d)break;if(J_(h,d),!c)break;""===F_(d[0])&&(o.lastIndex=V_(a,H_(o.lastIndex),u))}for(var f,p="",g=0,v=0;v<h.length;v++){for(var y=F_((d=h[v])[0]),m=Y_($_(U_(d.index),a.length),0),_=[],b=1;b<d.length;b++)J_(_,void 0===(f=d[b])?f:String(f));var k=d.groups;if(l){var w=X_([y],_,m,a);void 0!==k&&J_(w,k);var E=F_(L_(r,void 0,w))}else E=W_(y,a,m,_,k,r);m>=g&&(p+=Q_(a,g,m)+E,g=m+y.length)}return p+Q_(a,g)}]}),!nb||!eb||tb);var ib=ct,rb=sa;Er({target:"Object",stat:!0,forced:x((function(){rb(1)}))},{keys:function(e){return rb(ib(e))}});var ob=ze,ab=ct,sb=ne,lb=Mi,cb=TypeError,ub=function(e){return function(t,n,i,r){ob(n);var o=ab(t),a=sb(o),s=lb(o),l=e?s-1:0,c=e?-1:1;if(i<2)for(;;){if(l in a){r=a[l],l+=c;break}if(l+=c,e?l<0:s<=l)throw cb("Reduce of empty array with no initial value")}for(;e?l>=0:s>l;l+=c)l in a&&(r=n(r,a[l],l,o));return r}},hb={left:ub(!1),right:ub(!0)},db=hb.left,fb=Pe,pb=Up;Er({target:"Array",proto:!0,forced:!Po("reduce")||!pb&&fb>79&&fb<83},{reduce:function(e){var t=arguments.length;return db(this,e,t,t>1?arguments[1]:void 0)}});var gb=Ap.entries;Er({target:"Object",stat:!0},{entries:function(e){return gb(e)}});var vb=Er,yb=Vo,mb=ae,_b=wo,bb=Wo,kb=J("".indexOf);vb({target:"String",proto:!0,forced:!bb("includes")},{includes:function(e){return!!~kb(_b(mb(this)),_b(yb(e)),arguments.length>1?arguments[1]:void 0)}});var wb=D,Eb=dt,Tb=ke,Sb=Sm,Cb=RegExp.prototype,xb=function(e){var t=e.flags;return void 0!==t||"flags"in Cb||Eb(e,"flags")||!Tb(Cb,e)?t:wb(Sb,e)},Ob=On.PROPER,Pb=bi,Ib=sn,Lb=wo,Db=x,Ab=xb,Mb="toString",Rb=RegExp.prototype.toString,Nb=Db((function(){return"/a/b"!=Rb.call({source:"a",flags:"b"})})),jb=Ob&&Rb.name!=Mb;(Nb||jb)&&Pb(RegExp.prototype,Mb,(function(){var e=Ib(this);return"/"+Lb(e.source)+"/"+Lb(Ab(e))}),{unsafe:!0});var Bb=He,Ub=TypeError,Hb=function(e,t){if(!delete e[t])throw Ub("Cannot delete property "+Bb(t)+" of "+Bb(e))},Fb=Er,Gb=ct,Vb=Pi,zb=Si,Wb=Mi,Kb=sp,qb=Ff,Yb=oo,$b=pc,Xb=Hb,Jb=mo("splice"),Zb=Math.max,Qb=Math.min;function ek(e,t){return e===t||e!=e&&t!=t}function tk(e,t){for(var n=e.length;n--;)if(ek(e[n][0],t))return n;return-1}Fb({target:"Array",proto:!0,forced:!Jb},{splice:function(e,t){var n,i,r,o,a,s,l=Gb(this),c=Wb(l),u=Vb(e,c),h=arguments.length;for(0===h?n=i=0:1===h?(n=0,i=c-u):(n=h-2,i=Qb(Zb(zb(t),0),c-u)),qb(c+n-i),r=Yb(l,i),o=0;o<i;o++)(a=u+o)in l&&$b(r,o,l[a]);if(r.length=i,n<i){for(o=u;o<c-i;o++)s=o+n,(a=o+i)in l?l[s]=l[a]:Xb(l,s);for(o=c;o>c-i+n;o--)Xb(l,o-1)}else if(n>i)for(o=c-i;o>u;o--)s=o+n-1,(a=o+i-1)in l?l[s]=l[a]:Xb(l,s);for(o=0;o<n;o++)l[o+u]=arguments[o+2];return Kb(l,c-i+n),r}});var nk=Array.prototype.splice;function ik(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}ik.prototype.clear=function(){this.__data__=[],this.size=0},ik.prototype.delete=function(e){var t=this.__data__,n=tk(t,e);return!(n<0)&&(n==t.length-1?t.pop():nk.call(t,n,1),--this.size,!0)},ik.prototype.get=function(e){var t=this.__data__,n=tk(t,e);return n<0?void 0:t[n][1]},ik.prototype.has=function(e){return tk(this.__data__,e)>-1},ik.prototype.set=function(e,t){var n=this.__data__,i=tk(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var rk=fe,ok=ve,ak=ms,sk=function(e,t,n){var i,r;return ak&&rk(i=t.constructor)&&i!==n&&ok(r=i.prototype)&&r!==n.prototype&&ak(e,r),e},lk=tn.f,ck=function(e,t,n){n in e||lk(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})},uk=O,hk=S,dk=J,fk=gr,pk=sk,gk=kn,vk=ki.f,yk=ke,mk=Ho,_k=wo,bk=xb,kk=Lm,wk=ck,Ek=bi,Tk=x,Sk=dt,Ck=ii.enforce,xk=zp,Ok=Mm,Pk=jm,Ik=Ot("match"),Lk=hk.RegExp,Dk=Lk.prototype,Ak=hk.SyntaxError,Mk=dk(Dk.exec),Rk=dk("".charAt),Nk=dk("".replace),jk=dk("".indexOf),Bk=dk("".slice),Uk=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Hk=/a/g,Fk=/a/g,Gk=new Lk(Hk)!==Hk,Vk=kk.MISSED_STICKY,zk=kk.UNSUPPORTED_Y,Wk=uk&&(!Gk||Vk||Ok||Pk||Tk((function(){return Fk[Ik]=!1,Lk(Hk)!=Hk||Lk(Fk)==Fk||"/a/i"!=Lk(Hk,"i")})));if(fk("RegExp",Wk)){for(var Kk=function(e,t){var n,i,r,o,a,s,l=yk(Dk,this),c=mk(e),u=void 0===t,h=[],d=e;if(!l&&c&&u&&e.constructor===Kk)return e;if((c||yk(Dk,e))&&(e=e.source,u&&(t=bk(d))),e=void 0===e?"":_k(e),t=void 0===t?"":_k(t),d=e,Ok&&"dotAll"in Hk&&(i=!!t&&jk(t,"s")>-1)&&(t=Nk(t,/s/g,"")),n=t,Vk&&"sticky"in Hk&&(r=!!t&&jk(t,"y")>-1)&&zk&&(t=Nk(t,/y/g,"")),Pk&&(o=function(e){for(var t,n=e.length,i=0,r="",o=[],a={},s=!1,l=!1,c=0,u="";i<=n;i++){if("\\"===(t=Rk(e,i)))t+=Rk(e,++i);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:Mk(Uk,Bk(e,i+1))&&(i+=2,l=!0),r+=t,c++;continue;case">"===t&&l:if(""===u||Sk(a,u))throw new Ak("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=pk(Lk(e,t),l?this:Dk,Kk),(i||r||h.length)&&(s=Ck(a),i&&(s.dotAll=!0,s.raw=Kk(function(e){for(var t,n=e.length,i=0,r="",o=!1;i<=n;i++)"\\"!==(t=Rk(e,i))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+Rk(e,++i);return r}(e),n)),r&&(s.sticky=!0),h.length&&(s.groups=h)),e!==d)try{gk(a,"source",""===d?"(?:)":d)}catch(w7){}return a},qk=vk(Lk),Yk=0;qk.length>Yk;)wk(Kk,Lk,qk[Yk++]);Dk.constructor=Kk,Kk.prototype=Dk,Ek(hk,"RegExp",Kk,{constructor:!0})}xk("RegExp");var $k=O,Xk=Mm,Jk=Y,Zk=Bl,Qk=ii.get,ew=RegExp.prototype,tw=TypeError;$k&&Xk&&Zk(ew,"dotAll",{configurable:!0,get:function(){if(this!==ew){if("RegExp"===Jk(this))return!!Qk(this).dotAll;throw tw("Incompatible receiver, RegExp required")}}});var nw=O,iw=Lm.MISSED_STICKY,rw=Y,ow=Bl,aw=ii.get,sw=RegExp.prototype,lw=TypeError;nw&&iw&&ow(sw,"sticky",{configurable:!0,get:function(){if(this!==sw){if("RegExp"===rw(this))return!!aw(this).sticky;throw lw("Incompatible receiver, RegExp required")}}});var cw,uw,hw=Er,dw=D,fw=fe,pw=sn,gw=wo,vw=(cw=!1,(uw=/[ac]/).exec=function(){return cw=!0,/./.exec.apply(this,arguments)},!0===uw.test("abc")&&cw),yw=/./.test;hw({target:"RegExp",proto:!0,forced:!vw},{test:function(e){var t=pw(this),n=gw(e),i=t.exec;if(!fw(i))return dw(yw,t,n);var r=dw(i,t,n);return null!==r&&(pw(r),!0)}});var mw="object"==("undefined"==typeof global?"undefined":i(global))&&global&&global.Object===Object&&global,_w="object"==("undefined"==typeof self?"undefined":i(self))&&self&&self.Object===Object&&self,bw=mw||_w||Function("return this")(),kw=bw.Symbol,ww=Object.prototype,Ew=ww.hasOwnProperty,Tw=ww.toString,Sw=kw?kw.toStringTag:void 0;var Cw=Object.prototype.toString;var xw=kw?kw.toStringTag:void 0;function Ow(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":xw&&xw in Object(e)?function(e){var t=Ew.call(e,Sw),n=e[Sw];try{e[Sw]=void 0;var i=!0}catch(xX){}var r=Tw.call(e);return i&&(t?e[Sw]=n:delete e[Sw]),r}(e):function(e){return Cw.call(e)}(e)}function Pw(e){var t=i(e);return null!=e&&("object"==t||"function"==t)}function Iw(e){if(!Pw(e))return!1;var t=Ow(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var Lw,Dw=bw["__core-js_shared__"],Aw=(Lw=/[^.]+$/.exec(Dw&&Dw.keys&&Dw.keys.IE_PROTO||""))?"Symbol(src)_1."+Lw:"";var Mw=Function.prototype.toString;function Rw(e){if(null!=e){try{return Mw.call(e)}catch(xX){}try{return e+""}catch(xX){}}return""}var Nw=/^\[object .+?Constructor\]$/,jw=Function.prototype,Bw=Object.prototype,Uw=jw.toString,Hw=Bw.hasOwnProperty,Fw=RegExp("^"+Uw.call(Hw).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Gw(e){return!(!Pw(e)||(t=e,Aw&&Aw in t))&&(Iw(e)?Fw:Nw).test(Rw(e));var t}function Vw(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Gw(n)?n:void 0}var zw=Vw(bw,"Map"),Ww=Vw(Object,"create");var Kw=Object.prototype.hasOwnProperty;var qw=Object.prototype.hasOwnProperty;function Yw(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function $w(e,t){var n,r,o=e.__data__;return("string"==(r=i(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Xw(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Yw.prototype.clear=function(){this.__data__=Ww?Ww(null):{},this.size=0},Yw.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Yw.prototype.get=function(e){var t=this.__data__;if(Ww){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Kw.call(t,e)?t[e]:void 0},Yw.prototype.has=function(e){var t=this.__data__;return Ww?void 0!==t[e]:qw.call(t,e)},Yw.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ww&&void 0===t?"__lodash_hash_undefined__":t,this},Xw.prototype.clear=function(){this.size=0,this.__data__={hash:new Yw,map:new(zw||ik),string:new Yw}},Xw.prototype.delete=function(e){var t=$w(this,e).delete(e);return this.size-=t?1:0,t},Xw.prototype.get=function(e){return $w(this,e).get(e)},Xw.prototype.has=function(e){return $w(this,e).has(e)},Xw.prototype.set=function(e,t){var n=$w(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function Jw(e){var t=this.__data__=new ik(e);this.size=t.size}Jw.prototype.clear=function(){this.__data__=new ik,this.size=0},Jw.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Jw.prototype.get=function(e){return this.__data__.get(e)},Jw.prototype.has=function(e){return this.__data__.has(e)},Jw.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ik){var i=n.__data__;if(!zw||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Xw(i)}return n.set(e,t),this.size=n.size,this};var Zw=function(){try{var e=Vw(Object,"defineProperty");return e({},"",{}),e}catch(xX){}}(),Qw=Zw;function eE(e,t,n){"__proto__"==t&&Qw?Qw(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var tE=Object.prototype.hasOwnProperty;function nE(e,t,n){var i=e[t];tE.call(e,t)&&ek(i,n)&&(void 0!==n||t in e)||eE(e,t,n)}function iE(e,t,n,i){var r=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=i?i(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),r?eE(n,s,l):nE(n,s,l)}return n}function rE(e){return null!=e&&"object"==i(e)}function oE(e){return rE(e)&&"[object Arguments]"==Ow(e)}var aE=Object.prototype,sE=aE.hasOwnProperty,lE=aE.propertyIsEnumerable,cE=oE(function(){return arguments}())?oE:function(e){return rE(e)&&sE.call(e,"callee")&&!lE.call(e,"callee")},uE=cE,hE=Array.isArray;var dE="object"==("undefined"==typeof exports?"undefined":i(exports))&&exports&&!exports.nodeType&&exports,fE=dE&&"object"==("undefined"==typeof module?"undefined":i(module))&&module&&!module.nodeType&&module,pE=fE&&fE.exports===dE?bw.Buffer:void 0,gE=(pE?pE.isBuffer:void 0)||function(){return!1},vE=/^(?:0|[1-9]\d*)$/;function yE(e,t){var n=i(e);return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&vE.test(e))&&e>-1&&e%1==0&&e<t}function mE(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var _E={};function bE(e){return function(t){return e(t)}}_E["[object Float32Array]"]=_E["[object Float64Array]"]=_E["[object Int8Array]"]=_E["[object Int16Array]"]=_E["[object Int32Array]"]=_E["[object Uint8Array]"]=_E["[object Uint8ClampedArray]"]=_E["[object Uint16Array]"]=_E["[object Uint32Array]"]=!0,_E["[object Arguments]"]=_E["[object Array]"]=_E["[object ArrayBuffer]"]=_E["[object Boolean]"]=_E["[object DataView]"]=_E["[object Date]"]=_E["[object Error]"]=_E["[object Function]"]=_E["[object Map]"]=_E["[object Number]"]=_E["[object Object]"]=_E["[object RegExp]"]=_E["[object Set]"]=_E["[object String]"]=_E["[object WeakMap]"]=!1;var kE="object"==("undefined"==typeof exports?"undefined":i(exports))&&exports&&!exports.nodeType&&exports,wE=kE&&"object"==("undefined"==typeof module?"undefined":i(module))&&module&&!module.nodeType&&module,EE=wE&&wE.exports===kE&&mw.process,TE=function(){try{var e=wE&&wE.require&&wE.require("util").types;return e||EE&&EE.binding&&EE.binding("util")}catch(xX){}}(),SE=TE&&TE.isTypedArray,CE=SE?bE(SE):function(e){return rE(e)&&mE(e.length)&&!!_E[Ow(e)]},xE=Object.prototype.hasOwnProperty;function OE(e,t){var n=hE(e),i=!n&&uE(e),r=!n&&!i&&gE(e),o=!n&&!i&&!r&&CE(e),a=n||i||r||o,s=a?function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}(e.length,String):[],l=s.length;for(var c in e)!t&&!xE.call(e,c)||a&&("length"==c||r&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||yE(c,l))||s.push(c);return s}var PE=Object.prototype;function IE(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||PE)}function LE(e,t){return function(n){return e(t(n))}}var DE=LE(Object.keys,Object),AE=Object.prototype.hasOwnProperty;function ME(e){return null!=e&&mE(e.length)&&!Iw(e)}function RE(e){return ME(e)?OE(e):function(e){if(!IE(e))return DE(e);var t=[];for(var n in Object(e))AE.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}var NE=Object.prototype.hasOwnProperty;function jE(e){if(!Pw(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=IE(e),n=[];for(var i in e)("constructor"!=i||!t&&NE.call(e,i))&&n.push(i);return n}function BE(e){return ME(e)?OE(e,!0):jE(e)}var UE=Er,HE=Pr,FE=Zr,GE=ve,VE=Pi,zE=Mi,WE=ce,KE=pc,qE=Ot,YE=og,$E=mo("slice"),XE=qE("species"),JE=Array,ZE=Math.max;UE({target:"Array",proto:!0,forced:!$E},{slice:function(e,t){var n,i,r,o=WE(this),a=zE(o),s=VE(e,a),l=VE(void 0===t?a:t,a);if(HE(o)&&(n=o.constructor,(FE(n)&&(n===JE||HE(n.prototype))||GE(n)&&null===(n=n[XE]))&&(n=void 0),n===JE||void 0===n))return YE(o,s,l);for(i=new(void 0===n?JE:n)(ZE(l-s,0)),r=0;s<l;s++,r++)s in o&&KE(i,r,o[s]);return i.length=r,i}});var QE="object"==("undefined"==typeof exports?"undefined":i(exports))&&exports&&!exports.nodeType&&exports,eT=QE&&"object"==("undefined"==typeof module?"undefined":i(module))&&module&&!module.nodeType&&module,tT=eT&&eT.exports===QE?bw.Buffer:void 0,nT=tT?tT.allocUnsafe:void 0;var iT={},rT=Y,oT=ce,aT=ki.f,sT=Wc,lT="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];iT.f=function(e){return lT&&"Window"==rT(e)?function(e){try{return aT(e)}catch(w7){return sT(lT)}}(e):aT(oT(e))};var cT={},uT=Ot;cT.f=uT;var hT=S,dT=dt,fT=cT,pT=tn.f,gT=function(e){var t=hT.Symbol||(hT.Symbol={});dT(t,e)||pT(t,e,{value:fT.f(e)})},vT=D,yT=be,mT=Ot,_T=bi,bT=function(){var e=yT("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,i=mT("toPrimitive");t&&!t[i]&&_T(t,i,(function(e){return vT(n,this)}),{arity:1})},kT=Er,wT=S,ET=D,TT=J,ST=O,CT=De,xT=x,OT=dt,PT=ke,IT=sn,LT=ce,DT=Ut,AT=wo,MT=U,RT=xa,NT=sa,jT=ki,BT=iT,UT=$i,HT=C,FT=tn,GT=ra,VT=A,zT=bi,WT=Qe.exports,KT=Vn,qT=yt,YT=Ot,$T=cT,XT=gT,JT=bT,ZT=rs,QT=ii,eS=po.forEach,tS=Gn("hidden"),nS="Symbol",iS=QT.set,rS=QT.getterFor(nS),oS=Object.prototype,aS=wT.Symbol,sS=aS&&aS.prototype,lS=wT.TypeError,cS=wT.QObject,uS=HT.f,hS=FT.f,dS=BT.f,fS=VT.f,pS=TT([].push),gS=WT("symbols"),vS=WT("op-symbols"),yS=WT("wks"),mS=!cS||!cS.prototype||!cS.prototype.findChild,_S=ST&&xT((function(){return 7!=RT(hS({},"a",{get:function(){return hS(this,"a",{value:7}).a}})).a}))?function(e,t,n){var i=uS(oS,t);i&&delete oS[t],hS(e,t,n),i&&e!==oS&&hS(oS,t,i)}:hS,bS=function(e,t){var n=gS[e]=RT(sS);return iS(n,{type:nS,tag:e,description:t}),ST||(n.description=t),n},kS=function(e,t,n){e===oS&&kS(vS,t,n),IT(e);var i=DT(t);return IT(n),OT(gS,i)?(n.enumerable?(OT(e,tS)&&e[tS][i]&&(e[tS][i]=!1),n=RT(n,{enumerable:MT(0,!1)})):(OT(e,tS)||hS(e,tS,MT(1,{})),e[tS][i]=!0),_S(e,i,n)):hS(e,i,n)},wS=function(e,t){IT(e);var n=LT(t),i=NT(n).concat(CS(n));return eS(i,(function(t){ST&&!ET(ES,n,t)||kS(e,t,n[t])})),e},ES=function(e){var t=DT(e),n=ET(fS,this,t);return!(this===oS&&OT(gS,t)&&!OT(vS,t))&&(!(n||!OT(this,t)||!OT(gS,t)||OT(this,tS)&&this[tS][t])||n)},TS=function(e,t){var n=LT(e),i=DT(t);if(n!==oS||!OT(gS,i)||OT(vS,i)){var r=uS(n,i);return!r||!OT(gS,i)||OT(n,tS)&&n[tS][i]||(r.enumerable=!0),r}},SS=function(e){var t=dS(LT(e)),n=[];return eS(t,(function(e){OT(gS,e)||OT(KT,e)||pS(n,e)})),n},CS=function(e){var t=e===oS,n=dS(t?vS:LT(e)),i=[];return eS(n,(function(e){!OT(gS,e)||t&&!OT(oS,e)||pS(i,gS[e])})),i};CT||(aS=function(){if(PT(sS,this))throw lS("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?AT(arguments[0]):void 0,t=qT(e),n=function(e){this===oS&&ET(n,vS,e),OT(this,tS)&&OT(this[tS],t)&&(this[tS][t]=!1),_S(this,t,MT(1,e))};return ST&&mS&&_S(oS,t,{configurable:!0,set:n}),bS(t,e)},zT(sS=aS.prototype,"toString",(function(){return rS(this).tag})),zT(aS,"withoutSetter",(function(e){return bS(qT(e),e)})),VT.f=ES,FT.f=kS,GT.f=wS,HT.f=TS,jT.f=BT.f=SS,UT.f=CS,$T.f=function(e){return bS(YT(e),e)},ST&&(hS(sS,"description",{configurable:!0,get:function(){return rS(this).description}}),zT(oS,"propertyIsEnumerable",ES,{unsafe:!0}))),kT({global:!0,constructor:!0,wrap:!0,forced:!CT,sham:!CT},{Symbol:aS}),eS(NT(yS),(function(e){XT(e)})),kT({target:nS,stat:!0,forced:!CT},{useSetter:function(){mS=!0},useSimple:function(){mS=!1}}),kT({target:"Object",stat:!0,forced:!CT,sham:!ST},{create:function(e,t){return void 0===t?RT(e):wS(RT(e),t)},defineProperty:kS,defineProperties:wS,getOwnPropertyDescriptor:TS}),kT({target:"Object",stat:!0,forced:!CT},{getOwnPropertyNames:SS}),JT(),ZT(aS,nS),KT[tS]=!0;var xS=De&&!!Symbol.for&&!!Symbol.keyFor,OS=Er,PS=be,IS=dt,LS=wo,DS=Qe.exports,AS=xS,MS=DS("string-to-symbol-registry"),RS=DS("symbol-to-string-registry");OS({target:"Symbol",stat:!0,forced:!AS},{for:function(e){var t=LS(e);if(IS(MS,t))return MS[t];var n=PS("Symbol")(t);return MS[t]=n,RS[n]=t,n}});var NS=Er,jS=dt,BS=Be,US=He,HS=xS,FS=(0,Qe.exports)("symbol-to-string-registry");NS({target:"Symbol",stat:!0,forced:!HS},{keyFor:function(e){if(!BS(e))throw TypeError(US(e)+" is not a symbol");if(jS(FS,e))return FS[e]}});var GS=Er,VS=be,zS=rg,WS=D,KS=J,qS=x,YS=Pr,$S=fe,XS=ve,JS=Be,ZS=og,QS=De,eC=VS("JSON","stringify"),tC=KS(/./.exec),nC=KS("".charAt),iC=KS("".charCodeAt),rC=KS("".replace),oC=KS(1..toString),aC=/[\uD800-\uDFFF]/g,sC=/^[\uD800-\uDBFF]$/,lC=/^[\uDC00-\uDFFF]$/,cC=!QS||qS((function(){var e=VS("Symbol")();return"[null]"!=eC([e])||"{}"!=eC({a:e})||"{}"!=eC(Object(e))})),uC=qS((function(){return'"\\udf06\\ud834"'!==eC("\udf06\ud834")||'"\\udead"'!==eC("\udead")})),hC=function(e,t){var n=ZS(arguments),i=t;if((XS(t)||void 0!==e)&&!JS(e))return YS(t)||(t=function(e,t){if($S(i)&&(t=WS(i,this,e,t)),!JS(t))return t}),n[1]=t,zS(eC,null,n)},dC=function(e,t,n){var i=nC(n,t-1),r=nC(n,t+1);return tC(sC,e)&&!tC(lC,r)||tC(lC,e)&&!tC(sC,i)?"\\u"+oC(iC(e,0),16):e};eC&&GS({target:"JSON",stat:!0,arity:3,forced:cC||uC},{stringify:function(e,t,n){var i=ZS(arguments),r=zS(cC?hC:eC,null,i);return uC&&"string"==typeof r?rC(r,aC,dC):r}});var fC=$i,pC=ct;function gC(){return[]}Er({target:"Object",stat:!0,forced:!De||x((function(){fC.f(1)}))},{getOwnPropertySymbols:function(e){var t=fC.f;return t?t(pC(e)):[]}});var vC=Object.prototype.propertyIsEnumerable,yC=Object.getOwnPropertySymbols,mC=yC?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,i=null==e?0:e.length,r=0,o=[];++n<i;){var a=e[n];t(a,n,e)&&(o[r++]=a)}return o}(yC(e),(function(t){return vC.call(e,t)})))}:gC,_C=mC;function bC(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}var kC=ct,wC=Ka,EC=Ba;Er({target:"Object",stat:!0,forced:x((function(){wC(1)})),sham:!EC},{getPrototypeOf:function(e){return wC(kC(e))}});var TC=LE(Object.getPrototypeOf,Object),SC=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)bC(t,_C(e)),e=TC(e);return t}:gC,CC=SC;function xC(e,t,n){var i=t(e);return hE(e)?i:bC(i,n(e))}function OC(e){return xC(e,RE,_C)}function PC(e){return xC(e,BE,CC)}var IC="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,LC=Si,DC=Di,AC=RangeError,MC=function(e){if(void 0===e)return 0;var t=LC(e),n=DC(t);if(t!==n)throw AC("Wrong length or index");return n},RC=Array,NC=Math.abs,jC=Math.pow,BC=Math.floor,UC=Math.log,HC=Math.LN2,FC=ct,GC=Pi,VC=Mi,zC=function(e){for(var t=FC(this),n=VC(t),i=arguments.length,r=GC(i>1?arguments[1]:void 0,n),o=i>2?arguments[2]:void 0,a=void 0===o?n:GC(o,n);a>r;)t[r++]=e;return t},WC=S,KC=J,qC=O,YC=IC,$C=On,XC=kn,JC=fu,ZC=x,QC=Fl,ex=Si,tx=Di,nx=MC,ix={pack:function(e,t,n){var i,r,o,a=RC(n),s=8*n-t-1,l=(1<<s)-1,c=l>>1,u=23===t?jC(2,-24)-jC(2,-77):0,h=e<0||0===e&&1/e<0?1:0,d=0;for((e=NC(e))!=e||e===1/0?(r=e!=e?1:0,i=l):(i=BC(UC(e)/HC),e*(o=jC(2,-i))<1&&(i--,o*=2),(e+=i+c>=1?u/o:u*jC(2,1-c))*o>=2&&(i++,o/=2),i+c>=l?(r=0,i=l):i+c>=1?(r=(e*o-1)*jC(2,t),i+=c):(r=e*jC(2,c-1)*jC(2,t),i=0));t>=8;)a[d++]=255&r,r/=256,t-=8;for(i=i<<t|r,s+=t;s>0;)a[d++]=255&i,i/=256,s-=8;return a[--d]|=128*h,a},unpack:function(e,t){var n,i=e.length,r=8*i-t-1,o=(1<<r)-1,a=o>>1,s=r-7,l=i-1,c=e[l--],u=127&c;for(c>>=7;s>0;)u=256*u+e[l--],s-=8;for(n=u&(1<<-s)-1,u>>=-s,s+=t;s>0;)n=256*n+e[l--],s-=8;if(0===u)u=1-a;else{if(u===o)return n?NaN:c?-1/0:1/0;n+=jC(2,t),u-=a}return(c?-1:1)*n*jC(2,u-t)}},rx=Ka,ox=ms,ax=ki.f,sx=tn.f,lx=zC,cx=Wc,ux=rs,hx=$C.PROPER,dx=$C.CONFIGURABLE,fx=ii.get,px=ii.set,gx="ArrayBuffer",vx="DataView",yx="Wrong index",mx=WC.ArrayBuffer,_x=mx,bx=_x&&_x.prototype,kx=WC.DataView,wx=kx&&kx.prototype,Ex=Object.prototype,Tx=WC.Array,Sx=WC.RangeError,Cx=KC(lx),xx=KC([].reverse),Ox=ix.pack,Px=ix.unpack,Ix=function(e){return[255&e]},Lx=function(e){return[255&e,e>>8&255]},Dx=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Ax=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Mx=function(e){return Ox(e,23,4)},Rx=function(e){return Ox(e,52,8)},Nx=function(e,t){sx(e.prototype,t,{get:function(){return fx(this)[t]}})},jx=function(e,t,n,i){var r=nx(n),o=fx(e);if(r+t>o.byteLength)throw Sx(yx);var a=fx(o.buffer).bytes,s=r+o.byteOffset,l=cx(a,s,s+t);return i?l:xx(l)},Bx=function(e,t,n,i,r,o){var a=nx(n),s=fx(e);if(a+t>s.byteLength)throw Sx(yx);for(var l=fx(s.buffer).bytes,c=a+s.byteOffset,u=i(+r),h=0;h<t;h++)l[c+h]=u[o?h:t-h-1]};if(YC){var Ux=hx&&mx.name!==gx;if(ZC((function(){mx(1)}))&&ZC((function(){new mx(-1)}))&&!ZC((function(){return new mx,new mx(1.5),new mx(NaN),1!=mx.length||Ux&&!dx})))Ux&&dx&&XC(mx,"name",gx);else{(_x=function(e){return QC(this,bx),new mx(nx(e))}).prototype=bx;for(var Hx,Fx=ax(mx),Gx=0;Fx.length>Gx;)(Hx=Fx[Gx++])in _x||XC(_x,Hx,mx[Hx]);bx.constructor=_x}ox&&rx(wx)!==Ex&&ox(wx,Ex);var Vx=new kx(new _x(2)),zx=KC(wx.setInt8);Vx.setInt8(0,2147483648),Vx.setInt8(1,2147483649),!Vx.getInt8(0)&&Vx.getInt8(1)||JC(wx,{setInt8:function(e,t){zx(this,e,t<<24>>24)},setUint8:function(e,t){zx(this,e,t<<24>>24)}},{unsafe:!0})}else bx=(_x=function(e){QC(this,bx);var t=nx(e);px(this,{bytes:Cx(Tx(t),0),byteLength:t}),qC||(this.byteLength=t)}).prototype,wx=(kx=function(e,t,n){QC(this,wx),QC(e,bx);var i=fx(e).byteLength,r=ex(t);if(r<0||r>i)throw Sx("Wrong offset");if(r+(n=void 0===n?i-r:tx(n))>i)throw Sx("Wrong length");px(this,{buffer:e,byteLength:n,byteOffset:r}),qC||(this.buffer=e,this.byteLength=n,this.byteOffset=r)}).prototype,qC&&(Nx(_x,"byteLength"),Nx(kx,"buffer"),Nx(kx,"byteLength"),Nx(kx,"byteOffset")),JC(wx,{getInt8:function(e){return jx(this,1,e)[0]<<24>>24},getUint8:function(e){return jx(this,1,e)[0]},getInt16:function(e){var t=jx(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=jx(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return Ax(jx(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return Ax(jx(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return Px(jx(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return Px(jx(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){Bx(this,1,e,Ix,t)},setUint8:function(e,t){Bx(this,1,e,Ix,t)},setInt16:function(e,t){Bx(this,2,e,Lx,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){Bx(this,2,e,Lx,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){Bx(this,4,e,Dx,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){Bx(this,4,e,Dx,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){Bx(this,4,e,Mx,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){Bx(this,8,e,Rx,t,arguments.length>2?arguments[2]:void 0)}});ux(_x,gx),ux(kx,vx);var Wx={ArrayBuffer:_x,DataView:kx},Kx=zp,qx="ArrayBuffer",Yx=Wx.ArrayBuffer;Er({global:!0,constructor:!0,forced:S.ArrayBuffer!==Yx},{ArrayBuffer:Yx}),Kx(qx);var $x=Er,Xx=J,Jx=x,Zx=sn,Qx=Pi,eO=Di,tO=Qp,nO=Wx.ArrayBuffer,iO=Wx.DataView,rO=iO.prototype,oO=Xx(nO.prototype.slice),aO=Xx(rO.getUint8),sO=Xx(rO.setUint8);$x({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:Jx((function(){return!new nO(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(oO&&void 0===t)return oO(Zx(this),e);for(var n=Zx(this).byteLength,i=Qx(e,n),r=Qx(void 0===t?n:t,n),o=new(tO(this,nO))(eO(r-i)),a=new iO(this),s=new iO(o),l=0;i<r;)sO(s,l++,aO(a,i++));return o}});var lO=Vw(bw,"DataView"),cO=Vw(bw,"Promise"),uO=Vw(bw,"Set"),hO=Vw(bw,"WeakMap"),dO="[object Map]",fO="[object Promise]",pO="[object Set]",gO="[object WeakMap]",vO="[object DataView]",yO=Rw(lO),mO=Rw(zw),_O=Rw(cO),bO=Rw(uO),kO=Rw(hO),wO=Ow;(lO&&wO(new lO(new ArrayBuffer(1)))!=vO||zw&&wO(new zw)!=dO||cO&&wO(cO.resolve())!=fO||uO&&wO(new uO)!=pO||hO&&wO(new hO)!=gO)&&(wO=function(e){var t=Ow(e),n="[object Object]"==t?e.constructor:void 0,i=n?Rw(n):"";if(i)switch(i){case yO:return vO;case mO:return dO;case _O:return fO;case bO:return pO;case kO:return gO}return t});var EO=wO,TO=Object.prototype.hasOwnProperty;var SO=bw.Uint8Array;function CO(e){var t=new e.constructor(e.byteLength);return new SO(t).set(new SO(e)),t}var xO=/\w*$/;var OO=kw?kw.prototype:void 0,PO=OO?OO.valueOf:void 0;function IO(e,t,n){var i,r,o,a=e.constructor;switch(t){case"[object ArrayBuffer]":return CO(e);case"[object Boolean]":case"[object Date]":return new a(+e);case"[object DataView]":return function(e,t){var n=t?CO(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?CO(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":case"[object Set]":return new a;case"[object Number]":case"[object String]":return new a(e);case"[object RegExp]":return(o=new(r=e).constructor(r.source,xO.exec(r))).lastIndex=r.lastIndex,o;case"[object Symbol]":return i=e,PO?Object(PO.call(i)):{}}}var LO=Object.create,DO=function(){function e(){}return function(t){if(!Pw(t))return{};if(LO)return LO(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),AO=DO;var MO=TE&&TE.isMap,RO=MO?bE(MO):function(e){return rE(e)&&"[object Map]"==EO(e)};var NO=TE&&TE.isSet,jO=NO?bE(NO):function(e){return rE(e)&&"[object Set]"==EO(e)},BO="[object Arguments]",UO="[object Function]",HO="[object Object]",FO={};function GO(e,t,n,i,r,o){var a,s=1&t,l=2&t,c=4&t;if(n&&(a=r?n(e,i,r,o):n(e)),void 0!==a)return a;if(!Pw(e))return e;var u=hE(e);if(u){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&TO.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!s)return function(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}(e,a)}else{var h=EO(e),d=h==UO||"[object GeneratorFunction]"==h;if(gE(e))return function(e,t){if(t)return e.slice();var n=e.length,i=nT?nT(n):new e.constructor(n);return e.copy(i),i}(e,s);if(h==HO||h==BO||d&&!r){if(a=l||d?{}:function(e){return"function"!=typeof e.constructor||IE(e)?{}:AO(TC(e))}(e),!s)return l?function(e,t){return iE(e,CC(e),t)}(e,function(e,t){return e&&iE(t,BE(t),e)}(a,e)):function(e,t){return iE(e,_C(e),t)}(e,function(e,t){return e&&iE(t,RE(t),e)}(a,e))}else{if(!FO[h])return r?e:{};a=IO(e,h,s)}}o||(o=new Jw);var f=o.get(e);if(f)return f;o.set(e,a),jO(e)?e.forEach((function(i){a.add(GO(i,t,n,i,e,o))})):RO(e)&&e.forEach((function(i,r){a.set(r,GO(i,t,n,r,e,o))}));var p=u?void 0:(c?l?PC:OC:l?BE:RE)(e);return function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););}(p||e,(function(i,r){p&&(i=e[r=i]),nE(a,r,GO(i,t,n,r,e,o))})),a}FO[BO]=FO["[object Array]"]=FO["[object ArrayBuffer]"]=FO["[object DataView]"]=FO["[object Boolean]"]=FO["[object Date]"]=FO["[object Float32Array]"]=FO["[object Float64Array]"]=FO["[object Int8Array]"]=FO["[object Int16Array]"]=FO["[object Int32Array]"]=FO["[object Map]"]=FO["[object Number]"]=FO[HO]=FO["[object RegExp]"]=FO["[object Set]"]=FO["[object String]"]=FO["[object Symbol]"]=FO["[object Uint8Array]"]=FO["[object Uint8ClampedArray]"]=FO["[object Uint16Array]"]=FO["[object Uint32Array]"]=!0,FO["[object Error]"]=FO[UO]=FO["[object WeakMap]"]=!1;function VO(e){return GO(e,5)}function zO(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Xw;++t<n;)this.add(e[t])}function WO(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function KO(e,t){return e.has(t)}zO.prototype.add=zO.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},zO.prototype.has=function(e){return this.__data__.has(e)};function qO(e,t,n,i,r,o){var a=1&n,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=2&n?new zO:void 0;for(o.set(e,t),o.set(t,e);++h<s;){var p=e[h],g=t[h];if(i)var v=a?i(g,p,h,t,e,o):i(p,g,h,e,t,o);if(void 0!==v){if(v)continue;d=!1;break}if(f){if(!WO(t,(function(e,t){if(!KO(f,t)&&(p===e||r(p,e,n,i,o)))return f.push(t)}))){d=!1;break}}else if(p!==g&&!r(p,g,n,i,o)){d=!1;break}}return o.delete(e),o.delete(t),d}var YO=O,$O=On.EXISTS,XO=J,JO=tn.f,ZO=Function.prototype,QO=XO(ZO.toString),eP=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,tP=XO(eP.exec);function nP(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function iP(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}YO&&!$O&&JO(ZO,"name",{configurable:!0,get:function(){try{return tP(eP,QO(this))[1]}catch(w7){return""}}});var rP=kw?kw.prototype:void 0,oP=rP?rP.valueOf:void 0;var aP=Object.prototype.hasOwnProperty;var sP="[object Arguments]",lP="[object Array]",cP="[object Object]",uP=Object.prototype.hasOwnProperty;function hP(e,t,n,i,r,o){var a=hE(e),s=hE(t),l=a?lP:EO(e),c=s?lP:EO(t),u=(l=l==sP?cP:l)==cP,h=(c=c==sP?cP:c)==cP,d=l==c;if(d&&gE(e)){if(!gE(t))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new Jw),a||CE(e)?qO(e,t,n,i,r,o):function(e,t,n,i,r,o,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new SO(e),new SO(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ek(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=nP;case"[object Set]":var l=1&i;if(s||(s=iP),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;i|=2,a.set(e,t);var u=qO(s(e),s(t),i,r,o,a);return a.delete(e),u;case"[object Symbol]":if(oP)return oP.call(e)==oP.call(t)}return!1}(e,t,l,n,i,r,o);if(!(1&n)){var f=u&&uP.call(e,"__wrapped__"),p=h&&uP.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,v=p?t.value():t;return o||(o=new Jw),r(g,v,n,i,o)}}return!!d&&(o||(o=new Jw),function(e,t,n,i,r,o){var a=1&n,s=OC(e),l=s.length;if(l!=OC(t).length&&!a)return!1;for(var c=l;c--;){var u=s[c];if(!(a?u in t:aP.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]],v=t[u];if(i)var y=a?i(v,g,u,t,e,o):i(g,v,u,e,t,o);if(!(void 0===y?g===v||r(g,v,n,i,o):y)){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,n,i,r,o))}function dP(e,t,n,i,r){return e===t||(null==e||null==t||!rE(e)&&!rE(t)?e!=e&&t!=t:hP(e,t,n,i,dP,r))}function fP(e){return e==e&&!Pw(e)}function pP(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function gP(e){var t=function(e){for(var t=RE(e),n=t.length;n--;){var i=t[n],r=e[i];t[n]=[i,r,fP(r)]}return t}(e);return 1==t.length&&t[0][2]?pP(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,i){var r=n.length,o=r,a=!i;if(null==e)return!o;for(e=Object(e);r--;){var s=n[r];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++r<o;){var l=(s=n[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 Jw;if(i)var d=i(c,u,l,e,t,h);if(!(void 0===d?dP(u,c,3,i,h):d))return!1}}return!0}(n,e,t)}}function vP(e){return"symbol"==i(e)||rE(e)&&"[object Symbol]"==Ow(e)}var yP=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,mP=/^\w*$/;function _P(e,t){if(hE(e))return!1;var n=i(e);return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!vP(e))||(mP.test(e)||!yP.test(e)||null!=t&&e in Object(t))}var bP=wo,kP=function(e,t){return void 0===e?arguments.length<2?"":t:bP(e)},wP=ve,EP=kn,TP=Error,SP=J("".replace),CP=String(TP("zxcasd").stack),xP=/\n\s*at [^:]*:[^\n]*/,OP=xP.test(CP),PP=function(e,t){if(OP&&"string"==typeof e&&!TP.prepareStackTrace)for(;t--;)e=SP(e,xP,"");return e},IP=U,LP=!x((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",IP(1,7)),7!==e.stack)})),DP=be,AP=dt,MP=kn,RP=ke,NP=ms,jP=ar,BP=ck,UP=sk,HP=kP,FP=function(e,t){wP(t)&&"cause"in t&&EP(e,"cause",t.cause)},GP=PP,VP=LP,zP=O,WP=Er,KP=rg,qP=function(e,t,n,i){var r="stackTraceLimit",o=i?2:1,a=e.split("."),s=a[a.length-1],l=DP.apply(null,a);if(l){var c=l.prototype;if(AP(c,"cause")&&delete c.cause,!n)return l;var u=DP("Error"),h=t((function(e,t){var n=HP(i?t:e,void 0),r=i?new l(e):new l;return void 0!==n&&MP(r,"message",n),VP&&MP(r,"stack",GP(r.stack,2)),this&&RP(c,this)&&UP(r,this,h),arguments.length>o&&FP(r,arguments[o]),r}));h.prototype=c,"Error"!==s?NP?NP(h,u):jP(h,u,{name:!0}):zP&&r in l&&(BP(h,l,r),BP(h,l,"prepareStackTrace")),jP(h,l);try{c.name!==s&&MP(c,"name",s),c.constructor=h}catch(w7){}return h}},YP="WebAssembly",$P=S.WebAssembly,XP=7!==Error("e",{cause:7}).cause,JP=function(e,t){var n={};n[e]=qP(e,t,XP),WP({global:!0,constructor:!0,arity:1,forced:XP},n)},ZP=function(e,t){if($P&&$P[e]){var n={};n[e]=qP("WebAssembly."+e,t,XP),WP({target:YP,stat:!0,constructor:!0,arity:1,forced:XP},n)}};JP("Error",(function(e){return function(t){return KP(e,this,arguments)}})),JP("EvalError",(function(e){return function(t){return KP(e,this,arguments)}})),JP("RangeError",(function(e){return function(t){return KP(e,this,arguments)}})),JP("ReferenceError",(function(e){return function(t){return KP(e,this,arguments)}})),JP("SyntaxError",(function(e){return function(t){return KP(e,this,arguments)}})),JP("TypeError",(function(e){return function(t){return KP(e,this,arguments)}})),JP("URIError",(function(e){return function(t){return KP(e,this,arguments)}})),ZP("CompileError",(function(e){return function(t){return KP(e,this,arguments)}})),ZP("LinkError",(function(e){return function(t){return KP(e,this,arguments)}})),ZP("RuntimeError",(function(e){return function(t){return KP(e,this,arguments)}}));function QP(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var i=arguments,r=t?t.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var a=e.apply(this,i);return n.cache=o.set(r,a)||o,a};return n.cache=new(QP.Cache||Xw),n}QP.Cache=Xw;var eI,tI,nI,iI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rI=/\\(\\)?/g,oI=(eI=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(iI,(function(e,n,i,r){t.push(i?r.replace(rI,"$1"):n||e)})),t},tI=QP(eI,(function(e){return 500===nI.size&&nI.clear(),e})),nI=tI.cache,tI),aI=oI;var sI=kw?kw.prototype:void 0,lI=sI?sI.toString:void 0;function cI(e){if("string"==typeof e)return e;if(hE(e))return function(e,t){for(var n=-1,i=null==e?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}(e,cI)+"";if(vP(e))return lI?lI.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function uI(e,t){return hE(e)?e:_P(e,t)?[e]:aI(function(e){return null==e?"":cI(e)}(e))}function hI(e){if("string"==typeof e||vP(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function dI(e,t){for(var n=0,i=(t=uI(t,e)).length;null!=e&&n<i;)e=e[hI(t[n++])];return n&&n==i?e:void 0}function fI(e,t,n){var i=null==e?void 0:dI(e,t);return void 0===i?n:i}function pI(e,t){return null!=e&&t in Object(e)}function gI(e,t){return null!=e&&function(e,t,n){for(var i=-1,r=(t=uI(t,e)).length,o=!1;++i<r;){var a=hI(t[i]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++i!=r?o:!!(r=null==e?0:e.length)&&mE(r)&&yE(a,r)&&(hE(e)||uE(e))}(e,t,pI)}function vI(e){return e}function yI(e){return _P(e)?(t=hI(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return dI(t,e)}}(e);var t}function mI(e){return"function"==typeof e?e:null==e?vI:"object"==i(e)?hE(e)?(t=e[0],n=e[1],_P(t)&&fP(n)?pP(hI(t),n):function(e){var i=fI(e,t);return void 0===i&&i===n?gI(e,t):dP(n,i,3)}):gP(e):yI(e);var t,n}function _I(e){return e!=e}function bI(e,t){return!!(null==e?0:e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var i=n-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1}(e,t,n):function(e,t,n,i){for(var r=e.length,o=n+(i?1:-1);i?o--:++o<r;)if(t(e[o],o,e))return o;return-1}(e,_I,n)}(e,t,0)>-1}function kI(e,t,n){for(var i=-1,r=null==e?0:e.length;++i<r;)if(n(t,e[i]))return!0;return!1}var wI=uO&&1/iP(new uO([,-0]))[1]==1/0?function(e){return new uO(e)}:function(){};function EI(e,t){return e&&e.length?function(e,t,n){var i=-1,r=bI,o=e.length,a=!0,s=[],l=s;if(n)a=!1,r=kI;else if(o>=200){var c=t?null:wI(e);if(c)return iP(c);a=!1,r=KO,l=new zO}else l=t?[]:s;e:for(;++i<o;){var u=e[i],h=t?t(u):u;if(u=n||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,n)||(l!==s&&l.push(h),s.push(u))}return s}(e,mI(t)):[]}var TI=function(e){return e.H265="h265",e.H264="h264",e}(TI||{}),SI={exports:{}},CI=x((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),xI=x,OI=ve,PI=Y,II=CI,LI=Object.isExtensible,DI=xI((function(){LI(1)}))||II?function(e){return!!OI(e)&&((!II||"ArrayBuffer"!=PI(e))&&(!LI||LI(e)))}:LI,AI=!x((function(){return Object.isExtensible(Object.preventExtensions({}))})),MI=Er,RI=J,NI=Vn,jI=ve,BI=dt,UI=tn.f,HI=ki,FI=iT,GI=DI,VI=AI,zI=!1,WI=yt("meta"),KI=0,qI=function(e){UI(e,WI,{value:{objectID:"O"+KI++,weakData:{}}})},YI=SI.exports={enable:function(){YI.enable=function(){},zI=!0;var e=HI.f,t=RI([].splice),n={};n[WI]=1,e(n).length&&(HI.f=function(n){for(var i=e(n),r=0,o=i.length;r<o;r++)if(i[r]===WI){t(i,r,1);break}return i},MI({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:FI.f}))},fastKey:function(e,t){if(!jI(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!BI(e,WI)){if(!GI(e))return"F";if(!t)return"E";qI(e)}return e[WI].objectID},getWeakData:function(e,t){if(!BI(e,WI)){if(!GI(e))return!0;if(!t)return!1;qI(e)}return e[WI].weakData},onFreeze:function(e){return VI&&zI&&GI(e)&&!BI(e,WI)&&qI(e),e}};NI[WI]=!0;var $I=Er,XI=S,JI=J,ZI=gr,QI=bi,eL=SI.exports,tL=Uy,nL=Fl,iL=fe,rL=ie,oL=ve,aL=x,sL=zy,lL=rs,cL=sk,uL=function(e,t,n){var i=-1!==e.indexOf("Map"),r=-1!==e.indexOf("Weak"),o=i?"set":"add",a=XI[e],s=a&&a.prototype,l=a,c={},u=function(e){var t=JI(s[e]);QI(s,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(r&&!oL(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return r&&!oL(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(r&&!oL(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(ZI(e,!iL(a)||!(r||s.forEach&&!aL((function(){(new a).entries().next()})))))l=n.getConstructor(t,e,i,o),eL.enable();else if(ZI(e,!0)){var h=new l,d=h[o](r?{}:-0,1)!=h,f=aL((function(){h.has(1)})),p=sL((function(e){new a(e)})),g=!r&&aL((function(){for(var e=new a,t=5;t--;)e[o](t,t);return!e.has(-0)}));p||((l=t((function(e,t){nL(e,s);var n=cL(new a,e,l);return rL(t)||tL(t,n[o],{that:n,AS_ENTRIES:i}),n}))).prototype=s,s.constructor=l),(f||g)&&(u("delete"),u("has"),i&&u("get")),(g||d)&&u(o),r&&s.clear&&delete s.clear}return c[e]=l,$I({global:!0,constructor:!0,forced:l!=a},c),lL(l,e),r||n.setStrong(l,e,i),l},hL=tn.f,dL=xa,fL=fu,pL=xr,gL=Fl,vL=ie,yL=Uy,mL=Bs,_L=Us,bL=zp,kL=O,wL=SI.exports.fastKey,EL=ii.set,TL=ii.getterFor,SL={getConstructor:function(e,t,n,i){var r=e((function(e,r){gL(e,o),EL(e,{type:t,index:dL(null),first:void 0,last:void 0,size:0}),kL||(e.size=0),vL(r)||yL(r,e[i],{that:e,AS_ENTRIES:n})})),o=r.prototype,a=TL(t),s=function(e,t,n){var i,r,o=a(e),s=l(e,t);return s?s.value=n:(o.last=s={index:r=wL(t,!0),key:t,value:n,previous:i=o.last,next:void 0,removed:!1},o.first||(o.first=s),i&&(i.next=s),kL?o.size++:e.size++,"F"!==r&&(o.index[r]=s)),e},l=function(e,t){var n,i=a(e),r=wL(t);if("F"!==r)return i.index[r];for(n=i.first;n;n=n.next)if(n.key==t)return n};return fL(o,{clear:function(){for(var e=a(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,kL?e.size=0:this.size=0},delete:function(e){var t=this,n=a(t),i=l(t,e);if(i){var r=i.next,o=i.previous;delete n.index[i.index],i.removed=!0,o&&(o.next=r),r&&(r.previous=o),n.first==i&&(n.first=r),n.last==i&&(n.last=o),kL?n.size--:t.size--}return!!i},forEach:function(e){for(var t,n=a(this),i=pL(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(i(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!l(this,e)}}),fL(o,n?{get:function(e){var t=l(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),kL&&hL(o,"size",{get:function(){return a(this).size}}),r},setStrong:function(e,t,n){var i=t+" Iterator",r=TL(t),o=TL(i);mL(e,t,(function(e,t){EL(this,{type:i,target:e,state:r(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?_L("keys"==t?n.key:"values"==t?n.value:[n.key,n.value],!1):(e.target=void 0,_L(void 0,!0))}),n?"entries":"values",!n,!0),bL(t)}};uL("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),SL);var CL=dt,xL=function(e){return void 0!==e&&(CL(e,"value")||CL(e,"writable"))},OL=D,PL=ve,IL=sn,LL=xL,DL=C,AL=Ka;Er({target:"Reflect",stat:!0},{get:function e(t,n){var i,r,o=arguments.length<3?t:arguments[2];return IL(t)===o?t[n]:(i=DL.f(t,n))?LL(i)?i.value:void 0===i.get?void 0:OL(i.get,o):PL(r=AL(t))?e(r,n,o):void 0}});var ML=S,RL=rs;Er({global:!0},{Reflect:{}}),RL(ML.Reflect,"Reflect",!0);var NL=D,jL=sn,BL=ve,UL=xL,HL=tn,FL=C,GL=Ka,VL=U;Er({target:"Reflect",stat:!0,forced:x((function(){var e=function(){},t=HL.f(new e,"a",{configurable:!0});return!1!==Reflect.set(e.prototype,"a",1,t)}))},{set:function e(t,n,i){var r,o,a,s=arguments.length<4?t:arguments[3],l=FL.f(jL(t),n);if(!l){if(BL(o=GL(t)))return e(o,n,i,s);l=VL(0)}if(UL(l)){if(!1===l.writable||!BL(s))return!1;if(r=FL.f(s,n)){if(r.get||r.set||!1===r.writable)return!1;r.value=i,HL.f(s,n,r)}else HL.f(s,n,VL(0,i))}else{if(void 0===(a=l.set))return!1;NL(a,s,i)}return!0}});var zL=Er,WL=po.findIndex,KL=Na,qL="findIndex",YL=!0;qL in[]&&Array(1).findIndex((function(){YL=!1})),zL({target:"Array",proto:!0,forced:YL},{findIndex:function(e){return WL(this,e,arguments.length>1?arguments[1]:void 0)}}),KL(qL);var $L=Er,XL=ct,JL=Mi,ZL=sp,QL=Hb,eD=Ff,tD=1!==[].unshift(0),nD=!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(w7){return w7 instanceof TypeError}}();$L({target:"Array",proto:!0,arity:1,forced:tD||nD},{unshift:function(e){var t=XL(this),n=JL(t),i=arguments.length;if(i){eD(n+i);for(var r=n;r--;){var o=r+i;r in t?t[o]=t[r]:QL(t,o)}for(var a=0;a<i;a++)t[a]=arguments[a]}return ZL(t,n+i)}});var iD=Er,rD=x,oD=iT.f;iD({target:"Object",stat:!0,forced:rD((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:oD});var aD=Er,sD=x,lD=ce,cD=C.f,uD=O,hD=sD((function(){cD(1)}));aD({target:"Object",stat:!0,forced:!uD||hD,sham:!uD},{getOwnPropertyDescriptor:function(e,t){return cD(lD(e),t)}});var dD=Er,fD=O,pD=tn.f;dD({target:"Object",stat:!0,forced:Object.defineProperty!==pD,sham:!fD},{defineProperty:pD}),Er({target:"Object",stat:!0},{setPrototypeOf:ms});var gD=Er,vD=ve,yD=SI.exports.onFreeze,mD=AI,_D=x,bD=Object.seal;gD({target:"Object",stat:!0,forced:_D((function(){bD(1)})),sham:!mD},{seal:function(e){return bD&&vD(e)?bD(yD(e)):e}});var kD=function(){var e,t=null;function n(e){return!!e&&("object"===i(e)||"function"==typeof e)}function r(e){if(null!==e&&!n(e))throw new TypeError("Object prototype may only be an Object or null: "+e)}var o=Object,a=Boolean(o.create)||!({__proto__:null}instanceof o),s=o.create||(a?function(e){return r(e),{__proto__:e}}:function(e){if(r(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}),l=function(){return null},c=o.getPrototypeOf||([].__proto__===Array.prototype?function(e){var t=e.__proto__;return n(t)?t:null}:l);return e=function(i,u){if(void 0===(this&&this instanceof e?this.constructor:void 0))throw new TypeError("Constructor Proxy requires 'new'");if(!n(i)||!n(u))throw new TypeError("Cannot create proxy with a non-object as target or handler");var h=function(){};t=function(){i=null,h=function(e){throw new TypeError("Cannot perform '".concat(e,"' on a proxy that has been revoked"))}},setTimeout((function(){t=null}),0);var d=u;for(var f in u={get:null,set:null,apply:null,construct:null},d){if(!(f in u))throw new TypeError("Proxy polyfill does not support trap '".concat(f,"'"));u[f]=d[f]}"function"==typeof d&&(u.apply=d.apply.bind(d));var p,g=c(i),v=!1,y=!1;"function"==typeof i?(p=function(){var e=this&&this.constructor===p,t=Array.prototype.slice.call(arguments);if(h(e?"construct":"apply"),e&&u.construct)return u.construct.call(this,i,t);if(!e&&u.apply)return u.apply(i,this,t);if(e){t.unshift(i);var n=i.bind.apply(i,t);return new n}return i.apply(this,t)},v=!0):i instanceof Array?(p=[],y=!0):p=a||null!==g?s(g):{};var m=u.get?function(e){return h("get"),u.get(this,e,p)}:function(e){return h("get"),this[e]},_=u.set?function(e,t){h("set"),u.set(this,e,t,p)}:function(e,t){h("set"),this[e]=t},b=o.getOwnPropertyNames(i),k={};b.forEach((function(e){if(!v&&!y||!(e in p)){var t=o.getOwnPropertyDescriptor(i,e),n={enumerable:Boolean(t.enumerable),get:m.bind(i,e),set:_.bind(i,e)};o.defineProperty(p,e,n),k[e]=!0}}));var w=!0;if(v||y){var E=o.setPrototypeOf||([].__proto__===Array.prototype?function(e,t){return r(t),e.__proto__=t,e}:l);g&&E(p,g)||(w=!1)}if(u.get||!w)for(var T in i)k[T]||o.defineProperty(p,T,{get:m.bind(i,T)});return o.seal(i),o.seal(p),p},e.revocable=function(n,i){return{proxy:new e(n,i),revoke:t}},e}(),wD=new(function(){function e(){a(this,e),this.subscribeId=0,this.watcherMap=new Map}return l(e,[{key:"observe",value:function(e){var t=this,n=new kD(e,{set:function(e,i,r){var o=Reflect.get(e,i);Reflect.set(e,i,r);var a=t.watcherMap.get(n);return a&&(t.flushCallback(a),t.flushPropertyCallback(a,i,o,r)),!0}});return this.watcherMap.set(n,{pending:!1,queue:[],property:{}}),n}},{key:"subscribe",value:function(e,t){var n=this.watcherMap.get(e);if(n)return this.subscribeId++,n.queue.push({id:this.subscribeId,callback:t}),this.subscribeId}},{key:"unsubscribe",value:function(e,t){var n=this.watcherMap.get(e);if(n){var i=n.queue,r=i.findIndex((function(e){return e.id===t}));void 0!==r&&r>-1&&i.splice(r,1)}}},{key:"subscribeProperty",value:function(e,t,n){var i=this.watcherMap.get(e);i&&(this.subscribeId++,i.property[t]||(i.property[t]={pending:!1,timer:0,pre:null,queue:[]}),i.property[t].queue.push({id:this.subscribeId,callback:n}))}},{key:"unsubscribeProperty",value:function(e,t,n){var i=this.watcherMap.get(e);if(i){var r=i.property[t];if(r){var o=r.queue,a=o.findIndex((function(e){return e.id===n}));void 0!==a&&a>-1&&o.splice(a,1)}}}},{key:"flushCallback",value:function(e){e.pending||(e.pending=!0,setTimeout((function(){e.queue.forEach((function(e){return e.callback()})),e.pending=!1}),0))}},{key:"flushPropertyCallback",value:function(e,t,n,i){var r=e.property[t];r&&(clearTimeout(r.timer),!1===r.pending&&(r.pending=!0,r.pre=n),r.timer=setTimeout((function(){r.queue.forEach((function(e){return e.callback(r.pre,i)})),r.pending=!1}),0))}}]),e}()),ED=Er,TD=po.find,SD=Na,CD="find",xD=!0;CD in[]&&Array(1).find((function(){xD=!1})),ED({target:"Array",proto:!0,forced:xD},{find:function(e){return TD(this,e,arguments.length>1?arguments[1]:void 0)}}),SD(CD);var OD=Er,PD=ne,ID=ce,LD=Po,DD=J([].join),AD=PD!=Object,MD=LD("join",",");OD({target:"Array",proto:!0,forced:AD||!MD},{join:function(e){return DD(ID(this),void 0===e?",":e)}}),Er({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var RD=J(1..valueOf),ND=O,jD=S,BD=J,UD=gr,HD=bi,FD=dt,GD=sk,VD=ke,zD=Be,WD=Nt,KD=x,qD=ki.f,YD=C.f,$D=tn.f,XD=RD,JD=xf.trim,ZD="Number",QD=jD.Number,eA=QD.prototype,tA=jD.TypeError,nA=BD("".slice),iA=BD("".charCodeAt),rA=function(e){var t=WD(e,"number");return"bigint"==typeof t?t:oA(t)},oA=function(e){var t,n,i,r,o,a,s,l,c=WD(e,"number");if(zD(c))throw tA("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=JD(c),43===(t=iA(c,0))||45===t){if(88===(n=iA(c,2))||120===n)return NaN}else if(48===t){switch(iA(c,1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+c}for(a=(o=nA(c,2)).length,s=0;s<a;s++)if((l=iA(o,s))<48||l>r)return NaN;return parseInt(o,i)}return+c};if(UD(ZD,!QD(" 0o1")||!QD("0b1")||QD("+0x1"))){for(var aA,sA=function(e){var t=arguments.length<1?0:QD(rA(e)),n=this;return VD(eA,n)&&KD((function(){XD(n)}))?GD(Object(t),n,sA):t},lA=ND?qD(QD):"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(","),cA=0;lA.length>cA;cA++)FD(QD,aA=lA[cA])&&!FD(sA,aA)&&$D(sA,aA,YD(QD,aA));sA.prototype=eA,eA.constructor=sA,HD(jD,ZD,sA,{constructor:!0})}var uA=tr,hA=ce,dA=C,fA=pc;Er({target:"Object",stat:!0,sham:!O},{getOwnPropertyDescriptors:function(e){for(var t,n,i=hA(e),r=dA.f,o=uA(i),a={},s=0;o.length>s;)void 0!==(n=r(i,t=o[s++]))&&fA(a,t,n);return a}});var pA=Er,gA=O,vA=ra.f;pA({target:"Object",stat:!0,forced:Object.defineProperties!==vA,sham:!gA},{defineProperties:vA});var yA=Er,mA=O,_A=S,bA=J,kA=dt,wA=fe,EA=ke,TA=wo,SA=tn.f,CA=ar,xA=_A.Symbol,OA=xA&&xA.prototype;if(mA&&wA(xA)&&(!("description"in OA)||void 0!==xA().description)){var PA={},IA=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:TA(arguments[0]),t=EA(OA,this)?new xA(e):void 0===e?xA():xA(e);return""===e&&(PA[t]=!0),t};CA(IA,xA),IA.prototype=OA,OA.constructor=IA;var LA="Symbol(test)"==String(xA("test")),DA=bA(OA.valueOf),AA=bA(OA.toString),MA=/^Symbol\((.*)\)[^)]+$/,RA=bA("".replace),NA=bA("".slice);SA(OA,"description",{configurable:!0,get:function(){var e=DA(this);if(kA(PA,e))return"";var t=AA(e),n=LA?NA(t,7,-1):RA(t,MA,"$1");return""===n?void 0:n}}),yA({global:!0,constructor:!0,forced:!0},{Symbol:IA})}gT("iterator");var jA=J,BA=ze,UA=ve,HA=dt,FA=og,GA=P,VA=Function,zA=jA([].concat),WA=jA([].join),KA={},qA=function(e,t,n){if(!HA(KA,t)){for(var i=[],r=0;r<t;r++)i[r]="a["+r+"]";KA[t]=VA("C,a","return new C("+WA(i,",")+")")}return KA[t](e,n)},YA=GA?VA.bind:function(e){var t=BA(this),n=t.prototype,i=FA(arguments,1),r=function(){var n=zA(i,FA(arguments));return this instanceof r?qA(t,n.length,n):t.apply(e,n)};return UA(n)&&(r.prototype=n),r},$A=Er,XA=rg,JA=YA,ZA=Yp,QA=sn,eM=ve,tM=xa,nM=x,iM=be("Reflect","construct"),rM=Object.prototype,oM=[].push,aM=nM((function(){function e(){}return!(iM((function(){}),[],e)instanceof e)})),sM=!nM((function(){iM((function(){}))})),lM=aM||sM;$A({target:"Reflect",stat:!0,forced:lM,sham:lM},{construct:function(e,t){ZA(e),QA(t);var n=arguments.length<3?e:ZA(arguments[2]);if(sM&&!aM)return iM(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var i=[null];return XA(oM,i,t),new(XA(JA,e,i))}var r=n.prototype,o=tM(eM(r)?r:rM),a=XA(e,o,t);return eM(a)?a:o}});var cM=Uc;Er({target:"Array",stat:!0,forced:!zy((function(e){Array.from(e)}))},{from:cM});var uM=bT;gT("toPrimitive"),uM();var hM=sn,dM=Ze,fM=TypeError,pM=dt,gM=bi,vM=function(e){if(hM(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw fM("Incorrect hint");return dM(this,e)},yM=Ot("toPrimitive"),mM=Date.prototype;function _M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function bM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_M(Object(n),!0).forEach((function(t){SM(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function kM(e){return(kM="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 wM(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EM(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,NM(i.key),i)}}function TM(e,t,n){return t&&EM(e.prototype,t),n&&EM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function SM(e,t,n){return(t=NM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CM(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&&OM(e,t)}function xM(e){return(xM=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function OM(e,t){return(OM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function PM(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function IM(e,t){if(t&&("object"===i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return PM(e)}function LM(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(xX){return!1}}();return function(){var n,i=xM(e);if(t){var r=xM(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return IM(this,n)}}function DM(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=xM(e)););return e}function AM(){return AM="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=DM(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},AM.apply(this,arguments)}function MM(e){return function(e){if(Array.isArray(e))return RM(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 RM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return RM(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 RM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function NM(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}pM(mM,yM)||gM(mM,yM,vM);var jM={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,i,o,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new r(i,o||e,a),l=n?n+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 i:delete e._events[t]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,i,r=[];if(0===this._eventsCount)return r;for(i in e=this._events)t.call(e,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,a=new Array(o);r<o;r++)a[r]=i[r].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},s.prototype.emit=function(e,t,i,r,o,a){var s=n?n+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,i),!0;case 4:return u.fn.call(u.context,t,i,r),!0;case 5:return u.fn.call(u.context,t,i,r,o),!0;case 6:return u.fn.call(u.context,t,i,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,i);break;case 4:u[c].fn.call(u[c].context,t,i,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,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,i,r){var o=n?n+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||i&&s.context!==i||a(this,o);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||r&&!s[l].once||i&&s[l].context!==i)&&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=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}(jM);var BM=jM.exports,UM=D,HM=sn,FM=ie,GM=Di,VM=wo,zM=ae,WM=qe,KM=g_,qM=I_;f_("match",(function(e,t,n){return[function(t){var n=zM(this),i=FM(t)?void 0:WM(t,e);return i?UM(i,t,n):new RegExp(t)[e](VM(n))},function(e){var i=HM(this),r=VM(e),o=n(t,i,r);if(o.done)return o.value;if(!i.global)return qM(i,r);var a=i.unicode;i.lastIndex=0;for(var s,l=[],c=0;null!==(s=qM(i,r));){var u=VM(s[0]);l[c]=u,""===u&&(i.lastIndex=KM(r,GM(i.lastIndex),a)),c++}return 0===c?null:l}]}));var YM=rg,$M=D,XM=J,JM=f_,ZM=sn,QM=ie,eR=Ho,tR=ae,nR=Qp,iR=g_,rR=Di,oR=wo,aR=qe,sR=Wc,lR=I_,cR=r_,uR=x,hR=Lm.UNSUPPORTED_Y,dR=4294967295,fR=Math.min,pR=[].push,gR=XM(/./.exec),vR=XM(pR),yR=XM("".slice),mR=!uR((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));JM("split",(function(e,t,n){var i;return i="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,n){var i=oR(tR(this)),r=void 0===n?dR:n>>>0;if(0===r)return[];if(void 0===e)return[i];if(!eR(e))return $M(t,i,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=$M(cR,h,i))&&!((a=h.lastIndex)>u&&(vR(l,yR(i,u,o.index)),o.length>1&&o.index<i.length&&YM(pR,l,sR(o,1)),s=o[0].length,u=a,l.length>=r));)h.lastIndex===o.index&&h.lastIndex++;return u===i.length?!s&&gR(h,"")||vR(l,""):vR(l,yR(i,u)),l.length>r?sR(l,0,r):l}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:$M(t,this,e,n)}:t,[function(t,n){var r=tR(this),o=QM(t)?void 0:aR(t,e);return o?$M(o,t,r,n):$M(i,oR(r),t,n)},function(e,r){var o=ZM(this),a=oR(e),s=n(i,o,a,r,i!==t);if(s.done)return s.value;var l=nR(o,RegExp),c=o.unicode,u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(hR?"g":"y"),h=new l(hR?"^(?:"+o.source+")":o,u),d=void 0===r?dR:r>>>0;if(0===d)return[];if(0===a.length)return null===lR(h,a)?[a]:[];for(var f=0,p=0,g=[];p<a.length;){h.lastIndex=hR?0:p;var v,y=lR(h,hR?yR(a,p):a);if(null===y||(v=fR(rR(h.lastIndex+(hR?p:0)),a.length))===f)p=iR(a,p,c);else{if(vR(g,yR(a,f,p)),g.length===d)return g;for(var m=1;m<=y.length-1;m++)if(vR(g,y[m]),g.length===d)return g;p=f=v}}return vR(g,yR(a,f)),g}]}),!mR,hR);var _R=S,bR=x,kR=wo,wR=xf.trim,ER=J("".charAt),TR=_R.parseFloat,SR=_R.Symbol,CR=SR&&SR.iterator,xR=1/TR("\t\n\v\f\r \u2028\u2029\ufeff-0")!=-1/0||CR&&!bR((function(){TR(Object(CR))}))?function(e){var t=wR(kR(e)),n=TR(t);return 0===n&&"-"==ER(t,0)?-0:n}:TR;Er({global:!0,forced:parseFloat!=xR},{parseFloat:xR});var OR=On.PROPER,PR=x,IR=_f,LR=xf.trim;Er({target:"String",proto:!0,forced:function(e){return PR((function(){return!!IR[e]()||"
"!=="
"[e]()||OR&&IR[e].name!==e}))}("trim")},{trim:function(){return LR(this)}});var DR=we.match(/firefox\/(\d+)/i),AR=!!DR&&+DR[1],MR=/MSIE|Trident/.test(we),RR=we.match(/AppleWebKit\/(\d+)\./),NR=!!RR&&+RR[1],jR=Er,BR=J,UR=ze,HR=ct,FR=Mi,GR=Hb,VR=wo,zR=x,WR=_u,KR=Po,qR=AR,YR=MR,$R=Pe,XR=NR,JR=[],ZR=BR(JR.sort),QR=BR(JR.push),eN=zR((function(){JR.sort(void 0)})),tN=zR((function(){JR.sort(null)})),nN=KR("sort"),iN=!zR((function(){if($R)return $R<70;if(!(qR&&qR>3)){if(YR)return!0;if(XR)return XR<603;var e,t,n,i,r="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(i=0;i<47;i++)JR.push({k:t+i,v:n})}for(JR.sort((function(e,t){return t.v-e.v})),i=0;i<JR.length;i++)t=JR[i].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return"DGBEFHACIJK"!==r}}));jR({target:"Array",proto:!0,forced:eN||!tN||!nN||!iN},{sort:function(e){void 0!==e&&UR(e);var t=HR(this);if(iN)return void 0===e?ZR(t):ZR(t,e);var n,i,r=[],o=FR(t);for(i=0;i<o;i++)i in t&&QR(r,t[i]);for(WR(r,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:VR(t)>VR(n)?1:-1}}(e)),n=FR(r),i=0;i<n;)t[i]=r[i++];for(;i<o;)GR(t,i++);return t}});var rN="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,oN={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},aN="%c[xgplayer]",sN={config:{debug:rN?3:0},logInfo:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.config.debug>=3&&(t=console).log.apply(t,[aN,oN.info,e].concat(i))},logWarn:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.config.debug>=1&&(t=console).warn.apply(t,[aN,oN.warn,e].concat(i))},logError:function(e){var t;if(!(this.config.debug<1)){for(var n=this.config.debug>=2?"trace":"error",i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];(t=console)[n].apply(t,[aN,oN.error,e].concat(r))}}};var lN=function(){function e(t){wM(this,e),this.bufferedList=t}return TM(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}(),cN={};function uN(e,t){for(var n=0,i=t.length;n<i;n++)if(e.indexOf(t[n])>-1)return!0;return!1}function hN(e){var t=kM(e);return null!==e&&("object"===t||"function"===t)}function dN(e,t,n){var i,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 n=i,o=r;return i=r=void 0,c=t,a=e.apply(o,n)}function g(e,t){return f?(window.cancelAnimationFrame(s),window.requestAnimationFrame(e)):setTimeout(e,t)}function v(e){return c=e,s=g(m,t),u?p(e):a}function y(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=o}function m(){var e=Date.now();if(y(e))return _(e);s=g(m,function(e){var n=e-c,i=t-(e-l);return h?Math.min(i,o-n):i}(e))}function _(e){return s=void 0,d&&i?p(e):(i=r=void 0,a)}function b(){for(var e=Date.now(),n=y(e),o=arguments.length,c=new Array(o),u=0;u<o;u++)c[u]=arguments[u];if(i=c,r=this,l=e,n){if(void 0===s)return v(l);if(h)return s=g(m,t),p(l)}return void 0===s&&(s=g(m,t)),a}return t=+t||0,hN(n)&&(u=!!n.leading,o=(h="maxWait"in n)?Math.max(+n.maxWait||0,t):o,d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==s&&function(e){if(f)return window.cancelAnimationFrame(e);clearTimeout(e)}(s),c=0,i=l=r=s=void 0},b.flush=function(){return void 0===s?a:_(Date.now())},b.pending=function(){return void 0!==s},b}cN.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=i,r.innerHTML=t,Object.keys(n).forEach((function(t){var i=t,o=n[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(i,o):r.setAttribute(i,o)})),r},cN.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var i=document.createElement("div");i.innerHTML=e;var r=i.children;return i=null,r.length>0?(r=r[0],n&&cN.addClass(r,n),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(o){return sN.logError("util.createDomFromHtml",o),null}},cN.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(xX){var n=e.className&&"object"===kM(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},cN.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(xX){cN.hasClass(e,t)||(e.className&&"object"===kM(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},cN.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(xX){cN.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===kM(e.className)?e.setAttribute("class",e.getAttribute("class").replace(n," ")):e.className=e.className.replace(n," ")}))}},cN.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){cN.hasClass(e,t)?cN.removeClass(e,t):cN.addClass(e,t)}))},cN.classNames=function(){for(var e=arguments,t=[],n=function(n){"String"===cN.typeOf(e[n])?t.push(e[n]):"Object"===cN.typeOf(e[n])&&Object.keys(e[n]).map((function(i){e[n][i]&&t.push(i)}))},i=0;i<arguments.length;i++)n(i);return t.join(" ")},cN.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(n)}catch(xX){sN.logError("util.findDom",xX),0===n.indexOf("#")&&(e=t.getElementById(n.slice(1)))}return e},cN.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},cN.padStart=function(e,t,n){for(var i=String(n),r=t>>0,o=Math.ceil(r/i.length),a=[],s=String(e);o--;)a.push(i);return a.join("").substring(0,r-s.length)+s},cN.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=cN.padStart(Math.floor(e/3600),2,0),n=cN.padStart(Math.floor((e-3600*t)/60),2,0),i=cN.padStart(Math.floor(e-3600*t-60*n),2,0);return("00"===t?[n,i]:[t,n,i]).join(":")},cN.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},cN.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},cN.deepCopy=function(e,t){if("Object"===cN.typeOf(t)&&"Object"===cN.typeOf(e))return Object.keys(t).forEach((function(n){"Object"!==cN.typeOf(t[n])||t[n]instanceof Node?"Array"===cN.typeOf(t[n])?e[n]="Array"===cN.typeOf(e[n])?e[n].concat(t[n]):t[n]:e[n]=t[n]:void 0===e[n]||void 0===e[n]?e[n]=t[n]:cN.deepCopy(e[n],t[n])})),e},cN.deepMerge=function(e,t){return Object.keys(t).map((function(n){var i;"Array"===cN.typeOf(t[n])&&"Array"===cN.typeOf(e[n])?"Array"===cN.typeOf(e[n])&&(i=e[n]).push.apply(i,MM(t[n])):cN.typeOf(e[n])!==cN.typeOf(t[n])||null===e[n]||"Object"!==cN.typeOf(e[n])||t[n]instanceof window.Node?null!==t[n]&&(e[n]=t[n]):cN.deepMerge(e[n],t[n])})),e},cN.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var n=document.createElement("a");return n.href=t.replace(/url\("|"\)/g,""),n.href},cN.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""},cN.setInterval=function(e,t,n,i){e._interval[t]||(e._interval[t]=window.setInterval(n.bind(e),i))},cN.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},cN.setTimeout=function(e,t,n){e._timers||(e._timers=[]);var i=setTimeout((function(){t(),cN.clearTimeout(e,i)}),n);return e._timers.push(i),i},cN.clearTimeout=function(e,t){var n=e._timers;if("Array"===cN.typeOf(n)){for(var i=0;i<n.length;i++)if(n[i]===t){n.splice(i,1),clearTimeout(t);break}}else clearTimeout(t)},cN.clearAllTimers=function(e){var t=e._timers;"Array"===cN.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},cN.createImgBtn=function(e,t,n,i){var r,o,a,s=cN.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(s.style.backgroundImage='url("'.concat(t,'")'),n&&i)&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){return!(n.indexOf(e)>-1&&i.indexOf(e)>-1)||(r=parseFloat(n.slice(0,n.indexOf(e)).trim()),o=parseFloat(i.slice(0,i.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},cN.Hex2RGBA=function(e,t){var n=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var i="#";e.replace(/[0-9A-F]/gi,(function(e){i+=e+e})),e=i}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){n.push(parseInt(e,16))})),"rgba(".concat(n.join(","),", ").concat(t,")")):"rgba(255, 255, 255, 0.1)"},cN.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},cN.checkIsFunction=function(e){return e&&"function"==typeof e},cN.checkIsObject=function(e){return null!==e&&"object"===kM(e)},cN.hide=function(e){e.style.display="none"},cN.show=function(e,t){e.style.display=t||"block"},cN.isUndefined=function(e){if(null==e)return!0},cN.isNotNull=function(e){return!(null==e)},cN.setStyleFromCsstext=function(e,t){t&&("String"===cN.typeOf(t)?t.replace(/\s+/g,"").split(";").map((function(t){if(t){var n=t.split(":");n.length>1&&(e.style[n[0]]=n[1])}})):Object.keys(t).map((function(n){e.style[n]=t[n]})))},cN.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"],n=e.style.cssText;if(!n)return{};var i=n.replace(/\s+/g,"").split(";"),r={},o={};return i.map((function(e){if(e){var n=e.split(":");n.length>1&&(uN(n[0],t)?r[n[0]]=n[1]:o[n[0]]=n[1])}})),e.setAttribute("style",""),Object.keys(o).map((function(t){e.style[t]=o[t]})),r},cN.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var n=t.replace(/\s+/g,"").split(";"),i={};return n.map((function(e){if(e){var t=e.split(":");t.length>1&&(i[t[0]]=t[1])}})),i},cN.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var i=new window.Image;i.onload=function(e){i=null,t&&t(e)},i.onerror=function(e){i=null,n&&n(e)},i.src=e}},cN.stopPropagation=function(e){e&&(e.stopPropagation(),e.cancelable&&e.preventDefault())},cN.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},cN.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},cN.checkTouchSupport=function(){return"ontouchstart"in window},cN.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=[],i=0;i<e.length;i++)n.push({start:e.start(i)<.5?0:e.start(i),end:e.end(i)});n.sort((function(e,t){var n=e.start-t.start;return n||t.end-e.end}));var r=[];if(t)for(var o=0;o<n.length;o++){var a=r.length;if(a){var s=r[a-1].end;n[o].start-s<t?n[o].end>s&&(r[a-1].end=n[o].end):r.push(n[o])}else r.push(n[o])}else r=n;return new lN(r)},cN.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}},cN.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},cN.getHostFromUrl=function(e){if("String"!==cN.typeOf(e))return"";var t=e.split("/"),n="";return t.length>3&&t[2]&&(n=t[2]),n},cN.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},cN.isMSE=function(e){return!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},cN.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(xX){e=0}t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(window.performance.now()));var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}));return n},cN.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},cN.adjustTimeByDuration=function(e,t,n){return t&&e&&(e>t||n&&e<t)?t:e},cN.createPositionBar=function(e,t){var n=cN.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(n),n};var fN=/(Android)\s([\d.]+)/,pN=/(Version)\/([\d.]+)/,gN=["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"],vN={get device(){return vN.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(n){return t[n].test(e)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,i=/(?:Android)/.test(e),r=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||i&&!/(?:Mobile)/.test(e)||r&&/(?:Tablet)/.test(e),a=/(?:iPhone)/.test(e)&&!o,s=!(a||i||n||o),l=/(?:iPad|PlayBook)/.test(e);return{isTablet:o,isPhone:a,isIpad:l,isIos:a||l,isAndroid:i,isPc:s,isSymbian:n,isWindowsPhone:t,isFireFox:r}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",n=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?pN:fN)?t.exec(e):[];if(n&&n.length>=3){var i=n[2].split(".");return i.length>0?parseInt(i[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&&gN.map((function(n){"probably"===t.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(e.isSupport=!0,e.mime+="||".concat(n))})),this.supportResult=e,t=null,e},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 n=e.video||{},i=e.audio||{};try{var r=MediaSource.isTypeSupported(n.contentType),o=MediaSource.isTypeSupported(i.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(xX){return Promise.resolve(t)}}},yN="3.0.4",mN={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},_N={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},bN=TM((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};wM(this,e);var i=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.media){var r=n.mediaError?n.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=n.errorCode||r.code;_N[f]&&(f=_N[f]);var p={playerVersion:yN,currentTime:a,duration:o,ended:s,readyState:h,networkState:d,src:l||c,errorType:n.errorType,errorCode:f,message:n.errorMessage||r.message,mediaError:r,originError:n.originError?n.originError.stack:"",host:cN.getHostFromUrl(l||c)};return n.ext&&Object.keys(n.ext).map((function(e){p[e]=n.ext[e]})),p}if(arguments.length>1){for(var g={playerVersion:yN,domain:document.domain},v=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],y=0;y<arguments.length;y++)g[v[y]]=arguments[y];return g.ex=i?(i[arguments[0]]||{}).msg:"",g}})),kN="play",wN="playing",EN="ended",TN="pause",SN="error",CN="seeking",xN="seeked",ON="timeupdate",PN="waiting",IN="canplay",LN="durationchange",DN="volumechange",AN="loadeddata",MN="ratechange",RN="progress",NN="loadstart",jN="emptied",BN="focus",UN="blur",HN="ready",FN="urlNull",GN="autoplay_started",VN="autoplay_was_prevented",zN="complete",WN="replay",KN="destroy",qN="urlchange",YN="download_speed_change",$N="fullscreen_change",XN="cssFullscreen_change",JN="mini_state_change",ZN="definition_change",QN="after_definition_change",ej="SEI_PARSED",tj="video_resize",nj="pip_change",ij="rotate",rj="screenShot",oj="playnext",aj="shortcut",sj="xglog",lj="user_action",cj="reset",uj=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],hj={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},dj="fps_stuck",fj=Object.freeze(Object.defineProperty({__proto__:null,ABORT:"abort",AFTER_DEFINITION_CHANGE:QN,AUTOPLAY_PREVENTED:VN,AUTOPLAY_STARTED:GN,BEFORE_DEFINITION_CHANGE:"before_definition_change",BUFFER_CHANGE:"bufferedChange",CANPLAY:IN,CANPLAY_THROUGH:"canplaythrough",COMPLETE:zN,CSS_FULLSCREEN_CHANGE:XN,DEFINITION_CHANGE:ZN,DESTROY:KN,DOWNLOAD_SPEED_CHANGE:YN,DURATION_CHANGE:LN,EMPTIED:jN,ENDED:EN,ERROR:SN,FPS_STUCK:dj,FULLSCREEN_CHANGE:$N,LOADED_DATA:AN,LOAD_START:NN,MINI_STATE_CHANGE:JN,PAUSE:TN,PIP_CHANGE:nj,PLAY:kN,PLAYER_BLUR:UN,PLAYER_FOCUS:BN,PLAYING:wN,PLAYNEXT:oj,PROGRESS:RN,RATE_CHANGE:MN,READY:HN,REPLAY:WN,RESET:cj,RETRY:"retry",ROTATE:ij,SCREEN_SHOT:rj,SEEKED:xN,SEEKING:CN,SEI_PARSED:ej,SHORTCUT:aj,STALLED:"stalled",STATS_EVENTS:hj,SUSPEND:"suspend",SWITCH_SUBTITLE:"switch_subtitle",TIME_UPDATE:ON,URL_CHANGE:qN,URL_NULL:FN,USER_ACTION:lj,VIDEO_EVENTS:uj,VIDEO_RESIZE:tj,VOLUME_CHANGE:DN,WAITING:PN,XGLOG:sj},Symbol.toStringTag,{value:"Module"}));function pj(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}function gj(e,t){return function(n,i){var r={player:t,eventName:e,originalEvent:n,detail:n.detail||{},timeStamp:n.timeStamp,currentTime:t.currentTime,duration:t.duration,paused:t.paused,ended:t.ended,isInternalOp:!!t._internalOp[n.type],muted:t.muted,volume:t.volume,host:cN.getHostFromUrl(t.currentSrc),vtype:t.vtype};if(t.removeInnerOP(n.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=i||t.video.error),t.mediaEventMiddleware[e]){var a=pj.bind(t,e,r);try{t.mediaEventMiddleware[e].call(t,r,a)}catch(s){throw pj.call(t,e,r),s}}else pj.call(t,e,r)}}var vj=function(e){CM(n,e);var t=LM(n);function n(e){var i;wM(this,n),(i=t.call(this,e))._hasStart=!1,i._currentTime=0,i._duration=0,i._internalOp={},i._lastMuted=!1,i.vtype="MP4",i._rate=-1,i.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"},e.videoConfig,e.videoAttributes);var r=e["x5-video-player-type"]||e.x5VideoPlayerType;return vN.isWeixin&&vN.os.isAndroid&&r&&(i.mediaConfig["x5-video-player-type"]=r,delete i.mediaConfig.playsinline,delete i.mediaConfig["webkit-playsinline"],delete i.mediaConfig["x5-playsinline"]),e.loop&&(i.mediaConfig.loop="loop"),i.media=cN.createDom(i.mediaConfig.mediaType,"",i.mediaConfig,""),e.defaultPlaybackRate&&(i.media.defaultPlaybackRate=i.media.playbackRate=e.defaultPlaybackRate),"Number"===cN.typeOf(e.volume)&&(i.volume=e.volume),e.autoplayMuted&&(i.media.muted=!0,i._lastMuted=!0),e.autoplay&&(i.media.autoplay=!0),i._interval={},i.mediaEventMiddleware={},i.attachVideoEvents(),i}return TM(n,[{key:"setEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(n){t.mediaEventMiddleware[n]=e[n]}))}},{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=uj.map((function(t){var n="on".concat(t.charAt(0).toUpperCase()).concat(t.slice(1));return"function"==typeof e[n]&&e.on(t,e[n]),SM({},t,gj(t,e))}))),this._evHandlers.forEach((function(e){var n=Object.keys(e)[0];t.addEventListener(n,e[n],!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 n=Object.keys(e)[0];t.removeEventListener(n,e[n],!1)})),this._evHandlers.forEach((function(t){var n=Object.keys(t)[0],i="on".concat(n.charAt(0).toUpperCase()).concat(n.slice(1));"function"==typeof e[i]&&e.off(n,e[i])})),this._evHandlers=null}},{key:"_attachSourceEvents",value:function(e,t){var n=this;e.removeAttribute("src"),e.load(),t.forEach((function(e){n.media.appendChild(cN.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||"")}))}));var i=e.children;if(i){this._videoSourceCount=i.length;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){if(n._videoSourceCount--,0===n._videoSourceCount){var t={code:4,message:"sources load error"};r?r.error(e,t):n.errorHandler("error",t)}});for(var a=0;a<i.length;a++)i[a].addEventListener("error",this._sourceError)}}},{key:"_detachSourceEvents",value:function(e){var t=e.children;if(t&&0!==t.length&&this._sourceError){for(var n=0;n<t.length;n++)t[n].removeEventListener("error",this._sourceError);for(;t.length>0;)e.removeChild(t[0])}}},{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 n=this.media.error||t,i=n.code?mN[n.code]:"other";n.message;this.media.currentSrc||(n={code:6,message:"empty_src"}),this.emit(e,new bN(this,{errorType:i,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{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 n=this.media.currentTime;if(e)for(var i=0,r=e.length;i<r&&(t[0]=e.start(i),t[1]=e.end(i),!(t[0]<=n&&n<=t[1]));i++);return t[0]-n<=0&&n-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?cN.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 n=0;n<t.length;n++)if((t.start(n)<=this.currentTime||t.start(n)<.1)&&t.end(n)>=this.currentTime)return{start:t.start(n),end:t.end(n)};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(qN,e),this.emit(PN),this._currentTime=0,this._duration=0,/^blob/.test(this.media.currentSrc)||/^blob/.test(this.media.src)?this.onWaiting():(this._detachSourceEvents(this.media),"Array"===cN.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:"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 i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=AM(xM(n.prototype),"emit",this)).call.apply(i,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=AM(xM(n.prototype),"on",this)).call.apply(i,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=AM(xM(n.prototype),"once",this)).call.apply(i,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=AM(xM(n.prototype),"off",this)).call.apply(i,[this,e,t].concat(o))}},{key:"offAll",value:function(){AM(xM(n.prototype),"removeAllListeners",this).call(this)}}]),n}(BM),yj=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"}};wM(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return TM(e,[{key:"openDB",value:function(e){var t=this,n=this,i=this.myDB.version||1,r=n.indexedDB.open(n.myDB.name,i);r.onerror=function(e){},r.onsuccess=function(i){t.myDB.db=i.target.result,e.call(n)},r.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(n.myDB.ojstore.name)||t.createObjectStore(n.myDB.ojstore.name,{keyPath:n.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 n,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(n=i.add(t[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var n,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(n=i.put(t[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,n){var i=this,r=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);r.onerror=function(){n.call(i,null)},r.onsuccess=function(e){var t=e.target.result;n.call(i,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}(),mj=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],_j=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],bj=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],kj="data-xgplayerid";function wj(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];var a=t.call.apply(t,[e].concat(r));n&&"function"==typeof n&&(a&&a.then?a.then((function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];n.call.apply(n,[e].concat(i))})):n.call.apply(n,[e].concat(r)))}function Ej(e,t){var n=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 i=arguments,r=this;if(n.pre)try{var o;(o=n.pre).call.apply(o,[this].concat(Array.prototype.slice.call(arguments)))}catch(xX){throw xX.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(xX.message),xX}if(this.__hooks&&this.__hooks[e])try{var a,s=(a=this.__hooks[e]).call.apply(a,[this,this].concat(Array.prototype.slice.call(arguments)));s?s.then?s.then((function(e){!1!==e&&wj.apply(void 0,[r,t,n.next].concat(MM(i)))})).catch((function(e){throw e})):wj.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments))):void 0===s&&wj.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}catch(xX){throw xX.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(xX.message),xX}else wj.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function Tj(e,t){var n=this.__hooks;if(n)return n.hasOwnProperty(e)?(n&&(n[e]=t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function Sj(e,t){var n=this.__hooks;n&&delete n[e]}function Cj(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.useHooks&&t.useHooks.apply(t,i)}}function xj(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.removeHooks&&t.removeHooks.apply(t,i)}}}function Oj(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 Pj(e){e.__hooks=null}function Ij(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];if(!e.__hooks||!e.__hooks[t])return n.call.apply(n,[e,e].concat(r));var a,s=(a=e.__hooks[t]).call.apply(a,[e,e].concat(r));if(s&&s.then)s.then((function(t){return!1===t?null:n.call.apply(n,[e,e].concat(r))})).catch((function(e){console.warn("[runHooks]".concat(t," reject"),e.message)}));else if(!1!==s)return n.call.apply(n,[e,e].concat(r))}function Lj(e,t){sN.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}var Dj=function(){function e(t){wM(this,e),cN.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),Oj(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return TM(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=cN.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 n=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):Array.isArray(e)&&e.forEach((function(e){n.__events[e]=t,n.player.on(e,t)})):Lj(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):Array.isArray(e)&&e.forEach((function(i){n.__onceEvents[i]=t,n.player.once(e,t)})):Lj(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):Array.isArray(e)&&e.forEach((function(i){delete n.__events[e],n.player.off(i,t)})):Lj(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e=this;["__events","__onceEvents"].forEach((function(t){Object.keys(e[t]).forEach((function(n){e[t][n]&&e.off(n,e[t][n]),n&&delete e[t][n]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t;if(this.player){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=this.player).emit.apply(t,[e].concat(i))}}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var i=bM(bM({},n),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,i)}}},{key:"hook",value:function(e,t){return Ej.call.apply(Ej,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return Tj.call.apply(Tj,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return Sj.call.apply(Sj,[this].concat(Array.prototype.slice.call(arguments)))}},{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]:"";if(this.player)return n&&(t.pluginName=n),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,n=this.pluginName;this.offAll(),cN.clearAllTimers(this),cN.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(n),Pj(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&Object.defineProperty(e,n,t[n])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}();if("undefined"!=typeof Element&&!Element.prototype.matches){var Aj=Element.prototype;Aj.matches=Aj.matchesSelector||Aj.mozMatchesSelector||Aj.msMatchesSelector||Aj.oMatchesSelector||Aj.webkitMatchesSelector}var Mj=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function Rj(e,t,n,i,r){var o=Nj.apply(this,arguments);return e.addEventListener(n,o,r),{destroy:function(){e.removeEventListener(n,o,r)}}}function Nj(e,t,n,i){return function(n){n.delegateTarget=Mj(n.target,t),n.delegateTarget&&i.call(e,n)}}var jj=function(e,t,n,i,r){return"function"==typeof e.addEventListener?Rj.apply(null,arguments):"function"==typeof n?Rj.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return Rj(e,t,n,i,r)})))},Bj={CONTROLS:"controls",ROOT:"root"},Uj={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"};function Hj(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function Fj(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=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 cN.addClass(e,n),Object.keys(i).map((function(t){e.setAttribute(t,i[t])})),e;if(Hj(e)||Hj(e.url))return i.src=Hj(e)?e:e.url||"",o=cN.createDom(e.tag||"img","",i,"xg-img ".concat(n));if("function"==typeof e)try{return(o=e())instanceof window.Element?(cN.addClass(o,n),Object.keys(i).map((function(e){o.setAttribute(e,i[e])})),o):(sN.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(xX){return sN.logError("Plugin named [".concat(r,"]:createIcon"),xX),null}return"string"==typeof e?cN.createDomFromHtml(e,i,n):(sN.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function Gj(e,t){var n=t.config.icons||t.playerConfig.icons;Object.keys(e).map((function(i){var r=e[i],o=r&&r.class?r.class:"",a=r&&r.attr?r.attr:{},s=null;n&&n[i]&&(o=function(e,t){return"object"===kM(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(n[i],o),a=function(e,t){return"object"===kM(e)&&e.attr&&"object"===kM(e.attr)&&Object.keys(e.attr).map((function(n){t[n]=e.attr[n]})),t}(n[i],a),s=Fj(n[i],i,o,a,t.pluginName)),!s&&r&&(s=Fj(r.icon?r.icon:r,a,o,{},t.pluginName)),t.icons[i]=s}))}var Vj=function(e){CM(n,e);var t=LM(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return wM(this,n),(e=t.call(this,i)).__delegates=[],e}return TM(n,[{key:"__init",value:function(e){if(AM(xM(n.prototype),"__init",this).call(this,e),e.root){var t=e.root,i=null;this.icons={},this.root=null,this.parent=null,Gj(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,n=o.i18n;return n[e]?n[e]:r[e]&&r[e][t]||""}})}));var s="";try{s=this.render()}catch(xX){throw sN.logError("Plugin:".concat(this.pluginName,":render"),xX),new Error("Plugin:".concat(this.pluginName,":render:").concat(xX.message))}if(s)(i=n.insert(s,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(i=cN.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(i)}this.root=i,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"===kM(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(n){var i,r,o=n,a=t[o],s={root:e.root};"function"==typeof a?(i=e.config[o]||{},r=a):"object"===kM(a)&&"function"==typeof a.plugin&&(i=a.options?cN.deepCopy(e.config[o]||{},a.options):e.config[o]||{},r=a.plugin),s.config=i,void 0!==i.index&&(s.index=i.index),i.root&&(s.root=i.root),e.registerPlugin(r,s,o)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,n=this.i18n,i=this.langText;t&&function e(t,n){for(var i=0;i<t.children.length;i++)t.children[i].children.length>0?e(t.children[i],n):n(t.children[i])}(t,(function(t){var r=t.getAttribute&&t.getAttribute("lang-key");if(r){var o=n[r.toUpperCase()]||i[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]:"",n=this.i18n||{},i=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var r=n[t]||i[t]||"";r&&(e.innerHTML=r)}},{key:"plugins",value:function(){return this._children}},{key:"children",value:function(){return{}}},{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]:"";t.root=t.root||this.root;var r=AM(xM(n.prototype),"registerPlugin",this).call(this,e,t,i);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,i){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=n.delegate.call(this,this.root,e,t,i);this.__delegates=this.__delegates.concat(o)}}},{key:"unbind",value:function(e,t){var n=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){n.unbindEL(e,t)})):this.unbindEL(e,t);else for(var i="".concat(e,"_").concat(t),r=0;r<this.__delegates.length;r++)if(this.__delegates[r].key===i){this.__delegates[r].destroy(),this.__delegates.splice(r,1);break}}},{key:"setStyle",value:function(e,t){var n=this;if(this.root)return"String"===cN.typeOf(e)?this.root.style[e]=t:void("Object"===cN.typeOf(e)&&Object.keys(e).map((function(t){n.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var n=this;if(this.root)return"String"===cN.typeOf(e)?this.root.setAttribute(e,t):void("Object"===cN.typeOf(e)&&Object.keys(e).map((function(t){n.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 n=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,n)}},{key:"unbindEL",value:function(e,t){var n=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,n)}},{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(n){return sN.logError("Plugin:appendChild",n),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)),AM(xM(n.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null}))}}],[{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.children.length,r=Number(n),o=e instanceof window.Node;if(i){for(var a=0,s=null,l="";a<i;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,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(e instanceof window.Node&&"function"==typeof i)if(Array.isArray(n))n.forEach((function(n){var a=jj(e,t,n,i,r);a.key="".concat(t,"_").concat(n),o.push(a)}));else{var a=jj(e,t,n,i,r);a.key="".concat(t,"_").concat(n),o.push(a)}return o}},{key:"ROOT_TYPES",get:function(){return Bj}},{key:"POSITIONS",get:function(){return Uj}}]),n}(Dj),zj=function(){function e(){var t=this;if(wM(this,e),SM(this,"__trigger",(function(e){var n=(new Date).getTime();t.timeStamp=n;for(var i=0;i<e.length;i++)t.__runHandler(e[i].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver(function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return hN(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),dN(e,t,{leading:i,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(xX){console.error(xX)}}return TM(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=e.getAttribute(kj),i=this.__handlers,r=-1,o=0;o<i.length;o++)i[o]&&e===i[o].target&&(r=o);r>-1?this.__handlers[r].handler=t:this.__handlers.push({target:e,handler:t,playerId:n})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)}));try{this.observer&&this.observer.unobserve(e)}catch(xX){}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){for(var t=this.__handlers,n=0;n<t.length;n++)if(t[n]&&e===t[n].target){try{t[n].handler(e)}catch(w7){console.error(w7)}return!0}return!1}}]),e}(),Wj=null;var Kj={pluginGroup:{},init:function(e){var t,n,i=e._pluginInfoId;i||(i=(new Date).getTime(),e._pluginInfoId=i),!e.config.closeResizeObserver&&(t=e.root,n=function(){e.resize()},Wj||(Wj=new zj),Wj.addObserver(t,n)),0===Object.keys(this.pluginGroup).length&&(e.isUserActive=!0),this.pluginGroup[i]={_player:e,_originalOptions:e.config||{},_plugins:{}}},checkPlayerRoot:function(e){if(this.pluginGroup){for(var t=Object.keys(this.pluginGroup),n=0;n<t.length;n++){var i=this.pluginGroup[t[n]]._player;if(i.root===e)return i}return null}return null},formatPluginInfo:function(e,t){var n=null,i=null;return e.plugin&&"function"==typeof e.plugin?(n=e.plugin,i=e.options):(n=e,i={}),t&&(i.config=t||{}),{PLUFGIN:n,options:i}},checkPluginIfExits:function(e,t){for(var n=0;n<t.length;n++)if(e.toLowerCase()===t[n].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(e,t){for(var n=Object.keys(t),i=null,r=0;r<n.length;r++)if(e.toLowerCase()===n[r].toLowerCase()){i=t[n[r]];break}return"Object"===cN.typeOf(i)?{root:i.root,position:i.position}:{}},lazyRegister:function(e,t){var n=this,i=t.timeout||1500;return Promise.race([t.loader().then((function(t){var i;i=t&&t.__esModule?t.default:t,n.register(e,i,t.options)})),new Promise((function(e,t){setTimeout((function(){t(new Error("timeout"))}),i)}))])},register:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var i=e._pluginInfoId;if(i&&this.pluginGroup[i]){this.pluginGroup[i]._plugins||(this.pluginGroup[i]._plugins={});var r=this.pluginGroup[i]._plugins,o=this.pluginGroup[i]._originalOptions;n.player=this.pluginGroup[i]._player;var a=n.pluginName||t.pluginName;if(!a)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported(e.config.mediaType,e.config.codecType)){n.config||(n.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"===cN.typeOf(c)?n.config=Object.assign({},n.config,o[s[l]]):"Boolean"===cN.typeOf(c)&&(n.config.disable=!c);break}t.defaultConfig&&Object.keys(t.defaultConfig).forEach((function(e){void 0===n.config[e]&&(n.config[e]=t.defaultConfig[e])})),n.root?"string"==typeof n.root&&(n.root=e[n.root]):n.root=e.root,n.index=n.config.index||0;try{r[a.toLowerCase()]&&(this.unRegister(i,a.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(a,"] exist, destroy the old instance")));var u=new t(n);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 n=this.pluginGroup[e]._plugins[t];n&&(n.pluginName&&n.__destroy(),delete this.pluginGroup[e]._plugins[t])}catch(xX){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),xX)}},deletePlugin:function(e,t){var n=e._pluginInfoId;n&&this.pluginGroup[n]&&this.pluginGroup[n]._plugins&&delete this.pluginGroup[n]._plugins[t]},getPlugins:function(e){var t=e._pluginInfoId;return t&&this.pluginGroup[t]?this.pluginGroup[t]._plugins:{}},findPlugin:function(e,t){var n=e._pluginInfoId;if(!n||!this.pluginGroup[n])return null;var i=t.toLowerCase();return this.pluginGroup[n]._plugins[i]},beforeInit:function(e){var t=this;function n(e){return e&&e.then?e:new Promise((function(e){e()}))}return new Promise((function(i){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(n(t))}catch(xX){throw a.push(n(null)),xX}})),Promise.all([].concat(a)).then((function(){i()})).catch((function(e){console.error(e),i()}))}else i()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins;Object.keys(n).forEach((function(e){n[e]&&n[e].afterPlayerInit&&n[e].afterPlayerInit()}))}},setLang:function(e,t){var n=t._pluginInfoId;if(n&&this.pluginGroup[n]){var i=this.pluginGroup[n]._plugins;Object.keys(i).forEach((function(t){if(i[t].updateLang)i[t].updateLang(e);else try{i[t].lang=e}catch(w7){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,n=e._pluginInfoId;if(n&&this.pluginGroup[n]){var i=[],r=this.pluginGroup[n]._plugins;Object.keys(r).forEach((function(e){"controls"!==e&&r[e]&&(i.push({plugin:r[e].func,options:r[e].__args}),t.unRegister(n,e))})),i.forEach((function(n){t.register(e,n.plugin,n.options)}))}},onPluginsReady:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins||{};Object.keys(n).forEach((function(e){n[e].onPluginsReady&&"function"==typeof n[e].onPluginsReady&&n[e].onPluginsReady()}))}},setCurrentUserActive:function(e,t){if(this.pluginGroup[e]){if(!t)return this.pluginGroup[e]._player.isUserActive=t,e;for(var n=Object.keys(this.pluginGroup),i=0;i<n.length;i++){var r=this.pluginGroup[n[i]];r&&r._player&&(this.pluginGroup[n[i]]._player.isUserActive=!1)}return this.pluginGroup[e]._player.isUserActive=t,e}},getCurrentUseActiveId:function(){if(this.pluginGroup){for(var e=Object.keys(this.pluginGroup),t=0;t<e.length;t++){var n=this.pluginGroup[e[t]];if(n&&n._player&&n._player.isUserActive)return e[t]}return null}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){var n,i;n=e.root,Wj.unObserver(n,i);for(var r=this.pluginGroup[t]._plugins,o=0,a=Object.keys(r);o<a.length;o++){var s=a[o];this.unRegister(t,s)}var l=e.isUseActive;if(delete this.pluginGroup[t],delete e._pluginInfoId,l){var c=Object.keys(this.pluginGroup);c.length>0&&this.setCurrentUserActive(c[c.length-1],!0)}}}},qj={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 Yj(){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(){},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,commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}};var e}var $j=function(e){CM(n,e);var t=LM(n);function n(){var e;wM(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return SM(PM(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var n=PM(e),i=n.player;n.playerConfig.closeControlsBlur&&i.focus({autoHide:!1})})),SM(PM(e),"onMouseLeave",(function(){PM(e).player.focus()})),e}return TM(n,[{key:"beforeCreate",value:function(e){e.config.mode||"mobile"!==vN.device||(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.disable,i=t.height,r=t.mode;if(!n){"flex"===r&&this.player.addClass(qj.FLEX_CONTROLS);var o={height:"".concat(i,"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(JN,(function(t){t?cN.addClass(e.root,"mini-controls"):cN.removeClass(e.root,"mini-controls")}));var a=this.playerConfig.isMobileSimulateMode;"mobile"!==vN.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&&cN.addClass(this.root,qj.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){cN.removeClass(this.root,qj.CONTROLS_AUTOHIDE)}},{key:"show",value:function(){cN.addClass(this.root,"show")}},{key:"hide",value:function(){cN.removeClass(this.root,"show")}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;if(this.root){var r=e.defaultConfig||{};if(!t.root){var o=t.position?t.position:t.config&&t.config.position?t.config.position:r.position;switch(o){case Uj.CONTROLS_LEFT:t.root=this.left;break;case Uj.CONTROLS_RIGHT:t.root=this.right;break;case Uj.CONTROLS_CENTER:t.root=this.center;break;case Uj.CONTROLS:t.root=this.root;break;default:t.root=this.left}return AM(xM(n.prototype),"registerPlugin",this).call(this,e,t,i)}}}},{key:"destroy",value:function(){"mobile"!==vN.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave))}},{key:"render",value:function(){var e=this.config,t=e.mode,n=e.autoHide,i=e.initShow;if(!e.disable){var r=cN.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},SM({},qj.CONTROLS_AUTOHIDE,n),{"xgplayer-controls-initshow":i||!n});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}}}]),n}(Vj),Xj={lang:{},langKeys:[],textKeys:[]};function Jj(e,t){return Object.keys(t).forEach((function(n){var i,r=cN.typeOf(t[n]),o=cN.typeOf(e[n]);"Array"===r?("Array"!==o&&(e[n]=[]),(i=e[n]).push.apply(i,MM(t[n]))):"Object"===r?("Object"!==o&&(e[n]={}),Jj(e[n],t[n])):e[n]=t[n]})),e}function Zj(){Object.keys(Xj.lang.en).map((function(e){Xj.textKeys[e]=e}))}function Qj(e,t){var n=e.LANG;if(t||(t=Xj),t.lang){var i=e.TEXT||{};"zh"===n&&(n="zh-cn"),t.lang[n]?Jj(t.lang[n],i):(t.langKeys.push(n),t.lang[n]=i),Zj()}}Qj({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 eB={get textKeys(){return Xj.textKeys},get langKeys(){return Xj.langKeys},get lang(){var e={};return Xj.langKeys.map((function(t){e[t]=Xj.lang[t]})),Xj.lang["zh-cn"]&&(e.zh=Xj.lang["zh-cn"]||{}),e},extend:function(e,t){var n=[];if(t||(t=Xj),t.lang){n="Array"!==cN.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e;var i=t.lang;n.map((function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),i[e.LANG]?Jj(i[e.LANG]||{},e.TEXT||{}):Qj(e,t)})),Zj()}},use:Qj,init:function(e){var t,n={lang:{},langKeys:[],textKeys:{},pId:e};return Jj(n.lang,Xj.lang),(t=n.langKeys).push.apply(t,MM(Xj.langKeys)),Jj(n.textKeys,Xj.textKeys),n}},tB={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7,DESTROYED:8},nB=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],iB=["play","pause","replay","retry"],rB=0,oB=0,aB=function(e){CM(n,e);var t=LM(n);function n(e){var i;wM(this,n);var r,o=cN.deepMerge(Yj(),e);SM(PM(i=t.call(this,o)),"canPlayFunc",(function(){if(i.config){var e=i.config,t=e.autoplay,n=e.startTime,r=e.defaultPlaybackRate;sN.logInfo("player","canPlayFunc, startTime",n),n&&(i.currentTime=n>i.duration?i.duration:n,i.config.startTime=0),i.playbackRate=r,(t||i._useAutoplay)&&i.mediaPlay(),i.off(IN,i.canPlayFunc),i.removeClass(qj.ENTER)}})),SM(PM(i),"onFullscreenChange",(function(e,t){var n=function(){cN.setTimeout(PM(i),(function(){i.resize()}),100)},r=cN.getFullScreenEl();i._fullActionFrom?i._fullActionFrom="":i.emit(lj,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:i.currentTime,duration:i.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=function(e,t,n){if(e){var i=e.getAttribute(n);return!(!i||i!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}}(r,i.playerId,kj);if(t||r&&(r===i._fullscreenEl||o))n(),!i.config.closeFocusVideoFocus&&i.media.focus(),i.fullscreen=!0,i.changeFullStyle(i.root,r,qj.FULLSCREEN),i.emit($N,!0,i._fullScreenOffset),i.cssfullscreen&&i.exitCssFullscreen();else if(i.fullscreen){n();var a=PM(i),s=a._fullScreenOffset;a.config.needFullscreenScroll?(window.scrollTo(s.left,s.top),cN.setTimeout(PM(i),(function(){i.fullscreen=!1,i._fullScreenOffset=null}),100)):(!i.config.closeFocusVideoFocus&&i.media.focus(),i.fullscreen=!1,i._fullScreenOffset=null),i.cssfullscreen?i.removeClass(qj.FULLSCREEN):i.recoverFullStyle(i.root,i._fullscreenEl,qj.FULLSCREEN),i._fullscreenEl=null,i.emit($N,!1)}})),SM(PM(i),"_onWebkitbeginfullscreen",(function(e){i._fullscreenEl=i.media,i.onFullscreenChange(e,!0)})),SM(PM(i),"_onWebkitendfullscreen",(function(e){i.onFullscreenChange(e,!1)})),Oj(PM(i),iB),i.config=o,i._pluginInfoId=cN.generateSessionId(),(r=PM(i)).logInfo=sN.logInfo.bind(r),r.logWarn=sN.logWarn.bind(r),r.logError=sN.logError.bind(r);var a=i.constructor.defaultPreset;if(i.config.presets.length){var s=i.config.presets.indexOf("default");s>=0&&a&&(i.config.presets[s]=a)}else a&&i.config.presets.push(a);if(i.userTimer=null,i.waitTimer=null,i._state=tB.INITIAL,i.isError=!1,i._hasStart=!1,i.isSeeking=!1,i.isCanplay=!1,i._useAutoplay=!1,i.rotateDeg=0,i.isActive=!1,i.fullscreen=!1,i.cssfullscreen=!1,i.isRotateFullscreen=!1,i._fullscreenEl=null,i._cssfullscreenEl=null,i.curDefinition=null,i._orgCss="",i._fullScreenOffset=null,i._videoHeight=0,i._videoWidth=0,i._accPlayed={t:0,acc:0,loopAcc:0},i.innerContainer=null,i.controls=null,i.topBar=null,i.root=null,i.__i18n=eB.init(i._pluginInfoId),vN.os.isAndroid&&vN.osVersion>0&&vN.osVersion<6&&(i.config.autoplay=!1),i.database=new yj,i.isUserActive=!1,i._onceSeekCanplay=null,i._isPauseBeforeSeek=0,!i._initDOM())return console.error(new Error("can't find the dom which id is ".concat(i.config.id," or this.config.el does not exist"))),IM(i);var l=i.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]),i.config.url=h.url,i.curDefinition=h}return i._bindEvents(),i._registerPresets(),i._registerPlugins(),Kj.onPluginsReady(PM(i)),i.getInitDefinition(),i.setState(tB.READY),cN.setTimeout(PM(i),(function(){i.emit(HN)}),0),i.onReady&&i.onReady(),(i.config.videoInit||i.config.autoplay)&&(!i.hasStart||i.state<tB.ATTACHED)&&i.start(),i}return TM(n,[{key:"_initDOM",value:function(){var e=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var t=this.config.el;if(!t||1!==t.nodeType)return this.emit(SN,new bN("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=t}var n=Kj.checkPlayerRoot(this.root);n&&(sN.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),n.destroy()),this.root.setAttribute(kj,this.playerId),Kj.init(this),this._initBaseDoms();var i=this.constructor.XgVideoProxy;if(i&&this.mediaConfig.mediaType===i.mediaType){var r=this.innerContainer||this.root;this.detachVideoEvents(this.media);var o=new i(r,this.config,this.mediaConfig);this.attachVideoEvents(o),this.media=o}if(this.media.setAttribute(kj,this.playerId),this.config.controls){var a=this.config.controls.root||null,s=Kj.register(this,$j,{root:a});this.controls=s}var l="mobile"===this.config.isMobileSimulateMode?"mobile":vN.device;if(this.addClass("".concat(qj.DEFAULT," ").concat(qj.INACTIVE," xgplayer-").concat(l," ").concat(this.config.controls?"":qj.NO_CONTROLS)),this.config.autoplay?this.addClass(qj.ENTER):this.addClass(qj.NO_START),this.config.fluid){var c=this.config,u=c.width,h=c.height;"number"==typeof u&&"number"==typeof h||(u=600,h=337.5);var d={width:"100%",height:"0","max-width":"100%","padding-top":"".concat(100*h/u,"%")};Object.keys(d).forEach((function(t){e.root.style[t]=d[t]}))}else["width","height"].forEach((function(t){e.config[t]&&("number"!=typeof e.config[t]?e.root.style[t]=e.config[t]:e.root.style[t]="".concat(e.config[t],"px"))}));return!0}},{key:"_initBaseDoms",value:function(){this.topBar=null,this.leftBar=null,this.rightBar=null,this.config.marginControls&&(this.innerContainer=cN.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)])})),mj.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),vN.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(AN,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once(kN,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),mj.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off(kN,this.playFunc),this.off(IN,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_startInit",value:function(e){var t=this;if(this.media&&(e&&""!==e&&("Array"!==cN.typeOf(e)||0!==e.length)||(e="",this.emit(FN),sN.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this._detachSourceEvents(this.media),"Array"===cN.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"===cN.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 i=this.media.readyState;sN.logInfo("_startInit readyState",i),this.config.autoplay&&(!/^blob/.test(this.media.currentSrc)&&!/^blob/.test(this.media.src)&&this.load(),(vN.os.isIpad||vN.os.isPhone)&&this.mediaPlay()),i>=2?this.canPlayFunc():this.once(IN,this.canPlayFunc),(!this.hasStart||this.state<tB.ATTACHED)&&Kj.afterInit(this),this.hasStart=!0,this.setState(tB.ATTACHED),cN.setTimeout(this,(function(){t.emit(zN)}),0)}}},{key:"_registerPlugins",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._loadingPlugins=[];var n=this.config.ignores||[],i=this.config.plugins||[],r=this.config.i18n||[];t&&eB.extend(r,this.__i18n);var o=n.join("||").toLowerCase().split("||"),a=this.plugins;i.forEach((function(n){try{var i=n.plugin?n.plugin.pluginName:n.pluginName;if(i&&o.indexOf(i.toLowerCase())>-1)return null;if(!t&&a[i.toLowerCase()])return;if(n.lazy&&n.loader){var r=Kj.lazyRegister(e,n);return void(n.forceBeforeInit&&(r.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})).catch((function(t){sN.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})),e._loadingPlugins.push(r)))}return e.registerPlugin(n)}catch(s){sN.logError("_registerPlugins:",s)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var n,i,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=[]),(n=e.config.plugins).push.apply(n,MM(a)),(i=e.config.ignores).push.apply(i,MM(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,MM(f)),e.config.i18n=d}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case Uj.ROOT_RIGHT:this.rightBar||(this.rightBar=cN.createPositionBar("xg-right-bar",this.root)),t=this.rightBar;break;case Uj.ROOT_LEFT:this.leftBar||(this.leftBar=cN.createPositionBar("xg-left-bar",this.root)),t=this.leftBar;break;case Uj.ROOT_TOP:this.topBar||(this.topBar=cN.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&cN.addClass(this.topBar,qj.TOP_BAR_AUTOHIDE)),t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var n=Kj.formatPluginInfo(e,t),i=n.PLUFGIN,r=n.options,o=this.config.plugins;!Kj.checkPluginIfExits(i.pluginName,o)&&o.push(i);var a=Kj.getRootByConfig(i.pluginName,this.config);a.root&&(r.root=a.root),a.position&&(r.position=a.position);var s=r.position?r.position:r.config&&r.config.position||i.defaultConfig&&i.defaultConfig.position;return!r.root&&"string"==typeof s&&s.indexOf("controls")>-1?this.controls&&this.controls.registerPlugin(i,r,i.pluginName):(r.root||(r.root=this._getRootByPosition(s)),Kj.register(this,i,r))}},{key:"deregister",value:function(e){"string"==typeof e?Kj.unRegister(this,e):e instanceof Dj&&Kj.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 Dj&&(t=e.pluginName),t)for(var n=this.config.plugins.length-1;n>-1;n--){if(this.config.plugins[n].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(n,1);break}}}},{key:"plugins",get:function(){return Kj.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=Kj.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(cN.hasClass(this.root,e)||cN.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&cN.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return cN.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>tB.ATTACHING))return e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this.setState(tB.ATTACHING),this._registerPlugins(!1),Kj.beforeInit(this).then((function(){if(t.config)return e||(e=t.url||t.config.url),t._startInit(e)})).catch((function(e){throw e.fileName="player",e.lineNumber="236",sN.logError("start:beforeInit:",e),e}))}},{key:"switchURL",value:function(e,t){var n=this,i=e;"Object"===cN.typeOf(e)&&(i=e.url);var r=this.currentTime,o=this.paused&&!this.isError;return this.src=i,new Promise((function(e){var t=function(){n.currentTime=r,o&&n.once("canplay",(function(){n.pause()})),e()};vN.os.isAndroid?n.once("timeupdate",(function(){t()})):n.once("canplay",(function(){t()})),n.play()}))}},{key:"videoPlay",value:function(){this.mediaPlay()}},{key:"mediaPlay",value:function(){var e=this;if(!this.hasStart&&this.state<tB.ATTACHED)return this.removeClass(qj.NO_START),this.addClass(qj.ENTER),this.start(),void(this._useAutoplay=!0);this.state<tB.RUNNING&&(this.removeClass(qj.NO_START),!this.isCanplay&&this.addClass(qj.ENTER));var t=AM(xM(n.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(qj.NOT_ALLOW_AUTOPLAY),e.addClass(qj.PLAYING),e.state<tB.RUNNING&&(sN.logInfo(">>>>playPromise.then"),e.setState(tB.RUNNING),e.emit(GN))})).catch((function(t){if(sN.logWarn(">>>>playPromise.catch",t.name),e.media&&e.media.error)return e.onError(),void e.removeClass(qj.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=cN.setTimeout(e,(function(){e._errorTimer=null,e.emit(VN),e.addClass(qj.NOT_ALLOW_AUTOPLAY),e.removeClass(qj.ENTER),e.pause(),e.setState(tB.NOTALLOW)}),0))})):(sN.logWarn("video.play not return promise"),this.state<tB.RUNNING&&(this.setState(tB.RUNNING),this.removeClass(qj.NOT_ALLOW_AUTOPLAY),this.removeClass(qj.NO_START),this.removeClass(qj.ENTER),this.addClass(qj.PLAYING),this.emit(GN))),t}},{key:"mediaPause",value:function(){AM(xM(n.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){AM(xM(n.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(qj.PAUSED),Ij(this,"play",(function(){return e.mediaPlay()}))}},{key:"pause",value:function(){var e=this;Ij(this,"pause",(function(){AM(xM(n.prototype),"pause",e).call(e)}))}},{key:"seek",value:function(e,t){var n=this;if(this.media&&!Number.isNaN(Number(e)||!this.hasStart)){var i=this.config,r=i.isSeekedPlay,o=i.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(IN,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(n.removeClass(qj.ENTER),n.isSeeking=!1,a){case"play":n.play();break;case"pause":n.pause();break;default:n._isPauseBeforeSeek>1||n.paused?n.pause():n.play()}n._isPauseBeforeSeek=0,n._onceSeekCanplay=null},this.once(IN,this._onceSeekCanplay),this.state<tB.RUNNING?(this.removeClass(qj.NO_START),this.addClass(qj.ENTER),this.currentTime=e,this.play()):this.currentTime=e}}},{key:"getInitDefinition",value:function(){var e=this,t=this.config,n=t.definition;!t.url&&n&&n.list&&n.list.length>0&&n.defaultDefinition&&n.list.map((function(t){t.definition===n.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t)}))}},{key:"changeDefinition",value:function(e,t){var n=this,i=this.config.definition;if(Array.isArray(null==i?void 0:i.list)&&i.list.forEach((function(t){(null==e?void 0:e.definition)===t.definition&&(n.curDefinition=t)})),null!=e&&e.bitrate&&"number"!=typeof e.bitrate&&(e.bitrate=parseInt(e.bitrate,10)||0),this.emit(ZN,{from:t,to:e}),this.hasStart){var r=this.switchURL(e.url,bM({seamless:!1!==i.seamless&&"undefined"!=typeof MediaSource&&"function"==typeof MediaSource.isTypeSupported},e));r&&r.then?r.then((function(){n.emit(QN,{from:t,to:e})})):this.emit(QN,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(AN,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[qj.NOT_ALLOW_AUTOPLAY,qj.PLAYING,qj.NO_START,qj.PAUSED,qj.REPLAY,qj.ENTER,qj.ENDED,qj.ERROR,qj.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(qj.ENTER),this.emit(cj)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;this.resetState();var i=this.plugins;if(i&&(t.map((function(t){e.deregister(t)})),n)){var r=Yj();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=r[t])}))}}},{key:"destroy",value:function(){var e=this,t=this.innerContainer,i=this.root,r=this.media;if(i&&r){if(this.hasStart=!1,this._useAutoplay=!1,i.removeAttribute(kj),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),cN.clearAllTimers(this),this.emit(KN),Kj.destroy(this),Pj(this),AM(xM(n.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),t)for(var o=t.children,a=0;a<o.length;a++)t.removeChild(o[a]);!t&&r instanceof window.Node&&i.contains(r)&&i.removeChild(r),["topBar","leftBar","rightBar","innerContainer"].map((function(t){e[t]&&i.removeChild(e[t]),e[t]=null}));var s=i.className.split(" ");s.length>0?i.className=s.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):i.className="",this.removeAttribute("data-xgfill"),["isSeeking","isCanplay","isActive","cssfullscreen","fullscreen"].forEach((function(t){e[t]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(qj.ENDED),this.currentTime=0,this.isSeeking=!1,Ij(this,"replay",(function(){e.once(IN,(function(){var t=e.mediaPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.play(),e.emit(WN),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(qj.ERROR),this.addClass(qj.LOADING),Ij(this,"retry",(function(){var t=e.currentTime;e.src=e.config.url,!e.config.isLive&&(e.currentTime=t),e.once(IN,(function(){e.mediaPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,n,i){e&&(i||(i=qj.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=cN.filterStyleFromText(e)),cN.addClass(e,n),t&&t!==e&&!this._orgPCss&&(this._orgPCss=cN.filterStyleFromText(t),cN.addClass(t,i),t.setAttribute(kj,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,n,i){i||(i=qj.PARENT_FULLSCREEN),this._orgCss&&(cN.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),cN.removeClass(e,n),t&&t!==e&&this._orgPCss&&(cN.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",cN.removeClass(t,i),t.removeAttribute(kj))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,n=this.media;e||(e=t),this._fullScreenOffset={top:cN.scrollTop(),left:cN.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get";var i=cN.getFullScreenEl();if(i!==this._fullscreenEl)try{for(var r=0;r<_j.length;r++){var o=_j[r];if(e[o]){var a="webkitRequestFullscreen"===o?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[o]();return a&&a.then?a:Promise.resolve()}}return n.fullscreenEnabled||n.webkitSupportsFullscreen?(n.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(s){return Promise.reject(new Error("call getFullscreen fail"))}else this.onFullscreenChange()}},{key:"exitFullscreen",value:function(e){if(this.isRotateFullscreen&&this.exitRotateFullscreen(),this._fullscreenEl||cN.getFullScreenEl()){this.root;var t=this.media;this._fullActionFrom="exit";try{for(var n=0;n<bj.length;n++){var i=bj[n];if(document[i]){var r=document[i]();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(qj.INNER_FULLSCREEN," ").concat(qj.CSS_FULLSCREEN):qj.CSS_FULLSCREEN;this.changeFullStyle(this.root,e,t);var n=this.config.fullscreen,i=void 0===n?{}:n,r=!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.useCssFullscreen();r&&(this.fullscreen=!0,this.emit($N,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(XN,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(qj.INNER_FULLSCREEN," ").concat(qj.CSS_FULLSCREEN):qj.CSS_FULLSCREEN;if(this.fullscreen){var t=this.config.fullscreen,n=void 0===t?{}:t;!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen()?(this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this.fullscreen=!1,this.emit($N,!1)):this.removeClass(e)}else this.recoverFullStyle(this.root,this._cssfullscreenEl,e);this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(XN,!1)}},{key:"getRotateFullscreen",value:function(e){this.cssfullscreen&&this.exitCssFullscreen(e);var t=e?"".concat(qj.INNER_FULLSCREEN," ").concat(qj.ROTATE_FULLSCREEN):qj.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,t,qj.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!0,this.fullscreen=!0,this.setRotateDeg(90),this.emit($N,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this._fullscreenEl!==this.root?"".concat(qj.INNER_FULLSCREEN," ").concat(qj.ROTATE_FULLSCREEN):qj.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,t,qj.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit($N,!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(BN,bM({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.emit(UN,bM({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]:{},n=t.autoHide,i=void 0===n?!this.config.closePlayerBlur:n,r=t.delay,o=void 0===r?this.config.inactive:r;this.isActive=!0,this.removeClass(qj.INACTIVE),this.userTimer&&(cN.clearTimeout(this,this.userTimer),this.userTimer=null),i?this.userTimer=cN.setTimeout(this,(function(){e.userTimer=null,e.blur()}),o):this.userTimer&&(cN.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"onBlur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ignorePaused,n=void 0!==t&&t;if(this.isActive){var i=this.config.closePauseVideoFocus;this.isActive=!1,(n||i||!this.paused&&!this.ended)&&this.addClass(qj.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(qj.ENTER),this.removeClass(qj.ERROR),this.removeClass(qj.LOADING),this.isCanplay=!0,this.waitTimer&&cN.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1,this.isSeeking=!1}},{key:"onLoadstart",value:function(){this.removeClass(qj.ERROR),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===tB.ENDED&&this.setState(tB.RUNNING),this.removeClass(qj.PAUSED),this.ended&&this.removeClass(qj.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(qj.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this.userTimer&&(cN.clearTimeout(this,this.userTimer),this.userTimer=null),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(qj.ENDED),this.setState(tB.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(qj.NOT_ALLOW_AUTOPLAY),this.removeClass(qj.NO_START),this.removeClass(qj.ENTER),this.removeClass(qj.LOADING),this.addClass(qj.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(qj.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&cN.clearTimeout(this,this.waitTimer),this.removeClass(qj.LOADING),this.removeClass(qj.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&cN.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=cN.setTimeout(this,(function(){e.addClass(qj.LOADING),cN.clearTimeout(e,e.waitTimer),e.waitTimer=null}),200)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[qj.NO_START,qj.PAUSED,qj.ENDED,qj.ERROR,qj.REPLAY,qj.LOADING].forEach((function(t){e.removeClass(t)}))}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.resize(),(this.waitTimer||this.hasClass(qj.LOADING))&&this.media.readyState>2&&(this.removeClass(qj.LOADING),cN.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state<tB.RUNNING&&this.duration&&(this.setState(tB.RUNNING),this.emit(GN)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===cN.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"emitUserAction",value:function(e,t,n){if(this.media&&t&&e){var i="String"===cN.typeOf(e)?e:e.type||"";n.props&&"Array"!==cN.typeOf(n.props)&&(n.props=[n.props]),this.emit(lj,bM({eventType:i,action:t,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},n))}}},{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=this.media.buffered;if(!t||0===t.length||!this.duration)return!0;for(var n=e||this.media.currentTime||.2,i=t.length,r=0;r<i;r++)if(t.start(r)<=n&&t.end(r)>n)return!0;return!1}},{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=1/e.h,n=1!==t?"scale(".concat(t,")"):"",i=0,r=0;e.y&&(r=(100-100*e.h)/2-100*e.y),e.w&&e.x&&(i=(100-100*e.w)/2-100*e.x),n+=" translate(".concat(i,"%, ").concat(r,"%)"),this.media.style.transform=n,this.media.style.webkitTransform=n}}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(n){if("plugins"!==n){t.config[n]=e[n];var i=t.plugins[n.toLowerCase()];i&&"Function"===cN.typeOf(i.setConfig)&&i.setConfig(e[n])}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this.setConfig(e),this._currentTime=0,this._duration=0,Ij(this,"playnext",(function(){t.start(),t.emit(oj,e)}))}},{key:"resize",value:function(){var e=this;if(this.media){var t=this.media,n=t.videoWidth,i=t.videoHeight,r=this.config,o=r.fitVideoSize,a=r.videoFillMode;if("fill"!==a&&"cover"!==a||this.setAttribute("data-xgfill",a),i&&n){this._videoHeight=i,this._videoWidth=n;var s=this.root.getBoundingClientRect(),l=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,c=s.width,u=s.height-l,h=parseInt(n/i*1e3,10),d=parseInt(c/u*1e3,10),f=c,p=u,g={};"auto"===o&&d>h||"fixWidth"===o?(p=c/h*1e3,this.config.fluid?g.paddingTop="".concat(100*p/f,"%"):g.height="".concat(p+l,"px")):("auto"===o&&d<h||"fixHeight"===o)&&(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"===a&&d<h||"fillWidth"===a&&d>h)&&this.setAttribute("data-xgfill","cover");var v={videoScale:h,vWidth:f,vHeight:p,cWidth:f,cHeight:p+l};this.emit(tj,v)}}}},{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){sN.logInfo("setState","state from:".concat(nB[this.state]," to:").concat(nB[e])),this._state=e}},{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(tB.READY),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===tB.RUNNING||this._state===tB.ENDED},set:function(e){e?this.setState(tB.RUNNING):this._state>=tB.RUNNING&&this.setState(tB.ATTACHED)}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,n=this.config.definition,i=null,r=null;n.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&&(i=e),n.defaultDefinition===e.definition&&(r=e)})),!r&&e.length>0&&(r=e[0]),i?this.changeDefinition(i):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){0!==eB.langKeys.filter((function(t){return t===e})).length||"zh"===e?(this.config.lang=e,Kj.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(eB.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 yN}},{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 AM(xM(n.prototype),"readyState",this)}},{key:"error",get:function(){var e=AM(xM(n.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return AM(xM(n.prototype),"networkState",this)}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed;return this.updateAcc("get"),e.acc}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"avgSpeed",get:function(){return oB},set:function(e){oB=e}},{key:"realTimeSpeed",get:function(){return rB},set:function(e){rB=e}},{key:"hook",value:function(e,t){return Ej.call.apply(Ej,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return Tj.call.apply(Tj,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return Sj.call.apply(Sj,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return Cj.call.apply(Cj,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return xj.call.apply(xj,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),this.muted=t),Kj.setCurrentUserActive(this.playerId,e)}}],[{key:"debugger",get:function(){return sN.config.debug},set:function(e){sN.config.debug=e}},{key:"getCurrentUserActivePlayerId",value:function(){return Kj.getCurrentUseActiveId()}},{key:"setCurrentUserActive",value:function(e,t){Kj.setCurrentUserActive(e,t)}},{key:"isHevcSupported",value:function(){return vN.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return vN.probeConfigSupported(e)}},{key:"install",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]||(n.plugins[e]=t)}},{key:"use",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]=t}}]),n}(vj);function sB(){return(new Date).getTime()}SM(aB,"defaultPreset",null),SM(aB,"XgVideoProxy",null);var lB="loadstart",cB="loadeddata",uB="firstFrame",hB="waitingStart",dB="waitingEnd",fB="seekStart",pB="seekEnd",gB=function(e){CM(n,e);var t=LM(n);function n(){var e;wM(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return SM(PM(e=t.call.apply(t,[this].concat(r))),"_onTimeupdate",(function(){e._state.isTimeUpdate=!0,e._state.autoplayStart&&(sN.logInfo("[xgLogger]".concat(e.player.playerId," _onTimeupdate")),e._sendFF("onTimeupdate"))})),SM(PM(e),"_onAutoplayStart",(function(){sN.logInfo("[xgLogger]".concat(e.player.playerId," _onAutoplayStart")),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),SM(PM(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=sB(),e.loadedCostTime=0,e.startCostTime=0,e._isSeeking=!1,e.seekingStart=0,e.waitingStart=0,e.fixedWaitingStart=0,e._isWaiting=!1,e._waitTimer&&cN.clearTimeout(PM(e),e._waitTimer),e._waittTimer&&cN.clearTimeout(PM(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),SM(PM(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=sB(),e.emitLog(fB,{start:sB()}))})),SM(PM(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),SM(PM(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=sB(),e.fixedWaitingStart=sB(),e._waitType=1,e.emitLog(hB,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),SM(PM(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=sB(),e._waitTimer=cN.setTimeout(PM(e),(function(){e._isWaiting&&(e.waitingStart=sB(),cN.clearTimeout(PM(e),e._waitTimer),e._waitTimer=null,e._startWaitTimeout(),e.emitLog(hB,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing"}))}),200))})),SM(PM(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),SM(PM(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return TM(n,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=sB(),this.loadedCostTime=0,this.startCostTime=0,this.on(NN,(function(){var t=e._state,n=t.autoplayStart,i=t.isFFSend;e.startCostTime=sB()-e.newPointTime,sN.logInfo("[xgLogger]".concat(e.player.playerId," LOAD_START"),"autoplayStart:".concat(n," isFFSend:").concat(i," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),i||(!t.isLs&&e.emitLog(lB,{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=sB(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())})),this.on(AN,(function(){e.vt=sB(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime;var t=e._state,n=t.isTimeUpdate,i=t.isFFSend,r=t.autoplayStart;sN.logInfo("[xgLogger]".concat(e.player.playerId," LOADED_DATA"),"fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(n||r)&&e._sendFF("loadedData"),i||e.emitLog(cB,{}),e.suspendWaitingStatus("loadeddata")})),this.on(CN,this._onSeeking),this.on(xN,this._onSeeked),this.on(KN,(function(){e.endState("destroy")})),this.on(qN,(function(){e.endState("urlChange"),sN.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()})),this.on([wN,IN],this._onPlaying),this.on(PN,this._onWaiting),this.on(SN,this._onError),this.on(cj,(function(){sN.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()}))}},{key:"_initOnceEvents",value:function(){this.off(GN,this._onAutoplayStart),this.off(ON,this._onTimeupdate),this.once(GN,this._onAutoplayStart),this.once(ON,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=sB();var t=this._state,n=t.isFFLoading,i=t.isFFSend;sN.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(n," !isFFSend:").concat(!i)),this.vt>0&&n&&!i&&(sN.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(uB,{fvt:this.fvt,costTime:this.fvt,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&cN.clearTimeout(this,this._waittTimer),this._waittTimer=cN.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),cN.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=sB(),n=t-this.seekingStart;this.seekingStart=0,this.emitLog(pB,{end:t,costTime:n,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(cN.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(cN.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var t=sB(),n=t-this.waitingStart,i=t-this.fixedWaitingStart,r=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(dB,{fixedCostTime:i>r?r:i,costTime:n>r?r:n,type:"loadeddata"===e?1:this._waitType,endType:2===this._waitType?"seek":e})}}},{key:"emitLog",value:function(e,t){var n=this.player;this.emit(sj,bM({t:sB(),host:cN.getHostFromUrl(n.currentSrc),vtype:n.vtype,eventType:e,currentTime:this.player.currentTime,readyState:n.video.readyState,networkState:n.video.networkState},t))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),n}(Vj);function vB(){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 yB=function(e){CM(n,e);var t=LM(n);function n(){return wM(this,n),t.apply(this,arguments)}return TM(n,[{key:"registerIcons",value:function(){return{replay:vB}}},{key:"afterCreate",value:function(){var e=this;Vj.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(EN,(function(){if(e.playerConfig.loop||cN.addClass(e.player.root,"replay"),!e.config.disable){e.show();var t=e.root.querySelector("path");if(t){var n=window.getComputedStyle(t).getPropertyValue("transform");if("string"==typeof n&&n.indexOf("none")>-1)return null;t.setAttribute("transform",n)}}})),this.on(kN,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),cN.removeClass(this.player.root,"replay")}},{key:"show",value:function(){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}}}]),n}(Vj),mB=function(e){CM(n,e);var t=LM(n);function n(){return wM(this,n),t.apply(this,arguments)}return TM(n,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){cN.addClass(this.root,"hide")}},{key:"show",value:function(){cN.removeClass(this.root,"hide")}},{key:"beforeCreate",value:function(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}},{key:"afterCreate",value:function(){var e=this;this.on(EN,(function(){e.isEndedShow&&cN.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(ON,(function(){e.onTimeUpdate()})),this.on(qN,(function(){cN.removeClass(e.root,"hide"),cN.addClass(e.root,"xg-showplay"),e.once(ON,(function(){e.onTimeUpdate()}))}))):this.on(kN,(function(){cN.addClass(e.root,"hide")}))}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?cN.removeClass(this.root,"xg-showplay"):this.once(ON,(function(){e.onTimeUpdate()}))}},{key:"update",value:function(e){e&&(this.config.poster=e,this.root.style.backgroundImage="url(".concat(e,")"))}},{key:"render",value:function(){var e=this.config,t=e.poster,n=e.hideCanplay,i=t?"background-image:url(".concat(t,");"):"";return'<xg-poster class="xgplayer-poster '.concat(n?"xg-showplay":"",'" style="').concat(i,'">\n </xg-poster>')}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,poster:""}}}]),n}(Vj);function _B(){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 bB(){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 kB={};var wB=function(e){CM(n,e);var t=LM(n);function n(e){var i;return wM(this,n),SM(PM(i=t.call(this,e)),"onPlayerReset",(function(){i.autoPlayStart=!1;var e="auto"===i.config.mode?"auto-hide":"hide";i.setAttr("data-state","play"),cN.removeClass(i.root,e),i.show()})),SM(PM(i),"onAutoplayStart",(function(){if(!i.autoPlayStart){var e="auto"===i.config.mode?"auto-hide":"hide";cN.addClass(i.root,e),i.autoPlayStart=!0,i.onPlayPause("play")}})),i.autoPlayStart=!1,i}return TM(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.playerConfig;this.initIcons(),this.once(HN,(function(){n&&(n.lang&&"en"===n.lang?cN.addClass(t.root,"lang-is-en"):"jp"===n.lang&&cN.addClass(t.root,"lang-is-jp"))})),this.on(GN,this.onAutoplayStart),n.autoplay||this.show(),this.on(VN,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),cN.removeClass(e.root,t),e.show()})),this.on(kN,(function(){e.onPlayPause("play")})),this.on(TN,(function(){e.onPlayPause("pause")})),this.on(cj,(function(){e.onPlayerReset()})),this.clickHandler=this.hook("startClick",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation();var n=e.player.paused;e.emitUserAction(t,"switch_play_pause",{props:"paused",from:n,to:!n})}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:_B,class:"xg-icon-play"},startPause:{icon:bB,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(){cN.addClass(this.root,"hide")}},{key:"show",value:function(){cN.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){cN.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){cN.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;!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};kB[e]&&window.clearTimeout(kB[e].id),kB[e]={},n.start&&n.start(),kB[e].id=window.setTimeout((function(){n.end&&n.end(),window.clearTimeout(kB[e].id),delete kB[e]}),t)}("pauseplay",400,{start:function(){cN.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){cN.removeClass(t.root,"interact"),!e&&t.hide()}})}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.state<tB.READY)||(this.player.paused||t.state!==tB.RUNNING?t.play():t.pause())}},{key:"onPlayPause",value:function(e){var t=this.config,n=this.player;if(!(n.state<tB.RUNNING)&&this.autoPlayStart){if("show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&n.paused&&!n.ended||t.isShowEnd&&n.ended)return this.switchStatus(),void this.show();if(t.disableAnimate)return this.switchStatus(),void this.hide();if("play"===e)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||n.ended)return;this.animate()}}else this.switchStatus()}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),Object.keys(kB).map((function(e){window.clearTimeout(kB[e].id),delete kB[e]}))}},{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"}}}]),n}(Vj),EB=function(e){CM(n,e);var t=LM(n);function n(){return wM(this,n),t.apply(this,arguments)}return TM(n,[{key:"render",value:function(){var e=this.config.innerHtml,t=cN.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 n="",i=1;i<=12;i++)n+='<div class="xgplayer-enter-bar'.concat(i,'"></div>');t.innerHTML='<div class="xgplayer-enter-spinner">'.concat(n,"</div>")}return t}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),n}(Vj);function TB(e,t,n){try{return' <div class="xg-tips '.concat(n?"hide":" ",'" lang-key="').concat(e.i18nKeys[t],'">\n ').concat(e.i18n[t],"\n </div>")}catch(xX){return'<div class="xg-tips hide"></div>'}}var SB=function(e){CM(n,e);var t=LM(n);function n(){return wM(this,n),t.apply(this,arguments)}return TM(n,[{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:Uj.CONTROLS_RIGHT,index:10}}}]),n}(Vj);function CB(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var xB=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],OB=xB.length;function PB(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===kM(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<OB;t++)e[xB[t]]=0;return e}();var n={};n.width=e.offsetWidth,n.height=e.offsetHeight;for(var i=n.isBorderBox="border-box"===t.boxSizing,r=0;r<OB;r++){var o=xB[r],a=t[o],s=parseFloat(a);n[o]=Number.isNaN(s)?0:s}var l=n.paddingLeft+n.paddingRight,c=n.paddingTop+n.paddingBottom,u=n.marginLeft+n.marginRight,h=n.marginTop+n.marginBottom,d=n.borderLeftWidth+n.borderRightWidth,f=n.borderTopWidth+n.borderBottomWidth,p=i,g=CB(t.width);!1!==g&&(n.width=g+(p?0:l+d));var v=CB(t.height);return!1!==v&&(n.height=v+(p?0:c+f)),n.innerWidth=n.width-(l+d),n.innerHeight=n.height-(c+f),n.outerWidth=n.width+u,n.outerHeight=n.height+h,n}}function IB(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i.identifier===t)return i}}var LB="dragStart",DB="dragMove",AB="dragEnded",MB={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},RB=function(e){CM(n,e);var t=LM(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wM(this,n),(i=t.call(this)).isEnabled=!0,i.isDragging=!1,i.isDown=!1,i.position={},i.downPoint={},i.dragPoint={x:0,y:0},i.startPos={x:0,y:0},i._root=e instanceof Element?e:document.querySelector(e),i._handlerDom=r.handle instanceof Element?r.handle:document.querySelector(r.handle),i._root&&i._handlerDom?(i._bindStartEvent(),i):IM(i)}return TM(n,[{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)]),MB[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 n=MB[this._startKey];n.map((function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=n}}},{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=IB(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=IB(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=IB(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 n=PB(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-n.height,this.startPos.maxX=window.innerWidth-n.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,t){this.isDragging=!0,this.animate(),this.emit(LB,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(AB)),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,t){var n={x:t.pageX-this.downPoint.pageX,y:t.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this.dragRealStart(e,t),n}},{key:"dragMove",value:function(e,t){if(e=e||window.event,this.isDown){var n=this.startPos,i=n.x,r=n.y,o=this._dragPointerMove(e,t),a=o.x,s=o.y;a=this.checkContain("x",a,i),s=this.checkContain("y",s,r),this.position.x=i+a,this.position.y=r+s,this.dragPoint.x=a,this.dragPoint.y=s,this.emit(DB,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,n){return t+n<0?0-n:"x"===e&&t+n>this.startPos.maxX?this.startPos.maxX-n:"y"===e&&t+n>this.startPos.maxY?this.startPos.maxY-n:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),n=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(n)?0:n,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var n=t.split(","),i=0===t.indexOf("matrix3d")?12:4,r=parseInt(n[i],10),o=parseInt(n[i+1],10);this.position.x+=r,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var n=PB(this._root.parentNode);return n?parseFloat(e)/100*n[t]:0}return parseInt(e,10)}}]),n}(BM),NB=function(e){CM(n,e);var t=LM(n);function n(e){var i;wM(this,n),SM(PM(i=t.call(this,e)),"onCancelClick",(function(e){i.exitMini(),i.isClose=!0})),SM(PM(i),"onCenterClick",(function(e){var t=PM(i).player;t.paused?t.play():t.pause()})),SM(PM(i),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-i.pos.scrollY)<50)){var t=parseInt(cN.getCss(i.player.root,"height"));t+=i.config.scrollTop,i.pos.scrollY=window.scrollY,window.scrollY>t+5?!i.isMini&&!i.isClose&&i.getMini():window.scrollY<=t&&(i.isMini&&i.exitMini(),i.isClose=!1)}})),i.isMini=!1,i.isClose=!1;var r=PM(i).config;return i.pos={left:r.left<0?window.innerWidth-r.width-20:r.left,top:r.top<0?window.innerHeight-r.height-20:r.top,height:i.config.height,width:i.config.width,scrollY:window.scrollY||0},i.lastStyle=null,i}return TM(n,[{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(TN,(function(){e.setAttr("data-state","pause")})),this.on(kN,(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 n={config:{onClick:function(){e.getMini()}}};t.controls.registerPlugin(SB,n,SB.pluginName)}var i=cN.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",i,this.onCancelClick),this.bind(".play-icon",i,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new RB(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:_B,class:"xg-icon-play"},pause:{icon:bB,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,n=this.playerConfig,i=this.config.target||this.player.root;this.lastStyle={},cN.addClass(t.root,"xgplayer-mini"),["width","height","top","left"].map((function(t){e.lastStyle[t]=i.style[t],i.style[t]="".concat(e.pos[t],"px")})),n.fluid&&(i.style["padding-top"]=""),this.emit(JN,!0),t.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var t=this.player,n=this.playerConfig,i=this.config.target||this.player.root;cN.removeClass(t.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map((function(t){i.style[t]=e.lastStyle[t]})),this.lastStyle=null,n.fluid&&(t.root.style.width="100%",t.root.style.height="0",t.root.style["padding-top"]="".concat(100*n.height/n.width,"%")),this.emit(JN,!1),this.isMini=t.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=cN.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(TB(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}}}]),n}(Vj),jB={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},BB=["videoClick","videoDbClick"],UB=function(e){CM(n,e);var t=LM(n);function n(){var e;wM(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return SM(PM(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var n=PM(e),i=n.player,r=n.playerConfig;i.isActive||(i.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&i.media.focus())})),SM(PM(e),"onMouseEnter",(function(t){var n=PM(e),i=n.playerConfig,r=n.player;!i.closeFocusVideoFocus&&r.media.focus(),i.closeDelayBlur?r.focus({autoHide:!1}):r.focus()})),SM(PM(e),"onMouseLeave",(function(t){var n=e.playerConfig,i=n.closePlayerBlur,r=n.leavePlayerTime,o=n.closeDelayBlur;i||o||(r?e.player.focus({autoHide:!0,delay:r}):e.player.blur())})),SM(PM(e),"onVideoClick",(function(t){var n=PM(e),i=n.player,r=n.playerConfig;t.target&&r.closeVideoClick||t.target!==i.root&&t.target!==i.media&&t.target!==i.innerContainer&&t.target!==i.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--,Ij(PM(e),BB[0],(function(t,n){e.switchPlayPause(n.e)}),{e:t,paused:i.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),SM(PM(e),"onVideoDblClick",(function(t){var n=PM(e),i=n.player;n.playerConfig.closeVideoDblclick||!t.target||t.target!==i.media&&t.target!==i.media.__canvas||(e._clickCount<2?e._clickCount=0:(e._clickCount=0,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),t.preventDefault(),t.stopPropagation(),Ij(PM(e),BB[1],(function(t,n){e.emitUserAction(n.e,"switch_fullscreen",{props:"fullscreen",from:i.fullscreen,to:!i.fullscreen}),i.fullscreen?i.exitFullscreen():i.getFullscreen()}),{e:t,fullscreen:i.fullscreen})))})),e}return TM(n,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,BB.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===vN.device&&!vN.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,t=this.player,n=t.video,i=t.root,r=this.playerConfig.enableContextmenu;i&&i.addEventListener("click",this.onVideoClick,!1),i&&i.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(jB).map((function(t){i.addEventListener(t,e[jB[t]],!1)})),r&&n&&n.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,n=t.video,i=t.root;this.clickTimer&&clearTimeout(this.clickTimer),i.removeEventListener("click",this.onVideoClick,!1),i.removeEventListener("dblclick",this.onVideoDblClick,!1),n.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(jB).map((function(t){i.removeEventListener(t,e[jB[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),n}(Dj),HB=Er,FB=J,GB=Si,VB=RD,zB=xo,WB=x,KB=RangeError,qB=String,YB=Math.floor,$B=FB(zB),XB=FB("".slice),JB=FB(1..toFixed),ZB=function(e,t,n){return 0===t?n:t%2==1?ZB(e,t-1,n*e):ZB(e*e,t/2,n)},QB=function(e,t,n){for(var i=-1,r=n;++i<6;)r+=t*e[i],e[i]=r%1e7,r=YB(r/1e7)},eU=function(e,t){for(var n=6,i=0;--n>=0;)i+=e[n],e[n]=YB(i/t),i=i%t*1e7},tU=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var i=qB(e[t]);n=""===n?i:n+$B("0",7-i.length)+i}return n};HB({target:"Number",proto:!0,forced:WB((function(){return"0.000"!==JB(8e-5,3)||"1"!==JB(.9,0)||"1.25"!==JB(1.255,2)||"1000000000000000128"!==JB(0xde0b6b3a7640080,0)}))||!WB((function(){JB({})}))},{toFixed:function(e){var t,n,i,r,o=VB(this),a=GB(e),s=[0,0,0,0,0,0],l="",c="0";if(a<0||a>20)throw KB("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return qB(o);if(o<0&&(l="-",o=-o),o>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(o*ZB(2,69,1))-69)<0?o*ZB(2,-t,1):o/ZB(2,t,1),n*=4503599627370496,(t=52-t)>0){for(QB(s,0,n),i=a;i>=7;)QB(s,1e7,0),i-=7;for(QB(s,ZB(10,i,1),0),i=t-1;i>=23;)eU(s,1<<23),i-=23;eU(s,1<<i),QB(s,1,1),eU(s,2),c=tU(s)}else QB(s,0,n),QB(s,1<<-t,0),c=tU(s)+$B("0",a);return c=a>0?l+((r=c.length)<=a?"0."+$B("0",a-r)+c:XB(c,0,r-a)+"."+XB(c,r-a)):l+c}});var nU="press",iU="pressend",rU="doubleclick",oU="click",aU="touchmove",sU="touchstart",lU="touchend",cU={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},uU={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function hU(e){return e&&e.length>0?e[e.length-1]:null}function dU(e){var t=navigator.userAgent;/(?:iPhone|iPad)/.test(t)&&e.cancelable&&e.preventDefault()}var fU=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};wM(this,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(i).map((function(e){n.config[e]=i[e]})),this.root=t,this.events="mouse"===i.eventType?uU:cU,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return TM(e,[{key:"_initEvent",value:function(){this.onTouchStart=this.onTouchStart.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.onTouchCancel=this.onTouchCancel.bind(this),this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(e){var t=this,n=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout((function(){t.trigger(nU,e),t._pos.press=!0,t.__clearPress()}),n.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(e){var t=this,n=this.config;if(this.dbIntrvalId)return this.__clearDb(),void this.trigger(rU,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(oU,e)}),n.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 n=this.__handlers[e],i=-1,r=0;r<n.length;r++)if(n[r]===t){i=r;break}i>=0&&this.__handlers[e].splice(i,1)}}},{key:"trigger",value:function(e,t){this.__handlers[e]&&this.__handlers[e].map((function(n){try{n(t)}catch(w7){console.error("trigger>>:".concat(e),w7)}}))}},{key:"onTouchStart",value:function(e){var t=this._pos,n=this.root;this.config.needPreventDefault&&dU(e);var i=hU(e.touches);t.x=i?parseInt(i.pageX,10):e.pageX,t.y=i?parseInt(i.pageX,10):e.pageX,t.start=!0,this.__setPress(e),n.addEventListener(this.events.end,this.onTouchEnd),n.addEventListener(this.events.cancel,this.onTouchCancel),n.addEventListener(this.events.move,this.onTouchMove),this.trigger(sU,e)}},{key:"onTouchCancel",value:function(e){this.onTouchEnd(e)}},{key:"onTouchEnd",value:function(e){var t=this._pos,n=this.root;this.config.needPreventDefault&&dU(e),this.__clearPress(),n.removeEventListener(this.events.cancel,this.onTouchCancel),n.removeEventListener(this.events.end,this.onTouchEnd),n.removeEventListener(this.events.move,this.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&this.trigger(iU,e),this.trigger(lU,e),!t.press&&!t.moving&&this.__setDb(e),t.press=!1,t.start=!1,t.moving=!1}},{key:"onTouchMove",value:function(e){var t=this._pos,n=this.config,i=hU(e.touches),r=i?parseInt(i.pageX,10):e.pageX,o=i?parseInt(i.pageY,10):e.pageX,a=r-t.x,s=o-t.y;Math.abs(s)<n.miniStep&&Math.abs(a)<n.miniStep||(this.__clearPress(),t.press&&this.trigger(iU,e),t.press=!1,t.moving=!0,this.trigger(aU,e))}},{key:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).map((function(n){e.root.removeEventListener("touchend",e[t[n]])}))}}]),e}();function pU(){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 gU="auto",vU="seeking",yU="playbackrate",mU=["videoClick","videoDbClick"],_U=function(e){CM(n,e);var t=LM(n);function n(e){var i;return wM(this,n),SM(PM(i=t.call(this,e)),"onTouchStart",(function(e){var t=PM(i),n=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=i.getTouche(e);if(s&&!r.disableGesture&&i.duration>0&&!n.ended){o.isStart=!0,cN.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),i.find(".xg-dur").innerHTML=cN.format(i.duration);var l=i.root.getBoundingClientRect();90===n.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===n.rotateDeg?u:c,o.y=90===n.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}})),SM(PM(i),"onTouchMove",(function(e){var t=i.getTouche(e),n=PM(i),r=n.pos,o=n.config,a=n.player;if(t&&!o.disableGesture&&i.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=i.checkScope(h,d,f,p,r))&&(l?a.blur():a.focus({autoHide:!1}),!r.time&&(r.time=parseInt(1e3*a.currentTime,10)+1e3*i.timeOffset)),r.scope=g),-1===g||g>0&&!o.gestureY||0===g&&!o.gestureX)return;e.cancelable&&e.preventDefault(),i.executeMove(f,p,g,r.width,r.height),r.x=h,r.y=d}}})),SM(PM(i),"onTouchEnd",(function(e){var t=PM(i),n=t.player,r=t.pos,o=t.playerConfig;if(r.isStart){r.scope>-1&&e.cancelable&&e.preventDefault();var a=i.config,s=a.disableGesture,l=a.gestureX;!s&&l?(i.endLastMove(r.scope),setTimeout((function(){n.getPlugin("progress")&&n.getPlugin("progress").resetSeekState()}),10)):r.time=0,r.scope=-1,i.resetPos(),cN.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),i.changeAction(gU)}})),SM(PM(i),"onRootTouchMove",(function(e){!i.config.disableGesture&&i.config.gestureX&&i.checkIsRootTarget(e)&&(e.stopPropagation(),i.pos.isStart?i.onTouchMove(e):i.onTouchStart(e))})),SM(PM(i),"onRootTouchEnd",(function(e){i.pos.isStart&&i.checkIsRootTarget(e)&&(e.stopPropagation(),i.onTouchEnd(e))})),i.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},i.timer=null,i}return TM(n,[{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:pU,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;mU.map((function(t){e.__hooks[t]=null}));var t=this.playerConfig,n=this.config,i=this.player;!0===t.closeVideoDblclick&&(n.closedbClick=!0),this.resetPos(),cN.isUndefined(t.disableGesture)||(n.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=cN.createDom("xg-mask","",{},"xgmask"),i.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new fU(this.root,{eventType:r,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",(function(e){e.preventDefault()})),i.root.addEventListener("touchmove",this.onRootTouchMove,!0),i.root.addEventListener("touchend",this.onRootTouchEnd,!0),this.on(LN,(function(){var t=e.player,n=e.config;1e3*t.duration<n.moveDuration&&(n.moveDuration=1e3*t.duration)})),this.on([IN,EN],(function(){var t=e.pos,n=t.time;!t.isStart&&n>0&&(e.pos.time=0)}));var o={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(o).map((function(t){e.touch.on(t,(function(n){e[o[t]](n)}))})),!n.disableActive){var a=i.plugins.progress;a&&(a.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),a.addCallBack("dragend",(function(){e.changeAction(gU)})))}}},{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,n=e.progressColor;t&&(this.find(".xg-curbar").style.backgroundColor=t,this.find(".xg-cur").style.color=t),n&&(this.find(".xg-bar").style.backgroundColor=n,this.find(".time-preview").style.color=n),this.config.disableTimeProgress&&cN.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 n=t.plugins.start;n&&n.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,n,i,r){var o=r.width,a=-1;if(e<0||e>o)return a;var s=0===i?Math.abs(n):Math.abs(n/i);return Math.abs(n)>0&&s>=1.73&&e>r.scopeM1&&e<r.scopeM2?a=0:(0===Math.abs(n)||s<=.57)&&(a=e<r.scopeL?1:e>r.scopeR?2:3),a}},{key:"executeMove",value:function(e,t,n,i,r){switch(n){case 0:this.updateTime(e/i*this.config.scopeM);break;case 1:this.updateBrightness(t/r);break;case 2:vN.os.isIos||this.updateVolume(t/r)}}},{key:"endLastMove",value:function(e){var t=this,n=this.pos,i=this.player,r=this.config,o=(n.time-this.timeOffset)/1e3;if(0===e)i.seek(Number(o).toFixed(1)),r.hideControlsEnd?i.blur():i.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500);this.changeAction(gU)}},{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,n=this.config,i=this.playerConfig;t.state<tB.RUNNING?i.closeVideoClick||(this.sendUseAction(cN.createEvent("click")),t.play()):!n.closedbClick||i.closeVideoClick?t.isActive?t.blur():t.focus():i.closeVideoClick||((t.isActive||n.focusVideoClick)&&(this.sendUseAction(cN.createEvent("click")),this.switchPlayPause()),t.focus())}},{key:"dbClickHandler",value:function(e){var t=this.config,n=this.player;!t.closedbClick&&n.state>=tB.RUNNING&&(this.sendUseAction(cN.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,n=this.player;Ij(this,mU[0],(function(e,n){t.clickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onDbClick",value:function(e){var t=this,n=this.player;Ij(this,mU[1],(function(e,n){t.dbClickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onPress",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{prop:"playbackRate",from:i.playbackRate,to:n.pressRate}),i.playbackRate=n.pressRate,this.changeAction(yU))}},{key:"onPressEnd",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(this.emitUserAction("pressend","change_rate",{prop:"playbackRate",from:i.playbackRate,to:t.rate}),i.playbackRate=t.rate,t.rate=1,this.changeAction(gU))}},{key:"updateTime",value:function(e){var t=this.player,n=this.config,i=this.player.duration;e=Number(e.toFixed(4));var r=parseInt(e*n.moveDuration,10)+this.timeOffset;r=(r+=this.pos.time)<0?0:r>1e3*i?1e3*i-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),n.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,n=this.pos;if(e=parseInt(100*e,10),n.volume+=e,!(Math.abs(n.volume)<10)){var i=parseInt(10*t.volume,10)-parseInt(n.volume/10,10);i=i>10?10:i<1?0:i,t.volume=i/10,n.volume=0}}},{key:"updateBrightness",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.pos,n=this.config,i=this.xgMask,r=t.light+.8*e;r=r>n.maxDarkness?n.maxDarkness:r<0?0:r,i&&(i.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],n=this.player,i=this.config,r=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!r&&!i.disableActive){e<0?e=0:e>n.duration&&(e=n.duration-.2),this.changeAction(vU);var o=n.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=cN.format(this.duration),this.find(".xg-cur").innerHTML=cN.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?cN.removeClass(this.find(".xg-seek-show"),"xg-back"):cN.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<tB.ATTACHED)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!1}},{key:"enableGesture",value:function(){this.config.disableGesture=!0}},{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)}},{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>/</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}}}]),n}(Vj);function bU(e){e.preventDefault(),e.returnValue=!1}function kU(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}var wU=function(e){CM(n,e);var t=LM(n);function n(){var e;wM(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return SM(PM(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){var n=t||window.event;if(e.player&&(e.player.isUserActive||e.config.isIgnoreUserActive)&&!(e.config.disable||e.config.disableBodyTrigger||!e.checkIsVisible()||n.metaKey||n.altKey||n.ctrlKey)){var i=n.keyCode;return!(n.target!==document.body&&(!e.config.isGlobalTrigger||kU(n.target))||!e.checkCode(i,!0))&&(bU(n),e.handleKeyCode(i,t),!1)}})),SM(PM(e),"onKeydown",(function(t){var n=t||window.event;if(!(e.config.disable||e.config.disableRootTrigger||n.metaKey||n.altKey||n.ctrlKey)&&(e.player.isUserActive||e.config.isIgnoreUserActive)&&(e.player.isUserActive||e.config.isIgnoreUserActive)){if(!n||37!==n.keyCode&&!e.checkCode(n.keyCode)||n.target!==e.player.root&&n.target!==e.player.video&&n.target!==e.player.controls.el)return!0;bU(n),e.handleKeyCode(n.keyCode,t)}})),e}return TM(n,[{key:"mergekeyCodeMap",value:function(){var e=this,t=this.config.keyCodeMap;t&&Object.keys(t).map((function(n){e.keyCodeMap[n]?["keyCode","action","disable","isBodyTarget"].map((function(i){t[n][i]&&(e.keyCodeMap[n][i]=t[n][i])})):e.keyCodeMap[n]=t[n]}))}},{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,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disable:!1},right:{keyCode:39,action:"seek",disable:!1},esc:{keyCode:27,action:"exitFullscreen",disable:!1}},this.mergekeyCodeMap(),this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),t=e.height,n=e.top,i=e.bottom,r=window.innerHeight;return!(n<0&&n<0-.9*t||i>0&&i-r>.9*t)}},{key:"checkCode",value:function(e,t){var n=this,i=!1;return Object.keys(this.keyCodeMap).map((function(r){n.keyCodeMap[r]&&e===n.keyCodeMap[r].keyCode&&!n.keyCodeMap[r].disable&&(i=!t||t&&!n.keyCodeMap[r].noBodyTarget)})),i}},{key:"downVolume",value:function(e){var t=this.player,n=parseFloat((t.volume-.1).toFixed(1)),i={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=n>=0?n:0}},{key:"upVolume",value:function(e){var t=this.player,n=parseFloat((t.volume+.1).toFixed(1)),i={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=n<=1?n:1}},{key:"seek",value:function(e){var t=this.player,n=t.currentTime,i=t.duration,r=n,o={currentTime:{from:n,to:r=n+this.seekStep<=i?n+this.seekStep:i-1}};this.emitUserAction(e,"seek",{props:o}),this.player.currentTime=r}},{key:"seekBack",value:function(e){var t=this.player.currentTime,n=0;t-this.seekStep>=0&&(n=t-this.seekStep);var i={currentTime:{from:t,to:n}};this.emitUserAction(e,"seek",{props:i}),this.player.currentTime=n}},{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,n=t.fullscreen,i=t.cssfullscreen;n&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:n,to:!n}),t.exitFullscreen()),i&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:i,to:!i}),t.exitCssFullscreen())}},{key:"handleKeyCode",value:function(e,t){var n=this;Object.keys(this.keyCodeMap).map((function(i){var r=n.keyCodeMap[i],o=r.action,a=r.keyCode,s=r.disable;a!==e||s||("function"==typeof o?o(t,n.player):"string"==typeof o&&"function"==typeof n[o]&&n[o](t,n.player),n.emit(aj,bM({key:i,target:t.target},n.keyCodeMap[i])))}))}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown)}},{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:!0,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!1,keyCodeMap:{},disable:!1,isIgnoreUserActive:!1}}}]),n}(Dj);function EU(){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 TU=function(e){CM(n,e);var t=LM(n);function n(){return wM(this,n),t.apply(this,arguments)}return TM(n,[{key:"registerIcons",value:function(){return{loadingIcon:EU}}},{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:Uj.ROOT}}}]),n}(Vj),SU=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],CU=function(){function e(t){wM(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 TM(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var n=0,i=this.fragments;this.fragments=i.map((function(e){return e.start=parseInt(n,10),e.end=parseInt(n+e.percent*t.duration,10),e.duration=parseInt(e.percent*t.duration,10),n+=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},n=this.progressList,i=this.fragments;if(!(n.length<1)){var r=t.newIndex,o=t.curIndex,a=t.millisecond;r!==o&&n.map((function(t,n){n<r?t[e].style.width="100%":n>r&&(t[e].style.width=0)}));var s=i[r],l=0===a?0:(a-s.start)/s.duration;n[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 n={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(n)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var i={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(i),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 n=this.playedIndex,i=this.cachedIndex;if("Undefined"!==cN.typeOf(e.played)){var r=this.findIndex(1e3*e.played,n);if(r<0)return;this.updateProgress("played",{newIndex:r,curIndex:n,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=r}if("Undefined"!==cN.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,i);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:i,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(e,t){var n=this.fragments;if(!n||0===n.length)return-1;if(1===n.length)return 0;if(t>-1&&t<n.length&&e>n[t].start&&e<n[t].end)return t;if(e>n[n.length-1].start)return n.length-1;for(var i=0;i<n.length;i++)if(e>n[i].start&&e<=n[i].end){t=i;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(cN.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++)cN.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return cN.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(n){void 0!==e[n]&&(t.fragConfig[n]=e[n])})),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 n=this.root.children;n.length>0;)this.root.removeChild(n[0]);this.render()}}},{key:"render",value:function(){var e=this,t=this.style.progressColor;if(this.root||(this.root=cN.createDom("xg-inners","",{},"progress-list")),this.fragments){var n=this.fragConfig,i=n.fragClass,r=n.fragFocusClass;this.progressList=this.fragments.map((function(n){var o=cN.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(n.percent):"flex: ".concat(n.percent)},"".concat(n.isFocus?r:""," xgplayer-progress-inner ").concat(i));return e.root.appendChild(o),SU.forEach((function(t){o.appendChild(cN.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}(),xU={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},OU=function(e){CM(n,e);var t=LM(n);function n(e){var i;return wM(this,n),SM(PM(i=t.call(this,e)),"onMoveOnly",(function(e,t){var n=PM(i),r=n.pos,o=n.config,a=n.player,s=t;if(e){cN.event(e);var l=cN.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=i.computeTime(e,c)}i.triggerCallbacks("dragmove",s,e),i._updateInnerFocus(s)})),SM(PM(i),"onBodyClick",(function(e){i.pos.isLocked&&(i.pos.isLocked=!1,e.preventDefault(),e.stopPropagation())})),SM(PM(i),"_mouseDownHandler",(function(e,t){i._state.time=t.currentTime,i.updateWidth(t.currentTime,t.percent,0),i._updateInnerFocus(t)})),SM(PM(i),"_mouseUpHandler",(function(e,t){PM(i).pos.moving&&i.updateWidth(t.currentTime,t.percent,2)})),SM(PM(i),"_mouseMoveHandler",(function(e,t){var n=PM(i),r=n._state,o=n.pos,a=n.config,s=n.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(),i.triggerCallbacks("dragstart",t,e),i.emitUserAction("drag","dragstart",t)),i.updateWidth(t.currentTime,t.percent,1),i.triggerCallbacks("dragmove",t,e),i._updateInnerFocus(t)})),SM(PM(i),"onMouseDown",(function(e){var t=PM(i),n=t._state,r=t.player,o=t.pos,a=t.config,s=t.playerConfig,l=cN.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(),i.focus(),cN.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),cN.checkIsFunction(a.onMoveStart)&&a.onMoveStart(),cN.event(e),o.x=c,o.isDown=!0,o.moving=!1,n.prePlayTime=r.currentTime,r.focus({autoHide:!1}),i.isProgressMoving=!0,cN.addClass(i.progressBtn,"active");var u=i.computeTime(e,c);return u.prePlayTime=n.prePlayTime,i._mouseDownHandlerHook(e,u),"touchstart"===e.type?(i.root.addEventListener("touchmove",i.onMouseMove),i.root.addEventListener("touchend",i.onMouseUp)):(i.unbind("mousemove",i.onMoveOnly),document.addEventListener("mousemove",i.onMouseMove,!1),document.addEventListener("mouseup",i.onMouseUp,!1)),!0}r.play()}})),SM(PM(i),"onMouseUp",(function(e){var t=PM(i),n=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=t._state;e.stopPropagation(),e.preventDefault(),cN.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),cN.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),cN.event(e),cN.removeClass(i.progressBtn,"active");var l=i.computeTime(e,o.x);l.prePlayTime=s.prePlayTime,o.moving?(i.triggerCallbacks("dragend",l,e),i.emitUserAction("drag","dragend",l)):(i.triggerCallbacks("click",l,e),i.emitUserAction("click","click",l)),i._mouseUpHandlerHook(e,l),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,o.isLocked=!0,s.prePlayTime=0,s.time=0,"touchend"===e.type?(i.root.removeEventListener("touchmove",i.onMouseMove),i.root.removeEventListener("touchend",i.onMouseUp),i.blur()):(document.removeEventListener("mousemove",i.onMouseMove,!1),document.removeEventListener("mouseup",i.onMouseUp,!1),o.isEnter?"mobile"!==a.isMobileSimulateMode&&i.bind("mousemove",i.onMoveOnly):i.onMouseLeave(e)),cN.setTimeout(PM(i),(function(){i.resetSeekState()}),10),n.focus()})),SM(PM(i),"onMouseMove",(function(e){var t=PM(i),n=t._state,r=t.pos,o=t.player,a=t.config;cN.checkTouchSupport()&&e.preventDefault(),cN.event(e);var s=cN.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=i.computeTime(e,l);u.prePlayTime=n.prePlayTime,i._mouseMoveHandlerHook(e,u)}})),SM(PM(i),"onMouseOut",(function(e){i.triggerCallbacks("mouseout",null,e)})),SM(PM(i),"onMouseOver",(function(e){i.triggerCallbacks("mouseover",null,e)})),SM(PM(i),"onMouseEnter",(function(e){var t=PM(i),n=t.player,r=t.pos;if(!(r.isDown||r.isEnter||n.isMini||!n.config.allowSeekAfterEnded&&n.ended)){r.isEnter=!0,i.bind("mousemove",i.onMoveOnly),i.bind("mouseleave",i.onMouseLeave),cN.event(e);var o=cN.getEventPos(e,n.zoom),a=90===n.rotateDeg?o.clientY:o.clientX,s=i.computeTime(e,a);i.triggerCallbacks("mouseenter",s,e),i.focus()}})),SM(PM(i),"onMouseLeave",(function(e){i.triggerCallbacks("mouseleave",null,e),i.unlock(),i._updateInnerFocus(null)})),SM(PM(i),"onVideoResize",(function(){var e=i.pos,t=e.x,n=e.isDown;if(e.isEnter&&!n){var r=i.computeTime(null,t);i.onMoveOnly(null,r)}})),i.useable=!1,i.isProgressMoving=!1,i.__dragCallBacks=[],i._state={now:-1,direc:0,time:0,prePlayTime:-1},i._disableBlur=!1,i}return TM(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"changeState",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.useable=e}},{key:"show",value:function(){this.root&&(this.root.style.display="flex")}},{key:"_initInner",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var i=bM(bM({fragments:t},n),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(i):(this.innerList=new CU(i),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(){var e=this;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 t=this.config,n=t.fragFocusClass,i=t.fragAutoFocus,r=t.fragClass;this._initInner(this.config.fragments,{fragFocusClass:n,fragAutoFocus:i,fragClass:r,style:this.playerConfig.commonStyle||{}}),"mobile"===vN.device&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(LN,(function(){e.onMouseLeave()})),this.on(ON,(function(){e.onTimeupdate()})),this.on(xN,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(RN,(function(){e.onCacheUpdate()})),this.on(EN,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(jN,(function(){e.onReset()})),this.on(tj,(function(){e.onVideoResize()})),this.bindDomEvents(),this.initCustomStyle()}}},{key:"setConfig",value:function(e){var t=this,n=null;Object.keys(e).forEach((function(i){t.config[i]=e[i],"fragments"===i&&(n=e[i])})),n&&this._initInner(n,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===kM(e)&&Object.keys(e).map((function(n){t.style[n]=e[n]})))}},{key:"triggerCallbacks",value:function(e,t,n){this.__dragCallBacks.length>0&&this.__dragCallBacks.map((function(i){if(i&&i.handler&&i.type===e)try{i.handler(t,n)}catch(w7){console.error("[XGPLAYER][triggerCallbacks] ".concat(i," error"),w7)}}))}},{key:"addCallBack",value:function(e,t){t&&"function"==typeof t&&this.__dragCallBacks.push({type:e,handler:t})}},{key:"removeCallBack",value:function(e,t){var n=this.__dragCallBacks,i=-1;n.map((function(n,r){n&&n.type===e&&n.handler===t&&(i=r)})),i>-1&&n.splice(i,1)}},{key:"unlock",value:function(){var e=this.player,t=this.pos;t.isEnter=!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,t=e.controls,n=e.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),t&&(t.root&&t.root.addEventListener("touchmove",cN.stopPropagation),t.center&&t.center.addEventListener("touchend",cN.stopPropagation))),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==n.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(),cN.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),cN.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,n){var i=this.config,r=this.player;if(!i.isCloseClickSeek||0!==n){var o=e>=r.duration?r.duration-i.endedDiff:Number(e).toFixed(1);this.updatePercent(t),this.updateTime(e),(1!==n||i.isDragingSeek&&"audio"!==r.config.mediaType)&&(this._state.now=o,this._state.direc=o>r.currentTime?0:1,r.seek(o))}}},{key:"computeTime",value:function(e,t){var n,i,r=this.player,o=this.root.getBoundingClientRect(),a=o.width,s=o.height,l=o.top,c=o.left,u=t;90===r.rotateDeg?(n=s,i=l):(n=a,i=c);var h=u-i,d=(h=h>n?n:h<0?0:h)/n;return{percent:d=d<0?0:d>1?1:d,currentTime:parseInt(d*this.duration*1e3,10)/1e3,offset:h,width:n,left:i,e:e}}},{key:"updateTime",value:function(e){var t=this.player,n=this.duration;e>n?e=n:e<0&&(e=0);var i=t.plugins.time;i&&i.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.duration},this.duration);var n=this.player.plugins.miniprogress;n&&n.update({played:e*this.duration},this.duration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,n=this._state,i=this.duration;if(!t.isSeeking&&!this.isProgressMoving){if(n.now>-1){var r=parseInt(1e3*n.now,10)-parseInt(1e3*t.currentTime,10);if(0===n.direc&&r>300||1===n.direc&&r>-300)return void(n.now=-1);n.now=-1}var o=this.timeOffset+t.currentTime;o=cN.adjustTimeByDuration(o,i,e),this.innerList.update({played:o},i),this.progressBtn.style.left="".concat(o/i*100,"%");var a=this.player.plugins.miniprogress;a&&a.update({played:o},i)}}},{key:"onCacheUpdate",value:function(e){var t=this.player,n=this.duration;if(t){var i=t.bufferedPoint.end;i=cN.adjustTimeByDuration(i,n,e),this.innerList.update({cached:i},n);var r=this.player.plugins.miniprogress;r&&r.update({cached:i},n)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0);var e=this.player.plugins.miniprogress;e&&e.update({cached:0,played:0},0)}},{key:"destroy",value:function(){var e=this.player,t=e.controls;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var n=this.domEventType;"touch"!==n&&"compatible"!==n||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),t&&(t.root&&t.root.removeEventListener("touchmove",cN.stopPropagation),t.center&&t.center.removeEventListener("touchend",cN.stopPropagation))),"mouse"!==n&&"compatible"!==n||(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:Uj.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:xU.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return xU}}]),n}(Vj),PU=function(e){CM(n,e);var t=LM(n);function n(){var e;wM(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return SM(PM(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),SM(PM(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return TM(n,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave)}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),n}(Vj),IU=function(e){CM(n,e);var t=LM(n);function n(){return wM(this,n),t.apply(this,arguments)}return TM(n,[{key:"afterCreate",value:function(){var e=this;AM(xM(n.prototype),"afterCreate",this).call(this);var t=this.player;this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.on([TN,SN,jN],(function(){e.animate(t.paused)})),this.on(kN,(function(){e.animate(t.paused)})),this.animate(!0))}},{key:"registerIcons",value:function(){return{play:{icon:_B,class:"xg-icon-play"},pause:{icon:bB,class:"xg-icon-pause"}}}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.player;return this.emitUserAction(e,"switch_play_pause",{prop:"paused",from:t.paused,to:!t.paused}),t.ended?t.replay():t.paused?(t.play(),this.animate(!1)):(t.pause(),this.animate(!0)),!1}},{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,n=this.find(".xg-tips");e?(this.setAttr("data-state","pause"),n&&this.changeLangTextKey(n,t.PLAY_TIPS)):(this.setAttr("data-state","play"),n&&this.changeLangTextKey(n,t.PAUSE_TIPS))}}},{key:"destroy",value:function(){AM(xM(n.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(TB(this,"PLAY_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:Uj.CONTROLS_LEFT,index:0,disable:!1}}}]),n}(PU);function LU(){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 DU=function(e){CM(n,e);var t=LM(n);function n(){return wM(this,n),t.apply(this,arguments)}return TM(n,[{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:LU,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){cN.addClass(this.root,"show")}},{key:"hide",value:function(){cN.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:Uj.ROOT_TOP,index:0}}}]),n}(Vj);function AU(){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 MU(){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 RU=function(e){CM(n,e);var t=LM(n);function n(){var e;wM(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return SM(PM(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 TM(n,[{key:"afterCreate",value:function(){var e=this;AM(xM(n.prototype),"afterCreate",this).call(this);var t=this.config,i=this.playerConfig;if(!t.disable){t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var r=cN.getFullScreenEl();i.fullscreenTarget===r&&this.player.getFullscreen().catch((function(e){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreenChange",this.toggleFullScreen,{pre:function(t){var n=e.player.fullscreen;e.emitUserAction(t,"switch_fullscreen",{prop:"fullscreen",from:n,to:!n})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on($N,(function(t){var n=e.find(".xg-tips");n&&e.changeLangTextKey(n,t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t)})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:DU,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===vN.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:AU,class:"xg-get-fullscreen"},exitFullscreen:{icon:MU,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){AM(xM(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===vN.device?"touchend":"click",this.handleFullscreen),"mobile"===vN.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&&(e.preventDefault(),e.stopPropagation());var t=this.player,n=this.config;!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen()?(t.fullscreen?t.exitCssFullscreen():t.getCssFullscreen(),this.animate(t.fullscreen)):n.rotateFullscreen?(t.fullscreen?t.exitRotateFullscreen():t.getRotateFullscreen(),this.animate(t.fullscreen)):n.switchCallback&&"function"==typeof n.switchCallback?n.switchCallback(t.fullscreen):t.fullscreen?t.exitFullscreen():t.getFullscreen().catch((function(e){}))}},{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:"show",value:function(){AM(xM(n.prototype),"show",this).call(this)}},{key:"hide",value:function(){AM(xM(n.prototype),"hide",this).call(this)}},{key:"render",value:function(){if(!this.config.disable){return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n '.concat(TB(this,"FULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:Uj.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),n}(PU),NU=function(e){CM(n,e);var t=LM(n);function n(e){var i;return wM(this,n),(i=t.call(this,e)).isActiving=!1,i}return TM(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"currentTime",get:function(){return this.player.currentTime||0}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"afterCreate",value:function(){var e=this,t=this.player.controls.config.mode;this.mode="flex"===t?"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.on(LN,(function(){e.onTimeUpdate()})),this.on(ON,(function(){e.onTimeUpdate()})),this.on(EN,(function(){e.onTimeUpdate(!0)})),this.on(jN,(function(){e.onReset()})))}},{key:"show",value:function(){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,n=this.config,i=this.duration;if(!n.disable&&!this.isActiving&&t.hasStart){var r=t.currentTime+this.timeOffset;r=cN.adjustTimeByDuration(r,i,e),"flex"===this.mode?(this.centerCurDom.innerHTML=cN.format(r),i!==1/0&&i>0&&(this.centerDurDom.innerHTML=cN.format(i))):(this.timeDom.innerHTML=cN.format(r),i!==1/0&&i>0&&(this.durationDom.innerHTML=cN.format(i)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=cN.format(0),this.centerDurDom.innerHTML=cN.format(0)):(this.timeDom.innerHTML=cN.format(0),this.durationDom.innerHTML=cN.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=cN.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-left"),this.centerDurDom=cN.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)}}},{key:"afterPlayerInit",value:function(){var e=this.config;this.duration===1/0||this.playerConfig.isLive?(cN.hide(this.durationDom),cN.hide(this.timeDom),cN.hide(this.find(".time-separator")),cN.show(this.find(".time-live-tag"))):cN.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(cN.hide(this.durationDom),cN.hide(this.timeDom),cN.hide(this.find(".time-separator")),cN.show(this.find(".time-live-tag"))):(cN.hide(this.find(".time-live-tag")),cN.show(this.find(".time-separator")),cN.show(this.durationDom),cN.show(this.timeDom))}},{key:"updateTime",value:function(e){this.isActiving=!0,!e&&0!==e||e>this.duration||("flex"!==this.mode?this.timeDom.innerHTML=cN.format(e):this.centerCurDom.innerHTML=cN.format(e))}},{key:"resetActive",value:function(){var e=this,t=this.player,n=function(){e.isActiving=!1};this.off(xN,n),t.isSeeking?this.once(xN,n):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:Uj.CONTROLS_LEFT,index:2,disable:!1}}}]),n}(Vj);function jU(){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 BU(){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 UU(){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 HU=function(e){CM(n,e);var t=LM(n);function n(){var e;wM(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return SM(PM(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var n=PM(e).player,i=e.find(".xgplayer-bar");cN.event(t);var r=i.getBoundingClientRect(),o=cN.getEventPos(t,n.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})),SM(PM(e),"onBarMouseMove",(function(t){var n=PM(e)._d;if(n.isStart){var i=PM(e),r=i.pos,o=i.player;t.preventDefault(),t.stopPropagation(),cN.event(t);var a=cN.getEventPos(t,o.zoom);n.isMoving=!0;var s=r.h-a.clientY+r.clientY;s>r.barH||e.updateVolumePos(s,t)}})),SM(PM(e),"onBarMouseUp",(function(t){cN.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var n=PM(e)._d;n.isStart=!1,n.isMoving=!1})),SM(PM(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),SM(PM(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),SM(PM(e),"onVolumeChange",(function(t){if(e.player){var n=e.player,i=n.muted,r=n.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=i||0===r?"4px":"".concat(100*r,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(i,r)}})),e}return TM(n,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:BU,class:"xg-volume-small"},volumeLarge:{icon:jU,class:"xg-volume"},volumeMuted:{icon:UU,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,n=t.commonStyle,i=t.volume;n.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=n.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"!==vN.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(DN,this.onVolumeChange),this.once(AN,this.onVolumeChange),"Number"!==cN.typeOf(i)&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,t){var n=this.player,i=this.find(".xgplayer-drag"),r=this.find(".xgplayer-bar");if(r&&i){var o=parseInt(e/r.getBoundingClientRect().height*1e3,10);i.style.height="".concat(e,"px");var a=Math.max(Math.min(o/1e3,1),0),s={volume:{from:n.volume,to:a}};n.muted&&(s.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:n.muted,volume:n.volume,props:s}),n.volume=Math.max(Math.min(o/1e3,1),0),n.muted&&(n.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,n=e.muted,i=this.find(".xgplayer-value-label"),r=Math.max(Math.min(t,1),0);i.innerText=n?0:Math.ceil(100*r)}},{key:"focus",value:function(){this.player.focus({autoHide:!1}),this._timerId&&(cN.clearTimeout(this,this._timerId),this._timerId=null),cN.addClass(this.root,"slide-show")}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,r=this._d,o=this.player;r.isActive||(this._timerId&&(cN.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=cN.setTimeout(this,(function(){r.isActive||(n?o.blur():o.focus(),cN.removeClass(e.root,"slide-show"),r.isStart&&e.onBarMouseUp(i)),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&&(cN.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"===vN.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:Uj.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),n}(Vj);function FU(){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 clip-path="url(#clip0)">\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 id="clip0">\n <rect width="40" height="40" fill="white"/>\n </clipPath>\n </defs>\n</svg>\n',"image/svg+xml").firstChild}var GU=function(e){CM(n,e);var t=LM(n);function n(e){var i;return wM(this,n),(i=t.call(this,e)).rotateDeg=i.config.rotateDeg||0,i}return TM(n,[{key:"afterCreate",value:function(){var e=this;this.config.disable||(AM(xM(n.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(tj,(function(){e.rotateDeg&&cN.setTimeout(e,(function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)}),100)})),this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate))}},{key:"destroy",value:function(){AM(xM(n.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){var n=this.player;e||(e=0);var i=this.player,r=i.root,o=i.innerContainer,a=this.player.media,s=r.offsetWidth,l=o&&t?o.offsetHeight:r.offsetHeight,c="100%",u="100%",h=0,d=0;.75!==e&&.25!==e||(c="".concat(l,"px"),u="".concat(s,"px"),h=-(l-s)/2,d=-(s-l)/2);var f="translate(".concat(h,"px,").concat(d,"px) rotate(").concat(e,"turn)"),p={transformOrigin:"center center",transform:f,webKitTransform:f,height:u,width:c},g=t?a:r,v=t?n.getPlugin("poster"):null;Object.keys(p).map((function(e){g.style[e]=p[e],v&&v.root&&(v.root.style[e]=p[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],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=this.player;this.rotateDeg||(this.rotateDeg=0);var r=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*r*n)%1,this.updateRotateDeg(this.rotateDeg,t),i.emit(ij,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:FU}}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n '.concat(TB(this,"ROTATE_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:Uj.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),n}(PU);function VU(){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 zU(){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 WU="picture-in-picture",KU="inline",qU="fullscreen",YU=function(e){CM(n,e);var t=LM(n);function n(){var e;wM(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return SM(PM(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 TM(n,[{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()&&(AM(xM(n.prototype),"afterCreate",this).call(this),this.pMode=KU,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(zN,(function(){e.config.showIcon&&(cN.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:VU,class:"xg-get-pip"},pipIconExit:{icon:zU,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 n=t.paused;cN.setTimeout(e,(function(){!n&&t.mediaPlay()}),0),!n&&t.mediaPlay(),e.setAttr("data-state","normal"),t.emit(nj,!1)},this.enterPIPCallback=function(n){t.emit(nj,!0),e.pipWindow=n.pictureInPictureWindow,e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(n){var i=t.media.webkitPresentationMode;e.pMode===qU&&i!==qU&&t.onFullscreenChange(null,!1),e.pMode=i,i===WU?e.enterPIPCallback(n):i===KU&&e.leavePIPCallback(n)},t.media&&(t.media.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.media.addEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(t.media)&&t.media.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"requestPIP",value:function(){var e=this.player,t=this.playerConfig;if(this.isPIPAvailable()&&!this.isPip)try{var i=t.poster;return i&&(e.media.poster="String"===cN.typeOf(i)?i:i.poster),n.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("picture-in-picture"):e.media.requestPictureInPicture(),!0}catch(r){return console.error("requestPiP",r),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{return this.isPIPAvailable()&&this.isPip&&(n.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("inline"):document.exitPictureInPicture()),!0}catch(t){return console.error("exitPIP",t),!1}}},{key:"isPip",get:function(){var e=this.player;return document.pictureInPictureElement&&document.pictureInPictureElement===e.media||e.media.webkitPresentationMode===WU}},{key:"isPIPAvailable",value:function(){var e=this.player.media;return("Boolean"!==cN.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===cN.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===cN.typeOf(e.webkitSetPresentationMode))}},{key:"destroy",value:function(){AM(xM(n.prototype),"destroy",this).call(this);var e=this.player;e.media.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.media.removeEventListener("leavepictureinpicture",this.leavePIPCallback),n.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(TB(this,"PIP",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:Uj.CONTROLS_RIGHT,index:6,showIcon:!1}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}]),n}(PU);function $U(){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 XU,JU,ZU,QU=function(e){CM(n,e);var t=LM(n);function n(e){var i;return wM(this,n),SM(PM(i=t.call(this,e)),"playNext",(function(e){var t=PM(i).player;e.preventDefault(),e.stopPropagation(),i.idx+1<i.config.urlList.length?(i.idx++,i.nextHandler(i.config.urlList[i.idx],i.idx),t.emit(oj,i.idx+1)):(i.nextHandler(),t.emit(oj))})),i.idx=-1,i}return TM(n,[{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:$U}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("nextClick",this.changeSrc);var e="mobile"===vN.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(TB(this,"PLAYNEXT_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:Uj.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),n}(Vj),eH={exports:{}},tH=IC,nH=O,iH=S,rH=fe,oH=ve,aH=dt,sH=Br,lH=He,cH=kn,uH=bi,hH=tn.f,dH=ke,fH=Ka,pH=ms,gH=Ot,vH=yt,yH=ii.enforce,mH=ii.get,_H=iH.Int8Array,bH=_H&&_H.prototype,kH=iH.Uint8ClampedArray,wH=kH&&kH.prototype,EH=_H&&fH(_H),TH=bH&&fH(bH),SH=Object.prototype,CH=iH.TypeError,xH=gH("toStringTag"),OH=vH("TYPED_ARRAY_TAG"),PH="TypedArrayConstructor",IH=tH&&!!pH&&"Opera"!==sH(iH.opera),LH=!1,DH={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},AH={BigInt64Array:8,BigUint64Array:8},MH=function(e){var t=fH(e);if(oH(t)){var n=mH(t);return n&&aH(n,PH)?n.TypedArrayConstructor:MH(t)}},RH=function(e){if(!oH(e))return!1;var t=sH(e);return aH(DH,t)||aH(AH,t)};for(XU in DH)(ZU=(JU=iH[XU])&&JU.prototype)?yH(ZU).TypedArrayConstructor=JU:IH=!1;for(XU in AH)(ZU=(JU=iH[XU])&&JU.prototype)&&(yH(ZU).TypedArrayConstructor=JU);if((!IH||!rH(EH)||EH===Function.prototype)&&(EH=function(){throw CH("Incorrect invocation")},IH))for(XU in DH)iH[XU]&&pH(iH[XU],EH);if((!IH||!TH||TH===SH)&&(TH=EH.prototype,IH))for(XU in DH)iH[XU]&&pH(iH[XU].prototype,TH);if(IH&&fH(wH)!==TH&&pH(wH,TH),nH&&!aH(TH,xH))for(XU in LH=!0,hH(TH,xH,{get:function(){return oH(this)?this[OH]:void 0}}),DH)iH[XU]&&cH(iH[XU],OH,XU);var NH={NATIVE_ARRAY_BUFFER_VIEWS:IH,TYPED_ARRAY_TAG:LH&&OH,aTypedArray:function(e){if(RH(e))return e;throw CH("Target is not a typed array")},aTypedArrayConstructor:function(e){if(rH(e)&&(!pH||dH(EH,e)))return e;throw CH(lH(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,i){if(nH){if(n)for(var r in DH){var o=iH[r];if(o&&aH(o.prototype,e))try{delete o.prototype[e]}catch(w7){try{o.prototype[e]=t}catch(a){}}}TH[e]&&!n||uH(TH,e,n?t:IH&&bH[e]||t,i)}},exportTypedArrayStaticMethod:function(e,t,n){var i,r;if(nH){if(pH){if(n)for(i in DH)if((r=iH[i])&&aH(r,e))try{delete r[e]}catch(w7){}if(EH[e]&&!n)return;try{return uH(EH,e,n?t:IH&&EH[e]||t)}catch(w7){}}for(i in DH)!(r=iH[i])||r[e]&&!n||uH(r,e,t)}},getTypedArrayConstructor:MH,isView:function(e){if(!oH(e))return!1;var t=sH(e);return"DataView"===t||aH(DH,t)||aH(AH,t)},isTypedArray:RH,TypedArray:EH,TypedArrayPrototype:TH},jH=S,BH=x,UH=zy,HH=NH.NATIVE_ARRAY_BUFFER_VIEWS,FH=jH.ArrayBuffer,GH=jH.Int8Array,VH=!HH||!BH((function(){GH(1)}))||!BH((function(){new GH(-1)}))||!UH((function(e){new GH,new GH(null),new GH(1.5),new GH(e)}),!0)||BH((function(){return 1!==new GH(new FH(2),1,void 0).length})),zH=ve,WH=Math.floor,KH=Number.isInteger||function(e){return!zH(e)&&isFinite(e)&&WH(e)===e},qH=Si,YH=RangeError,$H=function(e){var t=qH(e);if(t<0)throw YH("The argument can't be less than 0");return t},XH=RangeError,JH=function(e,t){var n=$H(e);if(n%t)throw XH("Wrong offset");return n},ZH=Br,QH=J("".slice),eF=function(e){return"Big"===QH(ZH(e),0,3)},tF=Nt,nF=TypeError,iF=function(e){var t=tF(e,"number");if("number"==typeof t)throw nF("Can't convert number to bigint");return BigInt(t)},rF=xr,oF=D,aF=Yp,sF=ct,lF=Mi,cF=xc,uF=bc,hF=uc,dF=eF,fF=NH.aTypedArrayConstructor,pF=iF,gF=Er,vF=S,yF=D,mF=O,_F=VH,bF=NH,kF=Wx,wF=Fl,EF=U,TF=kn,SF=KH,CF=Di,xF=MC,OF=JH,PF=Ut,IF=dt,LF=Br,DF=ve,AF=Be,MF=xa,RF=ke,NF=ms,jF=ki.f,BF=function(e){var t,n,i,r,o,a,s,l,c=aF(this),u=sF(e),h=arguments.length,d=h>1?arguments[1]:void 0,f=void 0!==d,p=uF(u);if(p&&!hF(p))for(l=(s=cF(u,p)).next,u=[];!(a=oF(l,s)).done;)u.push(a.value);for(f&&h>2&&(d=rF(d,arguments[2])),n=lF(u),i=new(fF(c))(n),r=dF(i),t=0;n>t;t++)o=f?d(u[t],t):u[t],i[t]=r?pF(o):+o;return i},UF=po.forEach,HF=zp,FF=tn,GF=C,VF=sk,zF=ii.get,WF=ii.set,KF=ii.enforce,qF=FF.f,YF=GF.f,$F=Math.round,XF=vF.RangeError,JF=kF.ArrayBuffer,ZF=JF.prototype,QF=kF.DataView,eG=bF.NATIVE_ARRAY_BUFFER_VIEWS,tG=bF.TYPED_ARRAY_TAG,nG=bF.TypedArray,iG=bF.TypedArrayPrototype,rG=bF.aTypedArrayConstructor,oG=bF.isTypedArray,aG="BYTES_PER_ELEMENT",sG="Wrong length",lG=function(e,t){rG(e);for(var n=0,i=t.length,r=new e(i);i>n;)r[n]=t[n++];return r},cG=function(e,t){qF(e,t,{get:function(){return zF(this)[t]}})},uG=function(e){var t;return RF(ZF,e)||"ArrayBuffer"==(t=LF(e))||"SharedArrayBuffer"==t},hG=function(e,t){return oG(e)&&!AF(t)&&t in e&&SF(+t)&&t>=0},dG=function(e,t){return t=PF(t),hG(e,t)?EF(2,e[t]):YF(e,t)},fG=function(e,t,n){return t=PF(t),!(hG(e,t)&&DF(n)&&IF(n,"value"))||IF(n,"get")||IF(n,"set")||n.configurable||IF(n,"writable")&&!n.writable||IF(n,"enumerable")&&!n.enumerable?qF(e,t,n):(e[t]=n.value,e)};mF?(eG||(GF.f=dG,FF.f=fG,cG(iG,"buffer"),cG(iG,"byteOffset"),cG(iG,"byteLength"),cG(iG,"length")),gF({target:"Object",stat:!0,forced:!eG},{getOwnPropertyDescriptor:dG,defineProperty:fG}),eH.exports=function(e,t,n){var i=e.match(/\d+$/)[0]/8,r=e+(n?"Clamped":"")+"Array",o="get"+e,a="set"+e,s=vF[r],l=s,c=l&&l.prototype,u={},h=function(e,t){qF(e,t,{get:function(){return function(e,t){var n=zF(e);return n.view[o](t*i+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var o=zF(e);n&&(r=(r=$F(r))<0?0:r>255?255:255&r),o.view[a](t*i+o.byteOffset,r,!0)}(this,t,e)},enumerable:!0})};eG?_F&&(l=t((function(e,t,n,r){return wF(e,c),VF(DF(t)?uG(t)?void 0!==r?new s(t,OF(n,i),r):void 0!==n?new s(t,OF(n,i)):new s(t):oG(t)?lG(l,t):yF(BF,l,t):new s(xF(t)),e,l)})),NF&&NF(l,nG),UF(jF(s),(function(e){e in l||TF(l,e,s[e])})),l.prototype=c):(l=t((function(e,t,n,r){wF(e,c);var o,a,s,u=0,d=0;if(DF(t)){if(!uG(t))return oG(t)?lG(l,t):yF(BF,l,t);o=t,d=OF(n,i);var f=t.byteLength;if(void 0===r){if(f%i)throw XF(sG);if((a=f-d)<0)throw XF(sG)}else if((a=CF(r)*i)+d>f)throw XF(sG);s=a/i}else s=xF(t),o=new JF(a=s*i);for(WF(e,{buffer:o,byteOffset:d,byteLength:a,length:s,view:new QF(o)});u<s;)h(e,u++)})),NF&&NF(l,nG),c=l.prototype=MF(iG)),c.constructor!==l&&TF(c,"constructor",l),KF(c).TypedArrayConstructor=l,tG&&TF(c,tG,r);var d=l!=s;u[r]=l,gF({global:!0,constructor:!0,forced:d,sham:!eG},u),aG in l||TF(l,aG,i),aG in c||TF(c,aG,i),HF(r)}):eH.exports=function(){},(0,eH.exports)("Uint8",(function(e){return function(t,n,i){return e(this,t,n,i)}}));var pG=Mi,gG=Si,vG=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("at",(function(e){var t=vG(this),n=pG(t),i=gG(e),r=i>=0?i:n+i;return r<0||r>=n?void 0:t[r]}));var yG=ct,mG=Pi,_G=Mi,bG=Hb,kG=Math.min,wG=[].copyWithin||function(e,t){var n=yG(this),i=_G(n),r=mG(e,i),o=mG(t,i),a=arguments.length>2?arguments[2]:void 0,s=kG((void 0===a?i:mG(a,i))-o,i-r),l=1;for(o<r&&r<o+s&&(l=-1,o+=s-1,r+=s-1);s-- >0;)o in n?n[r]=n[o]:bG(n,r),r+=l,o+=l;return n},EG=NH,TG=J(wG),SG=EG.aTypedArray;(0,EG.exportTypedArrayMethod)("copyWithin",(function(e,t){return TG(SG(this),e,t,arguments.length>2?arguments[2]:void 0)}));var CG=po.every,xG=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("every",(function(e){return CG(xG(this),e,arguments.length>1?arguments[1]:void 0)}));var OG=zC,PG=iF,IG=Br,LG=D,DG=x,AG=NH.aTypedArray,MG=NH.exportTypedArrayMethod,RG=J("".slice);MG("fill",(function(e){var t=arguments.length;AG(this);var n="Big"===RG(IG(this),0,3)?PG(e):+e;return LG(OG,this,n,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),DG((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})));var NG=Mi,jG=function(e,t){for(var n=0,i=NG(t),r=new e(i);i>n;)r[n]=t[n++];return r},BG=Qp,UG=NH.aTypedArrayConstructor,HG=NH.getTypedArrayConstructor,FG=function(e){return UG(BG(e,HG(e)))},GG=jG,VG=FG,zG=po.filter,WG=function(e,t){return GG(VG(e),t)},KG=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("filter",(function(e){var t=zG(KG(this),e,arguments.length>1?arguments[1]:void 0);return WG(this,t)}));var qG=po.find,YG=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("find",(function(e){return qG(YG(this),e,arguments.length>1?arguments[1]:void 0)}));var $G=po.findIndex,XG=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("findIndex",(function(e){return $G(XG(this),e,arguments.length>1?arguments[1]:void 0)}));var JG=xr,ZG=ne,QG=ct,eV=Mi,tV=function(e){var t=1==e;return function(n,i,r){for(var o,a=QG(n),s=ZG(a),l=JG(i,r),c=eV(s);c-- >0;)if(l(o=s[c],c,a))switch(e){case 0:return o;case 1:return c}return t?-1:void 0}},nV={findLast:tV(0),findLastIndex:tV(1)},iV=nV.findLast,rV=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("findLast",(function(e){return iV(rV(this),e,arguments.length>1?arguments[1]:void 0)}));var oV=nV.findLastIndex,aV=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("findLastIndex",(function(e){return oV(aV(this),e,arguments.length>1?arguments[1]:void 0)}));var sV=po.forEach,lV=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("forEach",(function(e){sV(lV(this),e,arguments.length>1?arguments[1]:void 0)}));var cV=Ui.includes,uV=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("includes",(function(e){return cV(uV(this),e,arguments.length>1?arguments[1]:void 0)}));var hV=Ui.indexOf,dV=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("indexOf",(function(e){return hV(dV(this),e,arguments.length>1?arguments[1]:void 0)}));var fV=S,pV=x,gV=J,vV=NH,yV=Js,mV=Ot("iterator"),_V=fV.Uint8Array,bV=gV(yV.values),kV=gV(yV.keys),wV=gV(yV.entries),EV=vV.aTypedArray,TV=vV.exportTypedArrayMethod,SV=_V&&_V.prototype,CV=!pV((function(){SV[mV].call([1])})),xV=!!SV&&SV.values&&SV[mV]===SV.values&&"values"===SV.values.name,OV=function(){return bV(EV(this))};TV("entries",(function(){return wV(EV(this))}),CV),TV("keys",(function(){return kV(EV(this))}),CV),TV("values",OV,CV||!xV,{name:"values"}),TV(mV,OV,CV||!xV,{name:"values"});var PV=NH.aTypedArray,IV=NH.exportTypedArrayMethod,LV=J([].join);IV("join",(function(e){return LV(PV(this),e)}));var DV=rg,AV=ce,MV=Si,RV=Mi,NV=Po,jV=Math.min,BV=[].lastIndexOf,UV=!!BV&&1/[1].lastIndexOf(1,-0)<0,HV=NV("lastIndexOf"),FV=UV||!HV?function(e){if(UV)return DV(BV,this,arguments)||0;var t=AV(this),n=RV(t),i=n-1;for(arguments.length>1&&(i=jV(i,MV(arguments[1]))),i<0&&(i=n+i);i>=0;i--)if(i in t&&t[i]===e)return i||0;return-1}:BV,GV=rg,VV=FV,zV=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return GV(VV,zV(this),t>1?[e,arguments[1]]:[e])}));var WV=po.map,KV=FG,qV=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("map",(function(e){return WV(qV(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(KV(e))(t)}))}));var YV=hb.left,$V=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return YV($V(this),e,t,t>1?arguments[1]:void 0)}));var XV=hb.right,JV=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return XV(JV(this),e,t,t>1?arguments[1]:void 0)}));var ZV=NH.aTypedArray,QV=NH.exportTypedArrayMethod,ez=Math.floor;QV("reverse",(function(){for(var e,t=this,n=ZV(t).length,i=ez(n/2),r=0;r<i;)e=t[r],t[r++]=t[--n],t[n]=e;return t}));var tz=S,nz=D,iz=NH,rz=Mi,oz=JH,az=ct,sz=x,lz=tz.RangeError,cz=tz.Int8Array,uz=cz&&cz.prototype,hz=uz&&uz.set,dz=iz.aTypedArray,fz=iz.exportTypedArrayMethod,pz=!sz((function(){var e=new Uint8ClampedArray(2);return nz(hz,e,{length:1,0:3},1),3!==e[1]})),gz=pz&&iz.NATIVE_ARRAY_BUFFER_VIEWS&&sz((function(){var e=new cz(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));fz("set",(function(e){dz(this);var t=oz(arguments.length>1?arguments[1]:void 0,1),n=az(e);if(pz)return nz(hz,this,n,t);var i=this.length,r=rz(n),o=0;if(r+t>i)throw lz("Wrong length");for(;o<r;)this[t+o]=n[o++]}),!pz||gz);var vz=FG,yz=og,mz=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("slice",(function(e,t){for(var n=yz(mz(this),e,t),i=vz(this),r=0,o=n.length,a=new i(o);o>r;)a[r]=n[r++];return a}),x((function(){new Int8Array(1).slice()})));var _z=po.some,bz=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("some",(function(e){return _z(bz(this),e,arguments.length>1?arguments[1]:void 0)}));var kz=J,wz=x,Ez=ze,Tz=_u,Sz=AR,Cz=MR,xz=Pe,Oz=NR,Pz=NH.aTypedArray,Iz=NH.exportTypedArrayMethod,Lz=S.Uint16Array,Dz=Lz&&kz(Lz.prototype.sort),Az=!(!Dz||wz((function(){Dz(new Lz(2),null)}))&&wz((function(){Dz(new Lz(2),{})}))),Mz=!!Dz&&!wz((function(){if(xz)return xz<74;if(Sz)return Sz<67;if(Cz)return!0;if(Oz)return Oz<602;var e,t,n=new Lz(516),i=Array(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,i[e]=e-2*t+3;for(Dz(n,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(n[e]!==i[e])return!0}));Iz("sort",(function(e){return void 0!==e&&Ez(e),Mz?Dz(this,e):Tz(Pz(this),function(e){return function(t,n){return void 0!==e?+e(t,n)||0:n!=n?-1:t!=t?1:0===t&&0===n?1/t>0&&1/n<0?1:-1:t>n}}(e))}),!Mz||Az);var Rz=Di,Nz=Pi,jz=FG,Bz=NH.aTypedArray;(0,NH.exportTypedArrayMethod)("subarray",(function(e,t){var n=Bz(this),i=n.length,r=Nz(e,i);return new(jz(n))(n.buffer,n.byteOffset+r*n.BYTES_PER_ELEMENT,Rz((void 0===t?i:Nz(t,i))-r))}));var Uz=rg,Hz=NH,Fz=x,Gz=og,Vz=S.Int8Array,zz=Hz.aTypedArray,Wz=Hz.exportTypedArrayMethod,Kz=[].toLocaleString,qz=!!Vz&&Fz((function(){Kz.call(new Vz(1))}));Wz("toLocaleString",(function(){return Uz(Kz,qz?Gz(zz(this)):zz(this),Gz(arguments))}),Fz((function(){return[1,2].toLocaleString()!=new Vz([1,2]).toLocaleString()}))||!Fz((function(){Vz.prototype.toLocaleString.call([1,2])})));var Yz=NH.exportTypedArrayMethod,$z=x,Xz=J,Jz=S.Uint8Array,Zz=Jz&&Jz.prototype||{},Qz=[].toString,eW=Xz([].join);$z((function(){Qz.call({})}))&&(Qz=function(){return eW(this)});var tW=Zz.toString!=Qz;Yz("toString",Qz,tW);var nW=Mi,iW=function(e,t){for(var n=nW(e),i=new t(n),r=0;r<n;r++)i[r]=e[n-r-1];return i},rW=NH.aTypedArray,oW=NH.getTypedArrayConstructor;(0,NH.exportTypedArrayMethod)("toReversed",(function(){return iW(rW(this),oW(this))}));var aW=ze,sW=jG,lW=NH.aTypedArray,cW=NH.getTypedArrayConstructor,uW=NH.exportTypedArrayMethod,hW=J(NH.TypedArrayPrototype.sort);uW("toSorted",(function(e){void 0!==e&&aW(e);var t=lW(this),n=sW(cW(t),t);return hW(n,e)}));var dW=Mi,fW=Si,pW=RangeError,gW=function(e,t,n,i){var r=dW(e),o=fW(n),a=o<0?r+o:o;if(a>=r||a<0)throw pW("Incorrect index");for(var s=new t(r),l=0;l<r;l++)s[l]=l===a?i:e[l];return s},vW=eF,yW=Si,mW=iF,_W=NH.aTypedArray,bW=NH.getTypedArrayConstructor,kW=NH.exportTypedArrayMethod,wW=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(w7){return 8===w7}}();kW("with",{with:function(e,t){var n=_W(this),i=yW(e),r=vW(n)?mW(t):+t;return gW(n,bW(n),i,r)}}.with,!wW);for(var EW="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",TW={},SW=0;SW<66;SW++)TW[EW.charAt(SW)]=SW;var CW={itoc:EW,ctoi:TW},xW=Er,OW=be,PW=J,IW=x,LW=wo,DW=dt,AW=hu,MW=CW.ctoi,RW=/[^\d+/a-z]/i,NW=/[\t\n\f\r ]+/g,jW=/[=]+$/,BW=OW("atob"),UW=String.fromCharCode,HW=PW("".charAt),FW=PW("".replace),GW=PW(RW.exec),VW=IW((function(){return""!==BW(" ")})),zW=!IW((function(){BW("a")})),WW=!VW&&!zW&&!IW((function(){BW()})),KW=!VW&&!zW&&1!==BW.length;xW({global:!0,enumerable:!0,forced:VW||zW||WW||KW},{atob:function(e){if(AW(arguments.length,1),WW||KW)return BW(e);var t,n,i=FW(LW(e),NW,""),r="",o=0,a=0;if(i.length%4==0&&(i=FW(i,jW,"")),i.length%4==1||GW(RW,i))throw new(OW("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;t=HW(i,o++);)DW(MW,t)&&(n=a%4?64*n+MW[t]:MW[t],a++%4&&(r+=UW(255&n>>(-2*a&6))));return r}});var qW=Up,YW=O,$W=x,XW=sn,JW=xa,ZW=kP,QW=Error.prototype.toString,eK=$W((function(){if(YW){var e=JW(Object.defineProperty({},"name",{get:function(){return this===e}}));if("true"!==QW.call(e))return!0}return"2: 1"!==QW.call({message:1,name:2})||"Error"!==QW.call({})}))?function(){var e=XW(this),t=ZW(e.name,"Error"),n=ZW(e.message);return t?n?t+": "+n:t:n}:QW,tK={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}},nK=Er,iK=function(e){try{if(qW)return Function('return require("'+e+'")')()}catch(w7){}},rK=be,oK=x,aK=xa,sK=U,lK=tn.f,cK=bi,uK=Bl,hK=dt,dK=Fl,fK=sn,pK=eK,gK=kP,vK=tK,yK=PP,mK=ii,_K=O,bK="DOMException",kK="DATA_CLONE_ERR",wK=rK("Error"),EK=rK(bK)||function(){try{(new(rK("MessageChannel")||iK("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(w7){if(w7.name==kK&&25==w7.code)return w7.constructor}}(),TK=EK&&EK.prototype,SK=wK.prototype,CK=mK.set,xK=mK.getterFor(bK),OK="stack"in wK(bK),PK=function(e){return hK(vK,e)&&vK[e].m?vK[e].c:0},IK=function(){dK(this,LK);var e=arguments.length,t=gK(e<1?void 0:arguments[0]),n=gK(e<2?void 0:arguments[1],"Error"),i=PK(n);if(CK(this,{type:bK,name:n,message:t,code:i}),_K||(this.name=n,this.message=t,this.code=i),OK){var r=wK(t);r.name=bK,lK(this,"stack",sK(1,yK(r.stack,1)))}},LK=IK.prototype=aK(SK),DK=function(e){return{enumerable:!0,configurable:!0,get:e}},AK=function(e){return DK((function(){return xK(this)[e]}))};_K&&(uK(LK,"code",AK("code")),uK(LK,"message",AK("message")),uK(LK,"name",AK("name"))),lK(LK,"constructor",sK(1,IK));var MK=oK((function(){return!(new EK instanceof wK)})),RK=MK||oK((function(){return SK.toString!==pK||"2: 1"!==String(new EK(1,2))})),NK=MK||oK((function(){return 25!==new EK(1,"DataCloneError").code}));MK||25!==EK.DATA_CLONE_ERR||TK.DATA_CLONE_ERR;nK({global:!0,constructor:!0,forced:MK},{DOMException:MK?IK:EK});var jK=rK(bK),BK=jK.prototype;for(var UK in RK&&EK===jK&&cK(BK,"toString",pK),NK&&_K&&EK===jK&&uK(BK,"code",DK((function(){return PK(fK(this).name)}))),vK)if(hK(vK,UK)){var HK=vK[UK],FK=HK.s,GK=sK(6,HK.c);hK(jK,FK)||lK(jK,FK,GK),hK(BK,FK)||lK(BK,FK,GK)}var VK=Er,zK=S,WK=be,KK=U,qK=tn.f,YK=dt,$K=Fl,XK=sk,JK=kP,ZK=tK,QK=PP,eq=O,tq="DOMException",nq=WK("Error"),iq=WK(tq),rq=function(){$K(this,oq);var e=arguments.length,t=JK(e<1?void 0:arguments[0]),n=JK(e<2?void 0:arguments[1],"Error"),i=new iq(t,n),r=nq(t);return r.name=tq,qK(i,"stack",KK(1,QK(r.stack,1))),XK(i,this,rq),i},oq=rq.prototype=iq.prototype,aq="stack"in nq(tq),sq="stack"in new iq(1,2),lq=iq&&eq&&Object.getOwnPropertyDescriptor(zK,tq),cq=!(!lq||lq.writable&&lq.configurable),uq=aq&&!cq&&!sq;VK({global:!0,constructor:!0,forced:uq},{DOMException:uq?rq:iq});var hq=WK(tq),dq=hq.prototype;if(dq.constructor!==hq)for(var fq in qK(dq,"constructor",KK(1,hq)),ZK)if(YK(ZK,fq)){var pq=ZK[fq],gq=pq.s;YK(hq,gq)||qK(hq,gq,KK(6,pq.c))}var vq="DOMException";rs(be(vq),vq);var yq=Er,mq=be,_q=J,bq=x,kq=wo,wq=hu,Eq=CW.itoc,Tq=mq("btoa"),Sq=_q("".charAt),Cq=_q("".charCodeAt),xq=!!Tq&&!bq((function(){Tq()})),Oq=!!Tq&&bq((function(){return"bnVsbA=="!==Tq(null)})),Pq=!!Tq&&1!==Tq.length;yq({global:!0,enumerable:!0,forced:xq||Oq||Pq},{btoa:function(e){if(wq(arguments.length,1),xq||Oq||Pq)return Tq(kq(e));for(var t,n,i=kq(e),r="",o=0,a=Eq;Sq(i,o)||(a="=",o%1);){if((n=Cq(i,o+=3/4))>255)throw new(mq("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");r+=Sq(a,63&(t=t<<8|n)>>8-o%1*8)}return r}});var Iq={exports:{}};Iq.exports=function e(t,n,i){var r,o,a=window,s="application/octet-stream",l=i||s,c=t,u=!n&&!i&&c,h=document.createElement("a"),d=function(e){return String(e)},f=a.Blob||a.MozBlob||a.WebKitBlob||d,p=n||"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):b(c);l=(c=_(c)).type||s}else if(/([\x80-\xff])/.test(c)){for(var v=0,y=new Uint8Array(c.length),m=y.length;v<m;++v)y[v]=c.charCodeAt(v);c=new f([y],{type:l})}function _(e){for(var t=e.split(/[:;,]/),n=t[1],i=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),r=i.length,o=0,a=new Uint8Array(r);o<r;++o)a[o]=i.charCodeAt(o);return new f([a],{type:n})}function b(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 n=document.createElement("iframe");document.body.appendChild(n),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),n.src=e,setTimeout((function(){document.body.removeChild(n)}),333)}if(r=c instanceof f?c:new f([c],{type:l}),navigator.msSaveBlob)return navigator.msSaveBlob(r,p);if(a.URL)b(a.URL.createObjectURL(r),!0);else{if("string"==typeof r||r.constructor===d)try{return b("data:"+l+";base64,"+a.btoa(r))}catch(k){return b("data:"+l+","+encodeURIComponent(r))}(o=new FileReader).onload=function(e){b(this.result)},o.readAsDataURL(r)}return!0};var Lq=Iq.exports;function Dq(){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 Aq=function(e){CM(n,e);var t=LM(n);function n(e){var i;return wM(this,n),SM(PM(i=t.call(this,e)),"download",(function(e){if(!i.isLock){i.emitUserAction(e,"download");var t=i.getAbsoluteURL(i.player.src);Lq(t),i.isLock=!0,i.timer=window.setTimeout((function(){i.isLock=!1,window.clearTimeout(i.timer),i.timer=null}),300)}})),i.timer=null,i.isLock=!1,i}return TM(n,[{key:"afterCreate",value:function(){AM(xM(n.prototype),"afterCreate",this).call(this),this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.download),this.bind(["click","touchend"],this.download))}},{key:"registerIcons",value:function(){return{download:Dq}}},{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(){AM(xM(n.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(TB(this,"DOWNLOAD_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:Uj.CONTROLS_RIGHT,index:3,disable:!0}}}]),n}(PU),Mq=function(e){CM(n,e);var t=LM(n);function n(){return wM(this,n),t.apply(this,arguments)}return TM(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){AM(xM(n.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(tj,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 n=document.createElement("a");n.href=e,n.download=t;var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}},{key:"createCanvas",value:function(e,t){var n=document.createElement("canvas"),i=n.getContext("2d");this.canvasCtx=i,this.canvas=n,n.width=e||this.config.width,n.height=t||this.config.height,i.imageSmoothingEnabled=!0,i.imageSmoothingEnabled&&(i.imageSmoothingQuality="high")}},{key:"onClickBtn",value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot"),this.shot().then((function(e){t.emit(rj,e),t.saveScreenShot(e,t.config.name+t.config.format)}))}},{key:"shot",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},r=this.config,o=this.player,a=i.quality||r.quality,s=i.type||r.type;return new Promise((function(i,l){var c,u=null;if(o.media.canvas)u=o.media.canvas;else{n.canvas?(n.canvas.width=e||r.width,n.canvas.height=t||r.height):n.createCanvas(e,t),u=n.canvas,c=n.canvasCtx;var h,d,f,p,g=o.media.videoWidth/o.media.videoHeight,v=u.width/u.height,y=o.media.videoWidth,m=o.media.videoHeight;g>v?(f=u.width,p=u.width/g,h=0,d=Math.round((u.height-p)/2)):g===v?(f=u.width,p=u.height,h=0,d=0):g<v&&(f=u.height*g,p=u.height,h=Math.round((u.width-f)/2),d=0),c.drawImage(o.media,0,0,y,m,h,d,f,p)}var _=u.toDataURL(s,a).replace(s,"image/octet-stream");i(_=_.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){AM(xM(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(tj,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:Uj.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,fitVideo:!0,disable:!1,name:"screenshot"}}}]),n}(PU),Rq=function(){function e(t){wM(this,e),this.config=t.config,this.parent=t.root,this.root=cN.createDom("ul","",{},"xg-options-list ".concat(this.config.className)),t.root.appendChild(this.root),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var n="mobile"===vN.device?"touchend":"click";this._delegates=Vj.delegate.call(this,this.root,"li",n,this.onItemClick)}return TM(e,[{key:"renderItemList",value:function(e){var t=this,n=this.config,i=this.root;e?n.data=e:e=n.data,n.style&&Object.keys(n.style).map((function(e){i.style[e]=n[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,n){var i=e.selected?"option-item selected":"option-item";e["data-index"]=n,t.root.appendChild(cN.createDom("li","<span>".concat(e.showText,"</span>"),e,i))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&cN.hasClass(t,"selected"))return!1;var n="function"==typeof this.config.onItemClick?this.config.onItemClick:null,i=this.root.querySelector(".selected");cN.addClass(t,"selected"),i&&cN.removeClass(i,"selected"),n(e,{from:i?this.getAttrObj(i,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var n={};t.map((function(t){n[t]=e.getAttribute(t)}));var i=e.getAttribute("data-index");return i&&(n.index=Number(i)),n}},{key:"show",value:function(){cN.removeClass(this.root,"hide"),cN.addClass(this.root,"active")}},{key:"hide",value:function(){cN.removeClass(this.root,"active"),cN.addClass(this.root,"hide")}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).forEach((function(n){t.root.style[n]=e[n]}))}},{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}(),Nq="side",jq="middle",Bq="click",Uq="hover";var Hq="mobile"===vN.device,Fq=function(e){CM(n,e);var t=LM(n);function n(e){var i;return wM(this,n),SM(PM(i=t.call(this,e)),"onEnter",(function(e){e.preventDefault(),e.stopPropagation(),i.emit("icon_mouseenter",{pluginName:i.pluginName}),i.switchActiveState(e)})),SM(PM(i),"switchActiveState",(function(e){e.preventDefault(),e.stopPropagation(),i.config.toggleMode===Bq?i.toggle(!i.isActive):i.toggle(!0)})),SM(PM(i),"onLeave",(function(e){e.preventDefault(),e.stopPropagation(),i.emit("icon_mouseleave",{pluginName:i.pluginName}),i.config.listType!==Nq&&i.isActive&&i.toggle(!1)})),SM(PM(i),"onListEnter",(function(e){i.enterType=2})),SM(PM(i),"onListLeave",(function(e){i.enterType=0,i.isActive&&i.toggle(!1)})),i.isIcons=!1,i.isActive=!1,i.curValue=null,i.curIndex=0,i}return TM(n,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.initIcons(),Hq&&t.listType!==jq&&(t.listType=Nq),t.hidePortrait&&cN.addClass(this.root,"portrait"),this.once(IN,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),Hq&&this.on(BN,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),Hq?(t.toggleMode=Bq,this.activeEvent="touchend"):this.activeEvent=t.toggleMode===Bq?"click":"mouseenter",t.toggleMode===Bq?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,n=Object.keys(t),i=!1;n.length>0&&(n.forEach((function(n){e.appendChild(".xgplayer-icon",t[n]),!i&&(i=t[n])})),this.isIcons=i),i||(this.appendChild(".xgplayer-icon",cN.createDom("span","",{},"icon-text")),cN.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(){!this.config.list||this.config.list.length<2||cN.addClass(this.root,"show")}},{key:"hide",value:function(){cN.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,n){if(void 0===e)return"";var i=this.config.list;!n&&(n=this.player.lang),t=!t||cN.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=i[e]);try{return"object"===kM(e[t])?e[t][n]||e[t].en:e[t]}catch(r){return console.warn(r),""}}},{key:"toggle",value:function(e){if(e!==this.isActive){var t=this.player.controls,n=this.config.listType;e?(n===Nq?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):(n===Nq?t.focus():t.focusAwhile(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.preventDefault(),e.stopPropagation();var n=this.config,i=n.listType,r=n.list;this.curIndex=t.to.index,this.curItem=r[this.curIndex],this.changeCurrentText(),(this.config.isItemClickHide||Hq||i===Nq)&&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 n=this,i=this.config,r=this.optionsList,o=this.player;if("number"==typeof t&&(this.curIndex=t,this.curItem=i.list[t]),r)return r.renderItemList(e),void this.changeCurrentText();var a,s,l={config:{data:e||[],className:(a=i.listType,s=i.position,a===Nq?s===Uj.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""),onItemClick:function(e,t){n.onItemClick(e,t)}},root:i.listType===Nq?o.innerContainer||o.root:this.root};this.config.isShowIcon&&(this.optionsList=new Rq(l),this.changeCurrentText(),this.show());var c=this.player.root.getBoundingClientRect().height,u=i.listType===jq?c-50:c;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(u,"px")})}},{key:"destroy",value:function(){this.config.toggleMode===Bq?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:Uj.CONTROLS_RIGHT,index:100,list:[],listType:"middle",listStyle:{},hidePortrait:!0,isShowIcon:!1,isItemClickHide:!0,toggleMode:Uq}}}]),n}(Vj),Gq=function(e){CM(n,e);var t=LM(n);function n(e){var i;return wM(this,n),(i=t.call(this,e)).curTime=0,i.isPaused=!0,i}return TM(n,[{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;AM(xM(n.prototype),"afterCreate",this).call(this),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(ZN,(function(t){e.renderItemList(e.config.list,t.to)})),this.player.definitionList.length<2&&this.hide()}},{key:"show",value:function(){!this.config.list||this.config.list.length<2||cN.addClass(this.root,"show")}},{key:"initDefinition",value:function(){var e=this.config,t=e.list,n=e.defaultDefinition;if(t.length>0){var i=null;t.map((function(e){e.definition===n&&(i=e)})),i||(i=t[0]),this.changeDefinition(i)}}},{key:"renderItemList",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.list||[],i=arguments.length>1?arguments[1]:void 0,r=i&&i.definition?i.definition:this.config.defaultDefinition;i&&t.forEach((function(e){e.selected=!1}));var o=0,a=t.map((function(t,n){var i=bM(bM({},t),{},{showText:e.getTextByLang(t)||t.definition,selected:!1});return(t.selected||t.definition&&t.definition==r)&&(i.selected=!0,o=n),i}));AM(xM(n.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 i=this.player.definitionList;AM(xM(n.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var r=0;r<i.length;r++)t.to&&i[r].definition===t.to.definition&&(t.to.url=i[r].url),t.from&&i[r].definition===t.from.definition&&(t.from.url=i[r].url);this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return bM(bM({},Fq.defaultConfig),{},{position:Uj.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),n}(Fq),Vq=function(e){CM(n,e);var t=LM(n);function n(e){var i;return wM(this,n),(i=t.call(this,e)).curRate=1,i}return TM(n,[{key:"beforeCreate",value:function(e){var t=e.player.config.playbackRate,n=t?Array.isArray(t)?t:e.config.list:[];Array.isArray(n)&&(e.config.list=n.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;AM(xM(n.prototype),"afterCreate",this).call(this),this.on(MN,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(){this.config.list&&0!==this.config.list.length&&AM(xM(n.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){AM(xM(n.prototype),"onItemClick",this).apply(this,arguments);var i=e.delegateTarget,r=Number(i.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 i=-1,r=this.config.list.map((function(n,r){var o={rate:n.rate};return o.rate===t&&(o.selected=!0,i=r),o.showText=e.getTextByLang(n),o}));AM(xM(n.prototype),"renderItemList",this).call(this,r,i)}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0],n="";n=!t||this.curIndex<0?"".concat(this.player.playbackRate,"x"):this.getTextByLang(t,"iconText"),this.find(".icon-text").innerHTML=n}}},{key:"destroy",value:function(){AM(xM(n.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return bM(bM({},Fq.defaultConfig),{},{position:Uj.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),n}(Fq);function zq(){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 Wq(){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 Kq=function(e){CM(n,e);var t=LM(n);function n(){return wM(this,n),t.apply(this,arguments)}return TM(n,[{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;AM(xM(n.prototype),"afterCreate",this).call(this),this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(XN,(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,n=this.find(".xg-tips");n&&this.changeLangTextKey(n,e?t.EXITCSSFULLSCREEN_TIPS:t.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:zq,class:"xg-get-cssfull"},exitCssFullscreen:{icon:Wq,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){AM(xM(n.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(TB(this,"CSSFULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:Uj.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),n}(PU),qq=function(e){CM(n,e);var t=LM(n);function n(){return wM(this,n),t.apply(this,arguments)}return TM(n,[{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(SN,(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,n=e.errorType,i=t.errorNote?this.i18n[t.errorNote]:"";if(!i)switch(n){case"decoder":i=this.i18n.MEDIA_ERR_DECODE;break;case"network":i=this.i18n.MEDIA_ERR_NETWORK;break;default:i=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=i,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"}}]),n}(Vj),Yq=function(e){CM(n,e);var t=LM(n);function n(){return wM(this,n),t.apply(this,arguments)}return TM(n,[{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.show.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).map((function(n){t.root.style[n]=e[n]}))}},{key:"show",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){this.customOnClick=i;var r=this.config.interval;this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),cN.addClass(this.root,"show"),"arrow"===n.mode&&cN.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>"):""),n.style&&this.setStyle(n.style);var o="boolean"==typeof n.autoHide?n.autoHide:this.config.autoHide;if(o){var a=n.interval||r;this.intervalId=setTimeout((function(){t.hide()}),a)}}}},{key:"hide",value:function(){cN.removeClass(this.root,"show"),cN.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(qj.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(){}}}}]),n}(Vj),$q={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function Xq(e){Object.keys($q).map((function(t){void 0===e[t]&&(e[t]=$q[t])}))}var Jq={_updateDotDom:function(e,t){if(t){var n=this.calcuPosition(e.time,e.duration),i=e.style||{};i.left="".concat(n.left,"%"),i.width="".concat(n.width,"%"),t.setAttribute("data-text",e.text),t.setAttribute("data-time",e.time),n.isMini?cN.addClass(t,"mini"):cN.removeClass(t,"mini"),Object.keys(i).map((function(e){t.style[e]=i[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],n=this.player.plugins.progress;if(n&&(t&&(Xq(e),this._ispots.push(e)),this.ispotsInit||!t)){var i=this.calcuPosition(e.time,e.duration),r=e.style||{};r.left="".concat(i.left,"%"),r.width="".concat(i.width,"%");var o="xgspot_".concat(e.id," xgplayer-spot");i.isMini&&(o+=" mini");var a=cN.createDom("xg-spot",e.template||"",{"data-text":e.text,"data-time":e.time,"data-id":e.id},o);Object.keys(r).map((function(e){a.style[e]=r[e]})),n.outer&&n.outer.appendChild(a)}},findDot:function(e){if(this.player.plugins.progress){var t=this._ispots.filter((function(t,n){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],n=this.player.plugins.progress;if(n){var i=this.findDot(e.id);if(i&&Object.keys(e).map((function(t){i[t]=e[t]})),this.ispotsInit){var r=n.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,n=this.player.plugins.progress;if(n){for(var i=[],r=0;r<t.length;r++)t[r].id===e&&i.push(r);for(var o=i.length-1;o>=0;o--)if(t.splice(i[o],1),this.ispotsInit){var a=n.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"),n=t.length-1;n>=0;n--)e.outer.removeChild(t[n]);this._ispots=[]}else this._ispots=[]},updateAllDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.player.plugins.progress;if(n)if(this.ispotsInit){this._ispots=[];var i=n.root.getElementsByTagName("xg-spot"),r=i.length;if(r>t.length)for(var o=r-1;o>t.length-1;o--)n.outer.removeChild(i[o]);t.forEach((function(t,n){n<r?(i[n].setAttribute("data-id","".concat(t.id)),e._ispots.push(t),e.updateDot(t)):e.createDot(t)}))}else this._ispots=t},updateDuration:function(){var e=this,t=this.player.plugins.progress;t&&this._ispots.forEach((function(n){var i=t.find('xg-spot[data-id="'.concat(n.id,'"]'));e._updateDotDom(n,i)}))},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 Zq={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMove"},Qq=function(e){CM(n,e);var t=LM(n);function n(e){var i;return wM(this,n),SM(PM(i=t.call(this,e)),"onMousemove",(function(e){i.config.disable||(cN.hasClass(e.target,"xg-spot-content")&&i.config.isHideThumbnailHover?i.player.plugins.progress.onMouseLeave(e):(i._state.f||cN.hasClass(e.target,"xg-spot-content"))&&(cN.event(e),e.stopPropagation()))})),SM(PM(i),"onMousedown",(function(e){i.config.disable||(i._state.f||cN.hasClass(e.target,"xg-spot-content"))&&(cN.event(e),e.stopPropagation())})),SM(PM(i),"onMouseup",(function(e){if(i.isDrag){var t=i.player.plugins.progress;t&&t.pos&&(t.onMouseUp(e),!t.pos.isEnter&&t.onMouseLeave(e))}})),SM(PM(i),"onDotMouseLeave",(function(e){if(!i.config.disable){i._curDot.removeEventListener("mouseleave",i.onDotMouseLeave),i.blurDot(e.target),i._curDot=null;var t=i.player.plugins.progress;t&&t.enableBlur(),i.show()}})),SM(PM(i),"onProgressMouseOver",(function(e,t){if(!i.config.disable&&cN.hasClass(t.target,"xgplayer-spot")&&!i._curDot){i._curDot=t.target,i.focusDot(t.target),i._curDot.children.length>0&&i.hide();var n=i.player.plugins.progress;n&&n.disableBlur(),i._curDot.addEventListener("mouseleave",i.onDotMouseLeave)}})),i._ispots=[],i.videoPreview=null,i.videothumbnail=null,i.thumbnail=null,i.timeStr="",i._state={now:0,f:!1},i}return TM(n,[{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,n){n.currentTime&&e.player.seek(n.currentTime)})),this.transformTimeHook=this.hook("transformTime",(function(t){e.setTimeContent(cN.format(t))})),function(e){var t=e.config,n=e.player;Object.keys(Jq).map((function(t){e[t]=Jq[t].bind(e)}));var i=n.config.progressDot||t.ispots||[];e._ispots=i.map((function(e){return Xq(e),e})),e.ispotsInit=!1,e.on(LN,(function(){e.ispotsInit?e.updateDuration():e.initDots()}))}(this),this.on(LN,(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(n){t.config[n]=e[n]}))}},{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(Zq).map((function(n){e[Zq[n]]=e[Zq[n]].bind(e),t.addCallBack(n,e[Zq[n]])})),"mobile"!==vN.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 n=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(t){t.stopPropagation(),n(parseInt(1e3*e._state.now,10)/1e3,t)},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&&cN.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&cN.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){this.config.disable||cN.hasClass(t.target,"xgplayer-spot")&&(t.stopPropagation(),t.preventDefault(),["time","id","text"].map((function(n){e[n]=t.target.getAttribute("data-".concat(n))})),e.time&&(e.time=Number(e.time)),this.handlerSpotClick(t,e))}},{key:"updateLinePos",value:function(e,t){var n=this.root,i=this.previewLine,r=this.timePoint,o=this.player,a=this.config,s="flex"===o.controls.mode,l=n.getBoundingClientRect().width;if(l){var c,u,h=r.getBoundingClientRect().width,d=e-(l=this._hasThumnail&&l<a.width?a.width:l)/2;d<0&&!s?(d=0,c=e-l/2,!this.thumbnail&&(u=e-l/2-h/2)):d>t-l&&!s?(c=d-(t-l),!this.thumbnail&&(u=d-(t-l)-h/2),d=t-l):(c=0,!this.thumbnail&&(u=-h/2)),void 0!==c&&(i.style.transform="translateX(".concat(c.toFixed(2),"px)")),void 0!==u&&(r.style.transform="translateX(".concat(u.toFixed(2),"px)")),n.style.transform="translateX(".concat(d.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var t=this.timeText,n=this.timePoint;t.textContent=e,!this.thumbnail&&(n.textContent=e)}},{key:"updatePosition",value:function(e,t,n,i){var r=this.root,o=this.config,a=this._state;if(r){this.updateLinePos(e,t),a.now=n,this.transformTimeHook(n);var s=this.timeStr;i&&i.target&&cN.hasClass(i.target,"xgplayer-spot")?(this.showTips(i.target.getAttribute("data-text"),!1,s),this.focusDot(i.target),a.f=!0,o.isFocusDots&&a.f&&(a.now=parseInt(i.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)}}},{key:"setTimeContent",value:function(e){this.timeStr=e}},{key:"updateThumbnails",value:function(e){var t=this.player,n=this.videoPreview,i=this.config,r=t.plugins.thumbnail;if(r&&r.usable){this.thumbnail&&r.update(this.thumbnail,e,i.width,i.height);var o=n&&n.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"!==vN.device){var t=this.player,n=this.config,i=t.getPlugin("thumbnail");if(i&&i.setConfig(e),i&&i.usable&&n.isShowThumbnail){cN.removeClass(this.root,"short-line no-thumbnail"),"short"===n.mode&&cN.addClass(this.root,"short-line"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.thumbnail=i.createThumbnail(r,"progress-thumbnail"),n.isShowCoverPreview&&(this.videoPreview=cN.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=i.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else cN.addClass(this.root,"short-line no-thumbnail")}}},{key:"calcuPosition",value:function(e,t){var n=this.player.plugins.progress,i=this.player,r=n.root.getBoundingClientRect().width,o=i.duration/r*6;return e+t>i.duration&&(t=i.duration-e),i.duration,i.duration,{left:e/i.duration*100,width:t/i.duration*100,isMini:t<o}}},{key:"showDot",value:function(e){var t=this.findDot(e);if(t){var n=this.root.getBoundingClientRect().width,i=t.time/this.player.duration*n;this.updatePosition(i,n,t.time)}}},{key:"focusDot",value:function(e,t){e&&(t||(t=e.getAttribute("data-id")),cN.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(cN.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";cN.addClass(this.root,"no-timepoint"),e&&(cN.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(cN.addClass(this.root,"product"),this.tipText.textContent=e):(cN.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(n," ").concat(e)))}},{key:"hideTips",value:function(){cN.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",cN.removeClass(this.find(".xg-spot-content"),"show-text"),cN.removeClass(this.root,"product")}},{key:"hide",value:function(){cN.addClass(this.root,"hide")}},{key:"show",value:function(){cN.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(Zq).map((function(n){t.removeCallBack(n,e[Zq[n]])})),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"===vN.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}}}]),n}(Vj),eY=function(e){CM(n,e);var t=LM(n);function n(e){var i;return wM(this,n),(i=t.call(this,e)).ratio=1,i.interval=null,i._preloadMark={},i}return TM(n,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([LN],(function(){var t=e.config,n=t.pic_num,i=t.interval;e.usable&&(e.interval=i>0?i:Math.round(1e3*e.player.duration/n)/1e3)}))}},{key:"setConfig",value:function(e){var t=this;if(e){var n=Object.keys(e);n.length<1||(n.forEach((function(n){t.config[n]=e[n]})),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,t=e.urls,n=e.pic_num;return t&&t.length>0&&n>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,n=e.height,i=e.pic_num,r=e.interval;this.ratio=t/n*100,this.interval=r||Math.round(this.player.duration/i),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 n=this.config.urls,i=n.length,r=[];e>0&&r.push(e-1),r.push(e),e>0&&e<i-1&&r.push(e+1),r.map((function(e){!t._preloadMark[e]&&e>=0&&e<i&&(t._preloadMark[e]=1,cN.preloadImg(n[e],(function(){t._preloadMark[e]=2})))}))}}},{key:"getPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.config,r=i.pic_num,o=i.row,a=i.col,s=i.width,l=i.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;if(t&&n){var v=t/n;v<s/l?p=(g=n)*(s/l):g=(p=t)/(s/l)}else n?t||(p=(g=n||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 n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=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,n,i);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 n=cN.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(n),n}}],[{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}}}]),n}(Vj),tY=function(e){CM(n,e);var t=LM(n);function n(){return wM(this,n),t.apply(this,arguments)}return TM(n,[{key:"afterCreate",value:function(){}},{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(){if(this.playerConfig.progress&&this.playerConfig.miniprogress)return'<xg-mini-progress class="xg-mini-progress">\n <xg-mini-progress-cache class="xg-mini-progress-cache"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played"></xg-mini-progress-played>\n </xg-mini-progress>'}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{}}}]),n}(Vj),nY="realtime",iY="firstframe",rY="poster";function oY(){try{return parseInt(window.performance.now(),10)}catch(xX){return(new Date).getTime()}}var aY=null,sY=function(e){CM(n,e);var t=LM(n);function n(){var e;wM(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return SM(PM(e=t.call.apply(t,[this].concat(r))),"onLoadedData",(function(t){e.player&&(e._frameCount=e.config.startFrameCount,e.renderOnTimeupdate(t),e.off(ON,e.renderOnTimeupdate),e.on(ON,e.renderOnTimeupdate))})),SM(PM(e),"renderOnTimeupdate",(function(t){e._frameCount>0?(e.renderOnce(),e._frameCount--):(e._isLoaded=!0,e.off(ON,e.renderOnTimeupdate),!e.player.paused&&e._checkIfCanStart()&&e.start())})),SM(PM(e),"start",(function(){var t=e.player.media,n=oY(),i=e.checkVideoIsSupport(t);i&&e.canvasCtx&&(e.stop(),t.videoWidth&&t.videoHeight&&(e.videoPI=t.videoHeight>0?parseInt(t.videoWidth/t.videoHeight*100,10):0,(e.config.mode===nY||n-e.preTime>=e.interval)&&(t&&t.videoWidth&&e.update(i,e.videoPI),e.preTime=n)),e.frameId=cN.requestAnimationFrame(e.start))})),SM(PM(e),"stop",(function(){e.frameId&&(cN.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return TM(n,[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),n.isSupport||(this.config.disable=!0);var t=this.config,i=t.disable,r=t.mode,o=t.frameRate;i||(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.once(zN,(function(){e.player&&(e.init(),e.player.paused||e.start())})),r!==rY&&(r!==iY&&(this.on(jN,(function(){e.stop()})),this.on(kN,(function(){e._checkIfCanStart()&&e.start()})),this.on(TN,(function(){e.stop()}))),this.on(AN,this.onLoadedData),this.on(NN,(function(){e._isLoaded=!1,e.stop()}))))}},{key:"init",value:function(){var e=this.player,t=this.config;this.canvasFilter=n.supportCanvasFilter();try{var i=this.config.isInnerRender&&e.innerContainer||e.root;i.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg"><canvas>\n </canvas><xgmask></xgmask></div>'),this.root=i.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=t.filter,this.canvas.style.webkitFilter=t.filter),this.mask=this.find("xgmask"),t.addMask&&(this.mask.style.background=t.maskBg),this.canvasCtx=this.canvas.getContext("2d"),this.renderByPoster()}catch(xX){sN.logError("plugin:DynamicBg",xX)}}},{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"!==vN.browser||!/^blob/.test(t.currentSrc)&&!/^blob/.test(t.src)))return t;var n=t?t.tagName.toLowerCase():"";return"canvas"===n||"img"===n?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===cN.typeOf(e)?e:"String"===cN.typeOf(e.poster)?e.poster:null;this.updateImg(t)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&e!==iY&&e!==rY}},{key:"renderOnce",value:function(){var e=this.player.media;if(e.videoWidth&&e.videoHeight){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var t=this.checkVideoIsSupport(e);t&&e.videoWidth&&this.update(t,this.videoPI)}}},{key:"updateImg",value:function(e){var t=this;if(e){var n=this.canvas.getBoundingClientRect(),i=n.width,r=n.height,o=new window.Image;o.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=r,t.canvas.width=i;var e=parseInt(i/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 n=this._pos,i=this.config,r=this.canvas.getBoundingClientRect(),o=r.width,a=r.height;if(o!==n.width||a!==n.height||n.pi!==t){var s=parseInt(o/a*100,10);n.pi=t,n.width=this.canvas.width=o,n.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)),n.rwidth=c*i.multiple,n.rheight=l*i.multiple,n.x=(o-n.rwidth)/2,n.y=(a-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=i.filter),this.canvasCtx.drawImage(e,n.x,n.y,n.rwidth,n.rheight)}catch(xX){sN.logError("plugin:DynamicBg",xX)}}},{key:"destroy",value:function(){this.stop(),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,mode:"framerate",frameRate:10,filter:"blur(50px)",startFrameCount:2,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof aY?aY:aY=function(){try{return!!document.createElement("canvas").getContext}catch(xX){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===vN.browser||"firefox"===vN.browser)}}]),n}(Vj),lY="info",cY=hj,uY=function(e){CM(n,e);var t=LM(n);function n(){var e;wM(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return SM(PM(e=t.call.apply(t,[this].concat(r))),"_recordUserActions",(function(t){var n=e._getTime(),i=Object.assign({},t,{msg:t.msg||t.action});e._stats.info.push(bM(bM({type:"userAction"},n),{},{payload:i}))})),SM(PM(e),"_onReset",(function(){e.reset()})),SM(PM(e),"_recordInfo",(function(t){e.info(t)})),SM(PM(e),"_downloadStats",(function(){var t=e.getStats(),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=window.URL.createObjectURL(n),r=document.createElement("a");r.style.display="none",r.href=i,r.download="player.txt",r.disabled=!1,r.click()})),e}return TM(n,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(lj,this._recordUserActions),this.on(cY.STATS_INFO,this._recordInfo),this.on(cY.STATS_DOWNLOAD,this._downloadStats),this.on(cY.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.info.push(bM(bM({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=bM({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=(SM(e={},lY,[]),SM(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player.media,t=[],n=0;n<e.buffered.length;n++)t.push({start:e.buffered.start(n),end:e.buffered.end(n)});var i={currentTime:e.currentTime,readyState:e.readyState,buffered:t,paused:e.paused,ended:e.ended};return this._stats.media=i,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){return this._stats.info.map((function(e){var t=e.payload.data,n="";try{t instanceof Error?n=t.msg:void 0!==t&&(n=JSON.stringify(t))}catch(w7){console.log("err",w7)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(n," ")}))}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats.info.forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),n}(Dj),hY=function(e){CM(n,e);var t=LM(n);function n(){var e;wM(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return SM(PM(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=PM(e),i=t.player,r=t.config;if(i.media.readyState!==HTMLMediaElement.HAVE_NOTHING){if(i.media.seeking){if(!e.seekingEventReceived)return}else e.seekingEventReceived=!1;if(!i.media.paused||0===i.media.currentTime||!e.hasPlayed){var o=i.media.buffered,a=r.smallGapLimit||.5,s=r.gapDetectionThreshold||.3,l=i.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>i.media.duration)){var h=u-l,d=h<=a;h<n.BROWSER_GAP_TOLERANCE||d&&(!1!==r.useGapJump&&(i.media.currentTime=e.isSafari?u+.1:u),e.player&&e.player.emit("detectGap"),console.log("gapJump gapIndex",c," isGapSamll:",d," currentTime:",i.media.currentTime," jumpSize:",l-i.media.currentTime),.08!==u&&i&&i.emit("log",{type:"oneevent",end_type:"gap",vid:i.config.vid,ext:{video_postion:Math.floor(1e3*u)}}))}}}}})),e}return TM(n,[{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(PN,this.onGapJump),this.on(kN,(function(){e.hasPlayed=!0})),this.on(CN,(function(){e.seekingEventReceived=!0})))}},{key:"_getIndex",value:function(e,t,n){if(!e||!e.length)return null;if(1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var i=this._getBuffered(e),r=null,o=0;o<i.length;o++){if(i[o].start>t&&(0===o||i[o-1].end-t<=n)){r=o;break}}return r}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),n}(Vj);hY.BROWSER_GAP_TOLERANCE=.001;var dY=function(e){CM(n,e);var t=LM(n);function n(){var e;wM(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return SM(PM(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=PM(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),SM(PM(e),"onJump",(function(){var t=PM(e),n=t.player,i=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>i.jumpCntMax||!1===i.useWaitingTimeoutJump||n.media.paused&&0!==n.media.currentTime&&e.hasPlayed)){e.jumpSize=i.jumpSize*(e.jumpCnt+1),e.jumpCnt===i.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var r=n.currentTime+e.jumpSize;r>n.media.duration||(console.log("waitintTimeout, currentTime:",n.currentTime,", jumpTo:",r),e.jumpCnt++,n.currentTime=r)}})),e}return TM(n,[{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.useWaitingTimeoutJump,i=t.jumpSize;!1!==n&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=i,this.on(PN,this.onWaiting),this.on([wN,IN],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on(kN,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),n}(Vj),fY=function(e){CM(n,e);var t=LM(n);function n(){var e;wM(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return SM(PM(e=t.call.apply(t,[this].concat(r))),"getSpeed",(function(t){if(e.speedListCache.length<=0)return 0;var n=0;return e.speedListCache.map((function(e){n+=e})),Math.floor(n/e.speedListCache.length)})),SM(PM(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed)})),SM(PM(e),"testSpeed",(function(){if(clearTimeout(e.timer),e.timer=null,e.player&&e.config.openSpeed){var t=e.config,n=t.url,i=t.loadSize,r=t.testCnt,o=t.testTimeStep,a=n+(n.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+"-"+(i+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,n=Math.round(1e3*t/(l-s));e.appendList(n),e.timer=setTimeout(e.testSpeed,o)}},c.send()}catch(xX){console.error(xX)}}}})),SM(PM(e),"appendList",(function(t){var n=e.config.saveSpeedMax;e.speedListCache.length>=n&&e.speedListCache.shift(),e.speedListCache.push(t),e.player&&(e.player.realTimeSpeed=t),e.updateSpeed()})),SM(PM(e),"updateSpeed",(function(){var t=e.getSpeed(),n=PM(e).player;!n||n.avgSpeed&&t===n.avgSpeed||(n.avgSpeed=t,n.emit(YN,{speed:t,realTimeSpeed:n.realTimeSpeed}))})),e}return TM(n,[{key:"afterCreate",value:function(){var e=this;this.speedListCache=[];var t=this.config,n=t.openSpeed,i=t.testTimeStep;this.timer=null,this.cnt=0,this.xhr=null,n&&(this.on("real_time_speed",this._onRealSpeedChange),this.on([AN,WN],(function(){cN.isMSE(e.player.video)||(e.speedListCache=[],e.cnt=0,e.timer=setTimeout(e.testSpeed,i))})))}},{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(){clearTimeout(this.timer),this.timer=null,this.xhr&&4!==this.xhr.readyState&&(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}}}]),n}(Vj),pY=function(e){CM(n,e);var t=LM(n);function n(){return wM(this,n),t.apply(this,arguments)}return TM(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.config;(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,n.disabled)||t.media.getVideoPlaybackQuality&&(this.on(kN,(function(){e._startTick()})),this.on(TN,(function(){e._stopTick()})),this.on(EN,(function(){e._stopTick()})),this.on(jN,(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:"_checkStuck",value:function(e){var t=this.player.media,n=document.hidden,i=t.paused;if("boolean"==typeof n&&!n&&!i){for(var r=t.currentTime,o=t.buffered,a=!1,s=0;s<o.length;s++){var l=o.start(s),c=o.end(s);if(l<=r&&r<=c-1){a=!0;break}}4===t.readyState&&a&&(this._currentStuckCount>this.config.stuckCount?(this.emit(dj),this._currentStuckCount=0):e<=this.config.reportFrame?this._currentStuckCount++:this._currentStuckCount=0)}}},{key:"_checkDecodeFPS",value:function(){if(this.player.media){var e=this.player.media.getVideoPlaybackQuality().totalVideoFrames,t=performance.now();if(e&&this._lastCheckPoint){var n=e-this._lastDecodedFrames;this._checkStuck(n)}this._lastDecodedFrames=e,this._lastCheckPoint=t}}},{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}}}]),n}(Vj);eB.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:"直播"}});var gY=TM((function e(t,n){var i,r,o;wM(this,e);var a=n&&"mobile"===n.isMobileSimulateMode,s=n.isLive,l=[].concat(s?[]:[OU,tY,Qq,NU],[IU,RU,GU,QU,Gq,Vq,Aq,Mq,HU,YU]),c=[yB,mB,wB,TU,EB,qq,Yq,eY,NB];this.plugins=[uY,gB].concat(MM(l),c,[hY,dY]);var u=a?"mobile":vN.device;switch(u){case"pc":(i=this.plugins).push.apply(i,[wU,UB,Kq,fY,pY]);break;case"mobile":(r=this.plugins).push.apply(r,[_U]);break;default:(o=this.plugins).push.apply(o,[wU,UB,Kq])}(vN.os.isIpad||"pc"===u)&&this.plugins.push(sY),vN.os.isIpad&&this.plugins.push(UB),this.ignores=[],this.i18n=[]})),vY=function(e){CM(n,e);var t=LM(n);function n(){return wM(this,n),t.apply(this,arguments)}return TM(n)}(aB);SM(vY,"defaultPreset",gY),SM(vY,"Util",cN),SM(vY,"Sniffer",vN),SM(vY,"Errors",bN),SM(vY,"Events",fj),SM(vY,"Plugin",Vj),SM(vY,"BasePlugin",Dj),SM(vY,"I18N",eB),SM(vY,"STATE_CLASS",qj);var yY={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:"直播"}},mY={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:"生放送"}},_Y=be,bY=rs;gT("toStringTag"),bY(_Y("Symbol"),"Symbol"),rs(S.JSON,"JSON",!0),rs(Math,"Math",!0);var kY=Er,wY=uv,EY=x,TY=be,SY=fe,CY=Qp,xY=vm,OY=bi,PY=wY&&wY.prototype;if(kY({target:"Promise",proto:!0,real:!0,forced:!!wY&&EY((function(){PY.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=CY(this,TY("Promise")),n=SY(e);return this.then(n?function(n){return xY(t,e()).then((function(){return n}))}:e,n?function(n){return xY(t,e()).then((function(){throw n}))}:e)}}),SY(wY)){var IY=TY("Promise").prototype.finally;PY.finally!==IY&&OY(PY,"finally",IY,{unsafe:!0})}function LY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function DY(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LY(Object(n),!0).forEach((function(t){jY(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LY(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function AY(e){return(AY="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 MY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RY(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,WY(i.key),i)}}function NY(e,t,n){return t&&RY(e.prototype,t),n&&RY(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jY(e,t,n){return(t=WY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BY(e){return(BY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function UY(e,t){return(UY=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function HY(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FY(e,t){if(t&&("object"===i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return HY(e)}function GY(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(xX){return!1}}();return function(){var n,i=BY(e);if(t){var r=BY(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return FY(this,n)}}function VY(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=BY(e)););return e}function zY(){return zY="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=VY(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},zY.apply(this,arguments)}function WY(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}var KY=/^WEBVTT/,qY=/^STYLE+$/,YY=/^\:\:cue/,$Y=/^}+$/,XY=/^\[Script Info\].*/,JY=[/[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,2}:[0-9]{2}\.[0-9]{1,3}-->[0-9]{1,2}:[0-9]{2}\.[0-9]{1,3}/,/[0-9]{1,2}\.[0-9]{1,3}-->[0-9]{1,2}\.[0-9]{1,3}/],ZY=/^Format:\s/,QY=/^Style:\s/,e$=/^Dialogue:\s/;function t$(e){var t=e.length;return 3===t?(60*(60*Number(e[0])+Number(e[1]))*1e3+1e3*Number(e[2]))/1e3:2===t?(60*Number(e[0])*1e3+1e3*Number(e[1]))/1e3:Number(e[0])}function n$(e){return/^(\-|\+)?\d+(\.\d+)?$/.test(e)}function i$(e,t){return e>=0&&e<t.length?t[e]:""}var r$=function(){function e(){MY(this,e)}return NY(e,null,[{key:"parseJson",value:function(e){for(var t=[],n=0,i=0;i<e.length;i++){if(n>=50&&(n=0),0===n){var r={start:e[i].start,list:[e[i]],end:e[i].end};t.push(r)}else t[t.length-1].list.push(e[i]),t[t.length-1].end=e[i].end;n++}return t}},{key:"parse",value:function(t,n){var i=e.checkFormat(t);i||n({format:i});try{var r=[];"ass"===i?r=e.parseASS(t):"vtt"===i&&(r=e.parseVTT(t)),n({format:i,list:r.list,styles:r.styles})}catch(w7){console.error(w7),n({format:i},w7)}}},{key:"parseASSItem",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.split(","),i={},r="";try{var o=n.length-t.length;return r=(r=o>0?n.splice(t.length-1,o+1).join(",")+"":n[n.length-1]+"").replace(/\\n+/g,""),n[t.length-1]=r,t.map((function(e,t){"end"===e||"start"===e?i[e]=t$(n[t].split(":")):"text"===e?i[e]=[n[t]]:"layer"===e?(i[e]=[n[t]],i.textTag=[n[t]]):i[e]="style"===e?[n[t]]:Number(n[t])?Number(n[t]):n[t]})),i}catch(w7){return console.error(w7),{}}}},{key:"parseASS",value:function(t){for(var n=t.split("\n"),i=[],r=0,o=0,a=[],s=[],l=null;r<n.length;){if(ZY.test(n[r]))s=(s=n[r].replace(ZY,"").replace(/\s+/g,"").split(",")).map((function(e){return e.toLocaleLowerCase()}));else if(QY.test(n[r]))a.push(n[r].replace(QY,"").replace(/\s+/g,""));else if(e$.test(n[r])){var c=e.parseASSItem(n[r].replace(e$,""),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(w7){console.error(w7)}else{l=c;var p=null;o%50==0?((p={start:l.start,end:l.end,list:[]}).list.push(l),i.push(p)):((p=i[i.length-1]).end=l.end,p.list.push(l)),o++}}r++}return{list:i,style:{}}}},{key:"parseVTTStyle",value:function(e,t){var n=e.split(":");if(n.length>1){var i=n[0].trim().split("-"),r="";i.length>1?i.map((function(e,t){r+=0===t?e:e.charAt(0).toUpperCase()+e.slice(1)})):r=i[0],t[r]=n[1].trim().replace(/;$/,"")}return t}},{key:"parseVTT",value:function(e){for(var t=(e=e.replace(KY,"")).split("\n"),n=[],i=0,r=0,o=null,a=!1,s=!1,l=null,c=null,u=[];i<t.length;){var h=i$(i,t).trim();if(!h||a&&n$(h))a=!h;else if(YY.test(h)&&qY.test(i$(i-1,t).trim())){s=!0;var d=/\((.+?)\)/g.exec(h);c=d?d[1]:"",l=""}else if(s)$Y.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[i]);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),n.push(g)):((g=n[n.length-1]).end=o.end,g.list.push(o)),r++}}else if(o){var v=o,y=v.text,m=v.textTag,_=this.parseVttText(t[i]);y.push(_.text),m.push(_.tag)}a=!1}i++}return{list:n,styles:u}}},{key:"checkIsTime",value:function(e){e=e.replace(/\s+/g,"");for(var t=0,n=null;t<JY.length&&!(n=JY[t].exec(e));)t++;return n?n[0]:null}},{key:"parseVttText",value:function(e){var t=/^(<?.+?>)/g.exec(e),n="",i="default";if(t){i=t[0].replace(/\<|\>|\&/g,"");var r=RegExp("^<".concat(i,">(([\\s\\S])*?)</").concat(i,">$")).exec(e);r?n=r[1]:(n=e,i="")}else n=e;for(var o=/<(\w+).(\w+)>/g,a=o.exec(n);a&&a.length>2;)n=n.replace(a[0],"<".concat(a[1],' class="').concat(a[2],'">')),a=o.exec(n);return{tag:i,text:n.replace(/\\n+/g,"<br/>")}}},{key:"parseVttTime",value:function(e){var t,n=e.split("--\x3e"),i=0;if(2===n.length){var r=n[0].split(":"),o=n[1].split(":");t=t$(r),i=t$(o)}return{start:t,end:i,time:e}}},{key:"isVTT",value:function(e){return KY.test(e)}},{key:"isASS",value:function(e){return XY.test(e)}},{key:"checkFormat",value:function(e){return e?KY.test(e)?"vtt":XY.test(e)?"ass":null:null}}]),e}(),o$=[{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"}];function a$(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={code:o$[e].code,msg:o$[e].msg};return Object.keys(t).map((function(e){n[e]=t[e]})),n}var s$=NY((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.url,i=t.method,r=void 0===i?"GET":i,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 MY(this,e),new Promise((function(e,t){var i=new window.XMLHttpRequest,o=r.toUpperCase(),s=[];if(a&&(i.responseType=a),l&&(i.timeout=l),Object.keys(u).forEach((function(e){s.push("k=".concat(u[e]))})),i.onload=function(){200===i.status||206===i.status?e({context:h,res:i}):t(new Error({context:h,res:i,type:"error"}))},i.onerror=function(e){t(new Error({context:h,res:i,type:"error"}))},i.ontimeout=function(e){t(new Error({context:h,res:i,type:"error"}))},i.onabort=function(){t(new Error({context:h,res:i,type:"error"}))},"GET"===o)i.open(o,"".concat(n)),i.send();else{if("post"!==o)throw new Error("xhr ".concat(o," is not supported"));i.open(o,n),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.send(s.join("&"))}}))})),l$=function(){function e(){var t,n;MY(this,e);var i=new Promise((function(e,i){t=e,n=i}));return i.resolve=function(e){t(e),i.state="fulfilled"},i.reject=function(e){n(e),i.state="rejected",i.isBreak="DESTROYED"===e},i.state="pending",i}return NY(e,[{key:"resolve",value:function(e){}},{key:"reject",value:function(e){}}]),e}();function c$(e,t){if(!e)return!1;if(e.classList)return Array.prototype.some.call(e.classList,(function(e){return e===t}));var n=e.className&&"object"===AY(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function u$(e,t){e&&(e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):c$(e,t)||(e.className&&"object"===AY(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t))}function h$(e,t,n){var i=t.length;if(i<1)return-1;if(t[n=n<0?0:n>=i?i-1:n].start<=e&&e<t[n].end)return n;for(var r=t[n].end<=e?n+1:0;r<i;r++){if(t[r].start<=e&&e<t[r].end)return r;if(e>t[r].end&&r+1<i&&e<t[r+1].start)return-1;if(e>t[r].end&&r+1>=i)return-1}return-1}function d$(e,t,n){var i=t.length;if(i<1)return[];var r=[];if((n=n<0?0:n>=i?i-1:n)<i)for(var o=t[n].end<=e?n:0;o<i&&(t[o].start<=e&&e<t[o].end&&r.push(o),!(e<t[o].start));o++);return r}function f$(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function p$(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=i,r.innerHTML=t,Object.keys(n).forEach((function(t){var i=t,o=n[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(i,o):r.setAttribute(i,o)})),r}function g$(e,t,n){if(n||(n=new l$),"json"===t){var i=r$.parseJson(e);n.resolve({list:i,format:"json"})}else"string"===t&&r$.parse(e,(function(e,t){if(t){var i=a$(2,t);n.reject(i,{format:e.format})}else if(e.format)n.resolve({styles:e.styles,list:e.list,format:e.format});else{var r=a$(3);n.reject(r)}}));return n}function v$(e,t){return t||(t=new l$),new s$({url:e.url,type:"text"}).then((function(n){g$(n.res.response,"string").then((function(n){t.resolve(DY(DY({},n),e))})).catch((function(e){t.reject(e)}))})).catch((function(n){var i=a$(1,DY({statusText:n.statusText,status:n.status,type:n.type,message:"http load error",url:e.src},e));t.reject(i)})),t}function y$(e,t){return!!(e.id&&t.id&&e.id===t.id||e.language&&t.language&&e.language===t.language)}var m$=function(){function e(){var t=this;MY(this,e),this.__handlers=[],window.ResizeObserver&&(this.observer=new window.ResizeObserver((function(e){t.__trigger(e)})))}return NY(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=this.__handlers,i=-1,r=0;r<n.length;r++)n[r]&&e===n[r].target&&(i=r);i>-1?this.__handlers[i].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)})),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 n=this.__handlers,i=0;i<n.length;i++)if(n[i]&&e===n[i].target){n[i].handler&&n[i].handler.forEach((function(n){try{n(e,t)}catch(w7){console.error(w7)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){var n=e.contentRect;t.__runHandler(e.target,n)}))}}]),e}(),_$=null;var b$="resize",k$="change",w$="off";function E$(e){var t=[];return e&&"String"===f$(e)?t.push({url:e,index:0,start:-1,end:-1}):"Array"===f$(e)&&e.forEach((function(e,n){t.push({url:e.url||e.src,index:n,start:e.start||-1,end:e.end||-1})})),t}var T$=!1,S$=function(e){!function(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&&UY(e,t)}(n,e);var t=GY(n);function n(e){var i,r,o,a,s,l,c;return MY(this,n),jY(HY(i=t.call(this)),"_onTimeupdate",(function(){if(i._isOpen){var e=i.player.video,t=e.videoWidth,n=e.videoHeight;!i._videoMeta.scale&&t&&n&&i._onResize(i.player.root);var r=i._getPlayerCurrentTime();Math.round(Math.abs(1e3*r-i._ctime))<200||(i._ctime=1e3*r,i.currentText&&i.currentText.list&&("live"===i.config.updateMode?i._liveUpdate(r):i._update(r)))}})),jY(HY(i),"getItemsByIndex",void 0),jY(HY(i),"_onResize",(function(e){var t=HY(i),n=t._videoMeta;if(t.config.domRender){if(e&&e instanceof window.Element||(e=i.player.root),i._iId&&(clearTimeout(i._iId),i._iId=null),!n.scale){if(!i.player.video)return;var r=i.player.video,o=r.videoWidth,a=r.videoHeight;if(!o||!a)return;n.videoWidth=o,n.videoHeight=a,n.scale=parseInt(a/o*100,10)}i.__startResize(e)}})),jY(HY(i),"_onCoreEvents",(function(e){try{switch(e.eventName){case"core.subtitlesegments":i._onSubtitleSegment(e.list||[]);break;case"core.subtitleplaylist":i._onSubtitlePlaylist(e.list||[]);break;case"core.seipayloadtime":i._onCoreSeiintime(e)}}catch(t){console.error(t)}})),jY(HY(i),"destroy",(function(){i.detachPlayer(),i.removeAllListeners(),i.player=null,i.textTrack=null})),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),T$=/(?:iPhone)/.test(r)&&!c||s||a||c,i.currentText=null,i.currentExtText=null,i.textTrack=[],i._cid=-1,i._gid=-1,i._cids=[],i._iId=null,i._iC=0,i.player=null,i.root=null,i.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",debugger:!1},i._ctime=0,i._loadingTrack={},Object.keys(i.config).map((function(t){void 0!==e[t]&&null!==e[t]&&(i.config[t]=e[t])})),i._isOpen=i.config.defaultOpen||!1,i._videoMeta={scale:0,videoHeight:0,videoWidth:0,lwidth:0,lheight:0,vWidth:0,vHeight:0,vBottom:0,vLeft:0,marginBottom:0},e.subTitles&&"Array"===f$(e.subTitles)?(e.player&&i.attachPlayer(e.player),i.seiTime=0,i.lastSeiTime=0,i._curTexts=[],i.setSubTitles(e.subTitles,i.config.defaultOpen),i):FY(i)}return NY(n,[{key:"version",get:function(){return"3.0.4"}},{key:"setSubTitles",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this._isOpen||n;i&&this.innerRoot&&this.switchOff(),this.currentText=null,this.textTrack=[],t.forEach((function(t){var n={};Object.keys(t).map((function(e){n[e]=t[e]})),n.url=E$(n.url),n.isDefault&&(e.currentText=n),e.textTrack.push(n)})),this._log("setSubTitles",r),r&&this.switch().catch((function(t){e._log("[switch]",t)})),this.currentText&&this._loadTrack(this.currentText).then((function(t){e.addStyles(t)})),this.emit("reset",{list:this.textTrack,isOpen:r})}},{key:"updateSubTitle",value:function(e){for(var t=this,n=-1,i=0;i<this.textTrack.length;i++)if(y$(e,this.textTrack[i])){n=i;break}if(this._log("updateSubTitle",n,e),n>-1){var r=y$(this.currentText,this.textTrack[n]);if(this._log("updateSubTitle","_isCurrent",r,"this.isOpen",this.isOpen,this.currentText),!r)return;var o=E$(e.url);this.isOpen?(o.forEach((function(e){t.textTrack[n].url.push(e)})),this._log("updateSubTitle _loadTrackUrls",this.textTrack[n]),this._loadTrackUrls(this.currentText,2)):this.textTrack[n].url=o}}},{key:"addStyles",value:function(e){var t=e.styles,n=e.format;t&&"vtt"===n&&(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]:"",n="";e.map((function(e){n+=" ".concat(t," ").concat(e.key," {").concat(e.style,"}")}));var i=document.createElement("style"),r=document.head||document.getElementsByTagName("head")[0];if(i.type="text/css",i.id="ssss",i.styleSheet){var o=function(){try{i.styleSheet.cssText=n}catch(xX){}};i.styleSheet.disabled?setTimeout(o,10):o()}else{var a=document.createTextNode(n);i.appendChild(a)}r.appendChild(i)}(t,"xg-text-track"))}},{key:"attachPlayer",value:function(e){var t=this;if(this._log("attachPlayer"),e){this.player&&this.detachPlayer();var n,i,r=this.config,o=r.fontColor,a=r.mode,s=r.fitVideo,l=r.domRender;this.player=e,l&&(this.root=document.createElement("xg-text-track"),this.root.className="xg-text-track",!this._isOpen&&u$(this.root,"text-track-hide"),!s&&u$(this.root,"text-track-no-fitvideo"),a&&u$(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.appendChild(this.root),n=e.root,i=this._onResize,_$||(_$=new m$),_$.addObserver(n,i)),this.player.on("destroy",this.destroy),this.player.on("timeupdate",this._onTimeupdate),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,n=this.player,i=this.config;n&&(n.off("destroy",this.destroy),n.off("timeupdate",this._onTimeupdate),n.on("core_event",this._onCoreEvents),i.domRender&&(n.root&&(e=n.root,t=this._onResize,_$&&_$.unObserver(e,t),n.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(n,i){if(t.id||t.language)if(e.currentText&&y$(t,e.currentText))e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),n(a$(0));else{var r=null;e.__removeByTime(e._curTexts,0);for(var o=0;o<e.textTrack.length;o++)if(y$(t,e.textTrack[o])){r=e.textTrack[o];break}if(e._log("nextSubtitle",r),r)e._emitPlayerSwitch(e.currentText,r),r.list?(e._loadingTrack={},e._updateCurrent(r),e.switchOn(),n(a$(0))):(e._log("this._loadTrack",r),e._updateCurrent(r),e._loadTrack(r).then((function(t){if(e.addStyles(t),e._loadingTrack.id===r.id||e._loadingTrack.language===t.language)e._loadingTrack={},e._updateCurrent(t),e.switchOn(),n(a$(0));else{var o=a$(6,{message:"check _loadingTrack fail id: ".concat(e._loadingTrack.id," nextSubtitle:").concat(t.id)});i(o)}})).catch((function(e){i(e)})));else{var a=a$(4,new Error("The is no subtitle with id:[{".concat(t.id,"}] or language:[").concat(t.language,"]")));i(a)}}else{if(e.currentText){e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn();var s=a$(0,{message:"switch default subtitle success"});return void n(s)}var l=a$(5,{message:"no default subtitle"});i(l)}}))}},{key:"switchExt",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};return new Promise((function(n,i){if(t.id||t.language){for(var r=null,o=0;o<e.textTrack.length;o++)if(y$(t,e.textTrack[o])){r=e.textTrack[o];break}r&&!y$(r,e.currentText)&&e._loadTrack(r).then((function(t){e.currentExtText=t,n(a$(0))}))}else e.currentExtText=null,n(a$(0))}))}},{key:"switchOn",value:function(){this._log("switchOn"),this._isOpen=!0,this.show(),this.emit(k$,this.currentText)}},{key:"switchOff",value:function(){this._isOpen=!1,this.hide(),this.emit(w$)}},{key:"isOpen",get:function(){return this._isOpen}},{key:"_log",value:function(){if(this.config.debugger){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];(e=console).log.apply(e,["[xgSubtitle]"].concat(n))}}},{key:"_loadTrack",value:function(e){var t=this;this._log("_loadTrack",e.language,e);var n=new l$,i="",r="";if(e.json?(i="json",r=e.json):e.stringContent&&!e.url&&(i="string",r=e.stringContent),r)return g$(r,i).then((function(t){e.format=t.format,e.styles=t.styles,e.list=t.list,n.resolve(e)})).catch((function(e){n.reject(e)})),n;var o=e.url;return 0===o.length?(n.resolve(e),n):(v$(o.splice(0,1)[0]).then((function(i){e.format=i.format,e.styles=i.styles,e.list||(e.list=[]),t._pushList(e.list,i.list),o.length>1&&t._loadTrackUrls(e,2),n.resolve(e)})).catch((function(e){n.reject(e)})),n)}},{key:"_emitPlayerSwitch",value:function(e,t){e&&"live"===this.config.updateMode&&(e.list=[],e.url=[]);var n=DY({lang:t.language},t);this._log("emit subtile_switch ",t,n),this.player&&this.player.emit("switch_subtitle",n)}},{key:"_loadTrackUrls",value:function(e,t,n){var i=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){v$(DY(DY({},t),{},{index:r})).then((function(t){e.format=t.format,e.styles=t.format,e.list||(e.list=[]),i._pushList(e.list,t.list),a--})).catch((function(e){a--})).finally((function(t){0===a&&(n&&n.resolve(e),i._loadTrackUrls(e,2))}))}))}},{key:"_freshUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{url:""},n=-1;e.url.forEach((function(e,i){e.url===t.url&&(n=i)})),n>-1&&e.url.splice(n,1)}},{key:"_pushList",value:function(e,t){var n=t[0].start,i=t[t.length-1].end;if(0===e.length||n>=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>i){r=o;break}r>-1&&t.forEach((function(t,n){e.splice(r+n,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 n=this._getPlayerCurrentTime();n&&("live"===this.config.updateMode?this._liveUpdate(n):this._update(n))}},{key:"__loadAll",value:function(){var e=this;this.textTrack.forEach((function(t){e._loadTrack(t)}))}},{key:"getDelCid",value:function(e,t){for(var n=[],i=0;i<e.length;i++)t.includes(e[i])||n.push(e[i]);return n}},{key:"getNewCid",value:function(e,t){for(var n=[],i=0;i<t.length;i++)e.includes(t[i])||n.push(t[i]);return n}},{key:"_liveUpdate",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var n=[],i=h$(e,this.currentText.list,this._gid);if(i>-1&&(n=d$(e,this.currentText.list[i].list,this._cid)),this.__removeByTime(this._curTexts,e),this._log("_liveUpdate",e,i,n,this.currentText.list[0].list[0].start,this.currentText.list[0].list[0].end),n.length>0){var r=function(e,t,n){if(0===e.length||t<0||t>e.length-1)return[];var i=e[t].list;if(0===n.length)return[];var r=i.splice(n[0],n.length);return t>0&&e.splice(0,t),0===i.length&&e.splice(0,1),r}(this.currentText.list,i,n),o=this._curTexts.length,a=o>0?this._curTexts[o-1].index:0;r.forEach((function(e,n){e.index=n+a,t._curTexts.push(e)})),this.__render(r)}this.emit("update",this._curTexts)}}},{key:"_update",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var n=h$(e,this.currentText.list,this._gid),i=[];if(n>-1&&(i=d$(e,this.currentText.list[n].list,this._cid)),i.length<1)return this._cids.length>0&&this.config.domRender&&this.__remove(this._cids),void(this._cids=[]);if(this._cids!==i||n!==this._gid){this._gid=n,this._cid=i[0];var r=this.getDelCid(this._cids,i),o=this.getNewCid(this._cids,i);this._cids=i,this.config.domRender&&this.__remove(r);var a=[];o.map((function(e){var i=t.currentText.list[n].list[e];i.index=e,a.push(i)})),this.currentExtText&&o.map((function(e){var i=t.currentText.list[n].list[e];i.index=e,a.push(i)})),this.emit("update",a),this.__render(a,e)}}}},{key:"_getPlayerCurrentTime",value:function(){if(!this.player)return 0;var e=this.player.currentTime;return parseInt(1e3*e+1e3*this.seiTime-1e3*this.lastSeiTime,10)/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}}))};y$(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(n){}}},{key:"resize",value:function(e,t){var n,i=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=parseInt(h*e,10)/100,n=e):(d=t,n=parseInt(t/h*100,10)),this._videoMeta.vWidth=n,this._videoMeta.vHeight=d;var f=0,p=0;h>120?(f=a,p=parseInt(f*d/1080,10)):(f=o,p=parseInt(f*n/1920,10));var g=T$?s:l,v={fontSize:p=p<g?g:p>f?f:p},y=parseInt((t-d)/2,10),m=parseInt((e-n)/2,10),_=parseInt(d*u,10)/100;this._videoMeta.vBottom=y,this._videoMeta.vLeft=m,this._videoMeta.marginBottom=_,c&&(v.bottom=y+_,v.left=v.right=m),Object.keys(v).map((function(e){i.root.style[e]="".concat(v[e],"px")})),this.emit(b$,{vLeft:m,vBottom:y,marginBottom:_,vWidth:n,vHeight:d,fontSize:p,scale:h})}},{key:"__startResize",value:function(e){var t=this,n=e.getBoundingClientRect(),i=this._videoMeta,r=n.width,o=n.height;if(this._iId&&(clearTimeout(this._iId),this._iId=null),r>0&&o>0&&(r!==i.lwidth||o!==i.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 n=[],i=0;i<e.length;i++)(!t||e[i].end<t)&&n.push(i);0!==n.length&&(e.splice(n[0],n.length),this.config.domRender&&this.__remove(n))}},{key:"__remove",value:function(e){var t=this;if(e&&!(e.length<1)){for(var n=this.innerRoot.children,i=[],r=0;r<n.length;r++){var o=Number(n[r].getAttribute("data-index"));e.includes(o)&&i.push(n[r])}i.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),t.length>0&&this.config.domRender&&t.map((function(t){var n="text-track-".concat(e.config.line);t.text.map((function(i,r){r>0&&(n+=" text-track-deputy");var o={"data-start":t.start,"data-end":t.end,"data-index":t.index};e.innerRoot.appendChild(p$("xg-text-track-span",i,o,n))}))}))}},{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)})):c$(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===AY(e.className)?e.setAttribute("class",e.getAttribute("class").replace(n," ")):e.className=e.className.replace(n," ")}))))}},{key:"hide",value:function(){this.config.domRender&&(u$(this.root,"text-track-hide"),this.innerRoot.innerHTML="")}},{key:"emit",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=zY(BY(n.prototype),"emit",this)).call.apply(i,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=zY(BY(n.prototype),"on",this)).call.apply(i,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=zY(BY(n.prototype),"once",this)).call.apply(i,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(i=zY(BY(n.prototype),"off",this)).call.apply(i,[this,e,t].concat(o))}},{key:"offAll",value:function(){zY(BY(n.prototype),"removeAllListeners",this).call(this)}},{key:"marginBottom",get:function(){var e=this._videoMeta,t=e.bottom,n=e.marginBottom;return this.config.fitVideo?t+n:n}}]),n}(BM),C$={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"}},x$=["zh","en","jp","zh-hk"],O$=0,P$=1,I$=2,L$=function(e){return 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}(L$||{}),D$=S;Er({global:!0,forced:D$.globalThis!==D$},{globalThis:D$});var A$=D;Er({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return A$(URL.prototype.toString,this)}});var M$={exports:{}};!function(e,t){e.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",o="second",a="minute",s="hour",l="day",c="week",u="month",h="quarter",d="year",f="date",p="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|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"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},m=function(e,t,n){var i=String(e);return!i||i.length>=t?e:""+Array(t+1-i.length).join(n)+e},_={s:m,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),i=Math.floor(n/60),r=n%60;return(t<=0?"+":"-")+m(i,2,"0")+":"+m(r,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var i=12*(n.year()-t.year())+(n.month()-t.month()),r=t.clone().add(i,u),o=n-r<0,a=t.clone().add(i+(o?-1:1),u);return+(-(i+(n-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:u,y:d,w:c,d:l,D:f,h:s,m:a,s:o,ms:r,Q:h}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",k={};k[b]=y;var w=function(e){return e instanceof C},E=function e(t,n,i){var r;if(!t)return b;if("string"==typeof t){var o=t.toLowerCase();k[o]&&(r=o),n&&(k[o]=n,r=o);var a=t.split("-");if(!r&&a.length>1)return e(a[0])}else{var s=t.name;k[s]=t,r=s}return!i&&r&&(b=r),r||!i&&b},T=function(e,t){if(w(e))return e.clone();var n="object"==i(t)?t:{};return n.date=e,n.args=arguments,new C(n)},S=_;S.l=E,S.i=w,S.w=function(e,t){return T(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function i(e){this.$L=E(e.locale,null,!0),this.parse(e)}var y=i.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(S.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var i=t.match(g);if(i){var r=i[2]-1||0,o=(i[7]||"0").substring(0,3);return n?new Date(Date.UTC(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)):new Date(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},y.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()},y.$utils=function(){return S},y.isValid=function(){return!(this.$d.toString()===p)},y.isSame=function(e,t){var n=T(e);return this.startOf(t)<=n&&n<=this.endOf(t)},y.isAfter=function(e,t){return T(e)<this.startOf(t)},y.isBefore=function(e,t){return this.endOf(t)<T(e)},y.$g=function(e,t,n){return S.u(e)?this[t]:this.set(n,e)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(e,t){var n=this,i=!!S.u(t)||t,r=S.p(e),h=function(e,t){var r=S.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return i?r:r.endOf(l)},p=function(e,t){return S.w(n.toDate()[e].apply(n.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},g=this.$W,v=this.$M,y=this.$D,m="set"+(this.$u?"UTC":"");switch(r){case d:return i?h(1,0):h(31,11);case u:return i?h(1,v):h(0,v+1);case c:var _=this.$locale().weekStart||0,b=(g<_?g+7:g)-_;return h(i?y-b:y+(6-b),v);case l:case f:return p(m+"Hours",0);case s:return p(m+"Minutes",1);case a:return p(m+"Seconds",2);case o:return p(m+"Milliseconds",3);default:return this.clone()}},y.endOf=function(e){return this.startOf(e,!1)},y.$set=function(e,t){var n,i=S.p(e),c="set"+(this.$u?"UTC":""),h=(n={},n[l]=c+"Date",n[f]=c+"Date",n[u]=c+"Month",n[d]=c+"FullYear",n[s]=c+"Hours",n[a]=c+"Minutes",n[o]=c+"Seconds",n[r]=c+"Milliseconds",n)[i],p=i===l?this.$D+(t-this.$W):t;if(i===u||i===d){var g=this.clone().set(f,1);g.$d[h](p),g.init(),this.$d=g.set(f,Math.min(this.$D,g.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},y.set=function(e,t){return this.clone().$set(e,t)},y.get=function(e){return this[S.p(e)]()},y.add=function(i,r){var h,f=this;i=Number(i);var p=S.p(r),g=function(e){var t=T(f);return S.w(t.date(t.date()+Math.round(e*i)),f)};if(p===u)return this.set(u,this.$M+i);if(p===d)return this.set(d,this.$y+i);if(p===l)return g(1);if(p===c)return g(7);var v=(h={},h[a]=t,h[s]=n,h[o]=e,h)[p]||1,y=this.$d.getTime()+i*v;return S.w(y,this)},y.subtract=function(e,t){return this.add(-1*e,t)},y.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var i=e||"YYYY-MM-DDTHH:mm:ssZ",r=S.z(this),o=this.$H,a=this.$m,s=this.$M,l=n.weekdays,c=n.months,u=function(e,n,r,o){return e&&(e[n]||e(t,i))||r[n].slice(0,o)},h=function(e){return S.s(o%12||12,e,"0")},d=n.meridiem||function(e,t,n){var i=e<12?"AM":"PM";return n?i.toLowerCase():i},f={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:S.s(s+1,2,"0"),MMM:u(n.monthsShort,s,c,3),MMMM:u(c,s),D:this.$D,DD:S.s(this.$D,2,"0"),d:String(this.$W),dd:u(n.weekdaysMin,this.$W,l,2),ddd:u(n.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(o),HH:S.s(o,2,"0"),h:h(1),hh:h(2),a:d(o,a,!0),A:d(o,a,!1),m:String(a),mm:S.s(a,2,"0"),s:String(this.$s),ss:S.s(this.$s,2,"0"),SSS:S.s(this.$ms,3,"0"),Z:r};return i.replace(v,(function(e,t){return t||f[e]||r.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(i,r,f){var p,g=S.p(r),v=T(i),y=(v.utcOffset()-this.utcOffset())*t,m=this-v,_=S.m(this,v);return _=(p={},p[d]=_/12,p[u]=_,p[h]=_/3,p[c]=(m-y)/6048e5,p[l]=(m-y)/864e5,p[s]=m/n,p[a]=m/t,p[o]=m/e,p)[g]||m,f?_:S.a(_)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return k[this.$L]},y.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),i=E(e,t,!0);return i&&(n.$L=i),n},y.clone=function(){return S.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},i}(),x=C.prototype;return T.prototype=x,[["$ms",r],["$s",o],["$m",a],["$H",s],["$W",l],["$M",u],["$y",d],["$D",f]].forEach((function(e){x[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),T.extend=function(e,t){return e.$i||(e(t,C,T),e.$i=!0),T},T.locale=E,T.isDayjs=w,T.unix=function(e){return T(1e3*e)},T.en=k[b],T.Ls=k,T.p={},T}()}(M$);var R$=M$.exports,N$={exports:{}};!function(e,t){var n,i,r;e.exports=(n="minute",i=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g,function(e,t,o){var a=t.prototype;o.utc=function(e){return new t({date:e,utc:!0,args:arguments})},a.utc=function(e){var t=o(this.toDate(),{locale:this.$L,utc:!0});return e?t.add(this.utcOffset(),n):t},a.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.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 l.call(this)};var c=a.utcOffset;a.utcOffset=function(e,t){var o=this.$utils().u;if(o(e))return this.$u?0:o(this.$offset)?c.call(this):this.$offset;if("string"==typeof e&&null===(e=function(e){void 0===e&&(e="");var t=e.match(i);if(!t)return null;var n=(""+t[0]).match(r)||["-",0,0],o=n[0],a=60*+n[1]+ +n[2];return 0===a?0:"+"===o?a:-a}(e)))return this;var a=Math.abs(e)<=16?60*e:e,s=this;if(t)return s.$offset=a,s.$u=0===e,s;if(0!==e){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+l,n)).$offset=a,s.$x.$localOffset=l}else s=this.utc();return s};var u=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var h=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var d=a.diff;a.diff=function(e,t,n){if(e&&this.$u===e.$u)return d.call(this,e,t,n);var i=this.local(),r=o(e).local();return d.call(i,r,t,n)}})}(N$);var j$=N$.exports,B$=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==i(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=22)}([function(e,t,n){var i=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(e,t,n){var i=n(12)("wks"),r=n(13),o=n(0).Symbol,a="function"==typeof o;(e.exports=function(e){return i[e]||(i[e]=a&&o[e]||(a?o:r)("Symbol."+e))}).store=i},function(e,t,n){var i=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=i)},function(e,t,n){var i=n(4);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r="function"==typeof Symbol&&"symbol"==i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)};e.exports=function(e){return"object"===(void 0===e?"undefined":r(e))?null!==e:"function"==typeof e}},function(e,t,n){var i=n(6);e.exports=function(e,t,n){if(i(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){e.exports=!n(15)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,n){var i={}.toString;e.exports=function(e){return i.call(e).slice(8,-1)}},function(e,t,n){var i=n(3),r=n(26),o=n(27),a=Object.defineProperty;t.f=n(7)?Object.defineProperty:function(e,t,n){if(i(e),t=o(t,!0),i(n),r)try{return a(e,t,n)}catch(s){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=!1},function(e,t,n){var i=n(8),r=n(1)("toStringTag"),o="Arguments"==i(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(n){}}(t=Object(e),r))?n:o?i(t):"Object"==(a=i(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,n){var i=n(2),r=n(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:i.version,mode:n(10)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){var i=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++i+r).toString(36))}},function(e,t,n){var i=n(9),r=n(28);e.exports=n(7)?function(e,t,n){return i.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t,n){var i=n(4),r=n(0).document,o=i(r)&&i(r.createElement);e.exports=function(e){return o?r.createElement(e):{}}},function(e,t,n){var i=n(0),r=n(14),o=n(18),a=n(13)("src"),s=n(29),l=(""+s).split("toString");n(2).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var c="function"==typeof n;c&&(o(n,"name")||r(n,"name",t)),e[t]!==n&&(c&&(o(n,a)||r(n,a,e[t]?""+e[t]:l.join(String(t)))),e===i?e[t]=n:s?e[t]?e[t]=n:r(e,t,n):(delete e[t],r(e,t,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},function(e,t,n){var i={}.hasOwnProperty;e.exports=function(e,t){return i.call(e,t)}},function(e,t,n){e.exports={}},function(e,t,n){var i,r,o,a=n(5),s=n(38),l=n(39),c=n(16),u=n(0),h=u.process,d=u.setImmediate,f=u.clearImmediate,p=u.MessageChannel,g=u.Dispatch,v=0,y={},m=function(){var e=+this;if(y.hasOwnProperty(e)){var t=y[e];delete y[e],t()}},_=function(e){m.call(e.data)};d&&f||(d=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return y[++v]=function(){s("function"==typeof e?e:Function(e),t)},i(v),v},f=function(e){delete y[e]},"process"==n(8)(h)?i=function(e){h.nextTick(a(m,e,1))}:g&&g.now?i=function(e){g.now(a(m,e,1))}:p?(o=(r=new p).port2,r.port1.onmessage=_,i=a(o.postMessage,o,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(i=function(e){u.postMessage(e+"","*")},u.addEventListener("message",_,!1)):i="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,n){var i=n(6);function r(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=i})),this.resolve=i(t),this.reject=i(n)}e.exports.f=function(e){return new r(e)}},function(e,t,n){e.exports=n(23)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),n(24);var i,r=(i=n(48))&&i.__esModule?i:{default:i};t.default={url:r.default},e.exports=t.default},function(e,t,n){var i,r,o,a,s=n(10),l=n(0),c=n(5),u=n(11),h=n(25),d=n(4),f=n(6),p=n(30),g=n(31),v=n(37),y=n(20).set,m=n(40)(),_=n(21),b=n(41),k=n(42),w=n(43),E=l.TypeError,T=l.process,S=T&&T.versions,C=S&&S.v8||"",x=l.Promise,O="process"==u(T),P=function(){},I=r=_.f,L=!!function(){try{var e=x.resolve(1),t=(e.constructor={})[n(1)("species")]=function(e){e(P,P)};return(O||"function"==typeof PromiseRejectionEvent)&&e.then(P)instanceof t&&0!==C.indexOf("6.6")&&-1===k.indexOf("Chrome/66")}catch(i){}}(),D=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},A=function(e,t){if(!e._n){e._n=!0;var n=e._c;m((function(){for(var i=e._v,r=1==e._s,o=0,a=function(t){var n,o,a,s=r?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{s?(r||(2==e._h&&N(e),e._h=1),!0===s?n=i:(u&&u.enter(),n=s(i),u&&(u.exit(),a=!0)),n===t.promise?c(E("Promise-chain cycle")):(o=D(n))?o.call(n,l,c):l(n)):c(i)}catch(h){u&&!a&&u.exit(),c(h)}};n.length>o;)a(n[o++]);e._c=[],e._n=!1,t&&!e._h&&M(e)}))}},M=function(e){y.call(l,(function(){var t,n,i,r=e._v,o=R(e);if(o&&(t=b((function(){O?T.emit("unhandledRejection",r,e):(n=l.onunhandledrejection)?n({promise:e,reason:r}):(i=l.console)&&i.error&&i.error("Unhandled promise rejection",r)})),e._h=O||R(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},R=function(e){return 1!==e._h&&0===(e._a||e._c).length},N=function(e){y.call(l,(function(){var t;O?T.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})}))},j=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()),A(t,!0))},B=function e(t){var n,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===t)throw E("Promise can't be resolved itself");(n=D(t))?m((function(){var r={_w:i,_d:!1};try{n.call(t,c(e,r,1),c(j,r,1))}catch(o){j.call(r,o)}})):(i._v=t,i._s=1,A(i,!1))}catch(r){j.call({_w:i,_d:!1},r)}}};L||(x=function(e){p(this,x,"Promise","_h"),f(e),i.call(this);try{e(c(B,this,1),c(j,this,1))}catch(t){j.call(this,t)}},(i=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=n(44)(x.prototype,{then:function(e,t){var n=I(v(this,x));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=O?T.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&A(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new i;this.promise=e,this.resolve=c(B,e,1),this.reject=c(j,e,1)},_.f=I=function(e){return e===x||e===a?new o(e):r(e)}),h(h.G+h.W+h.F*!L,{Promise:x}),n(45)(x,"Promise"),n(46)("Promise"),a=n(2).Promise,h(h.S+h.F*!L,"Promise",{reject:function(e){var t=I(this);return(0,t.reject)(e),t.promise}}),h(h.S+h.F*(s||!L),"Promise",{resolve:function(e){return w(s&&this===a?x:this,e)}}),h(h.S+h.F*!(L&&n(47)((function(e){x.all(e).catch(P)}))),"Promise",{all:function(e){var t=this,n=I(t),i=n.resolve,r=n.reject,o=b((function(){var n=[],o=0,a=1;g(e,!1,(function(e){var s=o++,l=!1;n.push(void 0),a++,t.resolve(e).then((function(e){l||(l=!0,n[s]=e,--a||i(n))}),r)})),--a||i(n)}));return o.e&&r(o.v),n.promise},race:function(e){var t=this,n=I(t),i=n.reject,r=b((function(){g(e,!1,(function(e){t.resolve(e).then(n.resolve,i)}))}));return r.e&&i(r.v),n.promise}})},function(e,t,n){var i=n(0),r=n(2),o=n(14),a=n(17),s=n(5),l=function e(t,n,l){var c,u,h,d,f=t&e.F,p=t&e.G,g=t&e.P,v=t&e.B,y=p?i:t&e.S?i[n]||(i[n]={}):(i[n]||{}).prototype,m=p?r:r[n]||(r[n]={}),_=m.prototype||(m.prototype={});for(c in p&&(l=n),l)h=((u=!f&&y&&void 0!==y[c])?y:l)[c],d=v&&u?s(h,i):g&&"function"==typeof h?s(Function.call,h):h,y&&a(y,c,h,t&e.U),m[c]!=h&&o(m,c,d),g&&_[c]!=h&&(_[c]=h)};i.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,n){e.exports=!n(7)&&!n(15)((function(){return 7!=Object.defineProperty(n(16)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var i=n(4);e.exports=function(e,t){if(!i(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!i(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){e.exports=n(12)("native-function-to-string",Function.toString)},function(e,t,n){e.exports=function(e,t,n,i){if(!(e instanceof t)||void 0!==i&&i in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var i=n(5),r=n(32),o=n(33),a=n(3),s=n(34),l=n(36),c={},u={},h=e.exports=function(e,t,n,h,d){var f,p,g,v,y=d?function(){return e}:l(e),m=i(n,h,t?2:1),_=0;if("function"!=typeof y)throw TypeError(e+" is not iterable!");if(o(y)){for(f=s(e.length);f>_;_++)if((v=t?m(a(p=e[_])[0],p[1]):m(e[_]))===c||v===u)return v}else for(g=y.call(e);!(p=g.next()).done;)if((v=r(g,m,p.value,t))===c||v===u)return v};h.BREAK=c,h.RETURN=u},function(e,t,n){var i=n(3);e.exports=function(e,t,n,r){try{return r?t(i(n)[0],n[1]):t(n)}catch(a){var o=e.return;throw void 0!==o&&i(o.call(e)),a}}},function(e,t,n){var i=n(19),r=n(1)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[r]===e)}},function(e,t,n){var i=n(35),r=Math.min;e.exports=function(e){return e>0?r(i(e),9007199254740991):0}},function(e,t,n){var i=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:i)(e)}},function(e,t,n){var i=n(11),r=n(1)("iterator"),o=n(19);e.exports=n(2).getIteratorMethod=function(e){if(null!=e)return e[r]||e["@@iterator"]||o[i(e)]}},function(e,t,n){var i=n(3),r=n(6),o=n(1)("species");e.exports=function(e,t){var n,a=i(e).constructor;return void 0===a||null==(n=i(a)[o])?t:r(n)}},function(e,t,n){e.exports=function(e,t,n){var i=void 0===n;switch(t.length){case 0:return i?e():e.call(n);case 1:return i?e(t[0]):e.call(n,t[0]);case 2:return i?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return i?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return i?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var i=n(0).document;e.exports=i&&i.documentElement},function(e,t,n){var i=n(0),r=n(20).set,o=i.MutationObserver||i.WebKitMutationObserver,a=i.process,s=i.Promise,l="process"==n(8)(a);e.exports=function(){var e,t,n,c=function(){var i,r;for(l&&(i=a.domain)&&i.exit();e;){r=e.fn,e=e.next;try{r()}catch(o){throw e?n():t=void 0,o}}t=void 0,i&&i.enter()};if(l)n=function(){a.nextTick(c)};else if(!o||i.navigator&&i.navigator.standalone)if(s&&s.resolve){var u=s.resolve(void 0);n=function(){u.then(c)}}else n=function(){r.call(i,c)};else{var h=!0,d=document.createTextNode("");new o(c).observe(d,{characterData:!0}),n=function(){d.data=h=!h}}return function(i){var r={fn:i,next:void 0};t&&(t.next=r),e||(e=r,n()),t=r}}},function(e,t,n){e.exports=function(e){try{return{e:!1,v:e()}}catch(t){return{e:!0,v:t}}}},function(e,t,n){var i=n(0).navigator;e.exports=i&&i.userAgent||""},function(e,t,n){var i=n(3),r=n(4),o=n(21);e.exports=function(e,t){if(i(e),r(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){var i=n(17);e.exports=function(e,t,n){for(var r in t)i(e,r,t[r],n);return e}},function(e,t,n){var i=n(9).f,r=n(18),o=n(1)("toStringTag");e.exports=function(e,t,n){e&&!r(e=n?e:e.prototype,o)&&i(e,o,{configurable:!0,value:t})}},function(e,t,n){var i=n(0),r=n(9),o=n(7),a=n(1)("species");e.exports=function(e){var t=i[e];o&&t&&!t[a]&&r.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){var i=n(1)("iterator"),r=!1;try{var o=[7][i]();o.return=function(){r=!0},Array.from(o,(function(){throw 2}))}catch(a){}e.exports=function(e,t){if(!t&&!r)return!1;var n=!1;try{var o=[7],a=o[i]();a.next=function(){return{done:n=!0}},o[i]=function(){return a},e(o)}catch(s){}return n}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)};t.default=function(e,t,n){if(e&&t){var i=void 0;try{i=(0,a.getUri)(e,t,n)}catch(o){return Promise.reject(o.message)}return new s.default({type:"json",method:"GET",url:i}).then((function(e){return e&&e.response?"string"==typeof e.response?JSON.parse(e.response).Result:"object"===r(e.response)?e.response.Result:e.response:e}))}return Promise.reject("vid, host and token can't be empty")};var o,a=n(49),s=(o=n(51))&&o.__esModule?o:{default:o};e.exports=t.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getUri=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{e=JSON.parse((0,i.decode)(e))}catch(s){throw new Error("base64 decode error: "+s.message)}var r=[];for(var o in n)r.push(o+"="+n[o]);var a=(/^http/.test(t)?t:"//"+t)+"?"+e.GetPlayInfoToken+"&ssl=true";return r.length>0&&(a+="&"+r.join("&")),a};var i=n(50)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){var t,n,i,r,o,a,s,l=[-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];for(a=e.length,o=0,s="";o<a;){do{t=l[255&e.charCodeAt(o++)]}while(o<a&&-1===t);if(-1===t)break;do{n=l[255&e.charCodeAt(o++)]}while(o<a&&-1===n);if(-1===n)break;s+=String.fromCharCode(t<<2|(48&n)>>4);do{if(61==(i=255&e.charCodeAt(o++)))return s;i=l[i]}while(o<a&&-1===i);if(-1===i)break;s+=String.fromCharCode((15&n)<<4|(60&i)>>2);do{if(61==(r=255&e.charCodeAt(o++)))return s;r=l[r]}while(o<a&&-1===r);if(-1===r)break;s+=String.fromCharCode((3&i)<<6|r)}return s}},function(e,t,n){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.url,r=t.method,o=void 0===r?"GET":r,a=(t.type,t.data),s=void 0===a?{}:a,l=t.headers,c=void 0===l?{}:l;return i(this,e),new Promise((function(e,t){var i=new window.XMLHttpRequest,r=o.toUpperCase(),a=[];for(var l in s)a.push(l+"="+s[l]);if("GET"!==r)throw new Error("xhr "+r+" is not supported");for(var u in i.open(r,""+n,!0),i.responseType="",c)i.setRequestHeader(u,""+c[u]);i.send(),i.onload=function(){200===i.status||206===i.status?e(i):t(i)},i.onerror=function(){t(i)},i.ontimeout=function(){t(i)}}))},e.exports=t.default}]);R$.extend(j$);var U$=function(e){return e.VIDEO="video",e.EVIDEO="evideo",e}(U$||{}),H$=function(e){if(e){var t={},n=function(e){try{return JSON.parse(e)}catch(xX){return console.warn("[utils/json] decode fail: ".concat(e),xX),null}}(eX(e)?window.atob(e):e);if(n&&"string"==typeof n.GetPlayInfoToken)n.GetPlayInfoToken.split("&").map((function(e){var n=e.split("=");n[0]&&n[1]&&(t[n[0]]=n[1])}));return t}},F$=function(e){var t={};return e.split("&").map((function(e){var n=e.split("=");n[0]&&n[1]&&(t[n[0]]=n[1])})),t},G$=function(e){var t,n;if(null==e||!e.playAuthToken)return!1;var i=H$(null==e?void 0:e.playAuthToken),r=null!==(t=null==i||null===(n=i.FileType)||void 0===n?void 0:n.toLowerCase())&&void 0!==t?t:"video";return!!i&&("evideo"===r||"eaudio"===r)},V$=function(e){var t,n,i;if(null==e||!e.playAuthToken)return"";var r=H$(null==e?void 0:e.playAuthToken),o=null!==(t=null==r||null===(n=r.FileType)||void 0===n?void 0:n.toLowerCase())&&void 0!==t?t:"video",a=null==r||null===(i=r.Format)||void 0===i?void 0:i.toLowerCase();return a||(Object.values(U$).includes(o)?"mp4":"m4a")},z$=function(e){if(!e["X-Expires"]||!e["X-Date"])return!1;var t=parseInt(e["X-Expires"]);if(isNaN(t))return!1;var n=e["X-Date"].replace(/T/g," ").replace(/Z/g,""),i=R$.utc(n,"YYYYMMDD hhmmss");return!!i.isValid()&&i.add(t,"seconds").isBefore(R$())};function W$(e){var n=e.playAuthToken,i=e.playDomain,r=e.reqParams,o=void 0===r?{}:r,a=e.definitionMap,s=e.needThumbs,l=void 0!==s&&s,c=e.needBarrageMask,u=void 0!==c&&c;if(n){var h=t(t({},o),{},{NeedThumbs:l?1:0,NeedBarrageMask:u?1:0});return new Promise((function(e,r){B$.url(n,i,h).then((function(n){var i=n.Data||n,r=i.Status,o=i.PlayInfoList,s=void 0===o?[]:o,l=i.PosterUrl,c=i.Vid,u=i.Duration,h=i.BarrageMaskUrl,d=i.ThumbInfoList,f=void 0===d?[]:d;if(r===L$.VALID&&s.length){var p=s.map((function(e){return t(t({vid:c,lineId:1,lineName:"1",url:e.MainPlayUrl,streamType:e.Format,backUrlList:[e.BackupPlayUrl],bitrate:e.Bitrate,size:e.Size,kid:e.PlayAuthId,vwidth:e.Width,vheight:e.Height,codec:e.Codec},e),$$(e,a))})).sort((function(e,t){return t.Bitrate&&e.Bitrate?t.Bitrate-e.Bitrate:-1}));e({playList:p,poster:l,vid:c,duration:u,dashOpts:n.Data?n:{Data:n},thumbs:f,barrageMaskUrl:h})}else e({playList:[],poster:l,vid:c,duration:u,dashOpts:n.Data?n:{Data:n},thumbs:f,barrageMaskUrl:h}),console.error("HAS NO VIDEO INFORMATION CORRECTLY, PLEASE CHECK THE TOKEN.")})).catch((function(e){console.log("err",e),r(e)}))}))}return Promise.resolve()}function K$(e,t,n,i){return q$.apply(this,arguments)}function q$(){return(q$=o(n().mark((function e(t,i,r,o){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t();case 3:case 15:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),!--i||!r(e.t0)){e.next=12;break}return e.abrupt("return",K$(t,i,r,o));case 12:if(!o||"function"!=typeof o){e.next=16;break}return e.next=15,o(e.t0);case 16:throw e.t0;case 17:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}var Y$=function(e){return(null==e?void 0:e.length)&&e.reduce((function(t,n,i){return t[n]={next:i+1>=e.length?null:e[i+1],pre:0===i?null:e[i-1]},t}),{})},$$=function(e,n){if(!e||!e.Definition&&!e.Quality)return{definition:"240P"};var i=e.Definition||e.Quality;if(n){var r=n[i];return r?"string"==typeof r?{definition:r}:t({},r||{}):{definition:i}}return{definition:i}},X$=function(){function e(){a(this,e),this.timeID=null,this.func=null}return l(e,[{key:"repeat",value:function(e,t){this.timeID=1,this.repeatInterval(e,t)}},{key:"repeatInterval",value:function(e,t){var n=this;this.timeID&&(null===this.func&&(this.func=e),this.func===e&&(this.timeID&&clearTimeout(this.timeID),this.timeID=null,this.timeID=setTimeout((function(){e(),n.repeatInterval(e,t)}),t)))}},{key:"clear",value:function(){clearTimeout(this.timeID),this.timeID=null}}]),e}(),J$=l((function e(t){var n=t.url,i=t.method,r=void 0===i?"GET":i,o=t.type,s=t.timeout,l=void 0===s?1e4:s,c=t.body,u=t.xhrSetup,h=t.cache,d=void 0===h||h;return a(this,e),new Promise((function(e,t){var i=new window.XMLHttpRequest,a=r.toUpperCase();if("GET"!==a&&"POST"!==a&&"HEAD"!==a)throw new Error("XHR ".concat(a," is not allowed"));if(o&&(i.responseType=o),l&&(i.timeout=l),i.onload=function(){200===i.status||206===i.status?e(i):t(i)},i.onerror=function(){t(i)},i.ontimeout=function(){t(i)},i.onabort=function(){t(i)},"GET"===a&&!d){var s=/\?/gi.test(n)?"&":"?";n+="".concat(s,"_=").concat((new Date).getTime())}if(i.open(a,"".concat(n),!0),u)try{u(i,n)}catch(xX){console.error("xhr setup failure: ".concat(xX.stack||xX.message))}switch(a){case"POST":"text"===o&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.send(c);break;case"GET":case"HEAD":i.send()}}))})),Z$=function(e){return e&&e.then?e:new Promise((function(e){e(null)}))},Q$=function(e,t){var n;if(t&&e)return Object.keys(e).map((function(i){i.toLowerCase()===t.toLowerCase()&&(n=e[i])})),n};function eX(e){return/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/.test(e)}function tX(){var e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return"zh-cn"===e&&(e="zh"),e}function nX(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=setTimeout((function(){n&&console.warn(n),i=null}),t);return e.then?e.then((function(){return clearTimeout(i)})):(clearTimeout(i),i=null),e}function iX(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return new Promise((function(i,r){e().then(i).catch((function(o){setTimeout((function(){1!==t?iX(e,t-1,n).then(i,r):r(o)}),n)}))}))}function rX(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if(!window.MediaSource)return!1;try{return window.MediaSource.isTypeSupported(e)}catch(w7){return console.error("mse error",w7),!1}}var oX=/["'&<>]/;var aX={playDomain:{}.VITE_PLAY_DOMAIN,backupPlayDomain:{}.VITE_BACKUP_PLAY_DOMAIN},sX=["options","type","isLive","id","root","plugins","defaultConfig","languages","url","codec","playList","streamType","isMobile","useSoftDecoding","enableH265Degrade","checkExpireInterval","expireDetectType","onMediaExpired","onTokenExpired","platform","unionId","isMusic"],lX=function(){function e(t){a(this,e),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:void 0};var n=t.options,i=t.type,r=t.isLive,o=t.id,s=t.root,l=t.plugins,c=void 0===l?[]:l,u=t.defaultConfig,h=t.languages;t.url;var d=t.codec;t.playList,t.streamType;var p,g,v=t.isMobile,y=void 0!==v&&v,m=t.useSoftDecoding,k=void 0!==m&&m,w=t.enableH265Degrade,E=void 0!==w&&w,T=t.checkExpireInterval,S=void 0===T?400:T,C=t.expireDetectType,x=void 0===C?[]:C,O=t.onMediaExpired,P=t.onTokenExpired,I=t.platform,L=t.unionId,D=t.isMusic,A=void 0!==D&&D,M=f(t,sX);this.configs=t,this.options=Object.assign({},n,M),this.options.poster="string"==typeof this.options.poster?function(e){var t,n=""+e,i=oX.exec(n);if(!i)return n;var r,o="",a=0;for(r=i.index;r<n.length;r++){switch(n.charCodeAt(r)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}a!==r&&(o+=n.substring(a,r)),a=r+1,o+=t}return a!==r?o+n.substring(a,r):o}(this.options.poster):void 0,this.options.icons=(p=this.options.icons,g={},p&&Object.entries(p).forEach((function(e){var t=_(e,2),n=t[0],i=t[1];i&&"string"!=typeof i&&(g[n]=i)})),g),this.id=o,this.root=s,this.type=i,this.isLive=!!(null!=r?r:"live"===i),this.defaultConfig=u,this.languageData=this.initI18nData(h),this.isMobile=y||"mobile"===vN.device,this.openSoftDecoding=k,this.enableH265Degrade=E,this.codec=d,this.checkExpireInterval=S,this.expireDetectType=x,this.onMediaExpired=O,this.onTokenExpired=P,this.initPlayData(t),this.current=wD.observe(this.current),this.playList=wD.observe(this.playList),this.plugins=b(c),this.isMusic=A,this.platform=I,this.unionId=L,this.apiMap=aX}return l(e,[{key:"initPlayData",value:function(e){var t=this.initPlaylistAndGetCurrent(e);this.initCurrent(t)}},{key:"initPlaylistAndGetCurrent",value:function(e){var n,i=e.url,r=e.playList,o=e.streamType,a=void 0===o?"":o,s=null;if(r&&(this.playList=b(r)),i)if(0===this.playList.length)this.playList=[t(t({},this.current),{},{url:i,streamType:a})];else{var l=this.getUrlList({url:i});l.length>0?s=l[0]:console.log("默认url不在Playlist中")}var c=this.getCurrentByDefaultConfig();return c&&(s=c),null!==(n=s)&&void 0!==n?n:this.playList[0]}},{key:"isCurrentH265",value:function(){return!!this.codec&&this.codec.replace(".","").toLowerCase()===TI.H265}},{key:"getCurrentByDefaultConfig",value:function(){if(this.defaultConfig){var e=this.defaultConfig,t=e.type,n=e.isLive,i=e.lineId,r=void 0===i?"":i,o=e.definition,a=void 0===o?"":o;if((null!=n?n:"live"===t)===this.isLive){if(!r&&!a)return console.log("默认配置未设置默认线路或默认清晰度"),void(this.isHitDefault=!1);var s=this.getUrlList({lineId:r,definition:a});return s.length>0?(this.isHitDefault=!0,s[0]):(console.log("playlist中没有满足默认配置的流"),void(this.isHitDefault=!1))}}}},{key:"initCurrent",value:function(e){var t=this;Object.keys(this.current).forEach((function(n){t.current[n]=null==e?void 0:e[n]}));var n=(null==e?void 0:e.codec)||(null==e?void 0:e.Codec);n&&1===this.playList.length&&(this.codec=n)}},{key:"initI18nData",value:function(e){var t=[mY,yY],n=e&&Object.entries(e).reduce((function(e,n){var i=_(n,2),r=i[0],o=i[1];return x$.includes(r)?e.push({LANG:"zh"===r?"zh-cn":r,TEXT:o}):t.push({LANG:r,TEXT:o}),e}),[]);return{extraLangList:t,extendLangList:n}}},{key:"getCurrentUrl",value:function(){var e;return null===(e=this.getCurrentStreams()[0])||void 0===e?void 0:e.url}},{key:"getCurrentStreamType",value:function(){var e=this.getCurrentStreams();if(e.length){var t=e[0],n=t.url;return t.streamType||function(e){return function(e){return e&&0<e.toLowerCase().indexOf(".m3u8")}(e)?"hls":function(e){return e&&0<e.toLowerCase().indexOf(".flv")}(e)?"flv":function(e){return e&&0<e.toLowerCase().indexOf(".sdp")}(e)?"rtm":function(e){return e&&0<e.toLowerCase().indexOf(".mp4")}(e)?"mp4":function(e){return e&&0<e.toLowerCase().indexOf(".mpd")}(e)?"dash":"mp4"}(n)}return this.configs.streamType}},{key:"getCurrentStreams",value:function(){var e=this.current;return this.getUrlList(e)}},{key:"getLineList",value:function(){return VO(EI(this.playList,"lineId"))}},{key:"getLineListByLineId",value:function(e){return this.playList.filter((function(t){var n;return(null==e?void 0:e.toString())===(null===(n=t.lineId)||void 0===n?void 0:n.toString())}))}},{key:"getDefinitionListByLineId",value:function(e){return VO(EI(this.getLineListByLineId(e),"definition"))}},{key:"getUrlList",value:function(e){return this.playList.filter((function(t){return Object.keys(e).every((function(n){var i,r,o=(null===(i=e[n])||void 0===i?void 0:i.toString())===(null===(r=t[n])||void 0===r?void 0:r.toString()),a=!e[n];return o||a}))}))}},{key:"getNextDefinition",value:function(){var e,t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=arguments.length>1?arguments[1]:void 0,r=n?"next":"prev",o=this.current,a=o.definition,s=o.lineId;if(a){var l=null===(e=this.getCurrentStreams())||void 0===e?void 0:e[0],c="auto"===a?l.mapDefinition:a,u=Y$(i)||C$,h=Object.keys(u);if(h.includes(c)){for(var d=null===(t=u[c])||void 0===t?void 0:t[r],f=this.getDefinitionListByLineId(s);0===f.filter((function(e){return e.definition===d})).length&&d;){var p;d=null===(p=u[d])||void 0===p?void 0:p[r]}if(d)return"auto"===a&&d&&(l.mapDefinition=d),this.getUrlList({lineId:s,definition:d});console.log("已经降至最低级")}}}}]),e}(),cX=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},uX=D,hX=sn,dX=ie,fX=ae,pX=cX,gX=wo,vX=qe,yX=I_;f_("search",(function(e,t,n){return[function(t){var n=fX(this),i=dX(t)?void 0:vX(t,e);return i?uX(i,t,n):new RegExp(t)[e](gX(n))},function(e){var i=hX(this),r=gX(e),o=n(t,i,r);if(o.done)return o.value;var a=i.lastIndex;pX(a,0)||(i.lastIndex=0);var s=yX(i,r);return pX(i.lastIndex,a)||(i.lastIndex=a),null===s?-1:s.index}]}));var mX=Er,_X=Pr,bX=J([].reverse),kX=[1,2];mX({target:"Array",proto:!0,forced:String(kX)===String(kX.reverse())},{reverse:function(){return _X(this)&&(this.length=this.length),bX(this)}});var wX=function(){return(wX=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function EX(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function TX(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(EX(arguments[t]));return e}var SX,CX,xX,OX,PX,IX,LX=function(){function e(){this._hooks={},this._cache=[],this._hooksCache={}}return e.prototype.on=function(e,t){e&&t&&"function"==typeof t&&(this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t))},e.prototype.once=function(e,t){var n=this;e&&t&&"function"==typeof t&&this.on(e,(function i(r){t(r),n.off(e,i)}))},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var n=this._hooks[e].indexOf(t);-1!==n&&this._hooks[e].splice(n,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t,n){if(n){if(!e)return;-1!==this._cache.indexOf(n)?this._emit(e,t):(this._hooksCache.hasOwnProperty(n)||(this._hooksCache[n]={}),this._hooksCache[n].hasOwnProperty(e)||(this._hooksCache[n][e]=[]),this._hooksCache[n][e].push(t))}else this._emit(e,t)},e.prototype._emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&TX(this._hooks[e]).forEach((function(e){try{e(t)}catch(n){}}))},e.prototype.set=function(e){e&&-1===this._cache.indexOf(e)&&this._cache.push(e)},e}(),DX=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},AX=(SX=+Date.now()+Number((""+Math.random()).slice(2,8)),function(){return SX+=1}),MX=function(e){return function(e,t,n){if("string"==typeof e&&"number"==typeof n){var i,r=[];n=n<=25?n:n%25;var o=String.fromCharCode(n+97);i=e.split(o);for(var a=0;a<i.length;a++){var s=parseInt(i[a],n);s=1*s^64;var l=String.fromCharCode(s);r.push(l)}return r.join("")}}(e,0,25)},RX=function(e){var t=document.createElement("a");return t.href=e,t},NX=function(e){var t={};try{var n=RX(e).search;(n=n.slice(1)).split("&").forEach((function(e){var n,i,r=e.split("=");r.length&&(n=r[0],i=r[1]);try{t[n]=decodeURIComponent(void 0===i?"":i)}catch(o){t[n]=i}}))}catch(i){}return t},jX=function(e){for(var t=0,n=0,i=(e+="").length,r=0;r<i;r++)((t=31*t+e.charCodeAt(n++))>0x7fffffffffff||t<-0x800000000000)&&(t&=0xffffffffffff);return t<0&&(t+=0x7ffffffffffff),t},BX=(xX=CX={exports:{}},OX=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var i in n)t[i]=n[i]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function n(i){function r(){}function o(t,n,o){if("undefined"!=typeof document){"number"==typeof(o=e({path:"/"},r.defaults,o)).expires&&(o.expires=new Date(1*new Date+864e5*o.expires)),o.expires=o.expires?o.expires.toUTCString():"";try{var a=JSON.stringify(n);/^[\{\[]/.test(a)&&(n=a)}catch(c){}n=i.write?i.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var s="";for(var l in o)o[l]&&(s+="; "+l,!0!==o[l]&&(s+="="+o[l].split(";")[0]));return document.cookie=t+"="+n+s}}function a(e,n){if("undefined"!=typeof document){for(var r={},o=document.cookie?document.cookie.split("; "):[],a=0;a<o.length;a++){var s=o[a].split("="),l=s.slice(1).join("=");n||'"'!==l.charAt(0)||(l=l.slice(1,-1));try{var c=t(s[0]);if(l=(i.read||i)(l,c)||t(l),n)try{l=JSON.parse(l)}catch(u){}if(r[c]=l,e===c)break}catch(u){}}return e?r[e]:r}}return r.set=o,r.get=function(e){return a(e,!1)},r.getJSON=function(e){return a(e,!0)},r.remove=function(t,n){o(t,"",e(n,{expires:-1}))},r.defaults={},r.withConverter=n,r}((function(){}))},xX.exports=OX(),CX.exports),UX=function(e,t){try{return BX.get(e,{domain:t||document.domain})}catch(n){return""}},HX=function(e,t,n,i){try{var r=i||document.domain,o=+new Date+(n||6048e5);BX.set(e,t,{expires:new Date(o),path:"/",domain:r})}catch(a){}},FX=function(){function e(){this.cache={}}return e.prototype.setItem=function(e,t){this.cache[e]=t},e.prototype.getItem=function(e){return this.cache[e]},e.prototype.removeItem=function(e){this.cache[e]=void 0},e.prototype.getCookie=function(e,t){return UX(e,t)},e.prototype.setCookie=function(e,t,n,i){HX(e,t,n,i)},e}(),GX={getItem:function(e){try{var t=localStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(i){}return n||{}}catch(i){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,n)}catch(i){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(t){}},getCookie:function(e,t){return UX(e,t)},setCookie:function(e,t,n,i){HX(e,t,n,i)},isSupportLS:function(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(xX){return!1}}()},VX={getItem:function(e){try{var t=sessionStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(i){}return n||{}}catch(i){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,n)}catch(i){}},removeItem:function(e){try{sessionStorage.removeItem(e)}catch(t){}},getCookie:function(e,t){return UX(e,t)},setCookie:function(e,t,n,i){HX(e,t,n,i)},isSupportSession:function(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(xX){return!1}}()},zX=function(){function e(e,t){this._storage=t&&"session"===t?VX:!e&&GX.isSupportLS?GX:new FX}return e.prototype.getItem=function(e){return this._storage.getItem(e)},e.prototype.setItem=function(e,t){this._storage.setItem(e,t)},e.prototype.getCookie=function(e,t){return this._storage.getCookie(e,t)},e.prototype.setCookie=function(e,t,n,i){this._storage.setCookie(e,t,n,i)},e.prototype.removeItem=function(e){this._storage.removeItem(e)},e}(),WX=function(){function e(e,t,n){this.appid=e,this.domain=t,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion,this.cookie_expire=n}return e.prototype.init=function(){var e=window.navigator.userAgent,t=window.navigator.language,n=document.referrer,i=n?RX(n).hostname:"",r=NX(window.location.href),o=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(this.appVersion)?"wap":"web";this.utm=function(e,t,n,i){var r=new zX(!1),o=new zX(!1,"session"),a=e?"_tea_utm_cache_"+e:"_tea_utm_cache",s=e?"_$utm_from_url_"+e:"_$utm_from_url",l={},c=["tr_shareuser","tr_admaster","tr_param1","tr_param2","tr_param3","tr_param4","$utm_from_url"],u={ad_id:Number(t.ad_id)||void 0,campaign_id:Number(t.campaign_id)||void 0,creative_id:Number(t.creative_id)||void 0,utm_source:t.utm_source,utm_medium:t.utm_medium,utm_campaign:t.utm_campaign,utm_term:t.utm_term,utm_content:t.utm_content,tr_shareuser:t.tr_shareuser,tr_admaster:t.tr_admaster,tr_param1:t.tr_param1,tr_param2:t.tr_param2,tr_param3:t.tr_param3,tr_param4:t.tr_param4};try{var h=!1;for(var d in u)u[d]&&(-1!==c.indexOf(d)?(l.hasOwnProperty("tracer_data")||(l.tracer_data={}),l.tracer_data[d]=u[d]):l[d]=u[d],h=!0);if(h)o.setItem(s,"1"),r.setCookie(a,JSON.stringify(l),i,n);else{var f=r.getCookie(a,n);f&&(l=JSON.parse(f))}o.getItem(s)&&(l.hasOwnProperty("tracer_data")||(l.tracer_data={}),l.tracer_data.$utm_from_url=1)}catch(p){return u}return l}(this.appid,r,this.domain,this.cookie_expire);var a=this.browser(),s=this.os();return{browser:a.browser,browser_version:a.browser_version,platform:o,os_name:s.os_name,os_version:s.os_version,userAgent:e,screen_width:window.screen&&window.screen.width,screen_height:window.screen&&window.screen.height,device_model:this.getDeviceModel(s.os_name),language:t,referrer:n,referrer_host:i,utm:this.utm,latest_data:this.last(n,i)}},e.prototype.last=function(e,t){var n="",i="",r="",o=location.hostname,a=!1;if(e&&t&&o!==t){n=e,i=t,a=!0;var s=NX(e);s.keyword&&(r=s.keyword)}return{$latest_referrer:n,$latest_referrer_host:i,$latest_search_keyword:r,isLast:a}},e.prototype.browser=function(){var e,t,n="",i=""+parseFloat(this.appVersion),r=this.userAgent;return-1!==r.indexOf("Edge")||-1!==r.indexOf("Edg")?(n="Microsoft Edge",-1!==r.indexOf("Edge")?(e=r.indexOf("Edge"),i=r.substring(e+5)):(e=r.indexOf("Edg"),i=r.substring(e+4))):-1!==(e=r.indexOf("MSIE"))?(n="Microsoft Internet Explorer",i=r.substring(e+5)):-1!==(e=r.indexOf("Lark"))?(n="Lark",i=r.substring(e+5,e+11)):-1!==(e=r.indexOf("MetaSr"))?(n="sougoubrowser",i=r.substring(e+7,e+10)):-1!==r.indexOf("MQQBrowser")||-1!==r.indexOf("QQBrowser")?(n="qqbrowser",-1!==r.indexOf("MQQBrowser")?(e=r.indexOf("MQQBrowser"),i=r.substring(e+11,e+15)):-1!==r.indexOf("QQBrowser")&&(e=r.indexOf("QQBrowser"),i=r.substring(e+10,e+17))):-1!==r.indexOf("Chrome")?-1!==(e=r.indexOf("MicroMessenger"))?(n="weixin",i=r.substring(e+15,e+20)):-1!==(e=r.indexOf("360"))?(n="360browser",i=r.substring(r.indexOf("Chrome")+7)):-1!==r.indexOf("baidubrowser")||-1!==r.indexOf("BIDUBrowser")?(-1!==r.indexOf("baidubrowser")?(e=r.indexOf("baidubrowser"),i=r.substring(e+13,e+16)):-1!==r.indexOf("BIDUBrowser")&&(e=r.indexOf("BIDUBrowser"),i=r.substring(e+12,e+15)),n="baidubrowser"):-1!==(e=r.indexOf("xiaomi"))?-1!==r.indexOf("openlanguagexiaomi")?(n="openlanguage xiaomi",i=r.substring(e+7,e+13)):(n="xiaomi",i=r.substring(e-7,e-1)):-1!==(e=r.indexOf("TTWebView"))?(n="TTWebView",i=r.substring(e+10,e+23)):(-1!==(e=r.indexOf("Chrome"))||-1!==(e=r.indexOf("Chrome")))&&(n="Chrome",i=r.substring(e+7)):-1!==r.indexOf("Safari")?-1!==(e=r.indexOf("QQ"))?(n="qqbrowser",i=r.substring(e+10,e+16)):-1!==(e=r.indexOf("Safari"))&&(n="Safari",i=r.substring(e+7),-1!==(e=r.indexOf("Version"))&&(i=r.substring(e+8))):-1!==(e=r.indexOf("Firefox"))?(n="Firefox",i=r.substring(e+8)):-1!==(e=r.indexOf("MicroMessenger"))?(n="weixin",i=r.substring(e+15,e+20)):-1!==(e=r.indexOf("QQ"))&&(n="qqbrowser",i=r.substring(e+3,e+8)),-1!==(t=i.indexOf(";"))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(" "))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(")"))&&(i=i.substring(0,t)),{browser:n,browser_version:i}},e.prototype.os=function(){for(var e="",t="",n=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],i=0;i<n.length;i++){var r=n[i];if(r.r.test(this.userAgent)){"Mac OS X"===(e=r.s)&&this.isNewIpad()&&(e="iOS");break}}var o,a,s=function(e,t){var n=e.exec(t);return n&&n[1]?n[1]:""},l=function(e,t){var n=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:"+e+")","i").exec(t);return n?n.slice(1)[0]:""};switch(/Windows/.test(e)&&(t=s(/Windows (.*)/,e),e="windows"),e){case"Mac OS X":t=l("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent),e="mac";break;case"Android":(a=s(/Android ([\.\_\d]+)/,o=this.userAgent))||(a=s(/Android\/([\.\_\d]+)/,o)),t=a,e="android";break;case"iOS":t=this.isNewIpad()?l("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent):(t=/OS (\d+)_(\d+)_?(\d+)?/.exec(this.appVersion))?t[1]+"."+t[2]+"."+(0|t[3]):"",e="ios"}return{os_name:e,os_version:t}},e.prototype.getDeviceModel=function(e){var t="";try{if("android"===e)navigator.userAgent.split(";").forEach((function(e){e.indexOf("Build/")>-1&&(t=e.slice(0,e.indexOf("Build/")))}));else if("ios"===e||"mac"===e||"windows"===e)if(this.isNewIpad())t="iPad";else{var n=navigator.userAgent.replace("Mozilla/5.0 (",""),i=n.indexOf(";");t=n.slice(0,i)}}catch(r){return t.trim()}return t.trim()},e.prototype.isNewIpad=function(){return void 0!==this.userAgent&&"MacIntel"===navigator.platform&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1},e}(),KX={cn:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},qX={cn:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az28z1gz1hz1gz1cz18z1nz1gz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz21z1ez18z1jz1gz49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz18z1jz1gz24z18z49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k"},YX="5.0.29";!function(e){e.Init="init",e.Config="config",e.Start="start",e.Ready="ready",e.TokenComplete="token-complete",e.TokenStorage="token-storage",e.TokenFetch="token-fetch",e.TokenError="token-error",e.ConfigUuid="config-uuid",e.ConfigWebId="config-webid",e.ConfigDomain="config-domain",e.CustomWebId="custom-webid",e.TokenChange="token-change",e.TokenReset="token-reset",e.ConfigTransform="config-transform",e.EnvTransform="env-transform",e.SessionReset="session-reset",e.SessionResetTime="session-reset-time",e.Event="event",e.Events="events",e.EventNow="event-now",e.CleanEvents="clean-events",e.BeconEvent="becon-event",e.SubmitBefore="submit-before",e.SubmitScuess="submit-scuess",e.SubmitAfter="submit-after",e.SubmitError="submit-error",e.SubmitVerify="submit-verify",e.Stay="stay",e.ResetStay="reset-stay",e.StayReady="stay-ready",e.SetStay="set-stay",e.RouteChange="route-change",e.RouteReady="route-ready",e.Ab="ab",e.AbVar="ab-var",e.AbAllVars="ab-all-vars",e.AbConfig="ab-config",e.AbExternalVersion="ab-external-version",e.AbVersionChangeOn="ab-version-change-on",e.AbVersionChangeOff="ab-version-change-off",e.AbOpenLayer="ab-open-layer",e.AbCloseLayer="ab-close-layer",e.AbReady="ab-ready",e.AbComplete="ab-complete",e.Profile="profile",e.ProfileSet="profile-set",e.ProfileSetOnce="profile-set-once",e.ProfileUnset="profile-unset",e.ProfileIncrement="profile-increment",e.ProfileAppend="profile-append",e.ProfileClear="profile-clear",e.Autotrack="autotrack",e.AutotrackReady="autotrack-ready",e.CepReady="cep-ready",e.TracerReady="tracer-ready"}(PX||(PX={})),function(e){e.DEBUGGER_MESSAGE="debugger-message",e.DEBUGGER_MESSAGE_SDK="debugger-message-sdk",e.DEBUGGER_MESSAGE_FETCH="debugger-message-fetch",e.DEBUGGER_MESSAGE_FETCH_RESULT="debugger-message-fetch-result",e.DEBUGGER_MESSAGE_EVENT="debugger-message-event",e.DEVTOOL_WEB_READY="devtool-web-ready"}(IX||(IX={}));var $X=PX,XX=void 0,JX=(new Date).getTimezoneOffset(),ZX=parseInt(""+-JX/60,10),QX=60*JX,eJ=function(){function e(e,t){this.is_first_time=!0,this.configPersist=!1,this.initConfig=t,this.collect=e;var n=new WX(t.app_id,t.cookie_domain||"",t.cookie_expire||6048e5).init(),i="__tea_cache_first_"+t.app_id;this.configKey="__tea_cache_config_"+t.app_id,this.sessionStorage=new zX(!1,"session"),this.localStorage=new zX(!1,"local"),t.configPersist&&(this.configPersist=!0,this.storage=1===t.configPersist?this.sessionStorage:this.localStorage);var r=this.localStorage.getItem(i);r&&"1"===r?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(i,"1")),this.envInfo={user:{user_unique_id:XX,user_type:XX,user_id:XX,user_is_auth:XX,user_is_login:XX,device_id:XX,web_id:XX,ip_addr_id:XX,user_unique_id_type:XX},header:{app_id:XX,app_name:XX,app_install_id:XX,install_id:XX,app_package:XX,app_channel:XX,app_version:XX,os_name:n.os_name,os_version:n.os_version,device_model:n.device_model,ab_client:XX,traffic_type:XX,client_ip:XX,device_brand:XX,os_api:XX,access:XX,language:n.language,region:XX,app_language:XX,app_region:XX,ab_version:XX,creative_id:n.utm.creative_id,ad_id:n.utm.ad_id,campaign_id:n.utm.campaign_id,log_type:XX,rnd:XX,platform:n.platform,sdk_version:YX,sdk_lib:"js",province:XX,city:XX,timezone:ZX,tz_offset:QX,tz_name:XX,sim_region:XX,carrier:XX,resolution:n.screen_width+"x"+n.screen_height,browser:n.browser,browser_version:n.browser_version,referrer:n.referrer,referrer_host:n.referrer_host,width:n.screen_width,height:n.screen_height,screen_width:n.screen_width,screen_height:n.screen_height,utm_term:n.utm.utm_term,utm_content:n.utm.utm_content,utm_source:n.utm.utm_source,utm_medium:n.utm.utm_medium,utm_campaign:n.utm.utm_campaign,tracer_data:JSON.stringify(n.utm.tracer_data),custom:{},wechat_unionid:XX,wechat_openid:XX}},this.ab_version="",this.evtParams={},this.reportErrorCallback=function(){},this.initDomain()}return e.prototype.initDomain=function(){var e=this.initConfig.channel_domain;if(e)this.domain=e;else{var t=this.initConfig.channel;this.domain=MX(qX[t])}},e.prototype.setDomain=function(e){this.domain=e},e.prototype.getDomain=function(){return this.domain},e.prototype.setAbVersion=function(e){this.ab_version=e},e.prototype.getAbVersion=function(){return this.ab_version},e.prototype.setAbData=function(e){this.ab_data=e},e.prototype.getAbData=function(){return this.ab_data||{}},e.prototype.getUrl=function(e){var t="";switch(e){case"event":t=this.initConfig.report_url||"/list";break;case"webid":t="/webid";break;case"tobid":t="/tobid"}var n="";return this.initConfig.caller&&(n="?sdk_version="+YX+"&sdk_name=web&app_id="+this.initConfig.app_id+"&caller="+this.initConfig.caller),""+this.getDomain()+t+n},e.prototype.set=function(e){var t=this;Object.keys(e).forEach((function(n){if(void 0!==e[n]&&null!==e[n]||t.delete(n),"evtParams"===n)t.evtParams=wX({},t.evtParams||{},e.evtParams||{});else if("_staging_flag"===n)t.evtParams=wX({},t.evtParams||{},{_staging_flag:e._staging_flag});else if("reportErrorCallback"===n&&"function"==typeof e[n])t.reportErrorCallback=e[n];else{var i="",r="";if(n.indexOf(".")>-1){var o=n.split(".");i=o[0],r=o[1]}i?"user"===i||"header"===i?t.envInfo[i][r]=e[n]:t.envInfo.header.custom[r]=e[n]:t.envInfo.user.hasOwnProperty(n)?["user_type","ip_addr_id"].indexOf(n)>-1?t.envInfo.user[n]=e[n]?Number(e[n]):e[n]:["user_id","web_id","user_unique_id","user_unique_id_type"].indexOf(n)>-1?t.envInfo.user[n]=e[n]?String(e[n]):e[n]:["user_is_auth","user_is_login"].indexOf(n)>-1?t.envInfo.user[n]=Boolean(e[n]):"device_id"===n&&(t.envInfo.user[n]=e[n]):t.envInfo.header.hasOwnProperty(n)?t.envInfo.header[n]=e[n]:t.envInfo.header.custom[n]=e[n]}}))},e.prototype.get=function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:this.envInfo.user.hasOwnProperty(e)?this.envInfo.user[e]:this.envInfo.header.hasOwnProperty(e)?this.envInfo.header[e]:JSON.parse(JSON.stringify(this.envInfo[e])):JSON.parse(JSON.stringify(this.envInfo))}catch(t){console.log("get config stringify error "),this.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message})}},e.prototype.setStore=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};if(t&&Object.keys(e).length){var n=Object.assign(e,t);this.storage.setItem(this.configKey,n)}}catch(i){this.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:i.message})}},e.prototype.getStore=function(){try{if(!this.configPersist)return null;var e=this.storage.getItem(this.configKey);return e&&Object.keys(e).length?e:null}catch(t){return this.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),null}},e.prototype.delete=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey);t&&t.hasOwnProperty(e)&&(delete t[e],this.storage.setItem(this.configKey,t))}catch(n){this.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message})}},e}(),tJ=function(){function e(e,t){this.isLog=t||!1,this.name=e||""}return e.prototype.info=function(e){this.isLog&&console.log("%c %s","color: yellow; background-color: black;","[instance: "+this.name+"] "+e)},e.prototype.warn=function(e){this.isLog&&console.warn("[instance: "+this.name+"] "+e)},e.prototype.error=function(e){this.isLog&&console.error("[instance: "+this.name+"] "+e)},e.prototype.throw=function(e){throw this.error(this.name),new Error(e)},e}(),nJ=function(){function e(e,t){this.collect=e,this.native=t}var t=e.prototype;return t.bridgeInject=function(){try{return!!this.native&&(AppLogBridge?(console.log("AppLogBridge is injected"),!0):(console.log("AppLogBridge is not inject"),!1))}catch(e){return console.log("AppLogBridge is not inject"),!1}},t.bridgeReady=function(){var e=this;return new Promise((function(t,n){try{e.bridgeInject()?AppLogBridge.hasStarted((function(e){console.log("AppLogBridge is started? : "+e),e?t(!0):n(!1)})):n(!1)}catch(i){console.log("AppLogBridge, error:"+JSON.stringify(i.stack)),n(!1)}}))},t.setNativeAppId=function(e){try{AppLogBridge.setNativeAppId(JSON.stringify(e)),console.log("change bridge appid, event report with appid: "+e)}catch(t){console.error("setNativeAppId error")}},t.setConfig=function(e){var t=this;try{Object.keys(e).forEach((function(n){"user_unique_id"===n?t.setUserUniqueId(e[n]):e[n]?t.addHeaderInfo(n,e[n]):t.removeHeaderInfo(n)}))}catch(n){console.error("setConfig error")}},t.setUserUniqueId=function(e){try{AppLogBridge.setUserUniqueId(e)}catch(t){console.error("setUserUniqueId error")}},t.addHeaderInfo=function(e,t){try{AppLogBridge.addHeaderInfo(e,t)}catch(n){console.error("addHeaderInfo error")}},t.setHeaderInfo=function(e){try{AppLogBridge.setHeaderInfo(JSON.stringify(e))}catch(t){console.error("setHeaderInfo error")}},t.removeHeaderInfo=function(e){try{AppLogBridge.removeHeaderInfo(e)}catch(t){console.error("removeHeaderInfo error")}},t.reportPv=function(e){this.onEventV3("predefine_pageview",e)},t.onEventV3=function(e,t){try{AppLogBridge.onEventV3(e,t),this.collect.emit(DebuggerMesssge.DEBUGGER_MESSAGE,{type:DebuggerMesssge.DEBUGGER_MESSAGE_EVENT,info:"bridge埋点上报",time:Date.now(),data:[{events:[{event:e,params:t}]}],code:200,status:"success"})}catch(n){console.error("onEventV3 error")}},t.profileSet=function(e){try{AppLogBridge.profileSet(e)}catch(t){console.error("profileSet error")}},t.profileSetOnce=function(e){try{AppLogBridge.profileSetOnce(e)}catch(t){console.error("profileSetOnce error")}},t.profileIncrement=function(e){try{AppLogBridge.profileIncrement(e)}catch(t){console.error("profileIncrement error")}},t.profileUnset=function(e){try{AppLogBridge.profileUnset(e)}catch(t){console.error("profileUnset error")}},t.profileAppend=function(e){try{AppLogBridge.profileAppend(e)}catch(t){console.error("profileAppend error")}},e}(),iJ=500,rJ=5005;function oJ(e,t,n,i,r,o,a,s,l){try{var c=new XMLHttpRequest,u=s||"POST";c.open(u,""+e,!0),c.setRequestHeader("Content-Type","application/json; charset=utf-8"),a&&c.setRequestHeader("X-MCS-AppKey",""+a),i&&(c.withCredentials=!0),c.onload=function(){if(r){var e=null;if(c.responseText){try{e=JSON.parse(c.responseText)}catch(n){e={}}r(e,t)}}},n&&(c.timeout=n,c.ontimeout=function(){o&&o(t,rJ)}),c.onerror=function(){c.abort(),o&&o(t,iJ)},l?c.send(t):c.send(JSON.stringify(t))}catch(h){}}var aJ=function(e,t,n,i){try{var r,o=e.match(/\/v\d\//);r=o?o[0]:-1!==e.indexOf("/v1/")?"/v1/":"/v2/";var a=e.split(r)[0];if(!a)return void i(e,t,4001);t.forEach((function(r){var o=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&(t+="&"+n+"="+encodeURIComponent(JSON.stringify(e[n])));return"&"===t[0]?t.slice(1):t}(r),s=new Image(1,1);s.onload=function(){s=null,n&&n()},s.onerror=function(){s=null,i&&i(e,t,4e3)},s.src=a+"/gif?"+o}))}catch(s){i&&i(e,t,4002,s.message)}},sJ=function(e,t,n,i,r,o,a,s){var l=window.navigator.userAgent;if(-1===window.navigator.appName.indexOf("Microsoft Internet Explorer")||-1===l.indexOf("MSIE 8.0")&&-1===l.indexOf("MSIE 9.0")){if(a)return window.navigator&&window.navigator.sendBeacon?void(window.navigator.sendBeacon(e,JSON.stringify(t))?r():o(e,t,4003)):void aJ(e,t,r,o)}else aJ(e,t,r,o);oJ(e,t,n,i,r,o,"","",s)},lJ=function(){function e(e,t){this.collector=e,this.config=t,this.eventNameWhiteList=["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure"],this.paramsNameWhiteList=["$inactive","$inline","$target_uuid_list","$source_uuid","$is_spider","$source_id","$is_first_time","_staging_flag"],this.regStr=new RegExp("^[a-zA-Z0-9][a-z0-9A-Z_.-]{1,255}$")}return e.prototype.checkVerify=function(e){var t=this;if(!e||!e.length)return!1;var n=e[0];if(!n)return!1;var i=n.events,r=n.header;if(!i||!i.length)return!1;var o=!0;return i.forEach((function(e){t.checkEventName(e.event)||(o=!1,e.checkEvent="事件名不能以 $ or __开头"),t.checkEventParams(e.params)||(o=!1,e.checkParams="属性名不能以 $ or __开头")})),this.checkEventParams(r)||(o=!1),o},e.prototype.checkEventName=function(e){return!!e&&this.calculate(e,"event")},e.prototype.checkEventParams=function(e){var t=e;if("string"==typeof e&&(t=JSON.parse(t)),!Object.keys(t).length)return!0;for(var n in t)return!(!this.calculate(n,"params")||"string"==typeof t[n]&&t[n].length>1024&&(console.warn("params: "+n+" can not over 1024 byte, please check;"),1));return!0},e.prototype.calculate=function(e,t){return-1!==("event"===t?this.eventNameWhiteList:this.paramsNameWhiteList).indexOf(e)||(this.regStr.test(e)?!new RegExp("^\\$").test(e)&&!new RegExp("^__").test(e)||(console.warn(("event"===t?"event":"params")+" name: "+e+" can not start with $ or __, pleace check;"),!1):(console.warn(("event"===t?"event":"params")+" name: "+e+" is illegal, can not start with $ or __, pleace check;"),!1))},e}(),cJ=function(){function e(){this.eventLimit=50,this.enable_ttwebid=!1,this.eventCache=[],this.beconEventCache=[]}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.eventCheck=new lJ(e,t),this.cacheStorgae=new zX(!0),this.localStorage=new zX(!1),this.maxReport=t.max_report||10,this.reportTime=t.reportTime||30,this.timeout=t.timeout||1e5,this.enable_ttwebid=t.enable_ttwebid,this.reportUrl=this.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+this.configManager.get("app_id"),this.beconKey="__tea_cache_events_becon_"+this.configManager.get("app_id"),this.abKey="__tea_sdk_ab_version_"+this.configManager.get("app_id"),this.collect.on($X.Ready,(function(){n.reportAll(!1)})),this.collect.on($X.ConfigDomain,(function(){n.reportUrl=n.configManager.getUrl("event")})),this.collect.on($X.Event,(function(e){n.event(e)})),this.collect.on($X.BeconEvent,(function(e){n.beconEvent(e)})),this.collect.on($X.CleanEvents,(function(){n.reportAll(!1)})),this.linster()},e.prototype.linster=function(){var e,t=this;window.addEventListener("unload",(function(){t.reportAll(!0)}),!1),e=function(){t.reportAll(!0)},navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",e,!1):window.addEventListener("beforeunload",e,!1),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t.reportAll(!0)}),!1)},e.prototype.reportAll=function(e){this.report(e),this.reportBecon()},e.prototype.event=function(e){var t=this;try{var n=TX(e,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,n),this.reportTimeout&&clearTimeout(this.reportTimeout),n.length>=this.maxReport)this.report(!1);else{var i=this.reportTime;this.reportTimeout=setTimeout((function(){t.report(!1),t.reportTimeout=null}),i)}}catch(r){this.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:r.message})}},e.prototype.beconEvent=function(e){var t=TX(e,this.cacheStorgae.getItem(this.beconKey)||[]);this.cacheStorgae.setItem(this.beconKey,t),this.collect.destroyInstance||this.collect.tokenManager.getReady()&&this.collect.sdkReady&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(t)),!0))},e.prototype.reportBecon=function(){if(!this.collect.destroyInstance&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var e=this.cacheStorgae.getItem(this.beconKey)||[];e&&e.length&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(e)),!0))}},e.prototype.report=function(e){if(!this.collect.destroyInstance&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var t=this.cacheStorgae.getItem(this.eventKey)||[];t.length&&(this.cacheStorgae.removeItem(this.eventKey),this.sliceEvent(t,e))}},e.prototype.sliceEvent=function(e,t){if(e.length>this.eventLimit)for(var n=0;n<e.length;n+=this.eventLimit){var i;i=e.slice(n,n+this.eventLimit);var r=this.split(this.merge(i));this.send(r,t)}else r=this.split(this.merge(e)),this.send(r,t)},e.prototype.merge=function(e,t){var n=this,i=this.configManager.get(),r=i.header,o=i.user;r.custom=JSON.stringify(r.custom);var a=this.configManager.get("evtParams"),s=this.configManager.get("user_unique_id_type"),l=e.map((function(e){try{Object.keys(a).length&&!t&&(e.params=wX({},a,e.params)),s&&(e.params.$user_unique_id_type=s);var i=n.localStorage.getItem(n.abKey);return i&&i.uuid&&i.uuid===o.user_unique_id&&n.configManager.getAbVersion()&&(e.ab_sdk_version=n.configManager.getAbVersion()),e.session_id=n.collect.sessionManager.getSessionId(),e.params=JSON.stringify(e.params),e}catch(xX){return n.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:xX.message}),e}})),c=JSON.parse(JSON.stringify({events:l,user:o,header:r}));c.local_time=Math.floor(Date.now()/1e3),c.user_unique_type=this.config.enable_ttwebid?this.config.user_unique_type:void 0;var u=[];return u.push(c),u},e.prototype.split=function(e){return e.map((function(e){var t=[];return t.push(e),t}))},e.prototype.send=function(e,t){var n=this;e.length&&e.forEach((function(e){try{var i=JSON.parse(JSON.stringify(e));n.config.filter&&((i=n.config.filter(i))||console.warn("filter must return data !!")),n.collect.eventFilter&&i&&((i=n.collect.eventFilter(i))||console.warn("filterEvent api must return data !!"));var r=i||e;if(n.eventCheck.checkVerify(r),!r.length)return;n.collect.emit($X.SubmitBefore,r),n.collect.emit($X.SubmitVerify,r),sJ(n.reportUrl,r,n.timeout,n.enable_ttwebid,(function(e,t){e&&0!==e.e?(n.collect.emit($X.SubmitError,{type:"f_data",eventData:t,errorCode:e.e,response:e}),n.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_EVENT,info:"埋点上报失败",time:Date.now(),data:r,code:e.e,failType:"数据异常",status:"fail"})):(n.collect.emit($X.SubmitScuess,{eventData:t,res:e}),n.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:r,code:200,status:"success"}))}),(function(e,t){n.configManager.get("reportErrorCallback")(e,t),n.collect.emit($X.SubmitError,{type:"f_net",eventData:e,errorCode:t}),n.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_EVENT,info:"埋点上报网络异常",time:Date.now(),data:r,code:t,failType:"网络异常",status:"fail"})}),t,!1),n.collect.emit($X.SubmitAfter,r)}catch(o){console.warn("something error, "+JSON.stringify(o.stack)),n.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:o.message})}}))},e}(),uJ=function(){return function e(t){return t?(t^16*Math.random()>>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)}().replace(/-/g,"").slice(0,19)},hJ=function(){function e(){this.cacheToken={},this.enableCookie=!1,this.enable_ttwebid=!1,this.enableCustomWebid=!1}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new zX(!1),this.tokenKey="__tea_cache_tokens_"+t.app_id,this.enable_ttwebid=t.enable_ttwebid,this.enableCustomWebid=t.enable_custom_webid,this.collect.on($X.ConfigUuid,(function(e){n.setUuid(e)})),this.collect.on($X.ConfigWebId,(function(e){n.setWebId(e)})),this.enableCookie=t.cross_subdomain,this.expiresTime=t.cookie_expire||6048e5,this.cookieDomain=t.cookie_domain||"",this.checkStorage()},e.prototype.checkStorage=function(){var e=this;if(this.enableCookie){var t=this.storage.getCookie(this.tokenKey,this.cookieDomain);this.cacheToken=t&&"string"==typeof t?JSON.parse(t):{}}else this.cacheToken=this.storage.getItem(this.tokenKey)||{};this.tokenType=this.cacheToken&&this.cacheToken._type_?this.cacheToken._type_:"default","custom"!==this.tokenType||this.enableCustomWebid?this.enableCustomWebid?this.collect.on($X.CustomWebId,(function(){e.tokenReady=!0,e.collect.emit($X.TokenComplete)})):this.checkEnv()||(this.enable_ttwebid?this.completeTtWid(this.cacheToken):this.check()):this.remoteWebid()},e.prototype.check=function(){this.cacheToken&&this.cacheToken.web_id?this.complete(this.cacheToken):this.config.disable_webid?this.complete({web_id:uJ(),user_unique_id:this.configManager.get("user_unique_id")||uJ()}):this.remoteWebid()},e.prototype.checkEnv=function(){var e=window.navigator.userAgent;if(-1!==e.indexOf("miniProgram")||-1!==e.indexOf("MiniProgram")){var t=NX(window.location.href);return!(!t||!t.Web_ID||(this.complete({web_id:""+t.Web_ID,user_unique_id:this.configManager.get("user_unique_id")||""+t.Web_ID}),0))}return!1},e.prototype.remoteWebid=function(){var e=this,t=this.configManager.getUrl("webid"),n={app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""};this.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"SDK 发起WEBID请求",logType:"fetch",level:"info",time:Date.now(),data:n}),oJ(t,n,3e3,!1,(function(t){t&&0===t.e?e.complete({web_id:e.configManager.get("web_id")||t.web_id,user_unique_id:e.configManager.get("user_unique_id")||t.web_id}):(e.collect.emit($X.TokenError),console.warn("[]appid: "+e.config.app_id+" webid error, init error~")),e.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"WEBID请求成功",logType:"fetch",level:"info",time:Date.now(),data:t})}),(function(){e.collect.emit($X.TokenError),e.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"WEBID请求网络异常",logType:"fetch",level:"error",time:Date.now(),data:null}),console.warn("[]appid: "+e.config.app_id+", get webid error, init error~")}))},e.prototype.complete=function(e){var t=e.web_id,n=e.user_unique_id;e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:n}),this.setStorage(e),this.tokenReady=!0,this.collect.emit($X.TokenComplete)},e.prototype.completeTtWid=function(e){var t=e.user_unique_id||"",n=this.configManager.get("user_unique_id");(n||t)&&this.configManager.set({user_unique_id:n||t}),this.setStorage(e),this.tokenReady=!0,this.collect.emit($X.TokenComplete)},e.prototype.setUuid=function(e){if(e&&-1===["null","undefined","Null","None"].indexOf(e)){var t=String(e),n=this.configManager.get("user_unique_id"),i=this.cacheToken&&this.cacheToken.user_unique_id;if(t===n&&t===i)return;this.configManager.set({user_unique_id:t}),this.cacheToken||(this.cacheToken={}),this.cacheToken.user_unique_id=t,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit($X.TokenChange,"uuid"),this.collect.emit($X.SessionReset)}else this.clearUuid()},e.prototype.clearUuid=function(){this.config.enable_ttwebid||this.configManager.get("web_id")&&(this.configManager.set({user_unique_id:this.configManager.get("web_id")}),this.cacheToken&&this.cacheToken.web_id&&(this.cacheToken.user_unique_id=this.cacheToken.web_id,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)),this.collect.emit($X.TokenReset))},e.prototype.setWebId=function(e){if(e&&!this.config.enable_ttwebid){this.cacheToken&&this.cacheToken.web_id?this.cacheToken.web_id!==e&&(this.cacheToken.user_unique_id=this.cacheToken.web_id===this.cacheToken.user_unique_id?e:this.cacheToken.user_unique_id,this.cacheToken.web_id=e):(this.cacheToken={},this.cacheToken.web_id=e,this.cacheToken.user_unique_id=e),this.cacheToken.timestamp=Date.now();var t=this.configManager.get("web_id"),n=this.configManager.get("user_unique_id");n&&n!==t||(this.configManager.set({user_unique_id:e}),this.collect.emit($X.TokenChange,"uuid")),t!==e&&(this.configManager.set({web_id:e}),this.collect.emit($X.TokenChange,"webid")),this.setStorage(this.cacheToken)}},e.prototype.setStorage=function(e){e._type_=this.enableCustomWebid?"custom":"default",delete e["diss".split("").reverse().join("")],this.enableCookie||this.enable_ttwebid?(this.storage.setCookie(this.tokenKey,e,this.expiresTime,this.cookieDomain),this.enable_ttwebid&&(delete e.web_id,this.storage.setItem(this.tokenKey,e))):this.storage.setItem(this.tokenKey,e),this.cacheToken=e},e.prototype.getReady=function(){return this.tokenReady},e.prototype.getTobId=function(){var e=this,t=this.configManager.getUrl("tobid");return new Promise((function(n){oJ(t,{app_id:e.config.app_id,user_unique_id:e.configManager.get("user_unique_id"),web_id:e.configManager.get("web_id"),user_unique_id_type:e.configManager.get("user_unique_id_type")},3e4,e.enable_ttwebid,(function(e){e&&0===e.e?n(e.tobid):n("")}),(function(){n("")}))}))},e}(),dJ=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},fJ=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.storage=new zX(!1,"session"),this.sessionKey="__tea_session_id_"+t.app_id,this.expireTime=t.expireTime||18e5,this.disableSession=t.disable_session,this.disableSession||(this.setSessionId(),this.collect.on($X.SessionReset,(function(){n.resetSessionId()})),this.collect.on($X.SessionResetTime,(function(){n.updateSessionIdTime()})))},e.prototype.updateSessionIdTime=function(){var e=this.storage.getItem(this.sessionKey);if(e&&e.sessionId){var t=e.timestamp;Date.now()-t>this.expireTime?e={sessionId:dJ(),timestamp:Date.now()}:e.timestamp=Date.now(),this.storage.setItem(this.sessionKey,e),this.resetExpTime()}},e.prototype.setSessionId=function(){var e=this,t=this.storage.getItem(this.sessionKey);t&&t.sessionId?t.timestamp=Date.now():t={sessionId:dJ(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,t),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime)},e.prototype.getSessionId=function(){var e=this.storage.getItem(this.sessionKey);return this.disableSession?"":e&&e.sessionId?e.sessionId:""},e.prototype.resetExpTime=function(){var e=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))},e.prototype.resetSessionId=function(){var e={sessionId:dJ(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,e)},e.prototype.checkEXp=function(){var e=this.storage.getItem(this.sessionKey);e&&e.sessionId&&Date.now()-e.timestamp+30>=this.expireTime&&(e={sessionId:dJ(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e))},e}(),pJ=function(){function e(e,t){this.devToolReady=!1,this.devToolOrigin="*",this.sendAlready=!1,this.collect=e,this.config=t,this.app_id=t.app_id,this.filterEvent=["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure","bav2b_page","bav2b_beat","bav2b_page_statistics","bav2b_click","bav2b_page_exposure","_be_active","predefine_pageview","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append","predefine_page_alive","predefine_page_close","abtest_exposure"],this.load()}return e.prototype.loadScript=function(e){try{var t=document.createElement("script");t.src=e,t.onerror=function(){console.log("load DevTool render fail")},t.onload=function(){console.log("load DevTool render success")},document.getElementsByTagName("body")[0].appendChild(t)}catch(n){console.log("devTool load fail, "+n.message)}},e.prototype.load=function(){try{this.loadBaseInfo(),this.loadHook();var e=NX(window.location.href);if(!e.open_devtool_web||parseInt(e.app_id)!==this.app_id)return;this.addLintener(),this.loadDebuggerModule(),this.loadDevTool()}catch(t){console.log("debug fail, "+t.message)}},e.prototype.loadDevTool=function(){this.loadScript("https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/devtool/debug-web.js")},e.prototype.loadBaseInfo=function(){var e=this;this.info=[{title:"基本信息",type:1,infoName:{app_id:this.config.app_id,channel:this.config.channel,"上报域名":this.collect.configManager.getDomain(),"SDK版本":YX,"SDK引入方式":"npm"}},{title:"用户信息",type:2,infoName:{uuid:this.collect.configManager.get("user").user_unique_id||"",web_id:this.collect.configManager.get("user").web_id||"",ssid:"点击获取SSID"}},{title:"公共参数信息",type:2,infoName:{"浏览器":this.collect.configManager.get("browser"),"浏览器版本":this.collect.configManager.get("browser_version"),"平台":this.collect.configManager.get("platform"),"设备型号":this.collect.configManager.get("device_model"),"操作系统":this.collect.configManager.get("os_name"),"操作系统版本":this.collect.configManager.get("os_version"),"屏幕分辨率":this.collect.configManager.get("os_version"),"来源":this.collect.configManager.get("referrer"),"自定义信息":""}},{title:"配置信息",type:3,infoName:{"全埋点":!!this.config.autotrack,"停留时长":!!this.config.enable_stay_duration}},{title:"A/B配置信息",type:4,infoName:{"A/B实验":!!this.config.enable_ab_test}},{title:"客户端信息",type:3,infoName:{"打通开关":!!this.config.Native}}],this.log=[],this.event=[],this.collect.on($X.Ready,(function(){e.info[1].infoName.uuid=e.collect.configManager.get("user").user_unique_id,e.info[1].infoName.web_id=e.collect.configManager.get("user").web_id,e.info[2].infoName["自定义信息"]=JSON.stringify(e.collect.configManager.get("custom")),e.config.enable_ab_test&&(e.info[4].infoName["已曝光VID"]=e.collect.configManager.getAbVersion(),e.info[4].infoName["A/B域名"]=e.config.ab_channel_domain||MX(KX[e.config.channel]),e.info[4].infoName["全部配置"]=e.collect.configManager.getAbData()),e.config.Native&&(e.info[5].infoName["是否打通"]=!!e.collect.bridgeReport)}))},e.prototype.loadHook=function(){var e=this;this.collect.on(IX.DEBUGGER_MESSAGE,(function(t){switch(t.type){case IX.DEBUGGER_MESSAGE_SDK:var n={time:t.time,type:t.logType||"sdk",level:t.level,name:t.info,show:!0,levelShow:!0,needDesc:!!t.data};return t.data&&(n.desc={content:JSON.stringify(t.data)}),e.updateLog(n),t.secType&&"AB"===t.secType?(e.info[4].infoName["已曝光VID"]=e.collect.configManager.getAbVersion(),e.info[4].infoName["全部配置"]=e.collect.configManager.getAbData()):"USER"===t.secType&&(e.info[1].infoName.uuid=e.collect.configManager.get("user").user_unique_id,e.info[1].infoName.web_id=e.collect.configManager.get("user").web_id),void e.updateInfo();case IX.DEBUGGER_MESSAGE_EVENT:if(t.data&&t.data.length){var i=t.data[0],r=i.events;if(!r.length)return;r.forEach((function(n){n.checkShow=!0,n.searchShow=!0,n.success=t.status,n.type=-1!==e.filterEvent.indexOf(n.event)?"sdk":"cus",n.type=e.collect.bridgeReport?"bridge":n.type,n.info="","fail"===t.status&&(n.info={message:"code: "+t.code+", msg: "+t.failType})})),e.updateEvent(i)}return}}))},e.prototype.addLintener=function(){var e=this;window.addEventListener("message",(function(t){if(t&&t.data&&"devtool:web:ready"===t.data.type){if(e.devToolOrigin=t.origin,e.devToolReady=!0,e.sendAlready)return;console.log("inittttt"),e.sendData("devtool:web:init",{info:e.info,log:e.log,event:e.event}),e.sendAlready=!0}t&&t.data&&"devtool:web:ssid"===t.data.type&&e.collect.getToken((function(t){e.info[1].infoName.ssid=t.tobid,e.updateInfo()}))}))},e.prototype.sendData=function(e,t){try{var n={type:e,payload:t};(window.opener||window.parent).postMessage(n,this.devToolOrigin)}catch(i){}},e.prototype.updateInfo=function(){this.devToolReady&&this.sendData("devtool:web:info",this.info)},e.prototype.updateLog=function(e){this.devToolReady?this.sendData("devtool:web:log",e):this.log.push(e)},e.prototype.updateEvent=function(e){this.devToolReady?this.sendData("devtool:web:event",e):this.event.push(e)},e.prototype.loadDebuggerModule=function(){var e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.appendChild(document.createTextNode("#debugger-applog-web {\n position: absolute;\n width: 90px;\n height: 30px;\n background: #23c243;\n border-radius: 6px;\n color: #fff;\n font-size: 12px;\n bottom: 5%;\n right: 10%;\n text-align: center;\n line-height: 30px;\n cursor: pointer;\n z-index:100;\n }")),e.appendChild(t);var n=document.createElement("div");n.innerHTML='<div id="debugger-applog-web" class="debugger-applog-web">AppLog调试</div>';var i=document.createElement("div");i.innerHTML='<div id="debugger-container" class="debugger-container"></div>',document.getElementsByTagName("body")[0].appendChild(n),document.getElementsByTagName("body")[0].appendChild(i),document.getElementById("debugger-applog-web").addEventListener("click",(function(){(window.opener||window.parent).postMessage({type:"devtool:web:open-draw"},location.origin)}))},e}(),gJ=function(){function e(e){this.disableAutoPageView=!1,this.bridgeReport=!1,this.staging=!1,this.pluginInstances=[],this.sended=!1,this.started=!1,this.destroyInstance=!1,this.sdkReady=!1,this.adapters={},this.name=e,this.hook=new LX,this.remotePlugin=new Map,this.Types=$X,this.adapters.fetch=oJ,this.adapters.storage=zX}return e.usePlugin=function(t,n,i){if(n){for(var r=!1,o=0,a=e.plugins.length;o<a;o++)if(e.plugins[o].name===n){e.plugins[o].plugin=t,e.plugins[o].options=i||{},r=!0;break}r||e.plugins.push({name:n,plugin:t,options:i})}else e.plugins.push({plugin:t})},e.prototype.usePlugin=function(e,t,n){e&&(t?"string"==typeof t?this.remotePlugin.get(e)||this.remotePlugin.set(e,{src:t,call:n}):this.remotePlugin.get(e)||this.remotePlugin.set(e,{instance:t}):this.remotePlugin.get(e)||this.remotePlugin.set(e,"sdk"))},e.prototype.init=function(t){var n,i=this;this.inited?console.warn("[instance: "+this.name+"], every instance's api: init, can be call only one time!"):t&&DX(t)?t.app_id&&"number"==typeof(n=t.app_id)&&!isNaN(n)?t.app_key&&"string"!=typeof t.app_key?console.warn("app_key param is error, must be string, please check!"):(t.channel_domain||-1!==["cn","sg","va"].indexOf(t.channel)||(console.warn("channel must be `cn`, `sg`,`va` !!!"),t.channel="cn"),this.logger=new tJ(this.name,t.log),this.appBridge=new nJ(this,t.Native),this.bridgeReport=this.appBridge.bridgeInject(),this.configManager=new eJ(this,t),this.debugger=new pJ(this,t),this.initConfig=t,this.emit($X.Init),this.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"SDK 执行INIT",data:t,level:"info",time:Date.now()}),t.disable_auto_pv&&(this.disableAutoPageView=!0),this.bridgeReport||(this.configManager.set({app_id:t.app_id}),this.eventManager=new cJ,this.tokenManager=new hJ,this.sessionManager=new fJ,Promise.all([new Promise((function(e){i.once($X.TokenComplete,(function(){e(!0)}))})),new Promise((function(e){i.once($X.Start,(function(){e(!0)}))}))]).then((function(){try{e.plugins.reduce((function(e,t){var n=t.plugin,r=t.options,o=Object.assign(i.initConfig,r),a=new n;return a.apply(i,o),e.push(a),e}),i.pluginInstances)}catch(n){console.log("load plugin error, "+n.message),i.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message})}i.sdkReady=!0,i.emit($X.Ready),i.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"SDK 初始化完成",time:Date.now(),level:"info",data:i.configManager.get("user")}),i.logger.info("appid: "+t.app_id+", userInfo:"+JSON.stringify(i.configManager.get("user"))),i.logger.info("appid: "+t.app_id+", sdk is ready, version is "+YX+", you can report now !!!"),t.disable_auto_pv&&(i.disableAutoPageView=!0);try{(t.enable_ab_test||t.autotrack)&&(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(n){i.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message})}i.pageView(),i.on($X.TokenChange,(function(e){"webid"===e&&i.pageView(),i.logger.info("appid: "+t.app_id+" token change, new userInfo:"+JSON.stringify(i.configManager.get("user"))),i.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"SDK 设置了用户信息",time:Date.now(),secType:"USER",level:"info",data:i.configManager.get("user")})})),i.on($X.TokenReset,(function(){i.logger.info("appid: "+t.app_id+" token reset, new userInfo:"+JSON.stringify(i.configManager.get("user"))),i.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"SDK 重置了用户信息",time:Date.now(),secType:"USER",level:"info",data:i.configManager.get("user")})})),i.on($X.RouteChange,(function(e){e.init||t.disable_route_report||i.pageView()}));try{(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(n){}})),this.tokenManager.apply(this,t),this.eventManager.apply(this,t),this.sessionManager.apply(this,t)),this.inited=!0):console.warn("app_id param is error, must be number, please check!"):console.warn("init params error,please check")},e.prototype.config=function(e){if(this.inited)if(e&&DX(e))if(this.bridgeReport)this.appBridge.setConfig(e);else{e._staging_flag&&1===e._staging_flag&&(this.staging=!0),e.disable_auto_pv&&(this.disableAutoPageView=!0,delete e.disable_auto_pv);var t=wX({},e);if(this.initConfig&&this.initConfig.configPersist){var n=this.configManager.getStore();n&&(t=Object.assign(n,e)),this.configManager.setStore(e)}t.web_id,t.user_unique_id;var i=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&(n[i[r]]=e[i[r]])}return n}(t,["web_id","user_unique_id"]);t.hasOwnProperty("web_id")&&this.emit($X.ConfigWebId,t.web_id),t.hasOwnProperty("user_unique_id")&&this.emit($X.ConfigUuid,t.user_unique_id),this.configManager.set(i),this.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"SDK 执行CONFIG",level:"info",time:Date.now(),data:t})}else console.warn("config params is error, please check");else console.warn("config must be use after function init")},e.prototype.setDomain=function(e){this.configManager&&this.configManager.setDomain(e),this.emit($X.ConfigDomain)},e.prototype.getConfig=function(e){return this.configManager.get(e)},e.prototype.send=function(){this.start()},e.prototype.start=function(){this.inited&&!this.sended&&(this.sended=!0,this.emit($X.Start),this.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"SDK 执行START",level:"info",time:Date.now()}),this.bridgeReport&&(this.pageView(),this.emit($X.Ready)))},e.prototype.event=function(e,t){var n=this;try{if(this.initConfig&&this.initConfig.disable_track_event)return;var i=[];Array.isArray(e)?e.forEach((function(e){i.push(n.processEvent(e[0],e[1]||{}))})):i.push(this.processEvent(e,t)),this.bridgeReport?i.forEach((function(e){var t=e.event,i=e.params;n.appBridge.onEventV3(t,JSON.stringify(i))})):i.length&&(this.emit($X.Event,i),this.emit($X.SessionResetTime))}catch(r){console.warn("something error, please check"),this.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:r.message})}},e.prototype.beconEvent=function(e,t){if(!this.initConfig||!this.initConfig.disable_track_event)if(Array.isArray(e))console.warn("beconEvent not support batch report, please check");else{var n=[];n.push(this.processEvent(e,t||{})),n.length&&(this.emit($X.BeconEvent,n),this.emit($X.SessionResetTime))}},e.prototype.processEvent=function(e,t){void 0===t&&(t={});try{var n=e;/^event\./.test(e)&&(n=e.slice(6));var r=t;"object"!=i(r)&&(r={}),r.profile?delete r.profile:r.event_index=AX();var o=void 0;return r.local_ms?(o=r.local_ms,delete r.local_ms):o=+new Date,{event:n,params:r,local_time_ms:o,is_bav:this.initConfig&&this.initConfig.autotrack?1:0}}catch(a){return this.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:a.message}),{event:e,params:t}}},e.prototype.filterEvent=function(e){this.eventFilter=e},e.prototype.on=function(e,t){this.hook.on(e,t)},e.prototype.once=function(e,t){this.hook.once(e,t)},e.prototype.off=function(e,t){this.hook.off(e,t)},e.prototype.emit=function(e,t,n){this.hook.emit(e,t,n)},e.prototype.set=function(e){this.hook.set(e)},e.prototype.pageView=function(){this.disableAutoPageView||this.predefinePageView()},e.prototype.predefinePageView=function(e){void 0===e&&(e={});var t={title:document.title||location.pathname,url:location.href,url_path:location.pathname,time:Date.now(),referrer:window.document.referrer,$is_first_time:""+this.configManager.is_first_time},n=wX({},t,e);this.event("predefine_pageview",n)},e.prototype.clearEventCache=function(){this.emit($X.CleanEvents)},e.prototype.setWebIDviaUnionID=function(e){if(e){var t=jX(e);this.config({web_id:""+t,wechat_unionid:e}),this.emit($X.CustomWebId)}},e.prototype.setWebId=function(e){this.config({web_id:""+e})},e.prototype.setWebIDviaOpenID=function(e){if(e){var t=jX(e);this.config({web_id:""+t,wechat_openid:e}),this.emit($X.CustomWebId)}},e.prototype.setNativeAppId=function(e){this.bridgeReport&&this.appBridge.setNativeAppId(e)},e.prototype.resetStayDuration=function(e,t,n){this.emit($X.ResetStay,{url_path:e,title:t,url:n},$X.Stay)},e.prototype.resetStayParams=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),this.emit($X.SetStay,{url_path:e,title:t,url:n},$X.Stay)},e.prototype.getToken=function(e,t){var n=this,i=!1,r=function(t){if(!i){i=!0;var r=n.configManager.get().user;return t&&(r.tobid=t,r["diss".split("").reverse().join("")]=t),e(wX({},r))}},o=function(){n.tokenManager.getTobId().then((function(e){r(e)}))};this.sdkReady?o():(t&&setTimeout((function(){r()}),t),this.on($X.Ready,(function(){o()})))},e.prototype.profileSet=function(e){this.bridgeReport?this.appBridge.profileSet(JSON.stringify(e)):this.emit($X.ProfileSet,e,$X.Profile),this.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileSet",level:"info",time:Date.now(),data:e})},e.prototype.profileSetOnce=function(e){this.bridgeReport?this.appBridge.profileSetOnce(JSON.stringify(e)):this.emit($X.ProfileSetOnce,e,$X.Profile),this.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileSetOnce",level:"info",time:Date.now(),data:e})},e.prototype.profileIncrement=function(e){this.bridgeReport?this.appBridge.profileIncrement(JSON.stringify(e)):this.emit($X.ProfileIncrement,e,$X.Profile),this.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileIncrement",level:"info",time:Date.now(),data:e})},e.prototype.profileUnset=function(e){this.bridgeReport?this.appBridge.profileUnset(e):this.emit($X.ProfileUnset,e,$X.Profile),this.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileUnset",level:"info",time:Date.now(),data:e})},e.prototype.profileAppend=function(e){this.bridgeReport?this.appBridge.profileAppend(JSON.stringify(e)):this.emit($X.ProfileAppend,e,$X.Profile),this.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileAppend",level:"info",time:Date.now(),data:e})},e.prototype.setExternalAbVersion=function(e){this.emit($X.AbExternalVersion,"string"==typeof e&&e?(""+e).trim():null,$X.Ab)},e.prototype.getVar=function(e,t,n){this.emit($X.AbVar,{name:e,defaultValue:t,callback:n},$X.Ab)},e.prototype.getABconfig=function(e,t){this.emit($X.AbConfig,{params:e,callback:t},$X.Ab)},e.prototype.getAbSdkVersion=function(){return this.configManager.getAbVersion()},e.prototype.onAbSdkVersionChange=function(e){var t=this;return this.emit($X.AbVersionChangeOn,e,$X.Ab),function(){t.emit($X.AbVersionChangeOff,e,$X.Ab)}},e.prototype.offAbSdkVersionChange=function(e){this.emit($X.AbVersionChangeOff,e,$X.Ab)},e.prototype.openOverlayer=function(){this.emit($X.AbOpenLayer,"",$X.Ab)},e.prototype.closeOverlayer=function(){this.emit($X.AbCloseLayer,"",$X.Ab)},e.prototype.getAllVars=function(e){this.emit($X.AbAllVars,e,$X.Ab)},e.prototype.autoInitializationRangers=function(e){var t,n,i,r,o,a,s,l;n=(t=e).app_id,i=t.channel,r=t.onTokenReady,o=qX[i]+"/webid",a=new zX(!1),s="__tea_cache_tokens_"+n,(l=a.getItem(s))&&l.web_id?r(l.web_id):sJ(o,{app_key:"",app_id:n,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer},3e3,!1,(function(e){if(e&&0===e.e){r(e.web_id);var t={web_id:e.web_id,user_unique_id:e.web_id,timestamp:Date.now()};a.setItem(s,t)}else r("")}),(function(){r("")}),!0)},e.prototype.destoryInstace=function(){this.destroyInstance||(this.destroyInstance=!0,this.off($X.TokenComplete))},e.plugins=[],e}(),vJ=function(){function e(){}return e.prototype.apply=function(e,t){var n=this,i=e.adapters.fetch;if(t.event_verify_url)if("string"==typeof t.event_verify_url){if(this.url=t.event_verify_url+"/v1/list_test",this.url){var r=e.Types;e.on(r.SubmitBefore,(function(e){i(n.url,e,3e4)}))}}else console.log("please use correct et_test url")},e}(),yJ=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.duration=6e4,this.reportUrl=e.configManager.getDomain()+"/profile/list";var i=e.Types,r=e.adapters.fetch;this.eventCheck=new lJ(e,t),this.fetch=r,this.cache={},this.collect.on(i.ProfileSet,(function(e){n.setProfile(e)})),this.collect.on(i.ProfileSetOnce,(function(e){n.setOnceProfile(e)})),this.collect.on(i.ProfileUnset,(function(e){n.unsetProfile(e)})),this.collect.on(i.ProfileIncrement,(function(e){n.incrementProfile(e)})),this.collect.on(i.ProfileAppend,(function(e){n.appendProfile(e)})),this.collect.on(i.ProfileClear,(function(){n.cache={}})),this.ready(i.Profile)},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var n=this.collect.hook._hooksCache[e];if(!Object.keys(n).length)return;var i=function(e){n[e].length&&n[e].forEach((function(n){t.collect.hook.emit(e,n)}))};for(var r in n)i(r)}},e.prototype.report=function(e,t){void 0===t&&(t={});try{if(this.config.disable_track_event)return;var n=[];n.push(this.collect.processEvent(e,t));var i=this.collect.eventManager.merge(n);this.fetch(this.reportUrl,i),this.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:i,code:200,status:"success"})}catch(r){this.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:r.message})}},e.prototype.setProfile=function(e){var t=this.formatParams(e);t&&Object.keys(t).length&&(this.pushCache(t),this.report("__profile_set",wX({},t,{profile:!0})))},e.prototype.setOnceProfile=function(e){var t=this.formatParams(e,!0);t&&Object.keys(t).length&&(this.pushCache(t),this.report("__profile_set_once",wX({},t,{profile:!0})))},e.prototype.incrementProfile=function(e){e?this.report("__profile_increment",wX({},e,{profile:!0})):console.warn("please check the params, must be object!!!")},e.prototype.unsetProfile=function(e){if(e){var t={};t[e]="1",this.report("__profile_unset",wX({},t,{profile:!0}))}else console.warn("please check the key, must be string!!!")},e.prototype.appendProfile=function(e){if(e){var t={};for(var n in e)"string"==typeof e[n]||"Array"===Object.prototype.toString.call(e[n]).slice(8,-1)?t[n]=e[n]:console.warn("please check the value of param: "+n+", must be string or array !!!");Object.keys(t).length&&this.report("__profile_append",wX({},t,{profile:!0}))}else console.warn("please check the params, must be object!!!")},e.prototype.pushCache=function(e){var t=this;Object.keys(e).forEach((function(n){t.cache[n]={val:t.clone(e[n]),timestamp:Date.now()}}))},e.prototype.formatParams=function(e,t){var n=this;void 0===t&&(t=!1);try{if(!e||"[object Object]"!==Object.prototype.toString.call(e))return void console.warn("please check the params type, must be object !!!");var i={};for(var r in e)"string"==typeof e[r]||"number"==typeof e[r]||"Array"===Object.prototype.toString.call(e[r]).slice(8,-1)?i[r]=e[r]:console.warn("please check the value of params:"+r+", must be string,number,Array !!!");var o=Object.keys(i);if(!o.length)return;if(!this.eventCheck.checkEventParams(i))return;var a=Date.now();return o.filter((function(i){var r=n.cache[i];return t?!r:!(r&&n.compare(r.val,e[i])&&a-r.timestamp<n.duration)})).reduce((function(e,t){return e[t]=i[t],e}),{})}catch(s){this.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:s.message}),console.log("error")}},e.prototype.compare=function(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch(n){return this.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:n.message}),!1}},e.prototype.clone=function(e){try{return JSON.parse(JSON.stringify(e))}catch(t){return this.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),e}},e.prototype.unReady=function(){console.warn("sdk is not ready, please use this api after start")},e}(),mJ=function(){function e(){var e=this;this.setInterval=function(){e.clearIntervalFunc=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=1e3);var n,i=Date.now()+t;return n=window.setTimeout((function r(){var o=Date.now()-i;e(),i+=t,n=window.setTimeout(r,Math.max(0,t-o))}),t),function(){window.clearTimeout(n)}}((function(){e.isSessionhasEvent&&e.endCurrentSession()}),e.sessionInterval)},this.clearInterval=function(){e.clearIntervalFunc&&e.clearIntervalFunc()}}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,!t.disable_heartbeat){this.sessionInterval=6e4,this.startTime=0,this.lastTime=0,this.setInterval();var i=this.collect.Types;this.collect.on(i.SessionReset,(function(){n.process()}))}},e.prototype.endCurrentSession=function(){this.collect.event("_be_active",{start_time:this.startTime,end_time:this.lastTime,url:window.location.href,referrer:window.document.referrer,title:document.title||location.pathname}),this.isSessionhasEvent=!1,this.startTime=0},e.prototype.process=function(){this.isSessionhasEvent||(this.isSessionhasEvent=!0,this.startTime=+new Date);var e=this.lastTime||+new Date;this.lastTime=+new Date,this.lastTime-e>this.sessionInterval&&(this.clearInterval(),this.endCurrentSession(),this.setInterval())},e}(),_J=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,this.config=t,!this.config.channel_domain){var i=e.adapters.fetch;if(this.fetch=i,!t.disable_track_event&&!t.disable_sdk_monitor){this.url=e.configManager.getUrl("event");var r=this.collect.Types;this.collect.on(r.Ready,(function(){n.sdkOnload()})),this.collect.on(r.SubmitError,(function(e){var t=e.type,i=e.eventData,r=e.errorCode;"f_data"===t&&n.sdkError(i,r)}))}}},e.prototype.sdkOnload=function(){var e=this;try{var t=this.collect.configManager.get(),n=t.header,i=t.user,r=n.app_id,o=n.app_name,a=n.sdk_version,s=i.web_id,l={events:[{event:"onload",params:JSON.stringify({app_id:r,app_name:o||"",sdk_version:a,sdk_type:"npm",sdk_config:this.config,sdk_desc:"TOC"}),local_time_ms:Date.now()}],user:{user_unique_id:s},header:{}};setTimeout((function(){e.fetch(e.url,[l],3e4,!1,(function(){}),(function(){}),"566f58151b0ed37e")}),16)}catch(c){}},e.prototype.sdkError=function(e,t){var n=this;try{var i=e[0],r=i.user,o=i.header,a=[];e.forEach((function(e){e.events.forEach((function(e){a.push(e)}))}));var s={events:a.map((function(e){return{event:"on_error",params:JSON.stringify({error_code:t,app_id:o.app_id,app_name:o.app_name||"",error_event:e.event,sdk_version:o.sdk_version,local_time_ms:e.local_time_ms,tea_event_index:Date.now(),params:e.params,header:JSON.stringify(o),user:JSON.stringify(r)}),local_time_ms:Date.now()}})),user:{user_unique_id:r.user_unique_id},header:{}};setTimeout((function(){n.fetch(n.url,[s],3e4,!1,(function(){}),(function(){}),"566f58151b0ed37e")}),16)}catch(l){}},e}(),bJ=function(){function e(){this.verifyReady=!1,this.waitTime=5e3,this.cleanStatus=!1}return e.prototype.apply=function(e,t){var n=this;this.collector=e,this.config=t;var i=e.adapters.storage;this.cacheStorgae=new i(!1,"session"),this.eventStorage=[],this.collector.on("submit-verify",(function(e){e&&e.length&&n.eventStore(e[0])})),this.checkCache()},e.prototype.checkCache=function(){var e=this;this.verifyCookieKey="__applog_verify_set_"+this.config.app_id,this.cacheStorgae.getCookie(this.verifyCookieKey);var t=this.cacheStorgae.getItem(this.verifyCookieKey);this.sign=t&&t.sign||"",this.origin=t&&t.origin||"*";var n=setTimeout((function(){e.cleanVerify(),clearTimeout(n),e.collector.off("submit-verify")}),this.waitTime);window.addEventListener("message",(function(t){t&&t.data&&"simulator:verify"===t.data.type&&(clearTimeout(n),e.receMessage(t))}),!0)},e.prototype.receMessage=function(e){if(!this.cleanStatus){var t=e.data;this.verifyReady=!0,this.sign=t.sign,this.origin=e.origin,this.cacheStorgae.setItem(this.verifyCookieKey,JSON.stringify({sign:t.sign,origin:e.origin})),this.eventStorage.length&&this.postVerify(this.eventStorage,t.sign,e.origin)}},e.prototype.eventStore=function(e){this.cleanStatus||(this.verifyReady?this.postVerify(e,this.sign,this.origin):this.eventStorage.push(e))},e.prototype.cleanVerify=function(){this.cleanStatus=!0,this.eventStorage=[]},e.prototype.postVerify=function(e,t,n){try{var i=[];o=e,Array.isArray(o)?e.forEach((function(e){i.push(e)})):i.push(e);var r={type:"simulator:verify:event",sign:t,pageUrl:window.location.href,events:i};(window.opener||window.parent).postMessage(r,n)}catch(a){console.log("web verify post message error ~")}var o},e}(),kJ={autotrack:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/autotrack.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/autotrack.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/autotrack.js"},object:"LogAutoTrack"},ab:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/ab.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/ab.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/ab.js"},object:"LogAb"},stay:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/stay.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/stay.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/stay.js"},object:"LogStay"},route:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/route.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/route.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/route.js"},object:"LogRoute"},cep:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/cep.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/cep.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/cep.js"},object:"LogCep"},tracer:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/tracer.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/tracer.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/tracer.js"},object:"LogTracer"},visual:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/visual.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/visual.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/visual.js"},object:"LogVisual"}},wJ="undefined"!=typeof window?(window.LogPluginObject||(window.LogPluginObject={}),window.LogPluginObject):null,EJ=function(){function e(){}return e.prototype.apply=function(e,t){this._plugin={},this.config=t,this.collect=e,this.channel=t.channel||"cn",this.loadExtend()},e.prototype.loadExtend=function(){var e=this;try{this.collect.remotePlugin.forEach((function(t,n){if("sdk"===t)if(kJ.hasOwnProperty(n)){var r=kJ[n].object,o=""+kJ[n].src[e.channel];e.exist(n,r,o)}else console.warn("your "+n+" is not exist,please check plugin name");else"object"==i(t)&&(t.src?e.exist(n,t.call,t.src):e.process(n,t.instance,"INSTANCE"))}))}catch(t){this.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),console.log("load extend error")}},e.prototype.exist=function(e,t,n){var i=this;wJ[t]?(this.process(e,wJ[t]),console.log("已有"+e+"插件,避免重复加载~")):this.loadPlugin(e,n,(function(){i.process(e,wJ[t]),console.log(" %c %s %s %s","color: yellow; background-color: black;","–","load plugin:"+e+" success","-")}),(function(){console.log(" %c %s %s %s","color: red; background-color: yellow;","–","load plugin:"+e+" error","-")}))},e.prototype.process=function(e,t,n){try{if(n){var i=new t;i.apply&&i.apply(this.collect,this.config),console.log("excude "+e+" success")}else t&&t(this.collect,this.config)}catch(r){this.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:r.message}),console.log("excude "+e+" error, message:"+r.message)}},e.prototype.loadPlugin=function(e,t,n,i){var r=this;try{var o=document.createElement("script");o.src=t,this._plugin[e]||(this._plugin[e]=[]),this._plugin[e].push(n),o.onerror=function(){i(t)},o.onload=function(){r._plugin[e].forEach((function(e){e()}))},document.getElementsByTagName("head")[0].appendChild(o)}catch(a){this.collect.emit(IX.DEBUGGER_MESSAGE,{type:IX.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:a.message})}},e}();gJ.usePlugin(EJ,"extend"),gJ.usePlugin(bJ,"verify"),gJ.usePlugin(vJ,"et"),gJ.usePlugin(yJ,"profile"),gJ.usePlugin(mJ,"heartbeat"),gJ.usePlugin(_J,"monitor"),new gJ("default");var TJ=gJ;function SJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function CJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?SJ(Object(n),!0).forEach((function(t){LJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SJ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xJ(e){return(xJ="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 OJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PJ(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,DJ(i.key),i)}}function IJ(e,t,n){return t&&PJ(e.prototype,t),n&&PJ(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function LJ(e,t,n){return(t=DJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DJ(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;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 AJ=cl.charAt,MJ=ae,RJ=Si,NJ=wo;Er({target:"String",proto:!0,forced:!0},{at:function(e){var t=NJ(MJ(this)),n=t.length,i=RJ(e),r=i>=0?i:n+i;return r<0||r>=n?void 0:AJ(t,r)}});var jJ="undefined"!=typeof window&&window.location.href.indexOf("loggerdebug")>-1;function BJ(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=0,n=0;n<e.length;n++)isNaN(Number(e[n].end))||isNaN(Number(e[n].begin))||e[n].begin<0||e[n].end<0||e[n].end<e[n].begin||(t+=e[n].end-e[n].begin);return t=parseInt(1e3*t,10)}function UJ(e){if(null==e||""===e||"string"!=typeof e)return"";var t=e.split("/"),n="";return t.length>3&&t[2]&&(n=t[2]),n}function HJ(e){var t={};if(e instanceof window.XMLHttpRequest)try{e.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var n=e.split(": "),i=n.shift(),r=n.join(": ");t[i]=r}))}catch(w7){}return t}function FJ(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];jJ&&(t=console).log.apply(t,["[logger]",e].concat(i))}function GJ(){try{return Math.round(window.performance.now())}catch(w7){return(new Date).getTime()}}function VJ(){return(new Date).getTime()}function zJ(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(n,i){try{e||i(new Error("url is undefined"));var r=GJ(),o=r,a={},s=new window.XMLHttpRequest;s.open("get",e),s.onreadystatechange=function(){2===s.readyState&&(a.headers=HJ(s),a.connectTime=GJ()-o,a.status=s.status,a.statusText=s.statusText,r=GJ())},s.onload=function(){n(a)},s.onprogress=function(e){var t,n=GJ()-r;t=parseInt(e.loaded/1e3/(n/1e3),10),a.speed=0|t,a.costTime=n},s.onerror=function(e){a.status||(a.status=-1,a.costTime=GJ()-r),i(a)},s.ontimeout=function(){a.status||(a.status=-2,a.costTime=GJ()-r),n(a)},s.onabort=function(){n(a)},s.responseType="arraybuffer",s.timeout=t.timeout||1e4,s.setRequestHeader("Range","bytes=".concat(t.range||"0-1048576")),s.send()}catch(xX){i(xX)}}))}function WJ(e){return!e||window.location.href.indexOf(e)>-1}function KJ(e){return!!e&&/^blob:/.test(e)}var qJ={x_response_sinfo:"x-response-sinfo",x_response_cache:"x-response-cache",x_response_cinfo:"x-response-cinfo"};function YJ(e){if(!e)return{};var t={};return Object.keys(qJ).map((function(n){if(e[n]||"string"!=typeof qJ[n]){if(!e[n]&&qJ[n]instanceof Array){var i=qJ[n].filter((function(t){return void 0!==e[t]}));i.length>0?t[n]=e[i[0]]:t[n]=""}}else t[n]=e[qJ[n]]||""})),t}function $J(e,t){return e&&("string"==typeof t||"number"==typeof t)?e+""+t:t}function XJ(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function JJ(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(xX){var n=e.className&&"object"===xJ(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}}function ZJ(e){return"String"===XJ(e)?e.replace("P","p"):e?"Number"===XJ(e)?"".concat(e):void 0:""}function QJ(e){try{return JSON.stringify(e)}catch(xX){return""}}function eZ(e){if(!e||"String"!==XJ(e))return 0;var t=0;try{var n=new RegExp("(\\?|&)x-tos-expires=([^&]*)(&|$)"),i=e.match(n);if(null!==i)t=parseInt(i[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)?1:2:0}catch(xX){return 0}}var tZ=[];function nZ(e){var t={};try{e=e.replace(/^http:|^https:/,"");for(var n=tZ||[],i=function(i){if(n[i].name.replace(/^http:|^https:/,"")===e)return["domainLookupEnd","domainLookupStart","startTime","requestStart","responseEnd","responseStart","connectStart","connectEnd","fetchStart"].map((function(e){t[e]=Math.round(n[i][e])})),t.url=n[i].name,t.duration=Math.round(n[i].duration),t.domainDuration=t.domainLookupEnd-t.domainLookupStart,t.connectDuration=t.connectEnd-t.connectStart,"break"},r=n.length-1;r>=0;r--){if("break"===i(r))break}return t}catch(xX){return t}}"undefined"!=typeof window&&function(){try{var e=new window.PerformanceObserver((function(e,t){var n=e.getEntriesByType("resource");tZ.length>30&&tZ.splice(0,tZ.length-30);for(var i=0;i<n.length;i++)tZ.push(n[i])}));e.observe({entryTypes:["resource"]})}catch(xX){console.warn("PerformanceObserver not support",xX)}}();var iZ="videoplayer_oneplay",rZ="videoplayer_oneopera",oZ="videoplayer_oneerror",aZ="videoplayer_oneevent",sZ="videoplayer_onetemp",lZ={data:1e3,runtime:1002,parse:1004,network:1003,no_error_handler:9997,custom_error:9998,other:9999,notSupport:1005},cZ={1:-499991,2:-499992,3:-499993,4:-499994,5:-499995},uZ=0,hZ=1,dZ=2,fZ=3,pZ=4,gZ=0,vZ=1,yZ=2,mZ=3,_Z=1,bZ=2,kZ=3,wZ=4,EZ=5,TZ=6,SZ=7,CZ="error_retry",xZ="oneerror",OZ="oneevent",PZ="onetemp",IZ=0,LZ=1,DZ=432e5,AZ=36e5,MZ=["tag","subtag","device_type"];var RZ=function(){try{return"undefined"!=typeof localStorage&&"setItem"in window.localStorage&&!!window.localStorage.setItem}catch(xX){return!1}}()&&!function(){var e="_localstorage_support_test";try{return window.localStorage.setItem(e,!0),window.localStorage.removeItem(e),!1}catch(xX){return!0}}()?window.localStorage:{},NZ="__xgplayerlogkey",jZ={set:function(e){try{var t=this.get();t.push(e),RZ.setItem(NZ,JSON.stringify(t))}catch(w7){}},get:function(){try{var e=RZ.getItem(NZ);return e=e?JSON.parse(e):[]}catch(w7){return[]}},remove:function(){try{RZ.removeItem(NZ)}catch(w7){}},clear:function(){try{RZ.clear()}catch(w7){}}},BZ=[{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)/}],UZ=[{key:"Trident",reg:/(rv:)([\d.]+)/},{key:"Trident",reg:/(msie)\s*([\d.]+)/}];function HZ(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;var t=document.createElement("video");return"function"==typeof t.canPlayType?(["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"].map((function(n){"probably"===t.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(e.isSupport=!0,e.mime+="||".concat(n))})),e):(t=null,e)}var FZ=["Baiduspider","YandexBot"];function GZ(e,t){var n=!1;return FZ.map((function(t){t===e&&(n=!0)})),/(\+http|; http|\(http):\/\/([\w.]+\/?)\S*/.test(t)&&(n=!0),n}function VZ(){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}}var zZ="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),n=/(android)/.test(e),i=/(windows phone)/.test(e),r=t||n||i,o={isIOS:t,isAndroid:n,isMobile:r,isPC:!r,isPad:/(ipad)/.test(e)},a=HZ();o.isSupportMP4=a.isSupport,o.mime=a.mime;var s="",l=0,c=[],u=BZ;/trident/.test(e)&&(u=UZ);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=VZ();d&&(o.name="360EE")}if(o.name&&"Trident"!==o.name){var f=/(trident)/.exec(e);f&&(o.name=o.name?"".concat(o.name,"_Trident"):"Trident")}return o.isSpider=GZ(o.name),o}(navigator.userAgent);var WZ={range:"0-1048576",timer:6e4,timeout:15e3},KZ=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};OJ(this,e),Object.keys(WZ).map((function(e){void 0!==t[e]&&null!==t[e]||(t[e]=WZ[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 IJ(e,[{key:"setData",value:function(e,t){var n=this;if(Object.keys(e).map((function(t){"headers"!==t&&(n._data[t]=e[t])})),e.headers&&Object.keys(e.headers).length>0){this._headers=YJ(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,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start",i=this.options;this.url=e,!this.url||"start"!==n&&(this.ishangUp||this.intervalId)?FJ("task>>cant`t trigger url",this.ishangUp,this.intervalId):(FJ("task>>trigger url ",e),this.ishangUp=!0,this.intervalId&&this.clear(),this.intervalId=setTimeout((function(){t.clear()}),"start"===n?500:i.timer),zJ(this.url,{range:"start"===n?"0-1024":i.range,timeout:i.timeout}).then((function(e){FJ("getXhr>>check result ",e),t.setData(e||{}),t.ishangUp=!1})).catch((function(e){FJ("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}(),qZ="0.11.15";FJ("xgVodLogger version is ".concat(qZ));var YZ,$Z=(YZ="Object",function(e){return Object.prototype.toString.call(e)==="[object ".concat(YZ,"]")}),XZ=1300,JZ="__tea_cache_tokens_".concat(XZ),ZZ=-1,QZ="",eQ=null,tQ=zZ.isSupportMP4?1:0;tQ="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"'))?tQ+2:tQ,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 n=e.video||{},i=e.audio||{};try{var r=MediaSource.isTypeSupported(n.contentType),o=MediaSource.isTypeSupported(i.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(xX){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&&(tQ+=1)})).catch((function(e){}));var nQ=function(){function e(t,n){var i=this;if(OJ(this,e),LJ(this,"initializeUrlLog",(function(e){var t=e&&e.url?e.url:"String"===XJ(e)?e:"";"String"!==XJ(t)&&(t=""),i.urlLog={initial_url:t,initial_host:UJ(t),initial_ip:""}})),LJ(this,"onXgLogCache",(function(){var e,t,n=null===(e=i.player)||void 0===e?void 0:e.getLogCache();n&&(i._templog={vtype:null===(t=i.player)||void 0===t?void 0:t.vtype,log:n},i.onOneTemp())})),LJ(this,"onMediaFormatError",(function(e){i.onOneEvent({end_type:(e.error_type||"")+"Error"})})),LJ(this,"onDrmTypeChange",(function(e){i.addIfExist("drm_type",{drm_type:e},i._options)})),LJ(this,"onReplayBtnClick",(function(){i.resetLoggerParams()})),LJ(this,"onBeforeDefinitionChange",(function(){i.resLogs.ldst=GJ(),i._endType="switch"})),LJ(this,"onDefinitionChange",(function(e){var t=e.from,n=e.to;i.changeResolution({from:t,to:n,startTime:i.resLogs.ldst,operaType:"switch"}),FJ("onDefinitionChange from:".concat(t,", to:").concat(n))})),LJ(this,"onDefiChangeSuccess",(function(){FJ("onDefinitionChangeSuccess"),i.updateVideoSize(),i.triggerTask("start")})),LJ(this,"onAbrChange",(function(e){var t=e.prev,n=e.cur,r=e.abrInfo;if(i.player.abrInstance){var o=i.player.abrInstance.eventInfo;FJ("abrChange",o),o.last_definition=t,o.now_definition=n,i.abrInfo.abr_event_info.video_switch.push(o),i.changeResolution({from:t,to:n,startTime:GJ(),operaType:"abr_switch",abrInfo:r})}})),LJ(this,"onAbrPrestallEnd",(function(e){i.abrInfo.abr_user_info.cancel_abr=e?1:0})),LJ(this,"onTimeUpdate",(function(){var e=i.playlogs,t=i.resLogs,n=i.player;if(i.errorLog.try_err_c=0,e.vt||1!==i.startStep||(e.vt=VJ(),FJ("onTimeUpdate: first frame inited","currentTime11:".concat(n.currentTime," vt-pt:").concat(e.vt-e.pt," vt-nt:").concat(e.vt-e.nt," vt-rt:").concat(e.vt-e.rt)),i.startStep=2),!t.initial_resolution){var r=n.currentDefitionFromPler&&n.currentDefitionFromPlayer.definition?n.currentDefitionFromPlayer.definition:n.config.defaultDefinition||n.video.videoHeight+"p"||"";r=ZJ(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:n.currentTime,end:-1}):e.played[o-1].end=n.currentTime;var a=t.played.length;a<1?t.played.push({begin:n.currentTime,end:-1}):t.played[a-1].end=n.currentTime,i.lastVideoTime=n.currentTime||0})),LJ(this,"onCanplay",(function(){FJ("onCanplay","this.startStep:".concat(i.startStep," ").concat(VJ())),i.setVt()})),LJ(this,"onLoadeddata",(function(){FJ("onLoadeddata","this.startStep:".concat(i.startStep," ").concat(VJ())),i.setVt(),i.updateVideoSize()})),LJ(this,"onLoadStart",(function(){var e=WJ(i.player.currentSrc);i.triggerTask("start"),FJ("onLoadStart","this.startStep:".concat(i.startStep," ").concat(VJ()," isSrcEmpty:").concat(e," player.src:").concat(i.player.src)),0!==i.startStep||e||"visible"!==document.visibilityState||i.setPt()})),LJ(this,"onDashStateChange",(function(e){FJ("onDashStateChange","this.startStep:".concat(i.startStep," ").concat(GJ()," state:").concat(e));var t=i.playlogs;if(i.startStep<2)switch(e){case"player_start":t.dash_pst=GJ();break;case"wasm_start":t.dash_wst=GJ();break;case"wasm_ready":t.dash_wrt=GJ();break;case"init_finished":t.dash_ift=GJ();break;case"core_start":t.dash_cst=GJ();break;case"start_play":t.dash_spt=GJ()}})),LJ(this,"onBufferedChange",(function(){var e=i.player.video&&i.player.video.buffered;if(e){var t=e.length;t>0&&e.end(t-1)+1>i.player.duration&&(i.bft=VJ())}})),LJ(this,"onPlayerInited",(function(){FJ("player init"),i._playerCreatedTime=VJ(),i.playlogs.rt=VJ()})),LJ(this,"onNotAutoPlay",(function(){FJ("onNotAutoPlay","autoplay:".concat(i.isAutoplay)),0===i.isAutoplay?i.isAutoplay=2:1===i.isAutoplay&&(i.isAutoplay=3)})),LJ(this,"onDashError",(function(e){e=e||{};var t=i.errorLog;t.last_errors.push(e.errorCode),t.accu_errc++,i.onOneError({errorType:e.errorTypeCode,code:e.errorCode,url:e.url||"",headers:e.headers||{}},0)})),LJ(this,"onPlayerError",(function(e){e=e||{};var t=i.errorLog,n=i.player;if(FJ("onPlayerError","this.player.type:".concat(i.player.type," this.player.replayRunning:").concat(i.player.replayRunning," isSupportMP4:").concat(zZ.isSupportMP4," isPC:").concat(zZ.isPC)),FJ("onPlayerError",e),i.load_state=mZ,i._endType="error",i.suspendWaitingStatus("onPlayerError"),"dash"!==n.type||!n.replayRunning){if(e.url||(e.url=i.player.currentSrc),zZ.isPC&&!zZ.isSupportMP4||zZ.isSpider)return t.errc=cZ[5],t.errt=lZ.notSupport,i.onOneError({errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0),void(i._isOnePlayReport=!0);t.errt=e.errorTypeCode||(e.errorType&&lZ[e.errorType]?lZ[e.errorType]:9999),e.errorCode?t.errc=e.errorCode>0&&cZ[e.errorCode]?cZ[e.errorCode]:e.errorCode:e.code&&(t.errc=e.code>0&&cZ[e.code]?cZ[e.code]:e.code),t.last_errors.push(t.errc),0===t.fir_errc&&(t.fir_errc=t.errc),i.onOnePlay(_Z),i.onOneTemp(_Z),i.sendDegradeLog("playCatch_end",i.playlogs.degrade);var r=!1;!i._options.needXhrCheck||4!==e.errorCode&&2!==e.errorCode||(r=!0),i.onOneError({endState:SZ,errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0,r),i.sendEventsQueue()}})),LJ(this,"onPlayInterfaceInfo",(function(e){FJ("onPlayInterfaceInfo",e);var t=i.errorLog,n=i.apiLog,r=i.playlogs;if(e&&Object.keys(e).map((function(t){"code"===t?n.vsc=e[t]:"message"===t?n.vsc_message=e.message||"success,视频可正常播放":n[t]=e[t]})),r.at=e.timestamep||(new Date).getTime(),(!e.error||-9988!==e.error.errc)&&(n.vsc=e.code||10,n.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=GJ()),i.onOneError({errorType:1e3,code:o.errc||-9998,url:"",headers:{}})}})),LJ(this,"onProgressEvent",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=i.netLog;if(e.speed){var n=e.speed>1e6?Math.floor(e.speed/1e3):e.speed;t.downloadSpeed=n,t.totalSpeed+=n,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=nZ(e.cdnUrl),a=e.xhr||{},s=e.type?"progress_".concat(e.type):"progress",l=e.headers;l||(l=HJ(a));var c=CJ(CJ({},l=YJ(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&&i.merror.cdn.push(CJ(CJ({costTime:e.costTime,cur_play_pos:e.pos,cdn_url:u,cdn_host:UJ(u)},c),l)),i.onOneEvent({costTime:e.costTime,vid:e.vid,end_type:s,cur_play_pos:e.pos,cdn_url:u,cdn_host:UJ(u)},c,"error"===e.type?0:2)}})),LJ(this,"onNext",(function(e){if(FJ("onNext:startStep:",i.startStep),i.startStep>0){if(i._reportInvalidVV(bZ))return;i.onOnePlay(bZ),i.onOneTemp(bZ),i.sendEventsQueue()}i.vtype=null,i.playlogs.lc=0,i.resetLoggerParams()})),LJ(this,"onNextEnded",(function(){var e=i.player,t=i.resLogs,n=ZJ(e.config.defaultDefinition||"");t.initial_resolution=n,t.final_resolution=n})),LJ(this,"onXgLogWaiting",(function(e){var t=i.playlogs,n=i.resLogs,r=i.stall;if(i._options.checkByInnerLog&&0===e.type){FJ("onXgLogWaiting",e);var o=e.endType,a=e.costTime,s=e.start,l={download_speed:i.realSpeed,avg_speed:i.avgSpeed,mse_op:i.mp4MseOpLength,mp4_load_range:i.mp4LoadSegmentTimeRange,bitrate:i.curBitrate};if("waitingStart"===e.eventType)return i.onOneEvent({costTime:a,end_type:"waitstart"},l,2),void i.appendStallInfo("start",s);if("waitingEnd"===e.eventType){var c=GJ();FJ("onXgLogWaiting>>".concat(o,"|costTime:").concat(a," vt:").concat(t.vt)),i.appendStallInfo("end",c,o),t.bc++,i.checkInBuffer(i.player.currentTime)?(t.de_bu_acu_t+=a,t.dbc++):(t.nbc++,t.n_bu_acu_t+=a),n.bc++,t.bu_acu_t+=a,n.bu_acu_t+=a,r.stall_end=c,r.stall_last_interval=r.stall_end-r.stall_start,r.stall_acc_time+=r.stall_last_interval,1===r.sc&&(r.first_buf_endt=c),i.onOneEvent({costTime:a,end_type:"waitend"},l,2)}}})),LJ(this,"onSeeking",(function(){if(!WJ(i.player.src)){var e=i.resLogs,t=i.playlogs,n=i.player,r=i.seekLog;FJ("onSeeking","currentTime:".concat(n.currentTime)),0===i.startStep&&i.setPt(),i.suspendWaitingStatus("seek"),i.isSeeking&&i.suspendSeekStatus("seek",!1),i.isSeeking=!0,t.played.push({begin:i.player.currentTime,end:-1}),e.played.push({begin:i.player.currentTime,end:-1}),r.lastSeekStartTime=GJ(),r.seekBefore=i.lastVideoTime.toString(),r.intervalId=setTimeout((function(){i.isSeeking&&i.suspendSeekStatus("seekTimeout",!0)}),6e4)}})),LJ(this,"onSeeked",(function(){WJ(i.player.src)||i.isSeeking&&i.suspendSeekStatus("seeked",!0)})),LJ(this,"onPlaying",(function(){i.suspendWaitingStatus("play"),i.load_state=vZ;var e=GJ();i.pauseLog.isPausing&&(i.pauseLog.isPausing=!1,i.pauseLog.pause_acu_t+=e-i.pauseLog.pause_start)})),LJ(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(FJ("onPlayCatch",e,t),e){switch(e){case"mp42dash":i.vtype="DASH_2";break;case"dash2mp4":i.vtype="MP4_2";break;case"dash1mp4":i.vtype="MP4_1";break;default:i.vtype=e}var n=i.errorLog,r=i.playlogs,o=i.merror;o.playCatch.push(CJ({errc:t.errorCode,errt:t.errorType},t.headers)),i.setBr("playcatch"),n.accu_errc++,n.try_err_c++,n.fir_errc=t.errorCode,t.errorCode&&n.last_errors.push(t.errorCode),i.suspendWaitingStatus("playcatch"),i.sendDegradeLog("playCatch",r.degrade,{cdn_url:t.url}),r.degrade=e,i.onOneError({errorType:t.errorTypeCode,code:t.errorCode,url:t.url||"",status:t.httpCode||t.status,headers:t.headers||{},vid:t.vid||i.vid,preload_hit:t.preloadHit||0,preload_cached:t.preloadCached||0,endState:TZ,costTime:t.costTime,message:t.errorMessage||t.message},0)}})),LJ(this,"onMediaExpied",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{errorType:"",errorTypeCode:0,errorCode:0,url:"",headers:{},status:0},t=i.errorLog,n=i.playlogs;FJ("onMediaExpied",e),i.suspendWaitingStatus("expied"),i.setBr("expied"),t.accu_errc++,t.try_err_c++,t.last_errors.push(e.errorCode),n.at=(new Date).getTime(),i.merror.expied.push(CJ({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status},YJ(e.headers||{}))),i.onOneError({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status,headers:e.headers||{}},0)})),LJ(this,"onLog",(function(e){FJ("onLog",e);var t=e.type;if(delete e.type,t)switch(t){case CZ:break;case PZ:i._templog||(i._templog={}),i._templog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object.keys(t).map((function(i){e[i]="append"===n?$J(e[i],t[i]):t[i]})),e}(i._templog,e.data,e.action),i._templog.preload_hit&&(i._cacheFile=LZ);break;case xZ:var n=i.errorLog;n.accu_errc++,n.try_err_c++,i.setBr("mp4error"),n.last_errors.push(e.code),i.onOneError(e,0);break;case OZ:var r=function(e,t){var n={ext:e.ext||{},data:{}};return Object.keys(e).map((function(i){t[i]?n.data[t[i]]=e[i]:"ext"!==i&&(n.ext[i]=e[i])})),n}(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])})),i.onOneEvent(r.data,r.ext,2)}})),LJ(this,"onPlay",(function(){FJ("onPlay","this.startStep :".concat(i.startStep," this.isEnded:").concat(i.isEnded)),i.isEnded&&(i.resetLoggerParams(),i.setPt())})),LJ(this,"onPause",(function(){FJ("onPause");var e=i.pauseLog;e.isPausing=!0,e.pause_start=GJ()})),LJ(this,"onWaiting",(function(){var e=i.stall,t=i._options;i.updateCurBuffer("onWaiting"),t.checkByInnerLog||(FJ("onWaiting>","isSeeking:".concat(i.isSeeking," startStep:").concat(i.startStep," intervalId:").concat(e.intervalId)),i.isSeeking||0===i.playlogs.vt||i.inWaitingStart>0||(e.intervalId&&(window.clearTimeout(e.intervalId),e.intervalId=null),i.inWaitingStart=GJ(),e.intervalId=window.setTimeout((function(){var e=i.stall;FJ("stall.intervalId>>".concat(e.intervalId," cost: ").concat(GJ()-i.inWaitingStart)),i._endType="wait",i.load_state=yZ,i.vtype.indexOf("MP4")>-1&&i.player.currentTime>10&&i.task&&(i.triggerTask("waiting",i.initial_url),i.requestCount++),e.stall_start=i.inWaitingStart,1===e.sc&&(e.first_buf_startt=i.inWaitingStart),window.clearTimeout(e.intervalId),e.intervalId=null,i.startWaitingStatus(i.inWaitingStart,GJ()-i.inWaitingStart),e.intervalId=setTimeout((function(){i.inWaitingStart>0&&i.suspendWaitingStatus("waitTimeout")}),6e4)}),200)))})),LJ(this,"onEnded",(function(){if(i.initial_url){FJ("onEnded","watchDur:".concat(i.watchDur," vt:").concat(i.vt," pt:").concat(i.pt)),i.isEnded=!0;var e=i.resLogs.df;i.changeResolution({from:e,to:e,startTime:GJ(),operaType:"leave_switch",endType:"ended"}),i.onOnePlay(kZ),i.sendDegradeLog("playCatch_end",i.playlogs.degrade),i.onOneTemp(kZ),i.sendEventsQueue(),i.playlogs.lc++}})),LJ(this,"onUnload",(function(){0!==i.startStep&&i.initial_url&&(i.onOneTemp(wZ),i.sendDegradeLog("playCatch_end",i.playlogs.degrade),i._reportInvalidVV(wZ)||i.onOnePlay(wZ,!0))})),LJ(this,"onVisibilitychange",(function(){var e=i.playlogs.vt;"visible"===document.visibilityState&&(e||i.setPt())})),LJ(this,"onDestroy",(function(){FJ("onDestroy:this.startStep:".concat(i.startStep," initial_url:").concat(i.initial_url," ").concat(!!i.initial_url)),i.onOnePlay(EZ),i.startStep>0&&i.initial_url&&(i.onOneTemp(EZ),i.sendDegradeLog("playCatch_end",i.playlogs.degrade));var e=i.resLogs.df;i.changeResolution({from:e,to:e,startTime:GJ(),operaType:"leave_switch",endType:"destroy"}),i.sendEventsQueue(),zZ.isPC?window.removeEventListener("beforeunload",i.onUnload):(zZ.isMobile||zZ.isPad)&&window.removeEventListener("pagehide",i.onUnload),document.removeEventListener("visibilitychange",i.onVisibilitychange),i.listeners.forEach((function(e){i.player.off(e.evt,e.handler)})),i.clearTimers(),i.player.off("destroy",i.onDestroy),i.task&&i.task.clear()})),LJ(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(FJ("onOnePlay _isOnePlayReport:".concat(i._isOnePlayReport," isLeave: ").concat(t," endState:").concat(e)),!i._isOnePlayReport){var n=i.errorLog,r=i.playlogs,o=i.abrInfo,a=i.resLogs,s=i.player,l=i.apiLog,c=i.pauseLog,u=i.stall,h=i.netLog,d=i.watchDur;i._isOnePlayReport=!0;var f=VJ(),p=i.getBufferTime(s),g=i.getPerformance();i.setExt();var v=CJ(CJ(CJ({local_time:(new Date).getTime(),log_type:"video_playq",plugin_exception:0,player_create_exception:"",v:i.vid,initial_url:i.initial_url,initial_host:i.initial_host,initial_ip:i.curHeaders.x_response_sinfo||0,initial_type:i.initial_type},i.curHeaders),{},{initial_resolution:a.initial_resolution,final_resolution:a.final_resolution,pt:i.pt,prepare_start_time:r.nt,prepare_end_time:r.rt||VJ(),vt:i.vt,lt:i.lt,lpt:i.lpt,fvt:i.fvt,nvt:i.nvt,bft:i.bft,sc:i.seekLog.sc,sat:i.seekLog.sat,bc:i.bc,dbc:r.dbc||0,nbc:r.nbc||0,video_net_s:i.videoNetworkState,status:i.curStatus,first_buf_startt:u.first_buf_startt,first_buf_endt:u.first_buf_endt,lc:r.lc,bu_acu_t:i.bu_acu_t>DZ?0:i.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:i.cur_play_pos,load_state:i.load_state,play_speed:i.playbackRate,playback_state:i.playback_state,end_state:e,watch_dur:d>DZ?0:d,switch_resolution_c:i.switchResolutionCount,is_start_play_automatically:i.isAutoplay,start_time:i.start_time,finish:i.finish,errt:n.errt,errc:n.errc,vsc:l.vsc,vsc_message:l.vsc_message,api_str:l.api_str,auth:l.auth||l.logid,width:i.videoWidth,height:i.videoHeight,vd:i.vd,video_length:parseInt(p.video,10),audio_length:parseInt(p.audio,10),df:i.resolution,lf:a.lf,play_c:0,player_created_t:i.player_created_t,fir_errt:n.fir_errt,fir_errc:n.fir_errc,lv_method:0,ldst:a.ldst,ldet:a.ldet,is_disable_short_seek:0,mute:i.mute,volume:i.volume,download_speed:i.realSpeed?i.realSpeed:i.task&&i.task.speed?i.task.speed:h.downloadSpeed,avg_speed:i.avgSpeed?i.avgSpeed:h.rqCount>0?parseInt(h.totalSpeed/h.rqCount,10):0,bitrate:i.curBitrate,preload_state:i.preloadState,preload_hit:i.preLoadData.hit||0,preload_cached:i.preLoadData.duration||i.preLoadData.byteLength||0,mdl_req_num:h.requestCount,watingcost:i.watingCost,br:r.br,fbrt:r.fbrt,try_err_c:n.try_err_c,accu_errc:n.accu_errc,dash_pst:i.dash_pst,dash_wst:i.dash_wst,dash_wrt:i.dash_wrt,dash_ift:i.dash_ift,dash_cst:i.dash_cst,dash_spt:i.dash_spt,dash_break:2===s.dashBufferBreak?1:0,merror:QJ(i.merror),ex:QJ(i.exInfo),perf:QJ(g),bufs:QJ(i.buffers.allBuffer),vs:a.vs,vds:a.vds,vps:a.vps},i.buffers.curBuffer),{},{degrade:r.degrade,cache_file:i._cacheFile});if(0!==i.vt&&(v.et=f),s&&s.dashState&&(v.dash_state=s.dashState),s.abrInstance){var y=s.abrInstance;if(i.updateAbrInfo(o,y,s.playbackRate),y.getAbrVVStats){var m=y.getAbrVVStats();Object.keys(m).forEach((function(e){v[e]=m[e]}))}}if(o.abr_init_opts=s.config.autoBitrateOpts||{},v.abr_info=QJ(i.abrInfo),t){var _=!i._options.disableLocalCache;i.reportLog(iZ,v,_?1:0)}else i.reportLog(iZ,v)}})),LJ(this,"onOneEvent",(function(e){var t=e.costTime,n=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;FJ("onOneEvent",r);var u=i.buffers.curBuffer,h=CJ({local_time:(new Date).getTime(),v:n||i.vid,cost_time:t,end_type:r||i.end_type,cdn_url:a||i.url,cdn_host:s||"",initial_type:i.initial_type,resolution:i.resolution,play_speed:i.playbackRate,first_frame_interval:GJ()-i.pt,last_switch_interval:i.getLastInterval("lastSwitchStartTime",i.resLogs,!1),last_seek_interval:i.updateSeekPt(!1),last_event_interval:i.getLastInterval("lastEventTime"),cur_play_pos:o||i.cur_play_pos,video_ready_s:i.videoReadyState,video_seeking:i.videoSeeking,video_paused:i.videoPaused,bufs:QJ(i.buffers.allBuffer),retry_count:i._retryCount,at:i.playlogs.at,stay_seconds:parseInt(((new Date).getTime()-i.playlogs.at)/1e3,10),preload_state:i.preloadState,preload_hit:i.preLoadData.hit,preload_cached:i.preLoadData.duration||i.preLoadData.byteLength},u);if("waitstart"===r&&"function"==typeof i._options.getPageFPS){var d=i._options.getPageFPS();h.cur_fps=d.curFPS||0,h.avg_fps=d.avgFPS||0}var f=i.player;f&&f.dashState&&(h.dash_state=i.player.dashState),Object.keys(l).forEach((function(e){h[e]=l[e]})),h.ex=QJ(i.getPlayerExt()),i.addIfExist("drm_type",i._options,h),i.reportLog(aZ,h,c)})),LJ(this,"onOneTemp",(function(){if(FJ("onOneTemp>>",!i._templog),i._templog){var e=i.player,t=i.playlogs,n=i.pauseLog,r=i.errorLog,o=i.resLogs,a=i.watchDur,s=CJ(CJ(CJ({local_time:(new Date).getTime()},i._templog),{},{v:i.vid,initial_type:i.initial_type,pt:i.pt,vt:i.vt,lt:i.lt,fvt:i.fvt,bc:i.bc,bu_acu_t:i.bu_acu_t>DZ?0:i.bu_acu_t,pause_acu_t:n.pause_acu_t,cur_play_pos:i.cur_play_pos,watch_dur:a>DZ?0:a,finish:i.finish,errt:r.errt,errc:r.errc,vd:i.vd,df:i.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:QJ(i.buffers.allBuffer),vs:o.vs,vds:o.vds,vps:o.vps},i.buffers.curBuffer),{},{degrade:t.degrade});0!==i.vt&&(s.et=VJ()),["drm_type","dynamic_type"].forEach((function(e){i.addIfExist(e,i._options,s)})),i.reportLog(sZ,s,0),i._templog=null}})),this.player=t,void 0===this.player||null===this.player)throw new Error("player is ".concat(this.player));if(n&&n.line_app_id){n.isTask&&(this.task=new KZ),this.eventQueue=[],this._instanceCreateTime=(new Date).getTime(),n.codec_type=n.codec_type||"h264",this._options=n,!this._options.maxQueueCount&&(this._options.maxQueueCount=5),this.line_app_id=parseInt(n.line_app_id,10)||0,this.line_user_id=(n.line_user_id||"").toString(),this.playerCoreVersion=t.version,this.playerVersion=n.playerVersion,this.closeSeekLog=n.closeSeekLog||!1,this.start_time=1e3*(n.start_time||0),this._initial_resolution="",this.__vtype=null,this.__dt="",this.resetLoggerParams();try{this.initializeTracker(),this.sendLocalLog(),this.bindEvt(),FJ("logger constructor:"+this.player.video)}catch(xX){console.error(xX)}}else console.warn("player.config.vodLogOpts.line_app_id is necessary for plugin xgVodLogger")}return IJ(e,[{key:"resetLoggerParams",value:function(){FJ("resetLoggerParams");var e=this.playlogs?this.playlogs.lc:0;this.playlogs={nt:VJ(),vt:0,rt:this.isEnded?VJ():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}],dash_pst:0,dash_wst:0,dash_wrt:0,dash_ift:0,dash_cst:0,dash_spt:0,interruptCount:0,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.initializeLogDatas(),this.initializeUrlLog()}},{key:"initializeLogDatas",value:function(){this.startStep=0,this.inWaitingStart=0,this.lastVideoTime=0,this._endType="",this._retryCount=0,this.lastOperaTime=ZZ,this.lastEventTime=ZZ,this.seekLog={intervalId:0,lastSeekStartTime:GJ(),seekBefore:0,sat:0,sc:0},this.resLogs={lastSwitchStartTime:ZZ,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:zZ.isSupportMP4?0:1005,last_errors:[]},this.pauseLog={pause_acu_t:0,isPausing:!1,pause_start:0},this.stall={intervalId:0,stall_count:0,first_buf_startt:0,first_buf_endt:0,stall_start:0,stall_end:0,stall_last_interval:0,stall_acc_time:0},this._playerCreatedTime=0,this.load_state=gZ,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=IZ}},{key:"initSessionId",value:function(){var e="0";try{e=window.localStorage.getItem(JZ).web_id||"0"}catch(w7){e="0"}this._sessionId=function(e){var t=(new Date).getTime();try{e=parseInt(e)}catch(xX){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 n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))}(e),FJ("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 eQ("tracker");var n=t.channel||"cn",i={app_id:"cn"===(n="va"===n||"sg"===n?n:"cn")?XZ:1300===XZ?323254:XZ,channel:n,log:!1,disable_sdk_monitor:!0};t.channelDomain&&(i.channel_domain=t.channelDomain),i.enable_ab_test=!!t.enableAbTest,this.tracker.init(i)}this.initSessionId();var r=navigator?navigator.hardwareConcurrency:0,o=navigator?navigator.deviceMemory:0;this.commonParams={play_type:0,source_type:"vid",sdk_version:qZ,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:zZ.isPad?"pad":zZ.isMobile?"mobile":"pc",cpu_core:Number(r)||0,memory_size:Number(o)||0,support:tQ,webdriver:navigator&&navigator.webdriver?1:0},FJ("commonParams ",this.commonParams);var a={evtParams:this.commonParams,disable_auto_pv:!0};FJ("Browser.name ",zZ.name),!zZ.name||zZ.isChrome||zZ.isSafari||(a.browser=zZ.name,zZ.appVersion&&(a.browser_version=zZ.appVersion)),this.line_user_id&&(a.user_unique_id=this.line_user_id,a.web_id=this.line_user_id),t.referrer&&(a.referrer=t.referrer,a.referrer_host=UJ(t.referrer)),t.ext&&Object.keys(t.ext).map((function(n){e.exInfo[n]=t.ext[n]})),this.tracker.config(a),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=jZ.get();jZ.remove(),t.map((function(t){Object.keys(t).map((function(n){if(FJ("sendLocalLog",n,t[n]),e.player){e.player.emit("abLog",n,t[n]);var i=e._options.sendLocalCallback;i&&"function"==typeof i&&i(n,t[n])}e._track(n,t[n])}))}))}},{key:"_track",value:function(e,t){"function"==typeof this.tracker?this.tracker(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:"DRM_ERROR",handler:this.onDashError},{evt:"ended",handler:this.onEnded},{evt:"loadeddata",handler:this.onLoadeddata},{evt:"loadstart",handler:this.onLoadStart},{evt:"canplay",handler:this.onCanplay},{evt:"dashStateChange",handler:this.onDashStateChange},{evt:"autoplay was prevented",handler:this.onNotAutoPlay},{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:"drmTypeChange",handler:this.onDrmTypeChange},{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:"ABR_PRESTALL_END",handler:this.onAbrPrestallEnd},{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}];var t=this.player.config.errorKey;FJ(">>>errorKey",t);var n={evt:"error",handler:this.onPlayerError};t&&(n.evt=t),this.listeners.push(n),this.listeners.forEach((function(t){e.player.on(t.evt,t.handler)})),this.bindUnload()}},{key:"addIfExist",value:function(e,t,n){if($Z(t)){var i=t[e];!(null==i)&&(n[e]=i)}}},{key:"changeResolution",value:function(e){var t=e.from,n=e.to,i=e.startTime,r=e.operaType,o=e.abrInfo,a=e.endType,s=void 0===a?"":a,l=this.resLogs;t=ZJ(t),n=ZJ(n),l.ldet=GJ(),l.df=n,l.lf=t,l.final_resolution=n,l.switch_count++;var c=l.ldet-i,u={bc:l.bc,bu_acu_t:l.bu_acu_t,sc:l.sc,sat:l.sat,watch_dur:BJ(l.played)};o&&(u.abrInfo=o),this.updateVds(),this.resetDefiInfo(),this._options.closeResolutionLog||this.onOneOperator({costTime:c,operaType:r,endType:s,stateBefore:t,stateAfter:n},u,0)}},{key:"getLastInterval",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t[e],r=GJ(),o=i===ZZ?ZZ:r-i;return n&&(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(){zZ.isPC?window.addEventListener("beforeunload",this.onUnload):(zZ.isMobile||zZ.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,t=this.stall;e.intervalId&&window.clearTimeout(e.intervalId),t.intervalId&&window.clearTimeout(t.intervalId)}},{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",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};FJ("sendDegradeLog",e,t,n);var i=this.degradeLog;if(!(i.hasSendEnd||"playCatch_end"===e&&"none"===t)){"playCatch_end"===e&&(i.hasSendEnd=!0);var r=this.bu_acu_t-i.bu_acu_t;this.onOneEvent({costTime:this.vd,vid:this.vid,end_type:e,cur_play_pos:this.player.currentTime,cdn_url:n.url},CJ({degrade:t,vt:this.vt,pt:this.pt,fvt:this.fvt,bc:this.bc-i.bc,bu_acu_t:r>DZ?0:r,watch_dur:this.watchDur-i.watch_dur},n),0)}}},{key:"getBufferTime",value:function(e){var t=0,n=0,i=e.video&&e.video.buffered;if(i){for(var r=i.length,o=0,a=0;a<r;a++)o+=i.end(a)-i.start(a);t=n=1e3*o}return{video:t,audio:n}}},{key:"updateAbrInfo",value:function(e,t,n){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:n},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(n){"performance"!==n&&(e.exInfo[n]=t[n])}))}},{key:"onOneOperator",value:function(e){var t=e.costTime,n=e.operaType,i=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:n,state_before:i,state_after:r,cost_time:t,end_type:o||this.end_type,cdn_url:this.url,resolution:this.resolution,last_interval:l,bufs:QJ(this.buffers.allBuffer),cur_play_pos:this.cur_play_pos,retry_count:this._retryCount},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(rZ,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},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];FJ("onOneError",t);var r=this.errorLog,o=this.apiLog,a=this.resLogs,s=this.player,l=this.playlogs,c=YJ(t.headers||{}),u=this.getPerformance();this.setExt();var h=CJ(CJ(CJ({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:t.code,es:this.es,cdn_url:t.url||this.url,bufs:QJ(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||_Z,preload_hit:t.preload_hit||0,preload_cached:t.preload_cached||0,ex:QJ(this.exInfo),pref:QJ(u),video_ready_s:this.videoReadyState});s&&s.dashState&&(h.dash_state=s.dashState);var d=this.player.currentSrc,f=KJ(d)?KJ(t.url)?this.initial_url:t.url:d,p={connectTime:0,status:0,statusText:"",isexpired:0,isBlob:KJ(d)?1:0};if(i&&"String"===XJ(f)){var g={};zJ(f,{range:"0-8",timeout:2e3}).then((function(e){FJ("getXhr>>check result ",e);var t=YJ(e.headers||{});h.server_ip=t.x_response_sinfo,g=CJ(CJ({},p),{},{statusText:e.statusText||"",status:e.status||0,connectTime:0|e.connectTime,sinfo:t.x_response_sinfo||"",cinfo:t.x_response_cinfo||""})})).catch((function(e){g=CJ(CJ({},p),{},{statusText:-2===e.status?"timeout":"error",status:e.status})})).finally((function(){var t=eZ(f);g.isexpired=t,h.net=QJ(g),e.reportLog(oZ,h,n)}))}else h.net=QJ(p),this.reportLog(oZ,h,n)}},{key:"reportLog",value:function(t,n,i){var r=this,o=this._options,a=this.player.ABTestTag,s=this.commonParams;!n.player_sessionid&&(n.player_sessionid=this.sessionId),!n.web_url&&(n.web_url=window.location.href),n.user_agent=navigator.userAgent,n.dynamic_type=this.dynamicType;var l="Array"===XJ(o.absdkVersion)?o.absdkVersion.join(","):o.absdkVersion;n.absdkVersion=l||e.AB_SDK_VERSION,null!=a&&(n.abtest_tag=a);var c=this._options;if(n.codec_type=this.codecType,$Z(c)&&(MZ.forEach((function(e){r.addIfExist(e,c,n)})),Object.keys(s).forEach((function(e){r.addIfExist(e,s,n)})),n.vtype=this.vtype),1===i){var u={};return u[t]=n,void jZ.set(u)}2!==i?(this.player&&this.player.emit("abLog",t,n),this._track(t,n)):this.addEventsQueue(t,n)}},{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.onOneEvent({costTime:t,end_type:"waitstart"},{},2),this.appendStallInfo("start",e),this.updateCurBuffer("startWaitingStatus")}},{key:"triggerTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"start",t=arguments.length>1?arguments[1]:void 0;FJ("triggerTask>>",e);var n=WJ(t=t||this.player.src);!n&&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,n=arguments.length>2?arguments[2]:void 0;if(!this.player.ext){this.exInfo.stall||(this.exInfo.stall=[]);var i=this.exInfo.stall;if("start"===e){i.length>6&&i.splice(0,i.length-6);var r=this.buffers.curBuffer;i.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=i.length-1;if(o<0)return;i[o].end<0&&(i[o].end=t,i[o].endType=n,i[o].cost=t-i[o].start)}FJ("appendStallInfo",i)}}},{key:"suspendWaitingStatus",value:function(e){var t=GJ(),n=this.playlogs,i=this.resLogs,r=this.stall,o=this.inWaitingStart;if(!(o<=0||this.isSeeking||n.vt<=0)){if(FJ("suspendWaitingStatus>>".concat(e,"|costTime:").concat(t-o," isSeeking:").concat(this.isSeeking," vt:").concat(n.vt)),this.appendStallInfo("end",t,e),t-o>200){var a=t-this.inWaitingStart;if(n.bc++,this.checkInBuffer(this.player.currentTime)?(n.de_bu_acu_t+=a,n.dbc++):(n.nbc++,n.n_bu_acu_t+=a),i.bc++,n.bu_acu_t+=a,i.bu_acu_t+=a,r.stall_end=t,r.stall_last_interval=r.stall_end-r.stall_start,r.stall_acc_time+=r.stall_last_interval,1===r.sc&&(r.first_buf_endt=t),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:e||"wait"},{},2)}this._endType="",this.load_state=vZ,this.inWaitingStart=0,window.clearTimeout(r.intervalId),r.intervalId=null}}},{key:"suspendSeekStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isSeeking){var n=this.seekLog,i=this.resLogs,r=this.player,o=GJ()-n.lastSeekStartTime;FJ("suspendSeekStatus>>","".concat(e," currentTime:").concat(r.currentTime," costTime:").concat(o," sat:").concat(n.sat," resLogs.sat:").concat(i.sat)),n.intervalId&&window.clearTimeout(n.intervalId),n.intervalId=null,this.isSeeking=!1;var a=this._endType="seek",s=n.seekBefore,l=(r.currentTime||0).toString();n.sc++,n.sat+=o>AZ?0:o,i.sc++,i.sat+=o>AZ?0:o,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=VJ(),FJ("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=VJ(),FJ("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(){return this.playlogs.bu_acu_t}},{key:"pt",get:function(){return this.playlogs.pt||VJ()}},{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,n=e.pt;return t>0&&n>0?parseInt(t-n,10):0}},{key:"nvt",get:function(){var e=this.playlogs,t=e.vt,n=e.nt;return t>0&&n>0?parseInt(t-n,10):0}},{key:"dash_pst",get:function(){return this.playlogs.dash_pst}},{key:"dash_wst",get:function(){return this.playlogs.dash_wst}},{key:"dash_wrt",get:function(){return this.playlogs.dash_wrt}},{key:"dash_ift",get:function(){return this.playlogs.dash_ift}},{key:"dash_cst",get:function(){return this.playlogs.dash_cst}},{key:"dash_spt",get:function(){return this.playlogs.dash_spt}},{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(xX){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:WJ(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:UJ(WJ(e)?"":e)}},{key:"curHeaders",get:function(){var e=this.player,t=this.task;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?YJ(e.__dash__.curReqVideoSegInfo.headers||{}):t?t.headers:{}}},{key:"curStatus",get:function(){var e=this.task,t=this.vtype,n=this.netLog;return t.indexOf("MP4")>-1?e?e.status:0:n.status}},{key:"play_type",get:function(){return 0}},{key:"resolution",get:function(){var e=this.player.curDefinition;return e?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 n=t.preLoadData.length;return{hit:n>0,length:n}}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,n=e.curDefinition;return n&&n.bitrate?n.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 JJ(this.player.root,"xgplayer-playing")}},{key:"isStop",get:function(){return JJ(this.player.root,"xgplayer-ended")||JJ(this.player.root,"xgplayer-nostart")}},{key:"isPause",get:function(){return JJ(this.player.root,"xgplayer-pause")}},{key:"isLoading",get:function(){return JJ(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&&(FJ("lt init",this.playlogs.lt),e=VJ()),e}},{key:"lpt",get:function(){return this.lt?this.lt-this.pt:0}},{key:"playback_state",get:function(){return this.isError?fZ:this.isStop?uZ:this.isPause?dZ:this.isLoading?pZ:hZ}},{key:"is_start_play_automatically",get:function(){return this.isAutoplay+""}},{key:"watchDur",get:function(){var e=this.player,t=this.playlogs,n=e.cumulateTime?e.cumulateTime:BJ(t.played);return n>=0?n: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:"getPlayerExt",value:function(){var e=this.player.ext;if(e)return e}},{key:"watingCost",get:function(){if(this.inWaitingStart>0){var e=GJ()-this.inWaitingStart;return e>AZ?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:"updateCurBuffer",value:function(e){var t=this.player,n=t.buffered,i=t.currentTime,r={buf_s_pos:0,buf_e_pos:0,buf_include:0,buf_diff:0},o=[];if(!n||n.length<1)return r;for(var a=-1,s=-1,l=parseInt(1e3*i,10),c=n.length-1;c>-1;c--){var u=parseInt(1e3*n.start(c),10),h=parseInt(1e3*n.end(c),10);o.push({start:u,end:h}),l>u&&l<h?(r.buf_include=1,r.buf_s_pos=u,r.buf_e_pos=h,r.buf_diff=h-l):l<u&&(a<0||u-l<a)?(a=u-l,s=c):l>h&&(a<0||l-h<a)&&(a=l-h,s=c)}1!==r.buf_include&&(s<0&&(s=n.length-1),r.buf_s_pos=parseInt(1e3*n.start(s),10),r.buf_e_pos=parseInt(1e3*n.end(s),10)),this.buffers.allBuffer=o,this.buffers.curBuffer=r}},{key:"checkInBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.player.buffered;if(!n)return!1;e=parseInt(1e3*e,10);for(var i=0;i<n.length;i++){var r=parseInt(1e3*n.start(i),10)+t,o=parseInt(1e3*n.end(i),10)+t;if(e>r&&e<o)return!0}return!1}},{key:"updateVideoSize",value:function(){var e=this._options,t=this.player,n=this.resLogs,i=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];FJ("updateVideoSize》》videoItem",a),r=a?a.bitrate||a.bandwidth:0,i=a?a.size:0}else{var s=this.player.curDefinition;s?(r=s.bitrate||t.config.bitrate||0,i=parseInt(s.bitrate*t.duration/8,10)):(i=e.videoSize||t.config.videoSize||0,r=e.bitrate||t.config.bitrate||0)}FJ("updateVideoSize","bitrate:".concat(r,", vs:").concat(i)),i&&(n.vs=i,n.vis=parseInt(i/t.duration,10),n.bitrate=r||n.vis)}},{key:"updateVds",value:function(){var e=this.resLogs,t=this.playlogs,n=this.player;if(0!==e.vis){for(var i=parseInt(BJ(t.played)/1e3,10),r=n.buffered,o=0,a=0;a<r.length;a++)o+=parseInt(r.end(a)-r.start(a),10);FJ("updateVds","pdur:".concat(i," 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.vps+=parseInt((i-e.lplayed)*e.vis,10),e.vds+=parseInt((o-e.lbuf)*e.vis,10),e.lplayed=i,e.lbuf=o}else FJ("updateVds","vis:".concat(e.vis))}}],[{key:"TEA_ID",get:function(){return XZ},set:function(e){JZ="__tea_cache_tokens_".concat(XZ=e)}},{key:"AB_SDK_VERSION",get:function(){return QZ},set:function(e){QZ="Array"===XJ(e)?e.join(","):e}},{key:"Collector",set:function(e){eQ=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(e,t){},disableLocalCache:!1,closeResolutionLog:!1,closeSeekLog:!1,needXhrCheck:!1}}}]),e}();nQ.TEA_ID=323254,nQ.Collector=TJ;var iQ,rQ=function(e){if(e&&e.player){var t=e.player.config.vodLogOpts||{};e.player.vodLogger=new nQ(e.player,t),e.player.plugins.xgVodLogger=e.player.vodLogger}else this.vodLogger=new nQ(this,this.config.vodLogOpts||{})};function oQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function aQ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oQ(Object(n),!0).forEach((function(t){fQ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oQ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function sQ(){sQ=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(P){c=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var o=t&&t.prototype instanceof f?t:f,a=Object.create(o.prototype),s=new C(i||[]);return r(a,"_invoke",{value:w(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(P){return{type:"throw",arg:P}}}e.wrap=u;var d={};function f(){}function p(){}function g(){}var v={};c(v,a,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(x([])));m&&m!==t&&n.call(m,a)&&(v=m);var _=g.prototype=f.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function o(r,a,s,l){var c=h(e[r],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==i(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,s,l)}),(function(e){o("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return o("throw",e,s,l)}))}l(c.arg)}var a;r(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){o(e,n,t,i)}))}return a=a?a.then(i,i):i()}})}function w(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return{value:void 0,done:!0}}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=h(e,t,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function E(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var r=h(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function x(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=g,r(_,"constructor",{value:g,configurable:!0}),r(g,"constructor",{value:p,configurable:!0}),p.displayName=c(g,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},b(k.prototype),c(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var a=new k(u(t,n,i,r),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(_),c(_,l,"Generator"),c(_,a,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=x,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return a.type="throw",a.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;S(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function lQ(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(w7){return void n(w7)}s.done?t(l):Promise.resolve(l).then(i,r)}function cQ(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){lQ(o,i,r,a,s,"next",e)}function s(e){lQ(o,i,r,a,s,"throw",e)}a(void 0)}))}}function uQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hQ(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,bQ(i.key),i)}}function dQ(e,t,n){return t&&hQ(e.prototype,t),n&&hQ(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fQ(e,t,n){return(t=bQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pQ(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&&vQ(e,t)}function gQ(e){return(gQ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function vQ(e,t){return(vQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function yQ(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mQ(e,t){if(t&&("object"===i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return yQ(e)}function _Q(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(xX){return!1}}();return function(){var n,i=gQ(e);if(t){var r=gQ(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return mQ(this,n)}}function bQ(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}function kQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function wQ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kQ(Object(n),!0).forEach((function(t){IQ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kQ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function EQ(){EQ=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(P){c=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var o=t&&t.prototype instanceof f?t:f,a=Object.create(o.prototype),s=new C(i||[]);return r(a,"_invoke",{value:w(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(P){return{type:"throw",arg:P}}}e.wrap=u;var d={};function f(){}function p(){}function g(){}var v={};c(v,a,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(x([])));m&&m!==t&&n.call(m,a)&&(v=m);var _=g.prototype=f.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function o(r,a,s,l){var c=h(e[r],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==i(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,s,l)}),(function(e){o("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return o("throw",e,s,l)}))}l(c.arg)}var a;r(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){o(e,n,t,i)}))}return a=a?a.then(i,i):i()}})}function w(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return{value:void 0,done:!0}}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=h(e,t,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function E(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var r=h(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function x(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=g,r(_,"constructor",{value:g,configurable:!0}),r(g,"constructor",{value:p,configurable:!0}),p.displayName=c(g,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},b(k.prototype),c(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var a=new k(u(t,n,i,r),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(_),c(_,l,"Generator"),c(_,a,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=x,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return a.type="throw",a.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;S(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function TQ(e){return(TQ="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 SQ(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(w7){return void n(w7)}s.done?t(l):Promise.resolve(l).then(i,r)}function CQ(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){SQ(o,i,r,a,s,"next",e)}function s(e){SQ(o,i,r,a,s,"throw",e)}a(void 0)}))}}function xQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OQ(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,WQ(i.key),i)}}function PQ(e,t,n){return t&&OQ(e.prototype,t),n&&OQ(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function IQ(e,t,n){return(t=WQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LQ(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&&AQ(e,t)}function DQ(e){return(DQ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function AQ(e,t){return(AQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function MQ(){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(xX){return!1}}function RQ(e,t,n){return(RQ=MQ()?Reflect.construct.bind():function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&AQ(r,n.prototype),r}).apply(null,arguments)}function NQ(e){var t="function"==typeof Map?new Map:void 0;return NQ=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;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,i)}function i(){return RQ(e,arguments,DQ(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),AQ(i,e)},NQ(e)}function jQ(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function BQ(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UQ(e,t){if(t&&("object"===i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return BQ(e)}function HQ(e){var t=MQ();return function(){var n,i=DQ(e);if(t){var r=DQ(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return UQ(this,n)}}function FQ(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=DQ(e)););return e}function GQ(){return GQ="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=FQ(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},GQ.apply(this,arguments)}function VQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function zQ(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return VQ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?VQ(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function WQ(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}rQ.pluginName="__xgVodLogger",rQ.playerConfig={},rQ.Collector=TJ,rQ.setABSdkVersion=function(e){nQ.AB_SDK_VERSION=e},gT("asyncIterator");var KQ="network",qQ="network_timeout",YQ="demux",$Q="remux",XQ="media",JQ="other",ZQ=(IQ(iQ={},"manifest",{HLS:1100}),IQ(iQ,KQ,2100),IQ(iQ,qQ,2101),IQ(iQ,YQ,{FLV:3100,HLS:3200,MP4:3300,FMP4:3400}),IQ(iQ,$Q,{FMP4:4100,MP4:4200}),IQ(iQ,XQ,{MSE_ADD_SB:5200,MSE_APPEND_BUFFER:5201,MSE_OTHER:5202,MSE_FULL:5203}),IQ(iQ,JQ,8e3),iQ),QQ=function(e){LQ(n,e);var t=HQ(n);function n(e,i,r,o,a){var s;return xQ(this,n),(s=t.call(this,a||(null==r?void 0:r.message))).errorType=e===qQ?KQ:e,s.originError=r,s.ext=o,s.errorCode=ZQ[e][i]||ZQ[e],s.errorMessage=s.message,s.errorCode||(s.errorType=JQ,s.errorCode=ZQ[s.errorType]),s}return PQ(n,null,[{key:"create",value:function(e,t,i,r,o){return e instanceof n?e:(e instanceof Error&&(i=e,e=""),e||(e=JQ),new n(e,t,i,r,o))}},{key:"network",value:function(e){var t;return new n(null!=e&&e.isTimeout?qQ:KQ,null,e instanceof Error?e:null,{url:null==e?void 0:e.url,response:null==e?void 0:e.response,httpCode:null==e||null===(t=e.response)||void 0===t?void 0:t.status})}}]),n}(NQ(Error)),e0=xr,t0=ne,n0=ct,i0=Ut,r0=Mi,o0=xa,a0=jG,s0=Array,l0=J([].push),c0=function(e,t,n,i){for(var r,o,a,s=n0(e),l=t0(s),c=e0(t,n),u=o0(null),h=r0(l),d=0;h>d;d++)a=l[d],(o=i0(c(a,d,s)))in u?l0(u[o],a):u[o]=[a];if(i&&(r=i(s))!==s0)for(o in u)u[o]=a0(r,u[o]);return u},u0=Na;Er({target:"Array",proto:!0},{group:function(e){var t=arguments.length>1?arguments[1]:void 0;return c0(this,e,t)}}),u0("group");var h0={DEBUG:1,LOG:2,WARN:3,ERROR:4},d0=["Boolean","Number","String","Undefined","Null","Date","Object"],f0=function(){function e(t,n){xQ(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),e.disabled=(null==n?void 0:n.disabled)||!0,this.logCacheLevel=(null==n?void 0:n.logCacheLevel)||3,this.logMaxSize=(null==n?void 0:n.logMaxSize)||204800,this.logSize=0,this.logTextArray=[]}return PQ(e,[{key:"debug",value:function(){for(var t,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];this.logCache.apply(this,[h0.DEBUG].concat(i)),e.disabled||(t=console).debug.apply(t,[this._prefix,p0()].concat(i))}},{key:"log",value:function(){for(var t,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];this.logCache.apply(this,[h0.LOG].concat(i)),e.disabled||(t=console).log.apply(t,[this._prefix,p0()].concat(i))}},{key:"warn",value:function(){for(var t,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];this.logCache.apply(this,[h0.WARN].concat(i)),e.disabled||(t=console).warn.apply(t,[this._prefix,p0()].concat(i))}},{key:"error",value:function(){for(var t,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];this.logCache.apply(this,[h0.ERROR].concat(i)),e.disabled||(t=console).error.apply(t,[this._prefix,p0()].concat(i))}},{key:"logCache",value:function(e){if(!(e<this.logCacheLevel)){var t="";try{for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var o=i.map((function(e){return v0(e)}));t=this._prefix+p0()+JSON.stringify(o)}catch(xX){return}if(e>=this.logCacheLevel&&(this.logSize+=t.length,this.logTextArray.push(t)),this.logSize>this.logMaxSize){var a=this.logTextArray.shift();this.logSize-=a.length}}}},{key:"getLogCache",value:function(){var e=this.logTextArray.join("\n");return this.reset(),e}},{key:"reset",value:function(){this.logTextArray=[],this.logSize=0}},{key:"table",value:function(){var t;e.disabled||(console.group(this._prefix),(t=console).table.apply(t,arguments),console.groupEnd())}},{key:"setLogLevel",value:function(e){this.logCacheLevel=e}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();function p0(){return(new Date).toLocaleString()}function g0(e){if("object"!==TQ(e))return e;var t=Object.prototype.toString.call(e).slice(8,-1);switch(t){case"Array":case"Uint8Array":case"ArrayBuffer":return t+"["+e.length+"]";case"Object":return"{}";default:return t}}function v0(e,t,n){n||(n=1),t||(t=2);var i={};if(!e||"object"!==TQ(e))return e;var r=Object.prototype.toString.call(e).slice(8,-1);if(!d0.includes(r))return r;if(!(n>t)){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n===t?i[o]=g0(e[o]):"object"===TQ(e[o])?i[o]=v0(e[o],t,n+1):i[o]=e[o]);return i}}IQ(f0,"disabled",!0);var y0="fetch",m0="xhr",_0="arraybuffer",b0="text",k0="json",w0=function(e){LQ(n,e);var t=HQ(n);function n(e,i,r,o){var a;return xQ(this,n),IQ(BQ(a=t.call(this,o)),"retryCount",0),IQ(BQ(a),"isTimeout",!1),IQ(BQ(a),"loaderType",y0),IQ(BQ(a),"startTime",0),IQ(BQ(a),"endTime",0),IQ(BQ(a),"options",{}),a.url=e,a.request=i,a.response=r,a}return PQ(n)}(NQ(Error)),E0=Object.prototype.toString;function T0(e){if("[object Object]"!==E0.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function S0(e){if(e&&null!==e[0]&&void 0!==e[0]&&(0!==e[0]||null!==e[1]&&void 0!==e[1])){var t="bytes="+e[0]+"-";return e[1]&&(t+=e[1]),t}}function C0(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function x0(e,t){if(e){if(!t)return e;var n,i=Object.keys(t).map((function(e){if(null!=(n=t[e]))return Array.isArray(n)?e+="[]":n=[n],n.map((function(t){var n;return n=t,"[object Date]"===E0.call(n)?t=t.toISOString():function(e){return null!==e&&"object"===TQ(e)}(t)&&(t=JSON.stringify(t)),"".concat(C0(e),"=").concat(C0(t))})).join("&")})).filter(Boolean).join("&");if(i){var r=e.indexOf("#");-1!==r&&(e=e.slice(0,r)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}}function O0(e,t,n,i,r,o,a,s,l,c,u){return r=null!=r?parseFloat(r):null,i=parseInt(i||"0",10),Number.isNaN(i)&&(i=0),{data:e,done:t,option:{range:l,vid:c,index:s,contentLength:i,age:r,startTime:o,firstByteTime:a,endTime:Date.now(),priOptions:u},response:n}}function P0(e,t){return Math.round(8*e*1e3/t/1024)}var I0="error",L0="core.ttfb",D0="core.loadstart",A0="core.loadresponseheaders",M0="core.loadretry",R0="core.metadataparsed",N0="real_time_speed",j0=2097152,B0=function(e){LQ(i,e);var t,n=HQ(i);function i(){var e;return xQ(this,i),IQ(BQ(e=n.call(this)),"_abortController",null),IQ(BQ(e),"_timeoutTimer",null),IQ(BQ(e),"_reader",null),IQ(BQ(e),"_response",null),IQ(BQ(e),"_aborted",!1),IQ(BQ(e),"_index",-1),IQ(BQ(e),"_range",null),IQ(BQ(e),"_receivedLength",0),IQ(BQ(e),"_running",!1),IQ(BQ(e),"_logger",null),IQ(BQ(e),"_vid",""),IQ(BQ(e),"_onProcessMinLen",0),IQ(BQ(e),"_onCancel",null),IQ(BQ(e),"_priOptions",null),e}return PQ(i,[{key:"load",value:function(e){var t,n=this,i=e.url,r=e.vid,o=e.timeout,a=e.responseType,s=e.onProgress,l=e.index,c=e.onTimeout,u=e.onCancel,h=e.range,d=e.transformResponse,f=e.request,p=e.params,g=e.logger,v=e.method,y=e.headers,m=e.body,_=e.mode,b=e.credentials,k=e.cache,w=e.redirect,E=e.referrer,T=e.referrerPolicy,S=e.onProcessMinLen,C=e.priOptions;this._logger=g,this._aborted=!1,this._onProcessMinLen=S,this._onCancel=u,this._abortController="undefined"!=typeof AbortController&&new AbortController,this._running=!0,this._index=l,this._range=h||[0,0],this._vid=r||i,this._priOptions=C||{};var x={method:v,headers:y,body:m,mode:_,credentials:b,cache:k,redirect:w,referrer:E,referrerPolicy:T,signal:null===(t=this._abortController)||void 0===t?void 0:t.signal},O=!1;clearTimeout(this._timeoutTimer),i=x0(i,p);var P=S0(h);P&&(y=f?f.headers:x.headers=x.headers||(Headers?new Headers:{}),Headers&&y instanceof Headers?y.append("Range",P):y.Range=P),o&&(this._timeoutTimer=setTimeout((function(){if(O=!0,n.cancel(),c){var e=new w0(i,x,null,"timeout");e.isTimeout=!0,c(e,{index:n._index,range:n._range,vid:n._vid,priOptions:n._priOptions})}}),o));var I=Date.now();return this._logger.debug("[fetch load start], index,",l,",range,",h),new Promise((function(e,t){fetch(f||i,f?void 0:x).then(function(){var r=CQ(EQ().mark((function r(o){var c,u,f,p;return EQ().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(clearTimeout(n._timeoutTimer),n._response=o,!n._aborted&&n._running){r.next=4;break}return r.abrupt("return");case 4:if(d&&(o=d(o,i)||o),o.ok){r.next=7;break}throw new w0(i,x,o,"bad network response");case 7:if(c=Date.now(),a!==b0){r.next=15;break}return r.next=11,o.text();case 11:u=r.sent,n._running=!1,r.next=37;break;case 15:if(a!==k0){r.next=22;break}return r.next=18,o.json();case 18:u=r.sent,n._running=!1,r.next=37;break;case 22:if(!s){r.next=29;break}return n.resolve=e,n.reject=t,n._loadChunk(o,s,I,c),r.abrupt("return");case 29:return r.next=31,o.arrayBuffer();case 31:u=r.sent,u=new Uint8Array(u),n._running=!1,f=Date.now()-I,p=P0(u.byteLength,f),n.emit(N0,{speed:p,len:u.byteLength,time:f,vid:n._vid,index:n._index,range:n._range,priOptions:n._priOptions});case 37:n._logger.debug("[fetch load end], index,",l,",range,",h),e(O0(u,!0,o,o.headers.get("Content-Length"),o.headers.get("age"),I,c,l,h,n._vid,n._priOptions));case 39:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()).catch((function(e){var r;clearTimeout(n._timeoutTimer),n._running=!1,n._aborted&&!O||((e=e instanceof w0?e:new w0(i,x,null,null===(r=e)||void 0===r?void 0:r.message)).startTime=I,e.endTime=Date.now(),e.isTimeout=O,e.options={index:n._index,range:n._range,vid:n._vid,priOptions:n._priOptions},t(e))}))}))}},{key:"cancel",value:(t=CQ(EQ().mark((function e(){return EQ().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._aborted){e.next=2;break}return e.abrupt("return");case 2:if(this._aborted=!0,this._running=!1,!this._response){e.next=14;break}if(e.prev=5,!this._reader){e.next=9;break}return e.next=9,this._reader.cancel();case 9:e.next=13;break;case 11:e.prev=11,e.t0=e.catch(5);case 13:this._response=this._reader=null;case 14:if(this._abortController){try{this._abortController.abort()}catch(w7){}this._abortController=null}this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions});case 16:case"end":return e.stop()}}),e,this,[[5,11]])}))),function(){return t.apply(this,arguments)})},{key:"_loadChunk",value:function(e,t,n,i){var r=this;if(!e.body||!e.body.getReader){this._running=!1;var o=new w0(e.url,"",e,"onProgress of bad response.body.getReader");return o.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},void this.reject(o)}this._onProcessMinLen>0&&(this._cache=new Uint8Array(j0),this._writeIdx=0);var a,s,l,c=this._reader=e.body.getReader(),u=function(){var o=CQ(EQ().mark((function o(){var h,d,f,p,g,v,y,m;return EQ().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return s=Date.now(),o.prev=1,o.next=4,c.read();case 4:a=o.sent,l=Date.now(),o.next=13;break;case 8:return o.prev=8,o.t0=o.catch(1),l=Date.now(),r._aborted||(r._running=!1,o.t0.options={index:r._index,range:r._range,vid:r._vid,priOptions:r._priOptions},r.reject(o.t0)),o.abrupt("return");case 13:if(d=(null===(h=r._range)||void 0===h?void 0:h.length)>0?r._range[0]:0,f=d+r._receivedLength,!r._aborted){o.next=19;break}return r._running=!1,t(void 0,!1,{range:[f,f],vid:r._vid,index:r._index,startTime:s,endTime:l,st:n,firstByteTime:i,priOptions:r._priOptions},e),o.abrupt("return");case 19:p=a.value?a.value.byteLength:0,r._receivedLength+=p,r._logger.debug("【fetchLoader,onProgress call】,task,",r._range,", start,",f,", end,",d+r._receivedLength,", done,",a.done),r._onProcessMinLen>0?r._writeIdx+p>=r._onProcessMinLen||a.done?((g=new Uint8Array(r._writeIdx+p)).set(r._cache.slice(0,r._writeIdx),0),p>0&&g.set(a.value,r._writeIdx),r._writeIdx=0,r._logger.debug("【fetchLoader,onProgress enough】,done,",a.done,",len,",g.byteLength,", writeIdx,",r._writeIdx)):p>0&&r._writeIdx+p<j0?(r._cache.set(a.value,r._writeIdx),r._writeIdx+=p,r._logger.debug("【fetchLoader,onProgress cache】,len,",p,", writeIdx,",r._writeIdx)):p>0&&(v=new Uint8Array(r._writeIdx+p+2048),r._logger.debug("【fetchLoader,onProgress extra start】,size,",r._writeIdx+p+2048,", datalen,",p,", writeIdx,",r._writeIdx),v.set(r._cache.slice(0,r._writeIdx),0),p>0&&v.set(a.value,r._writeIdx),r._writeIdx+=p,delete r._cache,r._cache=v,r._logger.debug("【fetchLoader,onProgress extra end】,len,",p,", writeIdx,",r._writeIdx)):g=a.value,(g&&g.byteLength>0||a.done)&&t(g,a.done,{range:[r._range[0]+r._receivedLength-(g?g.byteLength:0),r._range[0]+r._receivedLength],vid:r._vid,index:r._index,startTime:s,endTime:l,st:n,firstByteTime:i,priOptions:r._priOptions},e),a.done?(y=Date.now()-n,m=P0(r._receivedLength,y),r.emit(N0,{speed:m,len:r._receivedLength,time:y,vid:r._vid,index:r._index,range:r._range,priOptions:r._priOptions}),r._running=!1,r._logger.debug("[fetchLoader onProgress end],task,",r._range,",done,",a.done),r.resolve(O0(a,!0,e,e.headers.get("Content-Length"),e.headers.get("age"),n,i,r._index,r._range,r._vid,r._priOptions))):u();case 25:case"end":return o.stop()}}),o,null,[[1,8]])})));return function(){return o.apply(this,arguments)}}();u()}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}}],[{key:"isSupported",value:function(){return!("undefined"==typeof fetch)}}]),i}(BM);var U0=function(e){LQ(n,e);var t=HQ(n);function n(){var e;return xQ(this,n),IQ(BQ(e=t.call(this)),"_xhr",null),IQ(BQ(e),"_aborted",!1),IQ(BQ(e),"_timeoutTimer",null),IQ(BQ(e),"_range",null),IQ(BQ(e),"_receivedLength",0),IQ(BQ(e),"_url",null),IQ(BQ(e),"_onProgress",null),IQ(BQ(e),"_index",-1),IQ(BQ(e),"_headers",null),IQ(BQ(e),"_currentChunkSizeKB",384),IQ(BQ(e),"_timeout",null),IQ(BQ(e),"_xhr",null),IQ(BQ(e),"_withCredentials",null),IQ(BQ(e),"_startTime",-1),IQ(BQ(e),"_loadCompleteResolve",null),IQ(BQ(e),"_loadCompleteReject",null),IQ(BQ(e),"_runing",!1),IQ(BQ(e),"_logger",!1),IQ(BQ(e),"_vid",""),IQ(BQ(e),"_responseType",void 0),IQ(BQ(e),"_credentials",void 0),IQ(BQ(e),"_method",void 0),IQ(BQ(e),"_transformResponse",void 0),IQ(BQ(e),"_firstRtt",void 0),IQ(BQ(e),"_onCancel",null),IQ(BQ(e),"_priOptions",null),e}return PQ(n,[{key:"load",value:function(e){var t=this;clearTimeout(this._timeoutTimer),this._logger=e.logger,this._range=e.range,this._onProgress=e.onProgress,this._index=e.index,this._headers=e.headers,this._withCredentials="include"===e.credentials||"same-origin"===e.credentials,this._body=e.body||null,e.method&&(this._method=e.method),this._timeout=e.timeout||null,this._runing=!0,this._vid=e.vid||e.url,this._responseType=e.responseType,this._firstRtt=-1,this._onTimeout=e.onTimeout,this._onCancel=e.onCancel,this._request=e.request,this._priOptions=e.priOptions||{},this._logger.debug("【xhrLoader task】, range",this._range),this._url=x0(e.url,e.params);var n=Date.now();return new Promise((function(e,n){t._loadCompleteResolve=e,t._loadCompleteReject=n,t._startLoad()})).catch((function(e){if(clearTimeout(t._timeoutTimer),t._runing=!1,!t._aborted)throw(e=e instanceof w0?e:new w0(t._url,t._request)).startTime=n,e.endTime=Date.now(),e.options={index:t._index,vid:t._vid,priOptions:t._priOptions},e}))}},{key:"_startLoad",value:function(){var e=null;if(this._responseType===_0&&this._range&&this._range.length>1)if(this._onProgress){this._firstRtt=-1;var t=1024*this._currentChunkSizeKB,n=this._range[0]+this._receivedLength,i=this._range[1];t<this._range[1]-n&&(i=n+t),e=[n,i],this._logger.debug("[xhr_loader->],tast :",this._range,", SubRange, ",e)}else e=this._range,this._logger.debug("[xhr_loader->],tast :",this._range,", allRange, ",e);this._internalOpen(e)}},{key:"_internalOpen",value:function(e){var t=this;try{this._startTime=Date.now();var n=this._xhr=new XMLHttpRequest;n.open(this._method||"GET",this._url,!0),n.responseType=this._responseType,this._timeout&&(n.timeout=this._timeout),n.withCredentials=this._withCredentials,n.onload=this._onLoad.bind(this),n.onreadystatechange=this._onReadyStatechange.bind(this),n.onerror=function(e){var n,i,r;t._running=!1;var o=new w0(t._url,t._request,null==e||null===(n=e.currentTarget)||void 0===n?void 0:n.response,"xhr.onerror.status:"+(null==e||null===(i=e.currentTarget)||void 0===i?void 0:i.status)+",statusText,"+(null==e||null===(r=e.currentTarget)||void 0===r?void 0:r.statusText));o.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(o)},n.ontimeout=function(e){t.cancel();var n=new w0(t._url,t._request,{status:408},"timeout");t._onTimeout&&(n.isTimeout=!0,t._onTimeout(n,{index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions})),n.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(n)};var i=this._headers||{},r=S0(e);r&&(i.Range=r),i&&Object.keys(i).forEach((function(e){n.setRequestHeader(e,i[e])})),this._logger.debug("[xhr.send->] tast,",this._range,",load sub range, ",e),n.send(this._body)}catch(xX){xX.options={index:this._index,range:e,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(xX)}}},{key:"_onReadyStatechange",value:function(e){2===e.target.readyState&&this._firstRtt<0&&(this._firstRtt=Date.now())}},{key:"_onLoad",value:function(e){var t,n=e.target.status;if(n<200||n>299){var i=new w0(this._url,null,wQ(wQ({},e.target.response),{},{status:n}),"bad response,status:"+n);return i.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(i)}var r,o=null,a=!1,s=(null===(t=this._range)||void 0===t?void 0:t.length)>0?this._range[0]:0;if(this._responseType===_0){var l,c=new Uint8Array(e.target.response);if(r=s+this._receivedLength,c&&c.byteLength>0){this._receivedLength+=c.byteLength;var u=Date.now()-this._startTime,h=P0(this._receivedLength,u);this.emit(N0,{speed:h,len:this._receivedLength,time:u,vid:this._vid,index:this._index,range:[r,s+this._receivedLength],priOptions:this._priOptions})}o=c,a=!((null===(l=this._range)||void 0===l?void 0:l.length)>1&&this._range[1]&&this._receivedLength<this._range[1]-this._range[0]),this._logger.debug("[xhr load done->], tast :",this._range,", start",r,"end ",s+this._receivedLength,",dataLen,",c?c.byteLength:0,",receivedLength",this._receivedLength,",index,",this._index,", done,",a)}else a=!0,o=e.target.response;var d={ok:n>=200&&n<300,status:n,statusText:this._xhr.statusText,url:this._xhr.responseURL,headers:this._getHeaders(this._xhr),body:this._xhr.response};this._transformResponse&&(d=this._transformResponse(d,this._url)||d),this._onProgress&&this._onProgress(o,a,{index:this._index,vid:this._vid,range:[r,s+this._receivedLength],startTime:this._startTime,endTime:Date.now(),priOptions:this._priOptions},d),a?(this._runing=!1,this._loadCompleteResolve&&this._loadCompleteResolve(O0(this._onProgress?null:o,a,d,d.headers["content-length"],d.headers.age,this._startTime,this._firstRtt,this._index,this._range,this._vid,this._priOptions))):this._startLoad()}},{key:"cancel",value:function(){if(!this._aborted)return this._aborted=!0,this._runing=!1,GQ(DQ(n.prototype),"removeAllListeners",this).call(this),this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions}),this._xhr?this._xhr.abort():void 0}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}},{key:"_getHeaders",value:function(e){var t,n={},i=zQ(e.getAllResponseHeaders().trim().split("\r\n"));try{for(i.s();!(t=i.n()).done;){var r=t.value.split(": ");n[r[0].toLowerCase()]=r.slice(1).join(": ")}}catch(o){i.e(o)}finally{i.f()}return n}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),n}(BM),H0=["retry","retryDelay","onRetryError","transformError"],F0=function(){function e(t,n){var i,r,o;xQ(this,e),this.promise=((o=new Promise((function(e,t){i=e,r=t}))).used=!1,o.resolve=function(){return o.used=!0,i.apply(void 0,arguments)},o.reject=function(){return o.used=!0,r.apply(void 0,arguments)},o),this.alive=!!n.onProgress,!n.logger&&(n.logger=new f0("Loader")),this._loaderType=t,this._loader=t===y0&&window.fetch?new B0:new U0,this._config=n,this._retryCount=0,this._retryTimer=null,this._canceled=!1,this._retryCheckFunc=n.retryCheckFunc,this._logger=n.logger}var t;return PQ(e,[{key:"exec",value:function(){var e=this,t=this._config,n=t.retry,i=t.retryDelay,r=t.onRetryError,o=t.transformError,a=jQ(t,H0),s=function(){var t=CQ(EQ().mark((function t(){var l,c,u;return EQ().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._loader.load(a);case 3:l=t.sent,e.promise.resolve(l),t.next=27;break;case 7:if(t.prev=7,t.t0=t.catch(0),e._loader.running=!1,e._logger.debug("[task request catch err]",t.t0),!e._canceled){t.next=13;break}return t.abrupt("return");case 13:if(t.t0.loaderType=e._loaderType,t.t0.retryCount=e._retryCount,c=t.t0,o&&(c=o(c)||c),r&&e._retryCount>0&&r(c,e._retryCount,{index:a.index,vid:a.vid,range:a.range,priOptions:a.priOptions}),e._retryCount++,u=!0,e._retryCheckFunc&&(u=e._retryCheckFunc(t.t0)),!(u&&e._retryCount<=n)){t.next=26;break}return clearTimeout(e._retryTimer),e._logger.debug("[task request setTimeout],retry",e._retryCount,",retry range,",a.range),e._retryTimer=setTimeout(s,i),t.abrupt("return");case 26:e.promise.reject(c);case 27:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return s(),this.promise}},{key:"cancel",value:(t=CQ(EQ().mark((function e(){return EQ().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(this._retryTimer),this._canceled=!0,this._loader.running=!1,e.abrupt("return",this._loader.cancel());case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"running",get:function(){return this._loader&&this._loader.running}},{key:"loader",get:function(){return this._loader}}]),e}();function G0(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){return setTimeout(t,e)}))}var V0=function(e){LQ(i,e);var t,n=HQ(i);function i(e){var t;return xQ(this,i),IQ(BQ(t=n.call(this,e)),"type",y0),IQ(BQ(t),"_queue",[]),IQ(BQ(t),"_alive",[]),IQ(BQ(t),"_currentTask",null),IQ(BQ(t),"_config",void 0),t._config=function(e){return wQ({loaderType:y0,retry:0,retryDelay:0,timeout:0,request:null,onTimeout:void 0,onProgress:void 0,onRetryError:void 0,transformRequest:void 0,transformResponse:void 0,transformError:void 0,responseType:b0,range:void 0,url:"",params:void 0,method:"GET",headers:{},body:void 0,mode:void 0,credentials:void 0,cache:void 0,redirect:void 0,referrer:void 0,referrerPolicy:void 0,integrity:void 0,onProcessMinLen:0},e)}(e),t._config.loaderType!==m0&&B0.isSupported()||(t.type=m0),t.log=e.logger,t}return PQ(i,[{key:"isFetch",value:function(){return this.type===y0}},{key:"load",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof e&&e?n=e:n.url=e||n.url||this._config.url,(n=Object.assign({},this._config,n)).params&&(n.params=Object.assign({},n.params)),n.headers&&T0(n.headers)&&(n.headers=Object.assign({},n.headers)),n.body&&T0(n.body)&&(n.body=Object.assign({},n.body)),n.transformRequest&&(n=n.transformRequest(n)||n),n.logger=this.log;var i=new F0(this.type,n);return i.loader.on(N0,(function(e){t.emit(N0,e)})),this._queue.push(i),1!==this._queue.length||this._currentTask&&this._currentTask.running||this._processTask(),i.promise}},{key:"cancel",value:(t=CQ(EQ().mark((function e(){var t;return EQ().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._queue.map((function(e){return e.cancel()})).concat(this._alive.map((function(e){return e.cancel()}))),this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],e.next=6,Promise.all(t);case 6:return e.next=8,G0();case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"_processTask",value:function(){var e=this;if(this._currentTask=this._queue.shift(),this._currentTask){this._currentTask.alive&&this._alive.push(this._currentTask);var t=this._currentTask.exec().catch((function(e){}));t&&"function"==typeof t.finally&&t.finally((function(){var t,n;null!==(t=e._currentTask)&&void 0!==t&&t.alive&&(null===(n=e._alive)||void 0===n?void 0:n.length)>0&&(e._alive=e._alive.filter((function(t){return t&&t!==e._currentTask}))),e._processTask()}))}}}],[{key:"isFetchSupport",value:function(){return B0.isSupported()}}]),i}(BM);uL("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),SL);var z0="core.rtcstatechange",W0={},K0={},q0={exports:{}},Y0=q0.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),t+=null!=e["network-id"]?" network-id %d":"%v",t+=null!=e["network-cost"]?" network-cost %d":"%v"}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(null!=e.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=null!=e.id?"id=%s %s":"%v%s",t+=null!=e.mediaClockValue?"=%s":"",t+=null!=e.rateNumerator?" rate=%s":"",t+=null!=e.rateDenominator?"/%s":""}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};Object.keys(Y0).forEach((function(e){Y0[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))})),function(e){var t=function(e){return String(Number(e))===e?Number(e):e},n=function(e,n,i){var r=e.name&&e.names;e.push&&!n[e.push]?n[e.push]=[]:r&&!n[e.name]&&(n[e.name]={});var o=e.push?{}:r?n[e.name]:n;!function(e,n,i,r){if(r&&!i)n[r]=t(e[1]);else for(var o=0;o<i.length;o+=1)null!=e[o+1]&&(n[i[o]]=t(e[o+1]))}(i.match(e.reg),o,e.names,e.name),e.push&&n[e.push].push(o)},i=q0.exports,r=RegExp.prototype.test.bind(/^([a-z])=(.*)/);e.parse=function(e){var t={},o=[],a=t;return e.split(/(\r\n|\r|\n)/).filter(r).forEach((function(e){var t=e[0],r=e.slice(2);"m"===t&&(o.push({rtp:[],fmtp:[]}),a=o[o.length-1]);for(var s=0;s<(i[t]||[]).length;s+=1){var l=i[t][s];if(l.reg.test(r))return n(l,a,r)}})),t.media=o,t};var o=function(e,n){var i=n.split(/=(.+)/,2);return 2===i.length?e[i[0]]=t(i[1]):1===i.length&&n.length>1&&(e[i[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(o,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(" ").map(Number)},e.parseRemoteCandidates=function(e){for(var n=[],i=e.split(" ").map(t),r=0;r<i.length;r+=3)n.push({component:i[r],ip:i[r+1],port:i[r+2]});return n},e.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(o,{})}))},e.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var n,i=!1;return"~"!==e[0]?n=t(e):(n=t(e.substring(1,e.length)),i=!0),{scid:n,paused:i}}))}))}}(K0);var $0=q0.exports,X0=/%[sdv%]/g,J0=function(e){var t=1,n=arguments,i=n.length;return e.replace(X0,(function(e){if(t>=i)return e;var r=n[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(r);case"%d":return Number(r);case"%v":return""}}))},Z0=function(e,t,n){var i=[e+"="+(t.format instanceof Function?t.format(t.push?n:n[t.name]):t.format)];if(t.names)for(var r=0;r<t.names.length;r+=1){var o=t.names[r];t.name?i.push(n[t.name][o]):i.push(n[t.names[r]])}else i.push(n[t.name]);return J0.apply(null,i)},Q0=["v","o","s","i","u","e","p","c","b","t","r","z","a"],e1=["i","c","b","a"],t1=K0,n1=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach((function(e){null==e.payloads&&(e.payloads="")}));var n=t.outerOrder||Q0,i=t.innerOrder||e1,r=[];return n.forEach((function(t){$0[t].forEach((function(n){n.name in e&&null!=e[n.name]?r.push(Z0(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){r.push(Z0(t,n,e))}))}))})),e.media.forEach((function(e){r.push(Z0("m",$0.m[0],e)),i.forEach((function(t){$0[t].forEach((function(n){n.name in e&&null!=e[n.name]?r.push(Z0(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){r.push(Z0(t,n,e))}))}))}))})),r.join("\r\n")+"\r\n"};W0.write=n1,W0.parse=t1.parse,W0.parseParams=t1.parseParams,W0.parseFmtpConfig=t1.parseFmtpConfig,W0.parsePayloads=t1.parsePayloads,W0.parseRemoteCandidates=t1.parseRemoteCandidates,W0.parseImageAttributes=t1.parseImageAttributes,W0.parseSimulcastStreamList=t1.parseSimulcastStreamList;var i1=new f0("rts"),r1=function(e){pQ(r,e);var t,n,i=_Q(r);function r(e){var t;return uQ(this,r),fQ(yQ(t=i.call(this)),"_url",""),fQ(yQ(t),"_pc",null),fQ(yQ(t),"_audioTransceicer",null),fQ(yQ(t),"_videoTransceicer",null),fQ(yQ(t),"_mediaStream",null),fQ(yQ(t),"_media",null),fQ(yQ(t),"_opts",null),fQ(yQ(t),"_loader",null),fQ(yQ(t),"_retry",0),fQ(yQ(t),"_waitingTimer",0),fQ(yQ(t),"_rctConnectStartTs",0),fQ(yQ(t),"_onTrack",(function(e){if(i1.log("addTrack: ",e.track,e.streams),t["_".concat(e.track.kind)]=e.track,!t._mediaStream){t._mediaStream=new MediaStream,t._media.srcObject=t._mediaStream;var n=t._media.play();n&&n.catch&&n.catch((function(e){}))}t._mediaStream.addTrack(e.track)})),fQ(yQ(t),"_mockWaitingByTimeupdate",(function(){var e,n;"connected"!==(null===(e=t._pc)||void 0===e?void 0:e.connectionState)&&"connected"!==(null===(n=t._pc)||void 0===n?void 0:n.iceConnectionState)||(clearTimeout(t._waitingTimer),t._waitingTimer=setTimeout((function(){t._media.paused||t.emit("waiting")}),t._opts.stallInterval))})),fQ(yQ(t),"_onLoadedData",(function(){i1.log("loadeddata emit"),t.getStatsSnapshoot().then((function(e){t.emit(R0,{type:"video",elapsed:Date.now()-t._rctConnectStartTs,meta:e.video}),t.emit(R0,{type:"audio",elapsed:Date.now()-t._rctConnectStartTs,meta:e.audio})}))})),fQ(yQ(t),"_onLoaderRetry",(function(e,n){t.emit(M0,{error:QQ.network(e),retryTime:n})})),t._opts=function(e){return aQ({retryCount:0,retryDelay:1e3,loadTimeout:5e3,stallInterval:400,delayHint:0},e)}(e),t._media=t._opts.media,t._loader=new V0(aQ(aQ({},e.fetchOptions),{},{responseType:"json",method:"POST",retry:t._opts.retryCount,retryDelay:t._opts.retryDelay,timeout:t._opts.loadTimeout,onRetryError:t._onLoaderRetry})),t._retry=t._opts.retryCount,t._bindMediaEvent(),t}return dQ(r,[{key:"pc",get:function(){return this._pc}},{key:"audioTrack",get:function(){return this._audio}},{key:"videoTack",get:function(){return this._video}},{key:"getStats",value:function(){return e=this._pc,new Promise((function(t){var n;null===(n=e.getStats(null))||void 0===n||n.then((function(e){var n,i;t((i=[],(n=e).forEach((function(e){"inbound-rtp"===e.type&&i.push(e)})),i.map((function(e){var t=n.get(e.codecId),i=n.get(e.trackId);return{type:e.mediaType,inboundRtp:e,codec:t,track:i}}))))}))})).catch((function(){}));var e}},{key:"getStatsSnapshoot",value:function(){return this.getStats().then((function(e){return function(e){var t,n,i,r,o,a,s,l,c,u,h,d,f,p,g,v,y,m,_,b,k,w,E,T,S,C,x,O,P,I=null==e?void 0:e.filter((function(e){return"video"===e.type}))[0],L=null==e?void 0:e.filter((function(e){return"audio"===e.type}))[0];return{video:I?{codec:null===(t=I.codec)||void 0===t?void 0:t.mimeType,payloadType:null===(n=I.codec)||void 0===n?void 0:n.payloadType,sdpFmtpLine:null===(i=I.codec)||void 0===i?void 0:i.sdpFmtpLine,bytesReceived:null===(r=I.inboundRtp)||void 0===r?void 0:r.bytesReceived,firCount:null===(o=I.inboundRtp)||void 0===o?void 0:o.firCount,pliCount:null===(a=I.inboundRtp)||void 0===a?void 0:a.pliCount,frameHeight:null===(s=I.inboundRtp)||void 0===s?void 0:s.frameHeight,frameWidth:null===(l=I.inboundRtp)||void 0===l?void 0:l.frameWidth,framesDecoded:null===(c=I.inboundRtp)||void 0===c?void 0:c.framesDecoded,framesDropped:null===(u=I.inboundRtp)||void 0===u?void 0:u.framesDropped,framesPerSecond:null===(h=I.inboundRtp)||void 0===h?void 0:h.framesPerSecond,framesReceived:null===(d=I.inboundRtp)||void 0===d?void 0:d.framesReceived,jitter:null===(f=I.inboundRtp)||void 0===f?void 0:f.jitter,jitterBufferDelay:null===(p=I.inboundRtp)||void 0===p?void 0:p.jitterBufferDelay,keyFramesDecoded:null===(g=I.inboundRtp)||void 0===g?void 0:g.keyFramesDecoded,nackCount:null===(v=I.inboundRtp)||void 0===v?void 0:v.nackCount,packetsLost:null===(y=I.inboundRtp)||void 0===y?void 0:y.packetsLost,packetsReceived:null===(m=I.inboundRtp)||void 0===m?void 0:m.packetsReceived}:void 0,audio:L?{codec:null===(_=L.codec)||void 0===_?void 0:_.mimeType,payloadType:null===(b=L.codec)||void 0===b?void 0:b.payloadType,sdpFmtpLine:null===(k=L.codec)||void 0===k?void 0:k.sdpFmtpLine,bytesReceived:null===(w=L.inboundRtp)||void 0===w?void 0:w.bytesReceived,audioLevel:null===(E=L.inboundRtp)||void 0===E?void 0:E.audioLevel,jitter:null===(T=L.inboundRtp)||void 0===T?void 0:T.jitter,jitterBufferDelay:null===(S=L.inboundRtp)||void 0===S?void 0:S.jitterBufferDelay,packetsLost:null===(C=L.inboundRtp)||void 0===C?void 0:C.packetsLost,packetsReceived:null===(x=L.inboundRtp)||void 0===x?void 0:x.packetsReceived,totalSamplesDuration:null===(O=L.inboundRtp)||void 0===O?void 0:O.totalSamplesDuration,totalSamplesReceived:null===(P=L.inboundRtp)||void 0===P?void 0:P.totalSamplesReceived}:void 0}}(e)}))}},{key:"load",value:(n=cQ(sQ().mark((function e(t){var n,i=this;return sQ().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._disconnect(),this._url=t,this._retry=this._opts.retryCount,n=this._pc,e.prev=4,this._pc=new RTCPeerConnection,this._bindRTCEvents(),e.next=9,this._connect(t);case 9:n&&n.close(),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(4),setTimeout((function(){return i._emitError(QQ.create(JQ,null,e.t0))}));case 15:case"end":return e.stop()}}),e,this,[[4,12]])}))),function(e){return n.apply(this,arguments)})},{key:"switchURL",value:function(e){this.load(e||this._url)}},{key:"_bindRTCEvents",value:function(){var e=this,t=this._pc;t.addEventListener("track",this._onTrack),t.addEventListener("connectionstatechange",(function(){if(i1.warn("onconnectionstatechange:",t.connectionState),e.emit(z0,{state:t.connectionState,url:e._url}),"disconnected"!==t.connectionState&&"failed"!==t.connectionState||e.emit("waiting"),"failed"===t.connectionState){if(0===e._retry)return void e._emitError(QQ.network(new Error("rtc connect failed")));e._retry--,e.load(e._url)}"connected"===t.connectionState&&e.emit(L0,{url:e._url,responseUrl:e._url,elapsed:Date.now()-e._rctConnectStartTs})}))}},{key:"_bindMediaEvent",value:function(){this._media.addEventListener("timeupdate",this._mockWaitingByTimeupdate),this._media.addEventListener("loadeddata",this._onLoadedData)}},{key:"_connect",value:(t=cQ(sQ().mark((function e(){var t,n,i,r,o,a,s,l,c,u;return sQ().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=this._pc).addTransceiver){e.next=11;break}return this._audioTransceicer=t.addTransceiver("audio",{direction:"recvonly"}),this._videoTransceicer=t.addTransceiver("video",{direction:"recvonly"}),(i=this._opts.delayHint)&&(this._audioTransceicer.receiver.playoutDelayHint=i,this._audioTransceicer.receiver.jitterBufferDelayHint=i,this._videoTransceicer.receiver.playoutDelayHint=i,this._videoTransceicer.receiver.jitterBufferDelayHint=i),e.next=8,t.createOffer();case 8:n=e.sent,e.next=14;break;case 11:return e.next=13,t.createOffer({iceRestart:!0,offerToReceiveAudio:!0,offerToReceiveVideo:!0});case 13:n=e.sent;case 14:return i1.log("local offer"),i1.log(n.sdp),(r=W0.parse(n.sdp)).media.filter((function(e){return"audio"===e.type})).forEach((function(e){var t,n=null===(t=e.rtp.filter((function(e){return"opus"===e.codec}))[0])||void 0===t?void 0:t.payload;n&&e.fmtp.forEach((function(e){e.payload===n&&(e.config="minptime=10;stereo=1;useinbandfec=1")}))})),n.sdp=W0.write(r),i1.log("local offer modified:\n",n.sdp),e.next=22,t.setLocalDescription(n);case 22:return e.prev=22,a=/_?session_id=([^&$]+)/.exec(this._url),s=a?a[1]:Date.now()+"",this.emit(D0,{url:this._url}),this._rctConnectStartTs=Date.now(),e.next=29,this._loader.load(this._url,{body:JSON.stringify({sessionId:s,version:"1.0-html",localSdp:n})});case 29:if(l=e.sent,this.emit(A0,{headers:l.response.headers}),200===(null==(c=null==l?void 0:l.data)?void 0:c.code)){e.next=34;break}throw new Error("code: ".concat(null==c?void 0:c.code,", message:").concat(null==c?void 0:c.message));case 34:return i1.log("answer:"),i1.log(null===(o=c.remoteSdp)||void 0===o?void 0:o.sdp),(u=W0.parse(c.remoteSdp.sdp)).media.forEach((function(e){e.fingerprint.hash=e.fingerprint.hash.toUpperCase()})),c.remoteSdp.sdp=W0.write(u),i1.log("answer modified:\n",c.remoteSdp.sdp),e.next=42,this._pc.setRemoteDescription(c.remoteSdp);case 42:e.next=47;break;case 44:e.prev=44,e.t0=e.catch(22),this._emitError(QQ.network(e.t0));case 47:case"end":return e.stop()}}),e,this,[[22,44]])}))),function(){return t.apply(this,arguments)})},{key:"_disconnect",value:function(){this._audioTransceicer=null,this._videoTransceicer=null,this._mediaStream=null}},{key:"_emitError",value:function(e){this.emit(I0,e)}},{key:"destroy",value:function(){var e;this._disconnect(),null===(e=this._media)||void 0===e||e.removeEventListener("timeupdate",this._mockWaitingByTimeupdate),this._media&&(this._media.srcObject=null),this._loader=null,this._media=null}}],[{key:"enableLogger",value:function(){f0.enable()}},{key:"disableLogger",value:function(){f0.disable()}}]),r}(BM);try{localStorage.getItem("xgd")?r1.enableLogger():r1.disableLogger()}catch(w7){}function o1(){return!(!window.RTCPeerConnection||!window.RTCPeerConnection.prototype.addTransceiver)}var a1=function(e){pQ(n,e);var t=_Q(n);function n(){var e;uQ(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return fQ(yQ(e=t.call.apply(t,[this].concat(r))),"_rts",null),fQ(yQ(e),"_rtsOpts",null),fQ(yQ(e),"_init",(function(){var t;null===(t=e._rts)||void 0===t||t.destroy();var n=e.player.config,i=n.rts||{};e._rtsOpts=i,e._rts=new r1(aQ({media:e.player.video},i)),e._rts.load(n.url)})),fQ(yQ(e),"_onSwitchURL",(function(t){e._rts&&(e.player.config.url=t,e._rts.switchURL(t))})),e}return dQ(n,[{key:"pc",get:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.pc}},{key:"videoTrack",get:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.videoTack}},{key:"audioTrack",get:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.audioTrack}},{key:"core",get:function(){return this._rts}},{key:"version",get:function(){return"0.1.11"}},{key:"beforePlayerInit",value:function(){var e,t=this;this._init(),this.player.switchURL=this._onSwitchURL,null===(e=this.player)||void 0===e||e.useHooks("replay",(function(){var e;return null===(e=t._rts)||void 0===e?void 0:e.switchURL()})),this.on(qN,this._onSwitchURL),this.on(KN,this.destroy),this._transErrorEvent(),this._transCoreEvent(D0),this._transCoreEvent(L0),this._transCoreEvent(A0),this._transCoreEvent(M0),this._transCoreEvent(R0),this._transCoreEvent(z0);try{Dj.defineGetterOrSetter(this.player,{__url:{get:function(){try{return URL.createObjectURL(new MediaSource)}catch(xX){var e,n;null!==(e=t.player)&&void 0!==e&&null!==(n=e.video)&&void 0!==n&&n.srcObject||(t.player.video.srcObject=new MediaStream)}}}})}catch(xX){}}},{key:"getStats",value:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.getStats()}},{key:"getStatsSnapshoot",value:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.getStatsSnapshoot()}},{key:"_transErrorEvent",value:function(){var e=this;this._rts.on(I0,(function(t){if(e.player){var n=new bN(e.player,t),i=e._rtsOpts,r=i.backupConstruct,o=i.backupURL;if(o){var a,s=e.player;s.emit("core_event",aQ(aQ({},{url:s.config.url,code:n.errorCode,message:n.message,httpCode:n.httpCode}),{},{eventName:"core.degrade"})),s.emit("degrade",{url:s.config.url,code:n.errorCode,message:n.message,httpCode:n.httpCode}),s.unRegisterPlugin("rts"),e._rts=null,s.rts=null,null!==(a=s.video)&&void 0!==a&&a.srcObject&&(s.video.srcObject=null),s.config.url=o,r?s.registerPlugin(r).beforePlayerInit():s.video.src=o}else e.player.emit(SN,n)}})),this._rts.on("waiting",(function(){var t;null===(t=e.player)||void 0===t||t.emit("waiting")}))}},{key:"_transCoreEvent",value:function(e){var t=this;this._rts.on(e,(function(n){t.player&&t.player.emit("core_event",aQ(aQ({},n),{},{eventName:e}))}))}},{key:"destroy",value:function(){var e;null===(e=this._rts)||void 0===e||e.destroy()}}],[{key:"pluginName",get:function(){return"rts"}},{key:"isSupported",value:function(){return o1()}},{key:"getCapacity",value:function(){return function(){if(!o1())return Promise.reject("RTCPeerConnection no support");var e;try{(e=new RTCPeerConnection({sdpSemantics:"unified-plan"})).addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"})}catch(xX){return Promise.reject(null==xX?void 0:xX.message)}return e.createOffer().then((function(t){var n,i,r,o,a=W0.parse(t.sdp),s=null===(n=a.media)||void 0===n?void 0:n.filter((function(e){return"video"===e.type}))[0],l=null===(i=a.media)||void 0===i?void 0:i.filter((function(e){return"audio"===e.type}))[0],c=null==s||null===(r=s.rtp)||void 0===r?void 0:r.filter((function(e){return"VP8"===e.codec||"VP9"===e.codec||"H264"===e.codec})),u=null==l||null===(o=l.rtp)||void 0===o?void 0:o.filter((function(e){return"opus"===e.codec})),h=null==s?void 0:s.fmtp,d=null==l?void 0:l.fmtp;return h&&c.map((function(e){var t;e.config=null===(t=h.filter((function(t){return t.payload===e.payload}))[0])||void 0===t?void 0:t.config})),d&&u.map((function(e){var t;e.config=null===(t=d.filter((function(t){return t.payload===e.payload}))[0])||void 0===t?void 0:t.config})),e.close(),{video:c,audio:u}}))}()}}]),n}(Dj);function s1(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var l1=Math.max;var c1=Qw?function(e,t){return Qw(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:vI,u1=c1,h1=Date.now;var d1=function(e){var t=0,n=0;return function(){var i=h1(),r=16-(i-n);if(n=i,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(u1),f1=d1;function p1(e,t){return f1(function(e,t,n){return t=l1(void 0===t?e.length-1:t,0),function(){for(var i=arguments,r=-1,o=l1(i.length-t,0),a=Array(o);++r<o;)a[r]=i[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=i[r];return s[t]=n(a),s1(e,this,s)}}(e,t,vI),e+"")}var g1,v1=Object.prototype.hasOwnProperty,y1=(g1=function(e,t){if(IE(t)||ME(t))iE(t,RE(t),e);else for(var n in t)v1.call(t,n)&&nE(e,n,t[n])},p1((function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(o=g1.length>3&&"function"==typeof o?(r--,o):void 0,a&&function(e,t,n){if(!Pw(n))return!1;var r=i(t);return!!("number"==r?ME(n)&&yE(t,n.length):"string"==r&&t in n)&&ek(n[t],e)}(t[0],t[1],a)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var s=t[n];s&&g1(e,s,n,o)}return e}))),m1=y1,_1=function(e){u(n,e);var t=v(n);function n(){return a(this,n),t.apply(this,arguments)}return l(n,[{key:"beforeCreate",value:function(e){var t=(e.player.config.rtm||{}).backupStreamType,n={flv:window.FlvPlayer,hls:window.HlsPlayer};e.player.config.rts=m1({},e.player.config.rtm,{backupConstruct:n[t]})}},{key:"afterCreate",value:function(){var e=this.player;e.on("degrade",(function(){e.unRegisterPlugin("rtm")}))}}],[{key:"pluginName",get:function(){return"rtm"}}]),n}(a1),b1=function(e){return e.PLAYER_CREATED_FINISH="player_create_finish",e.PLAYER_REBUILD="player_rebuild",e.NOT_SUPPORT_HARDWARE_DECODER="not_support_hardware_decoder",e.NOT_SUPPORT_SOFT_DECODER="not_support_soft_decoder",e.TOKEN_EXPIRED="playAuthToken_expired",e.UMD_LOAD_FAIL="umd_load_fail",e}(b1||{}),k1=function(e){return e.DANMU_CHANGE="danmu_change",e.TIME_SHIFT_CHANGE="time_shift_change",e.AI_SUBTITLE_LANG_CHANGE="ai_subtitle_lang_change",e.AI_SUBTITLE_MATCH="ai_subtitle_match",e.CANCEL_UNMUTE="cancel_unmute",e.REFRESH_CLICK="refresh_click",e.PLAY_BACKUP_CHANGE="play_backup_change",e.PLAY_BACKUP_CHANGE_FINISH="play_backup_change_finish",e.PLAY_ERROR_BUTTON_CLICK="play_error_button_click",e.PlAY_URL_CHANGE="play_url_change",e.SHOW_PLAY_ERROR="show_play_error",e.PLAYER_EXTEND_BUTTON="player_extend_button",e.LONG_WAITING="long_waiting",e.OFTEN_WAITING="often_waiting",e.DEFINITION_DEMOTE="definition_demote",e.LARKWINDOW_CHANGE="larkWindow_change",e.PANEL_MODE_CHANGE="panel_mode_change",e.INNER_DEFINITION_CHANGE="inner_definition_change",e.LINE_CHANGE="line_change",e.GET_PLAY_URL_ERR="get_play_url_err",e.MEDIA_EXPIRED="MEDIA_EXPIRED",e.MIRROR_CHANGE="mirror_change",e.TIME_SCALE_CHANGE="time_scale_change",e.MUSIC_MODE_CHANGE="music_mode_change",e.MUSIC_CHANGE="music_change",e.MUSIC_LIST_CHANGE="music_list_change",e}(k1||{}),w1=Object.freeze(Object.defineProperty({__proto__:null,SDKEvents:b1,PluginEvents:k1},Symbol.toStringTag,{value:"Module"})),E1=3,T1=3,S1=4,C1=5,x1=6,O1=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).playerData=null,i.playerData=i.playerConfig.playerData,i}return l(n,[{key:"beforeCreate",value:function(e){var t=e.player.config.playerData,n=t.getLineList(),i=t.current.lineId;Array.isArray(n)&&n.length>0&&(e.config.list=n.map((function(t){return t.text=e.player.i18n[t.lineTextKey]||t.lineTextKey,t}))),e.config.defaultLine=i}},{key:"afterCreate",value:function(){m(h(n.prototype),"afterCreate",this).call(this),this.config.list.length<2&&this.hide()}},{key:"afterPlayerInit",value:function(){}},{key:"renderItemList",value:function(){var e=this,t=this.config,i=t.list,r=t.defaultLine,o=0,a=i.map((function(t,n){var i,a={lineId:t.lineId||"",showText:e.i18n[t.lineTextKey]||t.lineTextKey,isCurrent:!1,selected:!1};return cN.isUndefined(t.lineId)||(null===(i=t.lineId)||void 0===i?void 0:i.toString())!==(null==r?void 0:r.toString())||(a.isCurrent=!0,a.selected=!0,o=n),a}));m(h(n.prototype),"renderItemList",this).call(this,a,o)}},{key:"onItemClick",value:function(e,t){this.player.emit(k1.LINE_CHANGE,{from:this.playerData.current.lineId,to:t.to.lineId}),this.playerData.current.lineId=t.to.lineId,this.player.emit(b1.PLAYER_REBUILD)}}],[{key:"pluginName",get:function(){return"sdkMultilinePlugin"}},{key:"defaultConfig",get:function(){return{position:Vj.POSITIONS.CONTROLS_RIGHT,index:S1,list:[],defaultLine:0,className:"xgplayer-multiline",hidePortrait:!1,isShowIcon:!0}}}]),n}(Fq),P1=function(e){u(i,e);var n=v(i);function i(e){var t;return a(this,i),(t=n.call(this,e)).playerData=null,t.toastInfo={},t.canChange=!0,t.playerData=t.playerConfig.playerData,t.dataMonitoring(),t}return l(i,[{key:"registerLanguageTexts",value:function(){return{switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}},{key:"beforeCreate",value:function(e){this.toastInfo={},this.canChange=!0;var t=this.getConfig(e.player),n=t.defaultDefinition,i=t.list;e.config.defaultDefinition=n,e.config.list=i}},{key:"getConfig",value:function(e){var t=this,n={list:[],defaultDefinition:""},i=e.config.playerData;this.toastInfo={},this.canChange=!0;var r=i.current,o=r.lineId,a=r.definition,s=i.getDefinitionListByLineId(o);return Array.isArray(s)&&s.length>0&&(n.list=s.map((function(n){return n.text||(n.text=t.getShowText(e.i18n,n)),n}))),n.defaultDefinition=a,n}},{key:"dataMonitoring",value:function(){var e=this;wD.subscribeProperty(this.playerData.current,"definition",(function(n,i){if(e.canChange&&n!==i&&e.player){var r=e.config.list,o=(void 0===r?[]:r).find((function(e){return e.definition===i}));o&&o.url&&(e.player.changeDefinition(t(t({},o),{},{definition:i,url:o.url})),e.player.emit(k1.INNER_DEFINITION_CHANGE,{from:n,to:i,url:o.url}),e.player.emit(k1.PlAY_URL_CHANGE,{url:o.url,from:k1.INNER_DEFINITION_CHANGE}),e.renderItemList(i),setTimeout((function(){e.player.ended?e.player.replay():e.player.paused&&e.player.play()}),1e3))}}))}},{key:"showToast",value:function(e){var t,n=this,i=null===(t=this.player)||void 0===t?void 0:t.getPlugin("sdkToastPlugin");if(i){var r=e.showText,o=i.add("".concat(this.langText.switching).concat(r,"..."),0,!0);this.toastInfo[o]={showTime:Date.now(),delayClose:!1},setTimeout((function(){var e;null!==(e=n.toastInfo[o])&&void 0!==e&&e.delayClose&&(i.remove(o),n.toastInfo[o].delayClose=!1)}),2e3),this.player.once(QN,(function(){var e;Date.now()-(null===(e=n.toastInfo[o])||void 0===e?void 0:e.showTime)>2e3?i.remove(o):n.toastInfo[o].delayClose=!0}))}}},{key:"afterCreate",value:function(){m(h(i.prototype),"afterCreate",this).call(this),this.config.list&&this.config.list.length>0&&(this.config.list.length<2?this.hide():(this.renderItemList(this.config.list),this.show()))}},{key:"afterPlayerInit",value:function(){}},{key:"getShowText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return e[t.definitionTextKey]||t.definitionTextKey||t.definition}},{key:"renderItemList",value:function(e){var t=this,n=this.config,r=n.list,o=n.defaultDefinition,a=0,s=r.map((function(n,i){var r={url:n.url,definition:n.definition||"",showText:t.getShowText(t.i18n,n),isCurrent:!1,selected:!1},s="string"==typeof e?n.definition===e:n.definition===o;return!cN.isUndefined(n.definition)&&s&&(r.isCurrent=!0,r.selected=!0,a=i),r}));m(h(i.prototype),"renderItemList",this).call(this,s,a)}},{key:"onItemClick",value:function(e,t){this.showToast(t.to),this.playerData.current.definition=t.to.definition}}],[{key:"pluginName",get:function(){return"sdkDefinitionPlugin"}},{key:"defaultConfig",get:function(){return{position:Vj.POSITIONS.CONTROLS_RIGHT,index:E1,list:[],defaultDefinition:"",hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0}}}]),i}(Fq),I1=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).state={isSupportAutoplay:!0,showUnmuteBt:!1},i}return l(n,[{key:"beforePlayerInit",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"afterCreate",value:function(){this.player.autoplay&&this.player.config.autoplayMuted&&this.initEvents()}},{key:"registerLanguageTexts",value:function(){return{unmute:{jp:"ミュートを解除する",en:"Click to unmute",zh:"点击取消静音","zh-hk":"點擊取消靜音"}}}},{key:"updateLang",value:function(){this.renderUnmuteBt()}},{key:"initEvents",value:function(){this.player.once("autoplay_was_prevented",this.handleAutoplayPrevented.bind(this)),this.player.once("autoplay_started",this.handleAutoplayStart.bind(this)),this.player.once("volumechange",this.handleVolumechange.bind(this))}},{key:"handleAutoplayPrevented",value:function(){console.warn("静音自动启播失败"),this.state.isSupportAutoplay=!1,this.player.muted=!1}},{key:"handleAutoplayStart",value:function(){this.state.isSupportAutoplay?(this.state.showUnmuteBt=!0,this.renderUnmuteBt()):this.player.muted=!1}},{key:"handleVolumechange",value:function(){this.state.showUnmuteBt=!1,this.renderUnmuteBt(),this.player.paused&&this.player.readyState>=1&&this.player.play()}},{key:"renderUnmuteBt",value:function(){var e=this.root;if(e&&(e.innerHTML="",this.state.showUnmuteBt)){var t=this.langText.unmute,n=cN.createDom("div",t,void 0,"xgplayer-unmute-bt");e.appendChild(n),this.bind(".xgplayer-unmute-bt","click",this.cancelUnmute.bind(this))}}},{key:"cancelUnmute",value:function(){this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt(),this.player.emit(k1.CANCEL_UNMUTE)}},{key:"destroy",value:function(){this.player.off("autoplay_was_prevented",this.handleAutoplayPrevented.bind(this)),this.player.off("autoplay_started",this.handleAutoplayStart.bind(this)),this.player.off("volumechange",this.handleVolumechange.bind(this))}},{key:"render",value:function(){return'<div class="xgplayer-unmute"></div>'}}],[{key:"pluginName",get:function(){return"sdkUnmutePlugin"}},{key:"defaultConfig",get:function(){return{position:Vj.POSITIONS.ROOT}}}]),n}(Vj);function L1(){return(new DOMParser).parseFromString('<svg width="20" height="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}var D1=function(){return bw.Date.now()},A1=/\s/;var M1=/^\s+/;function R1(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&A1.test(e.charAt(t)););return t}(e)+1).replace(M1,""):e}var N1=/^[-+]0x[0-9a-f]+$/i,j1=/^0b[01]+$/i,B1=/^0o[0-7]+$/i,U1=parseInt;function H1(e){if("number"==typeof e)return e;if(vP(e))return NaN;if(Pw(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Pw(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=R1(e);var n=j1.test(e);return n||B1.test(e)?U1(e.slice(2),n?2:8):N1.test(e)?NaN:+e}var F1=Math.max,G1=Math.min;function V1(e,t,n){var i,r,o,a,s,l,c=0,u=!1,h=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=i,o=r;return i=r=void 0,c=t,a=e.apply(o,n)}function p(e){return c=e,s=setTimeout(v,t),u?f(e):a}function g(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=o}function v(){var e=D1();if(g(e))return y(e);s=setTimeout(v,function(e){var n=t-(e-l);return h?G1(n,o-(e-c)):n}(e))}function y(e){return s=void 0,d&&i?f(e):(i=r=void 0,a)}function m(){var e=D1(),n=g(e);if(i=arguments,r=this,l=e,n){if(void 0===s)return p(l);if(h)return clearTimeout(s),s=setTimeout(v,t),f(l)}return void 0===s&&(s=setTimeout(v,t)),a}return t=H1(t)||0,Pw(n)&&(u=!!n.leading,o=(h="maxWait"in n)?F1(H1(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),m.cancel=function(){void 0!==s&&clearTimeout(s),c=0,i=l=r=s=void 0},m.flush=function(){return void 0===s?a:y(D1())},m}var z1=Vj.POSITIONS,W1=function(e){u(n,e);var t=v(n);function n(){return a(this,n),t.apply(this,arguments)}return l(n,[{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.refresh),this.initEvents()}},{key:"registerIcons",value:function(){return{refresh:{icon:L1,class:"xgplayer-refresh-svg"}}}},{key:"registerLanguageTexts",value:function(){return{refresh:{jp:"リフレッシュ",en:"Refresh",zh:"刷新","zh-hk":"刷新"}}}},{key:"initEvents",value:function(){this.handleRefresh=V1(this.handleRefresh.bind(this),200);var e="mobile"===vN.device?"touchend":"click";this.bind(e,this.handleRefresh),this.show()}},{key:"handleRefresh",value:function(e){var t=this.player;t&&(e.preventDefault(),e.stopPropagation(),t.addClass("xgplayer-is-enter"),t.pause(),t.emit(k1.REFRESH_CLICK),setTimeout((function(){t&&t.retry(),t.once("canplay",(function(){t.removeClass("xgplayer-is-enter")}))})))}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.handleRefresh)}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-refresh">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="refresh">'.concat(this.langText.refresh,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"refresh"}},{key:"defaultConfig",get:function(){return{position:z1.CONTROLS_LEFT,index:1}}}]),n}(Vj);function K1(){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}var q1=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).panel=null,i.panelContainer=null,i}return l(n,[{key:"beforePlayerInit",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"afterCreate",value:function(){this.renderMoreIcon()}},{key:"updateLang",value:function(e){if(this.panelContainer){var t=this.panelContainer.querySelectorAll(".panel-icon-bt-text"),n=this.getAndSplitList().extraList;t.forEach((function(t){var i,r,o=Number(t.getAttribute("plugin-index"));null!==(i=n[o])&&void 0!==i&&null!==(r=i.textTips)&&void 0!==r&&r[e]&&(t.innerHTML=n[o].textTips[e])}))}}},{key:"registerIcons",value:function(){return{more:{icon:K1,class:"xgplayer-more-svg"}}}},{key:"getAndSplitList",value:function(){var e,t,n,i,r,o=(null!==(e=this.player.config.ignores)&&void 0!==e?e:[]).map((function(e){return e.toLowerCase()})),a=this.config.iconPlugins.filter((function(e){return!o.includes(e.pluginName.toLowerCase())}));return a.length>this.config.maxShowNum+1?(i=a.slice(0,this.config.maxShowNum),r=a.slice(-(a.length-this.config.maxShowNum))):i=b(a),{list:null!==(t=i)&&void 0!==t?t:[],extraList:null!==(n=r)&&void 0!==n?n:[]}}},{key:"children",value:function(){var e=this,t=this.getAndSplitList().list,n={};return t.forEach((function(t){n[t.pluginName]={plugin:t,options:{root:e.root}}})),n}},{key:"renderMoreIcon",value:function(){var e=this,t=this.getAndSplitList().extraList;if(0!==t.length){var n=this.root,i=cN.createDom("div","",{},"xgplayer-icon");i.appendChild(this.icons.more),i.addEventListener("click",(function(){e.renderPanel(t)}));var r=cN.createDom("xg-icon","",{"data-index":0},"xgplayer-more");r.appendChild(i),n.appendChild(r)}}},{key:"renderPanel",value:function(e){var t=this;this.panelContainer||(this.panelContainer=cN.createDom("div","",{},"panel-content"),e.forEach((function(e,n){var i,r,o=cN.createDom("div","",{},"panel-icon-bt"),a=cN.createDom("div","",{},"panel-icon-svg");o.appendChild(a),t.registerExtraPlugin(e,a);var s="zh-cn"===t.player.lang?"zh":t.player.lang,l=null!==(i=null===(r=e.textTips)||void 0===r?void 0:r[s])&&void 0!==i?i:e.pluginName;o.appendChild(cN.createDom("span",l,{"plugin-index":n},"panel-icon-bt-text")),t.panelContainer.appendChild(o)}))),this.player.panel.showPanel(this.panelContainer)}},{key:"registerExtraPlugin",value:function(e,t){this.player.registerPlugin({plugin:e,options:{root:t}})}},{key:"destroy",value:function(){}},{key:"render",value:function(){return'<div class="xgplayer-rightTop-iconList"></div>'}}],[{key:"pluginName",get:function(){return"MoreButtonPlugin"}},{key:"defaultConfig",get:function(){return{position:Vj.POSITIONS.ROOT_TOP,iconPlugins:[],maxShowNum:2}}}]),n}(Vj);function Y1(){return(new DOMParser).parseFromString('<svg width="150" height="162" viewBox="0 0 150 162" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M127.718 112.831H6.13675C4.19663 112.831 2.25651 108.974 2.90322 104.475C3.54993 99.9761 8.07687 99.9761 13.8972 99.9761C11.9571 97.4052 9.37028 88.4069 15.8373 81.3369C22.3044 74.2668 25.5379 74.2668 34.5918 75.5526C33.9451 63.9837 47.526 34.4178 77.2744 35.0605C107.023 35.7032 116.077 54.3421 119.957 63.3404C129.011 62.6976 147.765 66.554 149.706 87.1214C151.258 103.575 135.694 111.117 127.718 112.831Z" fill="#F1F4F8"/>\n<path d="M44.9346 91.6022L43.6782 99.8032" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M47.3545 125.695L48.6109 117.494" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M31.5347 97.7378L38.7295 101.869" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M60.7544 119.559L53.5595 115.428" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M69.6755 44.5318L138.35 26.0209C139.115 25.8148 139.804 26.5367 139.563 27.2909L121.081 85.1146C120.982 85.4243 120.739 85.6665 120.429 85.7641L52.0645 107.28C51.2996 107.521 50.5766 106.809 50.8062 106.04L68.9776 45.2111C69.0768 44.879 69.3409 44.622 69.6755 44.5318Z" fill="#D0D6E0" stroke="#D0D6E0" stroke-width="4" stroke-linecap="round"/>\n<path d="M83.1285 52.7415C91.6454 54.3438 107.322 62.0019 101.894 79.8155" stroke="white" stroke-width="3" stroke-linecap="round"/>\n<path d="M84.138 62.3385C88.3894 63.1384 96.2148 66.9611 93.5053 75.8531" stroke="white" stroke-width="3" stroke-linecap="round"/>\n<ellipse cx="83.6417" cy="71.98" rx="3.08443" ry="3.07025" transform="rotate(12.6375 83.6417 71.98)" fill="white"/>\n<path d="M43.4699 110.358C39.5425 109.114 30.6316 108.203 26.4077 114.511C21.1278 122.397 36.5031 152.755 2.11053 160.141" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n</svg>\n',"image/svg+xml").firstChild}var $1=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).playerData=null,i.state={showError:!1,retryTimes:0,idx:0},i._errDetailList=[],i.playerData=e.player.config.playerData,i}return l(n,[{key:"afterCreate",value:function(){var e,t,n;this.initEvents(),this.errNoteMap={other:null!==(e=null===(t=this.i18n.ERROR_TYPES)||void 0===t||null===(n=t.other)||void 0===n?void 0:n.msg)&&void 0!==e?e:"error",1:this.i18n.MEDIA_ERR_ABORTED,2:this.i18n.MEDIA_ERR_NETWORK,3:this.i18n.MEDIA_ERR_DECODE,4:this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED,2100:this.i18n.NETWORK_ERROR,2101:this.i18n.NETWORK_TIMEOUT,9100:this.i18n.GET_URL_ERR_BY_TOKEN,9101:this.i18n.PLAY_AUTH_TOKEN_EXPIRED,9102:this.i18n.HLS_KEY_TOKEN_EXPIRED,5200:this.i18n.MEDIA_SOURCE_CANNOT_PLAY_TYPE}}},{key:"registerLanguageTexts",value:function(){return{clickButton:{jp:"リフレッシュ",en:"Refresh",zh:"刷新","zh-hk":"刷新"},errorTips:{jp:"再生中にエラーが発生しました。[更新]をクリックして試してください",en:"An error occurred while playing, click refresh to try",zh:"播放发生错误,点击刷新试试吧","zh-hk":"播放發生錯誤,點擊刷新試試吧"}}}},{key:"registerIcons",value:function(){return{errorImg:{icon:Y1,class:"xgplayer-error-svg"}}}},{key:"updateLang",value:function(){if(this.$errorDom){var e=this.$errorDom.querySelector(".xgplayer-error-tips");if(e){var t,n,i=null!==(t=null===(n=this.config.errorTipsText)||void 0===n?void 0:n[this.lang])&&void 0!==t?t:this.langText.errorTips;e.innerHTML=i}var r=this.$errorDom.querySelector(".xgplayer-error-button");r&&(r.innerHTML=this.langText.clickButton)}}},{key:"initEvents",value:function(){this.player.on(SN,this.handleError.bind(this)),this.playerData.isLive&&(this.player.on(EN,this.handleEnd.bind(this)),this.player.on(k1.REFRESH_CLICK,this.closeError.bind(this))),this.on(IN,this.closeError.bind(this)),this.on(kN,this.closeError.bind(this))}},{key:"handleError",value:function(e){this.player&&this.player.pause(),this.config.isNeedDemoteBack?(this.state.showError=!1,this.changeMainOrBackup()):this.state.showError=!0,this.renderError(e)}},{key:"handleEnd",value:function(){this.player&&this.player.pause(),this.config.isNeedDemoteBack&&this.changeMainOrBackup()}},{key:"getRetryList",value:function(){var e,t=this.playerData.getCurrentStreams()[0];return[null==t?void 0:t.url].concat(b(null!==(e=null==t?void 0:t.backUrlList)&&void 0!==e?e:[]))}},{key:"changeMainOrBackup",value:function(){var e=this;this.player.addClass(qj.ENTER);var t=this.getRetryList(),n=this.config.retryLoopNum*t.length,i=(t.indexOf(this.player.config.url)+1)%t.length;this.state.idx=i;var r=t[i];if(!r||this.state.retryTimes===n)return this.player.removeClass(qj.ENTER),this.state.retryTimes===n&&this.player.emit(k1.PLAY_BACKUP_CHANGE_FINISH),this.state.showError=!0,this.renderError(),void this.resetTimes();this.player.once("canplay",(function(){e.state.retryTimes=0})),console.log("重试第".concat(this.state.retryTimes,"次"),r),this.player.emit(k1.PLAY_BACKUP_CHANGE,{currentUrl:this.player.config.url,nextUrl:r,retryTimes:this.state.retryTimes}),this.changeUrl(r),this.state.retryTimes=this.state.retryTimes+1}},{key:"changeUrl",value:function(e){this.player.config.url=e,this.player.switchURL(e,!1),this.player.emit(k1.PlAY_URL_CHANGE,{url:e,from:k1.PLAY_BACKUP_CHANGE})}},{key:"resetTimes",value:function(){this.state.retryTimes=0,this.state.idx=0}},{key:"renderError",value:function(e){var t=this.root;t&&(t.innerHTML="",t.style.display="none",this.state.showError&&(this.player.emit(k1.SHOW_PLAY_ERROR),t.style.display="block",t.appendChild(this.getErrorDom(e))))}},{key:"addErrDetail",value:function(e){Array.isArray(e)?this._errDetailList=[].concat(b(this._errDetailList),b(e)):this._errDetailList.push(e)}},{key:"getErrorDom",value:function(e){var t=this;if(!this.$errorDom){var n,i;if(this.$errorDom=cN.createDom("div","",void 0,"xgplayer-error-cover"),this.config.errorImg){var r=cN.createDom("div","",void 0,"xgplayer-error-img");r.appendChild(this.icons.errorImg),this.$errorDom.appendChild(r)}if(this.config.errorTips){var o="";if(e){var a,s,l=e.errorCode,c=this.player.errorNote?this.i18n[this.player.errorNote]:"";if(!c)c=null!==(a=null!==(s=this.errNoteMap[l])&&void 0!==s?s:this.errNoteMap.other)&&void 0!==a?a:"error";o=c}else{var u,h;o=null!==(u=null===(h=this.config.errorTipsText)||void 0===h?void 0:h[this.lang])&&void 0!==u?u:this.langText.errorTips}var d=cN.createDom("div",o,void 0,"xgplayer-error-tips");this.$errorDom.appendChild(d)}if(this.config.isNeedRefreshButton){var f=cN.createDom("div",this.langText.clickButton,void 0,"xgplayer-error-button");this.bind(".xgplayer-error-button","click",this.handleButtonClick.bind(this)),this.$errorDom.appendChild(f)}if(null!==(n=this._errDetailList)&&void 0!==n&&n.length)null===(i=this._errDetailList)||void 0===i||i.forEach((function(e){var n="function"==typeof e?e():e;if(n){var i=cN.createDom("div","".concat(n.label,": ").concat(n.value),void 0,"xgplayer-error-detail-info");t.$errorDom.appendChild(i)}}));this.emit("sdkerrorplugin_render",this.$errorDom)}return this.$errorDom}},{key:"handleButtonClick",value:function(){var e,t;null===(e=this.player)||void 0===e||e.emit(k1.PLAY_ERROR_BUTTON_CLICK),null===(t=this.player)||void 0===t||t.retry(),this.closeError()}},{key:"closeError",value:function(){this.state.showError=!1,this.renderError()}},{key:"destroy",value:function(){this.player.off(SN,this.handleError.bind(this)),this.playerData.isLive&&this.player.off(EN,this.handleEnd.bind(this))}},{key:"render",value:function(){return'<xgplayer-error class="xgplayer-error"></xgplayer-error>'}}],[{key:"pluginName",get:function(){return"sdkErrorPlugin"}},{key:"defaultConfig",get:function(){return{errorImg:!0,errorTips:!0,isNeedRefreshButton:!0,isNeedDemoteBack:!1,retryLoopNum:1,errorTipsText:null,position:Vj.POSITIONS.ROOT}}}]),n}(Vj);function X1(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 4.106h-13a.3.3 0 00-.3.3v11.186a.3.3 0 00.3.3h7.111v1.7H3.5a2 2 0 01-2-2V4.406a2 2 0 012-2h13a2 2 0 012 2V10h-1.7V4.406a.3.3 0 00-.3-.3zM6 7.722c0-.42.34-.76.76-.76h6.58a.76.76 0 110 1.52H6.76a.76.76 0 01-.76-.76zm0 3.037c0-.42.34-.759.76-.759h3.543a.76.76 0 110 1.519H6.76a.76.76 0 01-.76-.76z" fill="#fff"/><circle cx="15.1" cy="14.201" r="3.4" fill="#3370FF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M13.185 13.756a.5.5 0 01.707 0l.866.866 1.78-1.78a.5.5 0 11.707.707l-2.133 2.134a.5.5 0 01-.707 0l-1.22-1.22a.5.5 0 010-.707z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function J1(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 4.106h-13a.3.3 0 00-.3.3v11.186a.3.3 0 00.3.3h7.111v1.7H3.5a2 2 0 01-2-2V4.406a2 2 0 012-2h13a2 2 0 012 2V10h-1.7V4.406a.3.3 0 00-.3-.3zM6 7.722c0-.42.34-.76.76-.76h6.58a.76.76 0 110 1.52H6.76a.76.76 0 01-.76-.76zm0 3.037c0-.42.34-.759.76-.759h3.543a.76.76 0 110 1.519H6.759a.76.76 0 01-.759-.76zm7.202 2.303a2.2 2.2 0 003.011 3.011l-3.011-3.01zm3.915 1.992a2.2 2.2 0 00-2.896-2.896l2.896 2.896zm1.383-.879a3.4 3.4 0 11-6.8 0 3.4 3.4 0 016.8 0z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function Z1(){return(new DOMParser).parseFromString('<svg fill="none" stroke="currentColor" stroke-width="4" viewBox="0 0 48 48" width="1em" height="1em"\n class="arco-icon arco-icon-refresh">\n <path\n d="M38.837 18C36.463 12.136 30.715 8 24 8 15.163 8 8 15.163 8 24s7.163 16 16 16c7.455 0 13.72-5.1 15.496-12M40 8v10H30">\n </path>\n</svg>',"image/svg+xml").firstChild}function Q1(e){return e&&e.ownerDocument||document}function e2(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}function t2(e,t){e.classList?e.classList.add(t):e2(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}var n2=!("undefined"==typeof window||!window.document||!window.document.createElement),i2=!1,r2=!1;try{var o2={get passive(){return i2=!0},get once(){return r2=i2=!0}};n2&&(window.addEventListener("test",o2,o2),window.removeEventListener("test",o2,!0))}catch(xX){}function a2(e,t,n,i){if(i&&"boolean"!=typeof i&&!r2){var r=i.once,o=i.capture,a=n;!r2&&r&&(a=n.__once||function e(i){this.removeEventListener(t,e,o),n.call(this,i)},n.__once=a),e.addEventListener(t,a,i2?i:o)}e.addEventListener(t,n,i)}function s2(e){var t=Q1(e);return t&&t.defaultView||window}function l2(e,t){return s2(e).getComputedStyle(e,t)}var c2=/([A-Z])/g;function u2(e){return e.replace(c2,"-$1").toLowerCase()}var h2=/^ms-/;function d2(e){return u2(e).replace(h2,"-ms-")}var f2=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function p2(e){return!(!e||!f2.test(e))}function g2(e,t){var n="",i="";if("string"==typeof t)return e.style.getPropertyValue(d2(t))||l2(e).getPropertyValue(d2(t));Object.keys(t).forEach((function(r){var o=t[r];o||0===o?p2(r)?i+=r+"("+o+") ":n+=d2(r)+": "+o+";":e.style.removeProperty(d2(r))})),i&&(n+="transform: "+i+";"),e.style.cssText+=";"+n}function v2(e,t,n,i){var r=i&&"boolean"!=typeof i?i.capture:i;e.removeEventListener(t,n,r),n.__once&&e.removeEventListener(t,n.__once,r)}function y2(e,t,n,i){return a2(e,t,n,i),function(){v2(e,t,n,i)}}function m2(e,t,n,i){if(void 0===n&&(n=!1),void 0===i&&(i=!0),e){var r=document.createEvent("HTMLEvents");r.initEvent(t,n,i),e.dispatchEvent(r)}}function _2(e,t,n,i){var r,o;null==n&&(r=g2(e,"transitionDuration")||"",o=-1===r.indexOf("ms")?1e3:1,n=parseFloat(r)*o||0);var a=function(e,t,n){void 0===n&&(n=5);var i=!1,r=setTimeout((function(){i||m2(e,"transitionend",!0)}),t+n),o=y2(e,"transitionend",(function(){i=!0}),{once:!0});return function(){clearTimeout(r),o()}}(e,n,i),s=y2(e,"transitionend",t);return function(){a(),s()}}var b2={transition:"","transition-duration":"","transition-delay":"","transition-timing-function":""};function k2(e){var t=e.node,n=e.properties,i=e.duration,r=void 0===i?200:i,o=e.easing,a=e.callback,s=[],l={},c="";Object.keys(n).forEach((function(e){var t=n[e];p2(e)?c+=e+"("+t+") ":(l[e]=t,s.push(u2(e)))})),c&&(l.transform=c,s.push("transform")),r>0&&(l.transition=s.join(", "),l["transition-duration"]=r/1e3+"s",l["transition-delay"]="0s",l["transition-timing-function"]=o||"linear");var u=_2(t,(function(e){e.target===e.currentTarget&&(g2(t,b2),a&&a.call(this,e))}),r);return t.clientLeft,g2(t,l),{cancel:function(){u(),g2(t,b2)}}}var w2=(new Date).getTime();var E2="clearTimeout",T2=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-w2)),i=setTimeout(e,n);return w2=t,i},S2=function(e,t){return e+(e?t[0].toUpperCase()+t.substr(1):t)+"AnimationFrame"};n2&&["","webkit","moz","o","ms"].some((function(e){var t=S2(e,"request");return t in window&&(E2=S2(e,"cancel"),T2=function(e){return window[t](e)}),!!T2}));var C2,x2=function(e){"function"==typeof window[E2]&&window[E2](e)},O2=T2;function P2(e,t){if(!C2){var n=document.body,i=n.matches||n.matchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector;C2=function(e,t){return i.call(e,t)}}return C2(e,t)}function I2(e,t){return e.contains?e.contains(t):e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):void 0}var L2=Function.prototype.bind.call(Function.prototype.call,[].slice);var D2=Function.prototype.bind.call(Function.prototype.call,[].slice);function A2(e,t){return D2(e.querySelectorAll(t))}function M2(e){return"nodeType"in e&&e.nodeType===document.DOCUMENT_NODE}function R2(e){return"window"in e&&e.window===e?e:M2(e)&&e.defaultView||!1}function N2(e){var t="pageXOffset"===e?"scrollLeft":"scrollTop";return function(n,i){var r=R2(n);if(void 0===i)return r?r[e]:n[t];r?r.scrollTo(r[e],i):n[t]=i}}var j2=N2("pageXOffset"),B2=N2("pageYOffset");function U2(e){var t=Q1(e),n={top:0,left:0,height:0,width:0},i=t&&t.documentElement;return i&&I2(i,e)?(void 0!==e.getBoundingClientRect&&(n=e.getBoundingClientRect()),n={top:n.top+B2(i)-(i.clientTop||0),left:n.left+j2(i)-(i.clientLeft||0),width:n.width,height:n.height}):n}function H2(e,t){var n=R2(e);return n?n.innerHeight:t?e.clientHeight:U2(e).height}var F2=/^(?:input|select|textarea|button)$/i;function G2(e,t,n){void 0===t&&(t=null),void 0===n&&(n=null);for(var i=[];e;e=e.nextElementSibling)if(e!==t){if(n&&P2(e,n))break;i.push(e)}return i}var V2=function(e){return!!e&&"offsetParent"in e};function z2(e){for(var t=Q1(e),n=e&&e.offsetParent;V2(n)&&"HTML"!==n.nodeName&&"static"===g2(n,"position");)n=n.offsetParent;return n||t.documentElement}function W2(){return W2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},W2.apply(this,arguments)}var K2;function q2(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Y2(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=q2(e.className,t):e.setAttribute("class",q2(e.className&&e.className.baseVal||"",t))}function $2(e,t){var n=g2(e,"position"),i="absolute"===n,r=e.ownerDocument;if("fixed"===n)return r||document;for(;(e=e.parentNode)&&!M2(e);){var o=i&&"static"===g2(e,"position"),a=(g2(e,"overflow")||"")+(g2(e,"overflow-y")||"")+g2(e,"overflow-x");if(!o&&(/(auto|scroll)/.test(a)&&(t||H2(e)<e.scrollHeight)))return e}return r||document}var X2=/ /gi,J2=/\xA0/g,Z2=/\s+([^\s])/gm;var Q2={addEventListener:a2,removeEventListener:v2,triggerEvent:m2,animate:function(e,t,n,i,r){if(!("nodeType"in e))return k2(e);if(!t)throw new Error("must include properties to animate");return"function"==typeof i&&(r=i,i=""),k2({node:e,properties:t,duration:n,easing:i,callback:r})},filter:function(e,t){return function(n){var i=n.currentTarget,r=n.target;A2(i,e).some((function(e){return I2(e,r)}))&&t.call(this,n)}},listen:y2,style:g2,getComputedStyle:l2,attribute:function(e,t,n){if(e){if(void 0===n)return e.getAttribute(t);n||""===n?e.setAttribute(t,String(n)):e.removeAttribute(t)}},activeElement:function(e){void 0===e&&(e=Q1());try{var t=e.activeElement;return t&&t.nodeName?t:null}catch(xX){return e.body}},ownerDocument:Q1,ownerWindow:s2,requestAnimationFrame:O2,cancelAnimationFrame:x2,matches:P2,height:H2,width:function(e,t){var n=R2(e);return n?n.innerWidth:t?e.clientWidth:U2(e).width},offset:U2,offsetParent:z2,position:function(e,t){var n,i={top:0,left:0};if("fixed"===g2(e,"position"))n=e.getBoundingClientRect();else{var r=t||z2(e);n=U2(e),"html"!==function(e){return e.nodeName&&e.nodeName.toLowerCase()}(r)&&(i=U2(r));var o=String(g2(r,"borderTopWidth")||0);i.top+=parseInt(o,10)-B2(r)||0;var a=String(g2(r,"borderLeftWidth")||0);i.left+=parseInt(a,10)-j2(r)||0}var s=String(g2(e,"marginTop")||0),l=String(g2(e,"marginLeft")||0);return W2({},n,{top:n.top-i.top-(parseInt(s,10)||0),left:n.left-i.left-(parseInt(l,10)||0)})},contains:I2,scrollbarSize:function(e){if((!K2&&0!==K2||e)&&n2){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),K2=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return K2},scrollLeft:j2,scrollParent:$2,scrollTo:function(e,t){var n=U2(e),i={top:0,left:0};if(e){var r=t||$2(e),o=R2(r),a=B2(r),s=H2(r,!0);o||(i=U2(r));var l=(n={top:n.top-i.top,left:n.left-i.left,height:n.height,width:n.width}).height,c=n.top+(o?0:a),u=c+l;a=a>c?c:u>a+s?u-s:a;var h=O2((function(){return B2(r,a)}));return function(){return x2(h)}}},scrollTop:B2,querySelectorAll:A2,closest:function(e,t,n){e.closest&&!n&&e.closest(t);var i=e;do{if(P2(i,t))return i;i=i.parentElement}while(i&&i!==n&&i.nodeType===document.ELEMENT_NODE);return null},addClass:t2,removeClass:Y2,hasClass:e2,toggleClass:function(e,t){e.classList?e.classList.toggle(t):e2(e,t)?Y2(e,t):t2(e,t)},transitionEnd:_2,childNodes:function(e){return e?L2(e.childNodes):[]},childElements:function(e){return e?Array.from(e.children):[]},nextUntil:function(e,t){return G2(e,e,t)},parents:function(e){return function(e,t){var n=null,i=[];for(n=e?e[t]:null;n&&9!==n.nodeType;)i.push(n),n=n[t]||null;return i}(e,"parentElement")},siblings:function(e){return G2(e&&e.parentElement?e.parentElement.firstElementChild:null,e)},clear:function(e){if(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}return null},insertAfter:function(e,t){return e&&t&&t.parentNode?(t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e):null},isInput:function(e){return!!e&&F2.test(e.nodeName)},isVisible:function(e){return!!e&&!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},prepend:function(e,t){return e&&t?(t.firstElementChild?t.insertBefore(e,t.firstElementChild):t.appendChild(e),e):null},remove:function(e){return e&&e.parentNode?(e.parentNode.removeChild(e),e):null},text:function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);var i="";return e&&(i=(e.textContent||"").replace(X2," ").replace(J2," "),t&&(i=i.trim()),n&&(i=i.replace(Z2," $1"))),i}};var e3=function(){function e(t,n){a(this,e),this.ticks=[],this.range=[0,100],this.currentValue=0,this.currentTick={name:"",val:0,renderVal:0},this.buttonStatus=1,this.startClientX=0,this.wrapperWidth=1,this.wrapperLeft=0,this.handleChange=function(){},this.parent=t,this.ticks=n.ticks,this.itemProps=n,this.sliderTitle=document.createElement("div"),this.sliderTitle.innerHTML=n.name,this.sliderContent=document.createElement("div"),this.sliderValue=document.createElement("div"),this.wrapper=document.createElement("div"),this.inner=document.createElement("div"),this.button=document.createElement("div"),Q2.addClass(this.wrapper,"wrapper"),Q2.addClass(this.parent,"xg-player-slider"),Q2.addClass(this.sliderContent,"line-slider"),Q2.addClass(this.sliderTitle,"line-title"),Q2.addClass(this.sliderValue,"line-value"),this.renderTicks(),this.rendInner(),this.parent.appendChild(this.sliderTitle),this.parent.appendChild(this.sliderContent),this.parent.appendChild(this.sliderValue),this.sliderContent.appendChild(this.wrapper),this.bindEvents(),this.setValue(n.defaultValue)}return l(e,[{key:"renderTicks",value:function(){var e=this.wrapper,t=document.createElement("div");Q2.addClass(t,"ticks");for(var n=1;n<this.ticks.length-1;n++){var i=this.ticks[n],r=document.createElement("div");Q2.addClass(r,"tick"),Q2.style(r,{left:i.val+"%"}),t.appendChild(r)}e.appendChild(t)}},{key:"rendInner",value:function(){var e=this.wrapper,t=this.inner;Q2.addClass(t,"inner");var n=this.button;Q2.addClass(n,"button"),e.appendChild(t),e.appendChild(n)}},{key:"bindEvents",value:function(){Q2.addEventListener(this.wrapper,"click",this.onClick.bind(this)),Q2.addEventListener(this.button,"touchstart",this.onTouchStart.bind(this)),Q2.addEventListener(this.button,"touchmove",function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Pw(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),V1(e,t,{leading:i,maxWait:t,trailing:r})}(this.onTouchmove.bind(this),30)),Q2.addEventListener(this.button,"touchend",this.onTouchend.bind(this)),Q2.addEventListener(this.button,"touchcancel",this.onTouchend.bind(this))}},{key:"setValue",value:function(e){var t=this;if(e>this.range[1]||e<this.range[0])return!1;this.currentTick=this.getCurrentTick(e),this.currentValue=this.currentTick.val;var n=this.currentValue+"%";return setTimeout((function(){Q2.style(t.inner,{width:n}),Q2.style(t.button,{left:n})})),this.sliderValue.innerHTML=this.currentTick.name,this.handleChange(this.currentValue),!0}},{key:"renderText",value:function(e){var t=this;this.ticks=e.ticks,this.itemProps=e,this.sliderTitle.innerHTML=e.name,this.currentTick=this.ticks.filter((function(e){return e.val===t.currentValue}))[0],this.sliderValue.innerHTML=this.currentTick.name}},{key:"onChange",value:function(e){this.handleChange=e}},{key:"getCurrentTick",value:function(e){for(var t=0;t<this.ticks.length-1;t++)if(this.ticks[t].val<=e&&this.ticks[t+1].val>=e)return e-this.ticks[t].val>this.ticks[t+1].val-e?this.ticks[t+1]:this.ticks[t];return this.ticks[0]}},{key:"onMousedown",value:function(e){this.startClientX=e.clientX,this.onStart()}},{key:"onTouchStart",value:function(e){e.stopPropagation(),this.startClientX=e.touches[0].clientX,this.onStart()}},{key:"onStart",value:function(){this.buttonStatus=2;var e=Q2.offset(this.wrapper);this.wrapperWidth=e.width,this.wrapperLeft=e.left}},{key:"onMousemove",value:function(e){if(2===this.buttonStatus){var t=e.clientX-this.startClientX;this.onMove(t)}}},{key:"onTouchmove",value:function(e){e.stopPropagation();var t=e.touches[0].clientX-this.startClientX;this.onMove(t)}},{key:"onMove",value:function(e){var t=this.startClientX+e;if(!(t-this.wrapperLeft<0||t-this.wrapperLeft>this.wrapperWidth)){this.startClientX=this.startClientX+e;var n=(this.startClientX-this.wrapperLeft)*(this.range[1]-this.range[0])/this.wrapperWidth;Q2.style(this.inner,{width:n+"%"}),Q2.style(this.button,{left:n+"%"})}}},{key:"onMouseup",value:function(e){console.log("mouse up",e.clientX),this.onEnd()}},{key:"onTouchend",value:function(){this.onEnd()}},{key:"onEnd",value:function(){this.buttonStatus=3;var e=(this.startClientX-this.wrapperLeft)*(this.range[1]-this.range[0])/this.wrapperWidth;this.setValue(e)}},{key:"onClick",value:function(e){e.stopPropagation();var t=Q2.offset(this.wrapper);this.wrapperWidth=t.width,this.wrapperLeft=t.left;var n=(e.clientX-this.wrapperLeft)*(this.range[1]-this.range[0])/this.wrapperWidth;this.setValue(n)}}]),e}(),t3={danmuSwitch:"弹幕开关",danmuSetting:"弹幕设置",openDanmu:"打开弹幕",reset:"重置",opacity:"不透明度",area:"显示区域",speed:"弹幕速度",fontSize:"字体大小",danmuMask:"智能挡板",screen0:"1/4屏",screen1:"半屏",screen2:"3/4屏",screen3:"全屏",opacity0:"0",opacity1:"1/3",opacity2:"2/3",opacity3:"1",speed0:"0.25",speed1:"0.5",speed2:"正常",speed3:"1.25",speed4:"1.5",speed5:"2",fontSize0:"极小",fontSize1:"适中",fontSize2:"极大"},n3={danmuSwitch:"Barrage switch",danmuSetting:"Barrage settings",openDanmu:"Open Barrage",reset:"Reset",opacity:"Opacity",area:"Display area",speed:"Barrage speed",fontSize:"Font size",danmuMask:"Intelligent blocking",screen0:"1/4 screen",screen1:"Half screen",screen2:"3/4 screen",screen3:"Full screen",opacity0:"0",opacity1:"1/3",opacity2:"2/3",opacity3:"1",speed0:"0.25",speed1:"0.5",speed2:"Normal",speed3:"1.25",speed4:"1.5",speed5:"2",fontSize0:"Minimal",fontSize1:"Moderate",fontSize2:"Great"},i3={zh:t3,"zh-cn":t3,en:n3,jp:n3,"zh-hk":{danmuSwitch:"彈幕開關",danmuSetting:"彈幕設置",openDanmu:"打開彈幕",reset:"重置",opacity:"不透明度",area:"顯示區域",speed:"彈幕速度",fontSize:"字體大小",danmuMask:"智能擋板",screen0:"1/4屏",screen1:"半屏",screen2:"3/4屏",screen3:"全屏",opacity0:"0",opacity1:"1/3",opacity2:"2/3",opacity3:"1",speed0:"0.25",speed1:"0.5",speed2:"正常",speed3:"1.25",speed4:"1.5",speed5:"2",fontSize0:"極小",fontSize1:"適中",fontSize2:"極大"}},r3=function(){function e(t){a(this,e),this.curLang="en",this._defaultConfig={opacity:99,area:99,fontSize:50,speed:40,active:!1,usePanel:!0,danmuItems:[],maskConfig:{maskUrl:"",maskOffset:0,interval:200},maskActive:!1,external:[]},Object.assign(this._defaultConfig,t)}return l(e,[{key:"updateLang",value:function(e){this.curLang=e,this.curLangMap=i3[e]||i3.en;var t=this.curLangMap;this.sliderItemsProps=[{key:"opacity",name:t.opacity,defaultValue:99,ticks:[{name:t.opacity0,val:0,renderVal:0},{name:t.opacity1,val:33,renderVal:.33},{name:t.opacity2,val:66,renderVal:.66},{name:t.opacity3,val:99,renderVal:1}]},{key:"area",name:t.area,defaultValue:99,ticks:[{name:t.screen0,val:0,renderVal:1/4},{name:t.screen1,val:33,renderVal:.5},{name:t.screen2,val:66,renderVal:3/4},{name:t.screen3,val:99,renderVal:1}]},{key:"speed",name:t.speed,defaultValue:40,ticks:[{name:t.speed0,val:0,renderVal:1/4},{name:t.speed1,val:20,renderVal:.5},{name:t.speed2,val:40,renderVal:1},{name:t.speed3,val:60,renderVal:5/4},{name:t.speed4,val:80,renderVal:1.5},{name:t.speed5,val:100,renderVal:2}]},{key:"fontSize",name:t.fontSize,defaultValue:50,ticks:[{name:t.fontSize0,val:0,renderVal:14},{name:t.fontSize1,val:50,renderVal:16},{name:t.fontSize2,val:100,renderVal:20}]}],this._defaultConfig.external.forEach((function(t){t.name=t.lang[e]||t.lang.en}))}},{key:"getConfig",value:function(){return this._defaultConfig}},{key:"updateConfig",value:function(e){Object.assign(this._defaultConfig,e)}},{key:"updateComments",value:function(e){this._defaultConfig.danmuItems=e}},{key:"getRenderVal",value:function(e,t){var n=this.sliderItemsProps.find((function(t){return t.key===e}))||this.sliderItemsProps[0];return(n.ticks.find((function(e){return e.val===t}))||n.ticks[0]).renderVal}}]),e}(),o3=function(){function e(t){a(this,e),this.state=t,this.root=cN.createDom("xg-danmu"),Q2.addClass(this.root,"xgplayer-danmu-container")}var t;return l(e,[{key:"initDanmuContainer",value:function(){var e=this.state.getConfig(),t=e.opacity,n=void 0===t?1:t,i=e.fontSize,r=void 0===i?16:i,o=e.area,a=void 0===o?1:o,s=e.danmuItems,l=void 0===s?[]:s,c=e.active,u=e.speed,h=void 0===u?40:u,d=(c?l:[]).map((function(e){return!e.style&&(e.style={}),e})),f={container:this.root,comments:d,live:!1,area:{start:0,end:this.state.getRenderVal("area",a)}};this.danmuJs=new window["danmu.js"](f),this.setOpacity(this.state.getRenderVal("opacity",n)),this.setFontSize(this.state.getRenderVal("fontSize",r)),this.setSpeed(this.state.getRenderVal("speed",h))}},{key:"start",value:function(){this.danmuJs.start()}},{key:"pause",value:function(){this.danmuJs.pause()}},{key:"play",value:function(){this.danmuJs.play()}},{key:"stop",value:function(){this.danmuJs.stop()}},{key:"resize",value:function(){this.danmuJs.resize()}},{key:"sendDanmu",value:function(e){this.state.getConfig().active&&this.danmuJs.sendComment(e)}},{key:"clear",value:function(){this.danmuJs.clear()}},{key:"setProperty",value:function(e,t){return"opacity"===e?this.setOpacity(this.state.getRenderVal(e,t)):"area"===e?this.setArea(this.state.getRenderVal(e,t)):"speed"===e?this.setSpeed(this.state.getRenderVal(e,t)):"fontSize"===e?this.setFontSize(this.state.getRenderVal(e,t)):void 0}},{key:"setOpacity",value:function(e){this.danmuJs.setOpacity(e)}},{key:"setFontSize",value:function(e){this.danmuJs.setFontSize(e)}},{key:"setArea",value:function(e){this.danmuJs.setArea({start:0,end:this.state.getRenderVal("area",e)})}},{key:"setSpeed",value:function(e){this.danmuJs.setAllDuration("scroll",1e4/e)}},{key:"destroy",value:(t=o(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.danmuJs){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.danmuJs.stop();case 4:return e.next=6,this.danmuJs.destroy();case 6:this.danmuJs=null,this.root.parentNode.removeChild(this.root),this.root=null;case 10:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),a3=function(){function e(t){a(this,e),this.state=t,this.root=document.createElement("div"),Q2.addClass(this.root,"panel-box"),Q2.addEventListener(this.root,"click",(function(e){e.stopPropagation()}))}return l(e,[{key:"destroy",value:function(){this.root.parentNode&&this.root.parentNode.removeChild(this.root),this.root=null}}]),e}(),s3=function(){function e(t){a(this,e),this.callback=function(){},this.key=t.key,this.name=t.name,this.value=t.value,this.root=document.createElement("div"),Q2.addClass(this.root,"xg-player-switch-wrapper"),this.render()}return l(e,[{key:"render",value:function(){var e=this;if(!this.root.childNodes.length){var t=document.createElement("div");this.$left=t,Q2.addClass(t,"left"),t.innerHTML=this.name;var n=document.createElement("div");this.$right=n,Q2.addClass(n,"right"),n.innerHTML='<label class="switch">\n <input type="checkbox">\n <span class="slider round"></span>\n </label>',this.root.appendChild(t),this.root.appendChild(n);var i=this.$right.querySelector("input");Q2.addEventListener(this.$right,"click",V1((function(t){t.stopPropagation(),e.value=!e.value,e.value?null==i||i.setAttribute("checked","checked"):null==i||i.removeAttribute("checked"),e.callback(e.value)}),50))}var r=this.$right.querySelector("input");this.value?null==r||r.setAttribute("checked","checked"):r.removeAttribute("checked"),r.checked=this.value}},{key:"renderName",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.$left.innerHTML=e}},{key:"onChange",value:function(e){this.callback=e}}]),e}(),l3="pc"===vN.device,c3=Vj.POSITIONS,u3=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).seekCost=window.performance.now(),i.eventBus=new BM,window["danmu.js"]?(i.state=new r3(e.config),i.state.updateLang(i.player.lang),i.iconWrap=document.createElement("div"),Q2.addClass(i.iconWrap,"icon-warp"),i.tipsWrap=document.createElement("div"),Q2.addClass(i.tipsWrap,"tips-wrap"),i.container=new o3(i.state),i.panel=new a3(i.state),i):g(i)}return l(n,[{key:"afterCreate",value:function(){var e;null===(e=this.player.root)||void 0===e||e.appendChild(this.container.root),this.renderIcon(),this.renderBox(),this.root.appendChild(this.iconWrap),l3&&(this.state.getConfig().usePanel&&this.root.appendChild(this.panel.root),this.renderTips(),Q2.addClass(this.panel.root,"pc-panel"),this.root.appendChild(this.tipsWrap)),this.initEvents(),this.container.initDanmuContainer()}},{key:"afterPlayerInit",value:function(){this.initDanmuMask()}},{key:"updateLang",value:function(e){this.state.updateLang(this.player.lang),this.eventBus.emit("updateLang")}},{key:"registerIcons",value:function(){return{open:{icon:X1,class:"xgplayer-danmu-open-svg"},close:{icon:J1,class:"xgplayer-danmu-close-svg"},reset:{icon:Z1,class:"xgplayer-danmu-reset-svg"}}}},{key:"initEvents",value:function(){l3?this.bindPCEvent():this.bindMobileEvent(),this.bindPlayerEvent()}},{key:"bindPlayerEvent",value:function(){var e=this;this.once(ON,(function(){e.container.start()})),this.on(TN,(function(){e.container.pause()})),this.on(kN,(function(){e.container.play()})),this.on(CN,(function(){e.seekCost=window.performance.now(),e.container.stop()})),this.on(xN,V1((function(){e.container.start()}),300)),this.on([$N,XN,JN],(function(){e.container.resize(),e.handleResize()})),this.on(nj,this.handlePIP.bind(this))}},{key:"bindPCEvent",value:function(){var e=this;Q2.addEventListener(this.root,"click",this.onClick.bind(this)),Q2.addEventListener(this.root,"mouseenter",(function(){var t=e.state.getConfig().active,n=e.player.controls;"rightSide"===e.config.listType?n.blur():n.focus(),t?(Q2.style(e.panel.root,{display:"block"}),Q2.style(e.tipsWrap,{display:"none"})):(Q2.style(e.panel.root,{display:"none"}),Q2.style(e.tipsWrap,{display:"block"}))})),Q2.addEventListener(this.root,"mouseleave",(function(){var t=e.player.controls;"rightSide"===e.config.listType?t.focus():t.focusAwhile(),Q2.style(e.panel.root,{display:"none"}),Q2.style(e.tipsWrap,{display:"none"})}))}},{key:"bindMobileEvent",value:function(){var e=this;Q2.addEventListener(this.root,"click",(function(){e.state.getConfig().usePanel?e.player.panel.showPanel(e.panel.root):e.onClick()}))}},{key:"onClick",value:function(){this.toggleDanmu(),this.renderIcon()}},{key:"toggleDanmu",value:function(){var e=this.state.getConfig(),t=e.active,n=e.maskActive,i=!t;i?(this.state.updateConfig({active:i}),n&&this.initMask()):(null==this||this.container.clear(),this.destroyMask(),this.state.updateConfig({active:i})),this.player.emit(k1.DANMU_CHANGE,{active:i}),this.danmuSwitchInSettingPanel&&(this.danmuSwitchInSettingPanel.value=i,this.danmuSwitchInSettingPanel.render())}},{key:"renderIcon",value:function(){this.iconWrap.innerHTML="",this.state.getConfig().active?this.iconWrap.appendChild(this.icons.open):this.iconWrap.appendChild(this.icons.close)}},{key:"renderTips",value:function(){this.tipsWrap.innerHTML=this.state.curLangMap.openDanmu}},{key:"renderBox",value:function(){var e=this;this.panel.root.innerHTML="";var t=document.createElement("div");Q2.addClass(t,"box-header"),t.innerHTML='<div class="header-setting">'+this.state.curLangMap.danmuSetting+'</div> <div class="header-reset"></div>';var n=t.querySelector(".header-reset");n.appendChild(this.icons.reset),Q2.addEventListener(n,"click",(function(t){t.stopPropagation(),e.eventBus.emit("reset")}),{capture:!0});var i=document.createElement("span");i.innerHTML=this.state.curLangMap.reset,n.appendChild(i),this.eventBus.on("updateLang",(function(){i.innerHTML=e.state.curLangMap.reset,t.querySelector(".header-setting").innerHTML=e.state.curLangMap.danmuSetting})),this.panel.root.appendChild(t),l3||this.renderTurnOff(),this.renderSliders(),this.renderSwitches()}},{key:"renderTurnOff",value:function(){var e=this,t={name:this.state.curLangMap.danmuSwitch,key:"active",value:this.state.getConfig().active||!1},n=new s3(t);this.danmuSwitchInSettingPanel=n,this.panel.root.appendChild(n.root),n.onChange((function(t){e.toggleDanmu(),e.renderIcon()})),this.eventBus.on("updateLang",(function(){n.renderName(e.state.curLangMap.danmuSwitch)}))}},{key:"renderSwitches",value:function(){var e,t=this;null===(e=this.state.getConfig().external)||void 0===e||e.forEach((function(e){var n=new s3(e);t.panel.root.appendChild(n.root),t.eventBus.on("updateLang",(function(){n.renderName(e.name)})),n.onChange((function(n){var i=t.state.getConfig().external||[];i.forEach((function(t){t.key===e.key&&(t.value=n)})),t.state.updateConfig({external:i}),t.player.emit(k1.DANMU_CHANGE,{external:i})}))}))}},{key:"renderSliders",value:function(){var e=this;this.state.sliderItemsProps.forEach((function(t,n){var i,r,o=document.createElement("div"),a=new e3(o,t);null!=(null===(i=e.state.getConfig())||void 0===i?void 0:i[t.key])&&a.setValue(null===(r=e.state.getConfig())||void 0===r?void 0:r[t.key]);a.onChange((function(n){e.state.updateConfig(c({},t.key,n)),console.log("val",e.state.getConfig()),e.player.emit(k1.DANMU_CHANGE,c({},t.key,n)),e.container.setProperty(t.key,n)})),e.eventBus.on("reset",(function(){a.setValue(t.defaultValue)})),e.eventBus.on("updateLang",(function(){a.renderText(e.state.sliderItemsProps[n])})),e.panel.root.appendChild(o)}))}},{key:"sendDanmu",value:function(e){return this.container.sendDanmu(e)}},{key:"updateConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.state.updateConfig(e)}},{key:"getConfig",value:function(){return this.state.getConfig()}},{key:"initDanmuMask",value:function(){if(this.player){var e=this.state.getConfig(),t=e.maskConfig,n=e.active,i=e.maskActive;t.maskUrl&&(this.renderDanmuMaskTurnOff(),n&&i&&this.initMask())}}},{key:"renderDanmuMaskTurnOff",value:function(){var e=this,t={name:this.state.curLangMap.danmuMask,key:"maskActive",value:this.state.getConfig().maskActive||!1},n=new s3(t);this.panel.root.appendChild(n.root),n.onChange((function(t){e.state.updateConfig({maskActive:t}),t?e.initMask():e.destroyMask(),e.renderIcon()})),this.eventBus.on("updateLang",(function(){n.renderName(e.state.curLangMap.danmuMask)}))}},{key:"initMask",value:function(){this.destroyMask();var e=this.state.getConfig(),t=e.maskConfig,n=e.maskActive,i=e.active;t.maskUrl&&n&&i&&(window.DanmuMask&&"function"==typeof window.DanmuMask&&(this.mask=new window.DanmuMask({player:this.player,url:t.maskUrl,originStart:t.maskOffset,interval:t.interval})),this.mask.init())}},{key:"destroyMask",value:function(){this.mask&&(this.mask.destroy(),this.mask=null)}},{key:"handleResize",value:function(){var e,t,n,i;if(this.mask){var r=this.player;this.mask.setContainerSize(null!==(e=null==r||null===(t=r.root)||void 0===t?void 0:t.offsetWidth)&&void 0!==e?e:0,null!==(n=null==r||null===(i=r.root)||void 0===i?void 0:i.offsetHeight)&&void 0!==n?n:0)}}},{key:"handlePIP",value:function(e){e?this.destroyMask():this.initMask()}},{key:"destroy",value:function(){this.destroyMask(),this.container.destroy(),this.panel.destroy()}},{key:"render",value:function(){return'<div class="xgplayer-danmu"></div>'}}],[{key:"pluginName",get:function(){return"DanmuPlugin"}},{key:"defaultConfig",get:function(){return{position:c3.CONTROLS_RIGHT,index:T1}}}]),n}(Vj);function h3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d3(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function f3(e,t,n){return t&&d3(e.prototype,t),n&&d3(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function p3(e,t){return(p3=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function g3(e){return(g3="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 v3(e,t){if(t&&("object"===g3(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function y3(e){return(y3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m3(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _3=J,b3=bi,k3=Date.prototype,w3="Invalid Date",E3="toString",T3=_3(k3.toString),S3=_3(k3.getTime);String(new Date(NaN))!=w3&&b3(k3,E3,(function(){var e=S3(this);return e==e?T3(this):w3}));var C3=YA;Er({target:"Function",proto:!0,forced:Function.bind!==C3},{bind:C3});var x3=S,O3=rg,P3=fe,I3=og,L3=hu,D3=/MSIE .\./.test(we),A3=x3.Function,M3=function(e){return D3?function(t,n){var i=L3(arguments.length,1)>2,r=P3(t)?t:A3(t),o=i?I3(arguments,2):void 0;return e(i?function(){O3(r,this,o)}:r,n)}:e},R3={setTimeout:M3(x3.setTimeout),setInterval:M3(x3.setInterval)},N3=R3.setInterval;Er({global:!0,bind:!0,forced:S.setInterval!==N3},{setInterval:N3});var j3=R3.setTimeout;Er({global:!0,bind:!0,forced:S.setTimeout!==j3},{setTimeout:j3});var B3,U3,H3={MENU_REPORT:"MENU_REPORT",MENU_LOG:"MENU_LOG"},F3={VID:5,TYPE:10,CODECS:20,SPEED:30,BUFFER:40,PLAY_QUALITY:50,SCHEME:60,RESOLUTION:70,VIEWPORT:80,VOLUME:90,CDN:100,P2P:110,PLAYER_VERSION:120},G3={MENU:0,INTERACT:1,CONTEXTMENU:2},V3={STATS:0,REPORT:1},z3={CLOSE:0,COPY:1},W3={SHOW:0,HIDE:1},K3={STATS:"STATS",REPORT:"REPORT",CLOSE:"CLOSE",COPY:"COPY",CONTEXTMENU_SHOW:"CONTEXTMENU_SHOW",CONTEXTMENU_HIDE:"CONTEXTMENU_HIDE"},q3=Object.freeze(Object.defineProperty({__proto__:null,CONTEXTMENU_TYPES:W3,EVENTS:H3,INFO_TYPES:F3,INTERACT_TYPES:z3,LOG_EVENTS:K3,LOG_TYPES:G3,MENU_TYPES:V3},Symbol.toStringTag,{value:"Module"}));function Y3(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(xX){return!1}}();return function(){var n,i=y3(e);if(t){var r=y3(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return v3(this,n)}}var $3={cn:(B3={},m3(B3,F3.VID,"VID"),m3(B3,F3.TYPE,"类型"),m3(B3,F3.CODECS,"编码"),m3(B3,F3.SPEED,"加载速度"),m3(B3,F3.BUFFER,"缓冲时长"),m3(B3,F3.PLAY_QUALITY,"丢帧率"),m3(B3,F3.SCHEME,"视频协议"),m3(B3,F3.RESOLUTION,"分辨率"),m3(B3,F3.VIEWPORT,"视图尺寸"),m3(B3,F3.VOLUME,"音量大小"),m3(B3,F3.CDN,"CDN"),m3(B3,F3.P2P,"P2P"),m3(B3,F3.PLAYER_VERSION,"播放器版本"),B3),en:(U3={},m3(U3,F3.VID,"Video ID"),m3(U3,F3.TYPE,"Video Type"),m3(U3,F3.CODECS,"Codecs"),m3(U3,F3.SPEED,"Connection Speed"),m3(U3,F3.BUFFER,"Buffer Health"),m3(U3,F3.PLAY_QUALITY,"Dropped Frames"),m3(U3,F3.SCHEME,"Protocol"),m3(U3,F3.RESOLUTION,"Res"),m3(U3,F3.VIEWPORT,"Viewport"),m3(U3,F3.VOLUME,"Volume"),m3(U3,F3.CDN,"CDN"),m3(U3,F3.P2P,"P2P"),m3(U3,F3.PLAYER_VERSION,"Player Version"),U3)},X3=function(e){!function(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&&p3(e,t)}(n,e);var t=Y3(n);function n(){return h3(this,n),t.apply(this,arguments)}return f3(n,[{key:"afterCreate",value:function(){}},{key:"onPluginsReady",value:function(){var e=this.player.plugins.stats;this.menuInst=new J3(this.player,this.config||{},e)}}],[{key:"pluginName",get:function(){return"MenuPlugin"}},{key:"defaultConfig",get:function(){return{enableDebug:!0}}}]),n}(Dj),J3=function(){function e(t,n,i){h3(this,e),this.player=t,this.options=n||{},this.statsPlugin=i;var r={report:'<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="M5.71429 5C5.3198 5 5 5.3198 5 5.71429V14.2857C5 14.6802 5.3198 15 5.71429 15H14.2857C14.6802 15 15 14.6802 15 14.2857V10C15 9.44772 15.4477 9 16 9C16.5523 9 17 9.44772 17 10V14.2857C17 15.7848 15.7848 17 14.2857 17H5.71429C4.21523 17 3 15.7848 3 14.2857V5.71429C3 4.21523 4.21523 3 5.71429 3H10C10.5523 3 11 3.44772 11 4C11 4.55228 10.5523 5 10 5H5.71429Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16.7071 3.29289C17.0976 3.68342 17.0976 4.31658 16.7071 4.70711L10.7071 10.7071C10.3166 11.0976 9.68342 11.0976 9.29289 10.7071C8.90237 10.3166 8.90237 9.68342 9.29289 9.29289L15.2929 3.29289C15.6834 2.90237 16.3166 2.90237 16.7071 3.29289Z" fill="currentColor"/></svg>',stats:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 10C9 9.44771 9.44771 9 10 9C10.5523 9 11 9.44772 11 10V13C11 13.5523 10.5523 14 10 14C9.44771 14 9 13.5523 9 13V10Z" fill="currentColor"/><path d="M10 6C9.44771 6 9 6.44772 9 7C9 7.55228 9.44771 8 10 8C10.5523 8 11 7.55228 11 7C11 6.44772 10.5523 6 10 6Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M18 10C18 14.4183 14.4183 18 10 18C5.58172 18 2 14.4183 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10ZM10 16C13.3137 16 16 13.3137 16 10C16 6.68629 13.3137 4 10 4C6.68629 4 4 6.68629 4 10C4 13.3137 6.68629 16 10 16Z" fill="currentColor"/></svg>',close:'<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="M16.1231 4.08053C16.5136 4.47105 16.5136 5.10422 16.1231 5.49474L11.453 10.1648L16.1231 14.8349C16.5136 15.2254 16.5136 15.8586 16.1231 16.2491C15.7326 16.6397 15.0994 16.6397 14.7089 16.2491L10.0388 11.579L5.36873 16.2491C4.9782 16.6397 4.34504 16.6397 3.95451 16.2491C3.56399 15.8586 3.56399 15.2254 3.95451 14.8349L8.6246 10.1648L3.95451 5.49474C3.56399 5.10422 3.56399 4.47105 3.95451 4.08053C4.34504 3.69001 4.9782 3.69001 5.36873 4.08053L10.0388 8.75061L14.7089 4.08053C15.0994 3.69 15.7326 3.69 16.1231 4.08053Z" fill="currentColor"/></svg>',copy:'<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="M6 3C5.44772 3 5 3.44772 5 4C5 4.55228 5.44772 5 6 5H13.5C14.3284 5 15 5.67157 15 6.5V14C15 14.5523 15.4477 15 16 15C16.5523 15 17 14.5523 17 14V6.5C17 4.567 15.433 3 13.5 3H6ZM4 8H12V16H4L4 8ZM2 8C2 6.89543 2.89543 6 4 6H12C13.1046 6 14 6.89543 14 8V16C14 17.1046 13.1046 18 12 18H4C2.89543 18 2 17.1046 2 16V8ZM5.75 9.5C5.33579 9.5 5 9.83579 5 10.25C5 10.6642 5.33579 11 5.75 11H10.25C10.6642 11 11 10.6642 11 10.25C11 9.83579 10.6642 9.5 10.25 9.5H5.75ZM5 13.75C5 13.3358 5.33579 13 5.75 13H10.25C10.6642 13 11 13.3358 11 13.75C11 14.1642 10.6642 14.5 10.25 14.5H5.75C5.33579 14.5 5 14.1642 5 13.75Z" fill="currentColor"/></g></svg>'},o=Object.assign({},r,this.options.icons);this.options.icons=o,this.playerInstance="dash_"+(new Date).getTime(),window[this.playerInstance]=this.player,this.menuItems=[{name:"视频统计信息",handler:this.showPanelInfo.bind(this),type:V3.STATS,icon:o.stats,eventName:K3.STATS},{name:"播放问题反馈",handler:this._handleReport.bind(this),type:V3.REPORT,icon:o.report,eventName:K3.REPORT}],this.playerHandler=[{evt:"RESOLUTION_UPDATE",handler:this._resolutionUpdate.bind(this)},{evt:"menusegment",handler:this._recordLastSegment.bind(this)},{evt:"resourceReady",handler:this._startup.bind(this)},{evt:"canplay",handler:this._startup.bind(this)},{evt:"ended",handler:this.destroyDOM.bind(this)},{evt:"destroy",handler:this.destroy.bind(this)},{evt:"playertypechange",handler:this.destroyDOM.bind(this)},{evt:"codecsupdate",handler:this._codecsUpdate.bind(this)}];for(var a=0;a<this.playerHandler.length;a++){var s=this.playerHandler[a],l=s.evt,c=s.handler;this.player.on(l,c)}this.debugInfo={ua:navigator.userAgent,version:this.player.playerVersion},this._pollTimer=null,this.hasInitDOM=!1,this._cacheMap={},this.menuHandler=this._menuHandler.bind(this),this.munuHideHandler=this._munuHideHandler.bind(this),this.rootClickHandler=this._rootClickHandler.bind(this),this._initDatas()}return f3(e,[{key:"_reset",value:function(){this.hasInitDOM=!1,this._cacheMap={},this._lastSegment=null}},{key:"_noop",value:function(){}},{key:"_recordLastSegment",value:function(e){this._lastSegment=e}},{key:"_resolutionUpdate",value:function(e){if(!this._cacheUpdate(F3.RESOLUTION)){var t=this.infoItems[F3.RESOLUTION];e?(t.value=e,this.updateInfoItem(t)):(t.hide=!0,this.createPanelInfo())}}},{key:"_codecsUpdate",value:function(e){if(!this._cacheUpdate(F3.CODECS)){var t=this.infoItems[F3.CODECS];t.value=e,this.updateInfoItem(t)}}},{key:"_cacheUpdate",value:function(e){return!this.hasInitDOM&&(this._cacheMap[e]=!0,!0)}},{key:"_handleReport",value:function(){for(var e=this.player.video.readyState,t=this.player.video.buffered,n=[],i=0;i<t.length;i++){var r=t.start(i),o=t.end(i);n.push({start:r,end:o})}var a={readyState:e,curTime:this.player.video.currentTime,err:this.player.video.error||-1,buffer:n},s=Object.assign({debug_date:new Date,type:this.type},this.debugInfo,{videoInfo:a});this._lastSegment&&(s.segment=this._lastSegment),this.options.enableDebug&&this.statsPlugin&&(s.stats=this.statsPlugin.getStats()),this.player.emit(H3.MENU_REPORT,s)}},{key:"_startup",value:function(){if(!this.hasInitDOM){this.type=this.player.currentFormat,this._initDatas(),this._initDOM();for(var e=Object.keys(this._cacheMap),t=0;t<e.length;t++){var n=e[t],i=this.infoItems[n];this.updateInfoItem(i,!0)}}}},{key:"_initDatas",value:function(){var e;this.parentNode=this.player.root,this._isPlayQualitySupported=this.player.video&&"function"==typeof this.player.video.getVideoPlaybackQuality;var t=this.player.playerType,n=$3.cn,i=this.options.lang||"cn";this.langConfig=this.options.langConfig||$3[i]||n,this.infoItems=(m3(e={},F3.VID,{name:"VID",value:this.player.config.vid,render:Z3,hide:!this.player.config.vid,key:"vid"}),m3(e,F3.TYPE,{name:"类型",value:t,render:Z3,key:"player_type"}),m3(e,F3.CODECS,{name:"编码",value:this.player.menuCodeType,render:Z3,key:"menuCodeType",hide:!this.player.menuCodeType}),m3(e,F3.SPEED,{name:"加载速度",value:0,render:Z3,posfix:" KB/s",hide:!this._isMenusHide("speed"),key:"speed"}),m3(e,F3.BUFFER,{name:"缓冲时长",value:0,render:Z3,posfix:"s",key:"buffer"}),m3(e,F3.PLAY_QUALITY,{name:"丢帧率",value:{droppedVideoFrames:0,totalVideoFrames:0},render:Q3,hide:null===this.player.video.getVideoPlaybackQuality,key:"frames_info"}),m3(e,F3.SCHEME,{name:"视频协议",value:"HTTPS",render:Z3,key:"scheme"}),m3(e,F3.CDN,{name:"CDN",value:this.player.CDNUrl?this.player.CDNUrl:"false",render:Z3,hide:!this._isMenusHide("cdn"),key:"CDN"}),m3(e,F3.P2P,{name:"P2P",value:"false",render:Z3,hide:!0,key:"p2p"}),m3(e,F3.RESOLUTION,{name:"分辨率",value:{width:0,height:0,fps:void 0},render:e5,hide:!this._isMenusHide("resolution"),key:"resolution"}),m3(e,F3.VIEWPORT,{name:"视图尺寸",value:{width:0,height:0},render:e5,key:"viewport"}),m3(e,F3.VOLUME,{name:"音量大小",value:(100*this.player.config.volume).toFixed(0)+"%",render:Z3,key:"volume"}),m3(e,F3.PLAYER_VERSION,{name:"播放器版本",value:this.player.playerVersion,render:Z3,key:"player_version"}),e);for(var r=Object.keys(this.infoItems),o=0;o<r.length;o++){var a=r[o];this.infoItems[a].type=a}for(var s=this.options.infoItems||[],l=0;l<s.length;l++){var c=s[l];c.name&&c.type&&c.key?(c.render&&i5(c.render)||(c.render=Z3),this.infoItems[c.type]=c):n5("".concat(c.name))}}},{key:"_isMenusHide",value:function(e){return!0===(this.player.supportMenus||{})[e]}},{key:"renderItemByType",value:function(e,t){var n=this.infoItems[e];n?(n.value=t,this._cacheUpdate(e)||this.updateInfoItem(n)):n5("".concat(e," item null"))}},{key:"_initDOM",value:function(){if(this.parentNode&&cN){this.hasInitDOM=!0;var e=document.createDocumentFragment(),t=document.createElement("xg-menu");cN.addClass(t,"xg-menu"),this.rightMenu=t;for(var n=this.menuItems.filter((function(e){return!e.hide})),i=0;i<n.length;i++)e.appendChild(this.createMenuItem(n[i]));t.appendChild(e),this.toggle(this.rightMenu,!1),this.parentNode.appendChild(t),this.parentNode.addEventListener("contextmenu",this.menuHandler,!1),document.addEventListener("click",this.munuHideHandler,!1),this.parentNode.addEventListener("click",this.rootClickHandler,!0),this.createPanelInfo(),this.bindEvents(),this.tick()}}},{key:"_menuHandler",value:function(e){if(e.preventDefault(),e.stopPropagation(),this.isPIPMode())return!1;var t=this.getOffset(),n=e.clientX-t.x+document.body.scrollLeft+document.documentElement.scrollLeft,i=e.clientY-t.y+document.body.scrollTop+document.documentElement.scrollTop,r=this.parentNode.clientWidth,o=this.parentNode.clientHeight;this.toggle(this.rightMenu,!0);var a=this.rightMenu.offsetWidth,s=this.rightMenu.offsetHeight,l=n+a>r?r-a:n,c=i+s>o?o-s:i;this.rightMenu.style.left=l+"px",this.rightMenu.style.top=c+"px",this.emitLog(G3.CONTEXTMENU,W3.SHOW,K3.CONTEXTMENU_SHOW)}},{key:"getOffset",value:function(){for(var e=this.parentNode,t=0,n=0;e&&!Number.isNaN(e.offsetLeft)&&!Number.isNaN(e.offsetTop);)t+=e.offsetLeft-e.scrollLeft,n+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:n}}},{key:"_munuHideHandler",value:function(){this.rightMenu&&"block"===this.rightMenu.style.display&&this.emitLog(G3.CONTEXTMENU,W3.HIDE,K3.CONTEXTMENU_HIDE),this.toggle(this.rightMenu,!1)}},{key:"_rootClickHandler",value:function(e){"block"===this.rightMenu.style.display&&e.target===this.player.video&&(e.stopPropagation(),e.preventDefault(),this._munuHideHandler())}},{key:"tick",value:function(){var e=this;this._pollTimer=setTimeout((function(){clearTimeout(e._pollTimer),e._poll(),e.tick(),e.isPIPMode()&&(e.toggle(e.rightMenu,!1),e.toggle(e.panelInfo,!1))}),500)}},{key:"_poll",value:function(){var e=this.bufferLength,t=this.infoItems[F3.BUFFER];if(t.value=e,this.updateInfoItem(t),this.player.video.getVideoPlaybackQuality){var n=this.player.video.getVideoPlaybackQuality(),i=this.infoItems[F3.PLAY_QUALITY];i.value={totalVideoFrames:n.totalVideoFrames,droppedVideoFrames:n.droppedVideoFrames},this.updateInfoItem(i)}var r=this.infoItems[F3.SPEED];if(!r.hide){var o=Math.floor(this.player.downloadSpeed);r.value=o,this.updateInfoItem(r)}}},{key:"bindEvents",value:function(){var e=this,t=this.player.video;this.handleVolumeChange=this._handleVolumeChange.bind(this),t.addEventListener("volumechange",this.handleVolumeChange);t.addEventListener("DOMNodeInserted",(function n(){t.removeEventListener("DOMNodeInserted",n),e._onWinElemSizeChange()})),this.onWinSizeChange=function(e,t,n){var i;return function(){var r=this,o=arguments,a=function(){i=null,n||e.apply(r,o)},s=n&&!i;clearTimeout(i),i=setTimeout(a,t),s&&e.apply(r,o)}}(this._onWinElemSizeChange.bind(this),1e3,!1),window.addEventListener("resize",this.onWinSizeChange),e._onWinElemSizeChange()}},{key:"_onWinElemSizeChange",value:function(){if(this.player&&this.player.video){var e=this.player.video.getBoundingClientRect(),t=this.infoItems[F3.VIEWPORT];if(t.value={width:Math.floor(e.width),height:Math.floor(e.height)},this._cacheUpdate(F3.VIEWPORT))return;this.updateInfoItem(t)}}},{key:"_handleVolumeChange",value:function(){var e=this.infoItems[F3.VOLUME];e.value=(100*this.player.video.volume).toFixed(0)+"%",this._cacheUpdate(F3.VOLUME)||this.updateInfoItem(e)}},{key:"createMenuItem",value:function(e){var t=this,n=document.createElement("div");if(n.classList.add("v-menu-item"),e.clsName&&n.classList.add(e.clsName),e.icon){var i=document.createElement("div");cN.addClass(i,"menu-item-icon"),i.innerHTML=e.icon,n.appendChild(i)}var r=document.createElement("div");return cN.addClass(r,"menu-item-content"),r.textContent=e.name,n.appendChild(r),!1!==n.clickable&&n.addEventListener("click",(function(n){n.stopPropagation(),n.preventDefault(),t.toggle(t.rightMenu,!1),e.handler(),t.emitLog(G3.MENU,e.type,e.eventName)})),n}},{key:"createIconBtn",value:function(e,t,n,i){var r=document.createElement("div");return cN.addClass(r,e),r.innerHTML=t+"<div class='svg-hover'>".concat(n,"</div>"),i.appendChild(r),r}},{key:"createPanelInfo",value:function(){var e=this,t=document.createElement("xg-panel-info");cN.addClass(t,"xg-panel-info"),this.createIconBtn("xg-info-close xg-interact-icon",this.options.icons.close,"关闭",t).addEventListener("click",(function(){e.toggle(t,!1),e.panelVisible=!1,e.emitLog(G3.INTERACT,z3.CLOSE,K3.CLOSE)})),this.createIconBtn("xg-info-copy xg-interact-icon",this.options.icons.copy,"复制",t).addEventListener("click",(function(){for(var t=Object.values(e.infoItems).filter((function(e){return!e.hide})),n={},i=0;i<t.length;i++){var r=t[i],o=r.key,a=void 0;a=e.options.connectPrefix&&r.posfix?"".concat(r.value).concat(r.posfix):r.value,n[o]=a}e.options.enableDebug&&e.statsPlugin&&Object.assign(n,{stats:e.statsPlugin.getStats()}),e.copyToClipboard(JSON.stringify(n)),e.emitLog(G3.INTERACT,z3.COPY,K3.COPY)}));var n=document.createElement("ul");cN.addClass(n,"xg-panel-detail");for(var i=Object.values(this.infoItems).filter((function(e){return!e.hide})),r=document.createDocumentFragment(),o=0;o<i.length;o++){var a=this.createInfoItem(i[o]);r.appendChild(a)}n.appendChild(r),t.appendChild(n),this.panelInfo=t,this.player.root.appendChild(t)}},{key:"createInfoItem",value:function(e){var t=document.createElement("li");return e.elem=t,this.updateInfoItem(e),t}},{key:"showPanelInfo",value:function(){this.toggle(this.panelInfo,!0),this.panelVisible=!0;for(var e=Object.values(this.infoItems).filter((function(e){return!e.hide})),t=0;t<e.length;t++)this.updateInfoItem(e[t])}},{key:"copyToClipboard",value:function(e){var t=document.createElement("textarea");t.style.height="0px",t.style.width="1px",document.body.appendChild(t),t.value=e,t.select(),document.execCommand("copy"),document.body.removeChild(t)}},{key:"updateInfoItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.panelVisible||t){var n=e.elem;t5(n);var i=document.createElement("label"),r=this.langConfig[e.type]||e.name;i.textContent=r+"",cN.addClass(i,"xg-item-label"),n.appendChild(i);var o=document.createElement("span"),a=e.ctx||null,s=e.render.call(a,e.value);s instanceof Element?o.appendChild(s):o.textContent="".concat(s).concat(e.posfix?e.posfix:""),n.appendChild(o)}}},{key:"toggle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&(e.style.display=t?"block":"none")}},{key:"bufferLength",get:function(){var e=this.player.getBufferedRange(),t=this.player.video.currentTime,n=e[1]-Math.max(e[0],t);return n=Math.max(0,n).toFixed(2),parseFloat(n)}},{key:"destroyDOM",value:function(){this.parentNode.removeEventListener("contextmenu",this.menuHandler),document.removeEventListener("click",this.munuHideHandler,!1),this.parentNode.removeEventListener("click",this.rootClickHandler,!0),this._reset(),this.removeElement(this.rightMenu),this.removeElement(this.panelInfo),this.rightMenu=null,this.panelInfo=null,this._pollTimer&&clearTimeout(this._pollTimer)}},{key:"destroy",value:function(){this.destroyDOM(),this.destroyEvents()}},{key:"destroyEvents",value:function(){for(var e=0;e<this.playerHandler.length;e++){var t=this.playerHandler[e],n=t.evt,i=t.handler;this.player.off(n,i)}window.removeEventListener("resize",this.onWinSizeChange)}},{key:"removeElement",value:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)}},{key:"isPIPMode",value:function(){return cN.hasClass(this.parentNode,"xgplayer-pip-active")}},{key:"emitLog",value:function(e,t,n){this.player.emit(H3.MENU_LOG,{logType:e,code:t,event:n})}}]),e}();function Z3(e){return e}function Q3(e){var t=e.droppedVideoFrames,n=e.totalVideoFrames,i=0;i=0===n?0:t/n*100;var r=document.createElement("span"),o=document.createElement("span");o.textContent=t,r.appendChild(o);var a=document.createElement("span");return a.textContent="/".concat(n,", ").concat(i.toFixed(2),"%"),r.appendChild(a),r}function e5(e){var t=e.width,n=e.height,i=e.fps;return"".concat(t," * ").concat(n).concat(void 0!==i?" / ".concat(i,"fps"):"")}function t5(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function n5(e){console&&console.warn&&console.warn(e)}function i5(e){return"[object Function]"===Object.prototype.toString.call(e)}X3.MenuEvents=q3,X3.Menu=J3;var r5=ae,o5=wo,a5=/"/g,s5=J("".replace),l5=x,c5=function(e,t,n,i){var r=o5(r5(e)),o="<"+t;return""!==n&&(o+=" "+n+'="'+s5(o5(i),a5,""")+'"'),o+">"+r+"</"+t+">"};Er({target:"String",proto:!0,forced:function(e){return l5((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}("sub")},{sub:function(){return c5(this,"sub","","")}});var u5=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),c(p(i=t.call(this)),"_onChange",(function(e){var t=i._media.textTracks;if(t&&0!==t.length){for(var n=[],r=[],o=-1,a=0;a<t.length;a++){var s=t[a];"subtitles"===s.kind&&(n.push({id:s.id||s.language,language:s.language,text:s.label,isDefault:"showing"===s.mode}),-1===o&&"showing"===s.mode&&(o=a),r.push(s.language))}r.join("|")!==i._languages?(i._languages=r.join("|"),i.emit("reset",{list:n,isOpen:o>-1})):-1===o?i.emit("off"):i.curIndex!==o&&i.emit("change",n[o]),i.curIndex=o}})),i._media=e,i._list=[],i._languages="",i.curIndex=-1,i._init(),i}return l(n,[{key:"_init",value:function(){var e=this._media.textTracks;e?(e.addEventListener("change",this._onChange),e.addEventListener("addtrack",this._onChange)):console.warn("current browser not support native subtitle")}},{key:"switch",value:function(e){var t=this;return new Promise((function(n,i){if(!e)return i({code:1,message:"no subtitle data"});for(var r=t._media.textTracks,o=0;o<r.length;o++){var a=r[o];a.language===e.language?a.mode="showing":"showing"===a.mode&&(a.mode="disabled")}return n({code:0})}))}},{key:"switchOff",value:function(){for(var e=this._media.textTracks,t=0;t<e.length;t++)e[t].mode="disabled";this.curIndex=-1}},{key:"destroy",value:function(){this._media.textTracks.removeEventListener("change",this._onChange),this._media=null,this._list=[],this._languages="",this.curIndex=-1}}]),n}(BM);function h5(){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 d5(){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}var f5=Vj.POSITIONS,p5="mobile"===vN.device,g5="text-close";function v5(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=-1;return e.map((function(e,n){e.id||e.language||(e.id=""+n),!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=n:e.isDefault=e.default=!1)})),t}var y5=function(e){u(r,e);var n=v(r);function r(e){var t;a(this,r),(t=n.call(this,e)).isOpenState=!0,t.optionList=null,t.currentLang="",t.handlerClickSwitch=function(e,n){e.stopPropagation(),e.preventDefault(),t.subTitles&&(n.type===g5?t.switchOffSubtitle():t.switchSubTitle({language:n.language,id:n.id}))},t.onPlayerFocus=function(e){t.subTitles&&t.config.style.follow&&t.rePosition()},t.onPlayerBlur=function(e){t.subTitles&&t.config.style.follow&&!t.playerConfig.marginControls&&t.subTitles.root&&(t.subTitles.root.style.transform="translate(0, 0)")};var i=e.player;return e.config,i.config.isLive&&(e.config.updateMode="live",vN.os.isIos&&(e.config.mode="native")),t}return l(r,[{key:"afterCreate",value:function(){var e=this.config.list,t=void 0===e?[]:e;this.curIndex=-1,this.curItem=null;var n=v5(t);m(h(r.prototype),"afterCreate",this).call(this),"native"===this.config.mode?this._initNativeSubtitle(n):this._initExtSubTitle(n)}},{key:"_initNativeSubtitle",value:function(e){var t=this.player;t._subTitles||(t._subTitles=new u5(t.video)),this.subTitles=t._subTitles,this.subTitles.on("off",this._onOff.bind(this)),this.subTitles.on("change",this._onChange.bind(this)),this.subTitles.on("reset",this._onListReset.bind(this)),this._renderList(e)}},{key:"_initExtSubTitle",value:function(e){var t=this.config,n=t.list,i=void 0===n?[]:n,r=t.style,o=t.isDefaultOpen,a={subTitles:i,defaultOpen:o,debugger:!1,updateMode:t.updateMode};this.isOpenState=o,Object.keys(r).map((function(e){a[e]=r[e]})),!this.playerConfig.marginControls&&this.player.controls.root&&(this.on(BN,this.onPlayerFocus),this.on(UN,this.onPlayerBlur));var s=this.player;s._subTitles?s._subTitles._isOpen&&(e=this.getSubTitleIndex(this.config.list,s._subTitles.currentText)):(s._subTitles=new S$(a),s._subTitles.attachPlayer(this.player),this.changeTipText()),this.subTitles=s._subTitles,this.subTitles.on("off",this._onOff.bind(this)),this.subTitles.on("change",this._onChange.bind(this)),this.subTitles.on("reset",this._onListReset.bind(this)),r.follow&&this.subTitles.root&&cN.addClass(this.subTitles.root,"follow-control"),this._renderList(e)}},{key:"_renderList",value:function(e){var t=this.config,n=t.list,i=void 0===n?[]:n,r=t.isDefaultOpen;i.length&&(r&&e<0?(i[0].isDefault=!0,this.curIndex=0,this.curItem=i[0]):(this.curIndex=e,this.curItem=i[e])),this.appendChild(".xgplayer-icon",this.icons.vttSubOpen),this.appendChild(".xgplayer-icon",this.icons.vttSubClose),this.creatOptionList(),this.initEvents(),this.isOpenState?cN.addClass(this.root,"isOpen"):cN.addClass(this.root,"isClose")}},{key:"_onOff",value:function(){this.noShowSubtitle()}},{key:"_onChange",value:function(e){var t=this.getSubTitleIndex(this.config.list,e);t<0||this.updateCurItem(t,e)}},{key:"_onListReset",value:function(e){this.updateList(e)}},{key:"updateCurItem",value:function(e,n){this.curIndex=e,this.curItem=this.config.list[e-1],this.renderItemList(),this.emit("subtitle_change",t({off:!1,isListUpdate:!1,list:[]},n))}},{key:"initEvents",value:function(){this.bind(["click"],this.handleButtonChange.bind(this)),this.bind(["mouseenter"],this.showList.bind(this)),this.bind(["mouseleave"],this.hideList.bind(this)),this._delegates=[]}},{key:"handleButtonChange",value:function(e){e.preventDefault(),e.stopPropagation(),e.delegateTarget||(p5?this.showMobilePanel():this.isOpenState?this.switchOffSubtitle():this.openSubtitle())}},{key:"showList",value:function(){var e;!p5&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.show())}},{key:"hideList",value:function(){var e;!p5&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.hide())}},{key:"openSubtitle",value:function(){this.curIndex>-1&&this.curItem&&this.switchSubTitle(this.curItem)}},{key:"getSubTitleIndex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{id:"",language:""},n=-1;return t&&(t.id||t.language)?(e.forEach((function(e,i){e.id!==t.id&&e.language!==t.language||(n=i)})),n):n}},{key:"registerIcons",value:function(){return{vttSubOpen:{icon:h5,class:"xgplayer-vttsub-open-svg"},vttSubClose:{icon:d5,class:"xgplayer-vttsub-close-svg"}}}},{key:"registerLanguageTexts",value:function(){return{sub:{jp:"字幕",en:"Subtitles",zh:"字幕","zh-hk":"字幕"},subOpen:{jp:"字幕をオンにする",en:"Show subtitles",zh:"开启字幕","zh-hk":"開啟字幕"},subClose:{jp:"クローズドキャプション",en:"Hide subtitles",zh:"关闭字幕","zh-hk":"關閉字幕"}}}},{key:"creatOptionList",value:function(){var e=this;if(!p5){var t={config:{data:this.getList(),className:"",onItemClick:function(t,n){e.handlerClickSwitch(t,null==n?void 0:n.to)}},root:this.root};this.optionList=new Rq(t)}}},{key:"getList",value:function(){var e=this;return this.config.list.map((function(t,n){return n===e.curIndex&&e.isOpenState?(t.isCurrent=!0,t.selected=!0):(t.isCurrent=!1,t.selected=!1),t.showText=e.getTextByLang(t),t}))}},{key:"renderOptionList",value:function(){this.optionList.renderItemList(this.getList())}},{key:"switchSubTitle",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""},n=-1;if(t&&(t.id||t.language)&&(this.config.list.map((function(e,i){e.id+""==t.id+""&&e.language+""==t.language+""&&(n=i)})),!(n<0||this.isOpenState&&n===this.curIndex)))return this.subTitles.switch(t).then((function(i){0===i.code&&(t.off=!1,t.isListUpdate=!1,t.list=[],e.curIndex=n,e.curItem=e.config.list[n],e.isOpenState=!0,cN.removeClass(e.root,"isClose"),cN.addClass(e.root,"isOpen"),e.renderItemList(),e.changeTipText(),e.emit("subtitle_change",t))})).catch((function(e){return console.error("switch subtitle err: ",e)}))}},{key:"switchOffSubtitle",value:function(){this.subTitles.switchOff(),this.noShowSubtitle()}},{key:"noShowSubtitle",value:function(){var e;this.emit("subtitle_change",{off:!0,isListUpdate:!1,list:[]}),this.isOpenState=!1,cN.addClass(this.root,"isClose"),cN.removeClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),null===(e=this.optionList)||void 0===e||e.hide()}},{key:"renderItemList",value:function(){p5?this.updatePanel():this.renderOptionList()}},{key:"updateSubtitles",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(this.updateList(),this.subTitles&&this.subTitles.setSubTitles(this.config.list,this.curIndex>-1,t))}},{key:"updateList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.list){var t=[];e.list.map((function(e){t.push(e)}));var n,i=v5(t);if(e.isOpen)this.isOpenState=!0,this.curIndex=i,this.curItem=i>-1?t[i]:null,cN.removeClass(this.root,"isClose"),cN.addClass(this.root,"isOpen");else this.isOpenState=!1,this.curIndex=-1,this.curItem=null,cN.removeClass(this.root,"isOpen"),cN.addClass(this.root,"isClose"),this.changeTipText(),null===(n=this.optionList)||void 0===n||n.hide();if(this.config.list=t,t.length>0){var r;if(!p5)null===(r=this.optionList)||void 0===r||r.hide()}else{var o,a;if(this.switchOffSubtitle(),p5?this.showMobilePanel():null===(o=this.optionList)||void 0===o||o.show(),!p5)null===(a=this.optionList)||void 0===a||a.hide();this.hide()}this.renderItemList()}}},{key:"changeTipText",value:function(){this.isOpenState?this.find(".xg-tips").innerHTML=this.langText.subClose:this.find(".xg-tips").innerHTML=this.langText.subOpen}},{key:"showMobilePanel",value:function(){var e,t=this.renderPanel();null===(e=this.player.panel)||void 0===e||e.showPanel(t,this.langText.sub,!0)}},{key:"updatePanel",value:function(){var e,t=this.renderPanel();null===(e=this.player.panel)||void 0===e||e.updatePanel(t)}},{key:"renderPanel",value:function(){var e=this,n=b(this.config.list),i=cN.createDom("div","",{},"ai-panel-content");n.map((function(n,r){var o=t({language:n.language||n.srclang,"data-id":n.id,selected:e.isOpenState&&e.curIndex===r,showText:e.getTextByLang(n)},n),a=e.renderPanelItem(o);i.appendChild(a)}));var r={showText:this.langText.subClose,"data-type":g5,selected:!this.isOpenState};return i.appendChild(this.renderPanelItem(r)),i}},{key:"renderPanelItem",value:function(e){var t=this,n=e.showText,i=e.selected,r=cN.createDom("div","",{language:e.language,"data-id":e["data-id"],"data-type":e["data-type"]},"panel-Item ".concat(i?"select-in":""));r.innerHTML=n;var o=p5?"touchend":"click",a=Vj.delegate(r,".panel-Item",o,(function(n){e["data-type"]===g5?(n.stopPropagation(),n.preventDefault(),t.switchOffSubtitle()):t.handlerClickSwitch(n,e)}));return this._delegates.push(a),r}},{key:"getTextByLang",value:function(e,t,n){if(void 0===e)return"";var r=this.config.list;return!n&&(n=this.player.lang),t=!t||cN.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=r[e]),"object"===i(e[t])?e[t][n]||e[t].zh:e[t]||""}},{key:"rePosition",value:function(){var e=this.config.style.fitVideo,t=0-this.player.controls.root.getBoundingClientRect().height;if(e){var n=this.player,i=n.video,r=n.root.getBoundingClientRect(),o=r.height,a=r.width,s=i.videoHeight,l=i.videoWidth,c=parseInt(s/l*100,10)*a/100;c>o&&(c=o);var u=(o-c)/2-t;u<0&&(this.subTitles.root.style.transform="translate(0, ".concat(u,"px)"))}else this.subTitles.root.style.transform="translate(0, ".concat(t,"px)")}},{key:"destroy",value:function(){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)||void 0===e||e.destroy(),this._delegates&&this._delegates.length>0&&(this._delegates.map((function(e){Array.isArray(e)&&e.map((function(e){e.destroy&&e.destroy()})),e.destroy&&e.destroy()})),this._delegates=null),m(h(r.prototype),"destroy",this).call(this)}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-vttsub">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="vttSubOpen">'.concat(this.langText.subOpen,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"Subtitle"}},{key:"defaultConfig",get:function(){return{position:f5.CONTROLS_RIGHT,index:x1,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"}}}]),r}(Vj),m5=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).toastNumber=0,i.toastMaps={},i}return l(n,[{key:"beforePlayerInit",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"afterCreate",value:function(){}},{key:"destroy",value:function(){}},{key:"add",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.toastNumber+1;this.toastNumber=r;var o=this.renderToast(e,i,r);return this.root.appendChild(o),this.toastMaps[r]=o,n&&setTimeout((function(){t.remove(r)}),n),r}},{key:"remove",value:function(e){var t=this.toastMaps[e];t&&(this.root.contains(t)&&this.root.removeChild(t),delete this.toastMaps[e])}},{key:"renderToast",value:function(e,t,n){var i=this,r=cN.createDom("div","",void 0,"toast-container"),o=cN.checkIsObject(e)?e:cN.createDom("div",e,void 0,"toast-txt");if(r.appendChild(o),t){var a=cN.createDom("span","×",void 0,"toast-close-bt");a.addEventListener("click",(function(){i.remove(n)})),r.appendChild(a)}return r}},{key:"render",value:function(){return'<xg-sdk-toast class="xgplayer-sdk-toast"></xg-sdk-toast>'}}],[{key:"pluginName",get:function(){return"sdkToastPlugin"}},{key:"defaultConfig",get:function(){return{index:5}}}]),n}(Vj),_5=Uf;Er({target:"Number",stat:!0,forced:Number.parseInt!=_5},{parseInt:_5});Er({target:"Array",proto:!0,forced:FV!==[].lastIndexOf},{lastIndexOf:FV});var b5=xR;Er({target:"Number",stat:!0,forced:Number.parseFloat!=b5},{parseFloat:b5});var k5=Math.log,w5=Math.LOG10E;Er({target:"Math",stat:!0},{log10:Math.log10||function(e){return k5(e)*w5}});var E5,T5=function(){function e(){a(this,e),this._hooks={},this._cache=[],this._hooksCache={}}return l(e,[{key:"on",value:function(e,t){e&&t&&"function"==typeof t&&(this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t))}},{key:"once",value:function(e,t){var n=this;if(e&&t&&"function"==typeof t){this.on(e,(function i(r){t(r),n.off(e,i)}))}}},{key:"off",value:function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var n=this._hooks[e].indexOf(t);-1!==n&&this._hooks[e].splice(n,1)}else this._hooks[e]=[]}},{key:"emit",value:function(e,t,n){if(n){if(!e)return;-1!==this._cache.indexOf(n)?this._emit(e,t):(this._hooksCache.hasOwnProperty(n)||(this._hooksCache[n]={}),this._hooksCache[n].hasOwnProperty(e)||(this._hooksCache[n][e]=[]),this._hooksCache[n][e].push(t))}else this._emit(e,t)}},{key:"_emit",value:function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&b(this._hooks[e]).forEach((function(e){try{e(t)}catch(xX){}}))}},{key:"set",value:function(e){e&&-1===this._cache.indexOf(e)&&this._cache.push(e)}}]),e}(),S5=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},C5=(E5=+Date.now()+Number("".concat(Math.random()).slice(2,8)),function(){return E5+=1}),x5=function(e){return function(e,t,n){if("string"==typeof e&&"number"==typeof t&&"number"==typeof n){var i,r=[];n=n<=25?n:n%25;var o=String.fromCharCode(n+97);i=e.split(o);for(var a=0;a<i.length;a++){var s=parseInt(i[a],n);s=1*s^t;var l=String.fromCharCode(s);r.push(l)}return r.join("")}}(e,64,25)},O5=function(e){var t=document.createElement("a");return t.href=e,t},P5=function(e){var t={};try{var n=O5(e).search;(n=n.slice(1)).split("&").forEach((function(e){var n,i,r=e.split("=");r.length&&(n=r[0],i=r[1]);try{t[n]=decodeURIComponent(void 0===i?"":i)}catch(xX){t[n]=i}}))}catch(xX){}return t},I5=function(e){for(var t=0,n=0,i=(e+="").length,r=0;r<i;r++)((t=31*t+e.charCodeAt(n++))>0x7fffffffffff||t<-0x800000000000)&&(t&=0xffffffffffff);return t<0&&(t+=0x7ffffffffffff),t},L5=Er,D5=AI,A5=x,M5=ve,R5=SI.exports.onFreeze,N5=Object.freeze;function j5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)e[i]=n[i]}return e}L5({target:"Object",stat:!0,forced:A5((function(){N5(1)})),sham:!D5},{freeze:function(e){return N5&&M5(e)?N5(R5(e)):e}});var B5=function e(t,n){function i(e,i,r){if("undefined"!=typeof document){"number"==typeof(r=j5({},n,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var a in r)r[a]&&(o+="; "+a,!0!==r[a]&&(o+="="+r[a].split(";")[0]));return document.cookie=e+"="+t.write(i,e)+o}}return Object.create({set:i,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],i={},r=0;r<n.length;r++){var o=n[r].split("="),a=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(i[s]=t.read(a,s),e===s)break}catch(xX){}}return e?i[e]:i}},remove:function(e,t){i(e,"",j5({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,j5({},this.attributes,t))},withConverter:function(t){return e(j5({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),U5=function(e,t){try{return B5.get(e,{domain:t||document.domain})}catch(xX){return""}},H5=function(e,t,n,i){try{var r=i||document.domain,o=+new Date+(n||6048e5);B5.set(e,t,{expires:new Date(o),path:"/",domain:r})}catch(xX){}},F5=function(){function e(){a(this,e),this.cache={}}return l(e,[{key:"setItem",value:function(e,t){this.cache[e]=t}},{key:"getItem",value:function(e){return this.cache[e]}},{key:"removeItem",value:function(e){this.cache[e]=void 0}},{key:"getCookie",value:function(e,t){return U5(e,t)}},{key:"setCookie",value:function(e,t,n,i){H5(e,t,n,i)}}]),e}();var G5={getItem:function(e){try{var t=localStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(xX){}return n||{}}catch(xX){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,n)}catch(xX){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(xX){}},getCookie:function(e,t){return U5(e,t)},setCookie:function(e,t,n,i){H5(e,t,n,i)},isSupportLS:function(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(xX){return!1}}()},V5={getItem:function(e){try{var t=sessionStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(xX){}return n||{}}catch(xX){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,n)}catch(xX){}},removeItem:function(e){try{sessionStorage.removeItem(e)}catch(xX){}},getCookie:function(e,t){return U5(e,t)},setCookie:function(e,t,n,i){H5(e,t,n,i)},isSupportSession:function(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(xX){return!1}}()},z5=function(){function e(t,n){a(this,e),this._storage=n&&"session"===n?V5:!t&&G5.isSupportLS?G5:new F5}return l(e,[{key:"getItem",value:function(e){return this._storage.getItem(e)}},{key:"setItem",value:function(e,t){this._storage.setItem(e,t)}},{key:"getCookie",value:function(e,t){return this._storage.getCookie(e,t)}},{key:"setCookie",value:function(e,t,n,i){this._storage.setCookie(e,t,n,i)}},{key:"removeItem",value:function(e){this._storage.removeItem(e)}}]),e}(),W5=function(){function e(t,n,i){a(this,e),this.appid=t,this.domain=n,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion,this.cookie_expire=i}return l(e,[{key:"init",value:function(){var e=window.navigator.userAgent,t=window.navigator.language,n=document.referrer,i=n?O5(n).hostname:"",r=P5(window.location.href),o=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(this.appVersion)?"wap":"web";this.utm=function(e,t,n,i){var r=new z5(!1),o=new z5(!1,"session"),a=e?"_tea_utm_cache_".concat(e):"_tea_utm_cache",s=e?"_$utm_from_url_".concat(e):"_$utm_from_url",l={},c=["tr_shareuser","tr_admaster","tr_param1","tr_param2","tr_param3","tr_param4","$utm_from_url"],u={ad_id:Number(t.ad_id)||void 0,campaign_id:Number(t.campaign_id)||void 0,creative_id:Number(t.creative_id)||void 0,utm_source:t.utm_source,utm_medium:t.utm_medium,utm_campaign:t.utm_campaign,utm_term:t.utm_term,utm_content:t.utm_content,tr_shareuser:t.tr_shareuser,tr_admaster:t.tr_admaster,tr_param1:t.tr_param1,tr_param2:t.tr_param2,tr_param3:t.tr_param3,tr_param4:t.tr_param4};try{var h=!1;for(var d in u)u[d]&&(-1!==c.indexOf(d)?(l.hasOwnProperty("tracer_data")||(l.tracer_data={}),l.tracer_data[d]=u[d]):l[d]=u[d],h=!0);if(h)o.setItem(s,"1"),r.setCookie(a,JSON.stringify(l),i,n);else{var f=r.getCookie(a,n);f&&(l=JSON.parse(f))}o.getItem(s)&&(l.hasOwnProperty("tracer_data")||(l.tracer_data={}),l.tracer_data.$utm_from_url=1)}catch(xX){return u}return l}(this.appid,r,this.domain,this.cookie_expire);var a=this.browser(),s=this.os();return{browser:a.browser,browser_version:a.browser_version,platform:o,os_name:s.os_name,os_version:s.os_version,userAgent:e,screen_width:window.screen&&window.screen.width,screen_height:window.screen&&window.screen.height,device_model:this.getDeviceModel(s.os_name),language:t,referrer:n,referrer_host:i,utm:this.utm,latest_data:this.last(n,i)}}},{key:"last",value:function(e,t){var n="",i="",r="",o=location.hostname,a=!1;if(e&&t&&o!==t){n=e,i=t,a=!0;var s=P5(e);s.keyword&&(r=s.keyword)}return{$latest_referrer:n,$latest_referrer_host:i,$latest_search_keyword:r,isLast:a}}},{key:"browser",value:function(){var e,t,n="",i="".concat(parseFloat(this.appVersion)),r=this.userAgent;return-1!==r.indexOf("Edge")||-1!==r.indexOf("Edg")?(n="Microsoft Edge",-1!==r.indexOf("Edge")?(e=r.indexOf("Edge"),i=r.substring(e+5)):(e=r.indexOf("Edg"),i=r.substring(e+4))):-1!==(e=r.indexOf("MSIE"))?(n="Microsoft Internet Explorer",i=r.substring(e+5)):-1!==(e=r.indexOf("Lark"))?(n="Lark",i=r.substring(e+5,e+11)):-1!==(e=r.indexOf("MetaSr"))?(n="sougoubrowser",i=r.substring(e+7,e+10)):-1!==r.indexOf("MQQBrowser")||-1!==r.indexOf("QQBrowser")?(n="qqbrowser",-1!==r.indexOf("MQQBrowser")?(e=r.indexOf("MQQBrowser"),i=r.substring(e+11,e+15)):-1!==r.indexOf("QQBrowser")&&(e=r.indexOf("QQBrowser"),i=r.substring(e+10,e+17))):-1!==r.indexOf("Chrome")?-1!==(e=r.indexOf("MicroMessenger"))?(n="weixin",i=r.substring(e+15,e+20)):-1!==(e=r.indexOf("360"))?(n="360browser",i=r.substring(r.indexOf("Chrome")+7)):-1!==r.indexOf("baidubrowser")||-1!==r.indexOf("BIDUBrowser")?(-1!==r.indexOf("baidubrowser")?(e=r.indexOf("baidubrowser"),i=r.substring(e+13,e+16)):-1!==r.indexOf("BIDUBrowser")&&(e=r.indexOf("BIDUBrowser"),i=r.substring(e+12,e+15)),n="baidubrowser"):-1!==(e=r.indexOf("xiaomi"))?-1!==r.indexOf("openlanguagexiaomi")?(n="openlanguage xiaomi",i=r.substring(e+7,e+13)):(n="xiaomi",i=r.substring(e-7,e-1)):-1!==(e=r.indexOf("TTWebView"))?(n="TTWebView",i=r.substring(e+10,e+23)):(-1!==(e=r.indexOf("Chrome"))||-1!==(e=r.indexOf("Chrome")))&&(n="Chrome",i=r.substring(e+7)):-1!==r.indexOf("Safari")?-1!==(e=r.indexOf("QQ"))?(n="qqbrowser",i=r.substring(e+10,e+16)):-1!==(e=r.indexOf("Safari"))&&(n="Safari",i=r.substring(e+7),-1!==(e=r.indexOf("Version"))&&(i=r.substring(e+8))):-1!==(e=r.indexOf("Firefox"))?(n="Firefox",i=r.substring(e+8)):-1!==(e=r.indexOf("MicroMessenger"))?(n="weixin",i=r.substring(e+15,e+20)):-1!==(e=r.indexOf("QQ"))&&(n="qqbrowser",i=r.substring(e+3,e+8)),-1!==(t=i.indexOf(";"))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(" "))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(")"))&&(i=i.substring(0,t)),{browser:n,browser_version:i}}},{key:"os",value:function(){for(var e="",t="",n=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],i=0;i<n.length;i++){var r=n[i];if(r.r.test(this.userAgent)){"Mac OS X"===(e=r.s)&&this.isNewIpad()&&(e="iOS");break}}var o=function(e,t){var n=e.exec(t);return n&&n[1]?n[1]:""},a=function(e,t){var n=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:".concat(e,")"),"i").exec(t);return n?n.slice(1)[0]:""};/Windows/.test(e)&&(t=o(/Windows (.*)/,e),e="windows");var s,l;switch(e){case"Mac OS X":t=a("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent),e="mac";break;case"Android":s=this.userAgent,(l=o(/Android ([\.\_\d]+)/,s))||(l=o(/Android\/([\.\_\d]+)/,s)),t=l,e="android";break;case"iOS":t=this.isNewIpad()?a("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent):(t=/OS (\d+)_(\d+)_?(\d+)?/.exec(this.appVersion))?"".concat(t[1],".").concat(t[2],".").concat(0|t[3]):"",e="ios"}return{os_name:e,os_version:t}}},{key:"getDeviceModel",value:function(e){var t="";try{if("android"===e)navigator.userAgent.split(";").forEach((function(e){e.indexOf("Build/")>-1&&(t=e.slice(0,e.indexOf("Build/")))}));else if("ios"===e||"mac"===e||"windows"===e)if(this.isNewIpad())t="iPad";else{var n=navigator.userAgent.replace("Mozilla/5.0 (",""),i=n.indexOf(";");t=n.slice(0,i)}}catch(xX){return t.trim()}return t.trim()}},{key:"isNewIpad",value:function(){return void 0!==this.userAgent&&"MacIntel"===navigator.platform&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1}}]),e}(),K5={cn:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},q5={cn:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az28z1gz1hz1gz1cz18z1nz1gz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz21z1ez18z1jz1gz49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz18z1jz1gz24z18z49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k"},Y5="5.0.29",$5=function(e){return e.Init="init",e.Config="config",e.Start="start",e.Ready="ready",e.TokenComplete="token-complete",e.TokenStorage="token-storage",e.TokenFetch="token-fetch",e.TokenError="token-error",e.ConfigUuid="config-uuid",e.ConfigWebId="config-webid",e.ConfigDomain="config-domain",e.CustomWebId="custom-webid",e.TokenChange="token-change",e.TokenReset="token-reset",e.ConfigTransform="config-transform",e.EnvTransform="env-transform",e.SessionReset="session-reset",e.SessionResetTime="session-reset-time",e.Event="event",e.Events="events",e.EventNow="event-now",e.CleanEvents="clean-events",e.BeconEvent="becon-event",e.SubmitBefore="submit-before",e.SubmitScuess="submit-scuess",e.SubmitAfter="submit-after",e.SubmitError="submit-error",e.SubmitVerify="submit-verify",e.Stay="stay",e.ResetStay="reset-stay",e.StayReady="stay-ready",e.SetStay="set-stay",e.RouteChange="route-change",e.RouteReady="route-ready",e.Ab="ab",e.AbVar="ab-var",e.AbAllVars="ab-all-vars",e.AbConfig="ab-config",e.AbExternalVersion="ab-external-version",e.AbVersionChangeOn="ab-version-change-on",e.AbVersionChangeOff="ab-version-change-off",e.AbOpenLayer="ab-open-layer",e.AbCloseLayer="ab-close-layer",e.AbReady="ab-ready",e.AbComplete="ab-complete",e.Profile="profile",e.ProfileSet="profile-set",e.ProfileSetOnce="profile-set-once",e.ProfileUnset="profile-unset",e.ProfileIncrement="profile-increment",e.ProfileAppend="profile-append",e.ProfileClear="profile-clear",e.Autotrack="autotrack",e.AutotrackReady="autotrack-ready",e.CepReady="cep-ready",e.TracerReady="tracer-ready",e}($5||{}),X5=function(e){return e.DEBUGGER_MESSAGE="debugger-message",e.DEBUGGER_MESSAGE_SDK="debugger-message-sdk",e.DEBUGGER_MESSAGE_FETCH="debugger-message-fetch",e.DEBUGGER_MESSAGE_FETCH_RESULT="debugger-message-fetch-result",e.DEBUGGER_MESSAGE_EVENT="debugger-message-event",e.DEVTOOL_WEB_READY="devtool-web-ready",e}(X5||{}),J5=void 0,Z5=(new Date).getTimezoneOffset(),Q5=parseInt("".concat(-Z5/60),10),e4=60*Z5,t4=function(){function e(t,n){a(this,e),this.is_first_time=!0,this.configPersist=!1,this.initConfig=n,this.collect=t;var i=new W5(n.app_id,n.cookie_domain||"",n.cookie_expire||6048e5).init(),r="__tea_cache_first_".concat(n.app_id);this.configKey="__tea_cache_config_".concat(n.app_id),this.sessionStorage=new z5(!1,"session"),this.localStorage=new z5(!1,"local"),n.configPersist&&(this.configPersist=!0,this.storage=1===n.configPersist?this.sessionStorage:this.localStorage);var o=this.localStorage.getItem(r);o&&"1"===o?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(r,"1")),this.envInfo={user:{user_unique_id:J5,user_type:J5,user_id:J5,user_is_auth:J5,user_is_login:J5,device_id:J5,web_id:J5,ip_addr_id:J5,user_unique_id_type:J5},header:{app_id:J5,app_name:J5,app_install_id:J5,install_id:J5,app_package:J5,app_channel:J5,app_version:J5,os_name:i.os_name,os_version:i.os_version,device_model:i.device_model,ab_client:J5,traffic_type:J5,client_ip:J5,device_brand:J5,os_api:J5,access:J5,language:i.language,region:J5,app_language:J5,app_region:J5,ab_version:J5,creative_id:i.utm.creative_id,ad_id:i.utm.ad_id,campaign_id:i.utm.campaign_id,log_type:J5,rnd:J5,platform:i.platform,sdk_version:Y5,sdk_lib:"js",province:J5,city:J5,timezone:Q5,tz_offset:e4,tz_name:J5,sim_region:J5,carrier:J5,resolution:"".concat(i.screen_width,"x").concat(i.screen_height),browser:i.browser,browser_version:i.browser_version,referrer:i.referrer,referrer_host:i.referrer_host,width:i.screen_width,height:i.screen_height,screen_width:i.screen_width,screen_height:i.screen_height,utm_term:i.utm.utm_term,utm_content:i.utm.utm_content,utm_source:i.utm.utm_source,utm_medium:i.utm.utm_medium,utm_campaign:i.utm.utm_campaign,tracer_data:JSON.stringify(i.utm.tracer_data),custom:{},wechat_unionid:J5,wechat_openid:J5}},this.ab_version="",this.evtParams={},this.reportErrorCallback=function(){},this.initDomain()}return l(e,[{key:"initDomain",value:function(){var e=this.initConfig.channel_domain;if(e)this.domain=e;else{var t=this.initConfig.channel;this.domain=x5(q5[t])}}},{key:"setDomain",value:function(e){this.domain=e}},{key:"getDomain",value:function(){return this.domain}},{key:"setAbVersion",value:function(e){this.ab_version=e}},{key:"getAbVersion",value:function(){return this.ab_version}},{key:"setAbData",value:function(e){this.ab_data=e}},{key:"getAbData",value:function(){return this.ab_data||{}}},{key:"getUrl",value:function(e){var t="";switch(e){case"event":t=this.initConfig.report_url||"/list";break;case"webid":t="/webid";break;case"tobid":t="/tobid"}var n="";return this.initConfig.caller&&(n="?sdk_version=".concat(Y5,"&sdk_name=web&app_id=").concat(this.initConfig.app_id,"&caller=").concat(this.initConfig.caller)),"".concat(this.getDomain()).concat(t).concat(n)}},{key:"set",value:function(e){var n=this;Object.keys(e).forEach((function(i){if(void 0!==e[i]&&null!==e[i]||n.delete(i),"evtParams"===i)n.evtParams=t(t({},n.evtParams||{}),e.evtParams||{});else if("_staging_flag"===i)n.evtParams=t(t({},n.evtParams||{}),{},{_staging_flag:e._staging_flag});else if("reportErrorCallback"===i&&"function"==typeof e[i])n.reportErrorCallback=e[i];else{var r="",o="";if(i.indexOf(".")>-1){var a=i.split(".");r=a[0],o=a[1]}r?"user"===r||"header"===r?n.envInfo[r][o]=e[i]:n.envInfo.header.custom[o]=e[i]:n.envInfo.user.hasOwnProperty(i)?["user_type","ip_addr_id"].indexOf(i)>-1?n.envInfo.user[i]=e[i]?Number(e[i]):e[i]:["user_id","web_id","user_unique_id","user_unique_id_type"].indexOf(i)>-1?n.envInfo.user[i]=e[i]?String(e[i]):e[i]:["user_is_auth","user_is_login"].indexOf(i)>-1?n.envInfo.user[i]=Boolean(e[i]):"device_id"===i&&(n.envInfo.user[i]=e[i]):n.envInfo.header.hasOwnProperty(i)?n.envInfo.header[i]=e[i]:n.envInfo.header.custom[i]=e[i]}}))}},{key:"get",value:function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:this.envInfo.user.hasOwnProperty(e)?this.envInfo.user[e]:this.envInfo.header.hasOwnProperty(e)?this.envInfo.header[e]:JSON.parse(JSON.stringify(this.envInfo[e])):JSON.parse(JSON.stringify(this.envInfo))}catch(xX){console.log("get config stringify error "),this.collect.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:xX.message})}}},{key:"setStore",value:function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};if(t&&Object.keys(e).length){var n=Object.assign(e,t);this.storage.setItem(this.configKey,n)}}catch(xX){this.collect.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:xX.message})}}},{key:"getStore",value:function(){try{if(!this.configPersist)return null;var e=this.storage.getItem(this.configKey);return e&&Object.keys(e).length?e:null}catch(xX){return this.collect.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:xX.message}),null}}},{key:"delete",value:function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey);t&&t.hasOwnProperty(e)&&(delete t[e],this.storage.setItem(this.configKey,t))}catch(xX){this.collect.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:xX.message})}}}]),e}(),n4=function(){function e(t,n){a(this,e),this.isLog=n||!1,this.name=t||""}return l(e,[{key:"info",value:function(e){this.isLog&&console.log("%c %s","color: yellow; background-color: black;","[instance: ".concat(this.name,"] ")+e)}},{key:"warn",value:function(e){this.isLog&&console.warn("[instance: ".concat(this.name,"] ")+e)}},{key:"error",value:function(e){this.isLog&&console.error("[instance: ".concat(this.name,"] ")+e)}},{key:"throw",value:function(e){throw this.error(this.name),new Error(e)}}]),e}(),i4=function(){function e(t,n){a(this,e),this.collect=t,this.native=n}return l(e,[{key:"bridgeInject",value:function(){try{return!!this.native&&(AppLogBridge?(console.log("AppLogBridge is injected"),!0):(console.log("AppLogBridge is not inject"),!1))}catch(xX){return console.log("AppLogBridge is not inject"),!1}}},{key:"bridgeReady",value:function(){var e=this;return new Promise((function(t,n){try{e.bridgeInject()?AppLogBridge.hasStarted((function(e){console.log("AppLogBridge is started? : ".concat(e)),e?t(!0):n(!1)})):n(!1)}catch(xX){console.log("AppLogBridge, error:".concat(JSON.stringify(xX.stack))),n(!1)}}))}},{key:"setNativeAppId",value:function(e){try{AppLogBridge.setNativeAppId(JSON.stringify(e)),console.log("change bridge appid, event report with appid: ".concat(e))}catch(xX){console.error("setNativeAppId error")}}},{key:"setConfig",value:function(e){var t=this;try{Object.keys(e).forEach((function(n){"user_unique_id"===n?t.setUserUniqueId(e[n]):e[n]?t.addHeaderInfo(n,e[n]):t.removeHeaderInfo(n)}))}catch(xX){console.error("setConfig error")}}},{key:"setUserUniqueId",value:function(e){try{AppLogBridge.setUserUniqueId(e)}catch(xX){console.error("setUserUniqueId error")}}},{key:"addHeaderInfo",value:function(e,t){try{AppLogBridge.addHeaderInfo(e,t)}catch(xX){console.error("addHeaderInfo error")}}},{key:"setHeaderInfo",value:function(e){try{AppLogBridge.setHeaderInfo(JSON.stringify(e))}catch(xX){console.error("setHeaderInfo error")}}},{key:"removeHeaderInfo",value:function(e){try{AppLogBridge.removeHeaderInfo(e)}catch(xX){console.error("removeHeaderInfo error")}}},{key:"reportPv",value:function(e){this.onEventV3("predefine_pageview",e)}},{key:"onEventV3",value:function(e,t){try{AppLogBridge.onEventV3(e,t),this.collect.emit(DebuggerMesssge.DEBUGGER_MESSAGE,{type:DebuggerMesssge.DEBUGGER_MESSAGE_EVENT,info:"bridge埋点上报",time:Date.now(),data:[{events:[{event:e,params:t}]}],code:200,status:"success"})}catch(xX){console.error("onEventV3 error")}}},{key:"profileSet",value:function(e){try{AppLogBridge.profileSet(e)}catch(w7){console.error("profileSet error")}}},{key:"profileSetOnce",value:function(e){try{AppLogBridge.profileSetOnce(e)}catch(w7){console.error("profileSetOnce error")}}},{key:"profileIncrement",value:function(e){try{AppLogBridge.profileIncrement(e)}catch(w7){console.error("profileIncrement error")}}},{key:"profileUnset",value:function(e){try{AppLogBridge.profileUnset(e)}catch(w7){console.error("profileUnset error")}}},{key:"profileAppend",value:function(e){try{AppLogBridge.profileAppend(e)}catch(w7){console.error("profileAppend error")}}}]),e}(),r4=500,o4=5005;function a4(e,t,n,i,r,o,a,s,l){try{var c=new XMLHttpRequest,u=s||"POST";c.open(u,"".concat(e),!0),c.setRequestHeader("Content-Type","application/json; charset=utf-8"),a&&c.setRequestHeader("X-MCS-AppKey","".concat(a)),i&&(c.withCredentials=!0),c.onload=function(){if(r){var e=null;if(c.responseText){try{e=JSON.parse(c.responseText)}catch(xX){e={}}r(e,t)}}},n&&(c.timeout=n,c.ontimeout=function(){o&&o(t,o4)}),c.onerror=function(){c.abort(),o&&o(t,r4)},l?c.send(t):c.send(JSON.stringify(t))}catch(xX){}}var s4=4001,l4=4e3,c4=4002,u4=4003,h4=function(e,t,n,i){try{var r=e.match(/\/v\d\//),o="";o=r?r[0]:-1!==e.indexOf("/v1/")?"/v1/":"/v2/";var a=e.split(o)[0];if(!a)return void i(e,t,s4);t.forEach((function(r){var o=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&(t+="&".concat(n,"=").concat(encodeURIComponent(JSON.stringify(e[n]))));return"&"===t[0]?t.slice(1):t}(r),s=new Image(1,1);s.onload=function(){s=null,n&&n()},s.onerror=function(){s=null,i&&i(e,t,l4)},s.src="".concat(a).concat("/gif","?").concat(o)}))}catch(xX){i&&i(e,t,c4,xX.message)}},d4=function(e,t,n,i,r,o,a,s){var l=window.navigator.userAgent;if(-1===window.navigator.appName.indexOf("Microsoft Internet Explorer")||-1===l.indexOf("MSIE 8.0")&&-1===l.indexOf("MSIE 9.0")){if(a)return window.navigator&&window.navigator.sendBeacon?void(window.navigator.sendBeacon(e,JSON.stringify(t))?r():o(e,t,u4)):void h4(e,t,r,o)}else h4(e,t,r,o);a4(e,t,n,i,r,o,"","",s)},f4=function(){function e(t,n){a(this,e),this.collector=t,this.config=n,this.eventNameWhiteList=["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure"],this.paramsNameWhiteList=["$inactive","$inline","$target_uuid_list","$source_uuid","$is_spider","$source_id","$is_first_time","_staging_flag"],this.regStr=new RegExp("^[a-zA-Z0-9][a-z0-9A-Z_.-]{1,255}$")}return l(e,[{key:"checkVerify",value:function(e){var t=this;if(!e||!e.length)return!1;var n=e[0];if(!n)return!1;var i=n.events,r=n.header;if(!i||!i.length)return!1;var o=!0;return i.forEach((function(e){t.checkEventName(e.event)||(o=!1,e.checkEvent="事件名不能以 $ or __开头"),t.checkEventParams(e.params)||(o=!1,e.checkParams="属性名不能以 $ or __开头")})),this.checkEventParams(r)||(o=!1),o}},{key:"checkEventName",value:function(e){return!!e&&this.calculate(e,"event")}},{key:"checkEventParams",value:function(e){var t=e;if("string"==typeof e&&(t=JSON.parse(t)),!Object.keys(t).length)return!0;for(var n in t)return!!this.calculate(n,"params")&&(!("string"==typeof t[n]&&t[n].length>1024)||(console.warn("params: ".concat(n," can not over 1024 byte, please check;")),!1));return!0}},{key:"calculate",value:function(e,t){return-1!==("event"===t?this.eventNameWhiteList:this.paramsNameWhiteList).indexOf(e)||(this.regStr.test(e)?!new RegExp("^\\$").test(e)&&!new RegExp("^__").test(e)||(console.warn("".concat("event"===t?"event":"params"," name: ").concat(e," can not start with $ or __, pleace check;")),!1):(console.warn("".concat("event"===t?"event":"params"," name: ").concat(e," is illegal, can not start with $ or __, pleace check;")),!1))}}]),e}(),p4=function(){function e(){a(this,e),this.eventLimit=50,this.enable_ttwebid=!1,this.eventCache=[],this.beconEventCache=[]}return l(e,[{key:"apply",value:function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.eventCheck=new f4(e,t),this.cacheStorgae=new z5(!0),this.localStorage=new z5(!1),this.maxReport=t.max_report||10,this.reportTime=t.reportTime||30,this.timeout=t.timeout||1e5,this.enable_ttwebid=t.enable_ttwebid,this.reportUrl=this.configManager.getUrl("event"),this.eventKey="__tea_cache_events_".concat(this.configManager.get("app_id")),this.beconKey="__tea_cache_events_becon_".concat(this.configManager.get("app_id")),this.abKey="__tea_sdk_ab_version_".concat(this.configManager.get("app_id")),this.collect.on($5.Ready,(function(){n.reportAll(!1)})),this.collect.on($5.ConfigDomain,(function(){n.reportUrl=n.configManager.getUrl("event")})),this.collect.on($5.Event,(function(e){n.event(e)})),this.collect.on($5.BeconEvent,(function(e){n.beconEvent(e)})),this.collect.on($5.CleanEvents,(function(){n.reportAll(!1)})),this.linster()}},{key:"linster",value:function(){var e,t=this;window.addEventListener("unload",(function(){t.reportAll(!0)}),!1),e=function(){t.reportAll(!0)},navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",e,!1):window.addEventListener("beforeunload",e,!1),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t.reportAll(!0)}),!1)}},{key:"reportAll",value:function(e){this.report(e),this.reportBecon()}},{key:"event",value:function(e){var t=this;try{var n=this.cacheStorgae.getItem(this.eventKey)||[],i=[].concat(b(e),b(n));if(this.cacheStorgae.setItem(this.eventKey,i),this.reportTimeout&&clearTimeout(this.reportTimeout),i.length>=this.maxReport)this.report(!1);else{var r=this.reportTime;this.reportTimeout=setTimeout((function(){t.report(!1),t.reportTimeout=null}),r)}}catch(xX){this.collect.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:xX.message})}}},{key:"beconEvent",value:function(e){var t=this.cacheStorgae.getItem(this.beconKey)||[],n=[].concat(b(e),b(t));this.cacheStorgae.setItem(this.beconKey,n),this.collect.destroyInstance||this.collect.tokenManager.getReady()&&this.collect.sdkReady&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(n)),!0))}},{key:"reportBecon",value:function(){if(!this.collect.destroyInstance&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var e=this.cacheStorgae.getItem(this.beconKey)||[];e&&e.length&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(e)),!0))}}},{key:"report",value:function(e){if(!this.collect.destroyInstance&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var t=this.cacheStorgae.getItem(this.eventKey)||[];t.length&&(this.cacheStorgae.removeItem(this.eventKey),this.sliceEvent(t,e))}}},{key:"sliceEvent",value:function(e,t){if(e.length>this.eventLimit)for(var n=0;n<e.length;n+=this.eventLimit){var i;i=e.slice(n,n+this.eventLimit);var r=this.split(this.merge(i));this.send(r,t)}else{var o=this.split(this.merge(e));this.send(o,t)}}},{key:"merge",value:function(e,n){var i=this,r=this.configManager.get(),o=r.header,a=r.user;o.custom=JSON.stringify(o.custom);var s=this.configManager.get("evtParams"),l=this.configManager.get("user_unique_id_type"),c=e.map((function(e){try{Object.keys(s).length&&!n&&(e.params=t(t({},s),e.params)),l&&(e.params.$user_unique_id_type=l);var r=i.localStorage.getItem(i.abKey);return r&&r.uuid&&r.uuid===a.user_unique_id&&i.configManager.getAbVersion()&&(e.ab_sdk_version=i.configManager.getAbVersion()),e.session_id=i.collect.sessionManager.getSessionId(),e.params=JSON.stringify(e.params),e}catch(xX){return i.collect.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:xX.message}),e}})),u=JSON.parse(JSON.stringify({events:c,user:a,header:o}));u.local_time=Math.floor(Date.now()/1e3),u.user_unique_type=this.config.enable_ttwebid?this.config.user_unique_type:void 0;var h=[];return h.push(u),h}},{key:"split",value:function(e){return e=e.map((function(e){var t=[];return t.push(e),t}))}},{key:"send",value:function(e,t){var n=this;e.length&&e.forEach((function(e){try{var i=JSON.parse(JSON.stringify(e));n.config.filter&&((i=n.config.filter(i))||console.warn("filter must return data !!")),n.collect.eventFilter&&i&&((i=n.collect.eventFilter(i))||console.warn("filterEvent api must return data !!"));var r=i||e;if(n.eventCheck.checkVerify(r),!r.length)return;n.collect.emit($5.SubmitBefore,r),n.collect.emit($5.SubmitVerify,r),d4(n.reportUrl,r,n.timeout,n.enable_ttwebid,(function(e,t){e&&0!==e.e?(n.collect.emit($5.SubmitError,{type:"f_data",eventData:t,errorCode:e.e,response:e}),n.collect.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_EVENT,info:"埋点上报失败",time:Date.now(),data:r,code:e.e,failType:"数据异常",status:"fail"})):(n.collect.emit($5.SubmitScuess,{eventData:t,res:e}),n.collect.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:r,code:200,status:"success"}))}),(function(e,t){n.configManager.get("reportErrorCallback")(e,t),n.collect.emit($5.SubmitError,{type:"f_net",eventData:e,errorCode:t}),n.collect.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_EVENT,info:"埋点上报网络异常",time:Date.now(),data:r,code:t,failType:"网络异常",status:"fail"})}),t,!1),n.collect.emit($5.SubmitAfter,r)}catch(xX){console.warn("something error, ".concat(JSON.stringify(xX.stack))),n.collect.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:xX.message})}}))}}]),e}(),g4=function e(t){return t?(t^16*Math.random()>>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)},v4=function(){return g4().replace(/-/g,"").slice(0,19)},y4=function(){function e(){a(this,e),this.cacheToken={},this.enableCookie=!1,this.enable_ttwebid=!1,this.enableCustomWebid=!1}return l(e,[{key:"apply",value:function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new z5(!1),this.tokenKey="__tea_cache_tokens_".concat(t.app_id),this.enable_ttwebid=t.enable_ttwebid,this.enableCustomWebid=t.enable_custom_webid,this.collect.on($5.ConfigUuid,(function(e){n.setUuid(e)})),this.collect.on($5.ConfigWebId,(function(e){n.setWebId(e)})),this.enableCookie=t.cross_subdomain,this.expiresTime=t.cookie_expire||6048e5,this.cookieDomain=t.cookie_domain||"",this.checkStorage()}},{key:"checkStorage",value:function(){var e=this;if(this.enableCookie){var t=this.storage.getCookie(this.tokenKey,this.cookieDomain);this.cacheToken=t&&"string"==typeof t?JSON.parse(t):{}}else this.cacheToken=this.storage.getItem(this.tokenKey)||{};this.tokenType=this.cacheToken&&this.cacheToken._type_?this.cacheToken._type_:"default","custom"!==this.tokenType||this.enableCustomWebid?this.enableCustomWebid?this.collect.on($5.CustomWebId,(function(){e.tokenReady=!0,e.collect.emit($5.TokenComplete)})):this.checkEnv()||(this.enable_ttwebid?this.completeTtWid(this.cacheToken):this.check()):this.remoteWebid()}},{key:"check",value:function(){this.cacheToken&&this.cacheToken.web_id?this.complete(this.cacheToken):this.config.disable_webid?this.complete({web_id:v4(),user_unique_id:this.configManager.get("user_unique_id")||v4()}):this.remoteWebid()}},{key:"checkEnv",value:function(){var e=window.navigator.userAgent;if(-1!==e.indexOf("miniProgram")||-1!==e.indexOf("MiniProgram")){var t=P5(window.location.href);return!(!t||!t.Web_ID)&&(this.complete({web_id:"".concat(t.Web_ID),user_unique_id:this.configManager.get("user_unique_id")||"".concat(t.Web_ID)}),!0)}return!1}},{key:"remoteWebid",value:function(){var e=this,t=this.configManager.getUrl("webid"),n={app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""};this.collect.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"SDK 发起WEBID请求",logType:"fetch",level:"info",time:Date.now(),data:n}),a4(t,n,3e3,!1,(function(t){t&&0===t.e?e.complete({web_id:e.configManager.get("web_id")||t.web_id,user_unique_id:e.configManager.get("user_unique_id")||t.web_id}):(e.collect.emit($5.TokenError),console.warn("[]appid: ".concat(e.config.app_id," webid error, init error~"))),e.collect.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"WEBID请求成功",logType:"fetch",level:"info",time:Date.now(),data:t})}),(function(){e.collect.emit($5.TokenError),e.collect.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"WEBID请求网络异常",logType:"fetch",level:"error",time:Date.now(),data:null}),console.warn("[]appid: ".concat(e.config.app_id,", get webid error, init error~"))}))}},{key:"complete",value:function(e){var t=e.web_id,n=e.user_unique_id;e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:n}),this.setStorage(e),this.tokenReady=!0,this.collect.emit($5.TokenComplete)}},{key:"completeTtWid",value:function(e){var t=e.user_unique_id||"",n=this.configManager.get("user_unique_id");(n||t)&&this.configManager.set({user_unique_id:n||t}),this.setStorage(e),this.tokenReady=!0,this.collect.emit($5.TokenComplete)}},{key:"setUuid",value:function(e){if(e&&-1===["null","undefined","Null","None"].indexOf(e)){var t=String(e),n=this.configManager.get("user_unique_id"),i=this.cacheToken&&this.cacheToken.user_unique_id;if(t===n&&t===i)return;this.configManager.set({user_unique_id:t}),this.cacheToken||(this.cacheToken={}),this.cacheToken.user_unique_id=t,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit($5.TokenChange,"uuid"),this.collect.emit($5.SessionReset)}else this.clearUuid()}},{key:"clearUuid",value:function(){this.config.enable_ttwebid||this.configManager.get("web_id")&&(this.configManager.set({user_unique_id:this.configManager.get("web_id")}),this.cacheToken&&this.cacheToken.web_id&&(this.cacheToken.user_unique_id=this.cacheToken.web_id,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)),this.collect.emit($5.TokenReset))}},{key:"setWebId",value:function(e){if(e&&!this.config.enable_ttwebid){this.cacheToken&&this.cacheToken.web_id?this.cacheToken.web_id!==e&&(this.cacheToken.user_unique_id=this.cacheToken.web_id===this.cacheToken.user_unique_id?e:this.cacheToken.user_unique_id,this.cacheToken.web_id=e):(this.cacheToken={},this.cacheToken.web_id=e,this.cacheToken.user_unique_id=e),this.cacheToken.timestamp=Date.now();var t=this.configManager.get("web_id"),n=this.configManager.get("user_unique_id");n&&n!==t||(this.configManager.set({user_unique_id:e}),this.collect.emit($5.TokenChange,"uuid")),t!==e&&(this.configManager.set({web_id:e}),this.collect.emit($5.TokenChange,"webid")),this.setStorage(this.cacheToken)}}},{key:"setStorage",value:function(e){e._type_=this.enableCustomWebid?"custom":"default",delete e["diss".split("").reverse().join("")],this.enableCookie||this.enable_ttwebid?(this.storage.setCookie(this.tokenKey,e,this.expiresTime,this.cookieDomain),this.enable_ttwebid&&(delete e.web_id,this.storage.setItem(this.tokenKey,e))):this.storage.setItem(this.tokenKey,e),this.cacheToken=e}},{key:"getReady",value:function(){return this.tokenReady}},{key:"getTobId",value:function(){var e=this,t=this.configManager.getUrl("tobid");return new Promise((function(n){a4(t,{app_id:e.config.app_id,user_unique_id:e.configManager.get("user_unique_id"),web_id:e.configManager.get("web_id"),user_unique_id_type:e.configManager.get("user_unique_id_type")},3e4,e.enable_ttwebid,(function(e){e&&0===e.e?n(e.tobid):n("")}),(function(){n("")}))}))}}]),e}(),m4=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},_4=function(){function e(){a(this,e)}return l(e,[{key:"apply",value:function(e,t){var n=this;this.collect=e,this.storage=new z5(!1,"session"),this.sessionKey="__tea_session_id_".concat(t.app_id),this.expireTime=t.expireTime||18e5,this.disableSession=t.disable_session,this.disableSession||(this.setSessionId(),this.collect.on($5.SessionReset,(function(){n.resetSessionId()})),this.collect.on($5.SessionResetTime,(function(){n.updateSessionIdTime()})))}},{key:"updateSessionIdTime",value:function(){var e=this.storage.getItem(this.sessionKey);if(e&&e.sessionId){var t=e.timestamp;Date.now()-t>this.expireTime?e={sessionId:m4(),timestamp:Date.now()}:e.timestamp=Date.now(),this.storage.setItem(this.sessionKey,e),this.resetExpTime()}}},{key:"setSessionId",value:function(){var e=this,t=this.storage.getItem(this.sessionKey);t&&t.sessionId?t.timestamp=Date.now():t={sessionId:m4(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,t),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime)}},{key:"getSessionId",value:function(){var e=this.storage.getItem(this.sessionKey);return this.disableSession?"":e&&e.sessionId?e.sessionId:""}},{key:"resetExpTime",value:function(){var e=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))}},{key:"resetSessionId",value:function(){var e={sessionId:m4(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,e)}},{key:"checkEXp",value:function(){var e=this.storage.getItem(this.sessionKey);e&&e.sessionId&&(Date.now()-e.timestamp+30>=this.expireTime&&(e={sessionId:m4(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e)))}}]),e}(),b4=function(){function e(t,n){a(this,e),this.devToolReady=!1,this.devToolOrigin="*",this.sendAlready=!1,this.collect=t,this.config=n,this.app_id=n.app_id,this.filterEvent=["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure","bav2b_page","bav2b_beat","bav2b_page_statistics","bav2b_click","bav2b_page_exposure","_be_active","predefine_pageview","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append","predefine_page_alive","predefine_page_close","abtest_exposure"],this.load()}return l(e,[{key:"loadScript",value:function(e){try{var t=document.createElement("script");t.src=e,t.onerror=function(){console.log("load DevTool render fail")},t.onload=function(){console.log("load DevTool render success")},document.getElementsByTagName("body")[0].appendChild(t)}catch(xX){console.log("devTool load fail, ".concat(xX.message))}}},{key:"load",value:function(){try{this.loadBaseInfo(),this.loadHook();var e=P5(window.location.href);if(!e.open_devtool_web||parseInt(e.app_id)!==this.app_id)return;this.addLintener(),this.loadDebuggerModule(),this.loadDevTool()}catch(xX){console.log("debug fail, ".concat(xX.message))}}},{key:"loadDevTool",value:function(){this.loadScript("https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/devtool/debug-web.js")}},{key:"loadBaseInfo",value:function(){var e=this;this.info=[{title:"基本信息",type:1,infoName:{app_id:this.config.app_id,channel:this.config.channel,"上报域名":this.collect.configManager.getDomain(),"SDK版本":Y5,"SDK引入方式":"npm"}},{title:"用户信息",type:2,infoName:{uuid:this.collect.configManager.get("user").user_unique_id||"",web_id:this.collect.configManager.get("user").web_id||"",ssid:"点击获取SSID"}},{title:"公共参数信息",type:2,infoName:{"浏览器":this.collect.configManager.get("browser"),"浏览器版本":this.collect.configManager.get("browser_version"),"平台":this.collect.configManager.get("platform"),"设备型号":this.collect.configManager.get("device_model"),"操作系统":this.collect.configManager.get("os_name"),"操作系统版本":this.collect.configManager.get("os_version"),"屏幕分辨率":this.collect.configManager.get("os_version"),"来源":this.collect.configManager.get("referrer"),"自定义信息":""}},{title:"配置信息",type:3,infoName:{"全埋点":!!this.config.autotrack,"停留时长":!!this.config.enable_stay_duration}},{title:"A/B配置信息",type:4,infoName:{"A/B实验":!!this.config.enable_ab_test}},{title:"客户端信息",type:3,infoName:{"打通开关":!!this.config.Native}}],this.log=[],this.event=[],this.collect.on($5.Ready,(function(){e.info[1].infoName.uuid=e.collect.configManager.get("user").user_unique_id,e.info[1].infoName.web_id=e.collect.configManager.get("user").web_id,e.info[2].infoName["自定义信息"]=JSON.stringify(e.collect.configManager.get("custom")),e.config.enable_ab_test&&(e.info[4].infoName["已曝光VID"]=e.collect.configManager.getAbVersion(),e.info[4].infoName["A/B域名"]=e.config.ab_channel_domain||x5(K5[e.config.channel]),e.info[4].infoName["全部配置"]=e.collect.configManager.getAbData()),e.config.Native&&(e.info[5].infoName["是否打通"]=!!e.collect.bridgeReport)}))}},{key:"loadHook",value:function(){var e=this;this.collect.on(X5.DEBUGGER_MESSAGE,(function(t){switch(t.type){case X5.DEBUGGER_MESSAGE_SDK:var n={time:t.time,type:t.logType||"sdk",level:t.level,name:t.info,show:!0,levelShow:!0,needDesc:!!t.data};return t.data&&(n.desc={content:JSON.stringify(t.data)}),e.updateLog(n),t.secType&&"AB"===t.secType?(e.info[4].infoName["已曝光VID"]=e.collect.configManager.getAbVersion(),e.info[4].infoName["全部配置"]=e.collect.configManager.getAbData()):"USER"===t.secType&&(e.info[1].infoName.uuid=e.collect.configManager.get("user").user_unique_id,e.info[1].infoName.web_id=e.collect.configManager.get("user").web_id),void e.updateInfo();case X5.DEBUGGER_MESSAGE_EVENT:if(t.data&&t.data.length){var i=t.data[0],r=i.events;if(!r.length)return;r.forEach((function(n){n.checkShow=!0,n.searchShow=!0,n.success=t.status,n.type=-1!==e.filterEvent.indexOf(n.event)?"sdk":"cus",n.type=e.collect.bridgeReport?"bridge":n.type,n.info="","fail"===t.status&&(n.info={message:"code: ".concat(t.code,", msg: ").concat(t.failType)})})),e.updateEvent(i)}return}}))}},{key:"addLintener",value:function(){var e=this;window.addEventListener("message",(function(t){if(t&&t.data&&"devtool:web:ready"===t.data.type){if(e.devToolOrigin=t.origin,e.devToolReady=!0,e.sendAlready)return;console.log("inittttt"),e.sendData("devtool:web:init",{info:e.info,log:e.log,event:e.event}),e.sendAlready=!0}t&&t.data&&"devtool:web:ssid"===t.data.type&&e.collect.getToken((function(t){e.info[1].infoName.ssid=t.tobid,e.updateInfo()}))}))}},{key:"sendData",value:function(e,t){try{var n={type:e,payload:t};(window.opener||window.parent).postMessage(n,this.devToolOrigin)}catch(xX){}}},{key:"updateInfo",value:function(){this.devToolReady&&this.sendData("devtool:web:info",this.info)}},{key:"updateLog",value:function(e){this.devToolReady?this.sendData("devtool:web:log",e):this.log.push(e)}},{key:"updateEvent",value:function(e){this.devToolReady?this.sendData("devtool:web:event",e):this.event.push(e)}},{key:"loadDebuggerModule",value:function(){var e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.appendChild(document.createTextNode("#debugger-applog-web {\n position: absolute;\n width: 90px;\n height: 30px;\n background: #23c243;\n border-radius: 6px;\n color: #fff;\n font-size: 12px;\n bottom: 5%;\n right: 10%;\n text-align: center;\n line-height: 30px;\n cursor: pointer;\n z-index:100;\n }")),e.appendChild(t);var n=document.createElement("div");n.innerHTML='<div id="debugger-applog-web" class="debugger-applog-web">AppLog调试</div>';var i=document.createElement("div");i.innerHTML='<div id="debugger-container" class="debugger-container"></div>',document.getElementsByTagName("body")[0].appendChild(n),document.getElementsByTagName("body")[0].appendChild(i),document.getElementById("debugger-applog-web").addEventListener("click",(function(){(window.opener||window.parent).postMessage({type:"devtool:web:open-draw"},location.origin)}))}}]),e}(),k4=["web_id","user_unique_id"],w4=function(){function e(t){a(this,e),this.disableAutoPageView=!1,this.bridgeReport=!1,this.staging=!1,this.pluginInstances=[],this.sended=!1,this.started=!1,this.destroyInstance=!1,this.sdkReady=!1,this.adapters={},this.name=t,this.hook=new T5,this.remotePlugin=new Map,this.Types=$5,this.adapters.fetch=a4,this.adapters.storage=z5}return l(e,[{key:"usePlugin",value:function(e,t,n){e&&(t?"string"==typeof t?this.remotePlugin.get(e)||this.remotePlugin.set(e,{src:t,call:n}):this.remotePlugin.get(e)||this.remotePlugin.set(e,{instance:t}):this.remotePlugin.get(e)||this.remotePlugin.set(e,"sdk"))}},{key:"init",value:function(t){var n,i=this;this.inited?console.warn("[instance: ".concat(this.name,"], every instance's api: init, can be call only one time!")):t&&S5(t)?t.app_id&&("number"==typeof(n=t.app_id)&&!isNaN(n))?!t.app_key||function(e){return"string"==typeof e}(t.app_key)?(t.channel_domain||-1!==["cn","sg","va"].indexOf(t.channel)||(console.warn("channel must be `cn`, `sg`,`va` !!!"),t.channel="cn"),this.logger=new n4(this.name,t.log),this.appBridge=new i4(this,t.Native),this.bridgeReport=this.appBridge.bridgeInject(),this.configManager=new t4(this,t),this.debugger=new b4(this,t),this.initConfig=t,this.emit($5.Init),this.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"SDK 执行INIT",data:t,level:"info",time:Date.now()}),t.disable_auto_pv&&(this.disableAutoPageView=!0),this.bridgeReport||(this.configManager.set({app_id:t.app_id}),this.eventManager=new p4,this.tokenManager=new y4,this.sessionManager=new _4,Promise.all([new Promise((function(e){i.once($5.TokenComplete,(function(){e(!0)}))})),new Promise((function(e){i.once($5.Start,(function(){e(!0)}))}))]).then((function(){try{e.plugins.reduce((function(e,t){var n=t.plugin,r=t.options,o=Object.assign(i.initConfig,r),a=new n;return a.apply(i,o),e.push(a),e}),i.pluginInstances)}catch(xX){console.log("load plugin error, ".concat(xX.message)),i.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:xX.message})}i.sdkReady=!0,i.emit($5.Ready),i.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"SDK 初始化完成",time:Date.now(),level:"info",data:i.configManager.get("user")}),i.logger.info("appid: ".concat(t.app_id,", userInfo:").concat(JSON.stringify(i.configManager.get("user")))),i.logger.info("appid: ".concat(t.app_id,", sdk is ready, version is ").concat(Y5,", you can report now !!!")),t.disable_auto_pv&&(i.disableAutoPageView=!0);try{(t.enable_ab_test||t.autotrack)&&(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(xX){i.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:xX.message})}i.pageView(),i.on($5.TokenChange,(function(e){"webid"===e&&i.pageView(),i.logger.info("appid: ".concat(t.app_id," token change, new userInfo:").concat(JSON.stringify(i.configManager.get("user")))),i.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"SDK 设置了用户信息",time:Date.now(),secType:"USER",level:"info",data:i.configManager.get("user")})})),i.on($5.TokenReset,(function(){i.logger.info("appid: ".concat(t.app_id," token reset, new userInfo:").concat(JSON.stringify(i.configManager.get("user")))),i.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"SDK 重置了用户信息",time:Date.now(),secType:"USER",level:"info",data:i.configManager.get("user")})})),i.on($5.RouteChange,(function(e){e.init||t.disable_route_report||i.pageView()}));try{(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(xX){}})),this.tokenManager.apply(this,t),this.eventManager.apply(this,t),this.sessionManager.apply(this,t)),this.inited=!0):console.warn("app_key param is error, must be string, please check!"):console.warn("app_id param is error, must be number, please check!"):console.warn("init params error,please check")}},{key:"config",value:function(e){if(this.inited)if(e&&S5(e))if(this.bridgeReport)this.appBridge.setConfig(e);else{e._staging_flag&&1===e._staging_flag&&(this.staging=!0),e.disable_auto_pv&&(this.disableAutoPageView=!0,delete e.disable_auto_pv);var n=t({},e);if(this.initConfig&&this.initConfig.configPersist){var i=this.configManager.getStore();i&&(n=Object.assign(i,e)),this.configManager.setStore(e)}var r=n;r.web_id,r.user_unique_id;var o=f(r,k4);n.hasOwnProperty("web_id")&&this.emit($5.ConfigWebId,n.web_id),n.hasOwnProperty("user_unique_id")&&this.emit($5.ConfigUuid,n.user_unique_id),this.configManager.set(o),this.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"SDK 执行CONFIG",level:"info",time:Date.now(),data:n})}else console.warn("config params is error, please check");else console.warn("config must be use after function init")}},{key:"setDomain",value:function(e){this.configManager&&this.configManager.setDomain(e),this.emit($5.ConfigDomain)}},{key:"getConfig",value:function(e){return this.configManager.get(e)}},{key:"send",value:function(){this.start()}},{key:"start",value:function(){this.inited&&!this.sended&&(this.sended=!0,this.emit($5.Start),this.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"SDK 执行START",level:"info",time:Date.now()}),this.bridgeReport&&(this.pageView(),this.emit($5.Ready)))}},{key:"event",value:function(e,t){var n=this;try{if(this.initConfig&&this.initConfig.disable_track_event)return;var i=[];Array.isArray(e)?e.forEach((function(e){i.push(n.processEvent(e[0],e[1]||{}))})):i.push(this.processEvent(e,t)),this.bridgeReport?i.forEach((function(e){var t=e.event,i=e.params;n.appBridge.onEventV3(t,JSON.stringify(i))})):i.length&&(this.emit($5.Event,i),this.emit($5.SessionResetTime))}catch(xX){console.warn("something error, please check"),this.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:xX.message})}}},{key:"beconEvent",value:function(e,t){if(!this.initConfig||!this.initConfig.disable_track_event)if(Array.isArray(e))console.warn("beconEvent not support batch report, please check");else{var n=[];n.push(this.processEvent(e,t||{})),n.length&&(this.emit($5.BeconEvent,n),this.emit($5.SessionResetTime))}}},{key:"processEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{var n=/^event\./,r=e;n.test(e)&&(r=e.slice(6));var o,a=t;"object"!==i(a)&&(a={}),a.profile?delete a.profile:a.event_index=C5(),a.local_ms?(o=a.local_ms,delete a.local_ms):o=+new Date;var s={event:r,params:a,local_time_ms:o,is_bav:this.initConfig&&this.initConfig.autotrack?1:0};return s}catch(xX){return this.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:xX.message}),{event:e,params:t}}}},{key:"filterEvent",value:function(e){this.eventFilter=e}},{key:"on",value:function(e,t){this.hook.on(e,t)}},{key:"once",value:function(e,t){this.hook.once(e,t)}},{key:"off",value:function(e,t){this.hook.off(e,t)}},{key:"emit",value:function(e,t,n){this.hook.emit(e,t,n)}},{key:"set",value:function(e){this.hook.set(e)}},{key:"pageView",value:function(){this.disableAutoPageView||this.predefinePageView()}},{key:"predefinePageView",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={title:document.title||location.pathname,url:location.href,url_path:location.pathname,time:Date.now(),referrer:window.document.referrer,$is_first_time:"".concat(this.configManager.is_first_time)},i=t(t({},n),e);this.event("predefine_pageview",i)}},{key:"clearEventCache",value:function(){this.emit($5.CleanEvents)}},{key:"setWebIDviaUnionID",value:function(e){if(e){var t=I5(e);this.config({web_id:"".concat(t),wechat_unionid:e}),this.emit($5.CustomWebId)}}},{key:"setWebId",value:function(e){this.config({web_id:"".concat(e)})}},{key:"setWebIDviaOpenID",value:function(e){if(e){var t=I5(e);this.config({web_id:"".concat(t),wechat_openid:e}),this.emit($5.CustomWebId)}}},{key:"setNativeAppId",value:function(e){this.bridgeReport&&this.appBridge.setNativeAppId(e)}},{key:"resetStayDuration",value:function(e,t,n){this.emit($5.ResetStay,{url_path:e,title:t,url:n},$5.Stay)}},{key:"resetStayParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";this.emit($5.SetStay,{url_path:e,title:t,url:n},$5.Stay)}},{key:"getToken",value:function(e,n){var i=this,r=!1,o=function(n){if(!r){r=!0;var o=i.configManager.get().user;return n&&(o.tobid=n,o["diss".split("").reverse().join("")]=n),e(t({},o))}},a=function(){i.tokenManager.getTobId().then((function(e){o(e)}))};this.sdkReady?a():(n&&setTimeout((function(){o()}),n),this.on($5.Ready,(function(){a()})))}},{key:"profileSet",value:function(e){this.bridgeReport?this.appBridge.profileSet(JSON.stringify(e)):this.emit($5.ProfileSet,e,$5.Profile),this.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileSet",level:"info",time:Date.now(),data:e})}},{key:"profileSetOnce",value:function(e){this.bridgeReport?this.appBridge.profileSetOnce(JSON.stringify(e)):this.emit($5.ProfileSetOnce,e,$5.Profile),this.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileSetOnce",level:"info",time:Date.now(),data:e})}},{key:"profileIncrement",value:function(e){this.bridgeReport?this.appBridge.profileIncrement(JSON.stringify(e)):this.emit($5.ProfileIncrement,e,$5.Profile),this.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileIncrement",level:"info",time:Date.now(),data:e})}},{key:"profileUnset",value:function(e){this.bridgeReport?this.appBridge.profileUnset(e):this.emit($5.ProfileUnset,e,$5.Profile),this.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileUnset",level:"info",time:Date.now(),data:e})}},{key:"profileAppend",value:function(e){this.bridgeReport?this.appBridge.profileAppend(JSON.stringify(e)):this.emit($5.ProfileAppend,e,$5.Profile),this.emit(X5.DEBUGGER_MESSAGE,{type:X5.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileAppend",level:"info",time:Date.now(),data:e})}},{key:"setExternalAbVersion",value:function(e){this.emit($5.AbExternalVersion,"string"==typeof e&&e?"".concat(e).trim():null,$5.Ab)}},{key:"getVar",value:function(e,t,n){this.emit($5.AbVar,{name:e,defaultValue:t,callback:n},$5.Ab)}},{key:"getABconfig",value:function(e,t){this.emit($5.AbConfig,{params:e,callback:t},$5.Ab)}},{key:"getAbSdkVersion",value:function(){return this.configManager.getAbVersion()}},{key:"onAbSdkVersionChange",value:function(e){var t=this;return this.emit($5.AbVersionChangeOn,e,$5.Ab),function(){t.emit($5.AbVersionChangeOff,e,$5.Ab)}}},{key:"offAbSdkVersionChange",value:function(e){this.emit($5.AbVersionChangeOff,e,$5.Ab)}},{key:"openOverlayer",value:function(){this.emit($5.AbOpenLayer,"",$5.Ab)}},{key:"closeOverlayer",value:function(){this.emit($5.AbCloseLayer,"",$5.Ab)}},{key:"getAllVars",value:function(e){this.emit($5.AbAllVars,e,$5.Ab)}},{key:"autoInitializationRangers",value:function(e){var t,n,i,r,o,a,s,l;n=(t=e).app_id,i=t.channel,r=t.onTokenReady,o="".concat(q5[i],"/webid"),a=new z5(!1),s="__tea_cache_tokens_".concat(n),(l=a.getItem(s))&&l.web_id?r(l.web_id):d4(o,{app_key:"",app_id:n,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer},3e3,!1,(function(e){if(e&&0===e.e){r(e.web_id);var t={web_id:e.web_id,user_unique_id:e.web_id,timestamp:Date.now()};a.setItem(s,t)}else r("")}),(function(){r("")}),!0)}},{key:"destoryInstace",value:function(){this.destroyInstance||(this.destroyInstance=!0,this.off($5.TokenComplete))}}],[{key:"usePlugin",value:function(t,n,i){if(n){for(var r=!1,o=0,a=e.plugins.length;o<a;o++){if(e.plugins[o].name===n){e.plugins[o].plugin=t,e.plugins[o].options=i||{},r=!0;break}}r||e.plugins.push({name:n,plugin:t,options:i})}else e.plugins.push({plugin:t})}}]),e}(),E4=w4;function T4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function S4(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T4(Object(n),!0).forEach((function(t){P4(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T4(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function C4(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(w7){return void n(w7)}s.done?t(l):Promise.resolve(l).then(i,r)}function x4(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){C4(o,i,r,a,s,"next",e)}function s(e){C4(o,i,r,a,s,"throw",e)}a(void 0)}))}}function O4(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function P4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I4(e,t){return e(t={exports:{}},t.exports),t.exports}E4.plugins=[];var L4=I4((function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(D){c=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var r=t&&t.prototype instanceof y?t:y,o=Object.create(r.prototype),a=new P(i||[]);return o._invoke=function(e,t,n){var i=d;return function(r,o){if(i===p)throw new Error("Generator is already running");if(i===g){if("throw"===r)throw o;return L()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=C(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===d)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var l=h(e,t,n);if("normal"===l.type){if(i=n.done?g:f,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=g,n.method="throw",n.arg=l.arg)}}}(e,n,a),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(D){return{type:"throw",arg:D}}}e.wrap=u;var d="suspendedStart",f="suspendedYield",p="executing",g="completed",v={};function y(){}function m(){}function _(){}var b={};b[a]=function(){return this};var k=Object.getPrototypeOf,w=k&&k(k(I([])));w&&w!==n&&r.call(w,a)&&(b=w);var E=_.prototype=y.prototype=Object.create(b);function T(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(o,a,s,l){var c=h(e[o],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"===i(d)&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,l)}),(function(e){n("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,l)}))}l(c.arg)}var o;this._invoke=function(e,i){function r(){return new t((function(t,r){n(e,i,t,r)}))}return o=o?o.then(r,r):r()}}function C(e,n){var i=e.iterator[n.method];if(i===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var r=h(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,v;var o=r.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function I(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:L}}function L(){return{value:t,done:!0}}return m.prototype=E.constructor=_,_.constructor=m,m.displayName=c(_,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,c(e,l,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},T(S.prototype),S.prototype[s]=function(){return this},e.AsyncIterator=S,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var a=new S(u(t,n,i,r),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},T(E),c(E,l,"Generator"),E[a]=function(){return this},E.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(i,r){return s.type="throw",s.arg=e,n.next=i,r&&(n.method="next",n.arg=t),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;O(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:I(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(n){Function("r","regeneratorRuntime = r")(t)}})),D4="xgplayer_device_id",A4="xgplayer_user_id",M4=function(e){if(!document.cookie)return null;for(var t=document.cookie.split(";"),n=0,i=t.length;n<i;n++){var r=t[n];if(t[n].indexOf(e)>=0)return r.split("=")[1]||null}},R4=function(e){return String(Math.floor(Math.random()*Math.pow(10,e)))},N4=function(){var e=M4(D4);if(e)return e;var t=R4(11);return document.cookie=D4+"="+t+";max-age=31536000;path=/",t},j4=function(){var e=M4(A4);if(e)return e;var t=R4(12);return document.cookie=A4+"="+t+";max-age=31536000;path=/",t};var B4={get device(){return B4.os.isPc?"pc":"mobile"},get browser(){var e=function(){var e=navigator.userAgent.toLowerCase(),t={},n={IE:window.ActiveXObject||"ActiveXObject"in window,Chrome:e.indexOf("chrome")>-1&&e.indexOf("safari")>-1,Firefox:e.indexOf("firefox")>-1,Opera:e.indexOf("opera")>-1,Safari:e.indexOf("safari")>-1&&-1==e.indexOf("chrome"),Edge:e.indexOf("edge")>-1,QQBrowser:/qqbrowser/.test(e),WeixinBrowser:/MicroMessenger/i.test(e)};for(var i in n)if(n[i]){var r="";if("IE"===i)r=e.match(/(msie\s|trident.*rv:)([\w.]+)/)[2];else if("Chrome"===i){for(var o in navigator.mimeTypes)"application/360softmgrplugin"===navigator.mimeTypes[o].type&&(i="360");var a=e.match(/chrome\/([\d.]+)/);r=a?a[1]:"-1"}else if("Firefox"===i){var s=e.match(/firefox\/([\d.]+)/);r=s?s[1]:"-1"}else if("Opera"===i){var l=e.match(/opera\/([\d.]+)/);r=l?l[1]:"-1"}else if("Safari"===i){var c=e.match(/version\/([\d.]+)/);r=c?c[1]:"-1"}else if("Edge"===i){var u=e.match(/edge\/([\d.]+)/);r=u?u[1]:"-1"}else if("QQBrowser"===i){var h=e.match(/qqbrowser\/([\d.]+)/);r=h?h[1]:"-1"}t.type=i,t.versions=parseInt(r)}return t}();return e.type+"_"+e.versions},get os(){var e=navigator.userAgent;navigator.platform.toLowerCase();var t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,i=/(?:Android)/.test(e),r=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||i&&!/(?:Mobile)/.test(e)||r&&/(?:Tablet)/.test(e),a=/(?:iPhone)/.test(e)&&!o;return{isTablet:o,isPhone:a,isAndroid:i,isPc:!(a||i||n||o),isSymbian:n,isWindowsPhone:t,isFireFox:r}},get operation_os(){for(var e=navigator.userAgent,t=[{s:"windows",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1|Windows 8.1|Windows NT 6.3|Windows 8|Windows NT 6.2|Windows 7|Windows NT 6.1)/},{s:"android",r:/Android/},{s:"linux",r:/(Linux|X11)/},{s:"ios",r:/(iPhone|iPad|iPod)/},{s:"mac",r:/Mac OS X/},{s:"mac",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],n=0;n<t.length;n++){var i=t[n];if(i.r.test(e))return i.s}return"unknown"}};function U4(){return(new Date).getTime()}function H4(e){var t="unknown";return"string"!=typeof e?t:e.indexOf(".flv")>-1?"flv":e.indexOf(".m3u8")>-1?"m3u8":e.indexOf(".mp4")>-1?"mp4":e.indexOf(".sdp")>-1?"rts":t}function F4(e){if(e.plugins){if(e.plugins.flv)return e.plugins.flv;if(e.plugins.hls)return e.plugins.hls;if(e.plugins.rts)return e.plugins.rts;if(e.plugins.flvlive)return e.plugins.flvlive;if(e.plugins.hlslive)return e.plugins.hlslive;if(e.plugins.hlsvod)return e.plugins.hlsvod;if(e.plugins.hlslivemobile)return e.plugins.hlslivemobile;if(e.plugins.flvlivemobile)return e.plugins.flvlivemobile}return e.newHls||e.newFlv||e.__core__||e.flv}var G4={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"},V4={cn:7497,va:7997},z4=new E4("xglive"),W4=function(){function e(e){var t=e.user_id,n=e.device_id,i=e.channel,r=void 0===i?"cn":i,o=e.channel_domain;if(!z4.inited){var a={app_id:V4[r],channel:r};o&&(a.channel_domain=o),z4.init(a),z4.start(),z4.inited=!0}var s={};t&&(s.user_unique_id=t),n&&(s.device_id=n),z4.config(s),this.logOptions=e,this._player=e.player}var t=e.prototype;return t.push=function(e){var t=this._player.config.url;this._player.video&&(e.play_current_time=this._player.currentTime),e.cdn_play_url=t&&t.startsWith("//")?window.location.protocol+t:t,e.play_format=H4(t),e.timestamp=U4(),this.send(e)},t.send=function(e){e.event_key&&(this.logOptions.onReport&&this.logOptions.onReport(e.event_key,e),z4.event(e.event_key,S4({},e)))},e}(),K4=function(){return void 0!==navigator.onLine?navigator.onLine?(e=navigator.connection)&&(e.effectiveType||e.type)||B4.device:"none":"unknown";var e},q4=["play","playing","pause","ended","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","ratechange","volumechange","loadeddata"],Y4=!1,$4=function(){function e(e){this.options=e,this.logger=new X4(e),this.restart=this.restart.bind(this),this.bindUrlChange(),Y4=B4.browser.includes("Safari")}var t=e.prototype;return t.restart=function(e){this.destroy("string"!=typeof e&&Boolean(e)),this.logger=new X4(this.options),this.bindUrlChange(),this.logger.reportStartPlay(),this.logger.handlePlayerComlete()},t.bindUrlChange=function(){this.options&&this.options.player&&!this.options.manual_restart&&this.options.player.on("urlchange",this.restart)},t.setNTP=function(e){this.logger.setNTP(e)},t.updateExt=function(e){this.options.ext=Object.assign(this.options.ext||{},e),this.logger&&this.logger.updateExt(e)},t.destroy=function(e){this.logger.destroy(e),this.logger=null,this.options&&this.options.player&&!this.options.manual_restart&&this.options.player.off("urlchange",this.restart)},e}(),X4=function(){function e(e){if(!e.player)throw new Error("option player is necessary");this.options=Object.assign({},e,function(e){return{device_id:e.device_id||N4(),user_id:e.user_id||j4(),error_report_stop:!!e.error_report_stop,project_key:e.project_key||"xigua_live",product_line:e.product_line||"live",onReport:e.onReport||function(){}}}(e)),this._player=this.options.player,this._url=this._player.config.url,this.project_key=e.project_key||"xigua_live",this.product_line=e.product_line||"live",this.ntpDelta=this.options.ntp?Date.now()-this.options.ntp:0,this.inWaitingStart=0,this.errorNumber=0,this.tempDroppedFrameCount=0,this.tempTotalFrameCount=0;this.options.reportURL?this.options.reportURL:this.options.overseas||"https://log.isnssdk.com/video/v1/live_log/".replace("isnssdk","snssdk"),this._logmanager=new W4(this.options),this.init(),this.started=!1,this.destroyed=!1,this.completed=!1,this.firstFrameViewed=!1,this.cacheRtcStats={}}var t,n,i,r=e.prototype;return r.setNTP=function(e){this.options&&(this.options.ntp=e,this.ntpDelta=Date.now()-this.options.ntp)},r.init=function(){this.bindCtx(),this.initLog(),this.initEvt()},r.bindCtx=function(){this.handlePlayerComlete=this.handlePlayerComlete.bind(this),this.handlePlayerPlaying=this.handlePlayerPlaying.bind(this),this.destroyFunc=this.destroyFunc.bind(this),this.handleUserLeave=this.handleUserLeave.bind(this),this.handlePlayerError=this.handlePlayerError.bind(this),this.handlePlayerReady=this.handlePlayerReady.bind(this),this.handlePlayerWaiting=this.handlePlayerWaiting.bind(this),this.handleAVUnsync=this.handleAVUnsync.bind(this),this.handlePlayerPause=this.handlePlayerPause.bind(this),this.handleTTFB=this.handleTTFB.bind(this),this.handleUrlChange=this.handleUrlChange.bind(this),this.handleKeyframe=this.handleKeyframe.bind(this),this.handleSourceOpen=this.handleSourceOpen.bind(this),this.handleBufferAppend=this.handleBufferAppend.bind(this),this.handleCoreEvent=this.handleCoreEvent.bind(this),this.handleDegrade=this.handleDegrade.bind(this)},r.initLog=function(){var e=this,t=this.options,n=t.player,i=void 0!==n.hlsOps;this.commonParams=S4({os:B4.operation_os},function(e){var t=e.player,n=t.config.mediaType;return S4({project_key:e.project_key,live_sdk_version:F4(t)||t.hlsOps?"2":"-1",player_sdk_version:t.version,logger_version:"1.0.0-alpha.9",report_version:"5",product_line:e.product_line,user_id:e.user_id,device_id:e.device_id,logger_id:R4(12),app_name:e.app_name,cdn_ip:e.cdn_ip,is_wasm:+(!!n&&"video"!==n),review_is_live:t.config.isLive?2:1,aid:e.aid,live_id:e.live_id||e.aid+"-"+e.user_id+"-"+Date.now(),is_preview:e.is_preview?1:0,codec_type:e.codec_type||"h264",width:Math.floor(t.config.width),height:Math.floor(t.config.height),browser:B4.browser,ua:navigator.userAgent,href:window.location.href,timestamp:0,logger_init_time:Date.now(),play_current_time:0,cdn_play_url:t.config.url&&t.config.url.startsWith("//")?window.location.protocol+t.config.url:t.config.url,play_format:H4(t.config.url)},e.ext)}(t)),this.log=Object.assign({},{start_play:{start_play_time:0,event_key:"start_play"},first_frame:{start:0,first_frame_view:0,event_key:"first_frame",first_sei_delay:0,ntp_sync:0,ntp_delta:0,ttfb:-1,ttdb:-1,ttfb_end:0},first_frame_failed:{code:void 0,msg:"",event_key:"first_frame_failed"},stall_start:{ready_state:-1,stall_start_time:0,event_key:"stall_start"},stalling:{event_key:"stalling"},stall:{reason:0,stall_start:0,stall_end:0,ready_state:0,event_key:"stall"},play_stop:{code:0,stop_time:0,drop_percent:0,is_stream_received:0,stall_count:0,stall_time:0,retry_count:0,duration:0,stall_count_per_100sec:0,stall_time_per_100sec:0,event_key:"play_stop",dns_parse_time:-1,redirect:-1,ttfb:-1,buffered:[],is_firstframe_received:0,meta:null},playing:{index:0,stall_count:0,stall_time:0,play_time:1e4,retry_count:0,is_last:0,video_buffer_time:0,audio_buffer_time:0,speed_switch_count:0,speed_switch_info:"none",download_speed:0,decode_fps:0,render_fps:0,drop_count:0,drop_percent:0,sei_source:"",sei_delay:0,ntp_sync:0,ntp_delta:0,event_key:"playing",stop_time:0,duration:0,stall_count_per_100sec:0,stall_time_per_100sec:0},play_error:{code:void 0,info:"",event_key:"play_error"},play_low_decode:{fps:-1,decode_fps:-1,bitrate:-1,url:-1,msg:"",event_key:"play_low_decode"},play_av_unsync:{aDts:-1,vDts:-1,frameLength:-1,currentTime:-1,duration:0,event_key:"play_av_unsync"},play_loadstream:{loadstream_url:"",event_key:"play_loadstream"},play_stream_loaded:{event_key:"play_stream_loaded"},play_metadata_loaded:{metadata_type:"",event_key:"play_metadata_loaded"},stream_exception:{event_key:"stream_exception"},pause:{event_key:"pause"},play_url_change:{event_key:"play_url_change"},source_opened:{event_key:"source_opened"},source_updateend:{event_key:"source_updateend"},play_result:{event_key:"play_result",result:0,threshold:15e3,is_threshold:0},degrade:{event_key:"degrade",payload:{}}});var r=this;for(var o in this.log){var a=function(t){Object.defineProperty(e.log[o],t,{get:function(){return null==this["_"+t]?r.commonParams[t]:this["_"+t]},set:function(e){this["_"+t]=e},enumerable:!0})};for(var s in this.commonParams)a(s);i&&Object.defineProperty(this.log[o],"m3u8",{get:function(){if(n.__core__){var e=n.__core__.m3u8Text;return e?e.slice(0,25e4):""}return""},enumerable:!0}),Object.defineProperty(this.log[o],"volume",{get:function(){if(n&&n.video)return n.volume||0},enumerable:!0}),Object.defineProperty(this.log[o],"access",{get:function(){return K4()},enumerable:!0})}},r.updateExt=function(e){for(var t in this.log)for(var n in e)this.log[t][n]=e[n]},r.reportStartPlay=function(){this.started||(this.started=!0,this.log.start_play.start_play_time=this.log.start_play.timestamp=U4(),this.logmanager.push(this.log.start_play,!0))},r.initWindowListener=function(){"pc"===B4.device?window.addEventListener("beforeunload",this.handleUserLeave):"mobile"===B4.device&&(window.addEventListener("beforeunload",this.handleUserLeave),window.addEventListener("pagehide",this.handleUserLeave))},r.removeWindowListener=function(){"pc"===B4.device?window.removeEventListener("beforeunload",this.handleUserLeave):"mobile"===B4.device&&(window.removeEventListener("beforeunload",this.handleUserLeave),window.removeEventListener("pagehide",this.handleUserLeave))},r.initEvt=function(){var e=this,t=this.player;q4.forEach((function(t){e["handleVideo"+t+"Evt"]=function(){e["handleVideo"+t]&&e["handleVideo"+t]()},e.initWindowListener(),e.bindVideoEvt(t,e["handleVideo"+t+"Evt"])})),t.once("error",this.handlePlayerError),t.once("complete",this.handlePlayerComlete),t.once("playing",this.handlePlayerPlaying),t.once("timeupdate",this.handlePlayerPlaying),t.once("destroy",this.destroyFunc),t.on("ready",this.handlePlayerReady),t.on("waiting",this.handlePlayerWaiting),t.on("pause",this.handlePlayerPause),t.on("urlchange",this.handleUrlChange),t.once("sourceopen",this.handleSourceOpen),t.once("bufferappend",this.handleBufferAppend),t.on("core_event",this.handleCoreEvent),t.on("degrade",this.handleDegrade),this.hiJackPlayerStart()},r.handleCoreEvent=function(e){var t=e.eventName,n=e.headers,i=e.pts,r=e.type,o=e.meta,a=e.sei,s=e.decodeFps,l=e.url;switch(t){case"core.ttfb":this.handleTTFB(e);break;case"core.loadresponseheaders":var c=n.get("X-Server-Ip");void 0!==this.player.hlsOps&&(this.log.play_stop.review_ts_count+=1),c&&(this.commonParams.cdn_ip=c);break;case"core.loadretry":this.log.play_stop.retry_count++;break;case"core.keyframe":this.handleKeyframe(i);break;case"core.metadataparsed":this.handleMetaDataLoaded(r,o);break;case"core.sei":this.handleSEIParsed(a);break;case"core.lowdecode":this.commonParams.is_wasm&&(Object.assign(this.log.play_low_decode,e||{}),this.log.play_low_decode.decode_fps=s,this.log.play_low_decode.timestamp=U4(),this.logmanager.push(this.log.play_low_decode,!0),this.commonParams.is_wasm=0);break;case"core.largeavgap":this.handleAVUnsync(e);break;case"core.loadstart":this.handlePlayerLoadStream(l);break;case"core.loadcomplete":this.handlePlayerLoadedStream();break;case"core.streamexception":this.handleStreamException(e)}},r.handleDegrade=function(e){this.log.degrade.payload=e,this.logmanager.push(this.log.degrade,!0)},r.hiJackPlayerStart=function(){var e=arguments,t=this;this.player._start=this.player.start;var n=this.player;n.start=function(){try{if(n._start)return n._start.apply(n,Array.prototype.slice.call(e,0))}catch(xX){}t.destroyed||t.handlePlayerComlete()}},r.handleTTFB=function(e){var t=e||{},n=t.end,i=t.elapsed;this.log.first_frame.ttfb=i||-1,this.log.first_frame.ttfb_end=n||0},r.handleUrlChange=function(e){this.logmanager.push(Object.assign(this.log.play_url_change,{url:e,timestamp:U4()}))},r.handleKeyframe=function(e){this.log.play_stop.is_firstframe_received=1,this.log.play_stop.firstframe_pts=e},r.handleSourceOpen=function(){this.log.source_opened.timestamp=U4(),this.logmanager.push(this.log.source_opened)},r.handleBufferAppend=function(){this.log.source_updateend.timestamp=U4(),this.logmanager.push(this.log.source_updateend)},r.handlePlayerPause=function(){this.log.pause.timestamp=U4(),this.logmanager.push(this.log.pause,!0)},r.handlePlayerError=function(e){this.errorNumber=1;var t=e.errorType,n=e.errorCode;Object.assign(this.log.play_error,S4({timestamp:U4(),code:n||("parse"===t?31:21),info:e.message,detail:JSON.stringify(e)},this.videoSize)),this.logmanager.push(this.log.play_error,!0),this.destroyed||(0===this.log.first_frame.first_frame_view&&(Object.assign(this.log.first_frame_failed,{code:n||("parse"===t?31:21),msg:e.message}),void 0!==this.log.first_frame_failed.timestamp&&(this.log.first_frame_failed.timestamp=U4()),this.logmanager.push(this.log.first_frame_failed,!0),this.log.play_result.is_threshold||(this.clearPlayResultTimer(),this.log.play_result.reason=e.message||"first frame failed",this.logmanager.push(this.log.play_result,!0))),this.options.error_report_stop?this.handleUserLeave():this.updatePlayStopParams())},r.handlePlayerLoadStream=function(e){if("string"==typeof e){var t=this.log.play_loadstream;t.timestamp=U4(),t.loadstream_url=e,this.logmanager.push(t)}},r.handlePlayerLoadedStream=function(){var e=this.log.play_stream_loaded;e.timestamp=U4(),this.logmanager.push(e)},r.handleSEIParsed=function(e){var t=this.log,n=t.playing,i=t.first_frame;if(100===e.code){var r=function(e){var t,n,i,r,o,a;for(t="",i=e.length,n=0;n<i;)switch((r=e[n++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(r);break;case 12:case 13:o=e[n++],t+=String.fromCharCode((31&r)<<6|63&o);break;case 14:o=e[n++],a=e[n++],t+=String.fromCharCode((15&r)<<12|(63&o)<<6|(63&a)<<0)}return t}(e.content);r=r.slice(r.indexOf("{"),r.lastIndexOf("}")+1);try{var o=JSON.parse(r),a=this.getPlayerBuffer()+this.ntpTime-o.ts;n.sei_delay=a,n.sei_source=o.source,n.ntp_sync=this.options.ntp?1:0,n.ntp_delta=this.ntp_delta,i.first_sei_delay=a,i.ntp_sync=this.options.ntp?1:0,i.ntp_delta=this.ntp_delta}catch(xX){}}},r.handleMetaDataLoaded=function(e,t){this.log.play_stop.meta=this.log.play_stop.meta||{},e&&(this.log.play_stop.meta[e]=t),this.log.play_metadata_loaded.timestamp=U4(),this.log.play_metadata_loaded.metadata_type=e,t&&(this.log.play_metadata_loaded.meta=t,this.log.play_metadata_loaded.codec=t.codec,this.commonParams.codec_type=t.codec),t||(this.log.play_metadata_loaded.meta=void 0,this.log.play_metadata_loaded.codec=void 0,"video"===e&&(this.commonParams.codec_type="unknown")),this.logmanager.push(this.log.play_metadata_loaded)},r.handleAVUnsync=function(e){Object.assign(this.log.play_av_unsync,e||{}),this.log.play_av_unsync.timestamp=U4(),this.logmanager.push(this.log.play_av_unsync,!1)},r.handleStreamException=function(e){this.logmanager.push(Object.assign({},this.log.stream_exception,e))},r.handlePlayerComlete=function(){this.completed||(this.completed=!0,this.core=F4(this.player),this.core&&(this.commonParams.live_sdk_version="2"),(this.player.config.autoplay||this.player.config.videoInit)&&this.reportStartPlay())},r.getPlayerBuffer=function(){var e=this.player.video.buffered;if(e){var t=Math.max(0,e.length-1);try{var n=Number.parseInt(1e3*(e.end(t)-this.player.video.currentTime));return this.log.playing.audio_buffer_time=this.log.playing.video_buffer_time=n,n}catch(xX){return 0}}},r.getPlayerDownloadSpeed=function(){if(this.core&&this.core.core)return this.core.core.speedInfo().speed},r.getPlayerQuality=function(){var e=this.player.video;if(e.getVideoPlaybackQuality){var t=e.getVideoPlaybackQuality();this.log.playing.drop_count=t.droppedVideoFrames-this.tempDroppedFrameCount,this.log.playing.drop_percent=Number.parseFloat(this.tempTotalFrameCount/t.totalVideoFrames).toFixed(1),this.log.play_stop.drop_percent=Number.parseFloat(t.droppedVideoFrames/t.totalVideoFrames).toFixed(1),this.tempDroppedFrameCount=t.droppedVideoFrames,this.tempTotalFrameCount=t.totalVideoFrames}},r.getExtraStats=function(){var e=x4(L4.mark((function e(t,n){return L4.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){if(Y4||"undefined"!==window.InstallTrigger)return e();try{t.getStats((function(t){t.result().forEach((function(e){var t={};e.names().forEach((function(n){t[n]=e.stat(n)})),t.id=e.id,t.type=e.type,t.timestamp=e.timestamp,"ssrc"===e.type?(null!=t.googAccelerateRate&&(n.accelerate_rate=t.googAccelerateRate),"audio"===t.mediaType?(n.audio_jitter_buffer_ms=t.googJitterBufferMs,n.audio_rtt_ms=t.googRtt,n.expand_rate=t.googExpandRate):"video"===t.mediaType&&(n.video_rtt_ms=t.googRtt,n.video_codec_name=t.googCodecName)):"VideoBwe"===e.type&&(n.video_recv_retransmit_bps=t.googRetransmitBitrate)})),e()}))}catch(w7){e()}})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.getRtcStats=function(){var e=x4(L4.mark((function e(t){var n,i,r,o,a=this;return L4.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.player.plugins.rts&&this.player.plugins.rts.pc){e.next=3;break}return e.abrupt("return");case 3:return i={},e.next=6,n.getStats();case 6:return r=e.sent,o=t-this.log.playing.timestamp,r.forEach((function(e){var t=e.type,n=e.mediaType,r=e.bytesReceived,s=e.packetsReceived,l=e.audioLevel,c=e.concealmentEvents,u=e.remoteTimestamp,h=e.timestamp,d=e.framesDropped,f=e.framesPerSecond,p=e.keyFramesDecoded,g=e.totalDecodeTime,v=e.framesDecoded,y=e.firCount,m=e.frameHeight,_=e.frameWidth,b=e.framesReceived,k=e.jitterBufferDelay,w=e.jitterBufferEmittedCount,E=e.jitter,T=e.nackCount,S=e.packetsLost,C=e.pliCount,x=e.totalSamplesReceived,O=e.concealedSamples;switch(t){case"inbound-rtp":"audio"===n?(i.audio_bytes_received=r,i.audio_packets_lost=S,i.audio_packets_received=s,i.audio_volume=-10*Math.log10(Math.pow(l,2))*255,i.concealment_event=c,i.audio_fraction_lost=S/s,null!=a.cacheRtcStats.totalSamplesReceived&&(i.audio_dec_sample_rate=(x-a.cacheRtcStats.totalSamplesReceived)/o),a.cacheRtcStats.totalSamplesReceived=x,i.concealed_samples=O,i.total_samples_received=x):(i.frames_dropped_by_framebuffer=d,i.frame_buffer_out_interval=f,i.iframes_jitter_buffer_out=p,i.video_bytes_received=r,i.video_dec_elapse=1e3*g,i.video_decoded_delay_ms=i.video_dec_elapse/v,i.video_fir_count=y,i.video_fraction_lost=S/s,i.video_frame_height=m,i.video_frame_width=_,null!=a.cacheRtcStats.framesDecoded&&(i.video_framerate_decoder_output=(v-a.cacheRtcStats.framesDecoded)/o),a.cacheRtcStats.framesDecoded=v,null!=a.cacheRtcStats.framesReceived&&(i.video_framerate_recv=(b-a.cacheRtcStats.framesReceived)/o),a.cacheRtcStats.framesReceived=b,i.video_jb_min_delay=k/w*1e3,i.video_jitter=1e3*E,i.video_nack_count=T,i.video_packets_lost=S,i.video_packets_received=s,i.video_pli_count=C);break;case"remote-outbound-rtp":i.e2e_delay_ms=h-u}i.total_delay=i.e2e_delay_ms+i.video_decoded_delay_ms+i.video_jb_min_delay})),e.next=11,this.getExtraStats(n,i);case 11:this.log.playing.rtc_stats=i;case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.reportPlaying=function(){var e=x4(L4.mark((function e(t){var n,i,r,o,a,s;return L4.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.commonParams.is_wasm&&(this.commonParams.fps=this.player.video.fps,this.log.playing.render_fps=this.player.video.fps,this.log.playing.decode_fps=this.player.video.decodeFps),this.log.playing.index++,n=this.log.playing.timestamp,this.inWaitingStart&&this.inWaitingStart<U4()&&(i=Math.min(this.options.playingInterval||this.log.playing.play_time,U4()-Math.max(this.inWaitingStart,n))),this.getPlayerQuality(),this.getPlayerBuffer(),this.options.downloadSpeedInterval||(this.log.playing.current_speed=this.getPlayerDownloadSpeed()),r=U4(),e.next=10,this.getRtcStats(r);case 10:o=r-n,a=(i>200?i:0)+this.log.playing.stall_time,s=(i>200?1:0)+this.log.playing.stall_count,this.options.aggregationDowngradeStallTime&&(this.log.playing.aggregation_downgrade_stall=(i>this.options.aggregationDowngradeStallTime?i:0)+(this.log.playing.aggregation_downgrade_stall||0)),Object.assign(this.log.playing,S4({timestamp:r,stop_time:r,duration:t?0:o/1e3,stall_time_per_100sec:a/o*100,stall_count_per_100sec:1e3*s/o*100,stall_count:s,stall_time:a,play_current_time:this.player.currentTime},this.videoSize)),this.logmanager.push(Object.assign({},this.log.playing,{play_time:t?0:o}),!0),this.log.playing.download_speed_array=[],this.log.playing.stall_time=0,this.log.playing.stall_count=0,this.options.aggregationDowngradeStallTime&&(this.log.playing.aggregation_downgrade_stall=0);case 20:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.handlePlayerPlaying=function(){var e=x4(L4.mark((function e(){var t,n=this;return L4.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.player&&this.player.video.readyState<3)){e.next=2;break}return e.abrupt("return");case 2:return this.player.off("playing",this.handlePlayerPlaying),this.player.off("timeupdate",this.handlePlayerPlaying),e.next=6,this.reportPlaying(!0);case 6:this.clearPlayingInterval(),t=this.options.playingInterval||this.log.playing.play_time,this.intervalId=setInterval(x4(L4.mark((function e(){return L4.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(Math.abs(Date.now()-n.log.playing.timestamp-t)<100||Date.now()-n.log.playing.timestamp>=t)){e.next=3;break}return e.next=3,n.reportPlaying();case 3:case"end":return e.stop()}}),e)}))),1e3),this.clearStallTimer(),this.handleVideoplaying(),this.started||this.reportStartPlay(),this.saveBuffered();case 13:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),r.handlePlayerReady=function(){var e=this;this.log.start_play.start_play_time=U4(),this.player.config.autoplay&&this.reportStartPlay(),this.options.playResultThreshold&&(this.log.play_result.threshold=this.options.playResultThreshold),this.clearPlayResultTimer(),this.playResultTimer=setTimeout((function(){e.log.play_result.is_threshold=1,e.logmanager.push(e.log.play_result,!0)}),this.log.play_result.threshold)},r.handlePlayerWaiting=function(){var e=this;!this.inWaitingStart&&this.log.first_frame.timestamp&&(this.log.stall.timestamp=this.inWaitingStart=this.log.stall.stall_start=U4(),this.log.stall_start.ready_state=this.log.stall.ready_state=this.player.video.readyState,this.log.stall_start.timestamp=U4(),this.log.stall_start.stall_start_time=U4(),this.log.stall_start.video_buffer_time=this.player.video.readyState,this.log.stall_start.play_current_time=this.player.currentTime,this.log.stall.play_current_time=this.player.currentTime,this.log.stall_start.buffered=this.getBuffered(),this.log.stall.buffered=this.log.stall_start.buffered,this.log.stall.current_speed=this.getPlayerDownloadSpeed(),Object.assign(this.log.stall_start,this.videoSize),this.clearStallTimer(),this.stallStartTimer=setTimeout((function(){e.logmanager.push(e.log.stall_start,!0)}),205))},r.handleVideoseeking=function(){this.player&&this.player.video&&this.inWaitingStart&&this.player.video.duration<1/0&&(this.inWaitingStart=0,this.clearStallTimer())},r.handleVideoseeked=function(){this.player&&this.player.video&&this.inWaitingStart&&this.player.video.duration<1/0&&(this.inWaitingStart=0,this.log.play_stop.stall_count>0&&this.log.play_stop.stall_count--)},r.handleVideoplay=function(){this.reportStartPlay(),this.removeVideoEvt("play",this.handleVideoplay)},r.handleVideotimeupdate=function(){Math.abs(this.player.currentTime-this.log.stall_start.play_current_time)>.2&&this.stallEnd(),this.saveBuffered()},r.handleVideocanplay=function(){this.stallEnd(),this.reportFirstframe()},r.handleVideoplaying=function(){this.stallEnd(),this.log.play_stop.is_stream_received=1;var e=U4();this.reportStartPlay(),this.log.first_frame.start=e},r.stallEnd=function(){this.clearStallTimer();var e=U4();if(this.inWaitingStart){var t=e-this.inWaitingStart;t>200&&(this.log.play_stop.stall_count++,this.log.play_stop.stall_time+=e-this.inWaitingStart,this.log.playing.stall_time+=e-Math.max(this.inWaitingStart,this.log.playing.timestamp),this.log.stall.stall_end=e,this.log.stall.timestamp=U4(),this.log.playing.stall_count++,Object.assign(this.log.stall,S4({},this.videoSize)),this.logmanager.push(this.log.stall,!0)),this.options.aggregationDowngradeStallTime&&t>this.options.aggregationDowngradeStallTime&&(this.log.playing.aggregation_downgrade_stall=(this.log.playing.aggregation_downgrade_stall||0)+(e-Math.max(this.inWaitingStart,this.log.playing.timestamp)))}this.inWaitingStart=0},r.handleVideoloadeddata=function(){this.reportFirstframe()},r.handleVideoratechange=function(){this.log.playing.speed_switch_count++,this.log.playing.speed_switch_info=this.player.video.playbackRate},r.handleVideoended=function(){this.clearPlayingInterval(),this.clearStallTimer(),Object.assign(this.log.playing,S4({timestamp:U4(),is_last:1},this.videoSize)),this.logmanager.push(this.log.playing)},r.handleVideoerror=function(){var e=this;this.errorNumber=1;var t=this.player.video.error;Object.assign(this.log.play_error,S4(S4({timestamp:U4()},this.videoSize),t&&{code:t.code,info:t.message})),this.logmanager.push(this.log.play_error,!0),0!==e.log.first_frame.first_frame_view||e.log.first_frame_failed.code||t&&(e.log.first_frame_failed.code=t.code,e.log.first_frame_failed.msg=G4[t.code],void 0!==e.log.first_frame_failed.timestamp&&(e.log.first_frame_failed.timestamp=U4()),e.logmanager.push(e.log.first_frame_failed,!0),e.log.play_result.is_threshold||(e.log.play_result.reason=G4[t.code]||"first frame failed",e.clearPlayResultTimer(),e.logmanager.push(e.log.play_result,!0))),e.options.error_report_stop?e.handleUserLeave():e.updatePlayStopParams()},r.handleVideopause=function(){this.stallEnd(),this.clearPlayingInterval(),this.clearStallTimer(),clearTimeout(this.collectDownloadSpeedTimer),this.player.once("playing",this.handlePlayerPlaying),this.player.once("timeupdate",this.handlePlayerPlaying)},r.destroyFunc=function(e){var t=this;this.destroyed||(e||this.handleUserLeave(),this.destroyed=!0,"pc"===B4.device?window.removeEventListener("beforeunload",this.handleUserLeave):"mobile"===B4.device&&window.removeEventListener("pagehide",this.handleUserLeave),q4.forEach((function(e){t.removeVideoEvt(e,t["handleVideo"+e+"Evt"])})),this.player&&(this.player._start&&(this.player.start=this.player._start,delete this.player._start),this.player.off("destroy",this.destroyFunc),this.player.off("complete",this.handlePlayerComlete),this.player.off("playing",this.handlePlayerPlaying),this.player.off("timeupdate",this.handlePlayerPlaying),this.player.off("ready",this.handlePlayerReady),this.player.off("waiting",this.handlePlayerWaiting),this.player.off("largeavgap",this.handleAVUnsync),this.player.off("error",this.handlePlayerError),this.player.off("SEI_PARSED",this.handleSEIParsed),this.player.off("pause",this.handlePlayerPause),this.player.off("ttfb",this.handleTTFB),this.player.off("urlchange",this.handleUrlChange),this.player.off("isKeyframe",this.handleKeyframe),this.player.off("sourceopen",this.handleSourceOpen),this.player.off("bufferappend",this.handleBufferAppend),this.player.off("core_event",this.handleCoreEvent),this.player.off("degrade",this.handleDegrade),this.clearPlayingInterval(),this.clearStallTimer(),clearTimeout(this.collectDownloadSpeedTimer),this._player=null))},r.handleUserLeave=function(){!this.destroyed&&this.started&&(this.destroyed=!0,this.updatePlayStopParams(),this.reportPlayStop(),this.clearPlayingInterval(),this.clearStallTimer(),clearTimeout(this.collectDownloadSpeedTimer),this.removeWindowListener())},r.saveBuffered=function(){try{var e=this.getBuffered();e&&e.length&&(this.log.play_stop.buffered=e)}catch(w7){}},r.getBuffered=function(){try{for(var e=[],t=this.player.video,n=0;n<t.buffered.length;n++)e.push([t.buffered.start(n),t.buffered.end(n)]);return e}catch(w7){}},r.reportPlayStop=function(){this.log.play_stop.play_current_time=this.player.currentTime||this.log.playing.play_current_time,this.saveBuffered(),this.logmanager.push(this.log.play_stop,!0)},r.reportFirstframe=function(){if(!this.firstFrameViewed){this.firstFrameViewed=!0;var e=U4();Object.assign(this.log.first_frame,S4({first_frame_view:e-this.log.start_play.start_play_time||e,timestamp:e},this.videoSize)),this.log.first_frame.ttfb_end&&(this.log.first_frame.ttdb=e-this.log.first_frame.ttfb_end),this.logmanager.push(this.log.first_frame,!0),this.clearPlayResultTimer(),this.log.play_result.result=1,this.logmanager.push(this.log.play_result,!0),this.log.play_stop.is_stream_received=1}},r.updatePlayStopParams=function(){var e=function(e){var t=performance.getEntriesByType("resource").filter((function(t){return t.name===e}));if(t.length){var n=t[0],i=t[t.length-1];return{dns_parse_time:Number.parseInt(n.domainLookupEnd-n.domainLookupStart),redirect:Number.parseInt(n.redirectEnd-n.redirectStart),ttfb:Number.parseInt(i.responseStart-i.requestStart)}}return{dns_parse_time:-1,redirect:-1,ttfb:-1}}(this._url),t=U4();this.playedTime=t-this.log.start_play.start_play_time;var n=this.log.play_stop;Object.assign(n,S4({},0===n.stall_count&&{stall_time:0})),this.inWaitingStart&&t-this.inWaitingStart>200&&(n.stall_time+=t-this.inWaitingStart),this.inWaitingStart=0,Object.assign(n,S4({stall_time_per_100sec:n.stall_time/this.playedTime*100,stall_count_per_100sec:1e3*n.stall_count/this.playedTime*100},e)),0===this.log.play_stop.stall_count_per_100sec&&(this.log.play_stop.stall_time_per_100sec=0),this.log.play_stop.stall_time_per_100sec>100||this.log.play_stop.stall_time_per_100sec<0||(this.log.playing.index?(Object.assign(this.log.playing,S4({timestamp:U4(),is_last:1},this.videoSize)),this.logmanager.push(this.log.playing,!0)):(this.log.play_stop.error_code=this.log.play_error.code,this.log.play_stop.error_info=this.log.play_error.info),t=U4(),Object.assign(n,S4({timestamp:t,stop_time:t,duration:this.playedTime/1e3,play_time:this.playedTime/1e3},this.videoSize)),0===this.errorNumber&&(n.play_time_on_no_frame=n.stop_time-this.log.start_play.start_play_time))},r.clearPlayingInterval=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},r.clearStallTimer=function(){clearTimeout(this.stallStartTimer)},r.clearPlayResultTimer=function(){clearTimeout(this.playResultTimer)},r.destroy=function(e){this.destroyFunc(!e)},r.bindVideoEvt=function(e,t){this.player&&this.player.video.addEventListener(e,t,!1)},r.removeVideoEvt=function(e,t){this.player&&this.player.video&&this.player.video.removeEventListener(e,t,!1)},r.send=function(e,t){this.logmanager.send(e,t)},t=e,(n=[{key:"videoSize",get:function(){return this.player?{width:this.player.video.videoWidth,height:this.player.video.videoHeight}:{width:0,height:0}}},{key:"player",get:function(){return this._player}},{key:"logmanager",get:function(){return this._logmanager}},{key:"ntpTime",get:function(){return Date.now()-this.ntpDelta}}])&&O4(t.prototype,n),i&&O4(t,i),e}(),J4=function(e){u(n,e);var t=v(n);function n(){return a(this,n),t.apply(this,arguments)}return l(n,[{key:"afterCreate",value:function(){var e,t,n=this;this.config.enable&&(this.config.appId?(this.openLog(),null===(e=this.player.plugins)||void 0===e||null===(t=e.sdkerrorplugin)||void 0===t||t.addErrDetail((function(){var e,t,i;if(n._liveLogger)return{label:"userId",value:null===(e=n._liveLogger)||void 0===e||null===(t=e.logger)||void 0===t||null===(i=t.options)||void 0===i?void 0:i.user_id}}))):console.info("not found appid, logger is closed"))}},{key:"startLog",value:function(){this._liveLogger=new $4({player:this.player,aid:this.config.appId,project_key:this.config.appId,app_name:this.config.appId,channel_domain:"//mcs.volceapplog.com"})}},{key:"closeLog",value:function(){this._liveLogger.destroy(),this._liveLogger=null}},{key:"openLog",value:function(){!this._liveLogger&&this.startLog()}}],[{key:"pluginName",get:function(){return"liveLogger"}},{key:"defaultConfig",get:function(){return{appId:"",enable:!0}}}]),n}(Vj);var Z4={hls:{name:"HlsPlayer",path:"xgplayer-hls/3.0.0-next.36-1/dist/index.min.js"},flv:{name:"FlvPlayer",path:"xgplayer-flv/3.0.0-next.23/dist/index.min.js"},XGVideo:{name:"XGVideo",path:"byted/xgplayer-xgvideo/0.1.16/dist/index.min.js"},hlsEncrypt:{name:"EncryptHlsPlugin",path:"byted/xgplayer-encrypt-hls/4.1.1/dist/index.min.js"},dash:{name:"DashPlugin",path:"byted/xgplayer-encrypt/3.5.2/dist/index.min.js"},shaka:{name:"ShakaPlugin",path:"xgplayer-shaka/3.0.0-alpha.1/dist/index.min.js"},mp4Encrypt:{name:"Mp4EncryptPlayer",path:"byted/xgplayer-encrypt-mp4/3.0.0/dist/index.min.js"},danmujs:{name:"danmu.js",path:"danmu.js/0.6.4/dist/index.js"},danmuMask:{name:"DanmuMask",path:"byted/danmu-mask/0.3.6/browser/index.js"},subtitle:{name:"XgSubtitle",path:"xgplayer-subtitles/1.0.22/dist/index.min.js"},streamprobe:{name:"StreamProbe",path:"byted/streamprobe/1.0.2/dist/index.min.js"}},Q4=function(){function e(){a(this,e),this.umdUrlMap=Z4,this.backupUmdUrlMap={},this.jsLoadMap={}}return l(e,[{key:"updateBackupMap",value:function(e){this.backupUmdUrlMap=e}},{key:"loadExtraCdn",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise((function(n,i){var r=t?document.createElement("script"):document.createElement("link");t?r.src=e:(r.rel="stylesheet",r.type="text/css",r.href=e),document.body.appendChild(r),r.onerror=function(){i("url: ".concat(e))},r.onload=r.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(r.onload=r.onreadystatechange=null,n())}}))}},{key:"loadPlugins",value:function(e,t){var n=this;if(this.umdUrlMap[e]){var i="".concat(e,"_load");return new Promise((function(r){if(Reflect.get(n.jsLoadMap,i))r(n.jsLoadMap[i]);else{var o=n.umdUrlMap[e],a=function(t){n.failCallback&&"function"==typeof n.failCallback&&n.failCallback&&n.failCallback(e,t),r(null)};if(!o)return console.error("".concat(e," umd info not exit")),a(void 0);var s=o.name,l=o.path;if(s&&window[s])return n.jsLoadMap[i]=window[s],t&&t(),r(n.jsLoadMap[i]);var c="//lf16-unpkg-i18n.byted-static.com/obj/unpkg-va/"+l;iX((function(){return n.loadExtraCdn(c,!0)}),2).then((function(){s?(n.jsLoadMap[i]=window[s],t&&t(),r(window[s])):(n.jsLoadMap[i]=!0,t&&t(),r(null))})).catch((function(o){var l,c=n.backupUmdUrlMap[e];return c?(l=c)&&l.indexOf&&/^(?:http|data:|\/)/.test(l)?void n.loadExtraCdn(n.backupUmdUrlMap[e]).then((function(){n.jsLoadMap[i]=window[s],t&&t(),r(n.jsLoadMap[i])})).catch((function(t){console.error("load ".concat(e," error, ").concat(t)),a(void 0)})):(console.error("umdUrlMap.".concat(e," isn't a valid url")),a(void 0)):(console.error("load ".concat(e," error, ").concat(o)),a(o))}))}}))}}}]),e}(),e6=new Q4;function t6(e){return n6.apply(this,arguments)}function n6(){return n6=o(n().mark((function e(t){var i,r,a,s,l,c,u,h,d,f,p,g,v,y,m,k,w,E,T,S,C,x;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=t.isLive,s=void 0!==a&&a,l=t.type,c=t.isMobile,u=void 0!==c&&c,h=t.playerData,d=t.getSoftOptionTask,f=["default",i6(s)],p=h.openSoftDecoding,g=h.isMusic,v=h.configs,y=!(null===(i=h.playList)||void 0===i||null===(r=i[0])||void 0===r||!r.kid),m=Q$(v,"EncryptHlsPlugin"),k=!!m||"hls"===l&&y,w=[],E=[],u?f.push(r6({isLive:s,playerData:h})):f.push(o6({isLive:s,playerData:h})),e.t0=l,e.next="flv"===e.t0?12:"rtm"===e.t0?14:"dash"===e.t0?16:18;break;case 12:return E.push(o(n().mark((function e(){var t,i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u){e.next=8;break}if(!rX()&&!p){e.next=6;break}return e.next=4,e6.loadPlugins("flv");case 4:t=e.sent,w.push(t);case 6:e.next=12;break;case 8:return e.next=10,e6.loadPlugins("flv");case 10:i=e.sent,w.push(i);case 12:case"end":return e.stop()}}),e)})))()),e.abrupt("break",19);case 14:return E.push(o(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([e6.loadPlugins("hls"),e6.loadPlugins("flv")]);case 2:w.push(_1);case 3:case"end":return e.stop()}}),e)})))()),e.abrupt("break",19);case 16:return E.push(o(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!v.url){e.next=5;break}return e.next=3,e6.loadPlugins("shaka");case 3:t=e.sent,w.push(t);case 5:case"end":return e.stop()}}),e)})))()),e.abrupt("break",19);case 18:return e.abrupt("break",19);case 19:return!g&&Q$(h.options,"DanmuPlugin")&&E.push(o(n().mark((function e(){var t;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([e6.loadPlugins("danmujs"),e6.loadPlugins("danmuMask")]);case 2:(t=e.sent)[0]&&t[1]&&w.push(u3);case 4:case"end":return e.stop()}}),e)})))()),Q$(h.options,"Subtitle")&&h.plugins.every((function(e){return"subtitle"!==e.pluginName.toLowerCase()}))&&w.push(y5),e.next=23,Promise.all([d(),a6({isMobile:u,isLive:s,openSoftDecoding:p,type:l,isHlsEncrypt:k,playerData:h,plugins:w})].concat(E));case 23:return T=e.sent,S=_(T,2),C=S[0],x=S[1],e.abrupt("return",{presets:f,softDecodingOption:C,plugins:[].concat(w,b(x)).filter(Boolean)});case 28:case"end":return e.stop()}}),e)}))),n6.apply(this,arguments)}function i6(e){var t=[$1,m5,I1];return e&&t.push(W1,J4),l((function e(){a(this,e),this.plugins=t,this.ignores=["error"]}))}function r6(e){var t,n=e.isLive,i=e.playerData,r=["error","playbackRate"],o=i.configs,s=Q$(o,"EncryptHlsPlugin"),c=null==o||null===(t=o.autoBitrateOpts)||void 0===t?void 0:t.isOpenAutoDefi;null!=s&&s.playAuthToken||c||r.push("definition");var u=["time","playnext","progress","progresspreview","replay","playbackRate","discontinue","PlaybackRateMobilePlugin"],h=[q1];return l((function e(){a(this,e),this.plugins=h,this.ignores=n?[].concat(u,r):[].concat(r)}))}function o6(e){var t,n=e.isLive,i=e.playerData,r=["cssfullscreen"],o=["time","playnext","progress","progresspreview","replay","playbackRate","discontinue"],s=n?[O1]:[],c=i.configs,u=Q$(c,"EncryptHlsPlugin"),h=null==c||null===(t=c.autoBitrateOpts)||void 0===t?void 0:t.isOpenAutoDefi;return null!=u&&u.playAuthToken||h||(r.push("definition"),s.push(P1)),l((function e(){a(this,e),this.plugins=s,this.ignores=n?[].concat(o,r):[].concat(r)}))}function a6(e){return s6.apply(this,arguments)}function s6(){return s6=o(n().mark((function e(t){var i,r,o,a,s,l,c,u,h,d,f,p,g,v,y,m,_,b,k,w,E,T,S,C,x;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.isMobile,s=t.isLive,l=t.openSoftDecoding,c=t.type,u=t.isHlsEncrypt,h=t.playerData,d=t.plugins,f=[],p=h.configs,g=h.options,v=!(null===(i=h.playList)||void 0===i||null===(r=i[0])||void 0===r||!r.kid)||G$(null==p?void 0:p.getVideoByToken),"hls"!==c){e.next=28;break}if(!u){e.next=12;break}return e.next=8,e6.loadPlugins("hlsEncrypt");case 8:y=e.sent,f.push(y),e.next=28;break;case 12:if(!a){e.next=24;break}if(m=Q$(g,"Subtitle"),_=s&&m,b=(rX()||window.WebAssembly)&&l,k=p.enableHlsMSE,s&&!b&&!_&&!k){e.next=22;break}return e.next=20,e6.loadPlugins("hls");case 20:w=e.sent,f.push(w);case 22:e.next=28;break;case 24:return e.next=26,e6.loadPlugins("hls");case 26:E=e.sent,f.push(E);case 28:if(("dash"!==c||p.url)&&!Q$(g,"DASHPlugin")){e.next=33;break}return e.next=31,e6.loadPlugins("dash");case 31:null!=(C=e.sent)&&null!==(T=C.encryptUtils)&&void 0!==T&&null!==(S=T.isSupported)&&void 0!==S&&S.call(T)&&d.push(C);case 33:if(Q$(g,"vodLogOpts")&&f.push(rQ),p.enableContextmenu&&f.push(X3),!(p.enableMp4MSE||Q$(g,"Mp4EncryptPlayer")||"mp4"===c&&(v||null!=p&&null!==(o=p.autoBitrateOpts)&&void 0!==o&&o.isOpenAutoDefi||h.openSoftDecoding))){e.next=40;break}return e.next=38,e6.loadPlugins("mp4Encrypt");case 38:x=e.sent,f.push(x);case 40:return e.abrupt("return",f.filter((function(e){var t,n,i,r,o;return"encrypthlsplugin"===(null==e||null===(t=e.pluginName)||void 0===t?void 0:t.toLowerCase())?!(null==e||null===(i=e.isSupported)||void 0===i||!i.call(e))||(console.warn("当前浏览器环境不支持HLS格式视频的加密播放"),!1):"dashplugin"!==(null==e||null===(n=e.pluginName)||void 0===n?void 0:n.toLowerCase())||(!(null==e||null===(r=e.encryptUtils)||void 0===r||null===(o=r.isSupported)||void 0===o||!o.call(r))||(console.warn("当前浏览器环境不支持DASH格式视频播放"),!1))})));case 41:case"end":return e.stop()}}),e)}))),s6.apply(this,arguments)}function l6(){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 c6(){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 u6(){return(new DOMParser).parseFromString('<svg width="20" height="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 h6(){return(new DOMParser).parseFromString('<svg width="20" height="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 d6(){return(new DOMParser).parseFromString('<svg width="20" height="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}var f6={startPlay:c6,play:function(){return(new DOMParser).parseFromString('<svg width="20" height="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" 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" 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" 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" 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:l6,refresh:L1,danmuSetting:function(){return(new DOMParser).parseFromString('<svg width="22" height="19" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" opacity=".6"><path d="M-4-4h28v28H-4z"/><path d="M1 19a1 1 0 01-1-1V1a1 1 0 011-1h17.2a1 1 0 011 1v3.75h-.001l.001 1.475a.9.9 0 11-1.8 0V1.8H1.8v15.4h8.442l-.029.019h.296a.89.89 0 01.017 1.78h7.691L18.2 19H1z" fill="#FFF" fill-rule="nonzero"/><path d="M5.507 7.698L5.33 9.279h2.511c0 2.015-.075 3.362-.2 4.042-.151.68-.792 1.054-1.934 1.124-.327 0-.653-.023-1.005-.047l-.339-1.136c.327.035.678.059 1.03.059.628 0 .98-.188 1.067-.563.088-.374.138-1.183.138-2.424H4l.352-3.679h2.122V5.132H4.113V4.09h3.654v3.608h-2.26zm3.089-2.214h1.507A8.91 8.91 0 009.16 4.03l1.193-.375c.351.469.665.96.93 1.5l-.792.328h1.733a14.68 14.68 0 00.93-1.921l1.242.41a8.956 8.956 0 01-.854 1.51H15v4.933h-2.587v.902h2.446l-1.014 1.148h-1.432v2.097h-1.28v-2.097h-2.99v-1.148h2.99v-.902H8.595V5.484zm5.249 3.912v-.913h-1.432v.913h1.432zm-2.713 0v-.913H9.764v.913h1.368zm-1.368-1.92h1.368v-.961H9.764v.96zm2.65-.961v.96h1.43v-.96h-1.43z" fill="#FFF" fill-rule="nonzero"/><path d="M17.595 9.84l2.957 1.69a1.2 1.2 0 01.605 1.041v3.358c0 .43-.23.828-.605 1.041l-2.957 1.69a1.2 1.2 0 01-1.19 0l-2.957-1.69a1.2 1.2 0 01-.605-1.041V12.57c0-.43.23-.828.605-1.041l2.957-1.69a1.2 1.2 0 011.19 0zM17 12.47c-.994 0-1.8.797-1.8 1.781a1.79 1.79 0 001.8 1.781c.994 0 1.8-.797 1.8-1.781a1.79 1.79 0 00-1.8-1.781z" fill="#FFF"/></g></svg>',"image/svg+xml").firstChild},openDanmu:J1,closeDanmu:X1,volumeLarge:u6,volumeMuted:h6,volumeSmall:d6},p6={whitelist:[""],widescreen:!0,width:"100%",height:"100%",lang:tX(),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:t({},f6),flv:{retryCount:0},hls:{retryCount:0}},g6={isLive:!0,closeVideoClick:!0,autoplay:!0,autoplayMuted:!0,preloadTime:8,start:{isShowPause:!1,isShowEnd:!1,mode:"hide",disableAnimate:!0},retry:{count:0}},v6={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}};function y6(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=t({},p6),i=t({},e?g6:v6);return t(t({},n),i)}var m6={startPlay:c6,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" 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>',"image/svg+xml").firstChild},exitFullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" 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>',"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:l6,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},danmuSetting:function(){return(new DOMParser).parseFromString('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.746 12.444a1 1 0 00-.62.216L1.75 13.75V2.166c0-.23.187-.417.417-.417h11.666c.23 0 .417.187.417.417v6.687c.44.044.86.156 1.25.326V2.167c0-.92-.746-1.667-1.667-1.667H2.167C1.247.5.5 1.246.5 2.167V14.61a.833.833 0 001.35.653l1.71-1.354a1 1 0 01.621-.216h5.543a4.195 4.195 0 01-.02-1.25H3.745z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 4a.5.5 0 00-.5.5V5a.5.5 0 00.5.5h5A.5.5 0 0010 5v-.5a.5.5 0 00-.5-.5h-5zm2.333 4.167a.5.5 0 00-.5.5v.666a.5.5 0 00.5.5h4.292c.311-.266.662-.487 1.042-.653v-.513a.5.5 0 00-.5-.5H6.834zm-3 .5a.5.5 0 01.5-.5H5a.5.5 0 01.5.5v.666a.5.5 0 01-.5.5h-.667a.5.5 0 01-.5-.5v-.666z" fill="#fff"/><path d="M11 4.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5V5a.5.5 0 01-.5.5h-.5A.5.5 0 0111 5v-.5z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.387 10.134a1 1 0 00-1 0l-1.887 1.09a1 1 0 00-.5.865v2.179a1 1 0 00.5.866l1.887 1.09a1 1 0 001 0l1.886-1.09a1 1 0 00.5-.866v-2.179a1 1 0 00-.5-.866l-1.886-1.089zm-.5 4.711a1.667 1.667 0 100-3.333 1.667 1.667 0 000 3.333z" fill="#fff"/></svg>',"image/svg+xml").firstChild},openDanmu:function(){return(new DOMParser).parseFromString('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.746 12.444a1 1 0 00-.62.216L1.75 13.75V2.166c0-.23.187-.417.417-.417h11.666c.23 0 .417.187.417.417v6.687c.44.044.86.156 1.25.326V2.167c0-.92-.746-1.667-1.667-1.667H2.167C1.247.5.5 1.246.5 2.167V14.61a.833.833 0 001.35.653l1.71-1.354a1 1 0 01.621-.216h5.543a4.195 4.195 0 01-.02-1.25H3.745z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 4a.5.5 0 00-.5.5V5a.5.5 0 00.5.5h5A.5.5 0 0010 5v-.5a.5.5 0 00-.5-.5h-5zm2.333 4.167a.5.5 0 00-.5.5v.666a.5.5 0 00.5.5h4.292c.311-.266.662-.487 1.042-.653v-.513a.5.5 0 00-.5-.5H6.834zm-3 .5a.5.5 0 01.5-.5H5a.5.5 0 01.5.5v.666a.5.5 0 01-.5.5h-.667a.5.5 0 01-.5-.5v-.666z" fill="#fff"/><path d="M11 4.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5V5a.5.5 0 01-.5.5h-.5A.5.5 0 0111 5v-.5z" fill="#fff"/><circle cx="13.833" cy="13" r="3.333" fill="#3370FF"/><path d="M15.591 12.011l-2.133 2.134-1.22-1.22" stroke="#fff" stroke-linecap="round" stroke-linejoin="round"/></svg>',"image/svg+xml").firstChild},closeDanmu:function(){return(new DOMParser).parseFromString('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.746 12.444a1 1 0 00-.62.216L1.75 13.75V2.166c0-.23.187-.417.417-.417h11.666c.23 0 .417.187.417.417v6.687c.44.044.86.156 1.25.326V2.167c0-.92-.746-1.667-1.667-1.667H2.167C1.247.5.5 1.246.5 2.167V14.61a.833.833 0 001.35.653l1.71-1.354a1 1 0 01.621-.216h5.543a4.195 4.195 0 01-.02-1.25H3.745z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 4a.5.5 0 00-.5.5V5a.5.5 0 00.5.5h5A.5.5 0 0010 5v-.5a.5.5 0 00-.5-.5h-5zm2.333 4.167a.5.5 0 00-.5.5v.666a.5.5 0 00.5.5h4.292c.311-.266.662-.487 1.042-.653v-.513a.5.5 0 00-.5-.5H6.834zm-3 .5a.5.5 0 01.5-.5H5a.5.5 0 01.5.5v.666a.5.5 0 01-.5.5h-.667a.5.5 0 01-.5-.5v-.666z" fill="#fff"/><path d="M11 4.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5V5a.5.5 0 01-.5.5h-.5A.5.5 0 0111 5v-.5z" fill="#fff"/><circle cx="13.833" cy="13" r="2.733" stroke="#fff" stroke-width="1.2"/><path fill="#fff" d="M12.833 10.77l3.473 3.472-1.063 1.064-3.474-3.473z"/></svg>',"image/svg+xml").firstChild},volumeLarge:u6,volumeMuted:h6,volumeSmall:d6};vN.os.isAndroid;var _6={width:"100%",height:"100%",lang:tX(),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"},danmusettings:{index:"2"},danmuicon:{index:"3"},cusPlaybackRatePlugin:{needCheck:!0,needPanel:!1},icons:t({},m6),flv:{innerDegrade:1,retryCount:0},hls:{innerDegrade:1,retryCount:0}},b6={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}},k6={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"}};function w6(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=t({},_6),i=t({},e?b6:k6);return t(t({},n),i)}var E6=Vj.POSITIONS,T6=function(){function e(t){var n,i;a(this,e);var r=t.config,o=t.root,s=t.player;this.config=r,this.parent=o,this.player=s,this.mode=null!==(n=null==r?void 0:r.mode)&&void 0!==n?n:P$,this.isAutoChange=null!==(i=null==r?void 0:r.isAutoChange)&&void 0!==i&&i,this.isShow=!1,this.initEvents(),this.renderPanel()}var t;return l(e,[{key:"initEvents",value:function(){var e;this.isAutoChange&&(window.addEventListener("orientationchange",this.handleOrientationChange.bind(this)),null===(e=this.player)||void 0===e||e.on($N,this.handleOrientationChange.bind(this)))}},{key:"handleOrientationChange",value:function(){var e,t,n,i=[90,-90,"90","-90"].includes(window.orientation);null!==(e=this.player)&&void 0!==e&&e.fullscreen&&i?this.changeMode(I$):this.changeMode(null!==(t=null===(n=this.config)||void 0===n?void 0:n.mode)&&void 0!==t?t:P$)}},{key:"changeConfig",value:function(e){this.config=e}},{key:"changeMode",value:function(e){this.mode=e,this.player.emit(k1.PANEL_MODE_CHANGE,{mode:e}),this.destroy(),this.renderPanel()}},{key:"renderPanel",value:function(){var e="xg-mobile-panel panel-".concat(["normal","inner","fullscreen"][this.mode]);switch(this.root=cN.createDom("div","",{},e),this.parent&&(this.parent.appendChild(this.root),this.hide()),this.bind("click",this.handleHide.bind(this)),this.mode){case O$:var t=cN.createDom("div","",{},"xg-mobile-panel-content");this.root.appendChild(t),this.container=t,t.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault()}));break;case P$:this.container=this.root;break;case I$:var n=cN.createDom("div","",{},"xg-mobile-panel-content");this.root.appendChild(n),this.container=n,n.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault()}))}}},{key:"showPanel",value:(t=o(n().mark((function e(t){var i,r=this,o=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=o.length>1&&void 0!==o[1]?o[1]:"",o.length>2&&void 0!==o[2]&&o[2]&&cN.addClass(t,"item-list-panel-content"),this.setTitle(i),!this.children){e.next=9;break}return e.next=7,this.hide();case 7:return setTimeout((function(){r.children=t,r.container&&(r.title&&r.container.appendChild(r.title),r.container.appendChild(t)),r.show()})),e.abrupt("return");case 9:this.children=t,this.container&&(this.title&&this.container.appendChild(this.title),this.container.appendChild(t)),this.show();case 12:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updatePanel",value:function(e){this.children&&cN.hasClass(this.children,"item-list-panel-content")&&cN.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)),this.show()}},{key:"setTitle",value:function(e){e&&this.mode!==P$?this.title?this.title.innerHTML=e:this.title=this.renderTitle(e):this.title=void 0}},{key:"renderTitle",value:function(e){return cN.createDom("div",e,{},"xg-mobile-panel-title")}},{key:"show",value:function(){this.isShow=!0,cN.removeClass(this.root,"hide"),cN.addClass(this.root,"active")}},{key:"hide",value:function(){this.isShow=!1,cN.removeClass(this.root,"active"),cN.addClass(this.root,"hide"),this.container&&(this.container.innerHTML="")}},{key:"handleHide",value:function(e){e.stopPropagation(),e.preventDefault(),this.hide()}},{key:"bind",value:function(e,t){var n=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,n)}},{key:"destroy",value:function(){var e;this.parent&&this.root&&this.parent.removeChild(this.root),window.removeEventListener("orientationchange",this.handleOrientationChange.bind(this)),null===(e=this.player)||void 0===e||e.off($N,this.handleOrientationChange.bind(this))}}]),e}();function S6(){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}var C6=Vj.POSITIONS,x6=function(e){u(i,e);var n=v(i);function i(e){var t;return a(this,i),(t=n.call(this,e)).toastInfo={},t.playerData=null,t.playerData=e.player.config.playerData,t.dataMonitoring(),t}return l(i,[{key:"dataMonitoring",value:function(){var e=this;this.playerData&&wD.subscribeProperty(this.playerData.current,"definition",(function(n,i){if(n!==i&&e.player){var r=e.playerData.current.lineId,o=e.playerData.getDefinitionListByLineId(r).find((function(e){return e.definition===i}));o&&o.url&&(e.player.changeDefinition(t(t({},o),{},{definition:i,url:o.url})),e.updatePanel(),e.player.emit(k1.INNER_DEFINITION_CHANGE,{from:n,to:i,url:o.url}),e.player.emit(k1.PlAY_URL_CHANGE,{url:o.url,from:k1.INNER_DEFINITION_CHANGE}),setTimeout((function(){e.player.ended?e.player.replay():e.player.paused&&e.player.play()}),1e3))}}))}},{key:"registerIcons",value:function(){return{definition:{icon:S6,class:"xgplayer-definition-svg"}}}},{key:"registerLanguageTexts",value:function(){return{definition:{jp:"明快さ",en:"Definition",zh:"清晰度","zh-hk":"清晰度"},definitionSelect:{jp:"クラリティセレクション",en:"Definition Choose",zh:"清晰度选择","zh-hk":"清晰度選擇"},switching:{jp:"に切り替える",en:"Switching to",zh:"正在切换至","zh-hk":"正在切換至"}}}},{key:"afterCreate",value:function(){this.toastInfo={},this.appendChild(".xgplayer-icon",this.icons.definition),this.initEvents()}},{key:"afterPlayerInit",value:function(){}},{key:"initEvents",value:function(){this.bind(["click"],this.handleButtonChange.bind(this))}},{key:"handleButtonChange",value:function(){var e=this.renderItemList();this.renderPanel(e)}},{key:"renderItemList",value:function(){var e=this,t=this.playerData.current.lineId,n=this.playerData.getDefinitionListByLineId(t),i=cN.createDom("div","",{},"definition-panel-content");return n.forEach((function(t){var n=e.renderItem(t);i.appendChild(n)})),i}},{key:"renderItem",value:function(e){var t=this,n=this.playerData.current.definition,i=cN.createDom("div","",{},"panel-Item ".concat(n===e.definition?"select-in":""));return i.innerHTML=this.getShowText(this.i18n,e),i.addEventListener("click",(function(n){n.stopPropagation(),n.preventDefault(),t.showToast(e),t.playerData.current.definition=e.definition})),i}},{key:"getShowText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return e[t.definitionTextKey]||t.definitionTextKey||t.definition}},{key:"showToast",value:function(e){var t,n=this,i=null===(t=this.player)||void 0===t?void 0:t.getPlugin("sdkToastPlugin");if(i){var r=this.getShowText(this.i18n,e),o=i.add("".concat(this.langText.switching).concat(r,"..."),0,!0),a=Date.now();this.toastInfo[o]={showTime:a,delayClose:!1},setTimeout((function(){var e;null!==(e=n.toastInfo[o])&&void 0!==e&&e.delayClose&&(i.remove(o),n.toastInfo[o].delayClose=!1)}),2e3),this.player.once(QN,(function(){var e;Date.now()-(null===(e=n.toastInfo[o])||void 0===e?void 0:e.showTime)>2e3?i.remove(o):n.toastInfo[o].delayClose=!0}))}}},{key:"renderPanel",value:function(e){var t,n;null===(t=this.player)||void 0===t||null===(n=t.panel)||void 0===n||n.showPanel(e,this.langText.definitionSelect,!0)}},{key:"updatePanel",value:function(){var e,t,n=this.renderItemList();null===(e=this.player)||void 0===e||null===(t=e.panel)||void 0===t||t.updatePanel(n)}},{key:"destroy",value:function(){this.unbind(["click"],this.handleButtonChange.bind(this))}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-mobile-definition">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}],[{key:"pluginName",get:function(){return"DefinitionMobilePlugin"}},{key:"textTips",get:function(){return{jp:"明快さ",en:"Definition",zh:"清晰度","zh-hk":"清晰度"}}},{key:"defaultConfig",get:function(){return{position:C6.CONTROLS_RIGHT,index:2.7}}}]),i}(Vj);function O6(){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}var P6=Vj.POSITIONS,I6=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).playerData=null,i.playerData=e.player.config.playerData,i.dataMonitoring(),i}return l(n,[{key:"dataMonitoring",value:function(){var e=this;this.playerData&&wD.subscribeProperty(this.playerData.current,"definition",(function(t,n){if(t!==n&&e.player){var i=e.playerData.getCurrentUrl();e.player.changeDefinition({definition:n,url:i}),e.updatePanel(),setTimeout((function(){e.player.paused&&e.player.play()}),1e3)}}))}},{key:"registerIcons",value:function(){return{line:{icon:O6,class:"xgplayer-line-svg"}}}},{key:"registerLanguageTexts",value:function(){return{line:{jp:"ライン",en:"Line",zh:"线路","zh-hk":"線路"},lineSelect:{jp:"ライン選ぶ",en:"Line Choose",zh:"线路选择","zh-hk":"線路選擇"}}}},{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.line),this.initEvents()}},{key:"afterPlayerInit",value:function(){}},{key:"initEvents",value:function(){this.bind(["click"],this.handleButtonChange.bind(this))}},{key:"handleButtonChange",value:function(){var e=this.renderItemList();this.renderPanel(e)}},{key:"renderItemList",value:function(){var e=this,t=this.playerData.getLineList(),n=cN.createDom("div","",{},"line-panel-content");return t.forEach((function(t){var i=e.renderItem(t);n.appendChild(i)})),n}},{key:"renderItem",value:function(e){var t=this,n=this.playerData.current.lineId,i=cN.createDom("div","",{},"panel-Item ".concat(n===e.lineId?"select-in":""));return i.innerHTML=this.i18n[e.lineTextKey]||e.lineTextKey,i.addEventListener("click",(function(n){n.stopPropagation(),n.preventDefault(),t.player.emit(k1.LINE_CHANGE,{from:t.playerData.current.lineId,to:e.lineId}),t.playerData.current.lineId=e.lineId,t.player.emit(b1.PLAYER_REBUILD)})),i}},{key:"renderPanel",value:function(e){var t,n;null===(t=this.player)||void 0===t||null===(n=t.panel)||void 0===n||n.showPanel(e,this.langText.lineSelect,!0)}},{key:"updatePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player)||void 0===e||e.panel.updatePanel(t)}},{key:"destroy",value:function(){this.unbind(["click"],this.handleButtonChange.bind(this))}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-mobile-line">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}],[{key:"pluginName",get:function(){return"LineMobilePlugin"}},{key:"textTips",get:function(){return{jp:"ライン",en:"Line",zh:"线路","zh-hk":"線路"}}},{key:"defaultConfig",get:function(){return{position:P6.CONTROLS_RIGHT,index:2.8}}}]),n}(Vj);function L6(){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.48864ZM6.82584 7.37256C6.26886 7.37256 5.82039 7.56063 5.48042 7.93677C5.14768 8.29121 4.98131 8.75415 4.97408 9.33282H5.82039C5.83485 8.92775 5.92166 8.61671 6.08079 8.41418C6.23993 8.19717 6.47863 8.08867 6.7969 8.08867C7.09347 8.08867 7.31771 8.15377 7.46961 8.29121C7.61428 8.42864 7.69385 8.63841 7.69385 8.92052C7.69385 9.20986 7.57811 9.48473 7.35388 9.7379C7.20921 9.8898 6.97774 10.0851 6.645 10.3166C6.04462 10.7289 5.64679 11.0471 5.45872 11.2642C5.11151 11.6548 4.94514 12.1105 4.94514 12.6385H8.54739V11.8935H6.00122C6.11696 11.6331 6.43523 11.3293 6.96327 10.982C7.46961 10.6421 7.83128 10.3672 8.03382 10.1502C8.36656 9.7813 8.54016 9.37622 8.54016 8.92775C8.54016 8.46481 8.38102 8.09591 8.06275 7.80657C7.73725 7.51723 7.32494 7.37256 6.82584 7.37256ZM9.90445 11.5463C9.74532 11.5463 9.60788 11.5969 9.50661 11.7126C9.39088 11.8211 9.34025 11.9586 9.34025 12.1177C9.34025 12.2768 9.39088 12.407 9.50661 12.5228C9.60788 12.624 9.74532 12.6819 9.90445 12.6819C10.0636 12.6819 10.1938 12.624 10.3095 12.5228C10.418 12.407 10.4759 12.2768 10.4759 12.1177C10.4759 11.9586 10.418 11.8211 10.3095 11.7126C10.1938 11.5969 10.0636 11.5463 9.90445 11.5463ZM11.665 8.12484C11.9977 7.6185 12.4679 7.37256 13.0755 7.37256C13.6759 7.37256 14.1461 7.6185 14.486 8.12484C14.8043 8.60225 14.9635 9.24602 14.9635 10.0562C14.9635 10.8663 14.8043 11.5101 14.486 11.9875C14.1461 12.4866 13.6759 12.7398 13.0755 12.7398C12.4679 12.7398 11.9977 12.4866 11.665 11.9875C11.3467 11.5101 11.1876 10.8663 11.1876 10.0562C11.1876 9.24602 11.3467 8.60225 11.665 8.12484ZM13.9435 8.77585C13.7699 8.31291 13.4806 8.08867 13.0755 8.08867C12.6632 8.08867 12.3739 8.31291 12.2075 8.77585C12.0918 9.08689 12.0339 9.51366 12.0339 10.0562C12.0339 10.5914 12.0918 11.0182 12.2075 11.3365C12.3739 11.7922 12.6632 12.0237 13.0755 12.0237C13.4806 12.0237 13.7699 11.7922 13.9435 11.3365C14.0593 11.0182 14.1171 10.5914 14.1171 10.0562C14.1171 9.51366 14.0593 9.08689 13.9435 8.77585Z" fill="#ffffff"/>\n</svg>',"image/svg+xml").firstChild}var D6=Vj.POSITIONS,A6=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).playerData=null,i.state={currentRate:1,isSupport:!0},i.playerData=e.player.config.playerData,i}return l(n,[{key:"registerIcons",value:function(){return{playbackRate:{icon:L6,class:"xgplayer-rate-svg"}}}},{key:"registerLanguageTexts",value:function(){return{rate:{jp:"倍速",en:"PlaybackRate",zh:"倍速","zh-hk":"倍速"},rateSelect:{jp:"倍速選ぶ",en:"PlaybackRate",zh:"倍速选择","zh-hk":"倍速選擇"}}}},{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.playbackRate),this.initEvents(),this.state.currentRate=this.player.playbackRate||1}},{key:"afterPlayerInit",value:function(){}},{key:"initEvents",value:function(){var e=this;this.bind(["click"],this.renderList.bind(this)),this.on(MN,(function(){var t,n;e.state.currentRate!==e.player.playbackRate&&(e.state.currentRate=e.player.playbackRate,null!==(t=e.player)&&void 0!==t&&null!==(n=t.panel)&&void 0!==n&&n.isShow&&e.updatePanel())}))}},{key:"renderList",value:function(){var e=this.renderItemList();this.renderPanel(e)}},{key:"renderItemList",value:function(){var e=this,t=cN.createDom("div","",{},"playbackRate-panel-content");return this.config.list.forEach((function(n){var i=e.renderItem(n);t.appendChild(i)})),t}},{key:"renderItem",value:function(e){var t=this,n=Pw(e)?e:{textKey:e+"X",value:e},i=cN.createDom("div","",{},"panel-Item ".concat(this.state.currentRate===n.value?"select-in":""));return i.innerHTML=this.i18n[n.textKey]||n.textKey,i.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault(),t.emit(MN,{from:t.player.playbackRate,to:n.value}),t.state.currentRate=n.value,t.player.playbackRate=n.value,t.updatePanel()})),i}},{key:"renderPanel",value:function(e){var t,n;null===(t=this.player)||void 0===t||null===(n=t.panel)||void 0===n||n.showPanel(e,this.langText.rateSelect,!0)}},{key:"updatePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player)||void 0===e||e.panel.updatePanel(t)}},{key:"destroy",value:function(){this.unbind(["click"],this.renderList.bind(this))}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-mobile-playBackRate">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}],[{key:"pluginName",get:function(){return"PlaybackRateMobilePlugin"}},{key:"textTips",get:function(){return{jp:"倍速",en:"PlaybackRate",zh:"倍速","zh-hk":"倍速"}}},{key:"defaultConfig",get:function(){return{position:D6.CONTROLS_RIGHT,index:2.9,list:[2,1.5,1.25,1,.75,.5],default:1}}}]),n}(Vj),M6={playAuthToken:"",needDefinitionList:!0},R6=function(e){u(d,e);var i,r,s,c,h=v(d);function d(e){var t;return a(this,d),(t=h.call(this,e)).isPlayByToken=!1,t.isEncrypt=!1,t.config=null,t.retryCount=1,t.init(),t}return l(d,[{key:"beforePlayerCreate",value:(c=o(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isPlayByToken){e.next=3;break}return e.next=3,this.getConfig();case 3:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"getConfig",value:(s=o(n().mark((function e(){var t,i,r,o,a,s,l,c,u,h,d,f,p,g,v,y,m,_,b,k;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!z$(this.tokenInfo)){e.next=8;break}return console.error("playAuthToken is expired, please check or update your playAuthToken"),this.sdk.emit(b1.TOKEN_EXPIRED,{type:"playAuthToken",token:this.tokenInfo}),o={errorType:"token",errorCode:9101,errorMessage:"playAuthToken has expired",ext:{token:this.tokenInfo,config:this.config},originError:void 0},null===(r=this.sdk)||void 0===r||r.delayError.push(o),e.abrupt("return");case 8:if(!this.keyTokenInfo){e.next=16;break}if(!z$(this.keyTokenInfo)){e.next=16;break}return console.error("keyToken is expired, please check or update your keyToken"),this.sdk.emit(b1.TOKEN_EXPIRED,{type:"keyToken",token:this.keyTokenInfo}),s={errorType:"token",errorCode:9102,errorMessage:"keyToken for hls encrypt play has expired",ext:{token:this.keyTokenInfo,config:this.config},originError:void 0},null===(a=this.sdk)||void 0===a||a.delayError.push(s),e.abrupt("return");case 16:return l=V$(this.config),this.playerData.codec=(null===(t=this.tokenInfo)||void 0===t||null===(i=t.Codec)||void 0===i?void 0:i.toLowerCase())||TI.H264,e.next=20,this.getVideos();case 20:if(e.t0=e.sent,e.t0){e.next=23;break}e.t0={};case 23:return c=e.t0,u=c.playList,h=void 0===u?[]:u,d=c.poster,f=c.vid,p=c.dashOpts,g=c.thumbs,v=c.barrageMaskUrl,e.next=33,this.getPrivateDrmInfo(h,f,l);case 33:this.playerData.options.vid=f,this.config.needPoster&&d&&(this.playerData.options.poster=d),this.config.needThumbs&&g.length>0&&this.getThumbnailConfig(g),this.config.needBarrageMask&&v&&this.getBarrageMaskUrl(v),h.length>0?(this.isEncrypt=!!h[0].kid,"hls"===l&&this.isEncrypt&&this.getEncryptHlsConfig({vid:f,playList:h}),("dash"===l||this.playerData.configs.DASHPlugin)&&this.getDashPluginConfig({vid:f,dashOpts:p,playList:h}),y=this.playerData.configs,m=y.autoBitrateOpts,_=y.Mp4EncryptPlayer,b=y.enableMp4MSE,("mp4"===l&&this.isEncrypt||"mp4"===l&&null!=m&&m.isOpenAutoDefi||_||b)&&this.getMp4EncryptConfig({vid:f,playList:h}),"dash"===l||this.playerData.configs.DASHPlugin?(k=h.filter((function(e){return"video"===e.FileType}))).length&&(this.playerData.playList=k,this.playerData.initCurrent(k[0])):(this.playerData.playList=this.config.needDefinitionList?h:[h[0]],this.playerData.initCurrent(this.playerData.playList[0]))):console.error("got no video by playAuthToken"),e.next=43;break;case 40:e.prev=40,e.t1=e.catch(0),console.error(e.t1);case 43:case"end":return e.stop()}}),e,this,[[0,40]])}))),function(){return s.apply(this,arguments)})},{key:"getVideos",value:(r=o(n().mark((function e(){var i,r,a=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=function(e){var t,n;try{100006===fI(JSON.parse(e.response),"ResponseMetadata.Error.CodeN")&&(console.error("playAuthToken is expired, please check or update your playAuthToken"),a.sdk.emit(b1.TOKEN_EXPIRED,e))}catch(r){console.log(r)}null===(t=a._emitter)||void 0===t||t.emit(k1.GET_PLAY_URL_ERR,e);var i={errorType:"token",errorCode:9100,errorMessage:"get play url error by playAuthToken, please check playAuthToken",ext:{},originError:e};null===(n=a.sdk)||void 0===n||n.delayError.push(i)},r=function(){var e=o(n().mark((function e(r){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(502!==(null==r?void 0:r.status)||!a.playerData.apiMap.backupPlayDomain){e.next=7;break}return a.playerData.apiMap.playDomain=a.playerData.apiMap.backupPlayDomain,e.next=4,K$((function(){return W$(t(t({},a.playerData.apiMap),a.config))}),a.retryCount,(function(e){return 502===e.status}),i);case 4:return e.abrupt("return",e.sent);case 7:i(r);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.next=4,K$((function(){return W$(t(t({},a.playerData.apiMap),a.config))}),this.retryCount,(function(e){return 502===e.status}),r);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getPrivateDrmInfo",value:(i=o(n().mark((function e(t,i,r){var o,a,s,l,c,u,h=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.config.getDrmAuthToken||"function"!=typeof this.config.getDrmAuthToken||!this.playerData.unionId){e.next=34;break}if(this.sessionId=(new Date).getTime().toString(),"hls"!==r){e.next=9;break}return e.next=5,e6.loadPlugins("hlsEncrypt");case 5:a=e.sent,o=a.updateUnionInfo(this.playerData.unionId,this.sessionId),e.next=21;break;case 9:if("dash"!==r){e.next=16;break}return e.next=12,e6.loadPlugins("dash");case 12:s=e.sent,o=s.updateUnionInfo(this.playerData.unionId,this.sessionId),e.next=21;break;case 16:if("mp4"!==r){e.next=21;break}return e.next=19,e6.loadPlugins("mp4Encrypt");case 19:l=e.sent,o=l.updateUnionInfo(this.playerData.unionId,this.sessionId);case 21:if(o){e.next=23;break}return e.abrupt("return");case 23:return c=b(new Set(t.map((function(e){return e.kid})))).join(","),e.prev=24,e.next=27,nX(Z$(this.config.getDrmAuthToken(c,i,o)),200,"The execution time of obtaining privateDrmAuthToken by getDrmAuthToken function of options has exceeded more than 200ms");case 27:(u=e.sent)&&"string"==typeof u&&(this.privateDrmAuthToken=u,t.forEach((function(e){e.drmKeyToken=h.privateDrmAuthToken}))),e.next=34;break;case 31:e.prev=31,e.t0=e.catch(24),console.error("get privaterDrmToken fail");case 34:case"end":return e.stop()}}),e,this,[[24,31]])}))),function(e,t,n){return i.apply(this,arguments)})},{key:"getEncryptHlsConfig",value:function(e){var n,i=e||{},r=i.playList,o=i.vid,a=this.config,s=a.playDomain,l=a.keyToken,c=a.getKeyType;a.keyDomain;var u=t({},this.playerData.configs.EncryptHlsPlugin||{}),h=null==r||null===(n=r[0])||void 0===n?void 0:n.kid;if(l)this.playerData.options.EncryptHlsPlugin=t({keyToken:l,playDomain:s||this.playerData.apiMap.playDomain,getKeyType:c||"TOP"},u);else if(this.privateDrmAuthToken&&this.sessionId){var d=F$(this.privateDrmAuthToken),f=parseInt(d["X-Expires"]),p=isNaN(f)?30:f;this.playerData.options.EncryptHlsPlugin=t({vid:o,kid:h,keyTokenExpiredDuration:p,drmKeyToken:this.privateDrmAuthToken,sessionId:this.sessionId,playDomain:s||this.playerData.apiMap.playDomain},u)}}},{key:"getThumbnailConfig",value:function(e){var n=e[0],i=t({},this.playerData.configs.thumbnail||{});this.playerData.options.thumbnail=t({pic_num:n.CaptureNum,urls:n.StoreUrls,width:n.CellWidth,height:n.CellHeight,col:n.ImgXLen,row:n.ImgYLen},i)}},{key:"getBarrageMaskUrl",value:function(e){var n,i,r=t({},(null===(n=this.playerData.configs)||void 0===n||null===(i=n.DanmuPlugin)||void 0===i?void 0:i.maskConfig)||{});this.playerData.configs.DanmuPlugin?(this.playerData.options.DanmuPlugin.active=!0,this.playerData.options.DanmuPlugin.maskActive=!0,this.playerData.options.DanmuPlugin.maskConfig=t({maskUrl:e},r)):this.playerData.options.DanmuPlugin={active:!0,maskActive:!0,maskConfig:t({maskUrl:e},r)}}},{key:"getDashPluginConfig",value:function(e){var n,i,r=e||{},o=r.vid,a=r.playList,s=r.dashOpts,l=this.config.playDomain,c=t({},(null===(n=this.playerData.configs)||void 0===n?void 0:n.DASHPlugin)||{}),u=null==a||null===(i=a[0])||void 0===i?void 0:i.kid;if(this.privateDrmAuthToken&&this.sessionId){var h=F$(this.privateDrmAuthToken),d=parseInt(h["X-Expires"]),f=isNaN(d)?30:d;this.playerData.options.DASHPlugin=t({playInfoType:"TOP",vid:o,dashOpts:s,defaultFormat:"dash",definitionText:this.config.definitionMap,kid:u,keyTokenExpiredDuration:f,sessionId:this.sessionId,drmKeyToken:this.privateDrmAuthToken,playDomain:l||this.playerData.apiMap.playDomain},c)}}},{key:"getMp4EncryptConfig",value:function(e){var n,i,r=e.playList,o=e.vid,a=this.config.playDomain,s=null==r||null===(n=r[0])||void 0===n?void 0:n.kid,l=t({},(null===(i=this.playerData.configs)||void 0===i?void 0:i.Mp4EncryptPlayer)||{});if(this.isEncrypt){if(this.privateDrmAuthToken&&this.sessionId){var c=F$(this.privateDrmAuthToken),u=parseInt(c["X-Expires"]),h=isNaN(u)?30:u;this.playerData.options.Mp4EncryptPlayer=t({vid:o,useEME:!1,isEncrypt:!0,bitrate:null==r?void 0:r[0].Bitrate,kid:s,drmKeyToken:this.privateDrmAuthToken,keyTokenExpiredDuration:h,sessionId:this.sessionId,playDomain:a||this.playerData.apiMap.playDomain},l)}}else this.playerData.options.Mp4EncryptPlayer=t({vid:o,bitrate:null==r?void 0:r[0].Bitrate},l)}},{key:"init",value:function(){var e=this.playerData.configs.getVideoByToken,t=void 0===e?{}:e;this.initConfig(t)}},{key:"initConfig",value:function(e){if(this.isPlayByToken=!!e.playAuthToken,this.isPlayByToken){if(this.config=Object.assign(M6,e),this.tokenInfo=H$(e.playAuthToken),e.keyToken){var t=eX(e.keyToken)?window.atob(e.keyToken):e.keyToken;this.keyTokenInfo=F$(t)}e.retryCount&&(this.retryCount=e.retryCount)}}},{key:"switchAuthToken",value:function(e){return this.initConfig(e),this.getConfig()}}],[{key:"pluginName",get:function(){return"AuthToken"}}]),d}(function(){function e(t){a(this,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=t,this.pluginName="",this.__init(t)}return l(e,[{key:"beforeCreate",value:function(){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerCreate",value:function(){}},{key:"afterPlayerCreate",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(t){var n=this;e.defineGetterOrSetter(this,{sdk:{get:function(){return t.sdk},configurable:!0},player:{get:function(){return t.sdk.getPlayerInstance()},configurable:!0},playerData:{get:function(){return t.sdk.playerData},configurable:!0},pluginName:{get:function(){return t.pluginName?t.pluginName.toLowerCase():n.constructor.pluginName.toLowerCase()},configurable:!0},_emitter:{get:function(){return t.sdk._emitter},configurable:!0}})}},{key:"__destroy",value:function(){var e=this,t=this.sdk,n=this.pluginName;this.destroy&&"function"==typeof this.destroy&&this.destroy(),["sdk","player","playerData","pluginName","_emitter"].map((function(t){Object.defineProperty(e,t,{writable:!0})})),Object.keys(this).map((function(t){e[t]=null,delete e[t]})),Object.setPrototypeOf&&Object.setPrototypeOf(this,null),delete t._sdkPlugins[n]}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var n in t)Object.defineProperty(e,n,t[n])}},{key:"pluginName",get:function(){return"pluginName"}}]),e}()),N6={init:function(e){var t;e&&(null!==(t=e.playerData)&&void 0!==t&&t.isLive?e.sdkPlugins=[]:e.sdkPlugins=[R6],e._sdkPlugins={})},registerPlugin:function(e,t){if(e&&t){var n=null,i=null;e.plugin&&"function"==typeof e.plugin?(n=e.plugin,i=e.options):(n=e,i={}),i.sdk=t;var r=i.pluginName||n.pluginName;if(!r)throw new Error("The property pluginName is necessary");var o=t._sdkPlugins;try{o[r.toLowerCase()]&&this.unRegister(r);var a=new n(i);return o[r.toLowerCase()]=a,o[r.toLowerCase()].func=n,a&&"function"==typeof a.afterCreate&&a.afterCreate(),a}catch(s){console.error(s)}}},unRegister:function(e,t){if(e&&t){e=e.toLowerCase();try{var n=t._sdkPlugins[e];n&&(n.pluginName&&n.__destroy(),delete t._sdkPlugins[e])}catch(i){console.error(i)}}},beforePlayerCreate:function(e){if(e){e._sdkPlugins||this.init(e);for(var t=e._sdkPlugins,n=[],i=0,r=Object.keys(t);i<r.length;i++){var o=r[i];if(t[o]&&t[o].beforePlayerCreate)try{var a=t[o].beforePlayerCreate();n.push(Z$(a))}catch(xX){throw n.push(Z$(null)),xX}}return new Promise((function(e){Promise.all([].concat(n)).then((function(){e(null)})).catch((function(t){console.error(t),e(null)}))}))}},afterPlayerCreate:function(e){if(e)for(var t=e._sdkPlugins,n=0,i=Object.keys(t);n<i.length;n++){var r=i[n];if(t[r]&&t[r].beforePlayerCreate)try{t[r].afterPlayerCreate()}catch(xX){throw xX}}},destroy:function(e){if(e){for(var t=e._sdkPlugins,n=0,i=Object.keys(t);n<i.length;n++){var r=i[n];this.unRegister(r,e)}delete e._sdkPlugins}}},j6=[{LANG:"en",TEXT:{MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported or no playable source found",GET_URL_ERR_BY_TOKEN:"Failed to get video url",PLAY_AUTH_TOKEN_EXPIRED:"Token has expired",HLS_KEY_TOKEN_EXPIRED:"Play certificate has expired",MEDIA_SOURCE_CANNOT_PLAY_TYPE:"Video type cannot play",NETWORK_ERROR:"Network error",NETWORK_TIMEOUT:"Network timeout"}},{LANG:"zh",TEXT:{MEDIA_ERR_SRC_NOT_SUPPORTED:"音/视频格式不支持,或未找到可用资源",GET_URL_ERR_BY_TOKEN:"获取视频地址失败",PLAY_AUTH_TOKEN_EXPIRED:"token已过期",HLS_KEY_TOKEN_EXPIRED:"播放凭证已过期",MEDIA_SOURCE_CANNOT_PLAY_TYPE:"不支持的视频格式",NETWORK_ERROR:"网络错误",NETWORK_TIMEOUT:"网络超时"}},{LANG:"zh-hk",TEXT:{MEDIA_ERR_SRC_NOT_SUPPORTED:"音/視頻格式不支持,或未找到可用資源",GET_URL_ERR_BY_TOKEN:"獲取視頻地址失敗",PLAY_AUTH_TOKEN_EXPIRED:"Token已過期",HLS_KEY_TOKEN_EXPIRED:"播放憑證已過期",MEDIA_SOURCE_CANNOT_PLAY_TYPE:"不支持的視頻格式",NETWORK_ERROR:"網絡錯誤",NETWORK_TIMEOUT:"網絡超時"}},{LANG:"jp",TEXT:{MEDIA_ERR_SRC_NOT_SUPPORTED:"オーディオ/ビデオ形式がサポートされていないか、利用可能なリソースが見つかりませんでした",GET_URL_ERR_BY_TOKEN:"動画の URL を取得できませんでした",PLAY_AUTH_TOKEN_EXPIRED:"playAuthTokenは期限切れです",HLS_KEY_TOKEN_EXPIRED:"プレイ証明書の有効期限が切れています",MEDIA_SOURCE_CANNOT_PLAY_TYPE:"サポートされていないビデオ形式",NETWORK_ERROR:"ネットワークエラー",NETWORK_TIMEOUT:"ネットワークタイムアウト"}}],B6=function(){function e(t,n){a(this,e),this.url=t;var i=new window.XMLHttpRequest;i.target=this,i.responseType="arraybuffer",i.open("get",t),i.onload=function(){200!==i.status&&206!==i.status||n&&n instanceof Function&&n(i.response)},i.onerror=function(e){},this.xhr=i,this.run()}return l(e,[{key:"cancel",value:function(){this.xhr.abort()}},{key:"run",value:function(){1===this.xhr.readyState&&this.xhr.send()}}]),e}(),U6={ORDER:"order",SLOOP:"sloop",LOOP:"loop",RANDOM:"random"},H6="xgplayer-music";function F6(e,t,n){var i=Math.floor(Math.random()*(t-e)+e);return i===n?(i>t/2?t/=2:e=t/2,t-e>2?F6(e,t,n):i):i}var G6=function(e){u(i,e);var n=v(i);function i(){var e;return a(this,i),(e=n.apply(this,arguments))._onEnded=function(){if("order"===e.mode&&e.index+1>=e.list.length)return e.player.pause(),void(e.player.currentTime=0);if(e.mode===U6.SLOOP)e.change();else e.next()},e._onDurationChange=function(){var t=e.config.abCycle;e._initABCycle(t,e.player)},e._onTimeUpdate=function(){var t=p(e),n=t.config,i=t.player;if(!e.halfPass&&i.currentTime>i.duration/2&&e.confirmOrder(),n.abCycle){var r=n.abCycle,o=r.end>i.duration?i.duration:r.end;i.currentTime>=o?(r.loop||(i.pause(),e.emit("abCycle_ended")),i.currentTime=r.start||0):i.currentTime<r.start&&(i.currentTime=r.start||0)}},e}return l(i,[{key:"afterCreate",value:function(){var e,t,n,i,r,o,a,s,l,c,u=this.player,h=this.playerConfig;(cN.addClass(u.root,H6),this.halfPass=!1,this.list=this.config.list||[],this.emit(k1.MUSIC_LIST_CHANGE,this.list),this.nextIndex=-1,this.prevIndex=-1,this.history=[],this.disable=!(this.list.length>0),!h.url&&this.list.length>0)&&(h.url=null===(e=this.list)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.src);h.poster||(h.poster=null===(n=this.list)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.poster);h.title||(h.title=null!==(r=null===(o=this.list)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.title)&&void 0!==r?r:"");h.vid||(h.vid=null!==(s=null===(l=this.list)||void 0===l||null===(c=l[0])||void 0===c?void 0:c.vid)&&void 0!==s?s:"");this._curInfo={src:h.url,poster:h.poster,title:h.title,vid:h.vid},this.index=0,this.on(ON,this._onTimeUpdate),this.on(EN,this._onEnded),this.on(LN,this._onDurationChange),this.config.offline&&this.checkOffline(this._curInfo.src,this._curInfo.vid).then((function(e){0===e.code&&(h.url=e.url,u.state>=4&&(u.src=e.url))})).catch((function(e){console.error(e)}))}},{key:"destroy",value:function(){cN.removeClass(this.player.root,H6)}},{key:"_nextCompute",value:function(){if(!this.disable)switch(this.mode){case U6.SLOOP:this.nextIndex=this.index;break;case U6.ORDER:case U6.LOOP:this.index+1<this.list.length?this.nextIndex=this.index+1:this.nextIndex=0;break;default:this.nextIndex=F6(0,this.list.length,this.index)}}},{key:"_prevCompute",value:function(){if(!this.disable)switch(this.mode){case U6.SLOOP:this.nextIndex=this.index;break;case U6.ORDER:case U6.LOOP:this.index-1>=0?this.prevIndex=this.index-1:this.prevIndex=this.list.length-1;break;default:this.prevIndex=F6(0,this.list.length,this.index)}}},{key:"_emitChange",value:function(){this.emit(k1.MUSIC_CHANGE,this._curInfo)}},{key:"_initABCycle",value:function(e,t){var n=t.plugins.progresspreview;if(e&&t){var i=e.end>this.player.duration?this.player.duration:e.end,r=e.start>this.player.duration?0:e.start,o={id:t.playerId,time:e.start,duration:i-r,text:e.text,color:e.color};n.findDot(o.id)?n.updateDot(o):n.createDot(o)}else n.findDot(t.playerId)&&n.deleteDot(t.playerId)}},{key:"random",value:function(){if(this.list.length<0)return null;var e=F6(0,this.list.length,this.index);return this.list[e]}},{key:"next",value:function(){this.disable||(this.halfPass||(this.halfPass=!0,this._nextCompute()),this.index=this.nextIndex,this.change())}},{key:"prev",value:function(){this.disable||(this.halfPass||(this.halfPass=!0,this._prevCompute()),this.index=this.prevIndex,this.change())}},{key:"forward",value:function(){var e=this.player,t=this.config.timeScale;e.currentTime=e.currentTime+t<e.duration?e.currentTime+t:e.duration-.1}},{key:"backward",value:function(){var e=this.player,t=this.config.timeScale;e.currentTime=e.currentTime-t>0?e.currentTime-t:0}},{key:"add",value:function(e){this.list.push({src:e.src,title:e.title,vid:e.vid,poster:e.poster}),this.disable=!(this.list.length>0),this.emit(k1.MUSIC_LIST_CHANGE,this.list)}},{key:"remove",value:function(e){var t=-1;this.list.every((function(n,i){return n.vid!==e||(t=i,!1)})),t>-1&&(this.list.splice(t,1),this.emit(k1.MUSIC_LIST_CHANGE,this.list)),this.disable=!(this.list.length>0)}},{key:"setAbCycle",value:function(e,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e&&"Object"===cN.typeOf(e)?this.config.abCycle=t({},e):this.config.abCycle=t({start:e||0,end:n||this.player.duration,loop:i},r),this._initABCycle(this.config.abCycle,this.player)}},{key:"removeAbCycle",value:function(){this.config.abCycle=null,this._initABCycle(null,this.player)}},{key:"updateList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.removeAbCycle(),this.player.pause(),this.player.currentTime=0,this.list=e,this.nextIndex=0,this.index=0,this.change(),this.disable=!(this.list.length>0),this.emit(k1.MUSIC_LIST_CHANGE,this.list)}},{key:"setIndex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;e<0||e>=this.list.length||(this.nextIndex=e,this.index=e,this.change())}},{key:"change",value:function(){var e=this;if(!this.disable){var t=this.player,n=this.list,i=this.index,r=n[i].vid;this.halfPass=!1,this.checkOffline(n[i].src,r).then((function(n){e._curInfo={title:e.list[e.index].title||"",vid:e.list[e.index].vid,poster:e.list[e.index].poster||"",src:n.url},t.playNext({url:n.url,vid:e.list[e.index].vid||0,poster:e.list[e.index].poster||"",autoplay:!0}),t.off("timeupdate",e._emitChange.bind(e)),t.once("timeupdate",e._emitChange.bind(e)),t.play()}))}}},{key:"checkOffline",value:function(e,t){var n=this;return new Promise((function(i,r){if(!n.config.offline||n.disable)return i({url:e,code:-1,vid:t});var o=n.player.database;o.openDB((function(){o.getDataByKey(o.myDB.ojstore.name,t,(function(n){setTimeout((function(){o.closeDB()}),5e3),i(n?{url:URL.createObjectURL(n.blob),code:0,vid:n.vid}:{url:e,code:-2,vid:t})}))}))}))}},{key:"confirmOrder",value:function(){this.halfPass=!0,this._nextCompute(),this._prevCompute(),this.config.preloadNext&&this.preload(this.nextIndex)}},{key:"preload",value:function(e){if(!(e<0||e>=this.list.length)){var t=this.list[e],n=this.player;this.checkOffline(t.src,t.vid).then((function(e){if(-2===e.code){var i=t.vid;new B6(t.src,(function(e){n.database.openDB((function(){n.database.addData(n.database.myDB.ojstore.name,[{vid:i,blob:new Blob([e],{type:'audio/mp4; codecs="mp4a.40.5"'})}]),setTimeout((function(){n.database.closeDB()}),5e3)}))}))}}))}}},{key:"timeScale",get:function(){return this.config.timeScale||15},set:function(e){this.config.timeScale=e,this.emit(k1.TIME_SCALE_CHANGE,e)}},{key:"mode",get:function(){return this.config.mode||U6.RANDOM},set:function(e){Object.values(U6).includes(e)&&(this.config.mode=e,this.emit(k1.MUSIC_MODE_CHANGE,e))}}],[{key:"pluginName",get:function(){return"music"}},{key:"defaultConfig",get:function(){return{offline:!1,preloadNext:!0,abCycle:null,timeScale:15,mode:U6.ORDER,list:[]}}},{key:"ModeType",get:function(){return Object.keys(U6).map((function(e){return U6[e]}))}}]),i}(Dj),V6=function(e){u(n,e);var t=v(n);function n(){return a(this,n),t.apply(this,arguments)}return l(n,[{key:"afterCreate",value:function(){var e=this;this.on(k1.MUSIC_CHANGE,(function(t){if(t&&t.poster){var n=e.find("img");n?n.src=t.poster:e.root.innerHTML="<img src=".concat(t.poster,' alt=""/>'),e.show()}else e.hide()}))}},{key:"render",value:function(){var e,t,n=this.playerConfig;return n.poster||null!=n&&null!==(e=n.url)&&void 0!==e&&e[0].poster?'<xg-icon class="xgplayer-cover">\n <img src="'.concat(n.poster||(null==n||null===(t=n.url)||void 0===t?void 0:t[0].poster),'" alt="">\n </xg-icon>'):'<xg-icon class="xgplayer-cover"></xg-icon>'}}],[{key:"pluginName",get:function(){return"musiccover"}},{key:"defaultConfig",get:function(){return{index:0,position:Vj.POSITIONS.CONTROLS_LEFT}}}]),n}(Vj);function z6(){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="M10.2478 0C6.32662 0 2.94593 2.3143 1.39715 5.65152L0.558008 5.42701C0.321533 5.36365 0.0784664 5.50398 0.0151043 5.74046C-0.00971985 5.8331 -0.00382614 5.9313 0.0319023 6.02031L1.13271 8.76283C1.22391 8.99003 1.48202 9.10028 1.70921 9.00908C1.74819 8.99344 1.78475 8.97233 1.81779 8.94639L4.14238 7.12171C4.33496 6.97055 4.36853 6.69189 4.21737 6.49932C4.15815 6.42387 4.07605 6.36967 3.98341 6.34485L3.14176 6.1196C4.46348 3.53919 7.14942 1.77312 10.2478 1.77312C14.6545 1.77312 18.2269 5.34545 18.2269 9.75215C18.2269 14.1589 14.6545 17.7312 10.2478 17.7312C6.45067 17.7312 3.273 15.0787 2.4666 11.5256L0.656528 11.5254C1.49041 16.0647 5.46745 19.5043 10.2478 19.5043C15.6338 19.5043 20 15.1381 20 9.75215C20 4.36619 15.6338 0 10.2478 0Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var W6=function(e){u(n,e);var t=v(n);function n(){var e;return a(this,n),(e=t.apply(this,arguments)).onClick=function(t){var n=p(e).player;t.preventDefault(),t.stopPropagation(),n.plugins.music.backward()},e}return l(n,[{key:"afterCreate",value:function(){var e=this;this.initIcons();["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.timeScaleDom=this.find(".xgplayer-timescale"),this.on(k1.TIME_SCALE_CHANGE,(function(t){e.timeScaleDom.innerHTML=t}))}},{key:"registerIcons",value:function(){return{musicBackward:{icon:z6,class:"xg-icon-mbackward"}}}},{key:"registerLanguageTexts",value:function(){return{backward:{jp:"あとずさりする",en:"MusicBackward",zh:"后退","zh-hk":"後退"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.musicBackward)}},{key:"destroy",value:function(){var e=this;["click","touchstart"].forEach((function(t){e.unbind(t,e.onClick)}))}},{key:"render",value:function(){var e=this.player.plugins.music.config.timeScale||15;return'<xg-icon class="xgplayer-backward">\n <div class="xgplayer-icon">\n <span class="xgplayer-timescale">'.concat(e,'</span>\n </div>\n <div class="xg-tips" lang-key="backward">').concat(this.langText.backward,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"musicbackword"}},{key:"defaultConfig",get:function(){return{index:1,position:Vj.POSITIONS.CONTROLS_LEFT}}}]),n}(Vj),K6=function(e){u(n,e);var t=v(n);function n(){var e;return a(this,n),(e=t.apply(this,arguments)).onClick=function(t){var n=p(e).player;t.preventDefault(),t.stopPropagation(),n.plugins.music.prev()},e}return l(n,[{key:"afterCreate",value:function(){var e=this;this.initIcons();["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.updateVisible(),this.on(k1.MUSIC_LIST_CHANGE,this.updateVisible.bind(this))}},{key:"updateVisible",value:function(){var e,t,n;(null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(n=t.list)||void 0===n?void 0:n.length)>1?this.show():this.hide()}},{key:"registerIcons",value:function(){return{musicPrev:{icon:' <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_20323_25783)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 1.20196V22.798C21.2 23.7867 20.0711 24.3511 19.28 23.7579L4.88002 12.9598C4.24002 12.4799 4.24002 11.5201 4.88002 11.0402L19.28 0.242135C20.0711 -0.35107 21.2 0.213286 21.2 1.20196Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3.8 0.00219727C4.13137 0.00219727 4.4 0.270826 4.4 0.602197V23.3978C4.4 23.7292 4.13137 23.9978 3.8 23.9978H2.6C2.26863 23.9978 2 23.7292 2 23.3978V0.602197C2 0.270826 2.26863 0.00219727 2.6 0.00219727H3.8Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0_20323_25783">\n <rect width="24" height="24" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n ',class:"xg-icon-mprev"}}}},{key:"registerLanguageTexts",value:function(){return{musicPrev:{jp:"前の曲",en:"MusicPrev",zh:"上一首","zh-hk":"上一首"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.musicPrev)}},{key:"destroy",value:function(){var e=this;["click","touchstart"].forEach((function(t){e.unbind(t,e.onClick)}))}},{key:"render",value:function(){return'<xg-icon class="xgplayer-next">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="musicPrev">'.concat(this.langText.musicPrev,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"musicprev"}},{key:"defaultConfig",get:function(){return{index:2,position:Vj.POSITIONS.CONTROLS_LEFT}}}]),n}(Vj);function q6(){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="M9.75215 0C13.6734 0 17.0541 2.3143 18.6029 5.65152L19.442 5.42701C19.6785 5.36365 19.9215 5.50398 19.9849 5.74046C20.0097 5.8331 20.0038 5.9313 19.9681 6.02031L18.8673 8.76283C18.7761 8.99003 18.518 9.10028 18.2908 9.00908C18.2518 8.99344 18.2152 8.97233 18.1822 8.94639L15.8576 7.12171C15.665 6.97055 15.6315 6.69189 15.7826 6.49932C15.8419 6.42387 15.9239 6.36967 16.0166 6.34485L16.8582 6.1196C15.5365 3.53919 12.8506 1.77312 9.75215 1.77312C5.34545 1.77312 1.77312 5.34545 1.77312 9.75215C1.77312 14.1589 5.34545 17.7312 9.75215 17.7312C13.5493 17.7312 16.727 15.0787 17.5334 11.5256L19.3435 11.5254C18.5096 16.0647 14.5325 19.5043 9.75215 19.5043C4.36619 19.5043 0 15.1381 0 9.75215C0 4.36619 4.36619 0 9.75215 0Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var Y6=function(e){u(n,e);var t=v(n);function n(){var e;return a(this,n),(e=t.apply(this,arguments)).onClick=function(t){var n=p(e).player;t.preventDefault(),t.stopPropagation(),n.plugins.music.forward()},e}return l(n,[{key:"afterCreate",value:function(){var e=this;this.initIcons();["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.timeScaleDom=this.find(".xgplayer-timescale"),this.on(k1.TIME_SCALE_CHANGE,(function(t){e.timeScaleDom.innerHTML=t}))}},{key:"registerIcons",value:function(){return{musicForward:{icon:q6,class:"xg-icon-mforward"}}}},{key:"registerLanguageTexts",value:function(){return{forward:{jp:"早送り",en:"MusicForward",zh:"快进","zh-hk":"快進"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.musicForward)}},{key:"destroy",value:function(){var e=this;["click","touchstart"].forEach((function(t){e.unbind(t,e.onClick)}))}},{key:"render",value:function(){var e=this.player.plugins.music.config.timeScale||15;return'<xg-icon class="xgplayer-forward">\n <div class="xgplayer-icon">\n <span class="xgplayer-timescale">'.concat(e,'</span>\n </div>\n <div class="xg-tips" lang-key="forward">').concat(this.langText.forward,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"musicforward"}},{key:"defaultConfig",get:function(){return{index:5,position:Vj.POSITIONS.CONTROLS_LEFT}}}]),n}(Vj),$6=function(e){u(n,e);var t=v(n);function n(){var e;return a(this,n),(e=t.apply(this,arguments)).onClick=function(t){var n=p(e).player;t.preventDefault(),t.stopPropagation(),n.plugins.music.next()},e}return l(n,[{key:"afterCreate",value:function(){var e=this;this.initIcons();["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.updateVisible(),this.on(k1.MUSIC_LIST_CHANGE,this.updateVisible.bind(this))}},{key:"updateVisible",value:function(){var e,t,n;(null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(n=t.list)||void 0===n?void 0:n.length)>1?this.show():this.hide()}},{key:"registerIcons",value:function(){return{musicNext:{icon:' <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_20323_25776)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3.92 0.242135L18.32 11.0402C18.96 11.5201 18.96 12.4799 18.32 12.9598L3.92 23.7579C3.12892 24.3511 2 23.7867 2 22.798V1.20196C2 0.213286 3.12892 -0.35107 3.92 0.242135Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M20.6 0.00219727C20.9314 0.00219727 21.2 0.270826 21.2 0.602197V23.3978C21.2 23.7292 20.9314 23.9978 20.6 23.9978H19.4C19.0687 23.9978 18.8 23.7292 18.8 23.3978V0.602197C18.8 0.270826 19.0687 0.00219727 19.4 0.00219727H20.6Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0_20323_25776">\n <rect width="24" height="24" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n ',class:"xg-icon-mnext"}}}},{key:"registerLanguageTexts",value:function(){return{musicNext:{jp:"次の曲",en:"MusicNext",zh:"下一首","zh-hk":"下一首"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.musicNext)}},{key:"destroy",value:function(){var e=this;["click","touchstart"].forEach((function(t){e.unbind(t,e.onClick)}))}},{key:"render",value:function(){return'<xg-icon class="xgplayer-next">\n <div class="xgplayer-icon"></div>\n <div class="xg-tips" lang-key="musicNext">'.concat(this.langText.musicNext,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"musicnext"}},{key:"defaultConfig",get:function(){return{index:4,position:Vj.POSITIONS.CONTROLS_LEFT}}}]),n}(Vj),X6=function(e){u(n,e);var t=v(n);function n(){return a(this,n),t.apply(this,arguments)}return l(n,[{key:"afterCreate",value:function(){var e=this;this.on(k1.MUSIC_CHANGE,(function(t){t&&t.title?e.root.innerHTML="".concat(t.title):e.root.innerHTML=""}))}},{key:"render",value:function(){var e=this.playerConfig;return'<xg-title class="xgplayer-name">\n '.concat(e.title||"","\n </xg-title>")}}],[{key:"pluginName",get:function(){return"musicmeta"}},{key:"defaultConfig",get:function(){return{index:0,position:Vj.POSITIONS.CONTROLS_LEFT}}}]),n}(Vj);function J6(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20779_14791)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M39 8C39.5523 8 40 8.44772 40 9V11C40 11.5523 39.5523 12 39 12H7C6.44772 12 6 11.5523 6 11V9C6 8.44772 6.44772 8 7 8H39ZM30 23C30 22.4477 29.5523 22 29 22H7C6.44772 22 6 22.4477 6 23V25C6 25.5523 6.44772 26 7 26H29C29.5523 26 30 25.5523 30 25V23ZM46.0725 31C46.0725 31.2113 46.0056 31.4173 45.8812 31.5882L39.845 39.888C39.5202 40.3346 38.8948 40.4334 38.4481 40.1086C38.3635 40.047 38.2891 39.9726 38.2275 39.888L32.1913 31.5882C31.8665 31.1415 31.9652 30.5161 32.4119 30.1913C32.5828 30.067 32.7887 30 33 30H37V19.5C37 19.2239 37.2239 19 37.5 19H40.5C40.7761 19 41 19.2239 41 19.5V30H45.0725C45.6248 30 46.0725 30.4477 46.0725 31ZM29 36C29.5523 36 30 36.4477 30 37V39C30 39.5523 29.5523 40 29 40H7C6.44772 40 6 39.5523 6 39V37C6 36.4477 6.44772 36 7 36H29Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_20779_14791">\n<rect width="48" height="48" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}function Z6(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20731_14771)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M42.0018 23V29.024C42.0018 34.569 37.5247 39.064 32.0018 39.064H17.9999V42.6585C17.9999 43.2108 17.5522 43.6585 16.9999 43.6585C16.7991 43.6585 16.603 43.598 16.437 43.485L8.20729 37.8803C7.75081 37.5694 7.63278 36.9473 7.94366 36.4908C8.01331 36.3886 8.10134 36.3001 8.20327 36.23L16.433 30.5662C16.888 30.2531 17.5106 30.3681 17.8237 30.8231C17.9385 30.9899 17.9999 31.1875 17.9999 31.39V35.048H32.0018C35.3155 35.048 38.0018 32.351 38.0018 29.024V23H42.0018ZM31.0019 5.89087C31.2027 5.89087 31.3988 5.95132 31.5648 6.06434L39.7945 11.6691C40.251 11.98 40.369 12.602 40.0582 13.0585C39.9885 13.1608 39.9005 13.2492 39.7986 13.3194L31.5688 18.9831C31.1139 19.2962 30.4912 19.1812 30.1781 18.7263C30.0633 18.5595 30.0019 18.3618 30.0019 18.1593V14.5013H16C12.6863 14.5013 10 17.1984 10 20.5254V26.5494H6V20.5254C6 14.9804 10.4772 10.4853 16 10.4853H30.0019V6.89087C30.0019 6.33858 30.4496 5.89087 31.0019 5.89087Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_20731_14771">\n<rect width="48" height="48" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}function Q6(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20731_14777)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M35.0194 27.9598C35.2314 27.9598 35.4379 28.0272 35.6091 28.1522L41.8863 32.736C42.3323 33.0617 42.4298 33.6873 42.1041 34.1333C42.0419 34.2186 41.9665 34.2934 41.8809 34.3551L35.6037 38.875C35.1556 39.1977 34.5306 39.096 34.2079 38.6478C34.0853 38.4776 34.0194 38.2732 34.0194 38.0635V35.5556C30.1354 35.5195 27.7656 34.3892 25.642 31.7548C26.4304 30.621 27.1705 29.3627 27.8834 27.9788C29.5719 30.6143 31.112 31.5275 34.0194 31.5546V28.9598C34.0194 28.4075 34.4671 27.9598 35.0194 27.9598ZM35.0112 7.94434C35.2205 7.94434 35.4246 8.01001 35.5946 8.13211L41.8792 12.6458C42.3278 12.968 42.4303 13.5928 42.1081 14.0414C42.0464 14.1273 41.9715 14.2028 41.8861 14.2652L35.6015 18.8607C35.1557 19.1867 34.53 19.0895 34.204 18.6437C34.0787 18.4724 34.0112 18.2657 34.0112 18.0535V15.4606C29.9521 15.4984 28.443 17.234 25.7897 23.0253C25.4916 23.6778 25.333 24.0244 25.1845 24.3452C21.6243 32.0396 17.983 35.4364 10.0186 35.5591H6V31.5394L9.98762 31.5397C16.0421 31.4462 18.5555 29.1016 21.5376 22.6568C21.6818 22.3451 21.8361 22.0079 22.1364 21.3507C25.3774 14.2767 27.8951 11.4978 34.0112 11.4409V8.94434C34.0112 8.39205 34.4589 7.94434 35.0112 7.94434ZM10.0186 11.4409C14.8213 11.5149 18.0519 12.7794 20.6407 15.459C19.9655 16.6111 19.3108 17.8933 18.6522 19.3098C16.5567 16.6161 14.0817 15.5236 9.98762 15.4604L6 15.4606V11.4409H10.0186Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_20731_14777">\n<rect width="48" height="48" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}function e7(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20731_14784)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M42.0018 22.1091V28.1331C42.0018 33.6781 37.5247 38.1732 32.0018 38.1732H17.9999V41.7676C17.9999 42.3199 17.5522 42.7676 16.9999 42.7676C16.7991 42.7676 16.603 42.7072 16.437 42.5941L8.20729 36.9894C7.75081 36.6785 7.63278 36.0564 7.94366 35.6C8.01331 35.4977 8.10134 35.4092 8.20327 35.3391L16.433 29.6754C16.888 29.3623 17.5106 29.4773 17.8237 29.9322C17.9385 30.099 17.9999 30.2967 17.9999 30.4991V34.1572H32.0018C35.3155 34.1572 38.0018 31.4601 38.0018 28.1331V22.1091H42.0018ZM26.05 18V29.664H23.19V21.08L21 22.852V19.772L23.19 18H26.05ZM31.0019 5C31.2027 5 31.3988 5.06045 31.5648 5.17347L39.7945 10.7782C40.251 11.0891 40.369 11.7112 40.0582 12.1677C39.9885 12.2699 39.9005 12.3584 39.7986 12.4285L31.5688 18.0922C31.1139 18.4054 30.4912 18.2904 30.1781 17.8354C30.0633 17.6686 30.0019 17.4709 30.0019 17.2685V13.6105H16C12.6863 13.6105 10 16.3075 10 19.6345V25.6585H6V19.6345C6 14.0895 10.4772 9.59443 16 9.59443H30.0019V6C30.0019 5.44772 30.4496 5 31.0019 5Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_20731_14784">\n<rect width="48" height="48" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}var t7=function(e){u(n,e);var t=v(n);function n(){return a(this,n),t.apply(this,arguments)}return l(n,[{key:"afterCreate",value:function(){var e,t,i,r=this;if(m(h(n.prototype),"afterCreate",this).call(this),this.player.plugins.music&&!this.config.disable){this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.on(k1.MUSIC_MODE_CHANGE,(function(e){r.animate(e)}));var o=null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(i=t.config)||void 0===i?void 0:i.mode;this.animate(o),this.updateVisible(),this.on(k1.MUSIC_LIST_CHANGE,this.updateVisible.bind(this))}}},{key:"updateVisible",value:function(){var e,t,n;(null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(n=t.list)||void 0===n?void 0:n.length)>1?this.show():this.hide()}},{key:"registerIcons",value:function(){return{order:{icon:J6,class:"xg-icon-order"},loop:{icon:Z6,class:"xg-icon-loop"},sloop:{icon:e7,class:"xg-icon-sloop"},random:{icon:Q6,class:"xg-icon-random"}}}},{key:"registerLanguageTexts",value:function(){return{order:{jp:"順番に遊ぶ",en:"Play in order",zh:"顺序播放","zh-hk":"順序播放"},loop:{jp:"リストループ",en:"List loop",zh:"列表循环","zh-hk":"列表循環"},sloop:{jp:"シングルサイクル",en:"Single loop",zh:"单曲循环","zh-hk":"單曲循環"},random:{jp:"シャッフル再生",en:"Play in shuffle",zh:"随机播放","zh-hk":"隨機播放"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.order),this.appendChild(".xgplayer-icon",e.sloop),this.appendChild(".xgplayer-icon",e.loop),this.appendChild(".xgplayer-icon",e.random)}},{key:"btnClick",value:function(e){var t,n,i;e.preventDefault(),e.stopPropagation();var r=null===(t=this.player.plugins)||void 0===t||null===(n=t.music)||void 0===n||null===(i=n.config)||void 0===i?void 0:i.mode,o=G6.ModeType.findIndex((function(e){return e===r})),a=0;o+1<G6.ModeType.length&&(a=o+1),this.player.plugins.music.mode=G6.ModeType[a]}},{key:"animate",value:function(e){switch(e){case U6.ORDER:this.setAttr("data-state","order"),this.changeLangTextKey(this.find(".xg-tips"),"order");break;case U6.LOOP:this.setAttr("data-state","loop"),this.changeLangTextKey(this.find(".xg-tips"),"loop");break;case U6.SLOOP:this.setAttr("data-state","sloop"),this.changeLangTextKey(this.find(".xg-tips"),"sloop");break;case U6.RANDOM:this.setAttr("data-state","random"),this.changeLangTextKey(this.find(".xg-tips"),"random");break;default:this.setAttr("data-state","order"),this.changeLangTextKey(this.find(".xg-tips"),"order")}}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-music-mode">\n <div class="xgplayer-icon"></div>\n <div class="xg-tips" lang-key="musicMode">'.concat(this.langText.order,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"MusicMode"}},{key:"defaultConfig",get:function(){return{position:Vj.POSITIONS.CONTROLS_RIGHT,index:9,disable:!1}}}]),n}(Vj);function n7(){return(new DOMParser).parseFromString('<svg width="30" height="30" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20323_25753)">\n<g filter="url(#filter0_d_20323_25753)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M25 0C38.8071 0 50 11.1929 50 25C50 38.8071 38.8071 50 25 50C11.1929 50 0 38.8071 0 25C0 11.1929 11.1929 0 25 0Z" fill="#1664FF"/>\n</g>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M19.3863 11.7091L37.5681 23.0728C38.9924 23.9629 38.9924 26.0372 37.5681 26.9273L19.3863 38.2909C17.8726 39.237 15.9091 38.1488 15.9091 36.3637V13.6364C15.9091 11.8513 17.8726 10.763 19.3863 11.7091Z" fill="white"/>\n</g>\n<defs>\n<filter id="filter0_d_20323_25753" x="-8" y="-6" width="66" height="66" 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"/>\n<feGaussianBlur stdDeviation="4"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_20323_25753"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_20323_25753" result="shape"/>\n</filter>\n<clipPath id="clip0_20323_25753">\n<rect width="50" height="50" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}function i7(){return(new DOMParser).parseFromString('<svg width="30" height="30" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20330_26170)">\n<g filter="url(#filter0_d_20330_26170)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M25 0C38.8071 0 50 11.1929 50 25C50 38.8071 38.8071 50 25 50C11.1929 50 0 38.8071 0 25C0 11.1929 11.1929 0 25 0Z" fill="#1664FF"/>\n</g>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M20.75 11C21.4404 11 22 11.6044 22 12.35V36.65C22 37.3956 21.4404 38 20.75 38H18.25C17.5596 38 17 37.3956 17 36.65V12.35C17 11.6044 17.5596 11 18.25 11H20.75Z" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M31.75 11C32.4404 11 33 11.6044 33 12.35V36.65C33 37.3956 32.4404 38 31.75 38H29.25C28.5596 38 28 37.3956 28 36.65V12.35C28 11.6044 28.5596 11 29.25 11H31.75Z" fill="white"/>\n</g>\n<defs>\n<filter id="filter0_d_20330_26170" x="-8" y="-6" width="66" height="66" 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"/>\n<feGaussianBlur stdDeviation="4"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_20330_26170"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_20330_26170" result="shape"/>\n</filter>\n<clipPath id="clip0_20330_26170">\n<rect width="50" height="50" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}var r7=l((function e(n,i){a(this,e),function(e){if("Object"!==cN.typeOf(e.controls))e.controls={mode:"flex",initShow:!0};else{var n=e.controls;e.controls=t({mode:"flex",initShow:!0},n)}var i=e.play||{};e.play=t({index:3},i),e.marginControls=!0,e.icons=t({play:n7,pause:i7},e.icons||{})}(i);var r="mobile"===vN.device;this.plugins=[G6,X6,V6].concat(b(r?[]:[W6,K6,Y6,$6,t7])),this.ignores=["start","cssFullScreen","fullscreen","pip","enter","replay","pc","loading","poster","error","playbackrate","mobile"]}));window&&!window.Player&&(window.Player=vY);var o7=function(){function e(t){a(this,e),this.player=null,this.mountingDom=null,this.playerContainer=null,this.mobilePanel=null,this._isFirstCreated=!0,this.sdkPlugins=[],this._sdkPlugins={},this.delayError=[],this.isFirstEmitted=!0,this._init(t)}var r,s,h,d,f,p;return l(e,[{key:"_init",value:function(e){this.initUmdLoader(e),this.playerData=new lX(e),this._emitter=new BM,this.on(b1.TOKEN_EXPIRED,this.onTokenExpiredAction.bind(this)),this._initSdkPlugins(),this.renderDom(),this.createPlayer(),this._initI18N(this.playerData.languageData)}},{key:"_initSdkPlugins",value:function(){var e=this;N6.init(this),b(this.sdkPlugins).map((function(t){return N6.registerPlugin(t,e)}))}},{key:"initCheckExpire",value:function(){var e=this;this.checkExpireTimer=new X$,this.checkExpireTimer.repeat((function(){e.onRepeat()}),this.playerData.checkExpireInterval)}},{key:"initUmdLoader",value:function(e){var t=this;this.sdkUmdLoader=e6,this.sdkUmdLoader.failCallback=function(e,n){return t.umdLoadErr(e,n)},e.umdUrlMap&&"object"===i(e.umdUrlMap)&&this.sdkUmdLoader.updateBackupMap(e.umdUrlMap)}},{key:"umdLoadErr",value:function(e,t){this.emit(b1.UMD_LOAD_FAIL,{name:e,error:t})}},{key:"onRepeat",value:function(){var e,t=this,n=this.playerData.expireDetectType;n.indexOf("getUrlTime")>-1&&(this.getUrlTime&&null!==(e=this.player)&&void 0!==e&&e.duration&&(new Date).getTime()/1e3>this.getUrlTime+3300+this.player.duration+500&&(this.getUrlTime=0,this.emitExpireEvent()));n.indexOf("xhrStatus")>-1&&this._playOriginalUrl&&Math.random()<1/7.5&&new J$({url:this._playOriginalUrl,method:"HEAD"}).catch((function(e){e&&void 0!==e.status&&(t.isFirstEmitted?(t.emitExpireEvent(),t.isFirstEmitted=!1):(t.expireCount=void 0===t.expireCount?1:t.expireCount+1,t.expireCount>3&&(t.expireCount=0,t.emitExpireEvent())))}))}},{key:"emitExpireEvent",value:function(){var e=this.player,t=(new Date).getTime()/1e3;e.emitExpireTimestamp?t-e.emitExpireTimestamp>300&&(e.emitExpireTimestamp=t,e.emit("MEDIA_EXPIRED")):(e.emitExpireTimestamp=t,e.emit("MEDIA_EXPIRED"))}},{key:"getUrlTimestamp",value:function(e){if(e){var t;e.startsWith("//")&&(e=location.protocol+e);try{var n,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=k(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(new URL(e).searchParams);try{for(i.s();!(n=i.n()).done;){var r=_(n.value,2),o=r[0],a=r[1];if("auth_key"===o||"sign"===o){var s=parseInt(a.split("-")[0]);if(!isNaN(s)){t=s;break}}}}catch(h){i.e(h)}finally{i.f()}}catch(h){console.error(h)}try{var l,c=null===(l=new URL(e).pathname.split("/"))||void 0===l?void 0:l[2];if(c){var u=parseInt(c,16);isNaN(u)||(t=u)}}catch(h){console.error(h)}this.getUrlTime=t||(new Date).getTime()/1e3}}},{key:"on",value:function(e,t){this._emitter.on(e,t)}},{key:"emit",value:function(e,t){this._emitter.emit(e,t)}},{key:"once",value:function(e,t){this._emitter.once(e,t)}},{key:"off",value:function(e,t){this._emitter.off(e,t)}},{key:"renderDom",value:function(){var e=this.playerData,t=e.id,n=e.root,i=document.createElement("div");this.playerContainer=i;var r=n||document.querySelector("#".concat(t));r&&(r.appendChild(i),this.mountingDom=r)}},{key:"renderPoster",value:function(){if(this.playerContainer){var e=this.playerData.options,t=e.poster,n=void 0===t?"":t,i=e.width,r=e.height;n&&(this.playerContainer.style.cssText='background: url("'.concat(n,'");\n background-size: cover;\n width:').concat(i?i+"px":"100%",";\n height:").concat(r?r+"px":"100%",";\n "))}}},{key:"createPlayer",value:(p=o(n().mark((function e(){var i,r,a,s,l,c,u,h,d,f,p,g,v,y,m,_,k,w,E,T,S,C,x,O,P,I,L,D,A,M,R,N,j,B=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._destroyPlayer();case 2:return e.next=4,this.beforePlayerCreate();case 4:return c=this.playerData,u=c.isLive,h=c.options,d=c.plugins,f=c.isMobile,p=c.openSoftDecoding,g=c.configs,v=c.isMusic,y=this.playerData.getCurrentUrl(),m=this.playerData.getCurrentStreamType()||V$(null==g?void 0:g.getVideoByToken),Q$(g,"EncryptHlsPlugin")||y&&m||v?(this._playOriginalUrl=y,this.getUrlTimestamp(y)):(console.warn("url is empty or streamType is empty: url:".concat(y,", streamType").concat(m)),this.renderPoster()),_={defaultDefinition:null===(i=this.playerData.playList[0])||void 0===i?void 0:i.definition,list:this.playerData.playList},k=function(){var e=o(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B.getSoftDecodingOption(p,y,m);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),e.next=13,t6({isLive:u,isMobile:f,type:m,playerData:this.playerData,getSoftOptionTask:k});case 13:return w=e.sent,E=w.presets,T=w.softDecodingOption,S=w.plugins,C=f?w6(u):y6(u),x=this._analyzeExtendPlugins(),O=x.basicPlugins,P=void 0===O?[]:O,I=x.iconPlugins,L=void 0===I?[]:I,D=this.playerData.getLineList(),A=this.playerData.current.lineId,M=this.playerData.getDefinitionListByLineId(A),R=t(t(t(t({},C),h),T||{}),{},{definition:_,icons:t(t(t({},C.icons),v?{play:n7,pause:i7}:{}),null!==(r=null==h?void 0:h.icons)&&void 0!==r?r:{}),MoreButtonPlugin:{iconPlugins:[].concat(b(null!==(a=null===(s=h.MoreButtonPlugin)||void 0===s?void 0:s.iconPlugins)&&void 0!==a?a:[]),b(L),[A6])},playerData:this.playerData}),D.length>1&&R.MoreButtonPlugin.iconPlugins.push(I6),M.length>1&&R.MoreButtonPlugin.iconPlugins.push(x6),this.setDefaultConfigOptions(R),N=[].concat(b(P),b(d),b(S)),R.ignores=[].concat(b(null!==(l=null==R?void 0:R.ignores)&&void 0!==l?l:[]),b(v?["sdkErrorPlugin","sdkToastPlugin","MoreButtonPlugin","DanmuPlugin"]:[])),this._isFirstCreated?this._isFirstCreated=!1:(R.autoplayMuted=!1,R.ignores=[].concat(b(null!==(j=null==R?void 0:R.ignores)&&void 0!==j?j:[]),["sdkUnmutePlugin"])),this.setPluginConfig(R),this.player=new vY(t(t(v?{el:this.playerContainer,controls:{mode:"flex",initShow:!0},marginControls:!0,presets:[].concat(b(E),[r7]),mediaType:["mp4","hls"].includes(m)?"video":"audio",url:y}:{el:this.playerContainer,presets:E,url:y,isLive:u},R),{},{plugins:b(N)})),this.player.playerData=this.playerData,this._emitter.emit(b1.PLAYER_CREATED_FINISH),this.afterPlayerCreate(),e.abrupt("return",this.player);case 35:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"setPluginConfig",value:function(e){var n,i=this.playerData,r=i.apiMap,o=i.configs,a=i.unionInfo,s=i.playList,l=this.playerData.getCurrentStreamType()||V$(null==o?void 0:o.getVideoByToken),c=Q$(o,"EncryptHlsPlugin"),u=Q$(o,"Mp4EncryptPlayer"),h=Q$(o,"DASHPlugin"),d=Q$(o,"vodLogOpts"),f=!(null==s||null===(n=s[0])||void 0===n||!n.kid)||!!c;c&&(e.EncryptHlsPlugin=t({playDomain:r.playDomain,getKeyType:"TOP"},c)),u&&(e.Mp4EncryptPlayer=t({playDomain:r.playDomain,getKeyType:"TOP"},u)),h&&(e.DASHPlugin=t({playDomain:r.playDomain,getKeyType:"TOP"},h)),o.privateDrmAuthToken&&o.kid&&a&&("hls"===l?e.EncryptHlsPlugin=t({kid:o.kid,drmKeyToken:o.privateDrmAuthToken,playDomain:r.playDomain},c||{}):"dash"===l?e.DASHPlugin=t({kid:o.kid,drmKeyToken:o.privateDrmAuthToken,playDomain:r.playDomain},h||{}):"mp4"===l&&(e.Mp4EncryptPlayer=t({kid:o.kid,drmKeyToken:o.privateDrmAuthToken,playDomain:r.playDomain},u||{}))),d&&(e.vodLogOpts=t({vtype:(l||"mp4").toUpperCase(),drm_type:f?1:0,playerVersion:"1.6.0-alpha.2",channel:{}.VITE_LOG_CHANNEL},d))}},{key:"detectCodec",value:(f=o(n().mark((function e(t){var i,r,o,a,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,e6.loadPlugins("streamprobe");case 3:if(e.t0=e.sent,e.t0){e.next=6;break}e.t0={};case 6:if(i=e.t0,!(r=i.LoadProbe)){e.next=14;break}return e.next=11,null===(o=new r)||void 0===o?void 0:o.parseUrl(t);case 11:a=e.sent,"bytevc1"===(s=(a||{}).codec)?this.playerData.codec=TI.H265:"avc"===s&&(this.playerData.codec=TI.H264);case 14:e.next=19;break;case 16:e.prev=16,e.t1=e.catch(0),console.warn("detect codec error: ",e.t1);case 19:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e){return f.apply(this,arguments)})},{key:"setDefaultConfigOptions",value:function(e){if(this._isFirstCreated){var n=this.playerData,i=n.defaultConfig,r=n.isHitDefault;if(i){var o=null!=i?i:{},a=o.volume,s=o.startTime,l=o.DanmuPlugin,c=o.LiveSubtitlesIconPlugin;if(a&&(e.volume=e.volume?t(t({},e.volume),{},{default:a}):a),r){var u,h;if(s&&(e.startTime=s),l)e.DanmuPlugin=t(t({},null!==(u=e.DanmuPlugin)&&void 0!==u?u:{}),l);if(c)e.LiveSubtitlesIconPlugin=t(t({},null!==(h=e.LiveSubtitlesIconPlugin)&&void 0!==h?h:{}),c)}}}}},{key:"getCurrentPlayerConfig",value:function(){var e,n,i=this.playerData,r=i.isLive,o=i.current,a=o.lineId,s={type:r?"live":"vod",isLive:r,definition:o.definition,lineId:a,volume:null!==(e=this.player.volume)&&void 0!==e?e:.6};r||(s.startTime=null!==(n=this.player.currentTime)&&void 0!==n?n:0);return t({},s)}},{key:"_analyzeExtendPlugins",value:function(){var e,t=this.playerData.options,n=t.extendPlugin||[],i=null!==(e=null==t?void 0:t.ignore)&&void 0!==e?e:[],r=[],o=[];return n.forEach((function(e){var t=function(e){var t="mobile"===vN.device,n=e.pluginName,i=void 0===n?"ExtendPlugin".concat(Math.random().toString().slice(-5)):n,r=e.type,o=void 0===r?t?"inner":"normal":r,s=e.position,h=void 0===s?E6.CONTROLS_LEFT:s,d=e.icon,f=void 0===d?J1:d,p=e.index,g=void 0===p?1:p,y=e.hideAtFullScreen,m=void 0===y||y,_=e.tips,b=void 0===_?{jp:"custom",en:"custom",zh:"自定义","zh-hk":"自定义"}:_;return function(e){u(n,e);var t=v(n);function n(){return a(this,n),t.apply(this,arguments)}return l(n,[{key:"afterCreate",value:function(){var e;this.appendChild(".xgplayer-icon",this.icons[i]),this.initEvents(),m&&null!==(e=this.player)&&void 0!==e&&e.fullscreen&&this.handleFullScreenChange()}},{key:"registerIcons",value:function(){return c({},i,{icon:f,class:"xgplayer-extendicon-svg"})}},{key:"updateIcons",value:function(e){var t=this.find(".xgplayer-icon");t&&(t.innerHTML=e)}},{key:"registerLanguageTexts",value:function(){return c({},i,b)}},{key:"initEvents",value:function(){this.handleCallback=V1(this.handleCallback.bind(this),200);var e,t="mobile"===vN.device?"touchend":"click";this.bind(t,this.handleCallback),this.show(),m&&(null===(e=this.player)||void 0===e||e.on($N,this.handleFullScreenChange.bind(this)))}},{key:"handleFullScreenChange",value:function(){var e,t=this.player;null===(e=this.player)||void 0===e||e.changePluginsIcon(i,!(null!=t&&t.fullscreen))}},{key:"handleCallback",value:function(e){var t=this.player;t&&(e.preventDefault(),e.stopPropagation(),t.emit(k1.PLAYER_EXTEND_BUTTON,i))}},{key:"destroy",value:function(){var e;this.unbind(["touchend","click"],this.handleCallback),m&&(null===(e=this.player)||void 0===e||e.off($N,this.handleFullScreenChange.bind(this)))}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-extend-icon">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(i,'">').concat(this.langText[i],"</div>\n </xg-icon>\n ")}}],[{key:"isExtendPlugin",get:function(){return!0}},{key:"type",get:function(){return o}},{key:"textTips",get:function(){return b}},{key:"pluginName",get:function(){return i}},{key:"defaultConfig",get:function(){return{position:h,index:g}}}]),n}(Vj)}(e);"inner"!==t.type||i[e.pluginName]?r.push(t):o.push(t)})),{basicPlugins:r,iconPlugins:o}}},{key:"beforePlayerCreate",value:(d=o(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,N6.beforePlayerCreate(this);case 2:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"afterPlayerCreate",value:function(){var e=this.playerData.isMobile;this._mountingPlayerPanel(e),this._mountingExtendMethods(),this._bindSdkEvents(),this._bindPlayerEvents(),this._setPlayerInfo(),N6.afterPlayerCreate(this),this.emitDelayError()}},{key:"emitDelayError",value:function(){var e=this;setTimeout((function(){e.player&&e.delayError.forEach((function(t){var n=new bN(e.player,t);e.player.emit("error",n)})),e.delayError=[]}),0)}},{key:"_setPlayerInfo",value:function(){var e,t;if(this.player){this.player.playerVersion="1.6.0-alpha.2";var n=this.playerData.getCurrentStreamType()||V$(null===(e=this.playerData)||void 0===e||null===(t=e.configs)||void 0===t?void 0:t.getVideoByToken);this.player.playerType||(this.player.playerType=n)}}},{key:"_mountingPlayerPanel",value:function(e){var t,n=this.playerData,i=n.options,r=n.isLive;this.player&&e&&(this.mobilePanel=new T6({config:null!==(t=i.panel)&&void 0!==t?t:{mode:r?P$:O$,isAutoChange:!0},root:this.player.root,player:this.player}),this.player.panel=this.mobilePanel)}},{key:"_bindPlayerEvents",value:function(){this.player&&(this.player.on(b1.PLAYER_REBUILD,this.createPlayer.bind(this)),this.player.on(k1.MEDIA_EXPIRED,this.onMediaExpiredAction.bind(this)),this.player.once(zN,this.emitDelayError.bind(this)))}},{key:"onMediaExpiredAction",value:function(){var e,t,n=this;if(null!==(e=this.playerData)&&void 0!==e&&e.onMediaExpired&&"function"==typeof(null===(t=this.playerData)||void 0===t?void 0:t.onMediaExpired)){var i=Z$(this.playerData.onMediaExpired());null!=i&&i.then&&i.then((function(e){return n.playNext(e)}))}}},{key:"onTokenExpiredAction",value:function(){var e,t,n=this;if(null!==(e=this.playerData)&&void 0!==e&&e.onTokenExpired&&"function"==typeof(null===(t=this.playerData)||void 0===t?void 0:t.onTokenExpired)){var i=Z$(this.playerData.onTokenExpired());null!=i&&i.then&&i.then((function(e){return n.updateAuthToken(e)}))}}},{key:"_bindSdkEvents",value:function(){var e=this;[].concat(b(Object.values(k1)),b(Object.values(b1)),b(Object.values(fj))).forEach((function(t){"string"==typeof t&&e.player.on(t,(function(){for(var n,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];(n=e._emitter).emit.apply(n,[t].concat(r))}))}))}},{key:"_mountingExtendMethods",value:function(){this.player&&(this.player.changePluginsIcon=this.changePluginsIcon.bind(this))}},{key:"_offPlayerEvents",value:function(){this.player&&this.player.off(b1.PLAYER_REBUILD,this.createPlayer.bind(this))}},{key:"changePluginsIcon",value:function(e,t){var n;if(this.player){var i=this.player.getPlugin(e);if(i&&null!=i&&i.root){var r=cN.hasClass(null==i?void 0:i.parent,"panel-icon-svg")?null==i||null===(n=i.parent)||void 0===n?void 0:n.parentNode:null==i?void 0:i.root;r&&(t?cN.show(r,"block"):cN.hide(r))}}}},{key:"getSdkPlugin",value:function(e){var t=this._sdkPlugins[e.toLowerCase()];return t&&t.pluginName?t:null}},{key:"switchAuthToken",value:function(e){var n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=i?0:this.player.currentTime,o=this.getSdkPlugin("AuthToken"),a=this.player.paused&&!this.player.isError,s=this.player.state,l=this.player.getPlugin("sdkDefinitionPlugin");return l&&(l.canChange=!1),new Promise((function(i,c){o?o.switchAuthToken(e).then((function(){var e,o=n.playerData.getCurrentUrl();n._playOriginalUrl=o;var u={defaultDefinition:null===(e=n.playerData.playList[0])||void 0===e?void 0:e.definition,list:n.playerData.playList};if(l&&(l.config=l.getConfig(n.player),l.renderItemList(),l.canChange=!0),n.player){var h=t(t({},n.playerData.options),{},{definition:u,startTime:r,url:o});if(n.player.playNext(h),6===s)n.player.once(IN,(function(){a&&n.player.pause(),i()}));else{var d=h.autoplay||h.autoplayMuted;n.player.once(IN,(function(){d?n.player.play():n.player.pause(),i()}))}}else console.error("no player created"),c()})):(console.error("current is not playAuthToken play"),c())}))}},{key:"updateAuthToken",value:function(e){var n=this,i=this.player.config,r=this.getSdkPlugin("AuthToken");return new Promise((function(o,a){r?r.switchAuthToken(e).then((function(){var e=n.playerData.getCurrentUrl();if(n._playOriginalUrl=e,n.getUrlTimestamp(e),n.player){n.player.resetState(),n.player.setConfig(t(t(t({},i),n.playerData.options),{},{url:e}));var r=n.player.start(e);r&&r.then?r.then((function(){return o()})):o()}else console.error("player not created"),a()})):(console.error("current is not playAuthToken play"),a())}))}},{key:"src",get:function(){var e;return null===(e=this.player)||void 0===e?void 0:e.src},set:function(e){this.player&&(this.player.src=e)}},{key:"switchURL",value:function(e){var t=this;this.resetUrlState(e);var n=this.player.switchURL(e,!1),i=this.player.currentTime;return n&&n.then?n:new Promise((function(e){var n=t.player.paused&&!t.player.isError,r=function(){t.player.currentTime=i,n&&t.player.once(IN,(function(){t.player.pause()})),e()};vN.os.isAndroid?t.once(ON,(function(){r()})):t.once(IN,(function(){r()})),t.player.play()}))}},{key:"next",value:function(e){var n,i=this,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=r?0:this.player.currentTime,a=this.playerData.configs,s=t(t({},a),{},{startTime:o,autoplay:!0},e);return null!=e&&null!==(n=e.getVideoByToken)&&void 0!==n&&n.playAuthToken&&(s.streamType=V$(null==e?void 0:e.getVideoByToken)||"mp4"),this.destroy().then((function(){return i._init(s)})).catch((function(e){console.error("next_error",e)}))}},{key:"playNext",value:function(e){var n,i,r=this,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)return Promise.reject();var a=e.url,s=e.getVideoByToken,l=!(null===(n=this.player)||void 0===n||null===(i=n.plugins)||void 0===i||!i.dashplugin),c=this.player.paused&&!this.player.isError,u=o?0:this.player.currentTime;if(a){this.resetUrlState(a);var h=this.player.config,d=this.player.state,f=t(t({},h),{},{startTime:u},e);return this.setPluginConfig(f),this.player.playNext(f),new Promise((function(e,t){if(r.player.once(SN,(function(e){t(e)})),6===d)r.player.once(jN,(function(){r.player.once(IN,(function(){c&&r.player.pause(),e(void 0)}))}));else{var n=f.autoplay||f.autoplayMuted;r.player.once(jN,(function(){r.player.once(IN,(function(){n?r.player.play():r.player.pause(),e(void 0)}))}))}}))}if(null!=s&&s.playAuthToken){var p,g=this.playerData.getCurrentStreamType()||V$(null===(p=this.playerData.configs)||void 0===p?void 0:p.getVideoByToken),v=e.streamType||V$(null==e?void 0:e.getVideoByToken)||"mp4";return g!==v?this.next(e,o):l?B$.url(null==s?void 0:s.playAuthToken,this.playerData.apiMap.playDomain).then((function(e){var t=Q$(r.player.config,"DASHPlugin");t.dashOpts={Data:e},r.player.plugins.dashplugin.next(r.player.currentTime,"MEDIA_EXPIRED",t,!0)})):this.switchAuthToken(s,o)}return this.next(e,o)}},{key:"resetUrlState",value:function(e){this.playerData.playList=[],this.playerData.initPlayData(t(t({},this.playerData.configs),{},{url:e})),this._playOriginalUrl=e,this.getUrlTimestamp(e)}},{key:"_destroyPlayer",value:(h=o(n().mark((function e(){var t,i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._offPlayerEvents(),e.next=3,null===(t=this.mobilePanel)||void 0===t?void 0:t.destroy();case 3:return e.next=5,null===(i=this.player)||void 0===i?void 0:i.destroy();case 5:this.player=null;case 6:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"getPlayerInstance",value:function(){return this.player}},{key:"getSoftDecodingOption",value:(s=o(n().mark((function e(t,i,r){var o,a,s,l,c,u,h,d,f,p,g,v;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.playerData,s=a.enableH265Degrade,l=a.codec,c=a.configs,u=G$(null==c?void 0:c.getVideoByToken),h=!!(c.enableMp4MSE||Q$(this.playerData.options,"Mp4EncryptPlayer")||"mp4"===r&&(u||null!=c&&null!==(o=c.autoBitrateOpts)&&void 0!==o&&o.isOpenAutoDefi)),!t){e.next=20;break}return e.next=6,e6.loadPlugins("XGVideo");case 6:if(!(null==(d=e.sent)?void 0:d.isSupported())){e.next=14;break}return l&&d.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),e.abrupt("return",{mediaType:h?this.playerData.isCurrentH265()?"xg-video":"video":"xg-video",innerDegrade:1,codecType:null!=l?l:"h264"});case 14:this.emit(b1.NOT_SUPPORT_SOFT_DECODER),f={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0},this.delayError.push(f),console.error("soft decode is not support by current browser");case 18:e.next=46;break;case 20:if(!s||l){e.next=23;break}return e.next=23,this.detectCodec(i);case 23:if(!this.playerData.isCurrentH265()||(n=void 0,y=void 0,m=void 0,n=window.navigator.userAgent.toLocaleLowerCase(),y=/(iphone)/.test(n)||/(ipad)/.test(n),m=/(quark)/.test(n),y&&!m||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"')))){e.next=46;break}if(!s){e.next=42;break}return e.next=27,e6.loadPlugins("XGVideo");case 27:if(!(null==(p=e.sent)?void 0:p.isSupported())){e.next=36;break}return null==p||p.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),this.playerData.openSoftDecoding=!0,e.abrupt("return",{mediaType:h?this.playerData.isCurrentH265()?"xg-video":"video":"xg-video",innerDegrade:1,codecType:this.playerData.codec});case 36:this.emit(b1.NOT_SUPPORT_SOFT_DECODER),g={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0},this.delayError.push(g),console.error("soft decode is not support by current browser");case 40:e.next=46;break;case 42:this.emit(b1.NOT_SUPPORT_HARDWARE_DECODER),v={ext:{},originError:void 0,errorType:"decoder",errorCode:3,errorMessage:"h265 hardware decode is not supported by this browser"},this.delayError.push(v),console.error("h265 hardware decode is not supported by this browser");case 46:return e.abrupt("return",{});case 47:case"end":return e.stop()}var n,y,m}),e,this)}))),function(e,t,n){return s.apply(this,arguments)})},{key:"setH265SoftPlayList",value:function(){if(this.playerData.isCurrentH265()){var e=this.playerData.playList;e.length>1&&(this.playerData.playList=e.filter((function(e){var t;return(null==e||null===(t=e.codec)||void 0===t?void 0:t.toLowerCase())===TI.H265}))),this.playerData.initCurrent(this.playerData.playList[0])}}},{key:"_initI18N",value:function(e){var t=e.extraLangList,n=e.extendLangList;null==t||t.forEach((function(e){eB.use(e)})),n&&eB.extend(n),eB.extend(j6)}},{key:"musicMode",get:function(){var e,t;return null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t?void 0:t.mode},set:function(e){var t;null!==(t=this.player.plugins)&&void 0!==t&&t.music&&(this.player.plugins.music.mode=e)}},{key:"musicTimeScale",get:function(){var e,t;return null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t?void 0:t.timeScale},set:function(e){var t;null!==(t=this.player.plugins)&&void 0!==t&&t.music&&(this.player.plugins.music.timeScale=e)}},{key:"musicList",get:function(){var e,t;return null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t?void 0:t.list},set:function(e){var t,n;null===(t=this.player.plugins)||void 0===t||null===(n=t.music)||void 0===n||n.updateList(e)}},{key:"musicAdd",value:function(e){var t,n,i;null===(t=this.player.plugins)||void 0===t||null===(n=t.music)||void 0===n||null===(i=n.add)||void 0===i||i.call(n,e)}},{key:"musicRandom",value:function(){var e,t,n;return null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(n=t.random)||void 0===n?void 0:n.call(t)}},{key:"musicNext",value:function(){var e,t,n;null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(n=t.next)||void 0===n||n.call(t)}},{key:"musicPrev",value:function(){var e,t,n;null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(n=t.prev)||void 0===n||n.call(t)}},{key:"musicSetIndex",value:function(e){var t,n,i;null===(t=this.player.plugins)||void 0===t||null===(n=t.music)||void 0===n||null===(i=n.setIndex)||void 0===i||i.call(n,e)}},{key:"musicForward",value:function(){var e,t,n;null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(n=t.forward)||void 0===n||n.call(t)}},{key:"musicBackward",value:function(){var e,t,n;null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(n=t.backward)||void 0===n||n.call(t)}},{key:"musicRemove",value:function(e){var t,n,i;null===(t=this.player.plugins)||void 0===t||null===(n=t.music)||void 0===n||null===(i=n.remove)||void 0===i||i.call(n,e)}},{key:"musicSetAbCycle",value:function(e,t,n,i){var r,o,a;null===(r=this.player.plugins)||void 0===r||null===(o=r.music)||void 0===o||null===(a=o.setAbCycle)||void 0===a||a.call(o,e,t,n,i)}},{key:"musicRemoveAbCycle",value:function(){var e,t,n;null===(e=this.player.plugins)||void 0===e||null===(t=e.music)||void 0===t||null===(n=t.removeAbCycle)||void 0===n||n.call(t)}},{key:"destroy",value:(r=o(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._destroyPlayer();case 2:this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null),this.mountingDom&&this.mountingDom.removeChild(this.playerContainer),this._emitter.removeAllListeners(),this._emitter=null,N6.destroy(this);case 7:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}]),e}();o7.isMSESupported=rX,o7.isRTMSupported=_1.isSupported,o7.playerVersion="1.6.0-alpha.2";var a7=function(e){u(i,e);var n=v(i);function i(e){var t;return a(this,i),(t=n.call(this,e)).state={showLang:"",subTitleList:[],rtmpDtsGap:0,dtsBase:0,showingSubtitle:"",currentSub:null},t.clearLineTimer=null,t.showTimer=null,t.state.showLang=e.showLang,t}return l(i,[{key:"beforePlayerInit",value:function(){var e=this;this.on(ON,this.handleVideoTimeupdate.bind(this)),this.on(TN,this.onPause.bind(this)),this.on(kN,this.onPlay.bind(this)),this.on(KN,this.destroy.bind(this)),this.on(qN,this.clearRtmpDtsGap.bind(this)),this.on(ej,this.handleSEIParsed.bind(this)),this.on("core_event",(function(t){"core.sei"===t.eventName&&e.handleSEIParsed(t.sei,t.originPts)}))}},{key:"onPause",value:function(){this.clearSubTitle(!1)}},{key:"onPlay",value:function(){this.clearSubTitle(!0)}},{key:"destroy",value:function(){this.clearSubTitle(!0),this.off(ON,this.handleVideoTimeupdate.bind(this)),this.off(ej,this.handleSEIParsed.bind(this)),this.off(TN,this.onPause.bind(this)),this.off(kN,this.onPlay.bind(this)),this.off(KN,this.destroy.bind(this)),this.off(qN,this.clearRtmpDtsGap.bind(this))}},{key:"clearRtmpDtsGap",value:function(){this.state.rtmpDtsGap=0,this.state.dtsBase=0,this.clearSubTitle(!0)}},{key:"clearSubTitle",value:function(e){if(this.state.subTitleList=[],this.state.showingSubtitle="",this.state.currentSub=null,clearTimeout(this.showTimer),clearTimeout(this.clearLineTimer),e){var t=this.find(".xgplayer-subtitles-inner");t&&this.resetDom(t)}}},{key:"getIsSoft",value:function(){var e;return"LIVE-VIDEO"===(null!==(e=this.player.video)&&void 0!==e?e:{}).tagName}},{key:"handleVideoTimeupdate",value:function(e){var t,n,i=this.player.video.currentTime,r=this.getIsSoft(),o=(null==e||null===(t=e.detail)||void 0===t?void 0:t.pts)/1e3,a=r?o:i;if(this.state.showLang&&a&&this.player.isPlaying){var s=this.findSubTitleByTime(a);s&&s.text!==this.state.showingSubtitle&&null!==(n=s.wordpiece)&&void 0!==n&&n.length&&(this.renderSubtitle(s),this.player.emit(k1.AI_SUBTITLE_MATCH,{subTitle:s,lang:this.state.showLang}),this.state.subTitleList.length>1e3&&(this.state.subTitleList=this.state.subTitleList.filter((function(e){return e.timestamp+e.duration/1e3>=a}))))}}},{key:"renderSubtitle",value:function(e){var t=this,n=this.root,i=this.find(".xgplayer-subtitles-inner"),r=this.find(".xgplayer-subtitles-helper");if(i){this.clearLineTimer&&clearTimeout(this.clearLineTimer),this.showTimer&&(clearTimeout(this.showTimer),this.showSurplus());var o=this.createNewDom(i);this.state.showingSubtitle=e.text,this.state.currentSub={subObj:e,dom:o,index:0};var a=Date.now(),s="",l=0;!function c(){var u,h=e.wordpiece,d=void 0===h?[]:h,f=e.delimiter;if(l===d.length)return s="",t.showTimer=null,void(t.clearLineTimer=setTimeout((function(){t.resetDom(i),t.clearLineTimer=null}),1e3));var p=d[l].duration-(Date.now()-a-d[l].OffsetMs);if(p<0)for(;p<0&&l<d.length-1;)s=s+f+d[l+=1].text,p=d[l].duration-(Date.now()-a-d[l].OffsetMs);else s=s+f+d[l].text;r.textContent=s;var g=null!==(u=null==n?void 0:n.offsetWidth)&&void 0!==u?u:300;r.offsetWidth>g&&(o=t.createNewDom(i),t.state.currentSub.dom=o,s=d[l].text),o.textContent=s,t.showTimer=setTimeout(c,p),l+=1,t.state.currentSub.index=l}()}}},{key:"handleSEIParsed",value:function(e,t){var n,i,r=e.dts;if(5===e.code)try{var o="string"==typeof e.content?e.content:(n=e.content,(i=String.fromCharCode.apply(null,n)).slice(i.indexOf("{"),i.lastIndexOf("}")+1)),a=JSON.parse(o).rtmp_dts;if(a&&r){var s=t||r;this.state.rtmpDtsGap=a-s}}catch(xX){}}},{key:"insertSubTitle",value:function(){for(var e,t=this,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];i.forEach((function(e){e.timestamp=t.adjustSubTitleTime(e.timestamp)})),(e=this.state.subTitleList).push.apply(e,i)}},{key:"setCurrentLang",value:function(e){this.state.showLang=e,this.player.emit(k1.AI_SUBTITLE_LANG_CHANGE,e)}},{key:"adjustSubTitleTime",value:function(e){var t,n,i,r,o,a,s,l;if(this.getIsSoft())return(e-this.state.rtmpDtsGap)/1e3;var c=(null===(t=this.player)||void 0===t||null===(n=t.plugins)||void 0===n?void 0:n.flvlive)||(null===(i=this.player)||void 0===i||null===(r=i.plugins)||void 0===r?void 0:r.hlslive);if(c){var u,h,d,f,p,g,v,y=null!==(u=null==c||null===(h=c._context)||void 0===h||null===(d=h.getInstance("COMPATIBILITY"))||void 0===d?void 0:d._videoLargeGap)&&void 0!==u?u:0,m=null==c||null===(f=c._context)||void 0===f?void 0:f.getInstance("MP4_REMUXER"),_=null!==(p=null!==(g=null===(v=m.remuxer)||void 0===v?void 0:v.videoDtsBase)&&void 0!==g?g:null==m?void 0:m.videoDtsBase)&&void 0!==p?p:0;return this.state.dtsBase=_-y,(e+y-_-this.state.rtmpDtsGap)/1e3}var b=(null===(o=this.player)||void 0===o||null===(a=o.plugins)||void 0===a?void 0:a.flv)||(null===(s=this.player)||void 0===s||null===(l=s.plugins)||void 0===l?void 0:l.hls);if(b){var k,w,E,T=null===(k=b.core._bufferService)||void 0===k||null===(w=k._demuxer)||void 0===w||null===(E=w._fixer)||void 0===E?void 0:E._baseDts;return this.state.dtsBase=T,(e-T-this.state.rtmpDtsGap)/1e3}return(e-this.state.rtmpDtsGap)/1e3}},{key:"findSubTitleByTime",value:function(e){var t=this,n=this.state.subTitleList,i=n.findIndex((function(n){var i=t.player,r=n.lang===t.state.showLang,o=((null==i?void 0:i.__curUrl)||i.config.url)===n.url,a=n.timestamp;return a+n.duration/1e3>=e&&a<=e&&o&&r}));if(!(i<0)){var r=n.splice(0,i+1),o=r[r.length-1];return this.splitSubTitle(o)}}},{key:"splitSubTitle",value:function(e){var n="en"===e.lang?" ":"",i=e.text.split(n);if(!e.wordpiece){var r=e.duration/i.length,o=i.map((function(e,t){return{text:e,OffsetMs:r*t,duration:r}}));return t(t({},e),{},{delimiter:n,textArr:i,wordpiece:o})}return t(t({},e),{},{delimiter:n,textArr:i})}},{key:"showSurplus",value:function(){var e,t=this;if(this.state.currentSub){var n=this.state.currentSub,i=n.index,r=n.subObj,o=n.dom,a=null!=r?r:{},s=a.wordpiece,l=a.delimiter;if(!(i>=s.length)){var c=this.find(".xgplayer-subtitles-helper"),u=this.find(".xgplayer-subtitles-inner"),h=this.root,d=null!==(e=null==h?void 0:h.offsetWidth)&&void 0!==e?e:300,f=s.length,p=o.textContent;s.slice(i,f).forEach((function(e){p=p+l+e.text,c.textContent=p,c.offsetWidth>d&&(t.state.currentSub.dom=t.createNewDom(u),p=e.text),t.state.currentSub.dom.textContent=p}))}}}},{key:"createNewDom",value:function(e){if(e){e.children.length>2&&e.firstElementChild&&e.removeChild(e.firstElementChild);var t=document.createElement("span");if(e.appendChild(t),e.children.length>2){var n=e.classList.contains("scroll-1"),i=e.classList.contains("scroll-2");n&&e.classList.replace("scroll-1","scroll-2"),i&&e.classList.replace("scroll-2","scroll-1"),n||i||e.classList.add("scroll-1")}return t}}},{key:"test",value:function(){var e=this,t=this.splitSubTitle({duration:1e4,lang:"zh",text:"你呼吸 已改变 停滞于某段流年 离别的你我 才明白挥霍有期限,逝去的人不曾走远 像 突如其来温暖我的晴天 像 倾盆大雨我躲避的屋檐",timestamp:0,url:"xxx"});this.renderSubtitle(t),setTimeout((function(){e.test()}),1e4)}},{key:"getPlayTime",value:function(){var e=this,t=this.getIsSoft();this.on(ON,(function(n){if(t){var i,r={pts:null==n||null===(i=n.detail)||void 0===i?void 0:i.pts,rtmpDtsGap:e.state.rtmpDtsGap};r.timestamp=r.pts+r.rtmpDtsGap,console.log("直播当前时间戳:",r.timestamp,r)}else{var o={currentTime:1e3*e.player.video.currentTime,dtsBase:e.state.dtsBase,rtmpDtsGap:e.state.rtmpDtsGap};o.timestamp=o.currentTime+o.dtsBase+o.rtmpDtsGap,console.log("直播当前时间戳:",o.timestamp,o)}}))}},{key:"resetDom",value:function(e){e&&(this.state.currentSub=null,e&&(e.innerHTML="",e.classList.remove("scroll-1","scroll-2")))}},{key:"render",value:function(){return'<xg-subtitles class="xgplayer-subtitles"><xg-subtitles-inner class="xgplayer-subtitles-inner"></xg-subtitles-inner><xg-subtitles-helper class="xgplayer-subtitles-helper"></xg-helper></xg-subtitles>'}}],[{key:"pluginName",get:function(){return"LiveSubtitlesPlugin"}},{key:"defaultConfig",get:function(){return{position:Vj.POSITIONS.ROOT,showLang:""}}}]),i}(Vj),s7=Vj.POSITIONS,l7=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).isMobile="mobile"===vN.device,i.isOpenState=!0,i.optionList=null,i.currentLang="",i}return l(n,[{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.aiSubOpen),this.appendChild(".xgplayer-icon",this.icons.aiSubClose),this.renderOptionList(),this.initEvents(),this.currentLang=this.config.default,this.config.defaultOpen?this.open(!0):this.close()}},{key:"afterPlayerInit",value:function(){this.config.defaultOpen&&this.changeSubTitleLang(this.config.default,!0)}},{key:"registerIcons",value:function(){return{aiSubOpen:{icon:h5,class:"xgplayer-aisub-open-svg"},aiSubClose:{icon:d5,class:"xgplayer-aisub-close-svg"}}}},{key:"registerLanguageTexts",value:function(){return{sub:{jp:"AI 字幕",en:"AI Subtitles",zh:"AI 字幕","zh-hk":"AI 字幕"},subOpen:{jp:"字幕をオンにする",en:"Show subtitles",zh:"开启字幕","zh-hk":"開啟字幕"},subClose:{jp:"クローズドキャプション",en:"Hide subtitles",zh:"关闭字幕","zh-hk":"關閉字幕"}}}},{key:"children",value:function(){return{LiveSubTitlesPlugin:{plugin:a7,options:{root:this.player.root,showLang:this.currentLang}}}}},{key:"initEvents",value:function(){this.bind(["click"],this.handleButtonChange.bind(this)),this.bind(["mouseenter"],this.showPanel.bind(this)),this.bind(["mouseleave"],this.hidePanel.bind(this))}},{key:"handleButtonChange",value:function(){(this.close=this.close.bind(this),this.open=this.open.bind(this),this.isMobile)?this.showMobilePanel():(this.isOpenState?this.close:this.open)()}},{key:"showMobilePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player.panel)||void 0===e||e.showPanel(t,this.langText.sub,!0)}},{key:"renderItemList",value:function(){var e=this,t=b(this.config.list),n=cN.createDom("div","",{},"ai-panel-content");return t.push({key:"",showText:this.langText.subClose}),t.forEach((function(t){var i=e.renderItem(t);n.appendChild(i)})),n}},{key:"renderItem",value:function(e){var t=this,n=""===e.key&&!this.isOpenState||this.currentLang===e.key&&this.isOpenState,i=cN.createDom("div","",{},"panel-Item ".concat(n?"select-in":""));return i.innerHTML=e.showText,i.addEventListener("click",(function(n){n.stopPropagation(),n.preventDefault(),t.changeSubTitleLang(e.key),t.updatePanel()})),i}},{key:"updatePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player.panel)||void 0===e||e.updatePanel(t)}},{key:"showPanel",value:function(){var e;!this.isMobile&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.show())}},{key:"hidePanel",value:function(){var e;!this.isMobile&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.hide())}},{key:"open",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isOpenState=!0,cN.removeClass(this.root,"isClose"),cN.addClass(this.root,"isOpen"),!e&&this.showPanel(),this.toggleSubTitle()}},{key:"close",value:function(){var e;this.isOpenState=!1,cN.removeClass(this.root,"isOpen"),cN.addClass(this.root,"isClose"),null===(e=this.optionList)||void 0===e||e.hide(),this.toggleSubTitle()}},{key:"renderOptionList",value:function(){var e,t=this;if(!((null===(e=this.config.list)||void 0===e?void 0:e.length)<2||this.isMobile)){var n={config:{data:this.config.list.map((function(e){return e.key===t.config.default&&(e.isCurrent=!0,e.selected=!0),e})),className:"",onItemClick:function(e,n){var i;e.stopPropagation(),e.preventDefault(),t.changeSubTitleLang(null===(i=n.to)||void 0===i?void 0:i.key)}},root:this.root};this.optionList=new Rq(n)}}},{key:"changeSubTitleLang",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.currentLang=e,e?this.open(t):this.close()}},{key:"toggleSubTitle",value:function(){var e;null===(e=this.player.getPlugin("LiveSubtitlesPlugin"))||void 0===e||e.setCurrentLang(this.isOpenState?this.currentLang:"")}},{key:"destroy",value:function(){var e;this.unbind(["click"],this.handleButtonChange.bind(this)),this.unbind(["mouseenter"],this.showPanel.bind(this)),this.unbind(["mouseleave"],this.hidePanel.bind(this)),null===(e=this.optionList)||void 0===e||e.destroy()}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-aisub">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="subOpen">'.concat(this.langText.subOpen,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"LiveSubtitlesIconPlugin"}},{key:"defaultConfig",get:function(){return{position:s7.CONTROLS_RIGHT,index:2.7,defaultOpen:!0,default:"en",list:[{key:"zh",showText:"中文"},{key:"en",showText:"En"}]}}}]),n}(Vj),c7=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).waitings=[],i.longWaitingEmitTime=0,i.waitingStartTime=0,i.playerData=null,i.isNeedShowTips=!0,i.playerData=i.playerConfig.playerData,i}return l(n,[{key:"registerLanguageTexts",value:function(){return{definition_demote_txt:{jp:"現在のネットワークは不安定です。に切り替えることをお勧めします",en:"The current network is unstable, it is recommended to switch to ",zh:"当前网络不稳定,建议切换到","zh-hk":"當前網絡不穩定,建議切換到"}}}},{key:"afterCreate",value:function(){this.bindCtx(),this.bindEvents()}},{key:"bindCtx",value:function(){this._count=this._count.bind(this),this._time=this._time.bind(this),this._waiting=this._waiting.bind(this),this._clearTime=this._clearTime.bind(this)}},{key:"bindEvents",value:function(){var e=this;this.on(PN,this._waiting),this.on(wN,this._clearTime),this.on(TN,this._clearTime),this.on(ON,this._clearTime),this.on(kN,this._clearTime),this.on(IN,(function(){e.isNeedShowTips=!0})),this.config.isNeedAutoDemote&&this.player.on(k1.LONG_WAITING,this.demote.bind(this))}},{key:"_waiting",value:function(){this._count(),this._time()}},{key:"_count",value:function(){var e=Date.now();if(this.waitings.push(e),this.waitings.length===this.config.oftenWaitingCount){var t=this.waitings.shift();t&&e-t<=this.config.oftenWaitingTime&&(this.player.emit(k1.OFTEN_WAITING),this.clearState())}}},{key:"_time",value:function(){var e=this;if(this.timer)console.log("连续触发了waiting,距离上次waiting时间:",Date.now()-this.waitingStartTime);else{this.waitingStartTime=Date.now();var t=this.player.currentTime;this.timer=setTimeout((function(){e.player&&e.player.currentTime<=t+.1&&(console.log("waiting持续时间超过 ".concat(e.config.longWaitingTime," 秒")),e.player.emit(k1.LONG_WAITING),e.clearState())}),this.config.longWaitingTime)}}},{key:"_clearTime",value:function(){this.waitingStartTime&&console.log("waiting持续时长:",Date.now()-this.waitingStartTime),this.clearState()}},{key:"clearState",value:function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.waitings.length>0&&(this.waitings=[]),this.waitingStartTime&&(this.waitingStartTime=0)}},{key:"demote",value:function(){if(this.playerData){var e=this.playerData.getNextDefinition(!0,this.config.demotePriority),t=null==e?void 0:e[0];if(t){var n=t.definition;if(n){var i=this.playerData.current.definition;if(this.player.emit(k1.DEFINITION_DEMOTE,{currentDef:i,willChangeDef:n,next:t}),"auto"===i){var r=t.url;this.changeUrl(r)}else n!==i&&this.showToast(t)}}}}},{key:"changeUrl",value:function(e){this.player&&e&&(this.player.config.url=e,this.player.switchURL(e,!1),this.player.emit(k1.PlAY_URL_CHANGE,{url:e,from:"definition_demote"}))}},{key:"showToast",value:function(e){var t,n=this,i=null===(t=this.player)||void 0===t?void 0:t.getPlugin("sdkToastPlugin");if(i&&this.isNeedShowTips){var r=this.i18n[e.definitionTextKey]||e.definitionTextKey||e.definition,o=cN.createDom("div",this.langText.definition_demote_txt,void 0,"toast-txt"),a=cN.createDom("span",r,void 0,"toast-txt-bt");o.appendChild(a);var s=i.add(o,5e3,!0);a.addEventListener("click",(function(){n.playerData&&(n.playerData.current.definition=e.definition,i.remove(s))})),this.isNeedShowTips=!1,setTimeout((function(){n.isNeedShowTips=!0}),3e4)}}},{key:"destroy",value:function(){this.clearState()}}],[{key:"pluginName",get:function(){return"DefinitionDemotePlugin"}},{key:"defaultConfig",get:function(){return{oftenWaitingCount:3,oftenWaitingTime:5e3,longWaitingTime:5e3,isNeedAutoDemote:!1,demotePriority:[]}}}]),n}(Vj),u7=Vj.POSITIONS,h7=604800,d7=function(e){u(i,e);var n=v(i);function i(){var e;return a(this,i),(e=n.apply(this,arguments)).isMobile="mobile"===vN.device,e.playedBar=null,e.cachedBar=null,e.innerBar=null,e.progressBtn=null,e.progressPoint=null,e.backLiveBt=null,e.cardDomList=[],e.initTime=0,e.liveGap=0,e.shiftTimeGap=0,e.isProgressMoving=!1,e.isPlayTimeShift=!1,e.liveUrl="",e.onBodyClick=function(e){e.preventDefault(),e.stopPropagation(),cN.event(e)},e}return l(i,[{key:"duration",get:function(){var e,t=this.liveGap+Math.floor(Date.now()/1e3-this.initTime),n=(null!==(e=this.config)&&void 0!==e?e:{}).maxMoveTime;return n&&t>n?n:t>h7?h7:t}},{key:"registerLanguageTexts",value:function(){return{BACKLIVE:{jp:"ライブに戻る",en:"Back to live",zh:"返回直播","zh-hk":"返回直播"}}}},{key:"updateLang",value:function(){this.backLiveBt&&(this.backLiveBt.innerHTML=this.langText.BACKLIVE)}},{key:"afterCreate",value:function(){this.liveUrl=this.player.config.url,this.playedBar=this.find(".xgplayer-progress-played"),this.cachedBar=this.find(".xgplayer-progress-cache"),this.progressBtn=this.find(".xgplayer-progress-btn"),this.progressPoint=this.find(".xgplayer-shift-progress-point"),this.innerBar=this.find(".xgplayer-progress-inner"),this.createBackLiveBtDom(),this.clacTime(),this.initEvents(),this.bindDomEvents(),this.isMobile||this.createTimeShiftCard()}},{key:"clacTime",value:function(){var e,t=null!==(e=this.config)&&void 0!==e?e:{},n=t.livingStartTime,i=t.currentTime;this.initTime=Math.floor(Date.now()/1e3),this.liveGap=Math.floor(i-n)}},{key:"initEvents",value:function(){this.on(ON,this.handleTimeUpdate.bind(this))}},{key:"bindDomEvents",value:function(){if(this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.tipsUpdate=this.tipsUpdate.bind(this),this.isMobile){this.bind("touchstart",this.handleMouseDown);var e=this.player.controls;e&&(e.root&&e.root.addEventListener("touchmove",cN.stopPropagation),e.center&&e.center.addEventListener("touchend",cN.stopPropagation))}else this.bind("mousedown",this.handleMouseDown),this.bind("mouseenter",this.handleMouseEnter)}},{key:"handleTimeUpdate",value:function(){this.isProgressMoving||this.progressUpdate()}},{key:"handleMouseDown",value:function(e){if(e.target!==this.backLiveBt){this.onBodyClick(e),this.focus(),cN.addClass(this.progressBtn,"active");var t=this.computeTime(e);this.updateShiftTime(t.percent),this.isProgressMoving=!0,this.isMobile?(this.bind("touchmove",this.handleMouseMove),this.bind("touchend",this.handleMouseUp)):(document.addEventListener("mousemove",this.handleMouseMove,!1),document.addEventListener("mouseup",this.handleMouseUp,!1))}}},{key:"handleMouseMove",value:function(e){this.onBodyClick(e);var t=this.computeTime(e);this.updateShiftTime(t.percent)}},{key:"handleMouseUp",value:function(e){this.onBodyClick(e),this.isProgressMoving=!1,cN.removeClass(this.progressBtn,"active"),this.changeTimeUrl(),this.isMobile?(this.unbind("touchmove",this.handleMouseMove),this.unbind("touchend",this.handleMouseUp)):(document.removeEventListener("mousemove",this.handleMouseMove,!1),document.removeEventListener("mouseup",this.handleMouseUp,!1))}},{key:"handleMouseEnter",value:function(e){this.bind("mouseleave",this.handleMouseLeave),this.bind("mousemove",this.tipsUpdate),this.tipsUpdate(e),this.focus()}},{key:"handleMouseLeave",value:function(){this.unbind("mouseleave",this.handleMouseLeave),this.unbind("mousemove",this.tipsUpdate),this.blur()}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),cN.addClass(this.root,"active")}},{key:"blur",value:function(){this.player.controls.recoverAutoHide(),cN.removeClass(this.root,"active")}},{key:"computeTime",value:function(e){var t,n,i,r=this.player,o=this.root.getBoundingClientRect(),a=o.width,s=o.height,l=o.top,c=o.left,u=cN.getEventPos(e,r.zoom);90===r.rotateDeg?(t=s,n=l,i=u.clientY):(t=a,n=c,i=u.clientX);var h=i-n,d=(h=h>t?t:h<0?0:h)/t;return{percent:d=d<0?0:d>1?1:d,offset:h,width:t,left:n,e:e}}},{key:"tipsUpdate",value:function(e){var t,n,i,r,o,a=this.computeTime(e),s=Math.floor(this.duration*(1-a.percent));this.progressPoint.style.left="".concat(100*a.percent,"%"),this.progressPoint.innerHTML="-".concat((t=s,n=Math.floor(t/3600),i=t%3600,r=Math.floor(i/60),o=Math.round(i%60),n>0?(r<10&&(r="0"+r),o<10&&(o="0"+o),"".concat(n,":").concat(r,":").concat(o)):(o<10&&(o="0"+o),"".concat(r,":").concat(o))))}},{key:"updateShiftTime",value:function(e){this.shiftTimeGap=Math.floor(this.duration*(1-e)),this.progressUpdate()}},{key:"getCurrentProgress",value:function(){return Math.floor(this.duration-this.shiftTimeGap)}},{key:"progressUpdate",value:function(){var e=this.getCurrentProgress()/this.duration;this.progressBtn.style.left="".concat(100*e,"%"),this.playedBar.style.width="".concat(100*e,"%"),this.cardProcessUpdate()}},{key:"changeTimeShift",value:function(e){var t=this.calcCardProcess(e);t<0||(this.updateShiftTime(t),this.changeTimeUrl())}},{key:"changeTimeUrl",value:function(){var e=this.config.timeShiftUrl,t="";this.isPlayTimeShift=!0,this.toggleBackButton();var n=this.shiftTimeGap<6?6:this.shiftTimeGap;t=e?e.replace("{}",n):function(e,t){if(!t)return e;var n=Object.entries(t).map((function(e){var t=_(e,2),n=t[0],i=t[1];return"".concat(n,"=").concat(null!=i?i:"")})).join("&");return e+(-1===e.indexOf("?")?"?":"&")+n}(this.liveUrl,{timeshift:n}),this.player.src=t,this.player.config.url=t,this.player.emit(k1.TIME_SHIFT_CHANGE,!0),this.player.emit(k1.PlAY_URL_CHANGE,{shiftUrl:t,from:k1.TIME_SHIFT_CHANGE})}},{key:"createBackLiveBtDom",value:function(){var e,t=this;if(this.backLiveBt)return this.backLiveBt;this.backLiveBt=cN.createDom("xg-back-live-bt",this.langText.BACKLIVE,void 0,"xgplayer-back-live-bt"),this.backLiveBt.addEventListener("click",(function(e){t.onBodyClick(e),t.backLive()})),null===(e=this.player.root)||void 0===e||e.appendChild(this.backLiveBt)}},{key:"backLive",value:function(){this.liveUrl&&(this.player.src=this.liveUrl,this.player.config.url=this.liveUrl,this.shiftTimeGap=0,this.isPlayTimeShift=!1,this.toggleBackButton(),this.player.emit(k1.TIME_SHIFT_CHANGE,!1),this.player.emit(k1.PlAY_URL_CHANGE,{url:this.liveUrl,from:k1.TIME_SHIFT_CHANGE}))}},{key:"toggleBackButton",value:function(){this.backLiveBt&&(this.backLiveBt.style.display=this.isPlayTimeShift?"flex":"none")}},{key:"updateCardList",value:function(e){this.config.cardList=b(e),this.clearCardDom(),this.createTimeShiftCard()}},{key:"clearCardDom",value:function(){var e=this;this.cardDomList.forEach((function(t){t.dom&&e.innerBar.contains(t.dom)&&e.innerBar.removeChild(t.dom)})),this.cardDomList=[]}},{key:"createTimeShiftCard",value:function(){var e,t=this;(null===(e=this.config.cardList)||void 0===e?void 0:e.length)<=0||this.config.cardList.forEach((function(e){t.renderCard(e)}))}},{key:"renderCard",value:function(e){if(e.img){var n=cN.createDom("xg-card","",void 0,"xgplayer-shift-progress-card"),i=cN.createDom("img","",{src:e.img},"xgplayer-shift-progress-card-img"),r=cN.createDom("div","",void 0,"xgplayer-shift-progress-card-point");n.appendChild(i),n.appendChild(r),this.cardDomList.push(t(t({},e),{},{dom:n}))}}},{key:"cardProcessUpdate",value:function(){var e=this;0!==this.cardDomList.length&&this.cardDomList.forEach((function(t){if(t.dom){var n=e.calcCardProcess(t.timestamp);if(!(n>1)){var i=e.innerBar.contains(t.dom);n<0?i&&e.innerBar.removeChild(t.dom):(i||e.innerBar.appendChild(t.dom),t.dom.style.left="".concat(100*n,"%"))}}}))}},{key:"calcCardProcess",value:function(e){var t,n=null!==(t=this.config)&&void 0!==t?t:{},i=n.maxMoveTime,r=n.livingStartTime,o=this.liveGap+Math.floor(Date.now()/1e3-this.initTime);return i&&o>i&&(r=o-i),e<r?-1:(e-r)/this.duration}},{key:"destroy",value:function(){if(this.off(ON,this.handleTimeUpdate.bind(this)),this.isMobile){this.unbind("touchstart",this.handleMouseDown);var e=this.player.controls;e&&(e.root&&e.root.removerEventListener("touchmove",cN.stopPropagation),e.center&&e.center.removerEventListener("touchend",cN.stopPropagation))}else this.unbind("mousedown",this.handleMouseDown),this.unbind("mouseenter",this.handleMouseEnter);var t;this.backLiveBt&&(null===(t=this.player.root)||void 0===t||t.removeChild(this.backLiveBt),this.backLiveBt=null)}},{key:"render",value:function(){if(this.config.disable)return"";var e=this.player.controls?this.player.controls.config.mode:"";return'\n <xg-progress class="xgplayer-progress '.concat("bottom"===e?"xgplayer-progress-bottom":"",' xgplayer-shift">\n <xg-outer class="xgplayer-progress-outer">\n <xg-inners class="progress-list">\n <xg-inner class="xgplayer-progress-inner" style="flex: 1">\n <xg-cache class="xgplayer-progress-cache" style="width: 100%;"></xg-cache>\n <xg-played class="xgplayer-progress-played" style="width: 100%;"></xg-played>\n </xg-inner>\n </xg-inners>\n <xg-progress-btn class="xgplayer-progress-btn"></xg-progress-btn>\n <xg-point class="xgplayer-shift-progress-point">00:00</xg-point>\n </xg-outer>\n </xg-progress>\n ')}}],[{key:"pluginName",get:function(){return"TimeShiftPlugin"}},{key:"defaultConfig",get:function(){return{position:u7.CONTROLS_CENTER,livingStartTime:Date.now()/1e3,maxMoveTime:0,currentTime:Date.now()/1e3,timeShiftUrl:"",cardList:[]}}}]),i}(Vj);function f7(){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 p7(){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}var g7=Vj.POSITIONS,v7="getMirror",y7="exitMirror",m7=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).isEnableMirror=!0,i.isEnableMirror=i.config.defaultEnable,i}return l(n,[{key:"afterCreate",value:function(){this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.updateMirrorState(this.isEnableMirror))}},{key:"registerIcons",value:function(){var e;return c(e={},v7,{icon:f7,class:"xg-get-mirror"}),c(e,y7,{icon:p7,class:"xg-exit-mirror"}),e}},{key:"initIcons",value:function(){var e=this.icons,t=this.find(".xgplayer-icon");t.appendChild(e[v7]),t.appendChild(e[y7])}},{key:"registerLanguageTexts",value:function(){return{getMirror:{jp:"ミラーを開く",en:"Turn on mirroring",zh:"开启镜像","zh-hk":"開啟鏡像"},exitMirror:{jp:"ミラーを閉じる",en:"Turn off mirroring",zh:"关闭镜像","zh-hk":"關閉鏡像"}}}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation(),this.isEnableMirror?this.action(!1):this.action(!0)}},{key:"action",value:function(e){this.isEnableMirror=e,this.updateMirrorState(this.isEnableMirror),this.player.emit(k1.MIRROR_CHANGE,this.isEnableMirror)}},{key:"updateMirrorState",value:function(e){var t=this.player;e?t.addClass("xgplayer-mirror"):t.removeClass("xgplayer-mirror"),this.animate(e)}},{key:"animate",value:function(e){this.root&&(e?this.setAttr("data-state","enable"):this.setAttr("data-state","normal"),this.switchTips(e))}},{key:"switchTips",value:function(e){this.changeLangTextKey(this.find(".xg-tips"),e?y7:v7)}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){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">'.concat(this.langText[v7],"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"mirrorPlugin"}},{key:"defaultConfig",get:function(){return{position:g7.CONTROLS_RIGHT,index:C1,disable:!1,defaultEnable:!1}}}]),n}(Vj);var _7=function(e){u(n,e);var t=v(n);function n(e){var i;return a(this,n),(i=t.call(this,e)).memoryId="",i.canJump=!1,i.saveTimeFun=cN.checkIsFunction(i.config.saveTime)?i.config.saveTime:i.saveTimeByStorage,i.getTimeFun=cN.checkIsFunction(i.config.getTime)?i.config.getTime:i.getTimeByStorage,i.startTime=0,i.memoryId=i.config.memoryId,i.showToast=i.showToast.bind(p(i)),i}return l(n,[{key:"registerLanguageTexts",value:function(){return{preText:{jp:"に位置付けられました",en:"Has located for you to ",zh:"已为您定位至","zh-hk":"已為您定位至"}}}},{key:"children",value:function(){return{toast:m5}}},{key:"afterCreate",value:function(){this.once(IN,this.showToast)}},{key:"beforePlayerInit",value:function(){return this.memoryId||(this.playerConfig.vid?this.memoryId=this.playerConfig.vid:this.player.url&&(this.memoryId=this.player.url.replace(/\?.*$/,""))),this.setSave(),this.getTime()}},{key:"destroy",value:function(){0!==this.player.currentTime&&this.player.currentTime!==this.player.duration&&this.saveTimeFun(this.memoryId,this.player.currentTime)}},{key:"getTime",value:function(){var e=this;return new Promise((function(t){var n,i=(n=e.getTimeFun(e.memoryId))&&n.then?n:new Promise((function(e){e(n)}));i.then((function(n){var i=parseFloat(n);isNaN(i)||0===i?console.warn("the time got is invalid",n):(e.startTime=i,e.canJump=!0,e.playerConfig.startTime=e.startTime,"mobile"===vN.device&&e.player.once("canplay",(function(){e.player.currentTime=e.startTime}))),t()})).catch((function(e){console.error("getTime function occur error",e),t()}))}))}},{key:"setSave",value:function(){var e=this;document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&0!==e.player.currentTime&&e.player.currentTime!==e.player.duration&&e.saveTimeFun(e.memoryId,e.player.currentTime)})),document.addEventListener("pagehide",(function(){0!==e.player.currentTime&&e.player.currentTime!==e.player.duration&&e.saveTimeFun(e.memoryId,e.player.currentTime)})),window.addEventListener("beforeunload",(function(){0!==e.player.currentTime&&e.player.currentTime!==e.player.duration&&e.saveTimeFun(e.memoryId,e.player.currentTime)}))}},{key:"showToast",value:function(){if(this.canJump){var e,t=null===(e=this.player)||void 0===e?void 0:e.getPlugin("sdkToastPlugin");if(!t)return;var n=cN.format(this.startTime);t.add("".concat(this.langText.preText).concat(n),4e3,!0)}}},{key:"saveTimeByStorage",value:function(e,t){localStorage.setItem(e,t)}},{key:"getTimeByStorage",value:function(e){return localStorage.getItem(e)}}],[{key:"pluginName",get:function(){return"memoryPlay"}},{key:"defaultConfig",get:function(){return{getTime:null,saveTime:null,memoryId:""}}}]),n}(Vj),b7=function(e){u(i,e);var n=v(i);function i(){var e;return a(this,i),(e=n.apply(this,arguments))._infoItems=[],e}return l(i,[{key:"streamType",get:function(){return this.playerConfig.playerData.getCurrentStreamType()}},{key:"afterCreate",value:function(){var e=this;["flv","hls"].includes(this.streamType)?(this.player.on("error",(function(){return e._handleError()})),this.player.on("loadeddata",(function(){return e._handleLoadedData()}))):this.close()}},{key:"registerLanguageTexts",value:function(){return{DECODEFPS:{en:"decodeFps",zh:"解码效率"},DECODECOST:{en:"decodeCost",zh:"解码消耗"},FORMAT:{en:"format",zh:"格式"},FPS:{en:"fps",zh:"帧率"},BITRATE:{en:"birate",zh:"码率"},GOP:{en:"GOP",zh:"GOP"},RESOLUTION:{en:"resolution",zh:"分辨率"},ENCODETYPE:{en:"encodeType",zh:"编码方式"},BUFFEREND:{en:"bufferEnd",zh:"buffer水位"},CURRENTTIME:{en:"currentTime",zh:"播放进度"}}}},{key:"_getDefaultInfo",value:function(e){var n={h265Title:{key:"h265Title",label:"H265解码",type:"title"},decodeEfficiency:{key:"decodeEfficiency",label:"解码效率",labelTextKey:"DECODEFPS",value:e.decodeFps,render:function(e){return e+"frames/s"}},decodeCost:{key:"decodeCost",label:"解码消耗",labelTextKey:"DECODECOST",value:e.decodeFps,render:function(e){return e?(1e3/e).toFixed()+"ms":""}}};return t({format:{key:"format",label:"格式",labelTextKey:"FORMAT",value:e.format},framerate:{key:"framerate",label:"帧率",labelTextKey:"FPS",value:e.fps,render:function(e){return"".concat(e," fps")}},bitrate:{key:"bitrate",label:"码率",labelTextKey:"BITRATE",value:e.bitrate,render:function(e){return"".concat(e/1e3," kbps")}},gop:{key:"gop",label:"GOP",labelTextKey:"GOP",value:e.gop,render:function(e){return"".concat(e," frames")}},resolution:{key:"resolution",label:"视频分辨率",labelTextKey:"RESOLUTION",value:{width:e.width,height:e.height},render:function(e){return"".concat(e.width," * ").concat(e.height)}},encodeType:{key:"encodeType",label:"编码方式",labelTextKey:"ENCODETYPE",value:e.encodeType},bufferEnd:{key:"bufferEnd",label:"buffer水位",labelTextKey:"BUFFEREND",value:e.bufferEnd},currentTime:{key:"currentTime",label:"播放进度",labelTextKey:"CURRENTTIME",value:e.currentTime,render:function(e){return e?e.toFixed(6)+"s":""}}},e.isOpenSoftDecoding&&this.config.showH265Info?n:{})}},{key:"_init",value:function(){var e=this,t=this._initDom(this._getInfoListData());this._infoItems=new Proxy(t,{set:function(t,n,i){return e._updateDom(t[n].dom,i),Reflect.set(t,n,i)}}),this._tick()}},{key:"_getStats",value:function(){var e,t;return"flv"===this.streamType?null===(e=this.player.plugins.flv)||void 0===e?void 0:e.getStats():"hls"===this.streamType?null===(t=this.player.plugins.hls)||void 0===t?void 0:t.getStats():{}}},{key:"_getInfoListData",value:function(){var e=this._getStats()||{};return this._getDefaultInfo(Object.assign(e,{format:"".concat(this.streamType,"_live"),isOpenSoftDecoding:"live-video"==this.playerConfig.mediaType}))}},{key:"_initDom",value:function(e){var t=this,n=this.find(".veplayer-livepanel-container");return n.innerHTML="",Object.values(e).forEach((function(e){var i=cN.createDom("veplayer-livepanel-div","",void 0,"veplayer-livepanel-container-row");"title"===e.type?t._updateTitle(i,e):t._updateDom(i,e),n.appendChild(i),e.dom=i})),e}},{key:"_updateTitle",value:function(e,t){e.innerHTML="";var n=cN.createDom("veplayer-livepanel-span",t.label,void 0,"veplayer-livepanel-container-row-title");e.appendChild(n)}},{key:"_updateDom",value:function(e,t){e.innerHTML="";var n=cN.createDom("veplayer-livepanel-span",this._renderLabel(t),void 0,"veplayer-livepanel-container-row-label");if(e.appendChild(n),"title"!==t.type){var i=cN.createDom("veplayer-livepanel-span",this._renderValue(t));e.appendChild(i)}}},{key:"_renderLabel",value:function(e){return e.labelTextKey&&this.langText[e.labelTextKey]}},{key:"_renderValue",value:function(e){return e.render?e.render(e.value):e.value}},{key:"_handleDataChange",value:function(){var e=this,n=this._getInfoListData();Object.values(this._infoItems).forEach((function(i){"title"!==i.type&&e._renderValue(i)!==e._renderValue(n[i.key])&&(e._infoItems[i.key]=t(t({},i),n[i.key]))}))}},{key:"_tick",value:function(){var e=this;this._pollTimer=setTimeout((function(){clearTimeout(e._pollTimer),e._poll(),e._tick()}),500)}},{key:"_poll",value:function(){this._handleDataChange()}},{key:"destroy",value:function(){clearTimeout(this._pollTimer)}},{key:"_handleError",value:function(){this._close()}},{key:"_handleLoadedData",value:function(){this.config.visible&&this._open()}},{key:"_open",value:function(){var e=this.find(".veplayer-livepanel-container");cN.removeClass(e,"veplayer-livepanel-hidden"),this._init()}},{key:"_close",value:function(){var e=this.find(".veplayer-livepanel-container");cN.addClass(e,"veplayer-livepanel-hidden"),clearTimeout(this._pollTimer)}},{key:"open",value:function(){this._open(),this.config.visible=!0}},{key:"close",value:function(){this._close(),this.config.visible=!1}},{key:"render",value:function(){return'\n <xg-livepanel class="xgplayer-livepanel">\n <xg-livepanel-container class="veplayer-livepanel-container '.concat(!this.config.visible&&"veplayer-livepanel-hidden",'">\n </xg-livepanel-container></xg-livepanel>\n ')}}],[{key:"pluginName",get:function(){return"LiveInfoPanel"}},{key:"defaultConfig",get:function(){return{visible:!0,showH265Info:!1}}}]),i}(Vj),k7=function(e){u(n,e);var t=v(n);function n(){return a(this,n),t.apply(this,arguments)}return l(n)}(o7);return k7.Music=r7,k7.LiveSubtitlesIconPlugin=l7,k7.LiveSubtitlesPlugin=a7,k7.DefinitionDemotePlugin=c7,k7.TimeShiftPlugin=d7,k7.MirrorPlugin=m7,k7.MemoryPlay=_7,k7.Subtitle=y5,k7.Service=B$,k7.LiveInfoPanel=b7,k7.Event=w1,k7.getI18N=function(){return eB},k7.BasePlugin=Dj,k7.Plugin=Vj,k7.Sniffer=vN,k7.Util=cN,k7.STATE_CLASS=qj,k7.I18N=eB,k7.STATES=tB,k7}));
|