xgplayer 3.0.0-next.2 → 3.0.0-next.20
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/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/xgplayer.min.css +1 -1
- package/dist/xgplayer.mobile.min.css +1 -1
- package/es/defaultConfig.d.ts +4 -0
- package/es/defaultConfig.js +7 -1
- package/es/error.js +8 -6
- package/es/events.d.ts +6 -0
- package/es/events.js +7 -1
- package/es/index.css +99 -98
- package/es/index.d.ts +6 -0
- package/es/index.mobile.css +83 -89
- package/es/index.umd.d.ts +4 -2
- package/es/lang/i18n.js +1 -1
- package/es/player.d.ts +96 -33
- package/es/player.js +508 -291
- package/es/plugin/basePlugin.d.ts +8 -3
- package/es/plugin/basePlugin.js +32 -29
- package/es/plugin/plugin.d.ts +2 -2
- package/es/plugin/plugin.js +14 -4
- package/es/plugin/pluginsManager.d.ts +24 -0
- package/es/plugin/pluginsManager.js +73 -17
- package/es/plugins/common/optionList.js +4 -4
- package/es/plugins/common/optionsIcon.js +19 -15
- package/es/plugins/common/thumbnail.d.ts +3 -2
- package/es/plugins/common/thumbnail.js +41 -13
- package/es/plugins/controls/index.css +4 -10
- package/es/plugins/controls/index.d.ts +1 -1
- package/es/plugins/controls/index.js +12 -19
- package/es/plugins/cssFullScreen/index.d.ts +1 -0
- package/es/plugins/cssFullScreen/index.js +9 -5
- package/es/plugins/danmu/index.js +1 -1
- package/es/plugins/definition/index.js +20 -68
- package/es/plugins/dynamicBg/index.css +1 -1
- package/es/plugins/dynamicBg/index.d.ts +1 -1
- package/es/plugins/dynamicBg/index.js +21 -9
- package/es/plugins/error/index.d.ts +1 -1
- package/es/plugins/error/index.js +2 -1
- package/es/plugins/fullscreen/index.css +1 -1
- package/es/plugins/fullscreen/index.d.ts +2 -13
- package/es/plugins/fullscreen/index.js +12 -78
- package/es/plugins/keyboard/index.d.ts +1 -0
- package/es/plugins/keyboard/index.js +77 -31
- package/es/plugins/logger/index.d.ts +13 -9
- package/es/plugins/logger/index.js +143 -31
- package/es/plugins/mobile/index.d.ts +1 -0
- package/es/plugins/mobile/index.js +27 -13
- package/es/plugins/mobile/touch.d.ts +1 -0
- package/es/plugins/mobile/touch.js +9 -6
- package/es/plugins/pc/index.js +8 -13
- package/es/plugins/pip/index.js +6 -2
- package/es/plugins/play/index.js +3 -1
- package/es/plugins/playNext/index.js +11 -3
- package/es/plugins/playbackRate/index.js +9 -4
- package/es/plugins/poster/index.js +2 -2
- package/es/plugins/progress/index.css +1 -0
- package/es/plugins/progress/index.d.ts +12 -1
- package/es/plugins/progress/index.js +147 -67
- package/es/plugins/progressPreview/dotsApi.js +24 -2
- package/es/plugins/progressPreview/index.css +15 -8
- package/es/plugins/progressPreview/index.d.ts +10 -1
- package/es/plugins/progressPreview/index.js +154 -15
- package/es/plugins/prompt/index.css +0 -1
- package/es/plugins/replay/index.js +4 -5
- package/es/plugins/rotate/index.js +1 -2
- package/es/plugins/start/index.css +1 -6
- package/es/plugins/start/index.js +3 -3
- package/es/plugins/stats/index.d.ts +38 -0
- package/es/plugins/stats/index.js +252 -0
- package/es/plugins/time/index.css +0 -1
- package/es/plugins/time/index.d.ts +1 -0
- package/es/plugins/time/index.js +7 -2
- package/es/plugins/track/index.css +4 -58
- package/es/plugins/track/index.d.ts +52 -10
- package/es/plugins/track/index.js +259 -76
- package/es/plugins/volume/index.css +3 -0
- package/es/plugins/volume/index.d.ts +14 -0
- package/es/plugins/volume/index.js +120 -65
- package/es/presets/default-en.d.ts +2 -1
- package/es/presets/default-en.js +2 -1
- package/es/presets/default.d.ts +2 -1
- package/es/presets/default.js +6 -1
- package/es/proxy.d.ts +49 -6
- package/es/proxy.js +264 -90
- package/es/stateClassMap.d.ts +4 -2
- package/es/stateClassMap.js +6 -4
- package/es/style/common.css +73 -70
- package/es/style/index.css +73 -70
- package/es/utils/sniffer.d.ts +5 -0
- package/es/utils/sniffer.js +37 -3
- package/es/utils/util.d.ts +1 -0
- package/es/utils/util.js +26 -3
- package/es/version.js +1 -1
- package/package.json +5 -4
package/dist/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Player=e()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=function(t){return t&&t.Math==Math&&t},n=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||function(){return this}()||Function("return this")(),i={},r=function(t){try{return!!t()}catch(t){return!0}},o=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),s={},a={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,l=c&&!a.call({1:2},1);s.f=l?function(t){var e=c(this,t);return!!e&&e.enumerable}:a;var u,h,f=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},d={}.toString,p=function(t){return d.call(t).slice(8,-1)},g=p,v="".split,y=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==g(t)?v.call(t,""):Object(t)}:Object,m=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},k=y,b=m,w=function(t){return k(b(t))},C=function(t){return"object"==typeof t?null!==t:"function"==typeof t},x=n,_=function(t){return"function"==typeof t?t:void 0},E=function(t,e){return arguments.length<2?_(x[t]):x[t]&&x[t][e]},T=E("navigator","userAgent")||"",S=n,P=T,R=S.process,O=S.Deno,I=R&&R.versions||O&&O.version,L=I&&I.v8;L?h=(u=L.split("."))[0]<4?1:u[0]+u[1]:P&&(!(u=P.match(/Edge\/(\d+)/))||u[1]>=74)&&(u=P.match(/Chrome\/(\d+)/))&&(h=u[1]);var A=h&&+h,D=A,M=r,N=!!Object.getOwnPropertySymbols&&!M((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&D&&D<41})),F=N&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,j=E,B=F?function(t){return"symbol"==typeof t}:function(t){var e=j("Symbol");return"function"==typeof e&&Object(t)instanceof e},H=C,U={exports:{}},V=n,G=function(t,e){try{Object.defineProperty(V,t,{value:e,configurable:!0,writable:!0})}catch(n){V[t]=e}return e},W=G,Y="__core-js_shared__",K=n[Y]||W(Y,{}),z=K;(U.exports=function(t,e){return z[t]||(z[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.16.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var X=m,q=function(t){return Object(X(t))},$=q,Z={}.hasOwnProperty,J=Object.hasOwn||function(t,e){return Z.call($(t),e)},Q=0,tt=Math.random(),et=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++Q+tt).toString(36)},nt=n,it=U.exports,rt=J,ot=et,st=N,at=F,ct=it("wks"),lt=nt.Symbol,ut=at?lt:lt&<.withoutSetter||ot,ht=function(t){return rt(ct,t)&&(st||"string"==typeof ct[t])||(st&&rt(lt,t)?ct[t]=lt[t]:ct[t]=ut("Symbol."+t)),ct[t]},ft=C,dt=B,pt=function(t,e){var n,i;if("string"===e&&"function"==typeof(n=t.toString)&&!H(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!H(i=n.call(t)))return i;if("string"!==e&&"function"==typeof(n=t.toString)&&!H(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")},gt=ht("toPrimitive"),vt=function(t,e){if(!ft(t)||dt(t))return t;var n,i=t[gt];if(void 0!==i){if(void 0===e&&(e="default"),n=i.call(t,e),!ft(n)||dt(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),pt(t,e)},yt=vt,mt=B,kt=function(t){var e=yt(t,"string");return mt(e)?e:String(e)},bt=C,wt=n.document,Ct=bt(wt)&&bt(wt.createElement),xt=function(t){return Ct?wt.createElement(t):{}},_t=xt,Et=!o&&!r((function(){return 7!=Object.defineProperty(_t("div"),"a",{get:function(){return 7}}).a})),Tt=o,St=s,Pt=f,Rt=w,Ot=kt,It=J,Lt=Et,At=Object.getOwnPropertyDescriptor;i.f=Tt?At:function(t,e){if(t=Rt(t),e=Ot(e),Lt)try{return At(t,e)}catch(t){}if(It(t,e))return Pt(!St.f.call(t,e),t[e])};var Dt={},Mt=C,Nt=function(t){if(!Mt(t))throw TypeError(String(t)+" is not an object");return t},Ft=o,jt=Et,Bt=Nt,Ht=kt,Ut=Object.defineProperty;Dt.f=Ft?Ut:function(t,e,n){if(Bt(t),e=Ht(e),Bt(n),jt)try{return Ut(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var Vt=Dt,Gt=f,Wt=o?function(t,e,n){return Vt.f(t,e,Gt(1,n))}:function(t,e,n){return t[e]=n,t},Yt={exports:{}},Kt=K,zt=Function.toString;"function"!=typeof Kt.inspectSource&&(Kt.inspectSource=function(t){return zt.call(t)});var Xt,qt,$t,Zt=Kt.inspectSource,Jt=Zt,Qt=n.WeakMap,te="function"==typeof Qt&&/native code/.test(Jt(Qt)),ee=U.exports,ne=et,ie=ee("keys"),re=function(t){return ie[t]||(ie[t]=ne(t))},oe={},se=te,ae=C,ce=Wt,le=J,ue=K,he=re,fe=oe,de="Object already initialized",pe=n.WeakMap;if(se||ue.state){var ge=ue.state||(ue.state=new pe),ve=ge.get,ye=ge.has,me=ge.set;Xt=function(t,e){if(ye.call(ge,t))throw new TypeError(de);return e.facade=t,me.call(ge,t,e),e},qt=function(t){return ve.call(ge,t)||{}},$t=function(t){return ye.call(ge,t)}}else{var ke=he("state");fe[ke]=!0,Xt=function(t,e){if(le(t,ke))throw new TypeError(de);return e.facade=t,ce(t,ke,e),e},qt=function(t){return le(t,ke)?t[ke]:{}},$t=function(t){return le(t,ke)}}var be={set:Xt,get:qt,has:$t,enforce:function(t){return $t(t)?qt(t):Xt(t,{})},getterFor:function(t){return function(e){var n;if(!ae(e)||(n=qt(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},we=n,Ce=Wt,xe=J,_e=G,Ee=Zt,Te=be.get,Se=be.enforce,Pe=String(String).split("String");(Yt.exports=function(t,e,n,i){var r,o=!!i&&!!i.unsafe,s=!!i&&!!i.enumerable,a=!!i&&!!i.noTargetGet;"function"==typeof n&&("string"!=typeof e||xe(n,"name")||Ce(n,"name",e),(r=Se(n)).source||(r.source=Pe.join("string"==typeof e?e:""))),t!==we?(o?!a&&t[e]&&(s=!0):delete t[e],s?t[e]=n:Ce(t,e,n)):s?t[e]=n:_e(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&Te(this).source||Ee(this)}));var Re={},Oe=Math.ceil,Ie=Math.floor,Le=function(t){return isNaN(t=+t)?0:(t>0?Ie:Oe)(t)},Ae=Le,De=Math.min,Me=function(t){return t>0?De(Ae(t),9007199254740991):0},Ne=Le,Fe=Math.max,je=Math.min,Be=function(t,e){var n=Ne(t);return n<0?Fe(n+e,0):je(n,e)},He=w,Ue=Me,Ve=Be,Ge=function(t){return function(e,n,i){var r,o=He(e),s=Ue(o.length),a=Ve(i,s);if(t&&n!=n){for(;s>a;)if((r=o[a++])!=r)return!0}else for(;s>a;a++)if((t||a in o)&&o[a]===n)return t||a||0;return!t&&-1}},We={includes:Ge(!0),indexOf:Ge(!1)},Ye=J,Ke=w,ze=We.indexOf,Xe=oe,qe=function(t,e){var n,i=Ke(t),r=0,o=[];for(n in i)!Ye(Xe,n)&&Ye(i,n)&&o.push(n);for(;e.length>r;)Ye(i,n=e[r++])&&(~ze(o,n)||o.push(n));return o},$e=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ze=qe,Je=$e.concat("length","prototype");Re.f=Object.getOwnPropertyNames||function(t){return Ze(t,Je)};var Qe={};Qe.f=Object.getOwnPropertySymbols;var tn,en=Re,nn=Qe,rn=Nt,on=E("Reflect","ownKeys")||function(t){var e=en.f(rn(t)),n=nn.f;return n?e.concat(n(t)):e},sn=J,an=on,cn=i,ln=Dt,un=r,hn=/#|\.prototype\./,fn=function(t,e){var n=pn[dn(t)];return n==vn||n!=gn&&("function"==typeof e?un(e):!!e)},dn=fn.normalize=function(t){return String(t).replace(hn,".").toLowerCase()},pn=fn.data={},gn=fn.NATIVE="N",vn=fn.POLYFILL="P",yn=fn,mn=n,kn=i.f,bn=Wt,wn=Yt.exports,Cn=G,xn=function(t,e){for(var n=an(e),i=ln.f,r=cn.f,o=0;o<n.length;o++){var s=n[o];sn(t,s)||i(t,s,r(e,s))}},_n=yn,En=function(t,e){var n,i,r,o,s,a=t.target,c=t.global,l=t.stat;if(n=c?mn:l?mn[a]||Cn(a,{}):(mn[a]||{}).prototype)for(i in e){if(o=e[i],r=t.noTargetGet?(s=kn(n,i))&&s.value:n[i],!_n(c?i:a+(l?".":"#")+i,t.forced)&&void 0!==r){if(typeof o==typeof r)continue;xn(o,r)}(t.sham||r&&r.sham)&&bn(o,"sham",!0),wn(n,i,o,t)}},Tn=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},Sn=qe,Pn=$e,Rn=Object.keys||function(t){return Sn(t,Pn)},On=Dt,In=Nt,Ln=Rn,An=o?Object.defineProperties:function(t,e){In(t);for(var n,i=Ln(e),r=i.length,o=0;r>o;)On.f(t,n=i[o++],e[n]);return t},Dn=E("document","documentElement"),Mn=Nt,Nn=An,Fn=$e,jn=oe,Bn=Dn,Hn=xt,Un=re("IE_PROTO"),Vn=function(){},Gn=function(t){return"<script>"+t+"</"+"script>"},Wn=function(t){t.write(Gn("")),t.close();var e=t.parentWindow.Object;return t=null,e},Yn=function(){try{tn=new ActiveXObject("htmlfile")}catch(t){}var t,e;Yn="undefined"!=typeof document?document.domain&&tn?Wn(tn):((e=Hn("iframe")).style.display="none",Bn.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(Gn("document.F=Object")),t.close(),t.F):Wn(tn);for(var n=Fn.length;n--;)delete Yn.prototype[Fn[n]];return Yn()};jn[Un]=!0;var Kn=Object.create||function(t,e){var n;return null!==t?(Vn.prototype=Mn(t),n=new Vn,Vn.prototype=null,n[Un]=t):n=Yn(),void 0===e?n:Nn(n,e)},zn=Tn,Xn=C,qn=[].slice,$n={},Zn=function(t,e,n){if(!(e in $n)){for(var i=[],r=0;r<e;r++)i[r]="a["+r+"]";$n[e]=Function("C,a","return new C("+i.join(",")+")")}return $n[e](t,n)},Jn=Function.bind||function(t){var e=zn(this),n=qn.call(arguments,1),i=function(){var r=n.concat(qn.call(arguments));return this instanceof i?Zn(e,r.length,r):e.apply(t,r)};return Xn(e.prototype)&&(i.prototype=e.prototype),i},Qn=En,ti=Tn,ei=Nt,ni=C,ii=Kn,ri=Jn,oi=r,si=E("Reflect","construct"),ai=oi((function(){function t(){}return!(si((function(){}),[],t)instanceof t)})),ci=!oi((function(){si((function(){}))})),li=ai||ci;function ui(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hi(t,e){return(hi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function fi(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&hi(t,e)}function di(t){return(di="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gi(t,e){if(e&&("object"===di(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return pi(t)}function vi(t){return(vi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function yi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Qn({target:"Reflect",stat:!0,forced:li,sham:li},{construct:function(t,e){ti(t),ei(e);var n=arguments.length<3?t:ti(arguments[2]);if(ci&&!ai)return si(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var i=[null];return i.push.apply(i,e),new(ri.apply(t,i))}var r=n.prototype,o=ii(ni(r)?r:Object.prototype),s=Function.apply.call(t,o,e);return ni(s)?s:o}});var mi=p,ki=Array.isArray||function(t){return"Array"==mi(t)},bi=B,wi=function(t){if(bi(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)},Ci={},xi=w,_i=Re.f,Ei={}.toString,Ti="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Ci.f=function(t){return Ti&&"[object Window]"==Ei.call(t)?function(t){try{return _i(t)}catch(t){return Ti.slice()}}(t):_i(xi(t))};var Si={},Pi=ht;Si.f=Pi;var Ri=n,Oi=J,Ii=Si,Li=Dt.f,Ai=Dt.f,Di=J,Mi=ht("toStringTag"),Ni=function(t,e,n){t&&!Di(t=n?t:t.prototype,Mi)&&Ai(t,Mi,{configurable:!0,value:e})},Fi=Tn,ji=function(t,e,n){if(Fi(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}},Bi=C,Hi=ki,Ui=ht("species"),Vi=function(t){var e;return Hi(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!Hi(e.prototype)?Bi(e)&&null===(e=e[Ui])&&(e=void 0):e=void 0),void 0===e?Array:e},Gi=function(t,e){return new(Vi(t))(0===e?0:e)},Wi=ji,Yi=y,Ki=q,zi=Me,Xi=Gi,qi=[].push,$i=function(t){var e=1==t,n=2==t,i=3==t,r=4==t,o=6==t,s=7==t,a=5==t||o;return function(c,l,u,h){for(var f,d,p=Ki(c),g=Yi(p),v=Wi(l,u,3),y=zi(g.length),m=0,k=h||Xi,b=e?k(c,y):n||s?k(c,0):void 0;y>m;m++)if((a||m in g)&&(d=v(f=g[m],m,p),t))if(e)b[m]=d;else if(d)switch(t){case 3:return!0;case 5:return f;case 6:return m;case 2:qi.call(b,f)}else switch(t){case 4:return!1;case 7:qi.call(b,f)}return o?-1:i||r?r:b}},Zi={forEach:$i(0),map:$i(1),filter:$i(2),some:$i(3),every:$i(4),find:$i(5),findIndex:$i(6),filterReject:$i(7)},Ji=En,Qi=n,tr=E,er=o,nr=N,ir=r,rr=J,or=ki,sr=C,ar=B,cr=Nt,lr=q,ur=w,hr=kt,fr=wi,dr=f,pr=Kn,gr=Rn,vr=Re,yr=Ci,mr=Qe,kr=i,br=Dt,wr=s,Cr=Wt,xr=Yt.exports,_r=U.exports,Er=oe,Tr=et,Sr=ht,Pr=Si,Rr=function(t){var e=Ri.Symbol||(Ri.Symbol={});Oi(e,t)||Li(e,t,{value:Ii.f(t)})},Or=Ni,Ir=be,Lr=Zi.forEach,Ar=re("hidden"),Dr="Symbol",Mr=Sr("toPrimitive"),Nr=Ir.set,Fr=Ir.getterFor(Dr),jr=Object.prototype,Br=Qi.Symbol,Hr=tr("JSON","stringify"),Ur=kr.f,Vr=br.f,Gr=yr.f,Wr=wr.f,Yr=_r("symbols"),Kr=_r("op-symbols"),zr=_r("string-to-symbol-registry"),Xr=_r("symbol-to-string-registry"),qr=_r("wks"),$r=Qi.QObject,Zr=!$r||!$r.prototype||!$r.prototype.findChild,Jr=er&&ir((function(){return 7!=pr(Vr({},"a",{get:function(){return Vr(this,"a",{value:7}).a}})).a}))?function(t,e,n){var i=Ur(jr,e);i&&delete jr[e],Vr(t,e,n),i&&t!==jr&&Vr(jr,e,i)}:Vr,Qr=function(t,e){var n=Yr[t]=pr(Br.prototype);return Nr(n,{type:Dr,tag:t,description:e}),er||(n.description=e),n},to=function(t,e,n){t===jr&&to(Kr,e,n),cr(t);var i=hr(e);return cr(n),rr(Yr,i)?(n.enumerable?(rr(t,Ar)&&t[Ar][i]&&(t[Ar][i]=!1),n=pr(n,{enumerable:dr(0,!1)})):(rr(t,Ar)||Vr(t,Ar,dr(1,{})),t[Ar][i]=!0),Jr(t,i,n)):Vr(t,i,n)},eo=function(t,e){cr(t);var n=ur(e),i=gr(n).concat(oo(n));return Lr(i,(function(e){er&&!no.call(n,e)||to(t,e,n[e])})),t},no=function(t){var e=hr(t),n=Wr.call(this,e);return!(this===jr&&rr(Yr,e)&&!rr(Kr,e))&&(!(n||!rr(this,e)||!rr(Yr,e)||rr(this,Ar)&&this[Ar][e])||n)},io=function(t,e){var n=ur(t),i=hr(e);if(n!==jr||!rr(Yr,i)||rr(Kr,i)){var r=Ur(n,i);return!r||!rr(Yr,i)||rr(n,Ar)&&n[Ar][i]||(r.enumerable=!0),r}},ro=function(t){var e=Gr(ur(t)),n=[];return Lr(e,(function(t){rr(Yr,t)||rr(Er,t)||n.push(t)})),n},oo=function(t){var e=t===jr,n=Gr(e?Kr:ur(t)),i=[];return Lr(n,(function(t){!rr(Yr,t)||e&&!rr(jr,t)||i.push(Yr[t])})),i};(nr||(xr((Br=function(){if(this instanceof Br)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?fr(arguments[0]):void 0,e=Tr(t),n=function(t){this===jr&&n.call(Kr,t),rr(this,Ar)&&rr(this[Ar],e)&&(this[Ar][e]=!1),Jr(this,e,dr(1,t))};return er&&Zr&&Jr(jr,e,{configurable:!0,set:n}),Qr(e,t)}).prototype,"toString",(function(){return Fr(this).tag})),xr(Br,"withoutSetter",(function(t){return Qr(Tr(t),t)})),wr.f=no,br.f=to,kr.f=io,vr.f=yr.f=ro,mr.f=oo,Pr.f=function(t){return Qr(Sr(t),t)},er&&(Vr(Br.prototype,"description",{configurable:!0,get:function(){return Fr(this).description}}),xr(jr,"propertyIsEnumerable",no,{unsafe:!0}))),Ji({global:!0,wrap:!0,forced:!nr,sham:!nr},{Symbol:Br}),Lr(gr(qr),(function(t){Rr(t)})),Ji({target:Dr,stat:!0,forced:!nr},{for:function(t){var e=fr(t);if(rr(zr,e))return zr[e];var n=Br(e);return zr[e]=n,Xr[n]=e,n},keyFor:function(t){if(!ar(t))throw TypeError(t+" is not a symbol");if(rr(Xr,t))return Xr[t]},useSetter:function(){Zr=!0},useSimple:function(){Zr=!1}}),Ji({target:"Object",stat:!0,forced:!nr,sham:!er},{create:function(t,e){return void 0===e?pr(t):eo(pr(t),e)},defineProperty:to,defineProperties:eo,getOwnPropertyDescriptor:io}),Ji({target:"Object",stat:!0,forced:!nr},{getOwnPropertyNames:ro,getOwnPropertySymbols:oo}),Ji({target:"Object",stat:!0,forced:ir((function(){mr.f(1)}))},{getOwnPropertySymbols:function(t){return mr.f(lr(t))}}),Hr)&&Ji({target:"JSON",stat:!0,forced:!nr||ir((function(){var t=Br();return"[null]"!=Hr([t])||"{}"!=Hr({a:t})||"{}"!=Hr(Object(t))}))},{stringify:function(t,e,n){for(var i,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(i=e,(sr(e)||void 0!==t)&&!ar(t))return or(e)||(e=function(t,e){if("function"==typeof i&&(e=i.call(this,t,e)),!ar(e))return e}),r[1]=e,Hr.apply(null,r)}});Br.prototype[Mr]||Cr(Br.prototype,Mr,Br.prototype.valueOf),Or(Br,Dr),Er[Ar]=!0;var so=En,ao=r,co=w,lo=i.f,uo=o,ho=ao((function(){lo(1)}));so({target:"Object",stat:!0,forced:!uo||ho,sham:!uo},{getOwnPropertyDescriptor:function(t,e){return lo(co(t),e)}});var fo=kt,po=Dt,go=f,vo=function(t,e,n){var i=fo(e);i in t?po.f(t,i,go(0,n)):t[i]=n},yo=on,mo=w,ko=i,bo=vo;function wo(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Co(t,e,n){return e&&wo(t.prototype,e),n&&wo(t,n),t}function xo(t,e,n){return(xo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=vi(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}En({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function(t){for(var e,n,i=mo(t),r=ko.f,o=yo(i),s={},a=0;o.length>a;)void 0!==(n=r(i,e=o[a++]))&&bo(s,e,n);return s}});var _o=r,Eo=A,To=ht("species"),So=function(t){return Eo>=51||!_o((function(){var e=[];return(e.constructor={})[To]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Po=Zi.map;En({target:"Array",proto:!0,forced:!So("map")},{map:function(t){return Po(this,t,arguments.length>1?arguments[1]:void 0)}});var Ro=En,Oo=r,Io=ki,Lo=C,Ao=q,Do=Me,Mo=vo,No=Gi,Fo=So,jo=A,Bo=ht("isConcatSpreadable"),Ho=9007199254740991,Uo="Maximum allowed index exceeded",Vo=jo>=51||!Oo((function(){var t=[];return t[Bo]=!1,t.concat()[0]!==t})),Go=Fo("concat"),Wo=function(t){if(!Lo(t))return!1;var e=t[Bo];return void 0!==e?!!e:Io(t)};Ro({target:"Array",proto:!0,forced:!Vo||!Go},{concat:function(t){var e,n,i,r,o,s=Ao(this),a=No(s,0),c=0;for(e=-1,i=arguments.length;e<i;e++)if(Wo(o=-1===e?s:arguments[e])){if(c+(r=Do(o.length))>Ho)throw TypeError(Uo);for(n=0;n<r;n++,c++)n in o&&Mo(a,c,o[n])}else{if(c>=Ho)throw TypeError(Uo);Mo(a,c++,o)}return a.length=c,a}});var Yo=q,Ko=Rn;En({target:"Object",stat:!0,forced:r((function(){Ko(1)}))},{keys:function(t){return Ko(Yo(t))}});var zo=En,Xo=C,qo=ki,$o=Be,Zo=Me,Jo=w,Qo=vo,ts=ht,es=So("slice"),ns=ts("species"),is=[].slice,rs=Math.max;zo({target:"Array",proto:!0,forced:!es},{slice:function(t,e){var n,i,r,o=Jo(this),s=Zo(o.length),a=$o(t,s),c=$o(void 0===e?s:e,s);if(qo(o)&&("function"!=typeof(n=o.constructor)||n!==Array&&!qo(n.prototype)?Xo(n)&&null===(n=n[ns])&&(n=void 0):n=void 0,n===Array||void 0===n))return is.call(o,a,c);for(i=new(void 0===n?Array:n)(rs(c-a,0)),r=0;a<c;a++,r++)a in o&&Qo(i,r,o[a]);return i.length=r,i}});var os={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},ss=r,as=function(t,e){var n=[][t];return!!n&&ss((function(){n.call(null,e||function(){throw 1},1)}))},cs=Zi.forEach,ls=n,us=os,hs=as("forEach")?[].forEach:function(t){return cs(this,t,arguments.length>1?arguments[1]:void 0)},fs=Wt;for(var ds in us){var ps=ls[ds],gs=ps&&ps.prototype;if(gs&&gs.forEach!==hs)try{fs(gs,"forEach",hs)}catch(t){gs.forEach=hs}}var vs=Nt,ys=function(){var t=vs(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},ms={},ks=r,bs=n.RegExp;ms.UNSUPPORTED_Y=ks((function(){var t=bs("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),ms.BROKEN_CARET=ks((function(){var t=bs("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));var ws=r,Cs=n.RegExp,xs=ws((function(){var t=Cs(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)})),_s=r,Es=n.RegExp,Ts=_s((function(){var t=Es("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})),Ss=wi,Ps=ys,Rs=ms,Os=U.exports,Is=Kn,Ls=be.get,As=xs,Ds=Ts,Ms=RegExp.prototype.exec,Ns=Os("native-string-replace",String.prototype.replace),Fs=Ms,js=function(){var t=/a/,e=/b*/g;return Ms.call(t,"a"),Ms.call(e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),Bs=Rs.UNSUPPORTED_Y||Rs.BROKEN_CARET,Hs=void 0!==/()??/.exec("")[1];(js||Hs||Bs||As||Ds)&&(Fs=function(t){var e,n,i,r,o,s,a,c=this,l=Ls(c),u=Ss(t),h=l.raw;if(h)return h.lastIndex=c.lastIndex,e=Fs.call(h,u),c.lastIndex=h.lastIndex,e;var f=l.groups,d=Bs&&c.sticky,p=Ps.call(c),g=c.source,v=0,y=u;if(d&&(-1===(p=p.replace("y","")).indexOf("g")&&(p+="g"),y=u.slice(c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==u.charAt(c.lastIndex-1))&&(g="(?: "+g+")",y=" "+y,v++),n=new RegExp("^(?:"+g+")",p)),Hs&&(n=new RegExp("^"+g+"$(?!\\s)",p)),js&&(i=c.lastIndex),r=Ms.call(d?n:c,y),d?r?(r.input=r.input.slice(v),r[0]=r[0].slice(v),r.index=c.lastIndex,c.lastIndex+=r[0].length):c.lastIndex=0:js&&r&&(c.lastIndex=c.global?r.index+r[0].length:i),Hs&&r&&r.length>1&&Ns.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&f)for(r.groups=s=Is(null),o=0;o<f.length;o++)s[(a=f[o])[0]]=r[a[1]];return r});var Us=Fs;En({target:"RegExp",proto:!0,forced:/./.exec!==Us},{exec:Us});var Vs=Yt.exports,Gs=Us,Ws=r,Ys=ht,Ks=Wt,zs=Ys("species"),Xs=RegExp.prototype,qs=function(t,e,n,i){var r=Ys(t),o=!Ws((function(){var e={};return e[r]=function(){return 7},7!=""[t](e)})),s=o&&!Ws((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[zs]=function(){return n},n.flags="",n[r]=/./[r]),n.exec=function(){return e=!0,null},n[r](""),!e}));if(!o||!s||n){var a=/./[r],c=e(r,""[t],(function(t,e,n,i,r){var s=e.exec;return s===Gs||s===Xs.exec?o&&!r?{done:!0,value:a.call(e,n,i)}:{done:!0,value:t.call(n,e,i)}:{done:!1}}));Vs(String.prototype,t,c[0]),Vs(Xs,r,c[1])}i&&Ks(Xs[r],"sham",!0)},$s=C,Zs=p,Js=ht("match"),Qs=function(t){var e;return $s(t)&&(void 0!==(e=t[Js])?!!e:"RegExp"==Zs(t))},ta=Nt,ea=Tn,na=ht("species"),ia=function(t,e){var n,i=ta(t).constructor;return void 0===i||null==(n=ta(i)[na])?e:ea(n)},ra=Le,oa=wi,sa=m,aa=function(t){return function(e,n){var i,r,o=oa(sa(e)),s=ra(n),a=o.length;return s<0||s>=a?t?"":void 0:(i=o.charCodeAt(s))<55296||i>56319||s+1===a||(r=o.charCodeAt(s+1))<56320||r>57343?t?o.charAt(s):i:t?o.slice(s,s+2):r-56320+(i-55296<<10)+65536}},ca={codeAt:aa(!1),charAt:aa(!0)},la=ca.charAt,ua=function(t,e,n){return e+(n?la(t,e).length:1)},ha=p,fa=Us,da=function(t,e){var n=t.exec;if("function"==typeof n){var i=n.call(t,e);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==ha(t))throw TypeError("RegExp#exec called on incompatible receiver");return fa.call(t,e)},pa=qs,ga=Qs,va=Nt,ya=m,ma=ia,ka=ua,ba=Me,wa=wi,Ca=da,xa=Us,_a=r,Ea=ms.UNSUPPORTED_Y,Ta=[].push,Sa=Math.min,Pa=4294967295;pa("split",(function(t,e,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(t,n){var i=wa(ya(this)),r=void 0===n?Pa:n>>>0;if(0===r)return[];if(void 0===t)return[i];if(!ga(t))return e.call(i,t,r);for(var o,s,a,c=[],l=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),u=0,h=new RegExp(t.source,l+"g");(o=xa.call(h,i))&&!((s=h.lastIndex)>u&&(c.push(i.slice(u,o.index)),o.length>1&&o.index<i.length&&Ta.apply(c,o.slice(1)),a=o[0].length,u=s,c.length>=r));)h.lastIndex===o.index&&h.lastIndex++;return u===i.length?!a&&h.test("")||c.push(""):c.push(i.slice(u)),c.length>r?c.slice(0,r):c}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function(e,n){var r=ya(this),o=null==e?void 0:e[t];return void 0!==o?o.call(e,r,n):i.call(wa(r),e,n)},function(t,r){var o=va(this),s=wa(t),a=n(i,o,s,r,i!==e);if(a.done)return a.value;var c=ma(o,RegExp),l=o.unicode,u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Ea?"g":"y"),h=new c(Ea?"^(?:"+o.source+")":o,u),f=void 0===r?Pa:r>>>0;if(0===f)return[];if(0===s.length)return null===Ca(h,s)?[s]:[];for(var d=0,p=0,g=[];p<s.length;){h.lastIndex=Ea?0:p;var v,y=Ca(h,Ea?s.slice(p):s);if(null===y||(v=Sa(ba(h.lastIndex+(Ea?p:0)),s.length))===d)p=ka(s,p,l);else{if(g.push(s.slice(d,p)),g.length===f)return g;for(var m=1;m<=y.length-1;m++)if(g.push(y[m]),g.length===f)return g;p=d=v}}return g.push(s.slice(d)),g}]}),!!_a((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),Ea);var Ra=En,Oa=w,Ia=[].join,La=y!=Object,Aa=as("join",",");Ra({target:"Array",proto:!0,forced:La||!Aa},{join:function(t){return Ia.call(Oa(this),void 0===t?",":t)}});var Da=En,Ma=Be,Na=Le,Fa=Me,ja=q,Ba=Gi,Ha=vo,Ua=So("splice"),Va=Math.max,Ga=Math.min,Wa=9007199254740991,Ya="Maximum allowed length exceeded";Da({target:"Array",proto:!0,forced:!Ua},{splice:function(t,e){var n,i,r,o,s,a,c=ja(this),l=Fa(c.length),u=Ma(t,l),h=arguments.length;if(0===h?n=i=0:1===h?(n=0,i=l-u):(n=h-2,i=Ga(Va(Na(e),0),l-u)),l+n-i>Wa)throw TypeError(Ya);for(r=Ba(c,i),o=0;o<i;o++)(s=u+o)in c&&Ha(r,o,c[s]);if(r.length=i,n<i){for(o=u;o<l-i;o++)a=o+n,(s=o+i)in c?c[a]=c[s]:delete c[a];for(o=l;o>l-i+n;o--)delete c[o-1]}else if(n>i)for(o=l-i;o>u;o--)a=o+n-1,(s=o+i-1)in c?c[a]=c[s]:delete c[a];for(o=0;o<n;o++)c[o+u]=arguments[o+2];return c.length=l-i+n,r}});var Ka={};Ka[ht("toStringTag")]="z";var za="[object z]"===String(Ka),Xa=za,qa=p,$a=ht("toStringTag"),Za="Arguments"==qa(function(){return arguments}()),Ja=Xa?qa:function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),$a))?n:Za?qa(e):"Object"==(i=qa(e))&&"function"==typeof e.callee?"Arguments":i},Qa=Ja,tc=za?{}.toString:function(){return"[object "+Qa(this)+"]"},ec=za,nc=Yt.exports,ic=tc;ec||nc(Object.prototype,"toString",ic,{unsafe:!0});var rc=n.Promise,oc=Yt.exports,sc=C,ac=Nt,cc=function(t){if(!sc(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t},lc=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,i){return ac(n),cc(i),e?t.call(n,i):n.__proto__=i,n}}():void 0),uc=E,hc=Dt,fc=o,dc=ht("species"),pc=function(t){var e=uc(t),n=hc.f;fc&&e&&!e[dc]&&n(e,dc,{configurable:!0,get:function(){return this}})},gc={},vc=gc,yc=ht("iterator"),mc=Array.prototype,kc=Ja,bc=gc,wc=ht("iterator"),Cc=Nt,xc=Nt,_c=function(t){return void 0!==t&&(vc.Array===t||mc[yc]===t)},Ec=Me,Tc=ji,Sc=function(t){if(null!=t)return t[wc]||t["@@iterator"]||bc[kc(t)]},Pc=function(t){var e=t.return;if(void 0!==e)return Cc(e.call(t)).value},Rc=function(t,e){this.stopped=t,this.result=e},Oc=ht("iterator"),Ic=!1;try{var Lc=0,Ac={next:function(){return{done:!!Lc++}},return:function(){Ic=!0}};Ac[Oc]=function(){return this},Array.from(Ac,(function(){throw 2}))}catch(t){}var Dc,Mc,Nc,Fc,jc=/(?:ipad|iphone|ipod).*applewebkit/i.test(T),Bc="process"==p(n.process),Hc=n,Uc=r,Vc=ji,Gc=Dn,Wc=xt,Yc=jc,Kc=Bc,zc=Hc.setImmediate,Xc=Hc.clearImmediate,qc=Hc.process,$c=Hc.MessageChannel,Zc=Hc.Dispatch,Jc=0,Qc={},tl="onreadystatechange";try{Dc=Hc.location}catch(t){}var el=function(t){if(Qc.hasOwnProperty(t)){var e=Qc[t];delete Qc[t],e()}},nl=function(t){return function(){el(t)}},il=function(t){el(t.data)},rl=function(t){Hc.postMessage(String(t),Dc.protocol+"//"+Dc.host)};zc&&Xc||(zc=function(t){for(var e=[],n=arguments.length,i=1;n>i;)e.push(arguments[i++]);return Qc[++Jc]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},Mc(Jc),Jc},Xc=function(t){delete Qc[t]},Kc?Mc=function(t){qc.nextTick(nl(t))}:Zc&&Zc.now?Mc=function(t){Zc.now(nl(t))}:$c&&!Yc?(Fc=(Nc=new $c).port2,Nc.port1.onmessage=il,Mc=Vc(Fc.postMessage,Fc,1)):Hc.addEventListener&&"function"==typeof postMessage&&!Hc.importScripts&&Dc&&"file:"!==Dc.protocol&&!Uc(rl)?(Mc=rl,Hc.addEventListener("message",il,!1)):Mc=tl in Wc("script")?function(t){Gc.appendChild(Wc("script")).onreadystatechange=function(){Gc.removeChild(this),el(t)}}:function(t){setTimeout(nl(t),0)});var ol,sl,al,cl,ll,ul,hl,fl,dl={set:zc,clear:Xc},pl=n,gl=/ipad|iphone|ipod/i.test(T)&&void 0!==pl.Pebble,vl=/web0s(?!.*chrome)/i.test(T),yl=n,ml=i.f,kl=dl.set,bl=jc,wl=gl,Cl=vl,xl=Bc,_l=yl.MutationObserver||yl.WebKitMutationObserver,El=yl.document,Tl=yl.process,Sl=yl.Promise,Pl=ml(yl,"queueMicrotask"),Rl=Pl&&Pl.value;Rl||(ol=function(){var t,e;for(xl&&(t=Tl.domain)&&t.exit();sl;){e=sl.fn,sl=sl.next;try{e()}catch(t){throw sl?cl():al=void 0,t}}al=void 0,t&&t.enter()},bl||xl||Cl||!_l||!El?!wl&&Sl&&Sl.resolve?((hl=Sl.resolve(void 0)).constructor=Sl,fl=hl.then,cl=function(){fl.call(hl,ol)}):cl=xl?function(){Tl.nextTick(ol)}:function(){kl.call(yl,ol)}:(ll=!0,ul=El.createTextNode(""),new _l(ol).observe(ul,{characterData:!0}),cl=function(){ul.data=ll=!ll}));var Ol=Rl||function(t){var e={fn:t,next:void 0};al&&(al.next=e),sl||(sl=e,cl()),al=e},Il={},Ll=Tn,Al=function(t){var e,n;this.promise=new t((function(t,i){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=i})),this.resolve=Ll(e),this.reject=Ll(n)};Il.f=function(t){return new Al(t)};var Dl,Ml,Nl,Fl,jl=Nt,Bl=C,Hl=Il,Ul=n,Vl="object"==typeof window,Gl=En,Wl=n,Yl=E,Kl=rc,zl=Yt.exports,Xl=function(t,e,n){for(var i in e)oc(t,i,e[i],n);return t},ql=lc,$l=Ni,Zl=pc,Jl=C,Ql=Tn,tu=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t},eu=Zt,nu=function(t,e,n){var i,r,o,s,a,c,l,u=n&&n.that,h=!(!n||!n.AS_ENTRIES),f=!(!n||!n.IS_ITERATOR),d=!(!n||!n.INTERRUPTED),p=Tc(e,u,1+h+d),g=function(t){return i&&Pc(i),new Rc(!0,t)},v=function(t){return h?(xc(t),d?p(t[0],t[1],g):p(t[0],t[1])):d?p(t,g):p(t)};if(f)i=t;else{if("function"!=typeof(r=Sc(t)))throw TypeError("Target is not iterable");if(_c(r)){for(o=0,s=Ec(t.length);s>o;o++)if((a=v(t[o]))&&a instanceof Rc)return a;return new Rc(!1)}i=r.call(t)}for(c=i.next;!(l=c.call(i)).done;){try{a=v(l.value)}catch(t){throw Pc(i),t}if("object"==typeof a&&a&&a instanceof Rc)return a}return new Rc(!1)},iu=function(t,e){if(!e&&!Ic)return!1;var n=!1;try{var i={};i[Oc]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n},ru=ia,ou=dl.set,su=Ol,au=function(t,e){if(jl(t),Bl(e)&&e.constructor===t)return e;var n=Hl.f(t);return(0,n.resolve)(e),n.promise},cu=function(t,e){var n=Ul.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))},lu=Il,uu=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},hu=be,fu=yn,du=Vl,pu=Bc,gu=A,vu=ht("species"),yu="Promise",mu=hu.get,ku=hu.set,bu=hu.getterFor(yu),wu=Kl&&Kl.prototype,Cu=Kl,xu=wu,_u=Wl.TypeError,Eu=Wl.document,Tu=Wl.process,Su=lu.f,Pu=Su,Ru=!!(Eu&&Eu.createEvent&&Wl.dispatchEvent),Ou="function"==typeof PromiseRejectionEvent,Iu="unhandledrejection",Lu=!1,Au=fu(yu,(function(){var t=eu(Cu),e=t!==String(Cu);if(!e&&66===gu)return!0;if(gu>=51&&/native code/.test(t))return!1;var n=new Cu((function(t){t(1)})),i=function(t){t((function(){}),(function(){}))};return(n.constructor={})[vu]=i,!(Lu=n.then((function(){}))instanceof i)||!e&&du&&!Ou})),Du=Au||!iu((function(t){Cu.all(t).catch((function(){}))})),Mu=function(t){var e;return!(!Jl(t)||"function"!=typeof(e=t.then))&&e},Nu=function(t,e){if(!t.notified){t.notified=!0;var n=t.reactions;su((function(){for(var i=t.value,r=1==t.state,o=0;n.length>o;){var s,a,c,l=n[o++],u=r?l.ok:l.fail,h=l.resolve,f=l.reject,d=l.domain;try{u?(r||(2===t.rejection&&Hu(t),t.rejection=1),!0===u?s=i:(d&&d.enter(),s=u(i),d&&(d.exit(),c=!0)),s===l.promise?f(_u("Promise-chain cycle")):(a=Mu(s))?a.call(s,h,f):h(s)):f(i)}catch(t){d&&!c&&d.exit(),f(t)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&ju(t)}))}},Fu=function(t,e,n){var i,r;Ru?((i=Eu.createEvent("Event")).promise=e,i.reason=n,i.initEvent(t,!1,!0),Wl.dispatchEvent(i)):i={promise:e,reason:n},!Ou&&(r=Wl["on"+t])?r(i):t===Iu&&cu("Unhandled promise rejection",n)},ju=function(t){ou.call(Wl,(function(){var e,n=t.facade,i=t.value;if(Bu(t)&&(e=uu((function(){pu?Tu.emit("unhandledRejection",i,n):Fu(Iu,n,i)})),t.rejection=pu||Bu(t)?2:1,e.error))throw e.value}))},Bu=function(t){return 1!==t.rejection&&!t.parent},Hu=function(t){ou.call(Wl,(function(){var e=t.facade;pu?Tu.emit("rejectionHandled",e):Fu("rejectionhandled",e,t.value)}))},Uu=function(t,e,n){return function(i){t(e,i,n)}},Vu=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,Nu(t,!0))},Gu=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw _u("Promise can't be resolved itself");var i=Mu(e);i?su((function(){var n={done:!1};try{i.call(e,Uu(Gu,n,t),Uu(Vu,n,t))}catch(e){Vu(n,e,t)}})):(t.value=e,t.state=1,Nu(t,!1))}catch(e){Vu({done:!1},e,t)}}};if(Au&&(xu=(Cu=function(t){tu(this,Cu,yu),Ql(t),Dl.call(this);var e=mu(this);try{t(Uu(Gu,e),Uu(Vu,e))}catch(t){Vu(e,t)}}).prototype,(Dl=function(t){ku(this,{type:yu,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Xl(xu,{then:function(t,e){var n=bu(this),i=Su(ru(this,Cu));return i.ok="function"!=typeof t||t,i.fail="function"==typeof e&&e,i.domain=pu?Tu.domain:void 0,n.parent=!0,n.reactions.push(i),0!=n.state&&Nu(n,!1),i.promise},catch:function(t){return this.then(void 0,t)}}),Ml=function(){var t=new Dl,e=mu(t);this.promise=t,this.resolve=Uu(Gu,e),this.reject=Uu(Vu,e)},lu.f=Su=function(t){return t===Cu||t===Nl?new Ml(t):Pu(t)},"function"==typeof Kl&&wu!==Object.prototype)){Fl=wu.then,Lu||(zl(wu,"then",(function(t,e){var n=this;return new Cu((function(t,e){Fl.call(n,t,e)})).then(t,e)}),{unsafe:!0}),zl(wu,"catch",xu.catch,{unsafe:!0}));try{delete wu.constructor}catch(t){}ql&&ql(wu,xu)}Gl({global:!0,wrap:!0,forced:Au},{Promise:Cu}),$l(Cu,yu,!1),Zl(yu),Nl=Yl(yu),Gl({target:yu,stat:!0,forced:Au},{reject:function(t){var e=Su(this);return e.reject.call(void 0,t),e.promise}}),Gl({target:yu,stat:!0,forced:Au},{resolve:function(t){return au(this,t)}}),Gl({target:yu,stat:!0,forced:Du},{all:function(t){var e=this,n=Su(e),i=n.resolve,r=n.reject,o=uu((function(){var n=Ql(e.resolve),o=[],s=0,a=1;nu(t,(function(t){var c=s++,l=!1;o.push(void 0),a++,n.call(e,t).then((function(t){l||(l=!0,o[c]=t,--a||i(o))}),r)})),--a||i(o)}));return o.error&&r(o.value),n.promise},race:function(t){var e=this,n=Su(e),i=n.reject,r=uu((function(){var r=Ql(e.resolve);nu(t,(function(t){r.call(e,t).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}});var Wu=o,Yu=Dt.f,Ku=Function.prototype,zu=Ku.toString,Xu=/^\s*function ([^ (]*)/,qu="name";Wu&&!(qu in Ku)&&Yu(Ku,qu,{configurable:!0,get:function(){try{return zu.call(this).match(Xu)[1]}catch(t){return""}}});var $u=C,Zu=lc,Ju=function(t,e,n){var i,r;return Zu&&"function"==typeof(i=e.constructor)&&i!==n&&$u(r=i.prototype)&&r!==n.prototype&&Zu(t,r),t},Qu="\t\n\v\f\r \u2028\u2029\ufeff",th=m,eh=wi,nh="[\t\n\v\f\r \u2028\u2029\ufeff]",ih=RegExp("^"+nh+nh+"*"),rh=RegExp(nh+nh+"*$"),oh=function(t){return function(e){var n=eh(th(e));return 1&t&&(n=n.replace(ih,"")),2&t&&(n=n.replace(rh,"")),n}},sh={start:oh(1),end:oh(2),trim:oh(3)},ah=o,ch=n,lh=yn,uh=Yt.exports,hh=J,fh=p,dh=Ju,ph=B,gh=vt,vh=r,yh=Kn,mh=Re.f,kh=i.f,bh=Dt.f,wh=sh.trim,Ch="Number",xh=ch.Number,_h=xh.prototype,Eh=fh(yh(_h))==Ch,Th=function(t){if(ph(t))throw TypeError("Cannot convert a Symbol value to a number");var e,n,i,r,o,s,a,c,l=gh(t,"number");if("string"==typeof l&&l.length>2)if(43===(e=(l=wh(l)).charCodeAt(0))||45===e){if(88===(n=l.charCodeAt(2))||120===n)return NaN}else if(48===e){switch(l.charCodeAt(1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+l}for(s=(o=l.slice(2)).length,a=0;a<s;a++)if((c=o.charCodeAt(a))<48||c>r)return NaN;return parseInt(o,i)}return+l};if(lh(Ch,!xh(" 0o1")||!xh("0b1")||xh("+0x1"))){for(var Sh,Ph=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof Ph&&(Eh?vh((function(){_h.valueOf.call(n)})):fh(n)!=Ch)?dh(new xh(Th(e)),n,Ph):Th(e)},Rh=ah?mh(xh):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),Oh=0;Rh.length>Oh;Oh++)hh(xh,Sh=Rh[Oh])&&!hh(Ph,Sh)&&bh(Ph,Sh,kh(xh,Sh));Ph.prototype=_h,_h.constructor=Ph,uh(ch,Ch,Ph)}var Ih=Zi.filter;En({target:"Array",proto:!0,forced:!So("filter")},{filter:function(t){return Ih(this,t,arguments.length>1?arguments[1]:void 0)}});var Lh=o,Ah=r,Dh=Rn,Mh=Qe,Nh=s,Fh=q,jh=y,Bh=Object.assign,Hh=Object.defineProperty,Uh=!Bh||Ah((function(){if(Lh&&1!==Bh({b:1},Bh(Hh({},"a",{enumerable:!0,get:function(){Hh(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach((function(t){e[t]=t})),7!=Bh({},t)[n]||Dh(Bh({},e)).join("")!=i}))?function(t,e){for(var n=Fh(t),i=arguments.length,r=1,o=Mh.f,s=Nh.f;i>r;)for(var a,c=jh(arguments[r++]),l=o?Dh(c).concat(o(c)):Dh(c),u=l.length,h=0;u>h;)a=l[h++],Lh&&!s.call(c,a)||(n[a]=c[a]);return n}:Bh;En({target:"Object",stat:!0,forced:Object.assign!==Uh},{assign:Uh});var Vh={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new r(i,o||t,s),c=n?n+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],a]:t._events[c].push(a):(t._events[c]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},a.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,s=new Array(o);r<o;r++)s[r]=i[r].fn;return s},a.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},a.prototype.emit=function(t,e,i,r,o,s){var a=n?n+t:t;if(!this._events[a])return!1;var c,l,u=this._events[a],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,i),!0;case 4:return u.fn.call(u.context,e,i,r),!0;case 5:return u.fn.call(u.context,e,i,r,o),!0;case 6:return u.fn.call(u.context,e,i,r,o,s),!0}for(l=1,c=new Array(h-1);l<h;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var f,d=u.length;for(l=0;l<d;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),h){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,i);break;case 4:u[l].fn.call(u[l].context,e,i,r);break;default:if(!c)for(f=1,c=new Array(h-1);f<h;f++)c[f-1]=arguments[f];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,i,r){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||r&&!a.once||i&&a.context!==i||s(this,o);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==e||r&&!a[c].once||i&&a[c].context!==i)&&l.push(a[c]);l.length?this._events[o]=1===l.length?l[0]:l:s(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&s(this,e)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a}(Vh);var Gh=Vh.exports;function Wh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Yh(t){return function(t){if(Array.isArray(t))return Wh(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Wh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wh(t,e):void 0}}(t)||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.")}()}var Kh=Nt,zh=Me,Xh=wi,qh=m,$h=ua,Zh=da;qs("match",(function(t,e,n){return[function(e){var n=qh(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,n):new RegExp(e)[t](Xh(n))},function(t){var i=Kh(this),r=Xh(t),o=n(e,i,r);if(o.done)return o.value;if(!i.global)return Zh(i,r);var s=i.unicode;i.lastIndex=0;for(var a,c=[],l=0;null!==(a=Zh(i,r));){var u=Xh(a[0]);c[l]=u,""===u&&(i.lastIndex=$h(r,zh(i.lastIndex),s)),l++}return 0===l?null:c}]}));var Jh=o,Qh=n,tf=yn,ef=Ju,nf=Wt,rf=Dt.f,of=Re.f,sf=Qs,af=wi,cf=ys,lf=ms,uf=Yt.exports,hf=r,ff=J,df=be.enforce,pf=pc,gf=xs,vf=Ts,yf=ht("match"),mf=Qh.RegExp,kf=mf.prototype,bf=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,wf=/a/g,Cf=/a/g,xf=new mf(wf)!==wf,_f=lf.UNSUPPORTED_Y,Ef=Jh&&(!xf||_f||gf||vf||hf((function(){return Cf[yf]=!1,mf(wf)!=wf||mf(Cf)==Cf||"/a/i"!=mf(wf,"i")})));if(tf("RegExp",Ef)){for(var Tf=function(t,e){var n,i,r,o,s,a,c=this instanceof Tf,l=sf(t),u=void 0===e,h=[],f=t;if(!c&&l&&u&&t.constructor===Tf)return t;if((l||t instanceof Tf)&&(t=t.source,u&&(e="flags"in f?f.flags:cf.call(f))),t=void 0===t?"":af(t),e=void 0===e?"":af(e),f=t,gf&&"dotAll"in wf&&(i=!!e&&e.indexOf("s")>-1)&&(e=e.replace(/s/g,"")),n=e,_f&&"sticky"in wf&&(r=!!e&&e.indexOf("y")>-1)&&(e=e.replace(/y/g,"")),vf&&(t=(o=function(t){for(var e,n=t.length,i=0,r="",o=[],s={},a=!1,c=!1,l=0,u="";i<=n;i++){if("\\"===(e=t.charAt(i)))e+=t.charAt(++i);else if("]"===e)a=!1;else if(!a)switch(!0){case"["===e:a=!0;break;case"("===e:bf.test(t.slice(i+1))&&(i+=2,c=!0),r+=e,l++;continue;case">"===e&&c:if(""===u||ff(s,u))throw new SyntaxError("Invalid capture group name");s[u]=!0,o.push([u,l]),c=!1,u="";continue}c?u+=e:r+=e}return[r,o]}(t))[0],h=o[1]),s=ef(mf(t,e),c?this:kf,Tf),(i||r||h.length)&&(a=df(s),i&&(a.dotAll=!0,a.raw=Tf(function(t){for(var e,n=t.length,i=0,r="",o=!1;i<=n;i++)"\\"!==(e=t.charAt(i))?o||"."!==e?("["===e?o=!0:"]"===e&&(o=!1),r+=e):r+="[\\s\\S]":r+=e+t.charAt(++i);return r}(t),n)),r&&(a.sticky=!0),h.length&&(a.groups=h)),t!==f)try{nf(s,"source",""===f?"(?:)":f)}catch(t){}return s},Sf=function(t){t in Tf||rf(Tf,t,{configurable:!0,get:function(){return mf[t]},set:function(e){mf[t]=e}})},Pf=of(mf),Rf=0;Pf.length>Rf;)Sf(Pf[Rf++]);kf.constructor=Tf,Tf.prototype=kf,uf(Qh,"RegExp",Tf)}pf("RegExp");var Of=Yt.exports,If=Nt,Lf=wi,Af=r,Df=ys,Mf="toString",Nf=RegExp.prototype,Ff=Nf.toString,jf=Af((function(){return"/a/b"!=Ff.call({source:"a",flags:"b"})})),Bf=Ff.name!=Mf;(jf||Bf)&&Of(RegExp.prototype,Mf,(function(){var t=If(this),e=Lf(t.source),n=t.flags;return"/"+e+"/"+Lf(void 0===n&&t instanceof RegExp&&!("flags"in Nf)?Df.call(t):n)}),{unsafe:!0});var Hf=q,Uf=Math.floor,Vf="".replace,Gf=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Wf=/\$([$&'`]|\d{1,2})/g,Yf=qs,Kf=r,zf=Nt,Xf=Le,qf=Me,$f=wi,Zf=m,Jf=ua,Qf=function(t,e,n,i,r,o){var s=n+t.length,a=i.length,c=Wf;return void 0!==r&&(r=Hf(r),c=Gf),Vf.call(o,c,(function(o,c){var l;switch(c.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,n);case"'":return e.slice(s);case"<":l=r[c.slice(1,-1)];break;default:var u=+c;if(0===u)return o;if(u>a){var h=Uf(u/10);return 0===h?o:h<=a?void 0===i[h-1]?c.charAt(1):i[h-1]+c.charAt(1):o}l=i[u-1]}return void 0===l?"":l}))},td=da,ed=ht("replace"),nd=Math.max,id=Math.min,rd="$0"==="a".replace(/./,"$0"),od=!!/./[ed]&&""===/./[ed]("a","$0");Yf("replace",(function(t,e,n){var i=od?"$":"$0";return[function(t,n){var i=Zf(this),r=null==t?void 0:t[ed];return void 0!==r?r.call(t,i,n):e.call($f(i),t,n)},function(t,r){var o=zf(this),s=$f(t);if("string"==typeof r&&-1===r.indexOf(i)&&-1===r.indexOf("$<")){var a=n(e,o,s,r);if(a.done)return a.value}var c="function"==typeof r;c||(r=$f(r));var l=o.global;if(l){var u=o.unicode;o.lastIndex=0}for(var h=[];;){var f=td(o,s);if(null===f)break;if(h.push(f),!l)break;""===$f(f[0])&&(o.lastIndex=Jf(s,qf(o.lastIndex),u))}for(var d,p="",g=0,v=0;v<h.length;v++){f=h[v];for(var y=$f(f[0]),m=nd(id(Xf(f.index),s.length),0),k=[],b=1;b<f.length;b++)k.push(void 0===(d=f[b])?d:String(d));var w=f.groups;if(c){var C=[y].concat(k,m,s);void 0!==w&&C.push(w);var x=$f(r.apply(void 0,C))}else x=Qf(y,s,m,k,w,r);m>=g&&(p+=s.slice(g,m)+x,g=m+y.length)}return p+s.slice(g)}]}),!!Kf((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!rd||od);var sd=r,ad=Qu,cd=sh.trim;En({target:"String",proto:!0,forced:function(t){return sd((function(){return!!ad[t]()||"
"!="
"[t]()||ad[t].name!==t}))}("trim")},{trim:function(){return cd(this)}});var ld=Math.floor,ud=function(t,e){var n=t.length,i=ld(n/2);return n<8?hd(t,e):fd(ud(t.slice(0,i),e),ud(t.slice(i),e),e)},hd=function(t,e){for(var n,i,r=t.length,o=1;o<r;){for(i=o,n=t[o];i&&e(t[i-1],n)>0;)t[i]=t[--i];i!==o++&&(t[i]=n)}return t},fd=function(t,e,n){for(var i=t.length,r=e.length,o=0,s=0,a=[];o<i||s<r;)o<i&&s<r?a.push(n(t[o],e[s])<=0?t[o++]:e[s++]):a.push(o<i?t[o++]:e[s++]);return a},dd=ud,pd=T.match(/firefox\/(\d+)/i),gd=!!pd&&+pd[1],vd=/MSIE|Trident/.test(T),yd=T.match(/AppleWebKit\/(\d+)\./),md=!!yd&&+yd[1],kd=En,bd=Tn,wd=q,Cd=Me,xd=wi,_d=r,Ed=dd,Td=as,Sd=gd,Pd=vd,Rd=A,Od=md,Id=[],Ld=Id.sort,Ad=_d((function(){Id.sort(void 0)})),Dd=_d((function(){Id.sort(null)})),Md=Td("sort"),Nd=!_d((function(){if(Rd)return Rd<70;if(!(Sd&&Sd>3)){if(Pd)return!0;if(Od)return Od<603;var t,e,n,i,r="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){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++)Id.push({k:e+i,v:n})}for(Id.sort((function(t,e){return e.v-t.v})),i=0;i<Id.length;i++)e=Id[i].k.charAt(0),r.charAt(r.length-1)!==e&&(r+=e);return"DGBEFHACIJK"!==r}}));kd({target:"Array",proto:!0,forced:Ad||!Dd||!Md||!Nd},{sort:function(t){void 0!==t&&bd(t);var e=wd(this);if(Nd)return void 0===t?Ld.call(e):Ld.call(e,t);var n,i,r=[],o=Cd(e.length);for(i=0;i<o;i++)i in e&&r.push(e[i]);for(n=(r=Ed(r,function(t){return function(e,n){return void 0===n?-1:void 0===e?1:void 0!==t?+t(e,n)||0:xd(e)>xd(n)?1:-1}}(t))).length,i=0;i<n;)e[i]=r[i++];for(;i<o;)delete e[i++];return e}});var Fd="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,jd={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},Bd="%c[xgplayer]",Hd={config:{debug:Fd?3:1},logInfo:function(t){for(var e,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&&(e=console).log.apply(e,[Bd,jd.info,t].concat(i))},logWarn:function(t){for(var e,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&&(e=console).warn.apply(e,[Bd,jd.warn,t].concat(i))},logError:function(t){var e;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];(e=console)[n].apply(e,[Bd,jd.error,t].concat(r))}}};var Ud=function(){function t(e){ui(this,t),this.bufferedList=e}return Co(t,[{key:"start",value:function(t){return this.bufferedList[t].start}},{key:"end",value:function(t){return this.bufferedList[t].end}},{key:"length",get:function(){return this.bufferedList.length}}]),t}(),Vd={};function Gd(t,e){for(var n=0,i=e.length;n<i;n++)if(t.indexOf(e[n])>-1)return!0;return!1}Vd.createDom=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",e=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(t);return r.className=i,r.innerHTML=e,Object.keys(n).forEach((function(e){var i=e,o=n[e];"video"===t||"audio"===t||"live-video"===t?o&&r.setAttribute(i,o):r.setAttribute(i,o)})),r},Vd.createDomFromHtml=function(t){var e=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=t;var r=i.children;return i=null,r.length>0?(r=r[0],n&&Vd.addClass(r,n),e&&Object.keys(e).forEach((function(t){r.setAttribute(t,e[t])})),r):null}catch(t){return Hd.logError("util.createDomFromHtml",t),null}},Vd.hasClass=function(t,e){if(!t||!e)return!1;try{return Array.prototype.some.call(t.classList,(function(t){return t===e}))}catch(i){var n=t.className&&"object"===di(t.className)?t.getAttribute("class"):t.className;return n&&!!n.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}},Vd.addClass=function(t,e){if(t&&e)try{e.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(e){e&&t.classList.add(e)}))}catch(n){Vd.hasClass(t,e)||(t.className&&"object"===di(t.className)?t.setAttribute("class",t.getAttribute("class")+" "+e):t.className+=" "+e)}},Vd.removeClass=function(t,e){if(t&&e)try{e.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(e){e&&t.classList.remove(e)}))}catch(n){Vd.hasClass(t,e)&&e.split(/\s+/g).forEach((function(e){var n=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className&&"object"===di(t.className)?t.setAttribute("class",t.getAttribute("class").replace(n," ")):t.className=t.className.replace(n," ")}))}},Vd.toggleClass=function(t,e){t&&e.split(/\s+/g).forEach((function(e){Vd.hasClass(t,e)?Vd.removeClass(t,e):Vd.addClass(t,e)}))},Vd.classNames=function(){for(var t=arguments,e=[],n=function(n){"String"===Vd.typeOf(t[n])?e.push(t[n]):"Object"===Vd.typeOf(t[n])&&Object.keys(t[n]).map((function(i){t[n][i]&&e.push(i)}))},i=0;i<arguments.length;i++)n(i);return e.join(" ")},Vd.findDom=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1?arguments[1]:void 0;try{t=e.querySelector(n)}catch(i){Hd.logError("util.findDom",i),0===n.indexOf("#")&&(t=e.getElementById(n.slice(1)))}return t},Vd.getCss=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,!1)[e]},Vd.padStart=function(t,e,n){for(var i=String(n),r=e>>0,o=Math.ceil(r/i.length),s=[],a=String(t);o--;)s.push(i);return s.join("").substring(0,r-a.length)+a},Vd.format=function(t){if(window.isNaN(t))return"";t=Math.round(t);var e=Vd.padStart(Math.floor(t/3600),2,0),n=Vd.padStart(Math.floor((t-3600*e)/60),2,0),i=Vd.padStart(Math.floor(t-3600*e-60*n),2,0);return("00"===e?[n,i]:[e,n,i]).join(":")},Vd.event=function(t){if(t.touches){var e=t.touches[0]||t.changedTouches[0];t.clientX=e.clientX||0,t.clientY=e.clientY||0,t.offsetX=e.pageX-e.target.offsetLeft,t.offsetY=e.pageY-e.target.offsetTop}t._target=t.target||t.srcElement},Vd.typeOf=function(t){return Object.prototype.toString.call(t).match(/([^\s.*]+)(?=]$)/g)[0]},Vd.deepCopy=function(t,e){if("Object"===Vd.typeOf(e)&&"Object"===Vd.typeOf(t))return Object.keys(e).forEach((function(n){"Object"!==Vd.typeOf(e[n])||e[n]instanceof Node?"Array"===Vd.typeOf(e[n])?t[n]="Array"===Vd.typeOf(t[n])?t[n].concat(e[n]):e[n]:t[n]=e[n]:void 0===t[n]||void 0===t[n]?t[n]=e[n]:Vd.deepCopy(t[n],e[n])})),t},Vd.deepMerge=function(t,e){return Object.keys(e).map((function(n){var i;"Array"===Vd.typeOf(e[n])&&"Array"===Vd.typeOf(t[n])?"Array"===Vd.typeOf(t[n])&&(i=t[n]).push.apply(i,Yh(e[n])):Vd.typeOf(t[n])!==Vd.typeOf(e[n])||null===t[n]||"Object"!==Vd.typeOf(t[n])||e[n]instanceof window.Node?null!==e[n]&&(t[n]=e[n]):Vd.deepMerge(t[n],e[n])})),t},Vd.getBgImage=function(t){var e=(t.currentStyle||window.getComputedStyle(t,null)).backgroundImage;if(!e||"none"===e)return"";var n=document.createElement("a");return n.href=e.replace(/url\("|"\)/g,""),n.href},Vd.copyDom=function(t){if(t&&1===t.nodeType){var e=document.createElement(t.tagName);return Array.prototype.forEach.call(t.attributes,(function(t){e.setAttribute(t.name,t.value)})),t.innerHTML&&(e.innerHTML=t.innerHTML),e}return""},Vd.setInterval=function(t,e,n,i){t._interval[e]||(t._interval[e]=setInterval(n.bind(t),i))},Vd.clearInterval=function(t,e){clearInterval(t._interval[e]),t._interval[e]=null},Vd.setTimeout=function(t,e,n){t._timers||(t._timers=[]);var i=setTimeout((function(){e(),Vd.clearTimeout(t,i)}),n);return t._timers.push(i),i},Vd.clearTimeout=function(t,e){var n=t._timers;if("Array"===Vd.typeOf(n)){for(var i=0;i<n.length;i++)if(n[i]===e){n.splice(i,1),clearTimeout(e);break}}else clearTimeout(e)},Vd.clearAllTimers=function(t){var e=t._timers;"Array"===Vd.typeOf(e)&&(e.map((function(t){clearTimeout(t)})),t._timerIds=[])},Vd.createImgBtn=function(t,e,n,i){var r,o,s,a=Vd.createDom("xg-".concat(t),"",{},"xgplayer-".concat(t,"-img"));(a.style.backgroundImage='url("'.concat(e,'")'),n&&i)&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(t){return!(n.indexOf(t)>-1&&i.indexOf(t)>-1)||(r=parseFloat(n.slice(0,n.indexOf(t)).trim()),o=parseFloat(i.slice(0,i.indexOf(t)).trim()),s=t,!1)})),a.style.width="".concat(r).concat(s),a.style.height="".concat(o).concat(s),a.style.backgroundSize="".concat(r).concat(s," ").concat(o).concat(s),a.style.margin="start"===t?"-".concat(o/2).concat(s," auto auto -").concat(r/2).concat(s):"auto 5px auto 5px");return a},Vd.Hex2RGBA=function(t,e){var n=[];if(/^\#[0-9A-F]{3}$/i.test(t)){var i="#";t.replace(/[0-9A-F]/gi,(function(t){i+=t+t})),t=i}return/^#[0-9A-F]{6}$/i.test(t)?(t.replace(/[0-9A-F]{2}/gi,(function(t){n.push(parseInt(t,16))})),"rgba(".concat(n.join(","),", ").concat(e,")")):"rgba(255, 255, 255, 0.1)"},Vd.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},Vd.checkIsFunction=function(t){return t&&"function"==typeof t},Vd.checkIsObject=function(t){return null!==t&&"object"===di(t)},Vd.hide=function(t){t.style.display="none"},Vd.show=function(t,e){t.style.display=e||"block"},Vd.isUndefined=function(t){if(null==t)return!0},Vd.setStyleFromCsstext=function(t,e){e&&("String"===Vd.typeOf(e)?e.replace(/\s+/g,"").split(";").map((function(e){if(e){var n=e.split(":");n.length>1&&(t.style[n[0]]=n[1])}})):Object.keys(e).map((function(n){t.style[n]=e[n]})))},Vd.filterStyleFromText=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=t.style.cssText;if(!n)return{};var i=n.replace(/\s+/g,"").split(";"),r={},o={};return i.map((function(t){if(t){var n=t.split(":");n.length>1&&(Gd(n[0],e)?r[n[0]]=n[1]:o[n[0]]=n[1])}})),t.setAttribute("style",""),Object.keys(o).map((function(e){t.style[e]=o[e]})),r},Vd.getStyleFromCsstext=function(t){var e=t.style.cssText;if(!e)return{};var n=e.replace(/\s+/g,"").split(";"),i={};return n.map((function(t){if(t){var e=t.split(":");e.length>1&&(i[e[0]]=e[1])}})),i},Vd.preloadImg=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=new window.Image;i.complete?e&&e():(i.onload=function(t){i=null,e&&e(t)},i.onerror=function(t){i=null,n&&n(t)}),i.src=t},Vd.stopPropagation=function(t){t&&(t.stopPropagation(),t.cancelable&&t.preventDefault())},Vd.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},Vd.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},Vd.checkTouchSupport=function(){return"ontouchstart"in window},Vd.getBuffered2=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=[],i=0;i<t.length;i++)n.push({start:t.start(i)<.5?0:t.start(i),end:t.end(i)});n.sort((function(t,e){var n=t.start-e.start;return n||e.end-t.end}));var r=[];if(e)for(var o=0;o<n.length;o++){var s=r.length;if(s){var a=r[s-1].end;n[o].start-a<e?n[o].end>a&&(r[s-1].end=n[o].end):r.push(n[o])}else r.push(n[o])}else r=n;return new Ud(r)},Vd.getEventPos=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return{x:t.x/e,y:t.y/e,clientX:t.clientX/e,clientY:t.clientY/e,offsetX:t.offsetX/e,offsetY:t.offsetY/e,pageX:t.pageX/e,pageY:t.pageY/e}},Vd.requestAnimationFrame=function(t){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(e)return e(t)},Vd.cancelAnimationFrame=function(t){var e=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;e&&e(t)};var Wd=Vd,Yd=/(Android)\s([\d.]+)/,Kd=/(Version)\/([\d.]+)/,zd={get device(){return zd.os.isPc?"pc":"mobile"},get browser(){if("undefined"==typeof navigator)return"";var t=navigator.userAgent.toLowerCase(),e={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(e).filter((function(n){return e[n].test(t)})))[0]},get os(){if("undefined"==typeof navigator)return{};var t=navigator.userAgent,e=/(?:Windows Phone)/.test(t),n=/(?:SymbianOS)/.test(t)||e,i=/(?:Android)/.test(t),r=/(?:Firefox)/.test(t),o=/(?:iPad|PlayBook)/.test(t)||i&&!/(?:Mobile)/.test(t)||r&&/(?:Tablet)/.test(t),s=/(?:iPhone)/.test(t)&&!o,a=!(s||i||n||o);return{isTablet:o,isPhone:s,isIpad:/(?:iPad|PlayBook)/.test(t),isIos:s,isAndroid:i,isPc:a,isSymbian:n,isWindowsPhone:e,isFireFox:r}},get osVersion(){var t=navigator.userAgent,e="",n=(e=/(?:iPhone)|(?:iPad|PlayBook)/.test(t)?Kd:Yd)?e.exec(t):[];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())||void 0}},Xd=zd,qd="3.0.0-next.2",$d={1:"network",2:"network",3:"decoder",4:"format"},Zd=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{}};ui(this,t);var i=e.i18n.ERROR_TYPES;if(e.video){var r=e.video.error||{},o=e.duration,s=e.currentTime,a=e.ended,c=e.src,l=e.video,u=l.readyState,h=l.networkState,f={playerVersion:qd,currentTime:s,duration:o,ended:a,readyState:u,networkState:h,src:c,errorType:n.errorType,errorCode:n.errorCode||r.code,message:n.errorMessage||r.message,mediaError:r,originError:n.originError?n.originError.stack:""};return n.ext&&Object.keys(n.ext).map((function(t){f[t]=n.ext[t]})),f}if(arguments.length>1){for(var d={playerVersion:qd,domain:document.domain},p=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],g=0;g<arguments.length;g++)d[p[g]]=arguments[g];return d.ex=(i[arguments[0]]||{}).msg,d}},Jd="play",Qd="playing",tp="ended",ep="pause",np="error",ip="seeking",rp="seeked",op="timeupdate",sp="waiting",ap="canplay",cp="durationchange",lp="volumechange",up="loadeddata",hp="ratechange",fp="progress",dp="loadstart",pp="emptied",gp="focus",vp="blur",yp="ready",mp="urlNull",kp="autoplay_started",bp="autoplay_was_prevented",wp="complete",Cp="replay",xp="destroy",_p="urlchange",Ep="fullscreen_change",Tp="cssFullscreen_change",Sp="mini_state_change",Pp="definition_change",Rp="after_definition_change",Op="video_resize",Ip="pip_change",Lp="rotate",Ap="screenShot",Dp="playnext",Mp="shortcut",Np="xglog",Fp="user_action",jp=Object.freeze({__proto__:null,PLAY:Jd,PLAYING:Qd,ENDED:tp,PAUSE:ep,ERROR:np,SEEKING:ip,SEEKED:rp,TIME_UPDATE:op,WAITING:sp,CANPLAY:ap,CANPLAY_THROUGH:"canplaythrough",DURATION_CHANGE:cp,VOLUME_CHANGE:lp,LOADED_DATA:up,RATE_CHANGE:hp,PROGRESS:fp,LOAD_START:dp,EMPTIED:pp,STALLED:"stalled",SUSPEND:"suspend",ABORT:"abort",BUFFER_CHANGE:"bufferedChange",PLAYER_FOCUS:gp,PLAYER_BLUR:vp,READY:yp,URL_NULL:mp,AUTOPLAY_STARTED:kp,AUTOPLAY_PREVENTED:bp,COMPLETE:wp,REPLAY:Cp,DESTROY:xp,URL_CHANGE:_p,FULLSCREEN_CHANGE:Ep,CSS_FULLSCREEN_CHANGE:Tp,MINI_STATE_CHANGE:Sp,DEFINITION_CHANGE:Pp,BEFORE_DEFINITION_CHANGE:"before_definition_change",AFTER_DEFINITION_CHANGE:Rp,SEI_PARSED:"SEI_PARSED",RETRY:"retry",VIDEO_RESIZE:Op,PIP_CHANGE:Ip,ROTATE:Lp,SCREEN_SHOT:Ap,PLAYNEXT:Dp,SHORTCUT:Mp,XGLOG:Np,USER_ACTION:Fp,USER_ACTION1:"user_action1"});function Bp(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Hp=["play","playing","pause","ended","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadstart","emptied","ratechange","progress","stalled","suspend","abort"];function Up(t,e){this&&this.emit&&("error"===t?this.errorHandler(t):this.emit(t,e))}var Vp=function(t){fi(n,t);var e=Bp(n);function n(t){var i;ui(this,n),(i=e.call(this,t))._hasStart=!1,i._currentTime=0,i._duration=0,i.videoConfig=Object.assign({},{controls:!1,autoplay:t.autoplay,playsinline:t.playsinline,"x5-playsinline":t.playsinline,"webkit-playsinline":t.playsinline,"x5-video-player-fullscreen":t["x5-video-player-fullscreen"]||t.x5VideoPlayerFullscreen,"x5-video-orientation":t["x5-video-orientation"]||t.x5VideoOrientation,airplay:t.airplay,"webkit-airplay":t.airplay,tabindex:2,mediaType:t.mediaType||"video"},t.videoConfig,t.videoAttributes);var r=t["x5-video-player-type"]||t.x5VideoPlayerType;return Xd.isWeixin&&Xd.os.isAndroid&&r&&(i.videoConfig["x5-video-player-type"]=r,delete i.videoConfig.playsinline,delete i.videoConfig["webkit-playsinline"],delete i.videoConfig["x5-playsinline"]),t.loop&&(i.videoConfig.loop="loop"),i.video=Wd.createDom(i.videoConfig.mediaType,"",i.videoConfig,""),t.defaultPlaybackRate&&(i.video.defaultPlaybackRate=i.video.playbackRate=t.defaultPlaybackRate),"Number"===Wd.typeOf(t.volume)&&(i.volume=t.volume),t.autoplayMuted&&(i.video.muted=!0),t.autoplay&&(i.video.autoplay=!0),i._interval={},i.videoEventMiddleware={},i.attachVideoEvents(),i}return Co(n,[{key:"setEventsMiddleware",value:function(t){var e=this;Object.keys(t).map((function(n){e.videoEventMiddleware[n]=t[n]}))}},{key:"removeEventsMiddleware",value:function(t){var e=this;Object.keys(t).map((function(t){delete e.videoEventMiddleware[t]}))}},{key:"attachVideoEvents",value:function(t){var e=this;this.evHandlers||(this._evHandlers=Hp.map((function(t){return yi({},t,(i=e,r="on".concat((n=t).charAt(0).toUpperCase()).concat(n.slice(1)),i[r]&&"function"==typeof i[r]&&i.on(n,i[r]),function(t){var e=n;if(t.player=i,t.eventName=n,"timeupdate"===e&&(i._currentTime=i.video&&i.video.currentTime),"durationchange"===n&&(i._duration=i.video.duration),i.videoEventMiddleware[n]){var r=Up.bind(i);try{i.videoEventMiddleware[n].call(i,t,r)}catch(t){throw Up.call(i,e,t),t}}else Up.call(i,e,t)}));var n,i,r}))),t||(t=this.video),this._evHandlers.map((function(e){var n=Object.keys(e)[0];t.addEventListener(n,e[n],!1)}))}},{key:"detachVideoEvents",value:function(t){t||(t=this.video),this._evHandlers.map((function(e){var n=Object.keys(e)[0];t.removeEventListener(Object.keys(e)[0],e[n],!1)}))}},{key:"errorHandler",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.video&&(this.video.error||e)){var n=this.video.error||e,i=n.code?$d[n.code]:"other";this.emit(t,new Zd(this,{errorType:i,errorCode:n.code,errorMessage:n.message||""}))}}},{key:"destroy",value:function(){var t=this;for(var e in this.video&&(this.video.pause&&this.video.pause(),this.video.removeAttribute("src")),this._currentTime=0,this._duration=0,this.videoConfig=null,this._interval)clearInterval(this._interval[e]),this._interval[e]=null;this.emit(xp),this.detachVideoEvents(),this._evHandlers.map((function(e){var n=Object.keys(e)[0],i="on".concat(n.charAt(0).toUpperCase()).concat(n.slice(1));"function"==typeof t[i]&&t.off(n,t[i])})),this._evHandlers=null,this.video=null,this.videoEventMiddleware={},this.removeAllListeners()}},{key:"play",value:function(){return this.video?this.video.play():null}},{key:"pause",value:function(){this.video&&this.video.pause()}},{key:"canPlayType",value:function(t){return this.video.canPlayType(t)}},{key:"getBufferedRange",value:function(t){var e=[0,0];if(!this.video)return e;t||(t=this.video.buffered);var n=this.video.currentTime;if(t)for(var i=0,r=t.length;i<r&&(e[0]=t.start(i),e[1]=t.end(i),!(e[0]<=n&&n<=e[1]));i++);return e[0]-n<=0&&n-e[1]<=0?e:[0,0]}},{key:"autoplay",get:function(){return this.video.autoplay},set:function(t){this.video.autoplay=t}},{key:"buffered",get:function(){return this.video.buffered}},{key:"buffered2",get:function(){return Wd.getBuffered2(this.video.buffered)}},{key:"bufferedPoint",get:function(){var t=this.video.buffered,e={start:0,end:0};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.video.crossOrigin},set:function(t){this.video.crossOrigin=t}},{key:"currentSrc",get:function(){return this.video.currentSrc},set:function(t){this.video.currentSrc=t}},{key:"currentTime",get:function(){return void 0!==this.video.currentTime?this.video.currentTime:this._currentTime},set:function(t){this.video.currentTime=t}},{key:"defaultMuted",get:function(){return this.video.defaultMuted},set:function(t){this.video.defaultMuted=t}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return this.video.ended}},{key:"error",get:function(){return this.video.error}},{key:"errorNote",get:function(){var t=this.video.error;if(!t)return"";return["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][t.code-1]}},{key:"loop",get:function(){return this.video.loop},set:function(t){this.video.loop=t}},{key:"muted",get:function(){return this.video.muted},set:function(t){this.video.muted=t}},{key:"networkState",get:function(){return this.video.networkState}},{key:"paused",get:function(){return this.video.paused}},{key:"playbackRate",get:function(){return this.video.playbackRate},set:function(t){this.video.defaultPlaybackRate=t,this.video.playbackRate=t}},{key:"played",get:function(){return this.video.played}},{key:"preload",get:function(){return this.video.preload},set:function(t){this.video.preload=t}},{key:"readyState",get:function(){return this.video.readyState}},{key:"seekable",get:function(){return this.video.seekable}},{key:"seeking",get:function(){return this.video.seeking}},{key:"src",get:function(){return this.video.src},set:function(t){this.emit(_p,t),this.emit(sp),this._currentTime=0,this._duration=0,/^blob/.test(this.video.currentSrc)||/^blob/.test(this.video.src)?this.onWaiting():this.video.src=t}},{key:"volume",get:function(){return this.video.volume},set:function(t){this.video.volume=t}},{key:"emit",value:function(t,e){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(i=xo(vi(n.prototype),"emit",this)).call.apply(i,[this,t,e].concat(o))}},{key:"on",value:function(t,e){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(i=xo(vi(n.prototype),"on",this)).call.apply(i,[this,t,e].concat(o))}},{key:"once",value:function(t,e){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(i=xo(vi(n.prototype),"once",this)).call.apply(i,[this,t,e].concat(o))}},{key:"off",value:function(t,e){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(i=xo(vi(n.prototype),"off",this)).call.apply(i,[this,t,e].concat(o))}},{key:"offAll",value:function(){xo(vi(n.prototype),"removeAllListeners",this).call(this)}}]),n}(Gh),Gp=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};ui(this,t),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=e}return Co(t,[{key:"openDB",value:function(t){var e=this,n=this,i=this.myDB.version||1,r=n.indexedDB.open(n.myDB.name,i);r.onerror=function(t){},r.onsuccess=function(i){e.myDB.db=i.target.result,t.call(n)},r.onupgradeneeded=function(t){var e=t.target.result;t.target.transaction,e.objectStoreNames.contains(n.myDB.ojstore.name)||e.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(t,e){for(var n,i=this.myDB.db.transaction(t,"readwrite").objectStore(t),r=0;r<e.length;r++)(n=i.add(e[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"putData",value:function(t,e){for(var n,i=this.myDB.db.transaction(t,"readwrite").objectStore(t),r=0;r<e.length;r++)(n=i.put(e[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"getDataByKey",value:function(t,e,n){var i=this,r=this.myDB.db.transaction(t,"readwrite").objectStore(t).get(e);r.onerror=function(){n.call(i,null)},r.onsuccess=function(t){var e=t.target.result;n.call(i,e)}}},{key:"deleteData",value:function(t,e){this.myDB.db.transaction(t,"readwrite").objectStore(t).delete(e)}},{key:"clearData",value:function(t){this.myDB.db.transaction(t,"readwrite").objectStore(t).clear()}}]),t}(),Wp=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],Yp=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],Kp=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],zp=Kn,Xp=Dt,qp=ht("unscopables"),$p=Array.prototype;null==$p[qp]&&Xp.f($p,qp,{configurable:!0,value:zp(null)});var Zp=function(t){$p[qp][t]=!0},Jp=En,Qp=Zi.find,tg=Zp,eg="find",ng=!0;function ig(t,e,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 s=e.call.apply(e,[t].concat(r));n&&"function"==typeof n&&(s&&s.then?s.then((function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];n.call.apply(n,[t].concat(i))})):n.call.apply(n,[t].concat(r)))}function rg(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[t]&&(this.__hooks[t]=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(e){throw e.message="[pluginName: ".concat(this.pluginName,":").concat(t,":pre error] >> ").concat(e.message),e}if(this.__hooks&&this.__hooks[t])try{var s,a=(s=this.__hooks[t]).call.apply(s,[this,this].concat(Array.prototype.slice.call(arguments)));a?a.then?a.then((function(t){!1!==t&&ig.apply(void 0,[r,e,n.next].concat(Yh(i)))})).catch((function(t){throw t})):ig.apply(void 0,[this,e,n.next].concat(Array.prototype.slice.call(arguments))):void 0===a&&ig.apply(void 0,[this,e,n.next].concat(Array.prototype.slice.call(arguments)))}catch(e){throw e.message="[pluginName: ".concat(this.pluginName,":").concat(t,"] >> ").concat(e.message),e}else ig.apply(void 0,[this,e,n.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function og(t,e){var n=this.__hooks;if(n)return n.hasOwnProperty(t)?(n&&(n[t]=e),!0):(console.warn("has no supported hook which name [".concat(t,"]")),!1)}function sg(t){if(this.plugins&&this.plugins[t.toLowerCase()]){for(var e=this.plugins[t.toLowerCase()],n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return e.useHooks&&e.useHooks.apply(e,i)}}function ag(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];t.__hooks={},e&&e.map((function(e){t.__hooks[e]=null})),Object.defineProperty(t,"hooks",{get:function(){return t.__hooks&&Object.keys(t.__hooks).map((function(e){if(t.__hooks[e])return e}))}})}function cg(t){t.__hooks=null}function lg(t,e,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(!t.__hooks||!t.__hooks[e])return n.call.apply(n,[t,t].concat(r));var s,a=(s=t.__hooks[e]).call.apply(s,[t,t].concat(r));if(a&&a.then)a.then((function(e){return!1===e?null:n.call.apply(n,[t,t].concat(r))})).catch((function(t){console.warn("[runHooks]".concat(e," reject"),t.message)}));else if(!1!==a)return n.call.apply(n,[t,t].concat(r))}function ug(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function hg(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ug(Object(n),!0).forEach((function(e){yi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ug(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function fg(t,e){Hd.logError("[".concat(t,"] event or callback cant be undefined or null when call ").concat(e))}eg in[]&&Array(1).find((function(){ng=!1})),Jp({target:"Array",proto:!0,forced:ng},{find:function(t){return Qp(this,t,arguments.length>1?arguments[1]:void 0)}}),tg(eg);var dg=function(){function t(e){ui(this,t),Wd.checkIsFunction(this.beforeCreate)&&this.beforeCreate(e),ag(this),this.__args=e,this.__events={},this.config=e.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(e)}return Co(t,[{key:"beforeCreate",value:function(t){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(t){this.player=t.player,this.playerConfig=t.player&&t.player.config,this.pluginName=t.pluginName?t.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=t.player&&t.player.logger}},{key:"updateLang",value:function(t){}},{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:"on",value:function(t,e){var n=this;t&&e&&this.player?"string"==typeof t?(this.__events[t]=e,this.player.on(t,e)):Array.isArray(t)&&t.forEach((function(t){n.__events[t]=e,n.player.on(t,e)})):fg(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(t,e){t&&e&&this.player?this.player.once(t,e):fg(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(t,e){var n=this;t&&e&&this.player?"string"==typeof t?(delete this.__events[t],this.player.off(t,e)):Array.isArray(t)&&t.forEach((function(i){delete n.__events[t],n.player.off(i,e)})):fg(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var t=this;Object.keys(this.__events).map((function(e){t.__events[e]&&t.off(e,t.__events[e]),e&&delete t.__events[e]})),this.__events={}}},{key:"emit",value:function(t,e){this.player&&this.player.emit(t,e)}},{key:"emitUserAction",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(e&&t){var r="String"===Wd.typeOf(t)?t:t.type||"";t=new Event(r),"Array"!==Wd.typeOf(n)&&(n=[n]),this.emit(Fp,hg({action:e,pluginName:this.pluginName,currentTime:this.player.currentTime,duration:this.player.duration,ended:this.player.ended,event:t,props:n},i))}}},{key:"hook",value:function(t,e){return rg.call.apply(rg,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return og.call.apply(og,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"registerPlugin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return n&&(e.pluginName=n),this.player.registerPlugin({plugin:t,options:e})}},{key:"getPlugin",value:function(t){return this.player?this.player.getPlugin(t):null}},{key:"__destroy",value:function(){var t=this,e=this.player,n=this.pluginName;this.offAll(),Wd.clearAllTimers(this),Wd.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(e){t[e]=null})),e.unRegisterPlugin(n),cg(this)}}],[{key:"defineGetterOrSetter",value:function(t,e){for(var n in e)Object.defineProperty(t,n,e[n])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),t}();if("undefined"!=typeof Element&&!Element.prototype.matches){var pg=Element.prototype;pg.matches=pg.matchesSelector||pg.mozMatchesSelector||pg.msMatchesSelector||pg.oMatchesSelector||pg.webkitMatchesSelector}var gg=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}};function vg(t,e,n,i,r){var o=yg.apply(this,arguments);return t.addEventListener(n,o,r),{destroy:function(){t.removeEventListener(n,o,r)}}}function yg(t,e,n,i){return function(n){n.delegateTarget=gg(n.target,e),n.delegateTarget&&i.call(t,n)}}var mg=function(t,e,n,i,r){return"function"==typeof t.addEventListener?vg.apply(null,arguments):"function"==typeof n?vg.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,(function(t){return vg(t,e,n,i,r)})))};function kg(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var bg={CONTROLS:"controls",ROOT:"root"},wg={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 Cg(t){return!!t&&(t.indexOf&&/^http/.test(t))}function xg(t,e){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(t instanceof window.Element)return Wd.addClass(t,n),Object.keys(i).map((function(e){t.setAttribute(e,i[e])})),t;if(Cg(t)||Cg(t.url))return i.src=Cg(t)?t:t.url||"",o=Wd.createDom(t.tag||"img","",i,"xg-img ".concat(n));if("function"==typeof t)try{return(o=t())instanceof window.Element?(Wd.addClass(o,n),Object.keys(i).map((function(t){o.setAttribute(t,i[t])})),o):(Hd.logWarn("warn>>icons.".concat(e," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(t){return Hd.logError("Plugin named [".concat(r,"]:createIcon"),t),null}return"string"==typeof t?Wd.createDomFromHtml(t,i,n):(Hd.logWarn("warn>>icons.".concat(e," in config of plugin named [").concat(r,"] is invalid")),null)}function _g(t,e){var n=e.config.icons||e.playerConfig.icons;Object.keys(t).map((function(i){var r=t[i],o=r&&r.class?r.class:"",s=r&&r.attr?r.attr:{},a=null;n&&n[i]&&(o=function(t,e){return"object"===di(t)&&t.class&&"string"==typeof t.class?"".concat(e," ").concat(t.class):e}(n[i],o),s=function(t,e){return"object"===di(t)&&t.attr&&"object"===di(t.attr)&&Object.keys(t.attr).map((function(n){e[n]=t.attr[n]})),e}(n[i],s),a=xg(n[i],i,o,s,e.pluginName)),!a&&r&&(a=xg(r.icon?r.icon:r,s,o,{},e.pluginName)),e.icons[i]=a}))}var Eg,Tg,Sg,Pg=function(t){fi(n,t);var e=kg(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ui(this,n),(t=e.call(this,i)).__delegates=[],t}return Co(n,[{key:"__init",value:function(t){if(xo(vi(n.prototype),"__init",this).call(this,t),t.root){var e=t.root,i=null;this.icons={},this.root=null,this.parent=null,_g(this.registerIcons()||{},this),this.langText={};var r,o,s=this.registerLanguageTexts()||{};r=s,o=this,Object.keys(r).map((function(t){Object.defineProperty(o.langText,t,{get:function(){var e=o.lang;return r[t][e]||r[t].zh}})}));var a="";try{a=this.render()}catch(t){throw Hd.logError("Plugin:".concat(this.pluginName,":render"),t),new Error("Plugin:".concat(this.pluginName,":render:").concat(t.message))}if(a)(i=n.insert(a,e,t.index)).setAttribute("data-index",t.index);else{if(!t.tag)return;(i=Wd.createDom(t.tag,"",t.attr,t.name)).setAttribute("data-index",t.index),e.appendChild(i)}this.root=i,this.parent=e;var c=this.config.attr||{},l=this.config.style||{};this.setAttr(c),this.setStyle(l),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var t=this;if(this.root){this._children=[];var e=this.children();e&&"object"===di(e)&&Object.keys(e).length>0&&Object.keys(e).map((function(n){var i,r,o=n,s=e[o],a={root:t.root};"function"==typeof s?(i=t.config[o]||{},r=s):"object"===di(s)&&"function"==typeof s.plugin&&(i=s.options?Wd.deepCopy(t.config[o]||{},s.options):t.config[o]||{},r=s.plugin),a.config=i,void 0!==i.index&&(a.index=i.index),i.root&&(a.root=i.root),t.registerPlugin(r,a,o)}))}}},{key:"updateLang",value:function(t){t||(t=this.lang);var e=this.root,n=this.i18n,i=this.langText;e&&function t(e,n){for(var i=0;i<e.children.length;i++)e.children[i].children.length>0?t(e.children[i],n):n(e.children[i])}(e,(function(e){var r=e.getAttribute&&e.getAttribute("lang-key");if(r){var o=n[r.toUpperCase()]||i[r];o&&(e.innerHTML="function"==typeof o?o(t):o)}}))}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.i18n||{},i=this.langText;t.setAttribute&&t.setAttribute("lang-key",e);var r=n[e.toUpperCase()]||i[e];r&&(t.innerHTML=r)}},{key:"plugins",value:function(){return this._children}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.root=e.root||this.root;var r=xo(vi(n.prototype),"registerPlugin",this).call(this,t,e,i);return this._children.push(r),r}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(t){if(this.root)return this.root.querySelector(t)}},{key:"bind",value:function(t,e,i){var r=this;if(arguments.length<3&&"function"==typeof e)Array.isArray(t)?t.forEach((function(t){r.bindEL(t,e)})):this.bindEL(t,e);else{var o=n.delegate.call(this,this.root,t,e,i);this.__delegates=this.__delegates.concat(o)}}},{key:"unbind",value:function(t,e){var n=this;if(arguments.length<3&&"function"==typeof e)Array.isArray(t)?t.forEach((function(t){n.unbindEL(t,e)})):this.unbindEL(t,e);else for(var i="".concat(t,"_").concat(e),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(t,e){var n=this;if(this.root)return"String"===Wd.typeOf(t)?this.root.style[t]=e:void("Object"===Wd.typeOf(t)&&Object.keys(t).map((function(e){n.root.style[e]=t[e]})))}},{key:"setAttr",value:function(t,e){var n=this;if(this.root)return"String"===Wd.typeOf(t)?this.root.setAttribute(t,e):void("Object"===Wd.typeOf(t)&&Object.keys(t).map((function(e){n.root.setAttribute(e,t[e])})))}},{key:"setHtml",value:function(t,e){this.root&&(this.root.innerHTML=t,"function"==typeof e&&e())}},{key:"bindEL",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(t)in this.root&&"function"==typeof e&&this.root.addEventListener(t,e,n)}},{key:"unbindEL",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(t)in this.root&&"function"==typeof e&&this.root.removeEventListener(t,e,n)}},{key:"show",value:function(t){if(this.root)return this.root.style.display=void 0!==t?t:"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(t,e){if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!(e&&e instanceof window.Element))return null;try{return"string"==typeof t?this.find(t).appendChild(e):t.appendChild(e)}catch(t){return Hd.logError("Plugin:appendChild",t),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var t=this,e=this.player;this.__delegates.map((function(t){t.destroy()})),this.__delegates=[],this._children instanceof Array&&(this._children.map((function(t){e.unRegisterPlugin(t.pluginName)})),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),xo(vi(n.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(e){t[e]=null}))}}],[{key:"insert",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=e.children.length,r=Number(n),o=t instanceof window.Node;if(i){for(var s=0,a=null,c="";s<i;s++){a=e.children[s];var l=Number(a.getAttribute("data-index"));if(l>=r){c="beforebegin";break}l<r&&(c="afterend")}return o?"afterend"===c?e.appendChild(t):e.insertBefore(t,a):a.insertAdjacentHTML(c,t),"afterend"===c?e.children[e.children.length-1]:e.children[s]}return o?e.appendChild(t):e.insertAdjacentHTML("beforeend",t),e.children[e.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(t,e,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(t instanceof window.Node&&"function"==typeof i)if(Array.isArray(n))n.forEach((function(n){var s=mg(t,e,n,i,r);s.key="".concat(e,"_").concat(n),o.push(s)}));else{var s=mg(t,e,n,i,r);s.key="".concat(e,"_").concat(n),o.push(s)}return o}},{key:"ROOT_TYPES",get:function(){return bg}},{key:"POSITIONS",get:function(){return wg}}]),n}(dg),Rg=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Og=J,Ig=q,Lg=Rg,Ag=re("IE_PROTO"),Dg=Object.prototype,Mg=Lg?Object.getPrototypeOf:function(t){return t=Ig(t),Og(t,Ag)?t[Ag]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Dg:null},Ng=r,Fg=Mg,jg=Wt,Bg=J,Hg=ht("iterator"),Ug=!1;[].keys&&("next"in(Sg=[].keys())?(Tg=Fg(Fg(Sg)))!==Object.prototype&&(Eg=Tg):Ug=!0),(null==Eg||Ng((function(){var t={};return Eg[Hg].call(t)!==t})))&&(Eg={}),Bg(Eg,Hg)||jg(Eg,Hg,(function(){return this}));var Vg={IteratorPrototype:Eg,BUGGY_SAFARI_ITERATORS:Ug},Gg=Vg.IteratorPrototype,Wg=Kn,Yg=f,Kg=Ni,zg=gc,Xg=function(){return this},qg=En,$g=function(t,e,n){var i=e+" Iterator";return t.prototype=Wg(Gg,{next:Yg(1,n)}),Kg(t,i,!1),zg[i]=Xg,t},Zg=Mg,Jg=lc,Qg=Ni,tv=Wt,ev=Yt.exports,nv=gc,iv=Vg.IteratorPrototype,rv=Vg.BUGGY_SAFARI_ITERATORS,ov=ht("iterator"),sv="keys",av="values",cv="entries",lv=function(){return this},uv=function(t,e,n,i,r,o,s){$g(n,e,i);var a,c,l,u=function(t){if(t===r&&g)return g;if(!rv&&t in d)return d[t];switch(t){case sv:case av:case cv:return function(){return new n(this,t)}}return function(){return new n(this)}},h=e+" Iterator",f=!1,d=t.prototype,p=d[ov]||d["@@iterator"]||r&&d[r],g=!rv&&p||u(r),v="Array"==e&&d.entries||p;if(v&&(a=Zg(v.call(new t)),iv!==Object.prototype&&a.next&&(Zg(a)!==iv&&(Jg?Jg(a,iv):"function"!=typeof a[ov]&&tv(a,ov,lv)),Qg(a,h,!0))),r==av&&p&&p.name!==av&&(f=!0,g=function(){return p.call(this)}),d[ov]!==g&&tv(d,ov,g),nv[e]=g,r)if(c={values:u(av),keys:o?g:u(sv),entries:u(cv)},s)for(l in c)(rv||f||!(l in d))&&ev(d,l,c[l]);else qg({target:e,proto:!0,forced:rv||f},c);return c},hv=w,fv=Zp,dv=gc,pv=be,gv=uv,vv="Array Iterator",yv=pv.set,mv=pv.getterFor(vv),kv=gv(Array,"Array",(function(t,e){yv(this,{type:vv,target:hv(t),index:0,kind:e})}),(function(){var t=mv(this),e=t.target,n=t.kind,i=t.index++;return!e||i>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:e[i],done:!1}:{value:[i,e[i]],done:!1}}),"values");dv.Arguments=dv.Array,fv("keys"),fv("values"),fv("entries");var bv=ca.charAt,wv=wi,Cv=be,xv=uv,_v="String Iterator",Ev=Cv.set,Tv=Cv.getterFor(_v);xv(String,"String",(function(t){Ev(this,{type:_v,string:wv(t),index:0})}),(function(){var t,e=Tv(this),n=e.string,i=e.index;return i>=n.length?{value:void 0,done:!0}:(t=bv(n,i),e.index+=t.length,{value:t,done:!1})}));var Sv=n,Pv=os,Rv=kv,Ov=Wt,Iv=ht,Lv=Iv("iterator"),Av=Iv("toStringTag"),Dv=Rv.values;for(var Mv in Pv){var Nv=Sv[Mv],Fv=Nv&&Nv.prototype;if(Fv){if(Fv[Lv]!==Dv)try{Ov(Fv,Lv,Dv)}catch(t){Fv[Lv]=Dv}if(Fv[Av]||Ov(Fv,Av,Mv),Pv[Mv])for(var jv in Rv)if(Fv[jv]!==Rv[jv])try{Ov(Fv,jv,Rv[jv])}catch(t){Fv[jv]=Rv[jv]}}}var Bv=function(){function t(){var e=this;if(ui(this,t),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver((function(t){var n=(new Date).getTime();n-e.timeStamp<100||(e.timeStamp=n,e.__trigger(t))})),this.timeStamp=(new Date).getTime()}catch(t){console.error(t)}}return Co(t,[{key:"addObserver",value:function(t,e){if(this.observer){this.observer&&this.observer.observe(t);for(var n=this.__handlers,i=-1,r=0;r<n.length;r++)n[r]&&t===n[r].target&&(i=r);i>-1?this.__handlers[i].handler=e:this.__handlers.push({target:t,handler:e})}}},{key:"unObserver",value:function(t){var e=-1;this.__handlers.map((function(n,i){t===n.target&&(e=i)}));try{this.observer&&this.observer.unobserve(t)}catch(t){}this.observer&&this.observer.unobserve(t),e>-1&&this.__handlers.splice(e,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(t){for(var e=this.__handlers,n=0;n<e.length;n++)if(e[n]&&t===e[n].target){try{e[n].handler(t)}catch(t){console.error(t)}return!0}return!1}},{key:"__trigger",value:function(t){for(var e=0;e<t.length;e++){if(this.__runHandler(t[e].target))break}}}]),t}(),Hv=null;function Uv(t){return"Object"===Object.prototype.toString.call(t).match(/([^\s.*]+)(?=]$)/g)[0]}function Vv(t){return"Boolean"===Object.prototype.toString.call(t).match(/([^\s.*]+)(?=]$)/g)[0]}var Gv={init:function(t){var e,n,i=t._pluginInfoId;i||(i=(new Date).getTime(),t._pluginInfoId=i),this.pluginGroup||(this.pluginGroup={}),!t.config.closeResizeObserver&&(e=t.root,n=function(){t.resize()},Hv||(Hv=new Bv),Hv.addObserver(e,n)),this.pluginGroup[i]={_player:t,_originalOptions:t.config||{}}},checkPlayerRoot:function(t){if(this.pluginGroup){for(var e=Object.keys(this.pluginGroup),n=0;n<e.length;n++){var i=this.pluginGroup[e[n]]._player;if(i.root===t)return i}return null}return null},lazyRegister:function(t,e){var n=this,i=e.timeout||1500;return Promise.race([e.loader().then((function(e){var i;i=e&&e.__esModule?e.default:e,n.register(t,i,e.options)})),new Promise((function(t,e){setTimeout((function(){e(new Error("timeout"))}),i)}))])},register:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e&&"function"==typeof e&&void 0!==e.prototype){var i=t._pluginInfoId;i&&this.pluginGroup&&this.pluginGroup[i]||(this.init(t),i=t._pluginInfoId),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 s=n.pluginName||e.pluginName;if(!s)throw new Error("The property pluginName is necessary");if(!e.isSupported||e.isSupported()){n.config||(n.config={});for(var a=Object.keys(o),c=0;c<a.length;c++)if(s.toLowerCase()===a[c].toLowerCase()){var l=o[a[c]];Uv(l)&&(n.config=Object.assign({},n.config,o[a[c]])),Vv(l)&&(n.config.disable=!l);break}e.defaultConfig&&Object.keys(e.defaultConfig).map((function(t){void 0===n.config[t]&&(n.config[t]=e.defaultConfig[t])})),n.root?"string"==typeof n.root&&(n.root=t[n.root]):n.root=t.root,n.index=n.config.index||0;try{r[s.toLowerCase()]&&(this.unRegister(i,s.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(s,"] exist, destroy the old instance")));var u=new e(n);return r[s.toLowerCase()]=u,r[s.toLowerCase()].func=e,u&&"function"==typeof u.afterCreate&&u.afterCreate(),u}catch(t){throw console.error(t),t}}else console.warn("not supported plugin [".concat(s,"]"))}},unRegister:function(t,e){t._pluginInfoId&&(t=t._pluginInfoId),e=e.toLowerCase();try{var n=this.pluginGroup[t]._plugins[e];n&&(n.pluginName&&n.__destroy(),delete this.pluginGroup[t]._plugins[e])}catch(n){console.error("[unRegister:".concat(e,"] cgid:[").concat(t,"] error"),n)}},deletePlugin:function(t,e){var n=t._pluginInfoId;n&&this.pluginGroup&&this.pluginGroup[n]&&this.pluginGroup[n]._plugins&&delete this.pluginGroup[n]._plugins[e]},getPlugins:function(t){var e=t._pluginInfoId;return e?this.pluginGroup[e]._plugins:{}},findPlugin:function(t,e){var n=t._pluginInfoId;if(!this.pluginGroup||!n)return null;var i=e.toLowerCase();return this.pluginGroup[n]._plugins[i]},beforeInit:function(t){var e=this;function n(t){return t&&t.then?t:new Promise((function(t){t()}))}return new Promise((function(i){if(e.pluginGroup)return(t._loadingPlugins&&t._loadingPlugins.length?Promise.all(t._loadingPlugins):Promise.resolve()).then((function(){var r=t._pluginInfoId;if(e.pluginGroup[r]){for(var o=e.pluginGroup[r]._plugins,s=[],a=0,c=Object.keys(o);a<c.length;a++){var l=c[a];if(o[l]&&o[l].beforePlayerInit)try{var u=o[l].beforePlayerInit();s.push(n(u))}catch(t){throw s.push(n(null)),t}}Promise.all([].concat(s)).then((function(){i()})).catch((function(t){console.error(t),i()}))}else i()}))}))},afterInit:function(t){var e=t._pluginInfoId;if(this.pluginGroup&&e)for(var n=this.pluginGroup[e]._plugins,i=0,r=Object.keys(n);i<r.length;i++){var o=r[i];n[o]&&n[o].afterPlayerInit&&n[o].afterPlayerInit()}},setLang:function(t,e){var n=e._pluginInfoId;if(this.pluginGroup&&n){var i=this.pluginGroup[n]._plugins;Object.keys(i).map((function(e){if(i[e].updateLang)i[e].updateLang(t);else try{i[e].lang=t}catch(t){console.warn("".concat(e," setLang"))}}))}},reRender:function(t){var e=t._pluginInfoId;if(e){for(var n={},i=this.pluginGroup[e]._plugins,r=0,o=Object.keys(i);r<o.length;r++){var s=o[r];n[s]={plugin:i[s].func,options:i[s]._args},this.unRegister(e,s)}for(var a=0,c=Object.keys(n);a<c.length;a++){var l=c[a];this.register(e,l,n[l].plugin,n[l].options)}}},onPluginsReady:function(t){var e=t._pluginInfoId,n=this.pluginGroup[e]._plugins;e&&n&&Object.keys(n).map((function(t){n[t].onPluginsReady&&"function"==typeof n[t].onPluginsReady&&n[t].onPluginsReady()}))},destroy:function(t){var e=t._pluginInfoId;if(this.pluginGroup[e]){var n,i;n=t.root,Hv.unObserver(n,i);for(var r=this.pluginGroup[e]._plugins,o=0,s=Object.keys(r);o<s.length;o++){var a=s[o];this.unRegister(e,a)}delete this.pluginGroup[e],delete t._pluginInfoId}}},Wv={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-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",INNER_FULLSCREEN:"xgplayer-inner-fullscreen",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",AUTOHIDE:"xgplayer_autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};var Yv=0,Kv=1,zv=2,Xv=3,qv=4,$v=5,Zv=6,Jv=7,Qv=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"];function ty(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var ey=function(t){fi(n,t);var e=ty(n);function n(){var t;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(t=e.call.apply(e,[this].concat(r))),"onMouseEnter",(function(e){var n=pi(t).player;n.userTimer&&(Wd.clearTimeout(n,n.userTimer),clearTimeout(n.userTimer))})),yi(pi(t),"onMouseLeave",(function(){var e=pi(t),n=e.player,i=e.playerConfig,r=i.closeControlsBlur?200:i.inactive;n.focus({hideDelay:r})})),t}return Co(n,[{key:"beforeCreate",value:function(t){t.config.mode||"mobile"!==Xd.device||(t.config.mode="flex"),t.player.config.marginControls&&(t.config.autoHide=!1)}},{key:"afterCreate",value:function(){var t=this,e=this.config,n=e.disable,i=e.height,r=e.mode,o=e.autoHide;if(!n){"flex"===r&&this.player.addClass(Wv.FLEX_CONTROLS),o&&this.player.addClass(Wv.AUTOHIDE);var s={height:"".concat(i,"px")};Object.keys(s).map((function(e){t.root.style[e]=s[e]})),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(Sp,(function(e){e?Wd.addClass(t.root,"mini-controls"):Wd.removeClass(t.root,"mini-controls")})),"mobile"!==Xd.device&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"unFocus",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&Wd.addClass(this.root,"control_autohide")}},{key:"pauseAutoHide",value:function(){Wd.removeClass(this.root,"control_autohide")}},{key:"show",value:function(){Wd.addClass(this.root,"show")}},{key:"hide",value:function(){Wd.removeClass(this.root,"show")}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;if(this.root){var r=t.defaultConfig||{};if(!e.root){var o=e.position?e.position:e.config&&e.config.position?e.config.position:r.position;switch(o){case wg.CONTROLS_LEFT:e.root=this.left;break;case wg.CONTROLS_RIGHT:e.root=this.right;break;case wg.CONTROLS_CENTER:e.root=this.center;break;case wg.CONTROLS:e.root=this.root;break;default:e.root=this.left}return xo(vi(n.prototype),"registerPlugin",this).call(this,t,e,i)}}}},{key:"destroy",value:function(){"mobile"!==Xd.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave))}},{key:"render",value:function(){var t=this.config,e=t.mode,n=t.autoHide,i=t.initShow;if(!t.disable){var r=Wd.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===e},{"bottom-controls":"bottom"===e},{control_autohide:n},{controls_permanent:!n},{"xgplayer-controls-initshow":i||!n});return'<xg-controls class="'.concat(r,'" unselectable="on" onselectstart="return false">\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}(Pg),ny={},iy={},ry=[],oy={};function sy(){Object.keys(ny.en).map((function(t){iy[t]=t.toLowerCase()}))}function ay(t){("Array"!==Wd.typeOf(t)?Object.keys(t).map((function(e){return{LANG:"zh"===e?"zh-cn":e,TEXT:t[e]}})):t).map((function(t){ny[t.LANG]?Wd.deepMerge(ny[t.LANG]||{},t.TEXT||{}):oy[t.LANG]=t.TEXT})),sy()}function cy(t){var e=t.LANG,n=t.TEXT||{};ny[e]||ry.push(e),ny[e]?Wd.deepMerge(n,ny[e]):ny[e]=n,oy[e]&&(ay([{LANG:e,TEXT:oy[e]}]),delete oy[e]),"zh-cn"===e&&(ny.zh=ny["zh-cn"]),sy()}cy({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 ly={get textKeys(){return iy},get langKeys(){return ry},get lang(){var t={};return ry.map((function(e){t[e]=ny[e]})),t.zh=ny["zh-cn"],t},extend:ay,use:cy};function uy(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function hy(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?uy(Object(n),!0).forEach((function(e){yi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):uy(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function fy(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var dy=["play","pause","replay","retry"],py=function(t){fi(n,t);var e=fy(n);function n(t){var i;ui(this,n);var r,o=Wd.deepMerge({id:"",el:null,url:"",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:!1,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!1,closeControlsBlur:!1,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},ignores:[],whitelist:[],inactive:3e3,lang:(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase(),controls:!0,marginControls:!1,fullscreenTarget:null,controlsList:[],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:[],thumbnail:null,commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}},t);ag(pi(i=e.call(this,o)),dy),i.config=o,(r=pi(i)).logInfo=Hd.logInfo.bind(r),r.logWarn=Hd.logWarn.bind(r),r.logError=Hd.logError.bind(r);var s=i.constructor.defaultPreset;if(i.config.presets.length){var a=i.config.presets.indexOf("default");a>=0&&s&&(i.config.presets[a]=s)}else s&&i.config.presets.push(s);if(i.userTimer=null,i.waitTimer=null,i._state=Kv,i._hasStart=!1,i.isSeeking=!1,i.isCanplay=!1,i._runPending=!1,i.rotateDeg=0,i.isActive=!1,i.isCssfullScreen=!1,i.fullscreen=!1,i._fullscreenEl=null,i._cssfullscreenEl=null,i.curDefinition=null,i._orgCss="",i._fullScreenOffset=null,i._videoHeight=0,i._videoWidth=0,i._played={begin:-1,end:-1,acc:0},i.innerContainer=null,i.controls=null,i.topBar=null,i.topBar=null,i.root=null,Xd.os.isAndroid&&Xd.osVersion>0&&Xd.osVersion<6&&(i.config.autoplay=!1),i.database=new Gp,!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"))),gi(i);i._bindEvents(),i._registerPresets(),i._registerPlugins(),Gv.onPluginsReady(pi(i)),i.setState(zv),i.emit(yp),i.onReady&&i.onReady();var c=i.config,l=c.definition;return!c.url&&l&&l.list&&l.list.length>0&&l.defaultDefinition&&l.list.map((function(t){t.definition===l.defaultDefinition&&(i.config.url=t.url,i.curDefinition=t.definition)})),(i.config.videoInit||i.config.autoplay)&&(!i.hasStart||i.state<qv)&&i.start(),i}return Co(n,[{key:"_initDOM",value:function(){var t=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var e=this.config.el;if(!e||1!==e.nodeType)return this.emit(np,new Zd("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=e}var n=Gv.checkPlayerRoot(this.root);n&&(Hd.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),n.destroy()),this._initBaseDoms();var i=this.constructor.XgVideoProxy;if(i&&this.videoConfig.mediaType===i.mediaType){var r=this.innerContainer||this.root;this.detachVideoEvents(this.video);var o=new i(r,this.config,this.videoConfig);this.attachVideoEvents(o),this.video=o}if(this.config.controls){var s=Gv.register(this,ey);this.controls=s}var a=this.config.isMobileSimulateMode?"mobile":Xd.device;if(this.addClass("".concat(Wv.DEFAULT," ").concat(Wv.ACTIVE," xgplayer-").concat(a," ").concat(this.config.controls?"":Wv.NO_CONTROLS)),this.config.autoplay?this.addClass(Wv.ENTER):this.addClass(Wv.NO_START),this.config.fluid){var c={"max-width":"100%",width:"100%",height:"0","padding-top":"".concat(100*this.config.height/this.config.width,"%"),position:"position",top:"0",left:"0"};Object.keys(c).map((function(e){t.root.style[e]=c[e]}))}else["width","height"].map((function(e){t.config[e]&&("number"!=typeof t.config[e]?t.root.style[e]=t.config[e]:t.root.style[e]="".concat(t.config[e],"px"))}));return!0}},{key:"_initBaseDoms",value:function(){this.topBar=Wd.createDom("xg-bar","",{"data-index":-1},"xg-top-bar"),this.leftBar=Wd.createDom("xg-bar","",{"data-index":-1},"xg-left-bar"),this.rightBar=Wd.createDom("xg-bar","",{"data-index":-1},"xg-right-bar"),this.config.marginControls&&(this.innerContainer=Wd.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer)),this.root.appendChild(this.topBar),this.root.appendChild(this.leftBar),this.root.appendChild(this.rightBar)}},{key:"_bindEvents",value:function(){var t=this;["focus","blur"].forEach((function(e){t.on(e,t["on"+e.charAt(0).toUpperCase()+e.slice(1)])}));var e=function(){t.fullscreen=!1,t._fullScreenOffset=null};this.onFullscreenChange=function(n,i){var r=Wd.getFullScreenEl();if(t._fullActionFrom?t._fullActionFrom="":t.emit(Fp,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:t.currentTime,duration:t.duration,props:[{prop:"fullscreen",from:!0,to:!1}]}),i||r&&(r===t._fullscreenEl||"VIDEO"===r.tagName))Wd.setTimeout(t,(function(){t.resize()}),100),t.video.focus(),t.fullscreen=!0,t.changeFullStyle(t.root,r,Wv.FULLSCREEN),t.emit(Ep,!0,t._fullScreenOffset),t.isCssfullScreen&&t.exitCssFullscreen();else if(t.fullscreen){Wd.setTimeout(t,(function(){t.resize()}),100);var o=t._fullScreenOffset;if(t.config.needFullscreenScroll)try{window.scrollTo(o.left,o.top),Wd.setTimeout(t,(function(){e()}),50)}catch(t){Hd.logError(t),e()}else t.video.focus(),e();t.isCssfullScreen?t.removeClass(Wv.FULLSCREEN):t.recoverFullStyle(t.root,t._fullscreenEl,Wv.FULLSCREEN),t._fullscreenEl=null,t.emit(Ep,!1)}},Wp.forEach((function(e){document&&document.addEventListener(e,t.onFullscreenChange)})),this.__webkitbeginfullscreen=function(e){t._fullscreenEl=t.video,t.onFullscreenChange(e,!0)},this.__webkitendfullscreen=function(e){t.onFullscreenChange(e,!1)},Xd.os.isIos&&(this.video.addEventListener("webkitbeginfullscreen",this.__webkitbeginfullscreen),this.video.addEventListener("webkitendfullscreen",this.__webkitendfullscreen)),this.once("loadeddata",this.resize),this.playFunc=function(){t.config.closeFocusVideoFocus||t.video.focus()},this.once("play",this.playFunc)}},{key:"_unbindEvents",value:function(){var t=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),Wp.forEach((function(e){document.removeEventListener(e,t.onFullscreenChange)})),this.playFunc&&this.off("play",this.playFunc),this.canPlayFunc&&this.off("canplay",this.canPlayFunc),this.video.removeEventListener("webkitbeginfullscreen",this.__webkitbeginfullscreen),this.video.removeEventListener("webkitendfullscreen",this.__webkitendfullscreen)}},{key:"_startInit",value:function(t){var e=this;if(this.video&&(t&&""!==t||(this.emit(mp),Hd.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this.canPlayFunc=function(){if(e.config){var t=e.config,n=t.autoplay,i=t.startTime,r=t.defaultPlaybackRate;Hd.logInfo("player","canPlayFunc",i),i&&(e.currentTime=i>e.duration?e.duration:i,e.config.startTime=0),1!==r&&(e.playbackRate=r),n&&e.videoPlay(),e.off(ap,e.canPlayFunc),e.removeClass(Wv.ENTER)}},"Array"===Wd.typeOf(t)?(t.forEach((function(t){e.video.appendChild(Wd.createDom("source","",{src:"".concat(t.src),type:"".concat(t.type||"")}))})),this._attachSourceEvents(this.video)):this.video.src=t,"Number"===Wd.typeOf(this.config.volume)&&(this.volume=this.config.volume),this.loadeddataFunc&&this.once("loadeddata",this.loadeddataFunc);var n=this.innerContainer?this.innerContainer:this.root;this.video instanceof window.Element&&!n.contains(this.video)&&n.insertBefore(this.video,n.firstChild),this.video.readyState>=2?this.canPlayFunc():this.once(ap,this.canPlayFunc),Hd.logInfo("_startInit"),this.config.autoplay&&(this.load(),(Xd.os.isIpad||Xd.os.isPhone)&&this.videoPlay()),Wd.setTimeout(this,(function(){e.emit(wp)}),1),(!this.hasStart||this.state<qv)&&Gv.afterInit(this),this.hasStart=!0,this.setState(qv)}}},{key:"_attachSourceEvents",value:function(t){var e=this,n=t.children;this._videoSourceCount=n.length,!this._sourceError&&(this._sourceError=function(t){e._videoSourceCount--,0===e._videoSourceCount&&(e.videoEventMiddleware.error?e.videoEventMiddleware.error.call(e,t,(function(){e.errorHandler("error")})):e.errorHandler("error",{code:4,message:"sources load error"}))});for(var i=0;i<n.length;i++)n[i].addEventListener("error",this._sourceError)}},{key:"_detachSourceEvents",value:function(t){var e=t.children;if(0!==e.length&&this._sourceError)for(var n=0;n<e.length;n++)e[n].removeEventListener("error",this._sourceError)}},{key:"_registerPlugins",value:function(){var t=this;this._loadingPlugins=[];var e=this.config.ignores||[],n=this.config.plugins||[];(this.config.i18n||[]).map((function(t){ly.use(t)}));var i=e.join("||").toLowerCase().split("||");n.map((function(e){try{var n=e.plugin?e.plugin.pluginName:e.pluginName;if(n&&i.indexOf(n.toLowerCase())>-1)return null;if(e.lazy&&e.loader){var r=Gv.lazyRegister(t,e);return void(e.forceBeforeInit&&(r.then((function(){t._loadingPlugins.splice(t._loadingPlugins.indexOf(r),1)})).catch((function(e){Hd.logError("_registerPlugins:loadingPlugin",e),t._loadingPlugins.splice(t._loadingPlugins.indexOf(r),1)})),t._loadingPlugins.push(r)))}return t.registerPlugin(e)}catch(t){return Hd.logError("_registerPlugins:",t),null}}))}},{key:"_registerPresets",value:function(){var t=this;this.config.presets.forEach((function(e){var n,i,r,o,s,a,c,l,u,h,f,d,p,g;n=t,a=(i=e).preset&&i.options?new i.preset(i.options,n.config):new i({},n.config),c=a.plugins,l=void 0===c?[]:c,u=a.ignores,h=void 0===u?[]:u,f=a.icons,d=void 0===f?{}:f,p=a.i18n,g=void 0===p?[]:p,n.config.plugins||(n.config.plugins=[]),n.config.ignores||(n.config.ignores=[]),(r=n.config.plugins).push.apply(r,Yh(l)),(o=n.config.ignores).push.apply(o,Yh(h)),Object.keys(d).map((function(t){n.config.icons[t]||(n.config.icons[t]=d[t])})),(s=n.config.i18n).push.apply(s,Yh(g))}))}},{key:"registerPlugin",value:function(t,e){var n=null,i=null;t.plugin&&"function"==typeof t.plugin?(n=t.plugin,i=t.options):(n=t,i={}),e&&(i.config=e);for(var r=Object.keys(this.config),o=0;o<r.length;o++)if(n.pluginName.toLowerCase()===r[o].toLowerCase()){var s=this.config[r[o]];"Object"===Wd.typeOf(s)&&(s.root&&(i.root=s.root),s.position&&(i.position=s.position));break}var a=i.position?i.position:i.config&&i.config.position||n.defaultConfig&&n.defaultConfig.position,c=Pg.POSITIONS;if(!i.root&&"string"==typeof a&&a.indexOf("controls")>-1)return this.controls&&this.controls.registerPlugin(n,i,n.pluginName);if(!i.root)switch(a){case c.ROOT_RIGHT:i.root=this.rightBar;break;case c.ROOT_LEFT:i.root=this.leftBar;break;case c.ROOT_TOP:i.root=this.topBar;break;default:i.root=this.innerContainer||this.root}return Gv.register(this,n,i)}},{key:"deregister",value:function(t){"string"==typeof t?Gv.unRegister(this,t):t instanceof dg&&Gv.unRegister(this,t.pluginName)}},{key:"unRegisterPlugin",value:function(t){this.deregister(t)}},{key:"plugins",get:function(){return Gv.getPlugins(this)}},{key:"getPlugin",value:function(t){var e=Gv.findPlugin(this,t);return e&&e.pluginName?e:null}},{key:"addClass",value:function(t){this.root&&(Wd.hasClass(this.root,t)||Wd.addClass(this.root,t))}},{key:"removeClass",value:function(t){this.root&&Wd.removeClass(this.root,t)}},{key:"hasClass",value:function(t){if(this.root)return Wd.hasClass(this.root,t)}},{key:"setAttribute",value:function(t,e){this.root&&this.root.setAttribute(t,e)}},{key:"removeAttribute",value:function(t,e){this.root&&this.root.removeAttribute(t,e)}},{key:"start",value:function(t){var e=this;return this.hasStart||this.state>=Xv?Promise.resolve():(this.hasStart=!0,this.setState(Xv),Gv.beforeInit(this).then((function(){if(e.config)return t||(t=e.url||e.config.url),e._startInit(t)})).catch((function(t){throw t.fileName="player",t.lineNumber="236",Hd.logError("start:beforeInit:",t),t})))}},{key:"load",value:function(){this.video&&this.video.load()}},{key:"videoPlay",value:function(){var t=this;if(this.hasStart||!(this.state<qv)){this.state<Zv&&(this.removeClass(Wv.NO_START),!this.isCanplay&&this.addClass(Wv.ENTER));var e=xo(vi(n.prototype),"play",this).call(this);return void 0!==e&&e&&e.then?e.then((function(){t.removeClass(Wv.NOT_ALLOW_AUTOPLAY),t.addClass(Wv.PLAYING),t.state<Zv&&(Hd.logInfo(">>>>playPromise.then"),t.setState(Zv),t.emit(kp))})).catch((function(e){if(Hd.logWarn(">>>>playPromise.catch",e.name),t.video&&t.video.error)return t.onError(),t.removeClass(Wv.ENTER),void t.setState(Yv);"NotAllowedError"===e.name&&(t._errorTimer=Wd.setTimeout(t,(function(){t._errorTimer=null,t.emit(bp),t.addClass(Wv.NOT_ALLOW_AUTOPLAY),t.removeClass(Wv.ENTER),t.pause(),t.setState($v)}),0))})):(Hd.logWarn("video.play not return promise"),this.state<Zv&&(this.setState(Zv),this.removeClass(Wv.NOT_ALLOW_AUTOPLAY),this.removeClass(Wv.NO_START),this.removeClass(Wv.ENTER),this.addClass(Wv.PLAYING),this.emit(kp))),e}this.removeClass(Wv.NO_START),this.addClass(Wv.ENTER);var i=this.start();i&&i.then((function(e){!t.config.autoplay&&t.videoPlay()}))}},{key:"videoPause",value:function(){xo(vi(n.prototype),"pause",this).call(this)}},{key:"play",value:function(){var t=this;this.removeClass(Wv.PAUSED),lg(this,"play",(function(){t.videoPlay()}))}},{key:"pause",value:function(){var t=this;lg(this,"pause",(function(){xo(vi(n.prototype),"pause",t).call(t)}))}},{key:"seek",value:function(t){var e=this;if(this.video&&!isNaN(Number(t))){var n=this.config,i=n.isSeekedPlay,r=n.seekedStatus,o=i?"play":r;t=t<0?0:t>this.duration?parseInt(this.duration,10):t,this.once(ap,(function(){switch(e.removeClass(Wv.ENTER),e.isSeeking=!1,o){case"play":e.play();break;case"pause":e.pause();break;default:!e.paused&&e.play()}})),this.state<Zv?(this.removeClass(Wv.NO_START),this.addClass(Wv.ENTER),this.currentTime=t,"play"===o&&this.play()):this.currentTime=t}}},{key:"changeDefinition",value:function(t,e){var n=this;this.emit(Pp,{from:e,to:t});var i=this.currentTime,r=this.paused;if(this.curDefinition=t.definition,this.hasStart){this.src=t.url;var o=function(){if(n.currentTime=i,r)n.pause();else{var o=n.play();void 0!==o&&o&&o.catch((function(t){}))}n.emit(Rp,{from:e,to:t})};Xd.os.isAndroid?this.once("timeupdate",(function(){o()})):this.once("canplay",(function(){o()}))}else this.config.url=t.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play().catch((function(t){console.log(t)}))},this.once("loadeddata",this.reloadFunc)}},{key:"resetState",value:function(){var t=this,e=[Wv.NOT_ALLOW_AUTOPLAY,Wv.PLAYING,Wv.NO_START,Wv.PAUSED,Wv.REPLAY,Wv.ENTER,Wv.ENDED,Wv.ERROR,Wv.LOADING];this.hasStart=!1,this.videoPause(),e.forEach((function(e){t.removeClass(e)})),this.addClass(Wv.ENTER),this.emit(pp)}},{key:"destroy",value:function(){var t=this,e=this.innerContainer,i=this.root,r=this.video;if(i){if(this._hasStart=!1,this._unbindEvents(),this._detachSourceEvents(this.video),Wd.clearAllTimers(this),Gv.destroy(this),cg(this),xo(vi(n.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root)try{this.exitFullscreen()}catch(t){}if(e)for(var o=e.children,s=0;s<o.length;s++)e.removeChild(o[s]);i.contains(r)&&i.removeChild(r),["topBar","leftBar","rightBar","innerContainer"].map((function(e){t[e]&&i.removeChild(t[e]),t[e]=null}));var a=i.className.split(" ");a.length>0?i.className=a.filter((function(t){return t.indexOf("xgplayer")<0})).join(" "):i.className="",this.removeAttribute("data-xgfill"),["isSeeking","isCanplay","isActive","isCssfullScreen","fullscreen"].map((function(e){t[e]=!1}))}}},{key:"replay",value:function(){var t=this;this.removeClass(Wv.ENDED),this.currentTime=0,this.isSeeking=!1,lg(this,"replay",(function(){t.once(ap,(function(){var e=t.videoPlay();e&&e.catch&&e.catch((function(t){console.log(t)}))})),t.play(),t.emit(Cp),t.onPlay()}))}},{key:"retry",value:function(){var t=this;this.removeClass(Wv.ERROR),this.addClass(Wv.LOADING),lg(this,"retry",(function(){var e=t.currentTime;t.videoPause(),t.src=t.config.url,!t.config.isLive&&(t.currentTime=e),t.once(ap,(function(){t.videoPlay()}))}))}},{key:"changeFullStyle",value:function(t,e,n,i){t&&(i||(i=Wv.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=Wd.filterStyleFromText(t)),Wd.addClass(t,n),e&&e!==t&&!this._orgPCss&&(this._orgPCss=Wd.filterStyleFromText(e),Wd.addClass(e,i)))}},{key:"recoverFullStyle",value:function(t,e,n,i){i||(i=Wv.PARENT_FULLSCREEN),this._orgCss&&(Wd.setStyleFromCsstext(t,this._orgCss),this._orgCss=""),Wd.removeClass(t,n),e&&e!==t&&this._orgPCss&&(Wd.setStyleFromCsstext(e,this._orgPCss),this._orgPCss="",Wd.removeClass(e,i))}},{key:"getFullscreen",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,e=this.root,n=this.video;t||(t=e),this._fullScreenOffset={top:Wd.scrollTop(),left:Wd.scrollLeft()},this._fullscreenEl=t,this._fullActionFrom="get";var i=Wd.getFullScreenEl();if(i!==this._fullscreenEl)try{for(var r=0;r<Yp.length;r++){var o=Yp[r];if(t[o]){var s="webkitRequestFullscreen"===o?t.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):t[o]();return s&&s.then?s:Promise.resolve()}}return n.fullscreenEnabled||n.webkitSupportsFullscreen?(n.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(t){return Promise.reject(new Error("call getFullscreen fail"))}else this.onFullscreenChange()}},{key:"exitFullscreen",value:function(t){if(this._fullscreenEl&&Wd.getFullScreenEl()){this.root;var e=this.video;this._fullActionFrom="exit";for(var n=0;n<Kp.length;n++){var i=Kp[n];if(document[i]){var r=document[i]();return r&&r.then?r:Promise.resolve()}}return e&&e.webkitSupportsFullscreen?(e.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}}},{key:"getCssFullscreen",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.fullscreen&&this.exitFullscreen(),this._cssfullscreenEl=t,this.changeFullStyle(this.root,t,t?Wv.INNER_FULLSCREEN:Wv.CSS_FULLSCREEN),this.isCssfullScreen=!0,this.emit(Tp,!0)}},{key:"exitCssFullscreen",value:function(){var t=this._cssfullscreenEl?Wv.INNER_FULLSCREEN:Wv.CSS_FULLSCREEN;this.fullscreen?this.removeClass(t):this.recoverFullStyle(this.root,this._cssfullscreenEl,t),this._cssfullscreenEl=null,this.isCssfullScreen=!1,this.emit(Tp,!1)}},{key:"focus",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!this.config.closePlayerBlur,delay:this.config.inactive};this.isActive?this.onFocus(t):this.emit(gp,hy({paused:this.paused,ended:this.ended},t))}},{key:"blur",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};this.isActive?this.emit(vp,hy({paused:this.paused,ended:this.ended},t)):this.onBlur(t)}},{key:"onFocus",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!0,delay:3e3};if(this.isActive=!0,this.removeClass(Wv.ACTIVE),this.userTimer&&Wd.clearTimeout(this,this.userTimer),!1!==e.autoHide){var n=e&&e.delay?e.delay:this.config.inactive;this.userTimer=Wd.setTimeout(this,(function(){t.blur()}),n)}}},{key:"onBlur",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};if(this.isActive){var e=this.config.closePauseVideoFocus;this.isActive=!1,(t.ignorePaused||e||!this.paused&&!this.ended)&&this.addClass(Wv.ACTIVE)}}},{key:"onCanplay",value:function(){this.state>=Zv&&this.removeClass(Wv.ENTER),this.removeClass(Wv.LOADING),this.isCanplay=!0}},{key:"onPlay",value:function(){this.state===Jv&&this.setState(Zv),this.removeClass(Wv.PAUSED),this.ended&&this.removeClass(Wv.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(Wv.PAUSED),this.config.closePauseVideoFocus||(this.userTimer&&Wd.clearTimeout(this,this.userTimer),this.focus())}},{key:"onEnded",value:function(){this.addClass(Wv.ENDED),this.setState(Jv)}},{key:"onError",value:function(){this.setState(Yv),this.removeClass(Wv.NOT_ALLOW_AUTOPLAY),this.removeClass(Wv.NO_START),this.removeClass(Wv.ENTER),this.removeClass(Wv.LOADING),this.addClass(Wv.ERROR)}},{key:"onSeeking",value:function(){if(!this.isSeeking){var t=this._played;t.acc+=t.begin<t.end&&t.end>-1?t.end-t.begin:0,t.begin=parseInt(1e3*this.video.currentTime,10),t.end=-1}this.isSeeking=!0,this.addClass(Wv.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&Wd.clearTimeout(this,this.waitTimer),this.removeClass(Wv.LOADING),this.removeClass(Wv.SEEKING)}},{key:"onWaiting",value:function(){var t=this;this.waitTimer&&Wd.clearTimeout(this,this.waitTimer),this.waitTimer=Wd.setTimeout(this,(function(){t.addClass(Wv.LOADING),Wd.clearTimeout(t,t.waitTimer),t.waitTimer=null}),200)}},{key:"onPlaying",value:function(){var t=this;[Wv.NO_START,Wv.PAUSED,Wv.ENDED,Wv.ERROR,Wv.REPLAY,Wv.LOADING].forEach((function(e){t.removeClass(e)}))}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.resize(),(this.waitTimer||this.hasClass(Wv.LOADING))&&this.video.readyState>2&&(this.removeClass(Wv.LOADING),Wd.clearTimeout(this,this.waitTimer),this.waitTimer=null),this._played.begin<0&&(this._played.begin=parseInt(1e3*this.video.currentTime,10)),this._played.end=parseInt(1e3*this.video.currentTime,10)}},{key:"onVolumechange",value:function(){"Number"===Wd.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"checkBuffer",value:function(t){var e=this.video.buffered;if(!e||0===e.length||!this.duration)return!0;for(var n=t||this.video.currentTime||.2,i=e.length,r=0;r<i;r++)if(e.start(r)<=n&&e.end(r)>n)return!0;return!1}},{key:"position",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{h:0,y:0,x:0,w:0};if(t&&t.h){var e=this.root.getBoundingClientRect(),n=e.height,i=n/t.h,r="scale(".concat(i/n,")"),o=0,s=0;t.y&&(s=(100-100*t.h)/2-100*t.y),t.w&&t.x&&(o=(100-100*t.w)/2-100*t.x),r+=" translate(".concat(o,"%, ").concat(s,"%)"),this.video.style.transform=r,this.video.style.webkitTransform=r}}},{key:"resize",value:function(){var t=this,e=this.video,n=e.videoWidth,i=e.videoHeight,r=this.config,o=r.fitVideoSize,s=r.videoFillMode;if("fill"!==s&&"cover"!==s||this.setAttribute("data-xgfill",s),i&&n){this._videoHeight=i,this._videoWidth=n;var a=this.root.getBoundingClientRect(),c=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,l=a.width,u=a.height-c,h=parseInt(n/i*1e3,10),f=parseInt(l/u*1e3,10),d=l,p=u,g={};"auto"===o&&f>h||"fixWidth"===o?(p=l/h*1e3,this.config.fluid?g.paddingTop="".concat(100*p/d,"%"):g.height="".concat(p+c,"px")):("auto"===o&&f<h||"fixHeight"===o)&&(d=h*u/1e3,g.width="".concat(d,"px")),this.fullscreen||this.isCssfullScreen||Object.keys(g).map((function(e){t.root.style[e]=g[e]})),("fillHeight"===s&&f<h||"fillWidth"===s&&f>h)&&this.setAttribute("data-xgfill","cover");var v={videoScale:h,vWidth:d,vHeight:p,cWidth:d,cHeight:p+c};this.emit(Op,v)}}},{key:"updateObjectPosition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.video.updateObjectPosition?this.video.updateObjectPosition(t,e):this.video.style.objectPosition="".concat(100*t,"% ").concat(100*e,"%")}},{key:"setState",value:function(t){Hd.logInfo("setState","state from:".concat(Qv[this.state]," to:").concat(Qv[t])),this._state=t}},{key:"state",get:function(){return this._state}},{key:"hasStart",get:function(){return this._hasStart},set:function(t){"boolean"==typeof t&&(this._hasStart=t,!1===t&&(this._state=zv),this.emit("hasstart"))}},{key:"definitionList",get:function(){return this.config.definition.list||[]},set:function(t){var e=this,n=this.config.definition;n.list=t,this.emit("resourceReady",t);var i=null,r=null;t.map((function(t){e.curDefinition===t.definition&&(i=t),n.defaultDefinition===t.definition&&(r=t)})),!r&&t.length>0&&(r=t[0]),i?this.changeDefinition(i):r&&this.changeDefinition(r)}},{key:"lang",get:function(){return this.config.lang},set:function(t){0!==ly.langKeys.filter((function(e){return e===t})).length||"zh"===t?(this.config.lang=t,Gv.setLang(t,this)):console.error("Sorry, set lang fail, because the language [".concat(t,"] is not supported now, list of all supported languages is [").concat(ly.langKeys.join(),"] "))}},{key:"i18n",get:function(){var t=this.config.lang;return ly.lang[t]||ly.lang.en}},{key:"i18nKeys",get:function(){return ly.textKeys||{}}},{key:"version",get:function(){return qd}},{key:"url",get:function(){return this.__url||this.config.url},set:function(t){this.__url=t}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(t){this.plugins.poster&&this.plugins.poster.update(t)}},{key:"readyState",get:function(){var t=xo(vi(n.prototype),"readyState",this);return this.i18n[t]||t}},{key:"error",get:function(){var t=xo(vi(n.prototype),"error",this);return this.i18n[t]||t}},{key:"networkState",get:function(){var t=xo(vi(n.prototype),"networkState",this);return this.i18n[t]||t}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var t=this._played,e=t.acc,n=t.end,i=t.begin;return i>-1&&n>i?(e+n-i)/1e3:e/1e3}},{key:"zoom",get:function(){return this.config.zoom},set:function(t){this.config.zoom=t}},{key:"hook",value:function(t,e){return rg.call.apply(rg,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(t,e){return og.call.apply(og,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(t,e,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 sg.call.apply(sg,[this].concat(Array.prototype.slice.call(arguments)))}}],[{key:"debugger",get:function(){return Hd.config.debug},set:function(t){Hd.config.debug=t}},{key:"install",value:function(t,e){n.plugins||(n.plugins={}),n.plugins[t]||(n.plugins[t]=e)}},{key:"use",value:function(t,e){n.plugins||(n.plugins={}),n.plugins[t]=e}}]),n}(Vp);function gy(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function vy(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}function yy(){return(new Date).getTime()}yi(py,"defaultPreset",null),yi(py,"XgVideoProxy",null);var my=function(t){fi(n,t);var e=vy(n);function n(){var t;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(t=e.call.apply(e,[this].concat(r))),"_onReset",(function(){t.vt=0,t.pt=0,t.fvt=0,t._isSeeking=!1,t.seekingStart=0,t.waitingStart=0,t._isWaiting=!1,t._waitTimer&&Wd.clearTimeout(pi(t),t._waitTimer),t._waittTimer&&Wd.clearTimeout(pi(t),t._waittTimer),t._waitTimer=null,t._waittTimer=null,t.stall={costTime:0,currentTime:0},t.seekData={costTime:0,currentTime:0}})),yi(pi(t),"_onSeeking",(function(){t.seekingStart||(t.seekingStart=yy(),t.emitLog("seekStart",{start:yy()}))})),yi(pi(t),"_onSeeked",(function(){t.suspendSeekingStatus("seeked")})),yi(pi(t),"_onWaiting",(function(){t._isWaiting||t.seekingStart||(t._isWaiting=!0,t._waitTimer=Wd.setTimeout(pi(t),(function(){t._isWaiting&&(t.waitingStart=yy(),Wd.clearTimeout(pi(t),t._waitTimer),t._waitTimer=null,t.emitLog("waitingStart",{start:t.waitingStart}))}),200))})),yi(pi(t),"_onError",(function(){t.suspendSeekingStatus("error"),t.suspendWaitingStatus("error")})),yi(pi(t),"_onPlaying",(function(){t.suspendWaitingStatus("playing")})),t}return Co(n,[{key:"afterCreate",value:function(){var t=this;this._onReset(),this.on(dp,(function(){t.vt=t.pt=yy()})),this.on(up,(function(){t.vt=yy(),t.fvt=t.vt-t.pt,t.emitLog("firstFrame",{fvt:t.fvt})})),this.on(sp,this._onWaiting),this.on(ip,this._onSeeking),this.on(rp,this._onSeeked),this.on(Qd,this._onPlaying),this.on(np,this._onError),this.on(pp,this._onReset)}},{key:"_startWaitTimeout",value:function(){var t=this;this._waittTimer=Wd.setTimeout(this,(function(){t.suspendWaitingStatus("timeout"),Wd.clearTimeout(t,t._waittTimer),t._waittTimer=null}),2e4)}},{key:"suspendSeekingStatus",value:function(t){if(this.seekingStart){var e=yy(),n=e-this.seekingStart;this.seekingStart=0,this.emitLog("seekEnd",{end:e,costTime:n})}}},{key:"suspendWaitingStatus",value:function(t){if(this._waitTimer&&(Wd.clearTimeout(this,this._waitTimer),this._waitTimer=null),this.waitingStart){var e=yy()-this.waitingStart;this._isWaiting=!1,this.waitingStart=0,this.emitLog("waitingEnd",{endType:t,costTime:e})}}},{key:"emitLog",value:function(t,e){var n=this.player;this.emit(Np,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?gy(Object(n),!0).forEach((function(e){yi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gy(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({eventType:t,currentTime:this.player.currentTime,readyState:n.video.readyState,networkState:n.video.networkState},e))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{}}}]),n}(Pg);function ky(){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}function by(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var wy=function(t){fi(n,t);var e=by(n);function n(){return ui(this,n),e.apply(this,arguments)}return Co(n,[{key:"registerIcons",value:function(){return{replay:ky}}},{key:"afterCreate",value:function(){var t=this;Pg.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayClick",(function(){t.player.replay()}),{pre:function(t){t.preventDefault(),t.stopPropagation()}}),this.bind("svg",["click","touchend"],this.__handleReplay),this.bind(".xgplayer-replay-txt",["click","touchend"],this.__handleReplay),this.on(tp,(function(){if(t.playerConfig.loop||Wd.addClass(t.player.root,"replay"),!t.config.disable){t.show();var e=t.root.querySelector("path");if(e){var n=window.getComputedStyle(e).getPropertyValue("transform");if("string"==typeof n&&n.indexOf("none")>-1)return null;e.setAttribute("transform",n)}}})),this.on(Jd,(function(){t.hide()}))}},{key:"handleReplay",value:function(t){t.preventDefault(),t.stopPropagation(),this.player.replay(),Wd.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("svg",["click","touchend"],this.__handleReplay),this.unbind(".xgplayer-replay-txt",["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}(Pg);function Cy(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var xy=function(t){fi(n,t);var e=Cy(n);function n(){return ui(this,n),e.apply(this,arguments)}return Co(n,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(t){this.config.isEndedShow=t}},{key:"hide",value:function(){Wd.addClass(this.root,"hide")}},{key:"show",value:function(){Wd.removeClass(this.root,"hide")}},{key:"beforeCreate",value:function(t){"string"==typeof t.player.config.poster&&(t.config.poster=t.player.config.poster)}},{key:"afterCreate",value:function(){var t=this;this.on(tp,(function(){t.isEndedShow||Wd.addClass(t.root,"hide")})),this.config.hideCanplay?(this.once(op,(function(){t.onTimeUpdate()})),this.on(_p,(function(){Wd.removeClass(t.root,"hide"),Wd.addClass(t.root,"xg-showplay"),t.once(op,(function(){t.onTimeUpdate()}))}))):this.on(Jd,(function(){Wd.addClass(t.root,"hide")}))}},{key:"onTimeUpdate",value:function(){var t=this;this.player.currentTime?Wd.removeClass(this.root,"xg-showplay"):this.once(op,(function(){t.onTimeUpdate()}))}},{key:"update",value:function(t){t&&(this.config.poster=t,this.root.style.backgroundImage="url(".concat(t,")"))}},{key:"render",value:function(){var t=this.config,e=t.poster,n=t.hideCanplay,i=e?"background-image:url(".concat(e,");"):"";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}(Pg);function _y(){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 Ey(){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}function Ty(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Sy={};var Py=function(t){fi(n,t);var e=Ty(n);function n(t){var i;return ui(this,n),(i=e.call(this,t)).autoPlayStart=!1,i}return Co(n,[{key:"afterCreate",value:function(){var t=this,e=this.player,n=this.playerConfig;this.initIcons(),this.once(yp,(function(){n&&(n.lang&&"en"===n.lang?Wd.addClass(e.root,"lang-is-en"):"jp"===n.lang&&Wd.addClass(e.root,"lang-is-jp"))})),this.on(kp,(function(){var e="auto"===t.config.mode?"auto-hide":"hide";Wd.addClass(t.root,e),t.autoPlayStart=!0,t.onPlayPause("play")})),n.autoplay||this.show(),this.on(bp,(function(){var e="auto"===t.config.mode?"auto-hide":"hide";t.setAttr("data-state","play"),Wd.removeClass(t.root,e),t.show()})),this.on(Jd,(function(){t.onPlayPause("play")})),this.on(ep,(function(){t.onPlayPause("pause")})),this.clickHandler=this.hook("startClick",this.switchPausePlay,{pre:function(e){e.preventDefault(),e.stopPropagation();var n=t.player.paused;t.emitUserAction(e,"switch_play_pause",{props:"paused",from:n,to:!n})}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"preventDefault",value:function(t){}},{key:"registerIcons",value:function(){return{startPlay:{icon:_y,class:"xg-icon-play"},startPause:{icon:Ey,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var t=this.icons;this.appendChild("xg-start-inner",t.startPlay),this.appendChild("xg-start-inner",t.startPause)}},{key:"hide",value:function(){Wd.addClass(this.root,"hide")}},{key:"show",value:function(){Wd.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){Wd.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){Wd.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(t){t?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(t){var e=this;!function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};Sy[t]&&window.clearTimeout(Sy[t].id),Sy[t]={},n.start&&n.start(),Sy[t].id=window.setTimeout((function(){n.end&&n.end(),window.clearTimeout(Sy[t].id),delete Sy[t]}),e)}("pauseplay",400,{start:function(){Wd.addClass(e.root,"interact"),e.show(),e.switchStatus(!0)},end:function(){Wd.removeClass(e.root,"interact"),!t&&e.hide()}})}},{key:"switchPausePlay",value:function(t){var e=this.player;(t.preventDefault(),t.stopPropagation(),e.state<zv)||(this.player.paused||e.state!==Zv?e.play():e.pause())}},{key:"onPlayPause",value:function(t){var e=this.config,n=this.player;if(!(n.state<Zv)&&this.autoPlayStart){if("show"===e.mode)return this.switchStatus(),void this.show();if("auto"!==e.mode){if(e.isShowPause&&n.paused&&!n.ended||e.isShowEnd&&n.ended)return this.switchStatus(),void this.show();if(e.disableAnimate)return this.switchStatus(),void this.hide();if("play"===t)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart)return;this.animate()}}else this.switchStatus()}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),Object.keys(Sy).map((function(t){window.clearTimeout(Sy[t].id),delete Sy[t]}))}},{key:"render",value:function(){var t=this.playerConfig.autoplay?"auto"===this.config.mode?"auto-hide":"hide":"";return'\n <xg-start class="xgplayer-start '.concat(t,'">\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}(Pg);function Ry(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Oy=function(t){fi(n,t);var e=Ry(n);function n(){return ui(this,n),e.apply(this,arguments)}return Co(n,[{key:"render",value:function(){var t=this.config.innerHtml,e=Wd.createDom("xg-enter","",{},"xgplayer-enter");if(t&&t instanceof window.HTMLElement)e.appendChild(t);else if(t&&"string"==typeof t)e.innerHTML=t;else{for(var n="",i=1;i<=12;i++)n+='<div class="xgplayer-enter-bar'.concat(i,'"></div>');e.innerHTML='<div class="xgplayer-enter-spinner">'.concat(n,"</div>")}return e}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),n}(Pg);function Iy(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Ly=function(t){fi(n,t);var e=Iy(n);function n(){return ui(this,n),e.apply(this,arguments)}return Co(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 t="MINISCREEN";return'\n <xg-icon class="xgplayer-miniicon">\n <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="'.concat(this.i18nKeys[t],'">').concat(this.i18n[t],"</span></div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:wg.CONTROLS_RIGHT,index:10}}}]),n}(Pg);function Ay(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}function Dy(t){var e=parseFloat(t);return-1===t.indexOf("%")&&!isNaN(e)&&e}var My=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],Ny=My.length;function Fy(t){if("string"==typeof t&&(t=document.querySelector(t)),t&&"object"===di(t)&&t.nodeType){var e=function(t){return window.getComputedStyle(t)}(t);if("none"===e.display)return function(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e<Ny;e++)t[My[e]]=0;return t}();var n={};n.width=t.offsetWidth,n.height=t.offsetHeight;for(var i=n.isBorderBox="border-box"===e.boxSizing,r=0;r<Ny;r++){var o=My[r],s=e[o],a=parseFloat(s);n[o]=isNaN(a)?0:a}var c=n.paddingLeft+n.paddingRight,l=n.paddingTop+n.paddingBottom,u=n.marginLeft+n.marginRight,h=n.marginTop+n.marginBottom,f=n.borderLeftWidth+n.borderRightWidth,d=n.borderTopWidth+n.borderBottomWidth,p=i,g=Dy(e.width);!1!==g&&(n.width=g+(p?0:c+f));var v=Dy(e.height);return!1!==v&&(n.height=v+(p?0:l+d)),n.innerWidth=n.width-(c+f),n.innerHeight=n.height-(l+d),n.outerWidth=n.width+u,n.outerHeight=n.height+h,n}}function jy(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(i.identifier===e)return i}}var By="dragStart",Hy="dragMove",Uy="dragEnded",Vy={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},Gy=function(t){fi(n,t);var e=Ay(n);function n(t){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ui(this,n),(i=e.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=t instanceof Element?t:document.querySelector(t),i._handlerDom=r.handle instanceof Element?r.handle:document.querySelector(r.handle),i._root&&i._handlerDom?(i._bindStartEvent(),i):gi(i)}return Co(n,[{key:"_bindStartEvent",value:function(){var t=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)]),Vy[this._startKey].map((function(e){t["on".concat(e)]=t["on".concat(e)].bind(t)}))}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(t){var e=this;if(t){var n=Vy[this._startKey];n.map((function(t){window.addEventListener(t,e["on".concat(t)])})),this._boundPointerEvents=n}}},{key:"_unbindPostStartEvents",value:function(){var t=this;this._boundPointerEvents&&(this._boundPointerEvents.map((function(e){window.removeEventListener(e,t["on".concat(e)])})),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(t){this.onUp()}},{key:"animate",value:function(){var t=this;this.isDragging&&(this.positionDrag(),window.requestAnimationFrame((function(){t.animate()})))}},{key:"positionDrag",value:function(){var t="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=t,this._root.style.webKitTransform=t}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(t){this.dragStart(t,t)}},{key:"onmousemove",value:function(t){this.dragMove(t,t)}},{key:"onmouseup",value:function(t){this.dragEnd(t,t)}},{key:"ontouchstart",value:function(t){var e=t.changedTouches[0];this.dragStart(t,e),this.touchIdentifier=void 0!==e.pointerId?e.pointerId:e.identifier,t.preventDefault()}},{key:"ontouchmove",value:function(t){var e=jy(t.changedTouches,this.touchIdentifier);e&&this.dragMove(t,e)}},{key:"ontouchend",value:function(t){var e=jy(t.changedTouches,this.touchIdentifier);e&&this.dragEnd(t,e),t.preventDefault()}},{key:"ontouchcancel",value:function(t){var e=jy(t.changedTouches,this.touchIdentifier);e&&this.dragCancel(t,e)}},{key:"dragStart",value:function(t,e){if(this._root&&!this.isDown&&this.isEnabled){this.downPoint=e,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var n=Fy(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(t)}}},{key:"dragRealStart",value:function(t,e){this.isDragging=!0,this.animate(),this.emit(By,this.startPos)}},{key:"dragEnd",value:function(t,e){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(Uy)),this.presetInfo())}},{key:"_dragPointerMove",value:function(t,e){var n={x:e.pageX-this.downPoint.pageX,y:e.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this.dragRealStart(t,e),n}},{key:"dragMove",value:function(t,e){if(t=t||window.event,this.isDown){var n=this.startPos,i=n.x,r=n.y,o=this._dragPointerMove(t,e),s=o.x,a=o.y;s=this.checkContain("x",s,i),a=this.checkContain("y",a,r),this.position.x=i+s,this.position.y=r+a,this.dragPoint.x=s,this.dragPoint.y=a,this.emit(Hy,this.position)}}},{key:"dragCancel",value:function(t,e){this.dragEnd(t,e)}},{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(t){return Math.abs(t.x)>3||Math.abs(t.y)>3}},{key:"checkContain",value:function(t,e,n){return e+n<0?0-n:"x"===t&&e+n>this.startPos.maxX?this.startPos.maxX-n:"y"===t&&e+n>this.startPos.maxY?this.startPos.maxY-n:e}},{key:"_getPosition",value:function(){var t=window.getComputedStyle(this._root),e=this._getPositionCoord(t.left,"width"),n=this._getPositionCoord(t.top,"height");this.position.x=isNaN(e)?0:e,this.position.y=isNaN(n)?0:n,this._addTransformPosition(t)}},{key:"_addTransformPosition",value:function(t){var e=t.transform;if(0===e.indexOf("matrix")){var n=e.split(","),i=0===e.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(t,e){if(-1!==t.indexOf("%")){var n=Fy(this._root.parentNode);return n?parseFloat(t)/100*n[e]:0}return parseInt(t,10)}}]),n}(Gh);function Wy(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Yy=function(t){fi(n,t);var e=Wy(n);function n(t){var i;ui(this,n),yi(pi(i=e.call(this,t)),"onCancelClick",(function(t){i.exitMini(),i.isClose=!0})),yi(pi(i),"onCenterClick",(function(t){var e=pi(i).player;e.paused?e.play():e.pause()})),yi(pi(i),"onScroll",(function(t){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-i.pos.scrollY)<50)){var e=parseInt(Wd.getCss(i.player.root,"height"));e+=i.config.scrollTop,i.pos.scrollY=window.scrollY,window.scrollY>e+5?!i.isMini&&!i.isClose&&i.getMini():window.scrollY<=e&&(i.isMini&&i.exitMini(),i.isClose=!1)}})),i.isMini=!1,i.isClose=!1;var r=pi(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 Co(n,[{key:"beforeCreate",value:function(t){"boolean"==typeof t.player.config.mini&&(t.config.isShowIcon=t.player.config.mini)}},{key:"afterCreate",value:function(){var t=this;this.initIcons(),this.on(ep,(function(){t.setAttr("data-state","pause")})),this.on(Jd,(function(){t.setAttr("data-state","play")}))}},{key:"onPluginsReady",value:function(){var t=this,e=this.player;if(!this.config.disable){if(this.config.isShowIcon){var n={config:{onClick:function(){t.getMini()}}};e.controls.registerPlugin(Ly,n,Ly.pluginName)}var i=Wd.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",i,this.onCancelClick),this.bind(".play-icon",i,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new Gy(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:_y,class:"xg-icon-play"},pause:{icon:Ey,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var t=this.icons;this.appendChild(".play-icon",t.play),this.appendChild(".play-icon",t.pause)}},{key:"getMini",value:function(){var t=this;if(!this.isMini){var e=this.player,n=this.playerConfig,i=this.config.target||this.player.root;this.lastStyle={},Wd.addClass(e.root,"xgplayer-mini"),["width","height","top","left"].map((function(e){t.lastStyle[e]=i.style[e],i.style[e]="".concat(t.pos[e],"px")})),n.fluid&&(i.style["padding-top"]=""),this.emit(Sp,!0),e.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var t=this;if(!this.isMini)return!1;var e=this.player,n=this.playerConfig,i=this.config.target||this.player.root;Wd.removeClass(e.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map((function(e){i.style[e]=t.lastStyle[e]})),this.lastStyle=null,n.fluid&&(e.root.style.width="100%",e.root.style.height="0",e.root.style["padding-top"]="".concat(100*n.height/n.width,"%")),this.emit(Sp,!1),this.isMini=e.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var t=Wd.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",t,this.onCancelClick),this.unbind(".play-icon",t,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 <div lang-key="'.concat(this.i18nKeys.MINI_DRAG,'">').concat(this.i18n.MINI_DRAG,'</div>\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}(Pg);function Ky(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var zy={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},Xy=["videoClick","videoDbClick"],qy=function(t){fi(n,t);var e=Ky(n);function n(){var t;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(t=e.call.apply(e,[this].concat(r))),"onMouseMove",(function(e){var n=pi(t),i=n.player,r=n.playerConfig;i.isActive||(i.focus({autoHide:r.closeDelayBlur}),!r.closeFocusVideoFocus&&i.video.focus())})),yi(pi(t),"onMouseEnter",(function(e){var n=pi(t),i=n.playerConfig,r=n.player;!i.closeFocusVideoFocus&&r.video.focus(),i.closeDelayBlur?r.focus({autoHide:!1}):r.focus()})),yi(pi(t),"onMouseLeave",(function(e){var n=t.playerConfig,i=n.closePlayerBlur,r=n.leavePlayerTime;i||(r?t.player.focus({autoHide:!0,hideDelay:r}):t.player.blur())})),yi(pi(t),"onVideoClick",(function(e){var n=pi(t),i=n.player,r=n.playerConfig;e.target&&r.closeVideoClick||e.target!==i.root&&e.target!==i.video&&e.target!==i.innerContainer&&e.target!==i.video.__canvas||(e.preventDefault(),r.closeVideoStopPropagation||e.stopPropagation(),t._clickCount++,t.clickTimer&&(clearTimeout(t.clickTimer),t.clickTimer=null),t.clickTimer=setTimeout((function(){t._clickCount&&(t._clickCount--,lg(pi(t),Xy[0],(function(e,n){t.switchPlayPause(n.e)}),{e:e,paused:i.paused}),clearTimeout(t.clickTimer),t.clickTimer=null)}),300))})),yi(pi(t),"onVideoDblClick",(function(e){var n=pi(t),i=n.player,r=n.playerConfig;!e.target||e.target!==i.video&&e.target!==i.video.__canvas||r.closeVideoDblclick||(t._clickCount<2?t._clickCount=0:(t._clickCount=0,t.clickTimer&&(clearTimeout(t.clickTimer),t.clickTimer=null),e.preventDefault(),e.stopPropagation(),lg(pi(t),Xy[1],(function(e,n){t.emitUserAction(n.e,"switch_fullscreen",{props:"fullscreen",from:i.fullscreen,to:!i.fullscreen}),i.fullscreen?i.exitFullscreen():i.getFullscreen()}),{e:e,fullscreen:i.fullscreen})))})),t}return Co(n,[{key:"afterCreate",value:function(){var t=this;this._clickCount=0,Xy.map((function(e){t.__hooks[e]=null}));var e=this.playerConfig,n=e.enableContextmenu;e.isMobileSimulateMode||"mobile"===Xd.device||(this.config.disableContextmenu=!n,this.initEvents())}},{key:"initEvents",value:function(){var t=this,e=this.player,n=e.video,i=e.root;i.addEventListener("click",this.onVideoClick,!1),n.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(zy).map((function(e){i.addEventListener(e,t[zy[e]],!1)})),this.config.disableContextmenu&&n.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(t){var e=this.player;this.emitUserAction(t,"switch_play_pause",{props:"paused",from:e.paused,to:!e.paused}),e.ended?e.duration!==1/0&&e.duration>0&&e.replay():e.paused?e.play():e.pause()}},{key:"onContextmenu",value:function(t){(t=t||window.event).preventDefault&&t.preventDefault(),t.stopPropagation?t.stopPropagation():(t.returnValue=!1,t.cancelBubble=!0)}},{key:"destroy",value:function(){var t=this,e=this.player,n=e.video,i=e.root;this.clickTimer&&clearTimeout(this.clickTimer),i.removeEventListener("click",this.onVideoClick,!1),n.removeEventListener("dblclick",this.onVideoDblClick,!1),n.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(zy).map((function(e){i.removeEventListener(e,t[zy[e]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{disableContextmenu:!0}}}]),n}(dg),$y=p,Zy=Le,Jy=wi,Qy=m,tm=En,em=Le,nm=function(t){if("number"!=typeof t&&"Number"!=$y(t))throw TypeError("Incorrect invocation");return+t},im=function(t){var e=Jy(Qy(this)),n="",i=Zy(t);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(e+=e))1&i&&(n+=e);return n},rm=r,om=1..toFixed,sm=Math.floor,am=function(t,e,n){return 0===e?n:e%2==1?am(t,e-1,n*t):am(t*t,e/2,n)},cm=function(t,e,n){for(var i=-1,r=n;++i<6;)r+=e*t[i],t[i]=r%1e7,r=sm(r/1e7)},lm=function(t,e){for(var n=6,i=0;--n>=0;)i+=t[n],t[n]=sm(i/e),i=i%e*1e7},um=function(t){for(var e=6,n="";--e>=0;)if(""!==n||0===e||0!==t[e]){var i=String(t[e]);n=""===n?i:n+im.call("0",7-i.length)+i}return n};tm({target:"Number",proto:!0,forced:om&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!rm((function(){om.call({})}))},{toFixed:function(t){var e,n,i,r,o=nm(this),s=em(t),a=[0,0,0,0,0,0],c="",l="0";if(s<0||s>20)throw RangeError("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return String(o);if(o<0&&(c="-",o=-o),o>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(o*am(2,69,1))-69)<0?o*am(2,-e,1):o/am(2,e,1),n*=4503599627370496,(e=52-e)>0){for(cm(a,0,n),i=s;i>=7;)cm(a,1e7,0),i-=7;for(cm(a,am(10,i,1),0),i=e-1;i>=23;)lm(a,1<<23),i-=23;lm(a,1<<i),cm(a,1,1),lm(a,2),l=um(a)}else cm(a,0,n),cm(a,1<<-e,0),l=um(a)+im.call("0",s);return l=s>0?c+((r=l.length)<=s?"0."+im.call("0",s-r)+l:l.slice(0,r-s)+"."+l.slice(r-s)):c+l}});var hm="press",fm="pressend",dm="doubleclick",pm="click",gm="touchmove",vm="touchstart",ym="touchend",mm={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},km={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function bm(t){return t&&t.length>0?t[t.length-1]:null}function wm(t){var e=navigator.userAgent;/(?:iPhone|iPad)/.test(e)&&t.cancelable&&t.preventDefault()}var Cm=function(){function t(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};ui(this,t),this._pos={moving:!1,start:!1,x:0,y:0},this.config={pressDelay:600,dbClickDelay:300,disablePress:!1,disableDbClick:!1,miniStep:2},Object.keys(i).map((function(t){n.config[t]=i[t]})),this.root=e,this.events="mouse"===i.eventType?km:mm,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return Co(t,[{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(t){var e=this,n=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout((function(){e.trigger(hm,t),e._pos.press=!0,e.__clearPress()}),n.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(t){var e=this,n=this.config;if(this.dbIntrvalId)return this.__clearDb(),void this.trigger(dm,t);this.dbIntrvalId=setTimeout((function(){e.__clearDb(),e._pos.start||e._pos.press||e._pos.moving||e.trigger(pm,t)}),n.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(t,e){this.__handlers[t]||(this.__handlers[t]=[]),this.__handlers[t].push(e)}},{key:"off",value:function(t,e){if(this.__handlers[t]){for(var n=this.__handlers[t],i=-1,r=0;r<n.length;r++)if(n[r]===e){i=r;break}i>=0&&this.__handlers[t].splice(i,1)}}},{key:"trigger",value:function(t,e){this.__handlers[t]&&this.__handlers[t].map((function(n){try{n(e)}catch(e){console.error("trigger>>:".concat(t),e)}}))}},{key:"onTouchStart",value:function(t){var e=this._pos,n=this.root;wm(t);var i=bm(t.touches);e.x=i?parseInt(i.pageX,10):t.pageX,e.y=i?parseInt(i.pageX,10):t.pageX,e.start=!0,this.__setPress(t),n.addEventListener(this.events.end,this.onTouchEnd),n.addEventListener(this.events.cancel,this.onTouchCancel),n.addEventListener(this.events.move,this.onTouchMove),this.trigger(vm,t)}},{key:"onTouchCancel",value:function(t){this.onTouchEnd(t)}},{key:"onTouchEnd",value:function(t){var e=this._pos,n=this.root;wm(t),this.__clearPress(),n.removeEventListener(this.events.cancel,this.onTouchCancel),n.removeEventListener(this.events.end,this.onTouchEnd),n.removeEventListener(this.events.move,this.onTouchMove),t.moving=e.moving,t.press=e.press,e.press&&this.trigger(fm,t),this.trigger(ym,t),!e.press&&!e.moving&&this.__setDb(t),e.press=!1,e.start=!1,e.moving=!1}},{key:"onTouchMove",value:function(t){var e=this._pos,n=this.config,i=bm(t.touches),r=i?parseInt(i.pageX,10):t.pageX,o=i?parseInt(i.pageY,10):t.pageX,s=r-e.x,a=o-e.y;Math.abs(a)<n.miniStep&&Math.abs(s)<n.miniStep||(this.__clearPress(),e.press&&this.trigger(fm,t),e.press=!1,e.moving=!0,this.trigger(gm,t))}},{key:"destroy",value:function(){var t=this,e={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(e).map((function(n){t.root.removeEventListener("touchend",t[e[n]])}))}}]),t}();function xm(){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}function _m(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Em="auto",Tm="seeking",Sm="playbackrate",Pm=function(t){fi(n,t);var e=_m(n);function n(t){var i;return ui(this,n),yi(pi(i=e.call(this,t)),"onTouchStart",(function(t){var e=pi(i),n=e.player,r=e.config,o=e.pos,s=e.playerConfig,a=i.getTouche(t);if(a&&!r.disableGesture&&i.duration>0&&!n.ended){o.isStart=!0,Wd.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),i.find(".xg-dur").innerHTML=Wd.format(i.duration);var c=i.root.getBoundingClientRect();90===n.rotateDeg?(o.top=c.left,o.left=c.top,o.width=c.height,o.height=c.width):(o.top=c.top,o.left=c.left,o.width=c.width,o.height=c.height),o.x=parseInt(a.pageX-o.left,10),o.y=parseInt(a.pageY-o.top,10),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}})),yi(pi(i),"onTouchMove",(function(t){var e=i.getTouche(t),n=pi(i),r=n.pos,o=n.config,s=n.player;if(e&&!o.disableGesture&&i.duration&&r.isStart){var a=o.miniMoveStep,c=o.hideControlsActive,l=parseInt(e.pageX-r.left,10),u=parseInt(e.pageY-r.top,10);if(Math.abs(l-r.x)>a||Math.abs(u-r.y)>a){var h=l-r.x,f=u-r.y,d=r.scope;if(-1===d&&(0===(d=i.checkScope(l,u,h,f,r))&&(c?s.blur():s.focus({autoHide:!1}),!r.time&&(r.time=parseInt(1e3*s.currentTime,10)+1e3*i.timeOffset)),r.scope=d),-1===d||d>0&&!o.gestureY||0===d&&!o.gestureX)return;t.cancelable&&t.preventDefault(),i.executeMove(h,f,d,r.width,r.height),r.x=l,r.y=u}}})),yi(pi(i),"onTouchEnd",(function(t){var e=pi(i),n=e.player,r=e.pos,o=e.playerConfig;r.isStart&&(r.scope>-1&&t.cancelable&&t.preventDefault(),i.endLastMove(r.scope),setTimeout((function(){n.getPlugin("progress")&&n.getPlugin("progress").resetSeekState()}),10),r.scope=-1,i.resetPos(),Wd.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),i.changeAction(Em))})),yi(pi(i),"onRootTouchMove",(function(t){!i.config.disableGesture&&i.config.gestureX&&i.checkIsRootTarget(t)&&(t.stopPropagation(),i.pos.isStart?i.onTouchMove(t):i.onTouchStart(t))})),yi(pi(i),"onRootTouchEnd",(function(t){if(i.pos.isStart&&i.checkIsRootTarget(t)){t.stopPropagation(),i.onTouchEnd(t);var e=i.player.controls;e&&e.recoverAutoHide()}})),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 Co(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:xm,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var t=this,e=this.playerConfig,n=this.config,i=this.player;!0===e.closeVideoDblclick&&(n.closedbClick=!0),this.resetPos(),Wd.isUndefined(e.disableGesture)||(n.disableGesture=!!e.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=Wd.createDom("xg-mask","",{},"xgmask"),i.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mobile"!==Xd.device?"mouse":"touch";this.touch=new Cm(this.root,{eventType:r}),this.root.addEventListener("contextmenu",(function(t){t.preventDefault()})),i.root.addEventListener("touchmove",this.onRootTouchMove,!0),i.root.addEventListener("touchend",this.onRootTouchEnd,!0),this.on(cp,(function(){var e=t.player,n=t.config;1e3*e.duration<n.moveDuration&&(n.moveDuration=1e3*e.duration)})),this.on([ap,tp],(function(){var e=t.pos,n=e.time;!e.isStart&&n>0&&(t.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(e){t.touch.on(e,(function(n){t[o[e]](n)}))})),!n.disableActive){var s=i.plugins.progress;s&&(s.addCallBack("dragmove",(function(e){t.activeSeekNote(e.currentTime,e.forward)})),s.addCallBack("dragend",(function(){t.changeAction(Em)})))}}},{key:"registerThumbnail",value:function(){var t=this.player.plugins.thumbnail;if(t&&t.usable){this.thumbnail=t.createThumbnail(null,"mobile-thumbnail");var e=this.find(".time-preview");e.insertBefore(this.thumbnail,e.children[0])}}},{key:"initCustomStyle",value:function(){var t=(this.playerConfig||{}).commonStyle,e=t.playedColor,n=t.progressColor;e&&(this.find(".xg-curbar").style.backgroundColor=e,this.find(".xg-cur").style.color=e),n&&(this.find(".xg-bar").style.backgroundColor=n,this.find(".time-preview").style.color=n),this.config.disableTimeProgress&&Wd.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var t=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map((function(e){t.pos[e]=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(t){var e=this.player;this.root.setAttribute("data-xg-action",t);var n=e.plugins.start;n&&n.recover()}},{key:"getTouche",value:function(t){this.player.rotateDeg;var e=t.touches&&t.touches.length>0?t.touches[t.touches.length-1]:t;return{pageX:e.pageX,pageY:e.pageY}}},{key:"checkScope",value:function(t,e,n,i,r){var o=r.width,s=-1;if(t<0||t>o)return s;var a=0===i?Math.abs(n):Math.abs(n/i);return Math.abs(n)>0&&a>=1.73&&t>r.scopeM1&&t<r.scopeM2?s=0:(0===Math.abs(n)||a<=.57)&&(s=t<r.scopeL?1:t>r.scopeR?2:3),s}},{key:"executeMove",value:function(t,e,n,i,r){switch(n){case 0:this.updateTime(t/i*this.config.scopeM);break;case 1:this.updateBrightness(e/r);break;case 2:Xd.os.isIos||this.updateVolume(e/r)}}},{key:"endLastMove",value:function(t){var e=this,n=this.pos,i=this.player,r=this.config,o=(n.time-this.timeOffset)/1e3;switch(t){case 0:i.seek(Number(o).toFixed(1)),r.hideControlsEnd?i.blur():i.focus(),this.timer=setTimeout((function(){e.pos.time=0}),500)}this.changeAction(Em)}},{key:"checkIsRootTarget",value:function(t){var e=this.player.plugins||{};return(!e.progress||!e.progress.root.contains(t.target))&&(e.start&&e.start.root.contains(t.target)||e.controls&&e.controls.root.contains(t.target))}},{key:"sendUseAction",value:function(t){var e=this.player.paused;this.emitUserAction(t,"switch_play_pause",{prop:"paused",from:e,to:!e})}},{key:"onClick",value:function(t){var e=this.player,n=this.config,i=this.playerConfig;e.state<Zv?i.closeVideoClick||(this.sendUseAction(new Event("click")),e.play()):!n.closedbClick||i.closeVideoClick?e.isActive?e.blur():e.focus():i.closeVideoClick||(e.isActive&&(this.sendUseAction(new Event("click")),this.switchPlayPause()),e.focus())}},{key:"onDbClick",value:function(t){var e=this.config,n=this.player;!e.closedbClick&&n.state>=Zv&&(this.sendUseAction(new Event("dblclick")),this.switchPlayPause())}},{key:"onPress",value:function(t){var e=this.pos,n=this.config,i=this.player;n.disablePress||(e.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{prop:"playbackRate",from:i.playbackRate,to:n.pressRate}),i.playbackRate=n.pressRate,this.changeAction(Sm))}},{key:"onPressEnd",value:function(t){var e=this.pos,n=this.config,i=this.player;n.disablePress||(this.emitUserAction("pressend","change_rate",{prop:"playbackRate",from:i.playbackRate,to:e.rate}),i.playbackRate=e.rate,e.rate=1,this.changeAction(Em))}},{key:"updateTime",value:function(t){var e=this.player,n=this.config,i=this.player.duration;t=Number(t.toFixed(4));var r=parseInt(t*n.moveDuration,10)+this.timeOffset;r=(r+=this.pos.time)<0?0:r>1e3*i?1e3*i-200:r,e.getPlugin("time")&&e.getPlugin("time").updateTime(r/1e3),e.getPlugin("progress")&&e.getPlugin("progress").updatePercent(r/1e3/this.duration,!0),this.activeSeekNote(r/1e3,t>0),n.isTouchingSeek&&e.seek(Number((r-this.timeOffset)/1e3).toFixed(1)),this.pos.time=r}},{key:"updateVolume",value:function(t){this.player.rotateDeg&&(t=-t);var e=this.player,n=this.pos;if(t=parseInt(100*t,10),n.volume+=t,!(Math.abs(n.volume)<10)){var i=parseInt(10*e.volume,10)-parseInt(n.volume/10,10);i=i>10?10:i<1?0:i,e.volume=i/10,n.volume=0}}},{key:"updateBrightness",value:function(t){this.player.rotateDeg&&(t=-t);var e=this.pos,n=this.config,i=this.xgMask,r=e.light+.8*t;r=r>n.maxDarkness?n.maxDarkness:r<0?0:r,i&&(i.style.backgroundColor="rgba(0,0,0,".concat(r,")")),e.light=r}},{key:"activeSeekNote",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.player,i=this.config,r=!(this.duration!==1/0&&this.duration>0);if(t&&"number"==typeof t&&!r&&!i.disableActive){t<0?t=0:t>n.duration&&(t=n.duration-.2),this.changeAction(Tm);var o=n.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=Wd.format(this.duration),this.find(".xg-cur").innerHTML=Wd.format(t),this.find(".xg-curbar").style.width="".concat(t/this.duration*100,"%"),e?Wd.removeClass(this.find(".xg-seek-show"),"xg-back"):Wd.addClass(this.find(".xg-seek-show"),"xg-back"),this.updateThumbnails(t)}}},{key:"updateThumbnails",value:function(t){var e=this.player.plugins.thumbnail;e&&e.usable&&this.thumbnail&&e.update(this.thumbnail,t,160,90)}},{key:"switchPlayPause",value:function(){var t=this.player;if(!t.state<qv)return!1;t.ended||(t.paused?t.play():t.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!1}},{key:"enableGesture",value:function(){this.config.disableGesture=!0}},{key:"destroy",value:function(){var t=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,t.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,t.root.removeEventListener("touchmove",this.onRootTouchMove,!0),t.root.removeEventListener("touchend",this.onRootTouchEnd,!0)}},{key:"render",value:function(){var t="normal"!==this.config.gradient?"gradient ".concat(this.config.gradient):"gradient";return'\n <xg-trigger class="trigger">\n <div class="'.concat(t,'"></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}}}]),n}(Pg);function Rm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Om(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}function Im(t){t.preventDefault(),t.returnValue=!1}var Lm=function(t){fi(n,t);var e=Om(n);function n(){var t;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(t=e.call.apply(e,[this].concat(r))),"onBodyKeyDown",(function(e){if(!t.config.disable&&!t.config.disableBodyTrigger&&t.checkIsVisible()){var n=e||window.event,i=n.keyCode;return!(n.target!==document.body||!t.checkCode(i,!0))&&(Im(n),t.handleKeyCode(i,e),!1)}})),yi(pi(t),"onKeydown",(function(e){if(!t.config.disable){var n=e||window.event;if(!n||37!==n.keyCode&&!t.checkCode(n.keyCode)||n.target!==t.player.root&&n.target!==t.player.video&&n.target!==t.player.controls.el)return!0;Im(n),t.handleKeyCode(n.keyCode,e)}})),t}return Co(n,[{key:"mergekeyCodeMap",value:function(){var t=this,e=this.config.keyCodeMap;e&&Object.keys(e).map((function(n){t.keyCodeMap[n]?["keyCode","action","disable","isBodyTarget"].map((function(i){e[n][i]&&(t.keyCodeMap[n][i]=e[n][i])})):t.keyCodeMap[n]=e[n]}))}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var t="function"==typeof this.config.seekStep?this.config.seekStep(this.player):this.config.seekStep;t&&"number"==typeof t&&(this.seekStep=t),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 t=this.player.root.getBoundingClientRect(),e=t.height,n=t.top,i=t.bottom,r=window.innerHeight;return!(n<0&&n<0-.9*e||i>0&&i-r>.9*e)}},{key:"checkCode",value:function(t,e){var n=this,i=!1;return Object.keys(this.keyCodeMap).map((function(r){n.keyCodeMap[r]&&t===n.keyCodeMap[r].keyCode&&!n.keyCodeMap[r].disable&&(i=!e||e&&!n.keyCodeMap[r].noBodyTarget)})),i}},{key:"downVolume",value:function(t){var e=this.player,n=parseFloat((e.volume-.1).toFixed(1));this.emitUserAction(t,"change_volume",{prop:"volume",from:e.volume,to:n}),e.volume=n>=0?n:0}},{key:"upVolume",value:function(t){var e=this.player,n=parseFloat((e.volume+.1).toFixed(1));this.emitUserAction(t,"change_volume",{prop:"volume",from:e.volume,to:n}),e.volume=n<=1?n:1}},{key:"seek",value:function(t){var e=this.player,n=e.currentTime,i=e.duration,r=n;r=n+this.seekStep<=i?n+this.seekStep:i-1,this.emitUserAction(t,"seek",{prop:"currentTime",from:n,to:r}),this.player.currentTime=r}},{key:"seekBack",value:function(t){var e=this.player.currentTime,n=0;e-this.seekStep>=0&&(n=e-this.seekStep),this.emitUserAction(t,"seek",{prop:"currentTime",from:e,to:n}),this.player.currentTime=n}},{key:"playPause",value:function(t){var e=this.player;this.emitUserAction(t,"switch_play_pause",{prop:"paused",from:e.paused,to:!e.paused}),e.paused?e.play():e.pause()}},{key:"exitFullscreen",value:function(t){console.log("exitFullscreen",t);var e=this.player,n=e.isCssfullScreen,i=e.fullscreen;i&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:i,to:!i}),e.exitFullscreen()),n&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:n,to:!n}),e.exitCssFullscreen())}},{key:"handleKeyCode",value:function(t,e){var n=this;Object.keys(this.keyCodeMap).map((function(i){var r=n.keyCodeMap[i],o=r.action,s=r.keyCode,a=r.disable;s!==t||a||("function"==typeof o?o(e):"string"==typeof o&&"function"==typeof n[o]&&n[o](e),n.emit(Mp,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Rm(Object(n),!0).forEach((function(e){yi(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Rm(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({key:i,target:e.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,keyCodeMap:{},disable:!1}}}]),n}(dg);function Am(){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}function Dm(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Mm=function(t){fi(n,t);var e=Dm(n);function n(){return ui(this,n),e.apply(this,arguments)}return Co(n,[{key:"registerIcons",value:function(){return{loadingIcon:Am}}},{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:wg.ROOT}}}]),n}(Pg),Nm=En,Fm=Zi.findIndex,jm=Zp,Bm="findIndex",Hm=!0;Bm in[]&&Array(1).findIndex((function(){Hm=!1})),Nm({target:"Array",proto:!0,forced:Hm},{findIndex:function(t){return Fm(this,t,arguments.length>1?arguments[1]:void 0)}}),jm(Bm);var Um=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],Vm=function(){function t(e){ui(this,t),this.fragments=e.fragments||[],this.focusClass="inner-focus",this.style=e.style||{playedColor:"",cachedColor:"",progressColor:""},this.duration=0,this.cachedIndex=0,this.playedIndex=0}return Co(t,[{key:"updateDuration",value:function(t){var e=this;this.duration=parseInt(1e3*t);var n=0,i=this.fragments;this.fragments=i.map((function(t){return t.start=n,t.end=n+t.percent*e.duration,t.duration=t.percent*e.duration,n+=t.percent*e.duration,t}))}},{key:"updateProgress",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},n=this.progressList,i=this.fragments,r=e.newIndex,o=e.curIndex,s=e.millisecond;r!==o&&n.map((function(e,n){n<r?e[t].style.width="100%":n>r&&(e[t].style.width=0)}));var a=i[r],c=0===s?0:(s-a.start)/a.duration;n[r][t].style.width=c<0?0:"".concat(100*c,"%")}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},e=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*e,10)!==this.duration){if(!e&&0!==e)return;this.updateDuration(e)}var n=this.playedIndex,i=this.cachedIndex;if("Undefined"!==Wd.typeOf(t.played)){var r=this.findIndex(1e3*t.played,n);this.updateProgress("played",{newIndex:r,curIndex:n,millisecond:parseInt(1e3*t.played,10)}),this.playedIndex=r}if("Undefined"!==Wd.typeOf(t.cached)){var o=this.findIndex(1e3*t.cached,i);this.updateProgress("cached",{newIndex:o,curIndex:i,millisecond:parseInt(1e3*t.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(t,e){var n=this.fragments;return 1===n.length?0:(t>n[e].start&&t<n[e].end||this.fragments.map((function(n,i){t>n.start&&t<=n.end&&(e=i)})),e)}},{key:"findHightLight",value:function(){for(var t=this.root.children,e=0;e<t.length;e++)if(Wd.hasClass(t[e],this.focusClass))return{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"findFragment",value:function(t){var e=this.root.children;return t<0||t>=e.length?null:{dom:e[t],pos:e[t].getBoundingClientRect()}}},{key:"unHightLight",value:function(){for(var t=this.root.children,e=0;e<t.length;e++)Wd.removeClass(t[e],this.focusClass)}},{key:"setHightLight",value:function(t){var e=this.root.children;if(t<e.length)return Wd.addClass(e[t],this.focusClass),{dom:e[t],pos:e[t].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"render",value:function(){var t=this,e=this.style.progressColor;return this.root=Wd.createDom("xg-inners","",{},"progress-list"),this.fragments&&(this.progressList=this.fragments.map((function(n){var i=Wd.createDom("xg-inner","",{style:e?"background:".concat(e,"; flex: ").concat(n.percent):"flex: ".concat(n.percent)},"".concat(n.isFocus?"inner-focus":""," xgplayer-progress-inner"));return t.root.appendChild(i),Um.map((function(e){i.appendChild(Wd.createDom(e.tag,"",{style:e.styleKey?"background: ".concat(t.style[e.styleKey],"; width:0;"):"width:0;"},e.className))})),{cached:i.children[0],played:i.children[1]}}))),this.root}}]),t}();function Gm(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Wm=function(t){fi(n,t);var e=Gm(n);function n(t){var i;return ui(this,n),yi(pi(i=e.call(this,t)),"onMoveOnly",(function(t){var e=pi(i),n=e.pos,r=e.config,o=e.player;Wd.event(t);var s=Wd.getEventPos(t,o.zoom),a=90===o.rotateDeg?s.clientY:s.clientX;if(!(n.moving&&Math.abs(n.x-a)<r.miniMoveStep)){n.moving=!0,n.x=a;var c=i.computeTime(t);i.triggerCallbacks("dragmove",c)}})),yi(pi(i),"onBodyClick",(function(t){t.preventDefault(),t.stopPropagation()})),yi(pi(i),"onMouseDown",(function(t){var e=pi(i),n=e.player,r=e.pos,o=e.config,s=e.playerConfig,a=Wd.getEventPos(t,n.zoom),c=90===n.rotateDeg?a.clientY:a.clientX;if(!(n.isMini||o.closeMoveSeek||!s.allowSeekAfterEnded&&n.ended)){t.stopPropagation(),t.preventDefault(),i.focus(),Wd.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),Wd.checkIsFunction(o.onMoveStart)&&o.onMoveStart(),Wd.event(t),r.x=c,r.isDown=!0,r.moving=!1,n.focus({autoHide:!1}),i.isProgressMoving=!0,Wd.addClass(i.progressBtn,"active");var l=i.computeTime(t);return i._state.time=l.currentTime,i.updateWidth(l.currentTime,l.percent,0),i.isMobile?(i.bind("touchmove",i.onMouseMove),i.bind("touchend",i.onMouseUp)):(i.unbind("mousemove",i.onMoveOnly),document.addEventListener("mousemove",i.onMouseMove,!1),document.addEventListener("mouseup",i.onMouseUp,!1),n.root.addEventListener("click",i.onBodyClick,!1)),!0}})),yi(pi(i),"onMouseUp",(function(t){var e=pi(i),n=e.player,r=e.config,o=e.pos,s=e.playerConfig,a=e._state;t.stopPropagation(),t.preventDefault(),Wd.checkIsFunction(s.enableSwipeHandler)&&s.enableSwipeHandler(),Wd.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),Wd.event(t),Wd.removeClass(i.progressBtn,"active");var c=i.computeTime(t);o.moving?(i.updateWidth(c.currentTime,c.percent,2),i.triggerCallbacks("dragend",c)):i.triggerCallbacks("click",c),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,a.time=0,i.isMobile?(i.unbind("touchmove",i.onMouseMove),i.unbind("touchend",i.onMouseUp),i.blur()):(document.removeEventListener("mousemove",i.onMouseMove,!1),document.removeEventListener("mouseup",i.onMouseUp,!1),n.root.removeEventListener("click",i.onBodyClick,!1),o.isEnter?!s.isMobileSimulateMode&&i.bind("mousemove",i.onMoveOnly):i.onMouseLeave(t)),Wd.setTimeout(pi(i),(function(){i.resetSeekState()}),10),n.focus()})),yi(pi(i),"onMouseMove",(function(t){var e=pi(i),n=e.pos,r=e.player,o=e.config,s=e._state;i.isMobile&&(t.stopPropagation(),t.preventDefault()),Wd.event(t);var a=Wd.getEventPos(t,r.zoom),c=90===r.rotateDeg?a.clientY:a.clientX,l=Math.abs(n.x-c);if(!(n.moving&&l<o.miniMoveStep||!n.moving&&l<o.miniStartStep)){n.x=c;var u=i.computeTime(t);s.time<u.currentTime?u.forward=!0:u.forward=!1,s.time=u.currentTime,n.isDown&&!n.moving&&(n.moving=!0,o.isPauseMoving&&r.pause(),i.triggerCallbacks("dragstart",u)),i.updateWidth(u.currentTime,u.percent,1),i.triggerCallbacks("dragmove",u)}})),yi(pi(i),"onMouseEnter",(function(t){var e=pi(i),n=e.player,r=e.pos;r.isDown||r.isEnter||n.isMini||!n.config.allowSeekAfterEnded&&n.ended||(r.isEnter=!0,i.bind("mousemove",i.onMoveOnly),i.bind("mouseleave",i.onMouseLeave),i.focus())})),yi(pi(i),"onMouseLeave",(function(t){var e=pi(i),n=e.player,r=e.pos;r.isEnter=!1,n.isMini||(i.unbind("mousemove",i.onMoveOnly),r.isDown?i.unbind("mouseleave",i.onMouseLeave):i.blur())})),i.useable=!1,i.isProgressMoving=!1,i.__dragCallBacks=[],i._state={now:-1,direc:0,time:0},i}return Co(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 t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.useable=t}},{key:"createInner",value:function(){var t=this;this.innerList=new Vm({fragments:this.config.fragments,style:this.playerConfig.commonStyle||{}}),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map((function(e){t[e]=t.innerList[e].bind(t.innerList)}))}},{key:"afterCreate",value:function(){var t=this;this.config.disable||this.playerConfig.isLive||(this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1},this.outer=this.find("xg-outer"),this.createInner(),"mobile"===Xd.device&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(op,(function(){t.onTimeupdate()})),this.on(rp,(function(){t.onTimeupdate(),t.onCacheUpdate()})),this.on(fp,(function(){t.onCacheUpdate()})),this.on(tp,(function(){t.onCacheUpdate(),t._state.now=0})),this.on(pp,(function(){t.onReset()})),this.bindDomEvents(),this.initCustomStyle())}},{key:"initCustomStyle",value:function(){var t=(this.playerConfig||{}).commonStyle.sliderBtnStyle,e=this.progressBtn;t&&("string"==typeof t?e.style.boxShadow=t:"object"===di(t)&&Object.keys(t).map((function(n){e.style[n]=t[n]})))}},{key:"triggerCallbacks",value:function(t,e){this.__dragCallBacks.length>0&&this.__dragCallBacks.map((function(n){if(n&&n.handler&&n.type===t)try{n.handler(e)}catch(t){console.error("[XGPLAYER][triggerCallbacks] ".concat(n," error"),t)}}))}},{key:"addCallBack",value:function(t,e){e&&"function"==typeof e&&this.__dragCallBacks.push({type:t,handler:e})}},{key:"removeCallBack",value:function(t,e){var n=this.__dragCallBacks,i=-1;n.map((function(n,r){n&&n.type===t&&n.handler===e&&(i=r)})),i>-1&&n.splice(i,1)}},{key:"bindDomEvents",value:function(){var t=this.player,e=t.controls,n=t.config;this.isMobile?(this.bind("touchstart",this.onMouseDown),e&&(e.root&&e.root.addEventListener("touchmove",Wd.stopPropagation),e.center&&e.center.addEventListener("touchend",Wd.stopPropagation))):(this.bind("mousedown",this.onMouseDown),!n.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),Wd.addClass(this.root,"active")}},{key:"blur",value:function(){this.player.controls.recoverAutoHide(),Wd.removeClass(this.root,"active")}},{key:"updateWidth",value:function(t,e,n){var i=this.config,r=this.player;if(!i.isCloseClickSeek||0!==n){var o=t>r.duration?r.duration-.2:Number(t).toFixed(1);this.updatePercent(e),this.updateTime(t),(1!==n||i.isDragingSeek&&"audio"!==r.videoConfig.mediaType)&&(this._state.now=o,this._state.direc=o>r.currentTime?0:1,r.seek(o))}}},{key:"computeTime",value:function(t){var e,n,i,r=this.player,o=this.root.getBoundingClientRect(),s=o.width,a=o.height,c=o.top,l=o.left,u=Wd.getEventPos(t,r.zoom);90===r.rotateDeg?(e=a,n=c,i=u.clientY):(e=s,n=l,i=u.clientX);var h=i-n,f=(h=h>e?e:h<0?0:h)/e;return{percent:f=f<0?0:f>1?1:f,currentTime:parseInt(f*this.duration*1e3,10)/1e3,offset:h,width:e,left:n,e:t}}},{key:"updateTime",value:function(t){var e=this.player,n=this.duration;t>n?t=n:t<0&&(t=0);var i=e.plugins.time;i&&i.updateTime(t)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var t=this.player.plugins.time;t&&t.resetActive()}},{key:"updatePercent",value:function(t,e){if(this.isProgressMoving=!0,!this.config.disable){t=t>1?1:t<0?0:t,this.progressBtn.style.left="".concat(100*t,"%"),this.innerList.update({played:t*this.duration},this.duration);var n=this.player.plugins.miniprogress;n&&n.update({played:t*this.duration},this.duration)}}},{key:"onTimeupdate",value:function(){var t=this.player,e=this._state,n=this.duration;if(!(t.isSeeking||this.isProgressMoving||t.state<Zv)){if(e.now>-1){var i=parseInt(1e3*e.now,10)-parseInt(1e3*t.currentTime,10);if(0===e.direc&&i>300||1===e.direc&&i>-300)return;e.now=-1}var r=this.timeOffset+t.currentTime;this.innerList.update({played:r},n),this.progressBtn.style.left="".concat(r/n*100,"%");var o=this.player.plugins.miniprogress;o&&o.update({played:r},n)}}},{key:"onCacheUpdate",value:function(){var t=this.player,e=this.duration,n=t.bufferedPoint;this.innerList.update({cached:n.end},e);var i=this.player.plugins.miniprogress;i&&i.update({cached:n.end},e)}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0);var t=this.player.plugins.miniprogress;t&&t.update({cached:0,played:0},0)}},{key:"destroy",value:function(){var t=this.player,e=t.controls;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null,this.isMobile?(this.unbind("touchstart",this.onMouseDown),this.unbind("touchmove",this.onMouseMove),this.unbind("touchend",this.onMouseUp),e&&(e.root&&e.root.removeEventListener("touchmove",Wd.stopPropagation),e.center&&e.center.removeEventListener("touchend",Wd.stopPropagation))):(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),t.root.removeEventListener("click",this.onBodyClick,!1))}},{key:"render",value:function(){if(!this.config.disable&&!this.playerConfig.isLive){var t=this.player.controls?this.player.controls.config.mode:"";return'\n <xg-progress class="xgplayer-progress '.concat("bottom"===t?"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:wg.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){}}}}]),n}(Pg);function Ym(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Km=function(t){fi(n,t);var e=Ym(n);function n(){return ui(this,n),e.apply(this,arguments)}return Co(n,[{key:"afterCreate",value:function(){var t=this,e=this.player;this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.on(ep,(function(){t.animate(e.paused)})),this.on(Jd,(function(){t.animate(e.paused)})),this.animate(!0))}},{key:"registerIcons",value:function(){return{play:{icon:_y,class:"xg-icon-play"},pause:{icon:Ey,class:"xg-icon-pause"}}}},{key:"btnClick",value:function(t){t.preventDefault(),t.stopPropagation();var e=this.player;return this.emitUserAction(t,"switch_play_pause",{prop:"paused",from:e.paused,to:!e.paused}),e.paused?(e.play(),this.animate(!1)):(e.pause(),this.animate(!0)),!1}},{key:"initIcons",value:function(){var t=this.icons;this.appendChild(".xgplayer-icon",t.play),this.appendChild(".xgplayer-icon",t.pause)}},{key:"animate",value:function(t){var e=this.i18nKeys;t?(this.setAttr("data-state","pause"),this.changeLangTextKey(this.find(".xg-tips"),e.PLAY_TIPS)):(this.setAttr("data-state","play"),this.changeLangTextKey(this.find(".xg-tips"),e.PAUSE_TIPS))}},{key:"destroy",value:function(){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 <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PLAY_TIPS,'">').concat(this.i18n.PLAY_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:wg.CONTROLS_LEFT,index:0,disable:!1}}}]),n}(Pg);function zm(){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}function Xm(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var qm=function(t){fi(n,t);var e=Xm(n);function n(){return ui(this,n),e.apply(this,arguments)}return Co(n,[{key:"afterCreate",value:function(){var t=this;this.initIcons(),this.onClick=function(e){e.preventDefault(),e.stopPropagation(),t.config.onClick(e)},this.bind(["click","touchend"],this.onClick)}},{key:"registerIcons",value:function(){return{screenBack:{icon:zm,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var t=this.icons;this.appendChild(this.root,t.screenBack)}},{key:"show",value:function(){Wd.addClass(this.root,"show")}},{key:"hide",value:function(){Wd.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:wg.ROOT_TOP,index:0}}}]),n}(Pg);function $m(){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 Zm(){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}function Jm(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Qm=function(t){fi(n,t);var e=Jm(n);function n(){var t;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(t=e.call.apply(e,[this].concat(r))),"_onOrientationChange",(function(e){t.player.fullscreen&&t.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?t.setRotateDeg(0):t.setRotateDeg(90))})),t}return Co(n,[{key:"afterCreate",value:function(){var t=this,e=this.config,n=this.playerConfig;if(!e.disable){e.target&&(this.playerConfig.fullscreenTarget=this.config.target);var i=Wd.getFullScreenEl();n.fullscreenTarget===i&&this.player.getFullscreen(),this.initIcons(),this.handleFullscreen=this.hook("fullscreenChange",this.changeFullScreen,{pre:function(e){var n=t.player.fullscreen;t.emitUserAction(e,"switch_fullscreen",{prop:"fullscreen",from:n,to:!n})}}),this.bind(".xgplayer-fullscreen","mobile"===Xd.device?"touchend":"click",this.handleFullscreen),this.on(Ep,(function(e){t.changeLangTextKey(t.find(".xg-tips"),e?t.i18nKeys.EXITFULLSCREEN_TIPS:t.i18nKeys.FULLSCREEN_TIPS),t.animate(e),t.config.needBackIcon&&t.show()})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:qm,options:{config:{onClick:function(e){t.handleFullscreen(e)}}}})),"mobile"===Xd.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:$m,class:"xg-get-fullscreen"},exitFullscreen:{icon:Zm,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){this.unbind(".xgplayer-icon","mobile"===Xd.device?"touchend":"click",this.handleFullscreen),"mobile"===Xd.device&&window.removeEventListener("orientationchange",this._onOrientationChange)}},{key:"initIcons",value:function(){var t=this.icons;this.appendChild(".xgplayer-icon",t.fullscreen),this.appendChild(".xgplayer-icon",t.exitFullscreen)}},{key:"setRotateDeg",value:function(t){var e=this.player;90===window.orientation||-90===window.orientation?e.rotateDeg=0:e.rotateDeg=t}},{key:"getRotateFullscreen",value:function(t){var e=this.player;e.isCssfullScreen&&e.exitCssFullscreen(t);var n=t?Wv.INNER_FULLSCREEN:Wv.ROTATE_FULLSCREEN;e._fullscreenEl=t||e.root,e.changeFullStyle(e.root,t,n,Wv.PARENT_ROTATE_FULLSCREEN),e.fullscreen=!0,this.setRotateDeg(90),this.emit(Ep,!0)}},{key:"exitRotateFullscreen",value:function(t){var e=this.player;e.fullscreen=!1;var n=e._fullscreenEl!==e.root?Wv.INNER_FULLSCREEN:Wv.ROTATE_FULLSCREEN;e.recoverFullStyle(e.root,e._fullscreenEl,n,Wv.PARENT_ROTATE_FULLSCREEN),this.setRotateDeg(0),this.emit(Ep,!1)}},{key:"changeFullScreen",value:function(t){t&&(t.preventDefault(),t.stopPropagation());var e=this.player,n=this.config,i=!1;if((!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen())&&(i=!0),i)e.fullscreen?(e.fullscreen=!1,e.exitCssFullscreen(),this.emit(Ep,!1)):(e.fullscreen=!0,e.getCssFullscreen(),this.emit(Ep,!0)),this.animate(e.fullscreen);else if(n.rotateFullscreen)e.fullscreen?this.exitRotateFullscreen():this.getRotateFullscreen(),this.animate(e.fullscreen);else{if(n.switchCallback&&"function"==typeof n.switchCallback)return void n.switchCallback(e.fullscreen);e.fullscreen?e.exitFullscreen():e.getFullscreen()}}},{key:"animate",value:function(t){t?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(t?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"show",value:function(){xo(vi(n.prototype),"show",this).call(this)}},{key:"hide",value:function(){xo(vi(n.prototype),"hide",this).call(this)}},{key:"render",value:function(){if(!this.config.disable){var t="FULLSCREEN_TIPS";return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys[t],'">').concat(this.i18n[t],"</div>\n </xg-icon>")}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:wg.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),n}(Pg);function tk(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var ek=function(t){fi(n,t);var e=tk(n);function n(t){var i;return ui(this,n),(i=e.call(this,t)).isActiving=!1,i}return Co(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"afterCreate",value:function(){var t=this,e=this.player.controls.config.mode;this.mode="flex"===e?"flex":"normal",this.config.disable||("flex"===this.mode&&(this.createCenterTime(),this.hide()),this.durationDom=this.find(".time-duration"),this.timeDom=this.find(".time-current"),this.on(cp,(function(){t.onTimeUpdate()})),this.on(op,(function(){t.onTimeUpdate()})),this.on(pp,(function(){t.onReset()})))}},{key:"show",value:function(){"flex"!==this.mode&&xo(vi(n.prototype),"show",this).call(this)}},{key:"onTimeUpdate",value:function(){var t=this.player;if(!(this.config.disable||this.isActiving||t.state<Zv)){var e=t.currentTime+this.timeOffset;"flex"===this.mode?(this.centerCurDom.innerHTML=Wd.format(e),this.duration!==1/0&&this.duration>0&&(this.centerDurDom.innerHTML=Wd.format(this.duration))):(this.timeDom.innerHTML=Wd.format(e),this.duration!==1/0&&this.duration>0&&(this.durationDom.innerHTML=Wd.format(this.duration)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=Wd.format(0),this.centerDurDom.innerHTML=Wd.format(0)):(this.timeDom.innerHTML=Wd.format(0),this.durationDom.innerHTML=Wd.format(0))}},{key:"createCenterTime",value:function(){var t=this.player;if(t.controls&&t.controls.center){var e=t.controls.center;this.centerCurDom=Wd.createDom("xg-icon","00:00",{},"xgplayer-time left"),this.centerDurDom=Wd.createDom("xg-icon","00:00",{},"xgplayer-time right"),e.children.length>0?e.insertBefore(this.centerCurDom,e.children[0]):e.appendChild(this.centerCurDom),e.appendChild(this.centerDurDom)}}},{key:"afterPlayerInit",value:function(){var t=this.config;this.duration===1/0||this.playerConfig.isLive?(Wd.hide(this.durationDom),Wd.hide(this.timeDom),Wd.hide(this.find(".time-separator")),Wd.show(this.find(".time-live-tag"))):Wd.hide(this.find(".time-live-tag")),t.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(t){t?(Wd.hide(this.durationDom),Wd.hide(this.timeDom),Wd.hide(this.find(".time-separator")),Wd.show(this.find(".time-live-tag"))):(Wd.hide(this.find(".time-live-tag")),Wd.show(this.find(".time-separator")),Wd.show(this.durationDom),Wd.show(this.timeDom))}},{key:"updateTime",value:function(t){this.isActiving=!0,!t&&0!==t||t>this.duration||("flex"!==this.mode?this.timeDom.innerHTML=Wd.format(t):this.centerCurDom.innerHTML=Wd.format(t))}},{key:"resetActive",value:function(){var t=this,e=this.player,n=function(){t.isActiving=!1};this.off(rp,n),e.isSeeking?this.once(rp,n):this.isActiving=!1}},{key:"destroy",value:function(){var t=this.player.controls.center;this.centerCurDom&&t.removeChild(this.centerCurDom),this.centerCurDom=null,this.centerDurDom&&t.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:wg.CONTROLS_LEFT,index:2,disable:!1}}}]),n}(Pg);function nk(){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 ik(){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 rk(){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}function ok(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var sk=function(t){fi(n,t);var e=ok(n);function n(){var t;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(t=e.call.apply(e,[this].concat(r))),"onBarMousedown",(function(e){var n=pi(t).player,i=t.find(".xgplayer-slider"),r=t.find(".xgplayer-bar");i.focus(),Wd.event(e);var o=r.getBoundingClientRect(),s=Wd.getEventPos(e,n.zoom),a=(s.clientX,s.clientY),c=o.height-(s.clientY-o.top);t.updateVolumePos(c,e),t.isMoving=!1;var l=function(e){e.preventDefault(),e.stopPropagation(),Wd.event(e);var i=Wd.getEventPos(e,n.zoom);t.isMoving=!0;var r=c-i.clientY+a;r>o.height||t.updateVolumePos(r,e)},u=function e(n){n.preventDefault(),n.stopPropagation(),Wd.event(n),window.removeEventListener("mousemove",l),window.removeEventListener("touchmove",l),window.removeEventListener("mouseup",e),window.removeEventListener("touchend",e),t.isMoving=!1};return window.addEventListener("mousemove",l),window.addEventListener("touchmove",l),window.addEventListener("mouseup",u),window.addEventListener("touchend",u),!1})),yi(pi(t),"onMouseenter",(function(e){Wd.addClass(t.root,"slide-show")})),yi(pi(t),"onMouseleave",(function(e){Wd.removeClass(t.root,"slide-show")})),yi(pi(t),"onVolumeChange",(function(e){var n=t.player,i=n.muted,r=n.volume;t.isMoving||(t.find(".xgplayer-drag").style.height=i||0===r?"0px":"".concat(100*r,"%")),t.animate(i,r)})),t}return Co(n,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:ik,class:"xg-volume-small"},volumeLarge:{icon:nk,class:"xg-volume"},volumeMuted:{icon:rk,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var t=this;if(!this.config.disable){this.initIcons();var e=this.playerConfig,n=e.commonStyle,i=e.volume;n.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=n.volumeColor),this.changeMutedHandler=this.hook("mutedChange",(function(e){t.changeMuted(e)}),{pre:function(e){e.preventDefault(),e.stopPropagation(),t.emitUserAction(e,"change_muted",{prop:"muted",from:t.player.muted,to:!t.player.muted})}}),"mobile"===Xd.device||this.playerConfig.isMobileSimulateMode||(this.bind("mouseenter",this.onMouseenter),this.bind(["blur","mouseleave"],this.onMouseleave),this.bind(".xgplayer-slider","mousedown",this.onBarMousedown)),this.bind(".xgplayer-icon","mobile"===Xd.device?"touchend":"click",this.changeMutedHandler),this.on(lp,this.onVolumeChange),this.once(up,this.onVolumeChange),"Number"!==Wd.typeOf(i)&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(t,e){var n=this.player,i=this.find(".xgplayer-drag"),r=t/this.find(".xgplayer-bar").getBoundingClientRect().height;i.style.height="".concat(t,"px");var o=Math.max(Math.min(r,1),0);this.emitUserAction(e,"change_volume",[{prop:"muted",from:!0,to:!1},{prop:"volume",from:n.volume,to:o}]),n.volume=o,n.muted=!1,this.config.showValueLabel&&this.updateVolumeValue()}},{key:"updateVolumeValue",value:function(){var t=this.player.volume,e=this.find(".xgplayer-value-label"),n=Math.max(Math.min(t,1),0);e.innerText=Math.ceil(100*n)}},{key:"changeMuted",value:function(t){t&&t.stopPropagation();var e=this.player;e.volume<.01?e.volume=this.config.default:e.muted=!e.muted}},{key:"animate",value:function(t,e){t||0===e?this.setAttr("data-state","mute"):e<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var t=this.icons;this.appendChild(".xgplayer-icon",t.volumeSmall),this.appendChild(".xgplayer-icon",t.volumeLarge),this.appendChild(".xgplayer-icon",t.volumeMuted)}},{key:"destroy",value:function(){this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-bar","mousedown",this.onBarMousedown),this.unbind(".xgplayer-icon","mobile"===Xd.device?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){if(!this.config.disable){var t=this.config.default||this.player.volume,e=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(e?'<div class="xgplayer-value-label">'.concat(100*t,"</div>"):"",'\n <div class="xgplayer-bar">\n <xg-drag class="xgplayer-drag" style="height: ').concat(100*t,'%"></xg-drag>\n </div>\n </xg-slider>\n </xg-icon>')}}}],[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:wg.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6}}}]),n}(Pg);function ak(){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}function ck(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var lk=function(t){fi(n,t);var e=ck(n);function n(t){var i;return ui(this,n),(i=e.call(this,t)).rotateDeg=i.config.rotateDeg||0,i}return Co(n,[{key:"afterCreate",value:function(){var t=this;this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.rotate),this.onBtnClick=this.onBtnClick.bind(this),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(Op,(function(){console.log("Events.VIDEO_RESIZE"),t.rotateDeg&&Wd.setTimeout(t,(function(){t.updateRotateDeg(t.rotateDeg,t.config.innerRotate)}),100)})),this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate))}},{key:"destroy",value:function(){this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{key:"onBtnClick",value:function(t){t.preventDefault(),t.stopPropagation(),this.emitUserAction(t,"rotate"),this.rotate(this.config.clockwise,this.config.innerRotate,1)}},{key:"updateRotateDeg",value:function(t,e){var n=this.player;t||(t=0);var i=this.player,r=i.root,o=i.innerContainer,s=i.video,a=r.offsetWidth,c=o&&e?o.offsetHeight:r.offsetHeight,l="100%",u="100%",h=0,f=0;.75!==t&&.25!==t||(l="".concat(c,"px"),u="".concat(a,"px"),h=-(c-a)/2,f=-(a-c)/2);var d="translate(".concat(h,"px,").concat(f,"px) rotate(").concat(t,"turn)"),p={transformOrigin:"center center",transform:d,webKitTransform:d,height:u,width:l},g=e?s:r,v=e?n.getPlugin("poster"):null;Object.keys(p).map((function(t){g.style[t]=p[t],v&&v.root&&(v.root.style[t]=p[t])}))}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=!(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=t?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*r*n)%1,this.updateRotateDeg(this.rotateDeg,e),i.emit(Lp,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:ak}}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.ROTATE_TIPS,'">\n ').concat(this.i18n.ROTATE_TIPS,"\n </div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:wg.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),n}(Pg);function uk(){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 hk(){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}function fk(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var dk="picture-in-picture",pk="inline",gk="fullscreen",vk=function(t){fi(n,t);var e=fk(n);function n(){var t;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(t=e.call.apply(e,[this].concat(r))),"switchPIP",(function(e){if(!t.isPIPAvailable())return!1;e.stopPropagation(),t.isPip?(t.exitPIP(),t.emitUserAction(e,"change_pip",{props:"pip",from:!0,to:!1}),t.setAttr("data-state","normal")):4===t.player.video.readyState&&(t.requestPIP(),t.emitUserAction(e,"change_pip",{props:"pip",from:!1,to:!0}),t.setAttr("data-state","pip"))})),t}return Co(n,[{key:"beforeCreate",value:function(t){"boolean"==typeof t.player.config.pip&&(t.config.showIcon=t.player.config.pip)}},{key:"afterCreate",value:function(){var t=this;this.isPIPAvailable()&&(this.pMode=pk,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(wp,(function(){t.config.showIcon&&(Wd.removeClass(t.find(".xgplayer-icon"),"xg-icon-disable"),t.bind("click",t.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:uk,class:"xg-get-pip"},pipIconExit:{icon:hk,class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var t=this.icons;this.appendChild(".xgplayer-icon",t.pipIcon),this.appendChild(".xgplayer-icon",t.pipIconExit)}},{key:"initPipEvents",value:function(){var t=this,e=this.player;this.leavePIPCallback=function(){var n=e.paused;Wd.setTimeout(t,(function(){!n&&e.videoPlay()}),0),!n&&e.videoPlay(),t.setAttr("data-state","normal"),e.emit(Ip,!1)},this.enterPIPCallback=function(n){e.emit(Ip,!0),t.pipWindow=n.pictureInPictureWindow,t.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(n){var i=e.video.webkitPresentationMode;t.pMode===gk&&i!==gk&&e.onFullscreenChange(null,!1),t.pMode=i,i===dk?t.enterPIPCallback(n):i===pk&&t.leavePIPCallback(n)},e.video&&(e.video.addEventListener("enterpictureinpicture",this.enterPIPCallback),e.video.addEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(e.video)&&e.video.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"requestPIP",value:function(){var t=this.player,e=this.playerConfig;if(this.isPIPAvailable()&&!this.isPip)try{var i=e.poster;return i&&(t.video.poster="String"===Wd.typeOf(i)?i:i.poster),n.checkWebkitSetPresentationMode(t.video)?t.video.webkitSetPresentationMode("picture-in-picture"):t.video.requestPictureInPicture(),!0}catch(t){return console.error("requestPiP",t),!1}}},{key:"exitPIP",value:function(){var t=this.player;try{return this.isPIPAvailable()&&this.isPip&&(n.checkWebkitSetPresentationMode(t.video)?t.video.webkitSetPresentationMode("inline"):document.exitPictureInPicture()),!0}catch(t){return console.error("exitPIP",t),!1}}},{key:"isPip",get:function(){var t=this.player;return document.pictureInPictureElement&&document.pictureInPictureElement===t.video||t.video.webkitPresentationMode===dk}},{key:"isPIPAvailable",value:function(){var t=this.player.video;return document.pictureInPictureEnabled&&("Boolean"===Wd.typeOf(t.disablePictureInPicture)&&!t.disablePictureInPicture||t.webkitSupportsPresentationMode&&"Function"===Wd.typeOf(t.webkitSetPresentationMode))}},{key:"destroy",value:function(){var t=this.player;t.video.removeEventListener("enterpictureinpicture",this.enterPIPCallback),t.video.removeEventListener("leavepictureinpicture",this.leavePIPCallback),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 <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PIP,'">').concat(this.i18n.PIP,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:wg.CONTROLS_RIGHT,index:6,showIcon:!1}}},{key:"checkWebkitSetPresentationMode",value:function(t){return"function"==typeof t.webkitSetPresentationMode}}]),n}(Pg);function yk(){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}function mk(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var kk=function(t){fi(n,t);var e=mk(n);function n(t){var i;return ui(this,n),yi(pi(i=e.call(this,t)),"playNext",(function(t){var e=pi(i).player;t.preventDefault(),t.stopPropagation(),i.idx+1<i.config.urlList.length?(i.idx++,e.emit(Dp,i.idx+1),i.nextHandler(i.config.urlList[i.idx],i.idx)):(i.nextHandler(),e.emit(Dp))})),i.idx=-1,i}return Co(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:yk}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("nextClick",this.changeSrc);var t="mobile"===Xd.device?"touchend":"click";this.bind(t,this.playNext),this.show()}},{key:"changeSrc",value:function(t){var e=this.player;t&&(e.pause(),e.currentTime=0,e.autoplay=!0,e.src=t)}},{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 <div class="xg-tips" lang-key="PLAYNEXT_TIPS">'.concat(this.i18n.PLAYNEXT_TIPS,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:wg.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),n}(Pg),bk={exports:{}};!function(t,e){t.exports=function t(e,n,i){var r,o,s=window,a="application/octet-stream",c=i||a,l=e,u=!n&&!i&&l,h=document.createElement("a"),f=function(t){return String(t)},d=s.Blob||s.MozBlob||s.WebKitBlob||f,p=n||"download";if(d=d.call?d.bind(s):Blob,"true"===String(this)&&(c=(l=[l,c])[0],l=l[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(e){t(e.target.response,p,a)},setTimeout((function(){g.send()}),0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(l)){if(!(l.length>2096103.424&&d!==f))return navigator.msSaveBlob?navigator.msSaveBlob(k(l),p):b(l);c=(l=k(l)).type||a}else if(/([\x80-\xff])/.test(l)){for(var v=0,y=new Uint8Array(l.length),m=y.length;v<m;++v)y[v]=l.charCodeAt(v);l=new d([y],{type:c})}function k(t){for(var e=t.split(/[:;,]/),n=e[1],i=("base64"==e[2]?atob:decodeURIComponent)(e.pop()),r=i.length,o=0,s=new Uint8Array(r);o<r;++o)s[o]=i.charCodeAt(o);return new d([s],{type:n})}function b(t,e){if("download"in h)return h.href=t,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===e&&setTimeout((function(){s.URL.revokeObjectURL(h.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(t)&&(t="data:"+t.replace(/^data:([\w\/\-\+]+)/,a)),window.open(t)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=t),!0;var n=document.createElement("iframe");document.body.appendChild(n),!e&&/^data:/.test(t)&&(t="data:"+t.replace(/^data:([\w\/\-\+]+)/,a)),n.src=t,setTimeout((function(){document.body.removeChild(n)}),333)}if(r=l instanceof d?l:new d([l],{type:c}),navigator.msSaveBlob)return navigator.msSaveBlob(r,p);if(s.URL)b(s.URL.createObjectURL(r),!0);else{if("string"==typeof r||r.constructor===f)try{return b("data:"+c+";base64,"+s.btoa(r))}catch(t){return b("data:"+c+","+encodeURIComponent(r))}(o=new FileReader).onload=function(t){b(this.result)},o.readAsDataURL(r)}return!0}}(bk);var wk=bk.exports;function Ck(){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}function xk(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var _k=function(t){fi(n,t);var e=xk(n);function n(t){var i;return ui(this,n),yi(pi(i=e.call(this,t)),"download",(function(t){if(!i.isLock){i.emitUserAction(t,"download");var e=i.getAbsoluteURL(i.player.src);wk(e),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 Co(n,[{key:"afterCreate",value:function(){this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.download),this.bind(["click","touchend"],this.download))}},{key:"registerIcons",value:function(){return{download:Ck}}},{key:"getAbsoluteURL",value:function(t){if(!t.match(/^https?:\/\//)){var e=document.createElement("div");e.innerHTML='<a href="'.concat(t,'">x</a>'),t=e.firstChild.href}return t}},{key:"destroy",value:function(){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 <div class="xg-tips" lang-key="'.concat(this.i18nKeys.DOWNLOAD_TIPS,'">').concat(this.i18n.DOWNLOAD_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:wg.CONTROLS_RIGHT,index:3,disable:!0}}}]),n}(Pg);function Ek(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Tk=function(t){fi(n,t);var e=Ek(n);function n(){return ui(this,n),e.apply(this,arguments)}return Co(n,[{key:"beforeCreate",value:function(t){"boolean"==typeof t.player.config.screenShot&&(t.config.disable=!t.player.config.screenShot)}},{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var t=this.config;this.initSize=function(e){t.fitVideo&&(t.width=e.vWidth,t.height=e.vHeight)},this.once(Op,this.initSize)}},{key:"onPluginsReady",value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind(["click","touchend"],this.onClickBtn)}},{key:"saveScreenShot",value:function(t,e){var n=document.createElement("a");n.href=t,n.download=e;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:"createCanvans",value:function(t,e){var n=document.createElement("canvas");this.canvasCtx=n.getContext("2d"),this.canvas=n,n.width=t||this.config.width,n.height=e||this.config.height}},{key:"onClickBtn",value:function(t){var e=this;t.preventDefault(),t.stopPropagation(),this.emitUserAction(t,"shot"),this.shot().then((function(t){e.emit(Ap,t),e.saveScreenShot(t,e.config.name+e.config.format)}))}},{key:"shot",value:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},r=this.config,o=this.player,s=i.quality||r.quality,a=i.type||r.type;return new Promise((function(i,c){n.canvas?(n.canvas.width=t||r.width,n.canvas.height=e||r.height):n.createCanvans(t,e),n.canvasCtx.drawImage(o.video,0,0,t||r.width,e||r.height);var l=n.canvas.toDataURL(a,s).replace(a,"image/octet-stream");i(l=l.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.onClickBtn),this.off(Op,this.initSize)}},{key:"render",value:function(){if(!this.config.disable){var t=this.icons.screenshotIcon?"xgplayer-icon":"xgplayer-icon btn-text",e="SCREENSHOT";return'\n <xg-icon class="xgplayer-shot">\n <div class="'.concat(t,'">\n ').concat(this.icons.screenshotIcon?"":'<span lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</span>")," \n </div>\n </xg-icon>")}}}],[{key:"pluginName",get:function(){return"screenShot"}},{key:"defaultConfig",get:function(){return{position:wg.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,fitVideo:!0,disable:!1,name:"screenshot"}}}]),n}(Pg),Sk=function(){function t(e){ui(this,t),this.config=e.config,this.parent=e.root,this.root=Wd.createDom("ul","",{},"xg-options-list ".concat(this.config.className)),e.root.appendChild(this.root),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var n="mobile"===Xd.device?"touchend":"click";this._delegates=Pg.delegate.call(this,this.root,"li",n,this.onItemClick)}return Co(t,[{key:"renderItemList",value:function(t){var e=this,n=this.config,i=this.root;t?n.data=t:t=n.data,n.style&&Object.keys(n.style).map((function(t){i.style[t]=n[t]})),t.length>0&&(this.attrKeys=Object.keys(t[0])),this.root.innerHTML="",t.map((function(t,n){var i=t.isCurrent?"option-item selected":"option-item";t["data-index"]=n,e.root.appendChild(Wd.createDom("li","<span>".concat(t.showText,"</span>"),t,i))}))}},{key:"onItemClick",value:function(t){t.delegateTarget||(t.delegateTarget=t.target);var e=t.delegateTarget;if(e&&Wd.hasClass(e,"selected"))return!1;var n="function"==typeof this.config.onItemClick?this.config.onItemClick:null,i=this.root.querySelector(".selected");Wd.addClass(e,"selected"),i&&Wd.removeClass(i,"selected"),n(t,{from:i?this.getAttrObj(i,this.attrKeys):null,to:this.getAttrObj(e,this.attrKeys)})}},{key:"getAttrObj",value:function(t,e){if(!t||!e)return{};var n={};e.map((function(e){n[e]=t.getAttribute(e)}));var i=t.getAttribute("data-index");return i&&(n.index=Number(i)),n}},{key:"show",value:function(){Wd.removeClass(this.root,"hide"),Wd.addClass(this.root,"active")}},{key:"hide",value:function(){Wd.removeClass(this.root,"active"),Wd.addClass(this.root,"hide")}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map((function(t){t.destroy&&t.destroy()})),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),t}();function Pk(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Rk="mobile"===Xd.device,Ok=function(t){fi(n,t);var e=Pk(n);function n(t){var i;return ui(this,n),(i=e.call(this,t)).isActive=!1,i.curValue=null,i.curIndex=0,i}return Co(n,[{key:"updateLang",value:function(t){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var t=this,e=this.config;Rk&&"middle"!==e.listType&&(e.listType="rightSide"),e.hidePortrait&&Wd.addClass(this.root,"portrait"),this.once(ap,(function(){e.list&&e.list.length>0&&(t.renderItemList(e.list),t.show())})),Rk&&this.on(gp,(function(){t.isActive&&(t.optionsList&&t.optionsList.hide(),t.isActive=!1)})),this.activeEvent=Rk?"touchend":"mouseenter",this.onEnter=this.onEnter.bind(this),this.onLeave=this.onLeave.bind(this),this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave)}},{key:"show",value:function(){!this.config.list||this.config.list.length<2||Wd.addClass(this.root,"show")}},{key:"hide",value:function(){Wd.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(t,e,n){if(void 0===t)return"";var i=this.config.list;!n&&(n=this.player.lang),e=!e||Wd.isUndefined(t[e])?"text":e,"number"==typeof t&&(t=i[t]);try{return"object"===di(t[e])?t[e][n]||t[e].zh:t[e]}catch(t){return console.warn(t),""}}},{key:"onEnter",value:function(t){t.preventDefault(),t.stopPropagation(),this.onToggle(!0)}},{key:"onLeave",value:function(t){t.preventDefault(),t.stopPropagation(),this.isActive&&this.onToggle(!1)}},{key:"onToggle",value:function(t){if(t!==this.isActive){var e=this.player.controls,n=this.config.listType;t?("rightSide"===n?e.blur():e.focus(),this.optionsList&&this.optionsList.show()):("rightSide"===n?e.focus():e.unFocus(),this.optionsList&&this.optionsList.hide()),this.isActive=t}}},{key:"onItemClick",value:function(t,e){t.preventDefault(),t.stopPropagation();var n=this.config,i=n.listType,r=n.list;(Rk||"rightSide"===i)&&this.onToggle(!1),this.curIndex=e.to.index,this.curItem=r[this.curIndex],this.changeCurrentText()}},{key:"changeCurrentText",value:function(){var t=this.config.list,e=t[this.curIndex<t.length?this.curIndex:0];e&&(this.find(".icon-text").innerHTML=this.getTextByLang(e,"iconText"))}},{key:"renderItemList",value:function(t,e){var n=this,i=this.config,r=this.optionsList,o=this.player;if("number"==typeof e&&(this.curIndex=e,this.curItem=i.list[e]),r)return r.renderItemList(t),void this.changeCurrentText();var s={config:{data:t||[],className:"rightSide"===i.listType?"right-side":"",onItemClick:function(t,e){n.onItemClick(t,e)}},root:"rightSide"===i.listType?o.root:this.root};this.optionsList=new Sk(s),this.changeCurrentText(),this.show()}},{key:"destroy",value:function(){this.unbind(this.activeEvent,this.onToggle),this.unbind("mouseleave",this.onToggle),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null)}},{key:"render",value:function(){return'<xg-icon class="xg-options-icon '.concat(this.config.className||"",'">\n <div class="xgplayer-icon btn-text">\n <span class="icon-text"></span>\n </div>\n </xg-icon>')}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:wg.CONTROLS_RIGHT,index:100,list:[],listType:"middle",listStyle:{},hidePortrait:!0}}}]),n}(Pg);function Ik(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Lk=function(t){fi(n,t);var e=Ik(n);function n(t){var i;return ui(this,n),(i=e.call(this,t)).curTime=0,i.isPaused=!0,i}return Co(n,[{key:"beforeCreate",value:function(t){var e=t.config.list;Array.isArray(e)&&e.length>0&&(t.config.list=e.map((function(t){return!t.text&&t.name&&(t.text=t.name),t.text||(t.text=t.definition),t})))}},{key:"afterCreate",value:function(){var t=this;xo(vi(n.prototype),"afterCreate",this).call(this),this.on("resourceReady",(function(e){console.log("resourceReady",e),t.changeDefinitionList(e)})),this.on(Pp,(function(e){t.renderItemList(e.to)})),this.player.definitionList.length<2&&this.hide()}},{key:"initDefinition",value:function(){var t=this.config,e=t.list,n=t.defaultDefinition;if(e.length>0){var i=null;e.map((function(t){t.definition===n&&(i=t)})),i||(i=e[0]),this.changeDefinition(i)}}},{key:"renderItemList",value:function(t){var e=this,i=this.player,r=this.config.list,o=t&&t.url?t.url:i.currentSrc||i.src,s=t&&t.definition?t.definition:this.config.defaultDefinition,a=0,c=r.map((function(t,n){var i={url:t.url,definition:t.definition||"",showText:e.getTextByLang(t)||t.definition,isCurrent:!1};return(t.url===o||!Wd.isUndefined(t.definition)&&t.definition===s)&&(i.isCurrent=!0,a=n),i}));xo(vi(n.prototype),"renderItemList",this).call(this,c,a)}},{key:"changeDefinitionList",value:function(t){Array.isArray(t)&&(this.config.list=t.map((function(t){return!t.text&&t.name&&(t.text=t.name),t.text||(t.text=t.definition),t})),this.renderItemList(),this.config.list.length<2?this.hide():this.show())}},{key:"changeDefinition",value:function(t,e){var n=this.player;n.switchURL?n.switchUrl(t.url):n.changeDefinition(t,e)}},{key:"onItemClick",value:function(t,e){xo(vi(n.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(t,"change_definition",{from:e.from,to:e.to}),this.player.changeDefinition(e.to,e.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return{position:wg.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition"}}}]),n}(Ok);function Ak(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Dk=function(t){fi(n,t);var e=Ak(n);function n(t){var i;return ui(this,n),(i=e.call(this,t)).curRate=1,i}return Co(n,[{key:"beforeCreate",value:function(t){var e=t.player.config.playbackRate,n=e?Array.isArray(e)?e:t.config.list:[];Array.isArray(n)&&(t.config.list=n.map((function(t){return"number"==typeof t?t={rate:t,text:"".concat(t,"x")}:!t.text&&t.rate&&(t.text="".concat(t.rate,"x")),t})))}},{key:"afterCreate",value:function(){var t=this;xo(vi(n.prototype),"afterCreate",this).call(this),this.on(hp,(function(){t.curValue!==t.player.playbackRate&&t.renderItemList()})),this.renderItemList()}},{key:"show",value:function(){this.config.list&&0!==this.config.list.length&&xo(vi(n.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(t,e){xo(vi(n.prototype),"onItemClick",this).apply(this,arguments);var i=t.delegateTarget,r=Number(i.getAttribute("rate"));if(!r||r===this.curValue)return!1;this.emitUserAction(t,"change_rate",{props:"playbackRate",from:this.player.playbackRate,to:r}),this.curValue=r,this.player.playbackRate=r}},{key:"renderItemList",value:function(){var t=this,e=this.player.playbackRate||1;this.curValue=e;var i=0,r=this.config.list.map((function(n,r){var o={rate:n.rate};return o.rate===e&&(o.isCurrent=!0,i=r),o.showText=t.getTextByLang(n),o}));xo(vi(n.prototype),"renderItemList",this).call(this,r,i)}},{key:"destroy",value:function(){xo(vi(n.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return{position:wg.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",hidePortrait:!1}}}]),n}(Ok);function Mk(){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 Nk(){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}function Fk(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var jk=function(t){fi(n,t);var e=Fk(n);function n(){return ui(this,n),e.apply(this,arguments)}return Co(n,[{key:"afterCreate",value:function(){var t=this;this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(Tp,(function(e){t.animate(e)})),this.btnClick=this.btnClick.bind(this),this.bind(["click","touchend"],this.btnClick))}},{key:"initIcons",value:function(){var t=this.icons,e=this.find(".xgplayer-icon");e.appendChild(t.cssFullscreen),e.appendChild(t.exitCssFullscreen)}},{key:"btnClick",value:function(t){t.preventDefault(),t.stopPropagation();var e=this.player.isCssfullScreen;this.emitUserAction(t,"switch_css_fullscreen",{prop:"cssfullscreen",from:e,to:!e}),e?this.player.exitCssFullscreen():this.player.getCssFullscreen()}},{key:"animate",value:function(t){this.root&&(t?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.switchTips(t))}},{key:"switchTips",value:function(t){var e=this.i18nKeys;this.changeLangTextKey(this.find(".xg-tips"),t?e.EXITCSSFULLSCREEN_TIPS:e.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:Mk,class:"xg-get-cssfull"},exitCssFullscreen:{icon:Nk,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){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 <div class="xg-tips" lang-key="'.concat(this.i18nKeys.EXITCSSFULLSCREEN_TIPS,'">').concat(this.i18n.CSSFULLSCREEN_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:wg.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),n}(Pg);function Bk(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Hk=function(t){fi(n,t);var e=Bk(n);function n(){return ui(this,n),e.apply(this,arguments)}return Co(n,[{key:"afterCreate",value:function(){var t=this;this.clickHandler=this.hook("errorRetry",this.errorRetry,{pre:function(t){t.preventDefault(),t.stopPropagation()}}),this.onError=this.hook("showError",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(ap,(function(){t.handleCanPlay()})),this.on(np,(function(e){t.onError(e)}))}},{key:"errorRetry",value:function(){this.player.retry()}},{key:"handleCanPlay",value:function(){Wd.removeClass(this.player.root,"xgplayer-is-error")}},{key:"handleError",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.player,n=t.errorType,i=e.errorNote?this.i18n[e.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}(Pg);function Uk(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Vk=function(t){fi(n,t);var e=Uk(n);function n(){return ui(this,n),e.apply(this,arguments)}return Co(n,[{key:"afterCreate",value:function(){var t=this;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],(function(e){(t.config.onClick||t.customOnClick)&&(e.preventDefault(),e.stopPropagation(),t.customOnClick?t.customOnClick(e):t.config.onClick(e))})),this.player.showPrompt=function(){t.show.apply(t,arguments)},this.player.hidePrompt=function(){t.hide()}}},{key:"setStyle",value:function(t){var e=this;Object.keys(t).map((function(n){e.root.style[n]=t[n]}))}},{key:"show",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(t){this.customOnClick=i;var r=this.config.interval;this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),Wd.addClass(this.root,"show"),"arrow"===n.mode&&Wd.addClass(this.root,"arrow"),this.find(".xgplayer-prompt-detail").innerHTML="string"==typeof t?t:"".concat(t.text||"")+"".concat(t.highlight?'<i class="highlight">'.concat(t.highlight,"</i>"):""),n.style&&this.setStyle(n.style);var o="boolean"==typeof n.autoHide?n.autoHide:this.config.autoHide;if(o){var s=n.interval||r;this.intervalId=setTimeout((function(){e.hide()}),s)}}}},{key:"hide",value:function(){Wd.removeClass(this.root,"show"),Wd.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(Wv.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}(Pg),Gk={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function Wk(t){Object.keys(Gk).map((function(e){void 0===t[e]&&(t[e]=Gk[e])}))}var Yk={initDots:function(){var t=this;this._ispots.map((function(e){t.createDot(e,!1)})),this._ispotsInit=!0},createDot:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.player.plugins.progress;if(n&&(e&&(Wk(t),this._ispots.push(t)),this._ispotsInit||!e)){var i=this.calcuPosition(t.time,t.duration),r=t.style||{};r.left="".concat(i.left,"%"),r.width="".concat(i.width,"%");var o="xgspot_".concat(t.id," xgplayer-spot");i.isMini&&(o+=" mini");var s=Wd.createDom("xg-spot","",{"data-text":t.text,"data-time":t.time,"data-id":t.id},o);Object.keys(r).map((function(t){s.style[t]=r[t]})),n.outer&&n.outer.appendChild(s)}},findDot:function(t){if(this.player.plugins.progress){var e=this._ispots.filter((function(e,n){return e.id===t}));return e.length>0?e[0]:null}},updateDot:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.player.plugins.progress;if(n){var i=this.findDot(t.id);if(i&&Object.keys(t).map((function(e){i[e]=t[e]})),this._ispotsInit){var r=n.find('xg-spot[data-id="'.concat(t.id,'"]'));if(r){var o=this.calcuPosition(t.time,t.duration),s=t.style||{};s.left="".concat(o.left,"%"),s.width="".concat(o.width,"%"),r.setAttribute("data-text",t.text),r.setAttribute("data-time",t.time),o.isMini?Wd.addClass(r,"mini"):Wd.removeClass(r,"mini"),Object.keys(s).map((function(t){r.style[t]=s[t]})),e&&this.showDot(t.id)}}}},deleteDot:function(t){var e=this._ispots,n=this.player.plugins.progress;if(n){for(var i=[],r=0;r<e.length;r++)e[r].id===t&&i.push(r);for(var o=i.length-1;o>=0;o--)if(e.splice(i[o],1),this._ispotsInit){var s=n.find('xg-spot[data-id="'.concat(t,'"]'));s&&s.parentElement.removeChild(s)}}},deleteAllDots:function(){var t=this.player.plugins.progress;if(t)if(this._ispotsInit){for(var e=t.root.getElementsByTagName("xg-spot"),n=e.length-1;n>=0;n--)t.outer.removeChild(e[n]);this._ispots=[]}else this._ispots=[]},updateAllDots:function(){var t=this,e=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>e.length)for(var o=r-1;o>e.length-1;o--)n.outer.removeChild(i[o]);e.map((function(e,n){n<r?(i[n].setAttribute("data-id","".concat(e.id)),t._ispots.push(e),t.updateDot(e)):t.createDot(e)}))}else this._ispots=e}};function Kk(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var zk={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd"},Xk=function(t){fi(n,t);var e=Kk(n);function n(t){var i;return ui(this,n),yi(pi(i=e.call(this,t)),"onMousemove",(function(t){(i._state.f||Wd.hasClass(t.target,"xg-spot-content"))&&(Wd.event(t),t.stopPropagation())})),yi(pi(i),"onMousedown",(function(t){(i._state.f||Wd.hasClass(t.target,"xg-spot-content"))&&(Wd.event(t),t.stopPropagation())})),i._ispots=[],i.videoPreview=null,i.videothumbnail=null,i.thumbnail=null,i._state={now:0,f:!1},i}return Co(n,[{key:"beforeCreate",value:function(t){var e=t.player.plugins.progress;e&&(t.root=e.root)}},{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(),function(t){var e=t.config,n=t.player;Object.keys(Yk).map((function(e){t[e]=Yk[e].bind(t)}));var i=n.config.progressDot||e.ispots||[];t._ispots=i.map((function(t){return Wk(t),t})),t._ispotsInit=!1,n.once(cp,(function(){t.initDots()}))}(this),this.bindEvents())}},{key:"bindEvents",value:function(){var t=this,e=this.player.plugins.progress;if("mobile"!==Xd.device&&e){Object.keys(zk).map((function(n){t[zk[n]]=t[zk[n]].bind(t),e.addCallBack(n,t[zk[n]])})),this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown);var n=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(e){e.stopPropagation(),n(parseInt(1e3*t._state.now,10)/1e3,e)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMove",value:function(t){this.updatePosition(t.offset,t.width,t.currentTime,t.e)}},{key:"onProgressDragStart",value:function(t){this.isDrag=!0,this.videoPreview&&Wd.addClass(this.videoPreview,"show")}},{key:"onProgressDragEnd",value:function(t){this.isDrag=!1,this.videoPreview&&Wd.removeClass(this.videoPreview,"show")}},{key:"updateLinePos",value:function(t,e){var n,i,r=this.root,o=this.previewLine,s=this.timePoint,a="flex"===this.player.controls.mode,c=r.getBoundingClientRect().width,l=s.getBoundingClientRect().width,u=t-c/2;u<0&&!a?(u=0,n=t-c/2,!this.thumbnail&&(i=t-c/2-l/2)):u>e-c&&!a?(n=u-(e-c),!this.thumbnail&&(i=u-(e-c)-l/2),u=e-c):(n=0,!this.thumbnail&&(i=-l/2)),void 0!==n&&(o.style.transform="translateX(".concat(n,"px)")),void 0!==i&&(s.style.transform="translateX(".concat(i,"px)")),r.style.transform="translateX(".concat(u,"px)")}},{key:"updateTimeText",value:function(t){var e=this.timeText,n=this.timePoint;e.textContent=t,!this.thumbnail&&(n.textContent=t)}},{key:"updatePosition",value:function(t,e,n,i){var r=this.root,o=this.config,s=this._state;if(r){this.updateLinePos(t,e),s.now=n;var a=Wd.format(n);i&&i.target&&Wd.hasClass(i.target,"xgplayer-spot")?(this.showTips(i.target.getAttribute("data-text"),!1,a),s.f=!0,o.isFocusDots&&s.f&&(s.now=parseInt(i.target.getAttribute("data-time"),10))):o.defaultText?(s.f=!1,this.showTips(o.defaultText,!0,a)):(s.f=!1,this.hideTips("")),this.updateTimeText(a),this.updateThumbnails(s.now)}}},{key:"updateThumbnails",value:function(t){var e=this.player,n=this.videoPreview,i=e.plugins.thumbnail;if(i&&i.usable){this.thumbnail&&i.update(this.thumbnail,t,160,90);var r=n&&n.getBoundingClientRect();this.videothumbnail&&i.update(this.videothumbnail,t,r.width,r.height)}}},{key:"registerThumbnail",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==Xd.device){var e=this.player,n=this.config,i=e.getPlugin("thumbnail");if(i&&Object.keys(t).map((function(e){i.config[e]=t[e]})),i&&i.usable&&n.isShowThumbnail){Wd.removeClass(this.root,"short-line no-thumbnail"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.thumbnail=i.createThumbnail(r,"progress-thumbnail"),n.isShowCoverPreview&&(this.videoPreview=Wd.createDom("xg-video-preview","",{},"xgvideo-preview"),e.root.appendChild(this.videoPreview),this.videothumbnail=i.createThumbnail(this.videoPreview,"xgvideo-thumbnail"))}else Wd.addClass(this.root,"short-line no-thumbnail")}}},{key:"calcuPosition",value:function(t,e){var n=this.player.plugins.progress,i=this.player,r=n.root.getBoundingClientRect().width,o=i.duration/r*6;return t+e>i.duration&&(e=i.duration-t),i.duration,i.duration,{left:t/i.duration*100,width:e/i.duration*100,isMini:e<o}}},{key:"showDot",value:function(t){var e=this.findDot(t);if(e){var n=this.root.getBoundingClientRect().width,i=e.time/this.player.duration*n;this.updatePosition(i,n,e.time)}}},{key:"showTips",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t&&(Wd.addClass(this.root,"no-timepoint"),Wd.addClass(this.find(".xg-spot-content"),"show-text"),e&&"production"===this.config.mode?(Wd.addClass(this.root,"product"),this.tipText.textContent=t):(Wd.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?t:"".concat(n," ").concat(t)))}},{key:"hideTips",value:function(){Wd.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",Wd.removeClass(this.find(".xg-spot-content"),"show-text"),Wd.removeClass(this.root,"product")}},{key:"destroy",value:function(){var t=this,e=this.player.plugins.progress;e&&Object.keys(zk).map((function(n){e.removeCallBack(n,t[zk[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-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return"mobile"===Xd.device||this.playerConfig.isMobileSimulateMode?"":'<div class="xg-spot-info '.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-line"></div>\n </div>')}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:""}}}]),n}(Pg);function qk(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var $k=function(t){fi(n,t);var e=qk(n);function n(t){var i;return ui(this,n),(i=e.call(this,t)).ratio=1,i.interval=null,i.preloadMark={},i}return Co(n,[{key:"afterCreate",value:function(){this.usable&&this.initThumbnail()}},{key:"usable",get:function(){var t=this.config,e=t.urls,n=t.pic_num;return e&&e.length>0&&n>0}},{key:"initThumbnail",value:function(){var t=this.config,e=t.width,n=t.height,i=t.pic_num,r=t.interval;this.ratio=e/n*100,this.interval=r||Math.round(this.player.duration/i),this.preload(0)}},{key:"getUrlByIndex",value:function(t){return t>=0&&t<this.config.urls.length?this.config.urls[t]:""}},{key:"preload",value:function(t){var e=this,n=this.config.urls,i=n.length;[t-1,t,t+1,t+2].map((function(t){!e.preloadMark[t]&&t>=0&&t<i&&(Wd.preloadImg(n[t]),e.preloadMark[t]=!0)}))}},{key:"getPosition",value:function(t){var e=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,s=i.col,a=i.width,c=i.height;this.interval=Math.round(this.player.duration/r);var l=Math.ceil(t/this.interval),u=(l=l>r?r:l)<o*s?0:Math.ceil(l/(o*s))-1,h=l-u*(s*o),f=h>0?Math.ceil(h/s)-1:0,d=h>0?h-f*s-1:0,p=0,g=0;if(e&&n){var v=e/n;v<a/c?g=(p=e)/(a/c):p=(g=n)*(a/c)}else g=(p=e||a)/(a/c);var y=this.getUrlByIndex(u);return{urlIndex:u,rowIndex:f,colIndex:d,url:y,height:g,width:p,style:{backgroundImage:"url(".concat(y,")"),backgroundSize:"".concat(p*s,"px auto"),backgroundPosition:"-".concat(d*p,"px -").concat(f*g,"px"),width:"".concat(p,"px"),height:"".concat(g,"px")}}}},{key:"update",value:function(t,e){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,s=o.pic_num,a=o.urls;if(!(s<=0)&&a&&0!==a.length){var c=this.getPosition(e,n,i);this.preload(c.urlIndex),Object.keys(c.style).map((function(e){t.style[e]=c.style[e]})),Object.keys(r).map((function(e){t.style[e]=r[e]}))}}},{key:"createThumbnail",value:function(t,e){var n=Wd.createDom("xg-thumbnail","",{},"thumbnail ".concat(e));return t&&t.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}(Pg);function Zk(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var Jk=function(t){fi(n,t);var e=Zk(n);function n(){return ui(this,n),e.apply(this,arguments)}return Co(n,[{key:"afterCreate",value:function(){}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},e=arguments.length>1?arguments[1]:void 0;e&&this.root&&(t.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(t.cached/e*100,"%")),t.played&&(this.find("xg-mini-progress-played").style.width="".concat(t.played/e*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}(Pg);function Qk(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var tb="realtime",eb="firstframe";function nb(){try{return window.performance.now()}catch(t){return(new Date).getTime()}}function ib(t){return"safari"!==Xd.browser||!/^blob/.test(t.currentSrc)&&!/^blob/.test(t.src)}var rb=null,ob=function(t){fi(n,t);var e=Qk(n);function n(){var t;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(t=e.call.apply(e,[this].concat(r))),"onLoadedData",(function(){var e=t.player.video;t.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10)})),yi(pi(t),"start",(function(){var e=t.player.video,n=nb();ib(e)&&t.canvasCtx&&(t.stop(),(t.config.mode===tb||n-t.preTime>=t.interval)&&(e&&e.videoWidth&&t.update(e,e.videoWidth,e.videoHeight),t.preTime=n),t.frameId=Wd.requestAnimationFrame(t.start))})),yi(pi(t),"stop",(function(){t.frameId&&(Wd.cancelAnimationFrame(t.frameId),t.frameId=null)})),t}return Co(n,[{key:"afterCreate",value:function(){var t=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),n.isSupport||(this.config.disable=!0);var e=this.config,i=e.disable,r=e.mode;i||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0},this.isStart=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/this.config.frameRate,10),this.canvas=null,this.canvasCtx=null,this.once(wp,(function(){t.init(),!t.player.paused&&t.start()})),this.once(up,this.onLoadedData),this.on(_p,(function(){t.once(up,t.onLoadedData)})),r!==eb&&(this.on(Jd,(function(){t.start()})),this.on(ep,(function(){t.stop()}))),r===eb&&this.once(op,(function(){var e=t.player.video;e&&ib(e)&&e.videoWidth&&t.update(e,e.videoWidth,e.videoHeight)})))}},{key:"init",value:function(){var t=this.player,e=this.config;this.canvasFilter=n.supportCanvasFilter();try{var i=t.innerContainer||t.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=e.filter,this.canvas.style.webkitFilter=e.filter),this.mask=this.find("xgmask"),e.addMask&&(this.mask.style.background=e.maskBg),this.canvasCtx=this.canvas.getContext("2d");var r=this.playerConfig.poster;if(r){var o="String"===Wd.typeOf(r)?r:"String"===Wd.typeOf(r.poster)?r.poster:null;this.updateImg(o)}}catch(t){Hd.logError("plugin:DynamicBg",t)}}},{key:"updateImg",value:function(t){var e=this;if(t){var n=this.canvas.getBoundingClientRect(),i=n.width,r=n.height,o=new window.Image;o.onload=function(){e.canvas&&(e.canvas.height=r,e.canvas.width=i,e.update(o,o.width,o.height),o=null)},o.src=t}}},{key:"update",value:function(t,e,n){if(this.canvas&&this.canvasCtx)try{var i=this._pos,r=this.config,o=this.canvas.getBoundingClientRect(),s=o.width,a=o.height;if(this.videoPI=parseInt(e/n*100,10),s!==i.width||a!==i.height){var c=parseInt(s/a*100,10);i.width=this.canvas.width=s,i.height=this.canvas.height=a;var l=a,u=s;c<this.videoPI?u=parseInt(a*this.videoPI/100,10):c>this.videoPI&&(l=parseInt(100*s/this.videoPI,10)),c<this.videoPI?u=parseInt(a*this.videoPI/100,10):c>this.videoPI&&(l=parseInt(100*s/this.videoPI,10)),i.rwidth=1.2*u,i.rheight=1.2*l,i.x=(s-i.rwidth)/2,i.y=(a-i.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=r.filter),this.canvasCtx.drawImage(t,i.x,i.y,i.rwidth,i.rheight)}catch(t){Hd.logError("plugin:DynamicBg",t)}}},{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{disable:!0,mode:"framerate",frameRate:10,filter:"blur(50px)",addMask:!0,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof rb?rb:rb=function(){try{return!!document.createElement("canvas").getContext}catch(t){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===Xd.browser||"firefox"===Xd.browser)}}]),n}(Pg),sb={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:"直播"}};function ab(t){var e=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(t){return!1}}();return function(){var n,i=vi(t);if(e){var r=vi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return gi(this,n)}}var cb=function(t){fi(n,t);var e=ab(n);function n(){return ui(this,n),e.apply(this,arguments)}return n}(py);return yi(cb,"defaultPreset",(function t(e,n){var i,r,o;ui(this,t);var s=n&&n.isMobileSimulateMode,a=n.isLive,c=[].concat(a?[]:[Wm,Jk,Xk,ek],[Km,Qm,lk,kk,Lk,Dk,_k,Tk,sk,vk]),l=[wy,xy,Py,Mm,Oy,Hk,Vk,$k,Yy];this.plugins=[my].concat(Yh(c),l);var u=s?"mobile":Xd.device;switch(u){case"pc":(i=this.plugins).push.apply(i,[Lm,qy,jk]);break;case"mobile":(r=this.plugins).push.apply(r,[Pm]);break;default:(o=this.plugins).push.apply(o,[Lm,qy,jk])}(Xd.os.isIpad||"pc"===u)&&this.plugins.push(ob),this.ignores=[],this.i18n=[sb]})),yi(cb,"Util",Wd),yi(cb,"Sniffer",Xd),yi(cb,"Errors",Zd),yi(cb,"Events",jp),yi(cb,"Plugin",Pg),yi(cb,"BasePlugin",dg),yi(cb,"I18N",ly),yi(cb,"STATE_CLASS",Wv),cb}));
|
|
1
|
+
!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).Player=t()}(this,(function(){"use strict";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},n=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")(),i={},r=function(e){try{return!!e()}catch(e){return!0}},o=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),s={},a={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,l=c&&!a.call({1:2},1);s.f=l?function(e){var t=c(this,e);return!!t&&t.enumerable}:a;var u,h,f=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},d={}.toString,p=function(e){return d.call(e).slice(8,-1)},v=p,g="".split,y=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==v(e)?g.call(e,""):Object(e)}:Object,m=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},k=y,b=m,w=function(e){return k(b(e))},C=function(e){return"object"==typeof e?null!==e:"function"==typeof e},x=n,_=function(e){return"function"==typeof e?e:void 0},E=function(e,t){return arguments.length<2?_(x[e]):x[e]&&x[e][t]},T=E("navigator","userAgent")||"",S=n,P=T,R=S.process,O=S.Deno,A=R&&R.versions||O&&O.version,L=A&&A.v8;L?h=(u=L.split("."))[0]<4?1:u[0]+u[1]:P&&(!(u=P.match(/Edge\/(\d+)/))||u[1]>=74)&&(u=P.match(/Chrome\/(\d+)/))&&(h=u[1]);var I=h&&+h,D=I,M=r,N=!!Object.getOwnPropertySymbols&&!M((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&D&&D<41})),F=N&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,B=E,j=F?function(e){return"symbol"==typeof e}:function(e){var t=B("Symbol");return"function"==typeof t&&Object(e)instanceof t},U=C,H={exports:{}},G=n,V=function(e,t){try{Object.defineProperty(G,e,{value:t,configurable:!0,writable:!0})}catch(n){G[e]=t}return t},W=V,Y="__core-js_shared__",K=n[Y]||W(Y,{}),z=K;(H.exports=function(e,t){return z[e]||(z[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.16.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var X=m,q=function(e){return Object(X(e))},$=q,Z={}.hasOwnProperty,J=Object.hasOwn||function(e,t){return Z.call($(e),t)},Q=0,ee=Math.random(),te=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++Q+ee).toString(36)},ne=n,ie=H.exports,re=J,oe=te,se=N,ae=F,ce=ie("wks"),le=ne.Symbol,ue=ae?le:le&&le.withoutSetter||oe,he=function(e){return re(ce,e)&&(se||"string"==typeof ce[e])||(se&&re(le,e)?ce[e]=le[e]:ce[e]=ue("Symbol."+e)),ce[e]},fe=C,de=j,pe=function(e,t){var n,i;if("string"===t&&"function"==typeof(n=e.toString)&&!U(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!U(i=n.call(e)))return i;if("string"!==t&&"function"==typeof(n=e.toString)&&!U(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")},ve=he("toPrimitive"),ge=function(e,t){if(!fe(e)||de(e))return e;var n,i=e[ve];if(void 0!==i){if(void 0===t&&(t="default"),n=i.call(e,t),!fe(n)||de(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===t&&(t="number"),pe(e,t)},ye=ge,me=j,ke=function(e){var t=ye(e,"string");return me(t)?t:String(t)},be=C,we=n.document,Ce=be(we)&&be(we.createElement),xe=function(e){return Ce?we.createElement(e):{}},_e=xe,Ee=!o&&!r((function(){return 7!=Object.defineProperty(_e("div"),"a",{get:function(){return 7}}).a})),Te=o,Se=s,Pe=f,Re=w,Oe=ke,Ae=J,Le=Ee,Ie=Object.getOwnPropertyDescriptor;i.f=Te?Ie:function(e,t){if(e=Re(e),t=Oe(t),Le)try{return Ie(e,t)}catch(e){}if(Ae(e,t))return Pe(!Se.f.call(e,t),e[t])};var De={},Me=C,Ne=function(e){if(!Me(e))throw TypeError(String(e)+" is not an object");return e},Fe=o,Be=Ee,je=Ne,Ue=ke,He=Object.defineProperty;De.f=Fe?He:function(e,t,n){if(je(e),t=Ue(t),je(n),Be)try{return He(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Ge=De,Ve=f,We=o?function(e,t,n){return Ge.f(e,t,Ve(1,n))}:function(e,t,n){return e[t]=n,e},Ye={exports:{}},Ke=K,ze=Function.toString;"function"!=typeof Ke.inspectSource&&(Ke.inspectSource=function(e){return ze.call(e)});var Xe,qe,$e,Ze=Ke.inspectSource,Je=Ze,Qe=n.WeakMap,et="function"==typeof Qe&&/native code/.test(Je(Qe)),tt=H.exports,nt=te,it=tt("keys"),rt=function(e){return it[e]||(it[e]=nt(e))},ot={},st=et,at=C,ct=We,lt=J,ut=K,ht=rt,ft=ot,dt="Object already initialized",pt=n.WeakMap;if(st||ut.state){var vt=ut.state||(ut.state=new pt),gt=vt.get,yt=vt.has,mt=vt.set;Xe=function(e,t){if(yt.call(vt,e))throw new TypeError(dt);return t.facade=e,mt.call(vt,e,t),t},qe=function(e){return gt.call(vt,e)||{}},$e=function(e){return yt.call(vt,e)}}else{var kt=ht("state");ft[kt]=!0,Xe=function(e,t){if(lt(e,kt))throw new TypeError(dt);return t.facade=e,ct(e,kt,t),t},qe=function(e){return lt(e,kt)?e[kt]:{}},$e=function(e){return lt(e,kt)}}var bt={set:Xe,get:qe,has:$e,enforce:function(e){return $e(e)?qe(e):Xe(e,{})},getterFor:function(e){return function(t){var n;if(!at(t)||(n=qe(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},wt=n,Ct=We,xt=J,_t=V,Et=Ze,Tt=bt.get,St=bt.enforce,Pt=String(String).split("String");(Ye.exports=function(e,t,n,i){var r,o=!!i&&!!i.unsafe,s=!!i&&!!i.enumerable,a=!!i&&!!i.noTargetGet;"function"==typeof n&&("string"!=typeof t||xt(n,"name")||Ct(n,"name",t),(r=St(n)).source||(r.source=Pt.join("string"==typeof t?t:""))),e!==wt?(o?!a&&e[t]&&(s=!0):delete e[t],s?e[t]=n:Ct(e,t,n)):s?e[t]=n:_t(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&Tt(this).source||Et(this)}));var Rt={},Ot=Math.ceil,At=Math.floor,Lt=function(e){return isNaN(e=+e)?0:(e>0?At:Ot)(e)},It=Lt,Dt=Math.min,Mt=function(e){return e>0?Dt(It(e),9007199254740991):0},Nt=Lt,Ft=Math.max,Bt=Math.min,jt=function(e,t){var n=Nt(e);return n<0?Ft(n+t,0):Bt(n,t)},Ut=w,Ht=Mt,Gt=jt,Vt=function(e){return function(t,n,i){var r,o=Ut(t),s=Ht(o.length),a=Gt(i,s);if(e&&n!=n){for(;s>a;)if((r=o[a++])!=r)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===n)return e||a||0;return!e&&-1}},Wt={includes:Vt(!0),indexOf:Vt(!1)},Yt=J,Kt=w,zt=Wt.indexOf,Xt=ot,qt=function(e,t){var n,i=Kt(e),r=0,o=[];for(n in i)!Yt(Xt,n)&&Yt(i,n)&&o.push(n);for(;t.length>r;)Yt(i,n=t[r++])&&(~zt(o,n)||o.push(n));return o},$t=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Zt=qt,Jt=$t.concat("length","prototype");Rt.f=Object.getOwnPropertyNames||function(e){return Zt(e,Jt)};var Qt={};Qt.f=Object.getOwnPropertySymbols;var en,tn=Rt,nn=Qt,rn=Ne,on=E("Reflect","ownKeys")||function(e){var t=tn.f(rn(e)),n=nn.f;return n?t.concat(n(e)):t},sn=J,an=on,cn=i,ln=De,un=r,hn=/#|\.prototype\./,fn=function(e,t){var n=pn[dn(e)];return n==gn||n!=vn&&("function"==typeof t?un(t):!!t)},dn=fn.normalize=function(e){return String(e).replace(hn,".").toLowerCase()},pn=fn.data={},vn=fn.NATIVE="N",gn=fn.POLYFILL="P",yn=fn,mn=n,kn=i.f,bn=We,wn=Ye.exports,Cn=V,xn=function(e,t){for(var n=an(t),i=ln.f,r=cn.f,o=0;o<n.length;o++){var s=n[o];sn(e,s)||i(e,s,r(t,s))}},_n=yn,En=function(e,t){var n,i,r,o,s,a=e.target,c=e.global,l=e.stat;if(n=c?mn:l?mn[a]||Cn(a,{}):(mn[a]||{}).prototype)for(i in t){if(o=t[i],r=e.noTargetGet?(s=kn(n,i))&&s.value:n[i],!_n(c?i:a+(l?".":"#")+i,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;xn(o,r)}(e.sham||r&&r.sham)&&bn(o,"sham",!0),wn(n,i,o,e)}},Tn=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Sn=qt,Pn=$t,Rn=Object.keys||function(e){return Sn(e,Pn)},On=De,An=Ne,Ln=Rn,In=o?Object.defineProperties:function(e,t){An(e);for(var n,i=Ln(t),r=i.length,o=0;r>o;)On.f(e,n=i[o++],t[n]);return e},Dn=E("document","documentElement"),Mn=Ne,Nn=In,Fn=$t,Bn=ot,jn=Dn,Un=xe,Hn=rt("IE_PROTO"),Gn=function(){},Vn=function(e){return"<script>"+e+"</"+"script>"},Wn=function(e){e.write(Vn("")),e.close();var t=e.parentWindow.Object;return e=null,t},Yn=function(){try{en=new ActiveXObject("htmlfile")}catch(e){}var e,t;Yn="undefined"!=typeof document?document.domain&&en?Wn(en):((t=Un("iframe")).style.display="none",jn.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Vn("document.F=Object")),e.close(),e.F):Wn(en);for(var n=Fn.length;n--;)delete Yn.prototype[Fn[n]];return Yn()};Bn[Hn]=!0;var Kn=Object.create||function(e,t){var n;return null!==e?(Gn.prototype=Mn(e),n=new Gn,Gn.prototype=null,n[Hn]=e):n=Yn(),void 0===t?n:Nn(n,t)},zn=Tn,Xn=C,qn=[].slice,$n={},Zn=function(e,t,n){if(!(t in $n)){for(var i=[],r=0;r<t;r++)i[r]="a["+r+"]";$n[t]=Function("C,a","return new C("+i.join(",")+")")}return $n[t](e,n)},Jn=Function.bind||function(e){var t=zn(this),n=qn.call(arguments,1),i=function(){var r=n.concat(qn.call(arguments));return this instanceof i?Zn(t,r.length,r):t.apply(e,r)};return Xn(t.prototype)&&(i.prototype=t.prototype),i},Qn=En,ei=Tn,ti=Ne,ni=C,ii=Kn,ri=Jn,oi=r,si=E("Reflect","construct"),ai=oi((function(){function e(){}return!(si((function(){}),[],e)instanceof e)})),ci=!oi((function(){si((function(){}))})),li=ai||ci;function ui(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hi(e,t){return(hi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function fi(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}}),t&&hi(e,t)}function di(e){return(di="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 pi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vi(e,t){if(t&&("object"===di(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return pi(e)}function gi(e){return(gi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function yi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Qn({target:"Reflect",stat:!0,forced:li,sham:li},{construct:function(e,t){ei(e),ti(t);var n=arguments.length<3?e:ei(arguments[2]);if(ci&&!ai)return si(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 i.push.apply(i,t),new(ri.apply(e,i))}var r=n.prototype,o=ii(ni(r)?r:Object.prototype),s=Function.apply.call(e,o,t);return ni(s)?s:o}});var mi=p,ki=Array.isArray||function(e){return"Array"==mi(e)},bi=j,wi=function(e){if(bi(e))throw TypeError("Cannot convert a Symbol value to a string");return String(e)},Ci={},xi=w,_i=Rt.f,Ei={}.toString,Ti="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Ci.f=function(e){return Ti&&"[object Window]"==Ei.call(e)?function(e){try{return _i(e)}catch(e){return Ti.slice()}}(e):_i(xi(e))};var Si={},Pi=he;Si.f=Pi;var Ri=n,Oi=J,Ai=Si,Li=De.f,Ii=De.f,Di=J,Mi=he("toStringTag"),Ni=function(e,t,n){e&&!Di(e=n?e:e.prototype,Mi)&&Ii(e,Mi,{configurable:!0,value:t})},Fi=Tn,Bi=function(e,t,n){if(Fi(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};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)}},ji=C,Ui=ki,Hi=he("species"),Gi=function(e){var t;return Ui(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!Ui(t.prototype)?ji(t)&&null===(t=t[Hi])&&(t=void 0):t=void 0),void 0===t?Array:t},Vi=function(e,t){return new(Gi(e))(0===t?0:t)},Wi=Bi,Yi=y,Ki=q,zi=Mt,Xi=Vi,qi=[].push,$i=function(e){var t=1==e,n=2==e,i=3==e,r=4==e,o=6==e,s=7==e,a=5==e||o;return function(c,l,u,h){for(var f,d,p=Ki(c),v=Yi(p),g=Wi(l,u,3),y=zi(v.length),m=0,k=h||Xi,b=t?k(c,y):n||s?k(c,0):void 0;y>m;m++)if((a||m in v)&&(d=g(f=v[m],m,p),e))if(t)b[m]=d;else if(d)switch(e){case 3:return!0;case 5:return f;case 6:return m;case 2:qi.call(b,f)}else switch(e){case 4:return!1;case 7:qi.call(b,f)}return o?-1:i||r?r:b}},Zi={forEach:$i(0),map:$i(1),filter:$i(2),some:$i(3),every:$i(4),find:$i(5),findIndex:$i(6),filterReject:$i(7)},Ji=En,Qi=n,er=E,tr=o,nr=N,ir=r,rr=J,or=ki,sr=C,ar=j,cr=Ne,lr=q,ur=w,hr=ke,fr=wi,dr=f,pr=Kn,vr=Rn,gr=Rt,yr=Ci,mr=Qt,kr=i,br=De,wr=s,Cr=We,xr=Ye.exports,_r=H.exports,Er=ot,Tr=te,Sr=he,Pr=Si,Rr=function(e){var t=Ri.Symbol||(Ri.Symbol={});Oi(t,e)||Li(t,e,{value:Ai.f(e)})},Or=Ni,Ar=bt,Lr=Zi.forEach,Ir=rt("hidden"),Dr="Symbol",Mr=Sr("toPrimitive"),Nr=Ar.set,Fr=Ar.getterFor(Dr),Br=Object.prototype,jr=Qi.Symbol,Ur=er("JSON","stringify"),Hr=kr.f,Gr=br.f,Vr=yr.f,Wr=wr.f,Yr=_r("symbols"),Kr=_r("op-symbols"),zr=_r("string-to-symbol-registry"),Xr=_r("symbol-to-string-registry"),qr=_r("wks"),$r=Qi.QObject,Zr=!$r||!$r.prototype||!$r.prototype.findChild,Jr=tr&&ir((function(){return 7!=pr(Gr({},"a",{get:function(){return Gr(this,"a",{value:7}).a}})).a}))?function(e,t,n){var i=Hr(Br,t);i&&delete Br[t],Gr(e,t,n),i&&e!==Br&&Gr(Br,t,i)}:Gr,Qr=function(e,t){var n=Yr[e]=pr(jr.prototype);return Nr(n,{type:Dr,tag:e,description:t}),tr||(n.description=t),n},eo=function(e,t,n){e===Br&&eo(Kr,t,n),cr(e);var i=hr(t);return cr(n),rr(Yr,i)?(n.enumerable?(rr(e,Ir)&&e[Ir][i]&&(e[Ir][i]=!1),n=pr(n,{enumerable:dr(0,!1)})):(rr(e,Ir)||Gr(e,Ir,dr(1,{})),e[Ir][i]=!0),Jr(e,i,n)):Gr(e,i,n)},to=function(e,t){cr(e);var n=ur(t),i=vr(n).concat(oo(n));return Lr(i,(function(t){tr&&!no.call(n,t)||eo(e,t,n[t])})),e},no=function(e){var t=hr(e),n=Wr.call(this,t);return!(this===Br&&rr(Yr,t)&&!rr(Kr,t))&&(!(n||!rr(this,t)||!rr(Yr,t)||rr(this,Ir)&&this[Ir][t])||n)},io=function(e,t){var n=ur(e),i=hr(t);if(n!==Br||!rr(Yr,i)||rr(Kr,i)){var r=Hr(n,i);return!r||!rr(Yr,i)||rr(n,Ir)&&n[Ir][i]||(r.enumerable=!0),r}},ro=function(e){var t=Vr(ur(e)),n=[];return Lr(t,(function(e){rr(Yr,e)||rr(Er,e)||n.push(e)})),n},oo=function(e){var t=e===Br,n=Vr(t?Kr:ur(e)),i=[];return Lr(n,(function(e){!rr(Yr,e)||t&&!rr(Br,e)||i.push(Yr[e])})),i};(nr||(xr((jr=function(){if(this instanceof jr)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?fr(arguments[0]):void 0,t=Tr(e),n=function(e){this===Br&&n.call(Kr,e),rr(this,Ir)&&rr(this[Ir],t)&&(this[Ir][t]=!1),Jr(this,t,dr(1,e))};return tr&&Zr&&Jr(Br,t,{configurable:!0,set:n}),Qr(t,e)}).prototype,"toString",(function(){return Fr(this).tag})),xr(jr,"withoutSetter",(function(e){return Qr(Tr(e),e)})),wr.f=no,br.f=eo,kr.f=io,gr.f=yr.f=ro,mr.f=oo,Pr.f=function(e){return Qr(Sr(e),e)},tr&&(Gr(jr.prototype,"description",{configurable:!0,get:function(){return Fr(this).description}}),xr(Br,"propertyIsEnumerable",no,{unsafe:!0}))),Ji({global:!0,wrap:!0,forced:!nr,sham:!nr},{Symbol:jr}),Lr(vr(qr),(function(e){Rr(e)})),Ji({target:Dr,stat:!0,forced:!nr},{for:function(e){var t=fr(e);if(rr(zr,t))return zr[t];var n=jr(t);return zr[t]=n,Xr[n]=t,n},keyFor:function(e){if(!ar(e))throw TypeError(e+" is not a symbol");if(rr(Xr,e))return Xr[e]},useSetter:function(){Zr=!0},useSimple:function(){Zr=!1}}),Ji({target:"Object",stat:!0,forced:!nr,sham:!tr},{create:function(e,t){return void 0===t?pr(e):to(pr(e),t)},defineProperty:eo,defineProperties:to,getOwnPropertyDescriptor:io}),Ji({target:"Object",stat:!0,forced:!nr},{getOwnPropertyNames:ro,getOwnPropertySymbols:oo}),Ji({target:"Object",stat:!0,forced:ir((function(){mr.f(1)}))},{getOwnPropertySymbols:function(e){return mr.f(lr(e))}}),Ur)&&Ji({target:"JSON",stat:!0,forced:!nr||ir((function(){var e=jr();return"[null]"!=Ur([e])||"{}"!=Ur({a:e})||"{}"!=Ur(Object(e))}))},{stringify:function(e,t,n){for(var i,r=[e],o=1;arguments.length>o;)r.push(arguments[o++]);if(i=t,(sr(t)||void 0!==e)&&!ar(e))return or(t)||(t=function(e,t){if("function"==typeof i&&(t=i.call(this,e,t)),!ar(t))return t}),r[1]=t,Ur.apply(null,r)}});jr.prototype[Mr]||Cr(jr.prototype,Mr,jr.prototype.valueOf),Or(jr,Dr),Er[Ir]=!0;var so=En,ao=r,co=w,lo=i.f,uo=o,ho=ao((function(){lo(1)}));so({target:"Object",stat:!0,forced:!uo||ho,sham:!uo},{getOwnPropertyDescriptor:function(e,t){return lo(co(e),t)}});var fo=ke,po=De,vo=f,go=function(e,t,n){var i=fo(t);i in e?po.f(e,i,vo(0,n)):e[i]=n},yo=on,mo=w,ko=i,bo=go;function wo(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 Co(e,t,n){return t&&wo(e.prototype,t),n&&wo(e,n),e}function xo(e,t,n){return(xo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=gi(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}En({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function(e){for(var t,n,i=mo(e),r=ko.f,o=yo(i),s={},a=0;o.length>a;)void 0!==(n=r(i,t=o[a++]))&&bo(s,t,n);return s}});var _o=Kn,Eo=De,To=he("unscopables"),So=Array.prototype;null==So[To]&&Eo.f(So,To,{configurable:!0,value:_o(null)});var Po=function(e){So[To][e]=!0},Ro=En,Oo=Zi.find,Ao=Po,Lo="find",Io=!0;Lo in[]&&Array(1).find((function(){Io=!1})),Ro({target:"Array",proto:!0,forced:Io},{find:function(e){return Oo(this,e,arguments.length>1?arguments[1]:void 0)}}),Ao(Lo);var Do=r,Mo=I,No=he("species"),Fo=function(e){return Mo>=51||!Do((function(){var t=[];return(t.constructor={})[No]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Bo=En,jo=r,Uo=ki,Ho=C,Go=q,Vo=Mt,Wo=go,Yo=Vi,Ko=Fo,zo=I,Xo=he("isConcatSpreadable"),qo=9007199254740991,$o="Maximum allowed index exceeded",Zo=zo>=51||!jo((function(){var e=[];return e[Xo]=!1,e.concat()[0]!==e})),Jo=Ko("concat"),Qo=function(e){if(!Ho(e))return!1;var t=e[Xo];return void 0!==t?!!t:Uo(e)};Bo({target:"Array",proto:!0,forced:!Zo||!Jo},{concat:function(e){var t,n,i,r,o,s=Go(this),a=Yo(s,0),c=0;for(t=-1,i=arguments.length;t<i;t++)if(Qo(o=-1===t?s:arguments[t])){if(c+(r=Vo(o.length))>qo)throw TypeError($o);for(n=0;n<r;n++,c++)n in o&&Wo(a,c,o[n])}else{if(c>=qo)throw TypeError($o);Wo(a,c++,o)}return a.length=c,a}});var es={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},ts=r,ns=function(e,t){var n=[][e];return!!n&&ts((function(){n.call(null,t||function(){throw 1},1)}))},is=Zi.forEach,rs=n,os=es,ss=ns("forEach")?[].forEach:function(e){return is(this,e,arguments.length>1?arguments[1]:void 0)},as=We;for(var cs in os){var ls=rs[cs],us=ls&&ls.prototype;if(us&&us.forEach!==ss)try{as(us,"forEach",ss)}catch(e){us.forEach=ss}}var hs=q,fs=Rn;En({target:"Object",stat:!0,forced:r((function(){fs(1)}))},{keys:function(e){return fs(hs(e))}});var ds=En,ps=C,vs=ki,gs=jt,ys=Mt,ms=w,ks=go,bs=he,ws=Fo("slice"),Cs=bs("species"),xs=[].slice,_s=Math.max;ds({target:"Array",proto:!0,forced:!ws},{slice:function(e,t){var n,i,r,o=ms(this),s=ys(o.length),a=gs(e,s),c=gs(void 0===t?s:t,s);if(vs(o)&&("function"!=typeof(n=o.constructor)||n!==Array&&!vs(n.prototype)?ps(n)&&null===(n=n[Cs])&&(n=void 0):n=void 0,n===Array||void 0===n))return xs.call(o,a,c);for(i=new(void 0===n?Array:n)(_s(c-a,0)),r=0;a<c;a++,r++)a in o&&ks(i,r,o[a]);return i.length=r,i}});var Es=Ne,Ts=function(){var e=Es(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},Ss={},Ps=r,Rs=n.RegExp;Ss.UNSUPPORTED_Y=Ps((function(){var e=Rs("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Ss.BROKEN_CARET=Ps((function(){var e=Rs("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var Os=r,As=n.RegExp,Ls=Os((function(){var e=As(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Is=r,Ds=n.RegExp,Ms=Is((function(){var e=Ds("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Ns=wi,Fs=Ts,Bs=Ss,js=H.exports,Us=Kn,Hs=bt.get,Gs=Ls,Vs=Ms,Ws=RegExp.prototype.exec,Ys=js("native-string-replace",String.prototype.replace),Ks=Ws,zs=function(){var e=/a/,t=/b*/g;return Ws.call(e,"a"),Ws.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Xs=Bs.UNSUPPORTED_Y||Bs.BROKEN_CARET,qs=void 0!==/()??/.exec("")[1];(zs||qs||Xs||Gs||Vs)&&(Ks=function(e){var t,n,i,r,o,s,a,c=this,l=Hs(c),u=Ns(e),h=l.raw;if(h)return h.lastIndex=c.lastIndex,t=Ks.call(h,u),c.lastIndex=h.lastIndex,t;var f=l.groups,d=Xs&&c.sticky,p=Fs.call(c),v=c.source,g=0,y=u;if(d&&(-1===(p=p.replace("y","")).indexOf("g")&&(p+="g"),y=u.slice(c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==u.charAt(c.lastIndex-1))&&(v="(?: "+v+")",y=" "+y,g++),n=new RegExp("^(?:"+v+")",p)),qs&&(n=new RegExp("^"+v+"$(?!\\s)",p)),zs&&(i=c.lastIndex),r=Ws.call(d?n:c,y),d?r?(r.input=r.input.slice(g),r[0]=r[0].slice(g),r.index=c.lastIndex,c.lastIndex+=r[0].length):c.lastIndex=0:zs&&r&&(c.lastIndex=c.global?r.index+r[0].length:i),qs&&r&&r.length>1&&Ys.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&f)for(r.groups=s=Us(null),o=0;o<f.length;o++)s[(a=f[o])[0]]=r[a[1]];return r});var $s=Ks;En({target:"RegExp",proto:!0,forced:/./.exec!==$s},{exec:$s});var Zs=Ye.exports,Js=$s,Qs=r,ea=he,ta=We,na=ea("species"),ia=RegExp.prototype,ra=function(e,t,n,i){var r=ea(e),o=!Qs((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),s=o&&!Qs((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[na]=function(){return n},n.flags="",n[r]=/./[r]),n.exec=function(){return t=!0,null},n[r](""),!t}));if(!o||!s||n){var a=/./[r],c=t(r,""[e],(function(e,t,n,i,r){var s=t.exec;return s===Js||s===ia.exec?o&&!r?{done:!0,value:a.call(t,n,i)}:{done:!0,value:e.call(n,t,i)}:{done:!1}}));Zs(String.prototype,e,c[0]),Zs(ia,r,c[1])}i&&ta(ia[r],"sham",!0)},oa=C,sa=p,aa=he("match"),ca=function(e){var t;return oa(e)&&(void 0!==(t=e[aa])?!!t:"RegExp"==sa(e))},la=Ne,ua=Tn,ha=he("species"),fa=function(e,t){var n,i=la(e).constructor;return void 0===i||null==(n=la(i)[ha])?t:ua(n)},da=Lt,pa=wi,va=m,ga=function(e){return function(t,n){var i,r,o=pa(va(t)),s=da(n),a=o.length;return s<0||s>=a?e?"":void 0:(i=o.charCodeAt(s))<55296||i>56319||s+1===a||(r=o.charCodeAt(s+1))<56320||r>57343?e?o.charAt(s):i:e?o.slice(s,s+2):r-56320+(i-55296<<10)+65536}},ya={codeAt:ga(!1),charAt:ga(!0)},ma=ya.charAt,ka=function(e,t,n){return t+(n?ma(e,t).length:1)},ba=p,wa=$s,Ca=function(e,t){var n=e.exec;if("function"==typeof n){var i=n.call(e,t);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==ba(e))throw TypeError("RegExp#exec called on incompatible receiver");return wa.call(e,t)},xa=ra,_a=ca,Ea=Ne,Ta=m,Sa=fa,Pa=ka,Ra=Mt,Oa=wi,Aa=Ca,La=$s,Ia=r,Da=Ss.UNSUPPORTED_Y,Ma=[].push,Na=Math.min,Fa=4294967295;xa("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=Oa(Ta(this)),r=void 0===n?Fa:n>>>0;if(0===r)return[];if(void 0===e)return[i];if(!_a(e))return t.call(i,e,r);for(var o,s,a,c=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,h=new RegExp(e.source,l+"g");(o=La.call(h,i))&&!((s=h.lastIndex)>u&&(c.push(i.slice(u,o.index)),o.length>1&&o.index<i.length&&Ma.apply(c,o.slice(1)),a=o[0].length,u=s,c.length>=r));)h.lastIndex===o.index&&h.lastIndex++;return u===i.length?!a&&h.test("")||c.push(""):c.push(i.slice(u)),c.length>r?c.slice(0,r):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var r=Ta(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,r,n):i.call(Oa(r),t,n)},function(e,r){var o=Ea(this),s=Oa(e),a=n(i,o,s,r,i!==t);if(a.done)return a.value;var c=Sa(o,RegExp),l=o.unicode,u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Da?"g":"y"),h=new c(Da?"^(?:"+o.source+")":o,u),f=void 0===r?Fa:r>>>0;if(0===f)return[];if(0===s.length)return null===Aa(h,s)?[s]:[];for(var d=0,p=0,v=[];p<s.length;){h.lastIndex=Da?0:p;var g,y=Aa(h,Da?s.slice(p):s);if(null===y||(g=Na(Ra(h.lastIndex+(Da?p:0)),s.length))===d)p=Pa(s,p,l);else{if(v.push(s.slice(d,p)),v.length===f)return v;for(var m=1;m<=y.length-1;m++)if(v.push(y[m]),v.length===f)return v;p=d=g}}return v.push(s.slice(d)),v}]}),!!Ia((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]})),Da);var Ba=En,ja=w,Ua=[].join,Ha=y!=Object,Ga=ns("join",",");Ba({target:"Array",proto:!0,forced:Ha||!Ga},{join:function(e){return Ua.call(ja(this),void 0===e?",":e)}});var Va=En,Wa=jt,Ya=Lt,Ka=Mt,za=q,Xa=Vi,qa=go,$a=Fo("splice"),Za=Math.max,Ja=Math.min,Qa=9007199254740991,ec="Maximum allowed length exceeded";Va({target:"Array",proto:!0,forced:!$a},{splice:function(e,t){var n,i,r,o,s,a,c=za(this),l=Ka(c.length),u=Wa(e,l),h=arguments.length;if(0===h?n=i=0:1===h?(n=0,i=l-u):(n=h-2,i=Ja(Za(Ya(t),0),l-u)),l+n-i>Qa)throw TypeError(ec);for(r=Xa(c,i),o=0;o<i;o++)(s=u+o)in c&&qa(r,o,c[s]);if(r.length=i,n<i){for(o=u;o<l-i;o++)a=o+n,(s=o+i)in c?c[a]=c[s]:delete c[a];for(o=l;o>l-i+n;o--)delete c[o-1]}else if(n>i)for(o=l-i;o>u;o--)a=o+n-1,(s=o+i-1)in c?c[a]=c[s]:delete c[a];for(o=0;o<n;o++)c[o+u]=arguments[o+2];return c.length=l-i+n,r}});var tc={};tc[he("toStringTag")]="z";var nc="[object z]"===String(tc),ic=nc,rc=p,oc=he("toStringTag"),sc="Arguments"==rc(function(){return arguments}()),ac=ic?rc: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(e){}}(t=Object(e),oc))?n:sc?rc(t):"Object"==(i=rc(t))&&"function"==typeof t.callee?"Arguments":i},cc=ac,lc=nc?{}.toString:function(){return"[object "+cc(this)+"]"},uc=nc,hc=Ye.exports,fc=lc;uc||hc(Object.prototype,"toString",fc,{unsafe:!0});var dc=n.Promise,pc=Ye.exports,vc=function(e,t,n){for(var i in t)pc(e,i,t[i],n);return e},gc=C,yc=Ne,mc=function(e){if(!gc(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},kc=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,i){return yc(n),mc(i),t?e.call(n,i):n.__proto__=i,n}}():void 0),bc=E,wc=De,Cc=o,xc=he("species"),_c=function(e){var t=bc(e),n=wc.f;Cc&&t&&!t[xc]&&n(t,xc,{configurable:!0,get:function(){return this}})},Ec=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},Tc={},Sc=Tc,Pc=he("iterator"),Rc=Array.prototype,Oc=function(e){return void 0!==e&&(Sc.Array===e||Rc[Pc]===e)},Ac=ac,Lc=Tc,Ic=he("iterator"),Dc=function(e){if(null!=e)return e[Ic]||e["@@iterator"]||Lc[Ac(e)]},Mc=Ne,Nc=function(e){var t=e.return;if(void 0!==t)return Mc(t.call(e)).value},Fc=Ne,Bc=Oc,jc=Mt,Uc=Bi,Hc=Dc,Gc=Nc,Vc=function(e,t){this.stopped=e,this.result=t},Wc=he("iterator"),Yc=!1;try{var Kc=0,zc={next:function(){return{done:!!Kc++}},return:function(){Yc=!0}};zc[Wc]=function(){return this},Array.from(zc,(function(){throw 2}))}catch(e){}var Xc,qc,$c,Zc,Jc=/(?:ipad|iphone|ipod).*applewebkit/i.test(T),Qc="process"==p(n.process),el=n,tl=r,nl=Bi,il=Dn,rl=xe,ol=Jc,sl=Qc,al=el.setImmediate,cl=el.clearImmediate,ll=el.process,ul=el.MessageChannel,hl=el.Dispatch,fl=0,dl={},pl="onreadystatechange";try{Xc=el.location}catch(e){}var vl=function(e){if(dl.hasOwnProperty(e)){var t=dl[e];delete dl[e],t()}},gl=function(e){return function(){vl(e)}},yl=function(e){vl(e.data)},ml=function(e){el.postMessage(String(e),Xc.protocol+"//"+Xc.host)};al&&cl||(al=function(e){for(var t=[],n=arguments.length,i=1;n>i;)t.push(arguments[i++]);return dl[++fl]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},qc(fl),fl},cl=function(e){delete dl[e]},sl?qc=function(e){ll.nextTick(gl(e))}:hl&&hl.now?qc=function(e){hl.now(gl(e))}:ul&&!ol?(Zc=($c=new ul).port2,$c.port1.onmessage=yl,qc=nl(Zc.postMessage,Zc,1)):el.addEventListener&&"function"==typeof postMessage&&!el.importScripts&&Xc&&"file:"!==Xc.protocol&&!tl(ml)?(qc=ml,el.addEventListener("message",yl,!1)):qc=pl in rl("script")?function(e){il.appendChild(rl("script")).onreadystatechange=function(){il.removeChild(this),vl(e)}}:function(e){setTimeout(gl(e),0)});var kl,bl,wl,Cl,xl,_l,El,Tl,Sl={set:al,clear:cl},Pl=n,Rl=/ipad|iphone|ipod/i.test(T)&&void 0!==Pl.Pebble,Ol=/web0s(?!.*chrome)/i.test(T),Al=n,Ll=i.f,Il=Sl.set,Dl=Jc,Ml=Rl,Nl=Ol,Fl=Qc,Bl=Al.MutationObserver||Al.WebKitMutationObserver,jl=Al.document,Ul=Al.process,Hl=Al.Promise,Gl=Ll(Al,"queueMicrotask"),Vl=Gl&&Gl.value;Vl||(kl=function(){var e,t;for(Fl&&(e=Ul.domain)&&e.exit();bl;){t=bl.fn,bl=bl.next;try{t()}catch(e){throw bl?Cl():wl=void 0,e}}wl=void 0,e&&e.enter()},Dl||Fl||Nl||!Bl||!jl?!Ml&&Hl&&Hl.resolve?((El=Hl.resolve(void 0)).constructor=Hl,Tl=El.then,Cl=function(){Tl.call(El,kl)}):Cl=Fl?function(){Ul.nextTick(kl)}:function(){Il.call(Al,kl)}:(xl=!0,_l=jl.createTextNode(""),new Bl(kl).observe(_l,{characterData:!0}),Cl=function(){_l.data=xl=!xl}));var Wl=Vl||function(e){var t={fn:e,next:void 0};wl&&(wl.next=t),bl||(bl=t,Cl()),wl=t},Yl={},Kl=Tn,zl=function(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=Kl(t),this.reject=Kl(n)};Yl.f=function(e){return new zl(e)};var Xl,ql,$l,Zl,Jl=Ne,Ql=C,eu=Yl,tu=n,nu="object"==typeof window,iu=En,ru=n,ou=E,su=dc,au=Ye.exports,cu=vc,lu=kc,uu=Ni,hu=_c,fu=C,du=Tn,pu=Ec,vu=Ze,gu=function(e,t,n){var i,r,o,s,a,c,l,u=n&&n.that,h=!(!n||!n.AS_ENTRIES),f=!(!n||!n.IS_ITERATOR),d=!(!n||!n.INTERRUPTED),p=Uc(t,u,1+h+d),v=function(e){return i&&Gc(i),new Vc(!0,e)},g=function(e){return h?(Fc(e),d?p(e[0],e[1],v):p(e[0],e[1])):d?p(e,v):p(e)};if(f)i=e;else{if("function"!=typeof(r=Hc(e)))throw TypeError("Target is not iterable");if(Bc(r)){for(o=0,s=jc(e.length);s>o;o++)if((a=g(e[o]))&&a instanceof Vc)return a;return new Vc(!1)}i=r.call(e)}for(c=i.next;!(l=c.call(i)).done;){try{a=g(l.value)}catch(e){throw Gc(i),e}if("object"==typeof a&&a&&a instanceof Vc)return a}return new Vc(!1)},yu=function(e,t){if(!t&&!Yc)return!1;var n=!1;try{var i={};i[Wc]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n},mu=fa,ku=Sl.set,bu=Wl,wu=function(e,t){if(Jl(e),Ql(t)&&t.constructor===e)return t;var n=eu.f(e);return(0,n.resolve)(t),n.promise},Cu=function(e,t){var n=tu.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))},xu=Yl,_u=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Eu=bt,Tu=yn,Su=nu,Pu=Qc,Ru=I,Ou=he("species"),Au="Promise",Lu=Eu.get,Iu=Eu.set,Du=Eu.getterFor(Au),Mu=su&&su.prototype,Nu=su,Fu=Mu,Bu=ru.TypeError,ju=ru.document,Uu=ru.process,Hu=xu.f,Gu=Hu,Vu=!!(ju&&ju.createEvent&&ru.dispatchEvent),Wu="function"==typeof PromiseRejectionEvent,Yu="unhandledrejection",Ku=!1,zu=Tu(Au,(function(){var e=vu(Nu),t=e!==String(Nu);if(!t&&66===Ru)return!0;if(Ru>=51&&/native code/.test(e))return!1;var n=new Nu((function(e){e(1)})),i=function(e){e((function(){}),(function(){}))};return(n.constructor={})[Ou]=i,!(Ku=n.then((function(){}))instanceof i)||!t&&Su&&!Wu})),Xu=zu||!yu((function(e){Nu.all(e).catch((function(){}))})),qu=function(e){var t;return!(!fu(e)||"function"!=typeof(t=e.then))&&t},$u=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;bu((function(){for(var i=e.value,r=1==e.state,o=0;n.length>o;){var s,a,c,l=n[o++],u=r?l.ok:l.fail,h=l.resolve,f=l.reject,d=l.domain;try{u?(r||(2===e.rejection&&eh(e),e.rejection=1),!0===u?s=i:(d&&d.enter(),s=u(i),d&&(d.exit(),c=!0)),s===l.promise?f(Bu("Promise-chain cycle")):(a=qu(s))?a.call(s,h,f):h(s)):f(i)}catch(e){d&&!c&&d.exit(),f(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Ju(e)}))}},Zu=function(e,t,n){var i,r;Vu?((i=ju.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),ru.dispatchEvent(i)):i={promise:t,reason:n},!Wu&&(r=ru["on"+e])?r(i):e===Yu&&Cu("Unhandled promise rejection",n)},Ju=function(e){ku.call(ru,(function(){var t,n=e.facade,i=e.value;if(Qu(e)&&(t=_u((function(){Pu?Uu.emit("unhandledRejection",i,n):Zu(Yu,n,i)})),e.rejection=Pu||Qu(e)?2:1,t.error))throw t.value}))},Qu=function(e){return 1!==e.rejection&&!e.parent},eh=function(e){ku.call(ru,(function(){var t=e.facade;Pu?Uu.emit("rejectionHandled",t):Zu("rejectionhandled",t,e.value)}))},th=function(e,t,n){return function(i){e(t,i,n)}},nh=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,$u(e,!0))},ih=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Bu("Promise can't be resolved itself");var i=qu(t);i?bu((function(){var n={done:!1};try{i.call(t,th(ih,n,e),th(nh,n,e))}catch(t){nh(n,t,e)}})):(e.value=t,e.state=1,$u(e,!1))}catch(t){nh({done:!1},t,e)}}};if(zu&&(Fu=(Nu=function(e){pu(this,Nu,Au),du(e),Xl.call(this);var t=Lu(this);try{e(th(ih,t),th(nh,t))}catch(e){nh(t,e)}}).prototype,(Xl=function(e){Iu(this,{type:Au,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=cu(Fu,{then:function(e,t){var n=Du(this),i=Hu(mu(this,Nu));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=Pu?Uu.domain:void 0,n.parent=!0,n.reactions.push(i),0!=n.state&&$u(n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),ql=function(){var e=new Xl,t=Lu(e);this.promise=e,this.resolve=th(ih,t),this.reject=th(nh,t)},xu.f=Hu=function(e){return e===Nu||e===$l?new ql(e):Gu(e)},"function"==typeof su&&Mu!==Object.prototype)){Zl=Mu.then,Ku||(au(Mu,"then",(function(e,t){var n=this;return new Nu((function(e,t){Zl.call(n,e,t)})).then(e,t)}),{unsafe:!0}),au(Mu,"catch",Fu.catch,{unsafe:!0}));try{delete Mu.constructor}catch(e){}lu&&lu(Mu,Fu)}iu({global:!0,wrap:!0,forced:zu},{Promise:Nu}),uu(Nu,Au,!1),hu(Au),$l=ou(Au),iu({target:Au,stat:!0,forced:zu},{reject:function(e){var t=Hu(this);return t.reject.call(void 0,e),t.promise}}),iu({target:Au,stat:!0,forced:zu},{resolve:function(e){return wu(this,e)}}),iu({target:Au,stat:!0,forced:Xu},{all:function(e){var t=this,n=Hu(t),i=n.resolve,r=n.reject,o=_u((function(){var n=du(t.resolve),o=[],s=0,a=1;gu(e,(function(e){var c=s++,l=!1;o.push(void 0),a++,n.call(t,e).then((function(e){l||(l=!0,o[c]=e,--a||i(o))}),r)})),--a||i(o)}));return o.error&&r(o.value),n.promise},race:function(e){var t=this,n=Hu(t),i=n.reject,r=_u((function(){var r=du(t.resolve);gu(e,(function(e){r.call(t,e).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}});var rh=o,oh=De.f,sh=Function.prototype,ah=sh.toString,ch=/^\s*function ([^ (]*)/,lh="name";rh&&!(lh in sh)&&oh(sh,lh,{configurable:!0,get:function(){try{return ah.call(this).match(ch)[1]}catch(e){return""}}});var uh=C,hh=kc,fh=function(e,t,n){var i,r;return hh&&"function"==typeof(i=t.constructor)&&i!==n&&uh(r=i.prototype)&&r!==n.prototype&&hh(e,r),e},dh="\t\n\v\f\r \u2028\u2029\ufeff",ph=m,vh=wi,gh="[\t\n\v\f\r \u2028\u2029\ufeff]",yh=RegExp("^"+gh+gh+"*"),mh=RegExp(gh+gh+"*$"),kh=function(e){return function(t){var n=vh(ph(t));return 1&e&&(n=n.replace(yh,"")),2&e&&(n=n.replace(mh,"")),n}},bh={start:kh(1),end:kh(2),trim:kh(3)},wh=o,Ch=n,xh=yn,_h=Ye.exports,Eh=J,Th=p,Sh=fh,Ph=j,Rh=ge,Oh=r,Ah=Kn,Lh=Rt.f,Ih=i.f,Dh=De.f,Mh=bh.trim,Nh="Number",Fh=Ch.Number,Bh=Fh.prototype,jh=Th(Ah(Bh))==Nh,Uh=function(e){if(Ph(e))throw TypeError("Cannot convert a Symbol value to a number");var t,n,i,r,o,s,a,c,l=Rh(e,"number");if("string"==typeof l&&l.length>2)if(43===(t=(l=Mh(l)).charCodeAt(0))||45===t){if(88===(n=l.charCodeAt(2))||120===n)return NaN}else if(48===t){switch(l.charCodeAt(1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+l}for(s=(o=l.slice(2)).length,a=0;a<s;a++)if((c=o.charCodeAt(a))<48||c>r)return NaN;return parseInt(o,i)}return+l};if(xh(Nh,!Fh(" 0o1")||!Fh("0b1")||Fh("+0x1"))){for(var Hh,Gh=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof Gh&&(jh?Oh((function(){Bh.valueOf.call(n)})):Th(n)!=Nh)?Sh(new Fh(Uh(t)),n,Gh):Uh(t)},Vh=wh?Lh(Fh):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),Wh=0;Vh.length>Wh;Wh++)Eh(Fh,Hh=Vh[Wh])&&!Eh(Gh,Hh)&&Dh(Gh,Hh,Ih(Fh,Hh));Gh.prototype=Bh,Bh.constructor=Gh,_h(Ch,Nh,Gh)}var Yh=Zi.map;En({target:"Array",proto:!0,forced:!Fo("map")},{map:function(e){return Yh(this,e,arguments.length>1?arguments[1]:void 0)}});var Kh=Zi.filter;En({target:"Array",proto:!0,forced:!Fo("filter")},{filter:function(e){return Kh(this,e,arguments.length>1?arguments[1]:void 0)}});var zh=o,Xh=r,qh=Rn,$h=Qt,Zh=s,Jh=q,Qh=y,ef=Object.assign,tf=Object.defineProperty,nf=!ef||Xh((function(){if(zh&&1!==ef({b:1},ef(tf({},"a",{enumerable:!0,get:function(){tf(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!=ef({},e)[n]||qh(ef({},t)).join("")!=i}))?function(e,t){for(var n=Jh(e),i=arguments.length,r=1,o=$h.f,s=Zh.f;i>r;)for(var a,c=Qh(arguments[r++]),l=o?qh(c).concat(o(c)):qh(c),u=l.length,h=0;u>h;)a=l[h++],zh&&!s.call(c,a)||(n[a]=c[a]);return n}:ef,rf=nf;En({target:"Object",stat:!0,forced:Object.assign!==rf},{assign:rf});var of={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,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new r(i,o||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),a.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},a.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,s=new Array(o);r<o;r++)s[r]=i[r].fn;return s},a.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},a.prototype.emit=function(e,t,i,r,o,s){var a=n?n+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],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,s),!0}for(l=1,c=new Array(h-1);l<h;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var f,d=u.length;for(l=0;l<d;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),h){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,i);break;case 4:u[l].fn.call(u[l].context,t,i,r);break;default:if(!c)for(f=1,c=new Array(h-1);f<h;f++)c[f-1]=arguments[f];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,i,r){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||r&&!a.once||i&&a.context!==i||s(this,o);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||r&&!a[c].once||i&&a[c].context!==i)&&l.push(a[c]);l.length?this._events[o]=1===l.length?l[0]:l:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a}(of);var sf=of.exports;function af(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 cf(e){return function(e){if(Array.isArray(e))return af(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){if("string"==typeof e)return af(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)?af(e,t):void 0}}(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.")}()}var lf=Ne,uf=Mt,hf=wi,ff=m,df=ka,pf=Ca;ra("match",(function(e,t,n){return[function(t){var n=ff(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,n):new RegExp(t)[e](hf(n))},function(e){var i=lf(this),r=hf(e),o=n(t,i,r);if(o.done)return o.value;if(!i.global)return pf(i,r);var s=i.unicode;i.lastIndex=0;for(var a,c=[],l=0;null!==(a=pf(i,r));){var u=hf(a[0]);c[l]=u,""===u&&(i.lastIndex=df(r,uf(i.lastIndex),s)),l++}return 0===l?null:c}]}));var vf=o,gf=n,yf=yn,mf=fh,kf=We,bf=De.f,wf=Rt.f,Cf=ca,xf=wi,_f=Ts,Ef=Ss,Tf=Ye.exports,Sf=r,Pf=J,Rf=bt.enforce,Of=_c,Af=Ls,Lf=Ms,If=he("match"),Df=gf.RegExp,Mf=Df.prototype,Nf=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Ff=/a/g,Bf=/a/g,jf=new Df(Ff)!==Ff,Uf=Ef.UNSUPPORTED_Y,Hf=vf&&(!jf||Uf||Af||Lf||Sf((function(){return Bf[If]=!1,Df(Ff)!=Ff||Df(Bf)==Bf||"/a/i"!=Df(Ff,"i")})));if(yf("RegExp",Hf)){for(var Gf=function(e,t){var n,i,r,o,s,a,c=this instanceof Gf,l=Cf(e),u=void 0===t,h=[],f=e;if(!c&&l&&u&&e.constructor===Gf)return e;if((l||e instanceof Gf)&&(e=e.source,u&&(t="flags"in f?f.flags:_f.call(f))),e=void 0===e?"":xf(e),t=void 0===t?"":xf(t),f=e,Af&&"dotAll"in Ff&&(i=!!t&&t.indexOf("s")>-1)&&(t=t.replace(/s/g,"")),n=t,Uf&&"sticky"in Ff&&(r=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,"")),Lf&&(e=(o=function(e){for(var t,n=e.length,i=0,r="",o=[],s={},a=!1,c=!1,l=0,u="";i<=n;i++){if("\\"===(t=e.charAt(i)))t+=e.charAt(++i);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:Nf.test(e.slice(i+1))&&(i+=2,c=!0),r+=t,l++;continue;case">"===t&&c:if(""===u||Pf(s,u))throw new SyntaxError("Invalid capture group name");s[u]=!0,o.push([u,l]),c=!1,u="";continue}c?u+=t:r+=t}return[r,o]}(e))[0],h=o[1]),s=mf(Df(e,t),c?this:Mf,Gf),(i||r||h.length)&&(a=Rf(s),i&&(a.dotAll=!0,a.raw=Gf(function(e){for(var t,n=e.length,i=0,r="",o=!1;i<=n;i++)"\\"!==(t=e.charAt(i))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+e.charAt(++i);return r}(e),n)),r&&(a.sticky=!0),h.length&&(a.groups=h)),e!==f)try{kf(s,"source",""===f?"(?:)":f)}catch(e){}return s},Vf=function(e){e in Gf||bf(Gf,e,{configurable:!0,get:function(){return Df[e]},set:function(t){Df[e]=t}})},Wf=wf(Df),Yf=0;Wf.length>Yf;)Vf(Wf[Yf++]);Mf.constructor=Gf,Gf.prototype=Mf,Tf(gf,"RegExp",Gf)}Of("RegExp");var Kf=Ye.exports,zf=Ne,Xf=wi,qf=r,$f=Ts,Zf="toString",Jf=RegExp.prototype,Qf=Jf.toString,ed=qf((function(){return"/a/b"!=Qf.call({source:"a",flags:"b"})})),td=Qf.name!=Zf;(ed||td)&&Kf(RegExp.prototype,Zf,(function(){var e=zf(this),t=Xf(e.source),n=e.flags;return"/"+t+"/"+Xf(void 0===n&&e instanceof RegExp&&!("flags"in Jf)?$f.call(e):n)}),{unsafe:!0});var nd=r,id=dh,rd=bh.trim;En({target:"String",proto:!0,forced:function(e){return nd((function(){return!!id[e]()||"
"!="
"[e]()||id[e].name!==e}))}("trim")},{trim:function(){return rd(this)}});var od=q,sd=Math.floor,ad="".replace,cd=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,ld=/\$([$&'`]|\d{1,2})/g,ud=ra,hd=r,fd=Ne,dd=Lt,pd=Mt,vd=wi,gd=m,yd=ka,md=function(e,t,n,i,r,o){var s=n+e.length,a=i.length,c=ld;return void 0!==r&&(r=od(r),c=cd),ad.call(o,c,(function(o,c){var l;switch(c.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(s);case"<":l=r[c.slice(1,-1)];break;default:var u=+c;if(0===u)return o;if(u>a){var h=sd(u/10);return 0===h?o:h<=a?void 0===i[h-1]?c.charAt(1):i[h-1]+c.charAt(1):o}l=i[u-1]}return void 0===l?"":l}))},kd=Ca,bd=he("replace"),wd=Math.max,Cd=Math.min,xd="$0"==="a".replace(/./,"$0"),_d=!!/./[bd]&&""===/./[bd]("a","$0");ud("replace",(function(e,t,n){var i=_d?"$":"$0";return[function(e,n){var i=gd(this),r=null==e?void 0:e[bd];return void 0!==r?r.call(e,i,n):t.call(vd(i),e,n)},function(e,r){var o=fd(this),s=vd(e);if("string"==typeof r&&-1===r.indexOf(i)&&-1===r.indexOf("$<")){var a=n(t,o,s,r);if(a.done)return a.value}var c="function"==typeof r;c||(r=vd(r));var l=o.global;if(l){var u=o.unicode;o.lastIndex=0}for(var h=[];;){var f=kd(o,s);if(null===f)break;if(h.push(f),!l)break;""===vd(f[0])&&(o.lastIndex=yd(s,pd(o.lastIndex),u))}for(var d,p="",v=0,g=0;g<h.length;g++){f=h[g];for(var y=vd(f[0]),m=wd(Cd(dd(f.index),s.length),0),k=[],b=1;b<f.length;b++)k.push(void 0===(d=f[b])?d:String(d));var w=f.groups;if(c){var C=[y].concat(k,m,s);void 0!==w&&C.push(w);var x=vd(r.apply(void 0,C))}else x=md(y,s,m,k,w,r);m>=v&&(p+=s.slice(v,m)+x,v=m+y.length)}return p+s.slice(v)}]}),!!hd((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!xd||_d);var Ed=Math.floor,Td=function(e,t){var n=e.length,i=Ed(n/2);return n<8?Sd(e,t):Pd(Td(e.slice(0,i),t),Td(e.slice(i),t),t)},Sd=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},Pd=function(e,t,n){for(var i=e.length,r=t.length,o=0,s=0,a=[];o<i||s<r;)o<i&&s<r?a.push(n(e[o],t[s])<=0?e[o++]:t[s++]):a.push(o<i?e[o++]:t[s++]);return a},Rd=Td,Od=T.match(/firefox\/(\d+)/i),Ad=!!Od&&+Od[1],Ld=/MSIE|Trident/.test(T),Id=T.match(/AppleWebKit\/(\d+)\./),Dd=!!Id&&+Id[1],Md=En,Nd=Tn,Fd=q,Bd=Mt,jd=wi,Ud=r,Hd=Rd,Gd=ns,Vd=Ad,Wd=Ld,Yd=I,Kd=Dd,zd=[],Xd=zd.sort,qd=Ud((function(){zd.sort(void 0)})),$d=Ud((function(){zd.sort(null)})),Zd=Gd("sort"),Jd=!Ud((function(){if(Yd)return Yd<70;if(!(Vd&&Vd>3)){if(Wd)return!0;if(Kd)return Kd<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++)zd.push({k:t+i,v:n})}for(zd.sort((function(e,t){return t.v-e.v})),i=0;i<zd.length;i++)t=zd[i].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return"DGBEFHACIJK"!==r}}));Md({target:"Array",proto:!0,forced:qd||!$d||!Zd||!Jd},{sort:function(e){void 0!==e&&Nd(e);var t=Fd(this);if(Jd)return void 0===e?Xd.call(t):Xd.call(t,e);var n,i,r=[],o=Bd(t.length);for(i=0;i<o;i++)i in t&&r.push(t[i]);for(n=(r=Hd(r,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:jd(t)>jd(n)?1:-1}}(e))).length,i=0;i<n;)t[i]=r[i++];for(;i<o;)delete t[i++];return t}});var Qd="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,ep={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},tp="%c[xgplayer]",np={config:{debug:Qd?3:1},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,[tp,ep.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,[tp,ep.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,[tp,ep.error,e].concat(r))}}};var ip=function(){function e(t){ui(this,e),this.bufferedList=t}return Co(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}(),rp={};function op(e,t){for(var n=0,i=t.length;n<i;n++)if(e.indexOf(t[n])>-1)return!0;return!1}rp.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},rp.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&&rp.addClass(r,n),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(e){return np.logError("util.createDomFromHtml",e),null}},rp.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(i){var n=e.className&&"object"===di(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},rp.addClass=function(e,t){if(e&&t)try{t.trim().split(/\s+/g).forEach((function(t){t&&e.classList.add(t)}))}catch(n){rp.hasClass(e,t)||(e.className&&"object"===di(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},rp.removeClass=function(e,t){if(e&&t)try{t.trim().split(/\s+/g).forEach((function(t){t&&e.classList.remove(t)}))}catch(n){rp.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===di(e.className)?e.setAttribute("class",e.getAttribute("class").replace(n," ")):e.className=e.className.replace(n," ")}))}},rp.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){rp.hasClass(e,t)?rp.removeClass(e,t):rp.addClass(e,t)}))},rp.classNames=function(){for(var e=arguments,t=[],n=function(n){"String"===rp.typeOf(e[n])?t.push(e[n]):"Object"===rp.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(" ")},rp.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(i){np.logError("util.findDom",i),0===n.indexOf("#")&&(e=t.getElementById(n.slice(1)))}return e},rp.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},rp.padStart=function(e,t,n){for(var i=String(n),r=t>>0,o=Math.ceil(r/i.length),s=[],a=String(e);o--;)s.push(i);return s.join("").substring(0,r-a.length)+a},rp.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=rp.padStart(Math.floor(e/3600),2,0),n=rp.padStart(Math.floor((e-3600*t)/60),2,0),i=rp.padStart(Math.floor(e-3600*t-60*n),2,0);return("00"===t?[n,i]:[t,n,i]).join(":")},rp.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},rp.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},rp.deepCopy=function(e,t){if("Object"===rp.typeOf(t)&&"Object"===rp.typeOf(e))return Object.keys(t).forEach((function(n){"Object"!==rp.typeOf(t[n])||t[n]instanceof Node?"Array"===rp.typeOf(t[n])?e[n]="Array"===rp.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]:rp.deepCopy(e[n],t[n])})),e},rp.deepMerge=function(e,t){return Object.keys(t).map((function(n){var i;"Array"===rp.typeOf(t[n])&&"Array"===rp.typeOf(e[n])?"Array"===rp.typeOf(e[n])&&(i=e[n]).push.apply(i,cf(t[n])):rp.typeOf(e[n])!==rp.typeOf(t[n])||null===e[n]||"Object"!==rp.typeOf(e[n])||t[n]instanceof window.Node?null!==t[n]&&(e[n]=t[n]):rp.deepMerge(e[n],t[n])})),e},rp.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},rp.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""},rp.setInterval=function(e,t,n,i){e._interval[t]||(e._interval[t]=setInterval(n.bind(e),i))},rp.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},rp.setTimeout=function(e,t,n){e._timers||(e._timers=[]);var i=setTimeout((function(){t(),rp.clearTimeout(e,i)}),n);return e._timers.push(i),i},rp.clearTimeout=function(e,t){var n=e._timers;if("Array"===rp.typeOf(n)){for(var i=0;i<n.length;i++)if(n[i]===t){n.splice(i,1),clearTimeout(t);break}}else clearTimeout(t)},rp.clearAllTimers=function(e){var t=e._timers;"Array"===rp.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},rp.createImgBtn=function(e,t,n,i){var r,o,s,a=rp.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(a.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()),s=e,!1)})),a.style.width="".concat(r).concat(s),a.style.height="".concat(o).concat(s),a.style.backgroundSize="".concat(r).concat(s," ").concat(o).concat(s),a.style.margin="start"===e?"-".concat(o/2).concat(s," auto auto -").concat(r/2).concat(s):"auto 5px auto 5px");return a},rp.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)"},rp.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},rp.checkIsFunction=function(e){return e&&"function"==typeof e},rp.checkIsObject=function(e){return null!==e&&"object"===di(e)},rp.hide=function(e){e.style.display="none"},rp.show=function(e,t){e.style.display=t||"block"},rp.isUndefined=function(e){if(null==e)return!0},rp.setStyleFromCsstext=function(e,t){t&&("String"===rp.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]})))},rp.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&&(op(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},rp.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},rp.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.complete?t&&t():(i.onload=function(e){i=null,t&&t(e)},i.onerror=function(e){i=null,n&&n(e)}),i.src=e}},rp.stopPropagation=function(e){e&&(e.stopPropagation(),e.cancelable&&e.preventDefault())},rp.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},rp.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},rp.checkTouchSupport=function(){return"ontouchstart"in window},rp.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 s=r.length;if(s){var a=r[s-1].end;n[o].start-a<t?n[o].end>a&&(r[s-1].end=n[o].end):r.push(n[o])}else r.push(n[o])}else r=n;return new ip(r)},rp.getEventPos=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return{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}},rp.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},rp.getHostFromUrl=function(e){if(null==e||""===e||"string"!=typeof e)return"";var t=e.split("/"),n="";return t.length>3&&t[2]&&(n=t[2]),n},rp.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)};var sp=rp,ap=/(Android)\s([\d.]+)/,cp=/(Version)\/([\d.]+)/,lp=["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"],up={get device(){return up.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),s=/(?:iPhone)/.test(e)&&!o,a=!(s||i||n||o),c=/(?:iPad|PlayBook)/.test(e);return{isTablet:o,isPhone:s,isIpad:c,isIos:s||c,isAndroid:i,isPc:a,isSymbian:n,isWindowsPhone:t,isFireFox:r}},get osVersion(){var e=navigator.userAgent,t="",n=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?cp:ap)?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())||void 0},isSupportMP4:function(){if(this.supportResult)return this.supportResult;var e=document.createElement("video"),t={isSupport:!1,mime:""};return"function"==typeof e.canPlayType&&lp.map((function(n){"probably"===e.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(t.isSupport=!0,t.mime+="||".concat(n))})),this.supportResult=t,e=null,t}},hp=up,fp="3.0.0-next.20",dp={1:"network",2:"network",3:"decoder",4:"format"},pp=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};ui(this,e);var i=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.video){var r=n.mediaError?n.mediaError:t.video.error||{},o=t.duration,s=t.currentTime,a=t.ended,c=t.src,l=t.currentSrc,u=t.video,h=u.readyState,f=u.networkState,d={playerVersion:fp,currentTime:s,duration:o,ended:a,readyState:h,networkState:f,src:c||l,errorType:n.errorType,errorCode:n.errorCode||r.code,message:n.errorMessage||r.message,mediaError:r,originError:n.originError?n.originError.stack:""};return n.ext&&Object.keys(n.ext).map((function(e){d[e]=n.ext[e]})),d}if(arguments.length>1){for(var p={playerVersion:fp,domain:document.domain},v=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],g=0;g<arguments.length;g++)p[v[g]]=arguments[g];return p.ex=i?(i[arguments[0]]||{}).msg:"",p}},vp="play",gp="playing",yp="ended",mp="pause",kp="error",bp="seeking",wp="seeked",Cp="timeupdate",xp="waiting",_p="canplay",Ep="durationchange",Tp="volumechange",Sp="loadeddata",Pp="ratechange",Rp="progress",Op="loadstart",Ap="emptied",Lp="focus",Ip="blur",Dp="ready",Mp="urlNull",Np="autoplay_started",Fp="autoplay_was_prevented",Bp="complete",jp="replay",Up="destroy",Hp="urlchange",Gp="fullscreen_change",Vp="cssFullscreen_change",Wp="mini_state_change",Yp="definition_change",Kp="after_definition_change",zp="video_resize",Xp="pip_change",qp="rotate",$p="screenShot",Zp="playnext",Jp="shortcut",Qp="xglog",ev="user_action",tv=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","ratechange","progress","loadstart","emptied","stalled","suspend","abort"],nv={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},iv=Object.freeze({__proto__:null,PLAY:vp,PLAYING:gp,ENDED:yp,PAUSE:mp,ERROR:kp,SEEKING:bp,SEEKED:wp,TIME_UPDATE:Cp,WAITING:xp,CANPLAY:_p,CANPLAY_THROUGH:"canplaythrough",DURATION_CHANGE:Ep,VOLUME_CHANGE:Tp,LOADED_DATA:Sp,RATE_CHANGE:Pp,PROGRESS:Rp,LOAD_START:Op,EMPTIED:Ap,STALLED:"stalled",SUSPEND:"suspend",ABORT:"abort",BUFFER_CHANGE:"bufferedChange",PLAYER_FOCUS:Lp,PLAYER_BLUR:Ip,READY:Dp,URL_NULL:Mp,AUTOPLAY_STARTED:Np,AUTOPLAY_PREVENTED:Fp,COMPLETE:Bp,REPLAY:jp,DESTROY:Up,URL_CHANGE:Hp,FULLSCREEN_CHANGE:Gp,CSS_FULLSCREEN_CHANGE:Vp,MINI_STATE_CHANGE:Wp,DEFINITION_CHANGE:Yp,BEFORE_DEFINITION_CHANGE:"before_definition_change",AFTER_DEFINITION_CHANGE:Kp,SEI_PARSED:"SEI_PARSED",RETRY:"retry",VIDEO_RESIZE:zp,PIP_CHANGE:Xp,ROTATE:qp,SCREEN_SHOT:$p,PLAYNEXT:Zp,SHORTCUT:Jp,XGLOG:Qp,USER_ACTION:ev,USER_ACTION1:"user_action1",VIDEO_EVENTS:tv,STATS_EVENTS:nv});function rv(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}function ov(e,t){this&&this.emit&&("error"===e?this.errorHandler(e):this.emit(e,t))}function sv(e,t){return function(n){var i={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:sp.getHostFromUrl(t.currentSrc),vtype:t.vtype};if(t.removeInnerOP(n.type),"timeupdate"===e&&(t._currentTime=t.video&&t.video.currentTime),"durationchange"===e&&(t._duration=t.video.duration),"volumechange"===e&&(i.isMutedChange=t._lastMuted!==t.muted,t._lastMuted=t.muted),t.videoEventMiddleware[e])try{t.videoEventMiddleware[e].call(t,i,ov.bind(t))}catch(n){throw ov.call(t,e,i),n}else ov.call(t,e,i)}}var av=function(e){fi(n,e);var t=rv(n);function n(e){var i;ui(this,n),(i=t.call(this,e))._hasStart=!1,i._currentTime=0,i._duration=0,i._internalOp={},i._lastMuted=!1,i.vtype="MP4",i.videoConfig=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:2,mediaType:e.mediaType||"video"},e.videoConfig,e.videoAttributes);var r=e["x5-video-player-type"]||e.x5VideoPlayerType;return hp.isWeixin&&hp.os.isAndroid&&r&&(i.videoConfig["x5-video-player-type"]=r,delete i.videoConfig.playsinline,delete i.videoConfig["webkit-playsinline"],delete i.videoConfig["x5-playsinline"]),e.loop&&(i.videoConfig.loop="loop"),i.video=sp.createDom(i.videoConfig.mediaType,"",i.videoConfig,""),e.defaultPlaybackRate&&(i.video.defaultPlaybackRate=i.video.playbackRate=e.defaultPlaybackRate),"Number"===sp.typeOf(e.volume)&&(i.volume=e.volume),e.autoplayMuted&&(i.video.muted=!0,i._lastMuted=!0),e.autoplay&&(i.video.autoplay=!0),i._interval={},i.videoEventMiddleware={},i.attachVideoEvents(),i}return Co(n,[{key:"setEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(n){t.videoEventMiddleware[n]=e[n]}))}},{key:"removeEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(e){delete t.videoEventMiddleware[e]}))}},{key:"attachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.video;this._evHandlers||(this._evHandlers=tv.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]),yi({},t,sv(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.video;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"),t.forEach((function(e){n.video.appendChild(sp.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||"")}))}));var i=e.children;if(i){this._videoSourceCount=i.length,!this._sourceError&&(this._sourceError=function(e){n._videoSourceCount--,0===n._videoSourceCount&&(n.videoEventMiddleware.error?n.videoEventMiddleware.error.call(n,e,(function(){n.errorHandler("error")})):n.errorHandler("error",{code:4,message:"sources load error"}))});for(var r=0;r<i.length;r++)i[r].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.video&&(this.video.error||t)){var n=this.video.error||t,i=n.code?dp[n.code]:"other";n.message;this.video.currentSrc||(n={code:6,message:"empty_src"}),this.emit(e,new pp(this,{errorType:i,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{key:"destroy",value:function(){for(var e in this.video&&(this.video.pause&&(this.video.pause(),this.video.muted=!0),this.video.removeAttribute("src"),this.video.load()),this._currentTime=0,this._duration=0,this.videoConfig=null,this._interval)clearInterval(this._interval[e]),this._interval[e]=null;this.detachVideoEvents(),this.video=null,this.videoEventMiddleware={},this.removeAllListeners()}},{key:"play",value:function(){return this.video?this.video.play():null}},{key:"pause",value:function(){this.video&&this.video.pause()}},{key:"canPlayType",value:function(e){return!!this.video&&this.video.canPlayType(e)}},{key:"getBufferedRange",value:function(e){var t=[0,0];if(!this.video)return t;e||(e=this.video.buffered);var n=this.video.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.video&&this.video.autoplay},set:function(e){this.video&&(this.video.autoplay=e)}},{key:"buffered",get:function(){return this.video?this.video.buffered:null}},{key:"buffered2",get:function(){return this.video?sp.getBuffered2(this.video.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.video)return e;var t=this.video.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.video?this.video.crossOrigin:""},set:function(e){this.video&&(this.video.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.video?this.video.currentSrc:""},set:function(e){this.video&&(this.video.currentSrc=e)}},{key:"currentTime",get:function(){return this.video?void 0!==this.video.currentTime?this.video.currentTime:this._currentTime:0},set:function(e){this.video&&(this.video.currentTime=e)}},{key:"defaultMuted",get:function(){return!!this.video&&this.video.defaultMuted},set:function(e){this.video&&(this.video.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return!!this.video&&this.video.ended}},{key:"error",get:function(){return this.video.error}},{key:"errorNote",get:function(){if(!this.video.error)return"";return["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][this.video.error.code-1]}},{key:"loop",get:function(){return!!this.video&&this.video.loop},set:function(e){this.video&&(this.video.loop=e)}},{key:"muted",get:function(){return!!this.video&&this.video.muted},set:function(e){this.video&&this.video.muted!==e&&(this._lastMuted=this.video.muted,this.video.muted=e)}},{key:"networkState",get:function(){return this.video.networkState}},{key:"paused",get:function(){return!this.video||this.video.paused}},{key:"playbackRate",get:function(){return this.video?this.video.playbackRate:0},set:function(e){this.video&&e!==1/0&&(this.video.defaultPlaybackRate=e,this.video.playbackRate=e)}},{key:"played",get:function(){return this.video?this.video.played:null}},{key:"preload",get:function(){return!!this.video&&this.video.preload},set:function(e){this.video&&(this.video.preload=e)}},{key:"readyState",get:function(){return this.video.readyState}},{key:"seekable",get:function(){return!!this.video&&this.video.seekable}},{key:"seeking",get:function(){return!!this.video&&this.video.seeking}},{key:"src",get:function(){return this.video?this.video.src:""},set:function(e){this.video&&(this.emit(Hp,e),this.emit(xp),this._currentTime=0,this._duration=0,/^blob/.test(this.video.currentSrc)||/^blob/.test(this.video.src)?this.onWaiting():(this._detachSourceEvents(this.video),"Array"===sp.typeOf(e)?this._attachSourceEvents(this.video,e):this.video.src=e,this.load()))}},{key:"volume",get:function(){return this.video?this.video.volume:0},set:function(e){e!==1/0&&this.video&&(this.video.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),s=2;s<r;s++)o[s-2]=arguments[s];(i=xo(gi(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),s=2;s<r;s++)o[s-2]=arguments[s];(i=xo(gi(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),s=2;s<r;s++)o[s-2]=arguments[s];(i=xo(gi(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),s=2;s<r;s++)o[s-2]=arguments[s];(i=xo(gi(n.prototype),"off",this)).call.apply(i,[this,e,t].concat(o))}},{key:"offAll",value:function(){xo(gi(n.prototype),"removeAllListeners",this).call(this)}}]),n}(sf),cv=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"}};ui(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return Co(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}(),lv=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],uv=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],hv=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"];function fv(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 s=t.call.apply(t,[e].concat(r));n&&"function"==typeof n&&(s&&s.then?s.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 dv(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(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(t.message),t}if(this.__hooks&&this.__hooks[e])try{var s,a=(s=this.__hooks[e]).call.apply(s,[this,this].concat(Array.prototype.slice.call(arguments)));a?a.then?a.then((function(e){!1!==e&&fv.apply(void 0,[r,t,n.next].concat(cf(i)))})).catch((function(e){throw e})):fv.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments))):void 0===a&&fv.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(t.message),t}else fv.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function pv(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 vv(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 gv(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 yv(e){e.__hooks=null}function mv(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 s,a=(s=e.__hooks[t]).call.apply(s,[e,e].concat(r));if(a&&a.then)a.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!==a)return n.call.apply(n,[e,e].concat(r))}function kv(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 bv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kv(Object(n),!0).forEach((function(t){yi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wv(e,t){np.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}var Cv=function(){function e(t){ui(this,e),sp.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),gv(this),this.__args=t,this.__events={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return Co(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){}},{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=sp.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)})):wv(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){e&&t&&this.player?this.player.once(e,t):wv(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)})):wv(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e=this;Object.keys(this.__events).map((function(t){e.__events[t]&&e.off(t,e.__events[t]),t&&delete e.__events[t]})),this.__events={}}},{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]:{},i=bv(bv({},n),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,i)}},{key:"hook",value:function(e,t){return dv.call.apply(dv,[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 pv.call.apply(pv,[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(),sp.clearAllTimers(this),sp.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(n),yv(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var n in t)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 xv=Element.prototype;xv.matches=xv.matchesSelector||xv.mozMatchesSelector||xv.msMatchesSelector||xv.oMatchesSelector||xv.webkitMatchesSelector}var _v=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function Ev(e,t,n,i,r){var o=Tv.apply(this,arguments);return e.addEventListener(n,o,r),{destroy:function(){e.removeEventListener(n,o,r)}}}function Tv(e,t,n,i){return function(n){n.delegateTarget=_v(n.target,t),n.delegateTarget&&i.call(e,n)}}var Sv=function(e,t,n,i,r){return"function"==typeof e.addEventListener?Ev.apply(null,arguments):"function"==typeof n?Ev.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return Ev(e,t,n,i,r)})))};function Pv(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Rv={CONTROLS:"controls",ROOT:"root"},Ov={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 Av(e){return!!e&&(e.indexOf&&/^http/.test(e))}function Lv(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 sp.addClass(e,n),Object.keys(i).map((function(t){e.setAttribute(t,i[t])})),e;if(Av(e)||Av(e.url))return i.src=Av(e)?e:e.url||"",o=sp.createDom(e.tag||"img","",i,"xg-img ".concat(n));if("function"==typeof e)try{return(o=e())instanceof window.Element?(sp.addClass(o,n),Object.keys(i).map((function(e){o.setAttribute(e,i[e])})),o):(np.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(e){return np.logError("Plugin named [".concat(r,"]:createIcon"),e),null}return"string"==typeof e?sp.createDomFromHtml(e,i,n):(np.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function Iv(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:"",s=r&&r.attr?r.attr:{},a=null;n&&n[i]&&(o=function(e,t){return"object"===di(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(n[i],o),s=function(e,t){return"object"===di(e)&&e.attr&&"object"===di(e.attr)&&Object.keys(e.attr).map((function(n){t[n]=e.attr[n]})),t}(n[i],s),a=Lv(n[i],i,o,s,t.pluginName)),!a&&r&&(a=Lv(r.icon?r.icon:r,s,o,{},t.pluginName)),t.icons[i]=a}))}var Dv,Mv,Nv,Fv=function(e){fi(n,e);var t=Pv(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ui(this,n),(e=t.call(this,i)).__delegates=[],e}return Co(n,[{key:"__init",value:function(e){if(xo(gi(n.prototype),"__init",this).call(this,e),e.root){var t=e.root,i=null;this.icons={},this.root=null,this.parent=null,Iv(this.registerIcons()||{},this),this.langText={};var r,o,s=this.registerLanguageTexts()||{};r=s,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 a="";try{a=this.render()}catch(e){throw np.logError("Plugin:".concat(this.pluginName,":render"),e),new Error("Plugin:".concat(this.pluginName,":render:").concat(e.message))}if(a)(i=n.insert(a,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(i=sp.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(i)}this.root=i,this.parent=t;var c=this.config.attr||{},l=this.config.style||{};this.setAttr(c),this.setStyle(l),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"===di(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(n){var i,r,o=n,s=t[o],a={root:e.root};"function"==typeof s?(i=e.config[o]||{},r=s):"object"===di(s)&&"function"==typeof s.plugin&&(i=s.options?sp.deepCopy(e.config[o]||{},s.options):e.config[o]||{},r=s.plugin),a.config=i,void 0!==i.index&&(a.index=i.index),i.root&&(a.root=i.root),e.registerPlugin(r,a,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=xo(gi(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"===sp.typeOf(e)?this.root.style[e]=t:void("Object"===sp.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"===sp.typeOf(e)?this.root.setAttribute(e,t):void("Object"===sp.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(e){return np.logError("Plugin:appendChild",e),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)),xo(gi(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 s=0,a=null,c="";s<i;s++){a=t.children[s];var l=Number(a.getAttribute("data-index"));if(l>=r){c="beforebegin";break}l<r&&(c="afterend")}return o?"afterend"===c?t.appendChild(e):t.insertBefore(e,a):a.insertAdjacentHTML(c,e),"afterend"===c?t.children[t.children.length-1]:t.children[s]}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 s=Sv(e,t,n,i,r);s.key="".concat(t,"_").concat(n),o.push(s)}));else{var s=Sv(e,t,n,i,r);s.key="".concat(t,"_").concat(n),o.push(s)}return o}},{key:"ROOT_TYPES",get:function(){return Rv}},{key:"POSITIONS",get:function(){return Ov}}]),n}(Cv),Bv=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),jv=J,Uv=q,Hv=Bv,Gv=rt("IE_PROTO"),Vv=Object.prototype,Wv=Hv?Object.getPrototypeOf:function(e){return e=Uv(e),jv(e,Gv)?e[Gv]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Vv:null},Yv=r,Kv=Wv,zv=We,Xv=J,qv=he("iterator"),$v=!1;[].keys&&("next"in(Nv=[].keys())?(Mv=Kv(Kv(Nv)))!==Object.prototype&&(Dv=Mv):$v=!0),(null==Dv||Yv((function(){var e={};return Dv[qv].call(e)!==e})))&&(Dv={}),Xv(Dv,qv)||zv(Dv,qv,(function(){return this}));var Zv={IteratorPrototype:Dv,BUGGY_SAFARI_ITERATORS:$v},Jv=Zv.IteratorPrototype,Qv=Kn,eg=f,tg=Ni,ng=Tc,ig=function(){return this},rg=function(e,t,n){var i=t+" Iterator";return e.prototype=Qv(Jv,{next:eg(1,n)}),tg(e,i,!1),ng[i]=ig,e},og=En,sg=rg,ag=Wv,cg=kc,lg=Ni,ug=We,hg=Ye.exports,fg=Tc,dg=Zv.IteratorPrototype,pg=Zv.BUGGY_SAFARI_ITERATORS,vg=he("iterator"),gg="keys",yg="values",mg="entries",kg=function(){return this},bg=function(e,t,n,i,r,o,s){sg(n,t,i);var a,c,l,u=function(e){if(e===r&&v)return v;if(!pg&&e in d)return d[e];switch(e){case gg:case yg:case mg:return function(){return new n(this,e)}}return function(){return new n(this)}},h=t+" Iterator",f=!1,d=e.prototype,p=d[vg]||d["@@iterator"]||r&&d[r],v=!pg&&p||u(r),g="Array"==t&&d.entries||p;if(g&&(a=ag(g.call(new e)),dg!==Object.prototype&&a.next&&(ag(a)!==dg&&(cg?cg(a,dg):"function"!=typeof a[vg]&&ug(a,vg,kg)),lg(a,h,!0))),r==yg&&p&&p.name!==yg&&(f=!0,v=function(){return p.call(this)}),d[vg]!==v&&ug(d,vg,v),fg[t]=v,r)if(c={values:u(yg),keys:o?v:u(gg),entries:u(mg)},s)for(l in c)(pg||f||!(l in d))&&hg(d,l,c[l]);else og({target:t,proto:!0,forced:pg||f},c);return c},wg=w,Cg=Po,xg=Tc,_g=bt,Eg=bg,Tg="Array Iterator",Sg=_g.set,Pg=_g.getterFor(Tg),Rg=Eg(Array,"Array",(function(e,t){Sg(this,{type:Tg,target:wg(e),index:0,kind:t})}),(function(){var e=Pg(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:t[i],done:!1}:{value:[i,t[i]],done:!1}}),"values");xg.Arguments=xg.Array,Cg("keys"),Cg("values"),Cg("entries");var Og=ya.charAt,Ag=wi,Lg=bt,Ig=bg,Dg="String Iterator",Mg=Lg.set,Ng=Lg.getterFor(Dg);Ig(String,"String",(function(e){Mg(this,{type:Dg,string:Ag(e),index:0})}),(function(){var e,t=Ng(this),n=t.string,i=t.index;return i>=n.length?{value:void 0,done:!0}:(e=Og(n,i),t.index+=e.length,{value:e,done:!1})}));var Fg=n,Bg=es,jg=Rg,Ug=We,Hg=he,Gg=Hg("iterator"),Vg=Hg("toStringTag"),Wg=jg.values;for(var Yg in Bg){var Kg=Fg[Yg],zg=Kg&&Kg.prototype;if(zg){if(zg[Gg]!==Wg)try{Ug(zg,Gg,Wg)}catch(e){zg[Gg]=Wg}if(zg[Vg]||Ug(zg,Vg,Yg),Bg[Yg])for(var Xg in jg)if(zg[Xg]!==jg[Xg])try{Ug(zg,Xg,jg[Xg])}catch(e){zg[Xg]=jg[Xg]}}}var qg=function(){function e(){var t=this;if(ui(this,e),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver((function(e){var n=(new Date).getTime();n-t.timeStamp<100||(t.timeStamp=n,t.__trigger(e))})),this.timeStamp=(new Date).getTime()}catch(e){console.error(e)}}return Co(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=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)}));try{this.observer&&this.observer.unobserve(e)}catch(e){}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(e){console.error(e)}return!0}return!1}},{key:"__trigger",value:function(e){for(var t=0;t<e.length;t++){if(this.__runHandler(e[t].target))break}}}]),e}(),$g=null;var Zg={init:function(e){var t,n,i=e._pluginInfoId;i||(i=(new Date).getTime(),e._pluginInfoId=i),this.pluginGroup||(this.pluginGroup={}),!e.config.closeResizeObserver&&(t=e.root,n=function(){e.resize()},$g||($g=new qg),$g.addObserver(t,n)),0===Object.keys(this.pluginGroup).length&&(e.isUserActive=!0),this.pluginGroup[i]={_player:e,_originalOptions:e.config||{}}},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},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;i&&this.pluginGroup&&this.pluginGroup[i]||(this.init(e),i=e._pluginInfoId),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 s=n.pluginName||t.pluginName;if(!s)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported()){n.config||(n.config={});for(var a=Object.keys(o),c=0;c<a.length;c++)if(s.toLowerCase()===a[c].toLowerCase()){var l=o[a[c]];"Object"===sp.typeOf(l)?n.config=Object.assign({},n.config,o[a[c]]):"Boolean"===sp.typeOf(l)&&(n.config.disable=!l);break}t.defaultConfig&&Object.keys(t.defaultConfig).map((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[s.toLowerCase()]&&(this.unRegister(i,s.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(s,"] exist, destroy the old instance")));var u=new t(n);return r[s.toLowerCase()]=u,r[s.toLowerCase()].func=t,u&&"function"==typeof u.afterCreate&&u.afterCreate(),u}catch(e){throw console.error(e),e}}else console.warn("not supported plugin [".concat(s,"]"))}},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(n){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),n)}},deletePlugin:function(e,t){var n=e._pluginInfoId;n&&this.pluginGroup&&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(!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]){for(var o=t.pluginGroup[r]._plugins,s=[],a=0,c=Object.keys(o);a<c.length;a++){var l=c[a];if(o[l]&&o[l].beforePlayerInit)try{var u=o[l].beforePlayerInit();s.push(n(u))}catch(e){throw s.push(n(null)),e}}Promise.all([].concat(s)).then((function(){i()})).catch((function(e){console.error(e),i()}))}else i()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(this.pluginGroup&&t)for(var n=this.pluginGroup[t]._plugins,i=0,r=Object.keys(n);i<r.length;i++){var o=r[i];n[o]&&n[o].afterPlayerInit&&n[o].afterPlayerInit()}},setLang:function(e,t){var n=t._pluginInfoId;if(this.pluginGroup&&n){var i=this.pluginGroup[n]._plugins;Object.keys(i).map((function(t){if(i[t].updateLang)i[t].updateLang(e);else try{i[t].lang=e}catch(e){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=e._pluginInfoId;if(t){for(var n={},i=this.pluginGroup[t]._plugins,r=0,o=Object.keys(i);r<o.length;r++){var s=o[r];n[s]={plugin:i[s].func,options:i[s]._args},this.unRegister(t,s)}for(var a=0,c=Object.keys(n);a<c.length;a++){var l=c[a];this.register(t,l,n[l].plugin,n[l].options)}}},onPluginsReady:function(e){var t=e._pluginInfoId,n=this.pluginGroup[t]._plugins;t&&n&&Object.keys(n).map((function(e){n[e].onPluginsReady&&"function"==typeof n[e].onPluginsReady&&n[e].onPluginsReady()}))},setCurrentUserActive:function(e,t){if(this.pluginGroup&&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]];if(r&&r._player){this.pluginGroup[n[i]]._player.isUserActive=!1;break}}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,$g.unObserver(n,i);for(var r=this.pluginGroup[t]._plugins,o=0,s=Object.keys(r);o<s.length;o++){var a=s[o];this.unRegister(t,a)}var c=e.isUseActive;if(delete this.pluginGroup[t],delete e._pluginInfoId,c){var l=Object.keys(this.pluginGroup);l.length>0&&this.setCurrentUserActive(l[l.length-1],!0)}}}},Jg={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"};var Qg=0,ey=1,ty=2,ny=3,iy=4,ry=5,oy=6,sy=7,ay=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"];function cy(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var ly=function(e){fi(n,e);var t=cy(n);function n(){var e;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var n=pi(e).player;n.userTimer&&(sp.clearTimeout(n,n.userTimer),clearTimeout(n.userTimer))})),yi(pi(e),"onMouseLeave",(function(){pi(e).player.focus()})),e}return Co(n,[{key:"beforeCreate",value:function(e){e.config.mode||"mobile"!==hp.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(Jg.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(Wp,(function(t){t?sp.addClass(e.root,"mini-controls"):sp.removeClass(e.root,"mini-controls")})),"mobile"!==hp.device&&(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&&sp.addClass(this.root,Jg.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){sp.removeClass(this.root,Jg.CONTROLS_AUTOHIDE)}},{key:"show",value:function(){sp.addClass(this.root,"show")}},{key:"hide",value:function(){sp.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 Ov.CONTROLS_LEFT:t.root=this.left;break;case Ov.CONTROLS_RIGHT:t.root=this.right;break;case Ov.CONTROLS_CENTER:t.root=this.center;break;case Ov.CONTROLS:t.root=this.root;break;default:t.root=this.left}return xo(gi(n.prototype),"registerPlugin",this).call(this,e,t,i)}}}},{key:"destroy",value:function(){"mobile"!==hp.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=sp.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},yi({},Jg.CONTROLS_AUTOHIDE,n),{"xgplayer-controls-initshow":i||!n});return'<xg-controls class="'.concat(r,'" unselectable="on" onselectstart="return false">\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}(Fv),uy={},hy={},fy=[],dy={};function py(){Object.keys(uy.en).map((function(e){hy[e]=e}))}function vy(e){("Array"!==sp.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e).map((function(e){uy[e.LANG]?sp.deepMerge(uy[e.LANG]||{},e.TEXT||{}):dy[e.LANG]=e.TEXT})),py()}function gy(e){var t=e.LANG,n=e.TEXT||{};uy[t]||fy.push(t),uy[t]?sp.deepMerge(n,uy[t]):uy[t]=n,dy[t]&&(vy([{LANG:t,TEXT:dy[t]}]),delete dy[t]),"zh-cn"===t&&(uy.zh=uy["zh-cn"]),py()}gy({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 yy={get textKeys(){return hy},get langKeys(){return fy},get lang(){var e={};return fy.map((function(t){e[t]=uy[t]})),e.zh=uy["zh-cn"],e},extend:vy,use:gy};function my(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 ky(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?my(Object(n),!0).forEach((function(t){yi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):my(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function by(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var wy=["play","pause","replay","retry"],Cy=function(e){fi(n,e);var t=by(n);function n(e){var i;ui(this,n);var r,o=sp.deepMerge({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:!1,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!1,closeControlsBlur:!1,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},ignores:[],whitelist:[],inactive:3e3,lang:(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase(),controls:!0,marginControls:!1,fullscreenTarget:null,controlsList:[],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:[],thumbnail:null,commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}},e);gv(pi(i=t.call(this,o)),wy),i.config=o,(r=pi(i)).logInfo=np.logInfo.bind(r),r.logWarn=np.logWarn.bind(r),r.logError=np.logError.bind(r);var s=i.constructor.defaultPreset;if(i.config.presets.length){var a=i.config.presets.indexOf("default");a>=0&&s&&(i.config.presets[a]=s)}else s&&i.config.presets.push(s);if(i.userTimer=null,i.waitTimer=null,i._state=ey,i._hasStart=!1,i.isSeeking=!1,i.isCanplay=!1,i._runPending=!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,hp.os.isAndroid&&hp.osVersion>0&&hp.osVersion<6&&(i.config.autoplay=!1),i.database=new cv,i.isUserActive=!1,!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"))),vi(i);var c=i.config,l=c.definition,u=void 0===l?{}:l;if(!c.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.definition}return i._bindEvents(),i._registerPresets(),i._registerPlugins(),Zg.onPluginsReady(pi(i)),i.setState(ty),i.emit(Dp),i.onReady&&i.onReady(),(i.config.videoInit||i.config.autoplay)&&(!i.hasStart||i.state<iy)&&i.start(),i}return Co(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(kp,new pp("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=Zg.checkPlayerRoot(this.root);n&&(np.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),n.destroy()),this._initBaseDoms();var i=this.constructor.XgVideoProxy;if(i&&this.videoConfig.mediaType===i.mediaType){var r=this.innerContainer||this.root;this.detachVideoEvents(this.video);var o=new i(r,this.config,this.videoConfig);this.attachVideoEvents(o),this.video=o}if(this.config.controls){var s=Zg.register(this,ly);this.controls=s}var a=this.config.isMobileSimulateMode?"mobile":hp.device;if(this.addClass("".concat(Jg.DEFAULT," ").concat(Jg.INACTIVE," xgplayer-").concat(a," ").concat(this.config.controls?"":Jg.NO_CONTROLS)),this.config.autoplay?this.addClass(Jg.ENTER):this.addClass(Jg.NO_START),this.config.fluid){var c=this.config,l=c.width,u=c.height;"number"==typeof l&&"number"==typeof u||(l=600,u=337.5);var h={width:"100%",height:"0","max-width":"100%","padding-top":"".concat(100*u/l,"%")};Object.keys(h).forEach((function(t){e.root.style[t]=h[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=sp.createDom("xg-bar","",{"data-index":-1},"xg-top-bar"),this.leftBar=sp.createDom("xg-bar","",{"data-index":-1},"xg-left-bar"),this.rightBar=sp.createDom("xg-bar","",{"data-index":-1},"xg-right-bar"),this.config.marginControls&&(this.innerContainer=sp.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer)),this.config.topBarAutoHide&&sp.addClass(this.topBar,Jg.TOP_BAR_AUTOHIDE),this.root.appendChild(this.topBar),this.root.appendChild(this.leftBar),this.root.appendChild(this.rightBar)}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),this.onFullscreenChange=function(t,n){var i=sp.getFullScreenEl();if(e._fullActionFrom?e._fullActionFrom="":e.emit(ev,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:e.currentTime,duration:e.duration,props:[{prop:"fullscreen",from:!0,to:!1}]}),n||i&&(i===e._fullscreenEl||"VIDEO"===i.tagName))sp.setTimeout(e,(function(){e.resize()}),100),!e.config.closeFocusVideoFocus&&e.video.focus(),e.fullscreen=!0,e.changeFullStyle(e.root,i,Jg.FULLSCREEN),e.emit(Gp,!0,e._fullScreenOffset),e.cssfullscreen&&e.exitCssFullscreen();else if(e.fullscreen){sp.setTimeout(e,(function(){e.resize()}),100);var r=e._fullScreenOffset;e.config.needFullscreenScroll?(window.scrollTo(r.left,r.top),sp.setTimeout(e,(function(){e.fullscreen=!1,e._fullScreenOffset=null}),100)):(!e.config.closeFocusVideoFocus&&e.video.focus(),e.fullscreen=!1,e._fullScreenOffset=null),e.cssfullscreen?e.removeClass(Jg.FULLSCREEN):e.recoverFullStyle(e.root,e._fullscreenEl,Jg.FULLSCREEN),e._fullscreenEl=null,e.emit(Gp,!1)}},lv.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),this.__webkitbeginfullscreen=function(t){e._fullscreenEl=e.video,e.onFullscreenChange(t,!0)},this.__webkitendfullscreen=function(t){e.onFullscreenChange(t,!1)},hp.os.isIos&&(this.video.addEventListener("webkitbeginfullscreen",this.__webkitbeginfullscreen),this.video.addEventListener("webkitendfullscreen",this.__webkitendfullscreen)),this.once(Sp,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.video.focus()},this.once(vp,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),lv.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off(vp,this.playFunc),this.canPlayFunc&&this.off(_p,this.canPlayFunc),this.video.removeEventListener("webkitbeginfullscreen",this.__webkitbeginfullscreen),this.video.removeEventListener("webkitendfullscreen",this.__webkitendfullscreen)}},{key:"_startInit",value:function(e){var t=this;if(this.video&&(e&&""!==e&&("Array"!==sp.typeOf(e)||0!==e.length)||(e="",this.emit(Mp),np.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this.canPlayFunc=function(){if(t.config){var e=t.config,n=e.autoplay,i=e.startTime,r=e.defaultPlaybackRate;np.logInfo("player","canPlayFunc",i),i&&(t.currentTime=i>t.duration?t.duration:i,t.config.startTime=0),1!==r&&(t.playbackRate=r),n&&t.videoPlay(),t.off(_p,t.canPlayFunc),t.removeClass(Jg.ENTER)}},this._detachSourceEvents(this.video),"Array"===sp.typeOf(e)?this._attachSourceEvents(this.video,e):this.video.src=e,"Number"===sp.typeOf(this.config.volume)&&(this.volume=this.config.volume),this.loadeddataFunc&&this.once(Sp,this.loadeddataFunc);var n=this.innerContainer?this.innerContainer:this.root;this.video instanceof window.Element&&!n.contains(this.video)&&n.insertBefore(this.video,n.firstChild);var i=this.video.readyState;np.logInfo("_startInit readyState",i),this.config.autoplay&&(!/^blob/.test(this.video.currentSrc)&&!/^blob/.test(this.video.src)&&this.load(),(hp.os.isIpad||hp.os.isPhone)&&this.videoPlay()),i>=2?this.canPlayFunc():this.once(_p,this.canPlayFunc),(!this.hasStart||this.state<iy)&&Zg.afterInit(this),this.hasStart=!0,this.setState(iy),sp.setTimeout(this,(function(){t.emit(Bp)}),0)}}},{key:"_registerPlugins",value:function(){var e=this;this._loadingPlugins=[];var t=this.config.ignores||[],n=this.config.plugins||[];(this.config.i18n||[]).forEach((function(e){yy.use(e)}));var i=t.join("||").toLowerCase().split("||");n.forEach((function(t){try{var n=t.plugin?t.plugin.pluginName:t.pluginName;if(n&&i.indexOf(n.toLowerCase())>-1)return;if(t.lazy&&t.loader){var r=Zg.lazyRegister(e,t);return void(t.forceBeforeInit&&(r.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})).catch((function(t){np.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})),e._loadingPlugins.push(r)))}return e.registerPlugin(t)}catch(e){np.logError("_registerPlugins:",e)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){var n,i,r,o,s,a,c,l,u,h,f,d,p,v;n=e,a=(i=t).preset&&i.options?new i.preset(i.options,n.config):new i({},n.config),c=a.plugins,l=void 0===c?[]:c,u=a.ignores,h=void 0===u?[]:u,f=a.icons,d=void 0===f?{}:f,p=a.i18n,v=void 0===p?[]:p,n.config.plugins||(n.config.plugins=[]),n.config.ignores||(n.config.ignores=[]),(r=n.config.plugins).push.apply(r,cf(l)),(o=n.config.ignores).push.apply(o,cf(h)),Object.keys(d).map((function(e){n.config.icons[e]||(n.config.icons[e]=d[e])})),(s=n.config.i18n).push.apply(s,cf(v))}))}},{key:"registerPlugin",value:function(e,t){var n=null,i=null;e.plugin&&"function"==typeof e.plugin?(n=e.plugin,i=e.options):(n=e,i={}),t&&(i.config=t);for(var r=Object.keys(this.config),o=0;o<r.length;o++)if(n.pluginName.toLowerCase()===r[o].toLowerCase()){var s=this.config[r[o]];"Object"===sp.typeOf(s)&&(s.root&&(i.root=s.root),s.position&&(i.position=s.position));break}var a=i.position?i.position:i.config&&i.config.position||n.defaultConfig&&n.defaultConfig.position,c=Fv.POSITIONS;if(!i.root&&"string"==typeof a&&a.indexOf("controls")>-1)return this.controls&&this.controls.registerPlugin(n,i,n.pluginName);if(!i.root)switch(a){case c.ROOT_RIGHT:i.root=this.rightBar;break;case c.ROOT_LEFT:i.root=this.leftBar;break;case c.ROOT_TOP:i.root=this.topBar;break;default:i.root=this.innerContainer||this.root}return Zg.register(this,n,i)}},{key:"deregister",value:function(e){"string"==typeof e?Zg.unRegister(this,e):e instanceof Cv&&Zg.unRegister(this,e.pluginName)}},{key:"unRegisterPlugin",value:function(e){this.deregister(e)}},{key:"plugins",get:function(){return Zg.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=Zg.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(sp.hasClass(this.root,e)||sp.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&sp.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return sp.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;return this.hasStart||this.state>=ny?Promise.resolve():(this.hasStart=!0,this.setState(ny),Zg.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",np.logError("start:beforeInit:",e),e})))}},{key:"switchURL",value:function(e){var t=this,n=e;"Object"===sp.typeOf(e)&&(n=e.url);var i=this.currentTime,r=this.paused;return this.src=n,new Promise((function(e){var n=function(){t.currentTime=i,r&&t.once("canplay",(function(){t.pause()})),e()};hp.os.isAndroid?t.once("timeupdate",(function(){n()})):t.once("canplay",(function(){n()})),t.play()}))}},{key:"load",value:function(){this.video&&this.video.load()}},{key:"videoPlay",value:function(){var e=this;if(this.hasStart||!(this.state<iy)){this.state<oy&&(this.removeClass(Jg.NO_START),!this.isCanplay&&this.addClass(Jg.ENTER));var t=xo(gi(n.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(Jg.NOT_ALLOW_AUTOPLAY),e.addClass(Jg.PLAYING),e.state<oy&&(np.logInfo(">>>>playPromise.then"),e.setState(oy),e.emit(Np))})).catch((function(t){if(np.logWarn(">>>>playPromise.catch",t.name),e.video&&e.video.error)return e.onError(),e.removeClass(Jg.ENTER),void e.setState(Qg);"NotAllowedError"===t.name&&(e._errorTimer=sp.setTimeout(e,(function(){e._errorTimer=null,e.emit(Fp),e.addClass(Jg.NOT_ALLOW_AUTOPLAY),e.removeClass(Jg.ENTER),e.pause(),e.setState(ry)}),0))})):(np.logWarn("video.play not return promise"),this.state<oy&&(this.setState(oy),this.removeClass(Jg.NOT_ALLOW_AUTOPLAY),this.removeClass(Jg.NO_START),this.removeClass(Jg.ENTER),this.addClass(Jg.PLAYING),this.emit(Np))),t}this.removeClass(Jg.NO_START),this.addClass(Jg.ENTER);var i=this.start();i&&i.then((function(t){!e.config.autoplay&&e.videoPlay()}))}},{key:"videoPause",value:function(){xo(gi(n.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;this.removeClass(Jg.PAUSED),mv(this,"play",(function(){e.videoPlay()}))}},{key:"pause",value:function(){var e=this;mv(this,"pause",(function(){xo(gi(n.prototype),"pause",e).call(e)}))}},{key:"seek",value:function(e,t){var n=this;if(this.video&&!isNaN(Number(e))){var i=this.config,r=i.isSeekedPlay,o=i.seekedStatus,s=t||(r?"play":o);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,this.once(_p,(function(){switch(n.removeClass(Jg.ENTER),n.isSeeking=!1,s){case"play":n.play();break;case"pause":n.pause();break;default:!n.paused&&n.play()}})),this.state<oy?(this.removeClass(Jg.NO_START),this.addClass(Jg.ENTER),this.currentTime=e,"play"===s&&this.play()):this.currentTime=e}}},{key:"changeDefinition",value:function(e,t){var n=this;if(this.emit(Yp,{from:t,to:e}),this.curDefinition=e.definition,this.hasStart){var i=this.switchURL(e.url);i&&i.then?i.then((function(){n.emit(Kp,{from:t,to:e})})):this.emit(Kp,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(Sp,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[Jg.NOT_ALLOW_AUTOPLAY,Jg.PLAYING,Jg.NO_START,Jg.PAUSED,Jg.REPLAY,Jg.ENTER,Jg.ENDED,Jg.ERROR,Jg.LOADING];this.hasStart=!1,this.isPlaying=!1,this.videoPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,t.forEach((function(t){e.removeClass(t)})),this.addClass(Jg.ENTER),this.emit(Ap)}},{key:"destroy",value:function(){var e=this,t=this.innerContainer,i=this.root,r=this.video;if(i&&r){if(this._hasStart=!1,this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.video),sp.clearAllTimers(this),this.emit(Up),Zg.destroy(this),yv(this),xo(gi(n.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),t)for(var o=t.children,s=0;s<o.length;s++)t.removeChild(o[s]);!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 a=i.className.split(" ");a.length>0?i.className=a.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(Jg.ENDED),this.currentTime=0,this.isSeeking=!1,mv(this,"replay",(function(){e.once(_p,(function(){var t=e.videoPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.play(),e.emit(jp),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(Jg.ERROR),this.addClass(Jg.LOADING),mv(this,"retry",(function(){var t=e.currentTime;e.videoPause(),e.src=e.config.url,!e.config.isLive&&(e.currentTime=t),e.once(_p,(function(){e.videoPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,n,i){e&&(i||(i=Jg.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=sp.filterStyleFromText(e)),sp.addClass(e,n),t&&t!==e&&!this._orgPCss&&(this._orgPCss=sp.filterStyleFromText(t),sp.addClass(t,i)))}},{key:"recoverFullStyle",value:function(e,t,n,i){i||(i=Jg.PARENT_FULLSCREEN),this._orgCss&&(sp.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),sp.removeClass(e,n),t&&t!==e&&this._orgPCss&&(sp.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",sp.removeClass(t,i))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,n=this.video;e||(e=t),this._fullScreenOffset={top:sp.scrollTop(),left:sp.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get";var i=sp.getFullScreenEl();if(i!==this._fullscreenEl)try{for(var r=0;r<uv.length;r++){var o=uv[r];if(e[o]){var s="webkitRequestFullscreen"===o?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[o]();return s&&s.then?s:Promise.resolve()}}return n.fullscreenEnabled||n.webkitSupportsFullscreen?(n.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(e){return Promise.reject(new Error("call getFullscreen fail"))}else this.onFullscreenChange()}},{key:"exitFullscreen",value:function(e){if(this.isRotateFullscreen&&this.exitRotateFullscreen(),this._fullscreenEl||sp.getFullScreenEl()){this.root;var t=this.video;this._fullActionFrom="exit";try{for(var n=0;n<hv.length;n++){var i=hv[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(e){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(Jg.INNER_FULLSCREEN," ").concat(Jg.CSS_FULLSCREEN):Jg.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(Gp,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(Vp,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(Jg.INNER_FULLSCREEN," ").concat(Jg.CSS_FULLSCREEN):Jg.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(Gp,!1)):this.removeClass(e)}else this.recoverFullStyle(this.root,this._cssfullscreenEl,e);this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(Vp,!1)}},{key:"getRotateFullscreen",value:function(e){this.cssfullscreen&&this.exitCssFullscreen(e);var t=e?"".concat(Jg.INNER_FULLSCREEN," ").concat(Jg.ROTATE_FULLSCREEN):Jg.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,t,Jg.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!0,this.fullscreen=!0,this.setRotateDeg(90),this.emit(Gp,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this._fullscreenEl!==this.root?"".concat(Jg.INNER_FULLSCREEN," ").concat(Jg.ROTATE_FULLSCREEN):Jg.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,t,Jg.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(Gp,!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.closePlayerBlur,delay:this.config.inactive};this.isActive?this.onFocus(e):this.emit(Lp,ky({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(Ip,ky({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(Jg.INACTIVE),this.userTimer&&sp.clearTimeout(this,this.userTimer),i&&(this.userTimer=sp.setTimeout(this,(function(){e.blur()}),o))}},{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(Jg.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.state>=oy&&this.removeClass(Jg.ENTER),this.removeClass(Jg.LOADING),this.isCanplay=!0,this.waitTimer&&sp.clearTimeout(this,this.waitTimer)}},{key:"onPlay",value:function(){this.state===sy&&this.setState(oy),this.removeClass(Jg.PAUSED),this.ended&&this.removeClass(Jg.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(Jg.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this.userTimer&&sp.clearTimeout(this,this.userTimer),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(Jg.ENDED),this.setState(sy)}},{key:"onError",value:function(){this.setState(Qg),this.updateAcc("error"),this.removeClass(Jg.NOT_ALLOW_AUTOPLAY),this.removeClass(Jg.NO_START),this.removeClass(Jg.ENTER),this.removeClass(Jg.LOADING),this.addClass(Jg.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(Jg.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&sp.clearTimeout(this,this.waitTimer),this.removeClass(Jg.LOADING),this.removeClass(Jg.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&sp.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=sp.setTimeout(this,(function(){e.addClass(Jg.LOADING),sp.clearTimeout(e,e.waitTimer),e.waitTimer=null}),200)}},{key:"onPlaying",value:function(){var e=this;[Jg.NO_START,Jg.PAUSED,Jg.ENDED,Jg.ERROR,Jg.REPLAY,Jg.LOADING].forEach((function(t){e.removeClass(t)}))}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.resize(),(this.waitTimer||this.hasClass(Jg.LOADING))&&this.video.readyState>2&&(this.removeClass(Jg.LOADING),sp.clearTimeout(this,this.waitTimer),this.waitTimer=null),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===sp.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.video&&t&&e){var i="String"===sp.typeOf(e)?e:e.type||"";n.props&&"Array"!==sp.typeOf(n.props)&&(n.props=[n.props]),this.emit(ev,ky({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.video.buffered;if(!t||0===t.length||!this.duration)return!0;for(var n=e||this.video.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.video&&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.video.style.transform=n,this.video.style.webkitTransform=n}}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).forEach((function(n){t.config[n]=e[n];var i=t.plugins[n.toLowerCase()];i&&"Function"===sp.typeOf(i.setConfig)&&i.setConfig(e[n])}))}},{key:"playNext",value:function(e){this.resetState(),this.isPlaying=!1,this.setConfig(e),this.play(),this.emit(Zp,e)}},{key:"resize",value:function(){var e=this;if(this.video){var t=this.video,n=t.videoWidth,i=t.videoHeight,r=this.config,o=r.fitVideoSize,s=r.videoFillMode;if("fill"!==s&&"cover"!==s||this.setAttribute("data-xgfill",s),i&&n){this._videoHeight=i,this._videoWidth=n;var a=this.root.getBoundingClientRect(),c=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,l=a.width,u=a.height-c,h=parseInt(n/i*1e3,10),f=parseInt(l/u*1e3,10),d=l,p=u,v={};"auto"===o&&f>h||"fixWidth"===o?(p=l/h*1e3,this.config.fluid?v.paddingTop="".concat(100*p/d,"%"):v.height="".concat(p+c,"px")):("auto"===o&&f<h||"fixHeight"===o)&&(d=h*u/1e3,v.width="".concat(d,"px")),this.fullscreen||this.cssfullscreen||Object.keys(v).forEach((function(t){e.root.style[t]=v[t]})),("fillHeight"===s&&f<h||"fillWidth"===s&&f>h)&&this.setAttribute("data-xgfill","cover");var g={videoScale:h,vWidth:d,vHeight:p,cWidth:d,cHeight:p+c};this.emit(zp,g)}}}},{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.video.updateObjectPosition?this.video.updateObjectPosition(e,t):this.video.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%")}},{key:"setState",value:function(e){np.logInfo("setState","state from:".concat(ay[this.state]," to:").concat(ay[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._state=ty),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===oy||this._state===sy}},{key:"definitionList",get:function(){return this.config.definition.list||[]},set:function(e){var t=this,n=this.config.definition;n.list=e,this.emit("resourceReady",e);var i=null,r=null;e.forEach((function(e){t.curDefinition===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:"lang",get:function(){return this.config.lang},set:function(e){0!==yy.langKeys.filter((function(t){return t===e})).length||"zh"===e?(this.config.lang=e,Zg.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(yy.langKeys.join(),"] "))}},{key:"i18n",get:function(){var e=this.config.lang;return yy.lang[e]||yy.lang.en}},{key:"i18nKeys",get:function(){return yy.textKeys||{}}},{key:"version",get:function(){return fp}},{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(){var e=xo(gi(n.prototype),"readyState",this);return this.i18n[e]||e}},{key:"error",get:function(){var e=xo(gi(n.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){var e=xo(gi(n.prototype),"networkState",this);return this.i18n[e]||e}},{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:"hook",value:function(e,t){return dv.call.apply(dv,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return pv.call.apply(pv,[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 vv.call.apply(vv,[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),Zg.setCurrentUserActive(this.playerId,e)}}],[{key:"debugger",get:function(){return np.config.debug},set:function(e){np.config.debug=e}},{key:"getCurrentUserActivePlayerId",value:function(){return Zg.getCurrentUseActiveId()}},{key:"setCurrentUserActive",value:function(e,t){Zg.setCurrentUserActive(e,t)}},{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}(av);function xy(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 _y(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}function Ey(){return(new Date).getTime()}yi(Cy,"defaultPreset",null),yi(Cy,"XgVideoProxy",null);var Ty=function(e){fi(n,e);var t=_y(n);function n(){var e;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(e=t.call.apply(t,[this].concat(r))),"_onTimeupdate",(function(){np.logInfo("[xgLogger]Events._onTimeupdate"),e._state.isTimeUpdate=!0,e._sendFirstFrame()})),yi(pi(e),"_onAutoplayStart",(function(){np.logInfo("[xgLogger]Events._onAutoplayStart"),e._state.autoplayStart=!0,e._sendFirstFrame()})),yi(pi(e),"_onReset",(function(){e.vt=0,e.pt=0,e.fvt=0,e._isSeeking=!1,e.seekingStart=0,e.waitingStart=0,e._isWaiting=!1,e._waitTimer&&sp.clearTimeout(pi(e),e._waitTimer),e._waittTimer&&sp.clearTimeout(pi(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),yi(pi(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=Ey(),e.emitLog("seekStart",{start:Ey()}))})),yi(pi(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),yi(pi(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=Ey(),e._waitType=1,e.emitLog("waitingStart",{start:e.waitingStart,type:1,endType:"loadstart"}))})),yi(pi(e),"_onWaiting",(function(){!e._isWaiting&&e.vt&&(e._isWaiting=!0,e._waitTimer=sp.setTimeout(pi(e),(function(){e._isWaiting&&(e.waitingStart=Ey(),sp.clearTimeout(pi(e),e._waitTimer),e._waitTimer=null,e.vt?e.seekingStart?e._waitType=2:e._waitType=0:e._waitType=1,e._startWaitTimeout(),e.emitLog("waitingStart",{start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing"}))}),200))})),yi(pi(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),yi(pi(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return Co(n,[{key:"afterCreate",value:function(){var e=this;this._state={autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1},this._onReset(),this._waitType="firstFrame",this.on(Op,(function(){var t=e._state.autoplayStart;e._state.isTimeUpdate=!1,e._state.isFFLoading=!0,np.logInfo("[xgLogger]Events.LOAD_START",t),e.pt=Ey(),e.vt=0,e.fvt=0,e.off(Np,e._onAutoplayStart),e.off(Cp,e._onTimeupdate),e._onWaitingLoadStart(),t?e.once(Cp,e._onTimeupdate):e.once(Np,e._onAutoplayStart)})),this.on(Sp,(function(){e.vt=Ey(),e.fvt=e.vt-e.pt,np.logInfo("[xgLogger]Events.LOADED_DATA",e.fvt,e._state.isTimeUpdate),e._state.isTimeUpdate&&e._sendFirstFrame(),e.suspendWaitingStatus("loadeddata")})),this.on(bp,this._onSeeking),this.on(wp,this._onSeeked),this.on(Up,(function(){e.endState("destroy")})),this.on(Hp,(function(){e.endState("urlChange"),e._onReset()})),this.on([gp,_p],this._onPlaying),this.on(xp,this._onWaiting),this.on(kp,this._onError),this.on(Ap,(function(){e.endState("emptied"),e._onReset()}))}},{key:"_sendFirstFrame",value:function(){this.s=Ey(),this.vt>0&&this._state.isFFLoading&&(np.logInfo("[xgLogger]Events._sendFirstFrame",this.vt),this._state.isFFLoading=!1,this.emitLog("firstFrame",{fvt:this.fvt,costTime:this.fvt,vt:this.vt}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&sp.clearTimeout(this,this._waittTimer),this._waittTimer=sp.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),sp.clearTimeout(e,e._waittTimer),e._waittTimer=null}),3e4)}},{key:"endState",value:function(e){this.suspendWaitingStatus(e),this.suspendSeekingStatus(e)}},{key:"suspendSeekingStatus",value:function(e){if(this.seekingStart){var t=Ey(),n=t-this.seekingStart;this.seekingStart=0,this.emitLog("seekEnd",{end:t,costTime:n,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(sp.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(sp.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var t=Ey()-this.waitingStart;this._isWaiting=!1,this.waitingStart=0,this.emitLog("waitingEnd",{costTime:t,type:this._waitType,endType:2===this._waitType?"seek":e})}}},{key:"emitLog",value:function(e,t){var n=this.player;this.emit(Qp,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xy(Object(n),!0).forEach((function(t){yi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({t:Ey(),host:sp.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{}}}]),n}(Fv);function Sy(){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}function Py(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Ry=function(e){fi(n,e);var t=Py(n);function n(){return ui(this,n),t.apply(this,arguments)}return Co(n,[{key:"registerIcons",value:function(){return{replay:Sy}}},{key:"afterCreate",value:function(){var e=this;Fv.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(yp,(function(){if(e.playerConfig.loop||sp.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(vp,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),sp.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}(Fv);function Oy(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Ay=function(e){fi(n,e);var t=Oy(n);function n(){return ui(this,n),t.apply(this,arguments)}return Co(n,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){sp.addClass(this.root,"hide")}},{key:"show",value:function(){sp.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(yp,(function(){e.isEndedShow&&sp.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(Cp,(function(){e.onTimeUpdate()})),this.on(Hp,(function(){sp.removeClass(e.root,"hide"),sp.addClass(e.root,"xg-showplay"),e.once(Cp,(function(){e.onTimeUpdate()}))}))):this.on(vp,(function(){sp.addClass(e.root,"hide")}))}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?sp.removeClass(this.root,"xg-showplay"):this.once(Cp,(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}(Fv);function Ly(){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 Iy(){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}function Dy(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var My={};var Ny=function(e){fi(n,e);var t=Dy(n);function n(e){var i;return ui(this,n),(i=t.call(this,e)).autoPlayStart=!1,i}return Co(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.playerConfig;this.initIcons(),this.once(Dp,(function(){n&&(n.lang&&"en"===n.lang?sp.addClass(t.root,"lang-is-en"):"jp"===n.lang&&sp.addClass(t.root,"lang-is-jp"))})),this.on(Np,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";sp.addClass(e.root,t),e.autoPlayStart=!0,e.onPlayPause("play")})),n.autoplay||this.show(),this.on(Fp,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),sp.removeClass(e.root,t),e.show()})),this.on(vp,(function(){e.onPlayPause("play")})),this.on(mp,(function(){e.onPlayPause("pause")})),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:"preventDefault",value:function(e){}},{key:"registerIcons",value:function(){return{startPlay:{icon:Ly,class:"xg-icon-play"},startPause:{icon:Iy,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(){sp.addClass(this.root,"hide")}},{key:"show",value:function(){sp.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){sp.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){sp.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};My[e]&&window.clearTimeout(My[e].id),My[e]={},n.start&&n.start(),My[e].id=window.setTimeout((function(){n.end&&n.end(),window.clearTimeout(My[e].id),delete My[e]}),t)}("pauseplay",400,{start:function(){sp.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){sp.removeClass(t.root,"interact"),!e&&t.hide()}})}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.state<ty)||(this.player.paused||t.state!==oy?t.play():t.pause())}},{key:"onPlayPause",value:function(e){var t=this.config,n=this.player;if(!(n.state<oy)&&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(My).map((function(e){window.clearTimeout(My[e].id),delete My[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}(Fv);function Fy(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var By=function(e){fi(n,e);var t=Fy(n);function n(){return ui(this,n),t.apply(this,arguments)}return Co(n,[{key:"render",value:function(){var e=this.config.innerHtml,t=sp.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}(Fv);function jy(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Uy=function(e){fi(n,e);var t=jy(n);function n(){return ui(this,n),t.apply(this,arguments)}return Co(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:Ov.CONTROLS_RIGHT,index:10}}}]),n}(Fv);function Hy(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}function Gy(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!isNaN(t)&&t}var Vy=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],Wy=Vy.length;function Yy(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===di(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<Wy;t++)e[Vy[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<Wy;r++){var o=Vy[r],s=t[o],a=parseFloat(s);n[o]=isNaN(a)?0:a}var c=n.paddingLeft+n.paddingRight,l=n.paddingTop+n.paddingBottom,u=n.marginLeft+n.marginRight,h=n.marginTop+n.marginBottom,f=n.borderLeftWidth+n.borderRightWidth,d=n.borderTopWidth+n.borderBottomWidth,p=i,v=Gy(t.width);!1!==v&&(n.width=v+(p?0:c+f));var g=Gy(t.height);return!1!==g&&(n.height=g+(p?0:l+d)),n.innerWidth=n.width-(c+f),n.innerHeight=n.height-(l+d),n.outerWidth=n.width+u,n.outerHeight=n.height+h,n}}function Ky(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i.identifier===t)return i}}var zy="dragStart",Xy="dragMove",qy="dragEnded",$y={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},Zy=function(e){fi(n,e);var t=Hy(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ui(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):vi(i)}return Co(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)]),$y[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=$y[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=Ky(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=Ky(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=Ky(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=Yy(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(zy,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(qy)),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),s=o.x,a=o.y;s=this.checkContain("x",s,i),a=this.checkContain("y",a,r),this.position.x=i+s,this.position.y=r+a,this.dragPoint.x=s,this.dragPoint.y=a,this.emit(Xy,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=isNaN(t)?0:t,this.position.y=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=Yy(this._root.parentNode);return n?parseFloat(e)/100*n[t]:0}return parseInt(e,10)}}]),n}(sf);function Jy(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Qy=function(e){fi(n,e);var t=Jy(n);function n(e){var i;ui(this,n),yi(pi(i=t.call(this,e)),"onCancelClick",(function(e){i.exitMini(),i.isClose=!0})),yi(pi(i),"onCenterClick",(function(e){var t=pi(i).player;t.paused?t.play():t.pause()})),yi(pi(i),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-i.pos.scrollY)<50)){var t=parseInt(sp.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=pi(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 Co(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(mp,(function(){e.setAttr("data-state","pause")})),this.on(vp,(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(Uy,n,Uy.pluginName)}var i=sp.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",i,this.onCancelClick),this.bind(".play-icon",i,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new Zy(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:Ly,class:"xg-icon-play"},pause:{icon:Iy,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={},sp.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(Wp,!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;sp.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(Wp,!1),this.isMini=t.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=sp.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 <div lang-key="'.concat(this.i18nKeys.MINI_DRAG,'">').concat(this.i18n.MINI_DRAG,'</div>\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}(Fv);function em(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var tm={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},nm=["videoClick","videoDbClick"],im=function(e){fi(n,e);var t=em(n);function n(){var e;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var n=pi(e),i=n.player,r=n.playerConfig;i.isActive||(i.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&i.video.focus())})),yi(pi(e),"onMouseEnter",(function(t){var n=pi(e),i=n.playerConfig,r=n.player;r.focus({autoHide:!i.closeDelayBlur}),!i.closeFocusVideoFocus&&r.video.focus()})),yi(pi(e),"onMouseLeave",(function(t){var n=e.playerConfig,i=n.closePlayerBlur,r=n.leavePlayerTime;i||(r?e.player.focus({autoHide:!0,delay:r}):e.player.blur())})),yi(pi(e),"onVideoClick",(function(t){var n=pi(e),i=n.player,r=n.playerConfig;t.target&&r.closeVideoClick||t.target!==i.video&&t.target!==i.innerContainer&&t.target!==i.video.__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--,mv(pi(e),nm[0],(function(t,n){e.switchPlayPause(n.e)}),{e:t,paused:i.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),yi(pi(e),"onVideoDblClick",(function(t){var n=pi(e),i=n.player,r=n.playerConfig;!t.target||t.target!==i.video&&t.target!==i.video.__canvas||r.closeVideoDblclick||(e._clickCount<2?e._clickCount=0:(e._clickCount=0,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),t.preventDefault(),t.stopPropagation(),mv(pi(e),nm[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 Co(n,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,nm.map((function(t){e.__hooks[t]=null}));var t=this.playerConfig,n=t.enableContextmenu;t.isMobileSimulateMode||"mobile"===hp.device&&!hp.os.isIpad||(this.config.disableContextmenu=!n,this.initEvents())}},{key:"initEvents",value:function(){var e=this,t=this.player,n=t.video,i=t.root;n.addEventListener("click",this.onVideoClick,!1),n.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(tm).map((function(t){i.addEventListener(t,e[tm[t]],!1)})),this.config.disableContextmenu&&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),n.removeEventListener("dblclick",this.onVideoDblClick,!1),n.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(tm).map((function(t){i.removeEventListener(t,e[tm[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{disableContextmenu:!0}}}]),n}(Cv),rm=p,om=Lt,sm=wi,am=m,cm=En,lm=Lt,um=function(e){if("number"!=typeof e&&"Number"!=rm(e))throw TypeError("Incorrect invocation");return+e},hm=function(e){var t=sm(am(this)),n="",i=om(e);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n},fm=r,dm=1..toFixed,pm=Math.floor,vm=function(e,t,n){return 0===t?n:t%2==1?vm(e,t-1,n*e):vm(e*e,t/2,n)},gm=function(e,t,n){for(var i=-1,r=n;++i<6;)r+=t*e[i],e[i]=r%1e7,r=pm(r/1e7)},ym=function(e,t){for(var n=6,i=0;--n>=0;)i+=e[n],e[n]=pm(i/t),i=i%t*1e7},mm=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var i=String(e[t]);n=""===n?i:n+hm.call("0",7-i.length)+i}return n};cm({target:"Number",proto:!0,forced:dm&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!fm((function(){dm.call({})}))},{toFixed:function(e){var t,n,i,r,o=um(this),s=lm(e),a=[0,0,0,0,0,0],c="",l="0";if(s<0||s>20)throw RangeError("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return String(o);if(o<0&&(c="-",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*vm(2,69,1))-69)<0?o*vm(2,-t,1):o/vm(2,t,1),n*=4503599627370496,(t=52-t)>0){for(gm(a,0,n),i=s;i>=7;)gm(a,1e7,0),i-=7;for(gm(a,vm(10,i,1),0),i=t-1;i>=23;)ym(a,1<<23),i-=23;ym(a,1<<i),gm(a,1,1),ym(a,2),l=mm(a)}else gm(a,0,n),gm(a,1<<-t,0),l=mm(a)+hm.call("0",s);return l=s>0?c+((r=l.length)<=s?"0."+hm.call("0",s-r)+l:l.slice(0,r-s)+"."+l.slice(r-s)):c+l}});var km="press",bm="pressend",wm="doubleclick",Cm="click",xm="touchmove",_m="touchstart",Em="touchend",Tm={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},Sm={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function Pm(e){return e&&e.length>0?e[e.length-1]:null}function Rm(e){var t=navigator.userAgent;/(?:iPhone|iPad)/.test(t)&&e.cancelable&&e.preventDefault()}var Om=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};ui(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?Sm:Tm,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return Co(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(km,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(wm,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(Cm,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(t){console.error("trigger>>:".concat(e),t)}}))}},{key:"onTouchStart",value:function(e){var t=this._pos,n=this.root;this.config.needPreventDefault&&Rm(e);var i=Pm(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(_m,e)}},{key:"onTouchCancel",value:function(e){this.onTouchEnd(e)}},{key:"onTouchEnd",value:function(e){var t=this._pos,n=this.root;this.config.needPreventDefault&&Rm(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(bm,e),this.trigger(Em,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=Pm(e.touches),r=i?parseInt(i.pageX,10):e.pageX,o=i?parseInt(i.pageY,10):e.pageX,s=r-t.x,a=o-t.y;Math.abs(a)<n.miniStep&&Math.abs(s)<n.miniStep||(this.__clearPress(),t.press&&this.trigger(bm,e),t.press=!1,t.moving=!0,this.trigger(xm,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 Am(){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}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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Im="auto",Dm="seeking",Mm="playbackrate",Nm=function(e){fi(n,e);var t=Lm(n);function n(e){var i;return ui(this,n),yi(pi(i=t.call(this,e)),"onTouchStart",(function(e){var t=pi(i),n=t.player,r=t.config,o=t.pos,s=t.playerConfig,a=i.getTouche(e);if(a&&!r.disableGesture&&i.duration>0&&!n.ended){o.isStart=!0,sp.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),i.find(".xg-dur").innerHTML=sp.format(i.duration);var c=i.root.getBoundingClientRect();90===n.rotateDeg?(o.top=c.left,o.left=c.top,o.width=c.height,o.height=c.width):(o.top=c.top,o.left=c.left,o.width=c.width,o.height=c.height);var l=parseInt(a.pageX-o.left,10),u=parseInt(a.pageY-o.top,10);o.x=90===n.rotateDeg?u:l,o.y=90===n.rotateDeg?l: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}})),yi(pi(i),"onTouchMove",(function(e){var t=i.getTouche(e),n=pi(i),r=n.pos,o=n.config,s=n.player;if(t&&!o.disableGesture&&i.duration&&r.isStart){var a=o.miniMoveStep,c=o.hideControlsActive,l=parseInt(t.pageX-r.left,10),u=parseInt(t.pageY-r.top,10),h=90===s.rotateDeg?u:l,f=90===s.rotateDeg?l:u;if(Math.abs(h-r.x)>a||Math.abs(f-r.y)>a){var d=h-r.x,p=f-r.y,v=r.scope;if(-1===v&&(0===(v=i.checkScope(h,f,d,p,r))&&(c?s.blur():s.focus({autoHide:!1}),!r.time&&(r.time=parseInt(1e3*s.currentTime,10)+1e3*i.timeOffset)),r.scope=v),-1===v||v>0&&!o.gestureY||0===v&&!o.gestureX)return;e.cancelable&&e.preventDefault(),i.executeMove(d,p,v,r.width,r.height),r.x=h,r.y=f}}})),yi(pi(i),"onTouchEnd",(function(e){var t=pi(i),n=t.player,r=t.pos,o=t.playerConfig;r.isStart&&(r.scope>-1&&e.cancelable&&e.preventDefault(),i.endLastMove(r.scope),setTimeout((function(){n.getPlugin("progress")&&n.getPlugin("progress").resetSeekState()}),10),r.scope=-1,i.resetPos(),sp.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),i.changeAction(Im))})),yi(pi(i),"onRootTouchMove",(function(e){!i.config.disableGesture&&i.config.gestureX&&i.checkIsRootTarget(e)&&(e.stopPropagation(),i.pos.isStart?i.onTouchMove(e):i.onTouchStart(e))})),yi(pi(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 Co(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:Am,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this,t=this.playerConfig,n=this.config,i=this.player;!0===t.closeVideoDblclick&&(n.closedbClick=!0),this.resetPos(),sp.isUndefined(t.disableGesture)||(n.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=sp.createDom("xg-mask","",{},"xgmask"),i.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r=this.domEventType;this.touch=new Om(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(Ep,(function(){var t=e.player,n=e.config;1e3*t.duration<n.moveDuration&&(n.moveDuration=1e3*t.duration)})),this.on([_p,yp],(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 s=i.plugins.progress;s&&(s.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),s.addCallBack("dragend",(function(){e.changeAction(Im)})))}}},{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&&sp.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,s=-1;if(e<0||e>o)return s;var a=0===i?Math.abs(n):Math.abs(n/i);return Math.abs(n)>0&&a>=1.73&&e>r.scopeM1&&e<r.scopeM2?s=0:(0===Math.abs(n)||a<=.57)&&(s=e<r.scopeL?1:e>r.scopeR?2:3),s}},{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:hp.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;switch(e){case 0:i.seek(Number(o).toFixed(1)),r.hideControlsEnd?i.blur():i.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500)}this.changeAction(Im)}},{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:"onClick",value:function(e){var t=this.player,n=this.config,i=this.playerConfig;t.state<oy?i.closeVideoClick||(this.sendUseAction(new Event("click")),t.play()):!n.closedbClick||i.closeVideoClick?t.isActive?t.blur():t.focus():i.closeVideoClick||((t.isActive||n.focusVideoClick)&&(this.emitUserAction("click","switch_play_pause"),this.switchPlayPause()),t.focus())}},{key:"onDbClick",value:function(e){var t=this.config,n=this.player;!t.closedbClick&&n.state>=oy&&(this.sendUseAction(new Event("dblclick")),this.switchPlayPause())}},{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(Mm))}},{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(Im))}},{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(Dm);var o=n.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=sp.format(this.duration),this.find(".xg-cur").innerHTML=sp.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?sp.removeClass(this.find(".xg-seek-show"),"xg-back"):sp.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<iy)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}(Fv);function Fm(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){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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}function jm(e){e.preventDefault(),e.returnValue=!1}function Um(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}var Hm=function(e){fi(n,e);var t=Bm(n);function n(){var e;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(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||Um(n.target))||!e.checkCode(i,!0))&&(jm(n),e.handleKeyCode(i,t),!1)}})),yi(pi(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;jm(n),e.handleKeyCode(n.keyCode,t)}})),e}return Co(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,s=r.keyCode,a=r.disable;s!==e||a||("function"==typeof o?o(t,n.player):"string"==typeof o&&"function"==typeof n[o]&&n[o](t,n.player),n.emit(Jp,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fm(Object(n),!0).forEach((function(t){yi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({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}(Cv);function Gm(){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}function Vm(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Wm=function(e){fi(n,e);var t=Vm(n);function n(){return ui(this,n),t.apply(this,arguments)}return Co(n,[{key:"registerIcons",value:function(){return{loadingIcon:Gm}}},{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:Ov.ROOT}}}]),n}(Fv),Ym=En,Km=Zi.findIndex,zm=Po,Xm="findIndex",qm=!0;Xm in[]&&Array(1).findIndex((function(){qm=!1})),Ym({target:"Array",proto:!0,forced:qm},{findIndex:function(e){return Km(this,e,arguments.length>1?arguments[1]:void 0)}}),zm(Xm);var $m=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],Zm=function(){function e(t){ui(this,e),this.fragments=t.fragments||[],this.focusClass="inner-focus",this.style=t.style||{playedColor:"",cachedColor:"",progressColor:""},this.duration=0,this.cachedIndex=0,this.playedIndex=0}return Co(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=parseInt(1e3*e);var n=0,i=this.fragments;this.fragments=i.map((function(e){return e.start=n,e.end=n+e.percent*t.duration,e.duration=e.percent*t.duration,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,r=t.newIndex,o=t.curIndex,s=t.millisecond;r!==o&&n.map((function(t,n){n<r?t[e].style.width="100%":n>r&&(t[e].style.width=0)}));var a=i[r],c=0===s?0:(s-a.start)/a.duration;n[r][e].style.width=c<0?0:"".concat(100*c,"%")}},{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(t)}var n=this.playedIndex,i=this.cachedIndex;if("Undefined"!==sp.typeOf(e.played)){var r=this.findIndex(1e3*e.played,n);this.updateProgress("played",{newIndex:r,curIndex:n,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=r}if("Undefined"!==sp.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,i);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;return 1===n.length?0:(e>n[t].start&&e<n[t].end||this.fragments.map((function(n,i){e>n.start&&e<=n.end&&(t=i)})),t)}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(sp.hasClass(e[t],this.focusClass))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++)sp.removeClass(e[t],this.focusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return sp.addClass(t[e],this.focusClass),{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"render",value:function(){var e=this,t=this.style.progressColor;return this.root=sp.createDom("xg-inners","",{},"progress-list"),this.fragments&&(this.progressList=this.fragments.map((function(n){var i=sp.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(n.percent):"flex: ".concat(n.percent)},"".concat(n.isFocus?"inner-focus":""," xgplayer-progress-inner"));return e.root.appendChild(i),$m.map((function(t){i.appendChild(sp.createDom(t.tag,"",{style:t.styleKey?"background: ".concat(e.style[t.styleKey],"; width:0;"):"width:0;"},t.className))})),{cached:i.children[0],played:i.children[1]}}))),this.root}}]),e}();function Jm(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Qm=function(e){fi(n,e);var t=Jm(n);function n(e){var i;return ui(this,n),yi(pi(i=t.call(this,e)),"onMoveOnly",(function(e){var t=pi(i),n=t.pos,r=t.config,o=t.player;sp.event(e);var s=sp.getEventPos(e,o.zoom),a=90===o.rotateDeg?s.clientY:s.clientX;if(!(n.moving&&Math.abs(n.x-a)<r.miniMoveStep)){n.moving=!0,n.x=a;var c=i.computeTime(e);i.triggerCallbacks("dragmove",c,e)}})),yi(pi(i),"onBodyClick",(function(e){e.preventDefault(),e.stopPropagation()})),yi(pi(i),"_mouseDownHandler",(function(e,t){i._state.time=t.currentTime,i.updateWidth(t.currentTime,t.percent,0)})),yi(pi(i),"_mouseUpHandler",(function(e,t){pi(i).pos.moving&&i.updateWidth(t.currentTime,t.percent,2)})),yi(pi(i),"_mouseMoveHandler",(function(e,t){var n=pi(i),r=n._state,o=n.pos,s=n.config,a=n.player;r.time<t.currentTime?t.forward=!0:t.forward=!1,r.time=t.currentTime,o.isDown&&!o.moving&&(o.moving=!0,s.isPauseMoving&&a.pause(),i.triggerCallbacks("dragstart",t,e)),i.updateWidth(t.currentTime,t.percent,1),i.triggerCallbacks("dragmove",t,e)})),yi(pi(i),"onMouseDown",(function(e){var t=pi(i),n=t.player,r=t.pos,o=t.config,s=t.playerConfig,a=sp.getEventPos(e,n.zoom),c=90===n.rotateDeg?a.clientY:a.clientX;if(!(n.isMini||o.closeMoveSeek||!s.allowSeekAfterEnded&&n.ended)){e.stopPropagation(),i.focus(),sp.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),sp.checkIsFunction(o.onMoveStart)&&o.onMoveStart(),sp.event(e),r.x=c,r.isDown=!0,r.moving=!1,n.focus({autoHide:!1}),i.isProgressMoving=!0,sp.addClass(i.progressBtn,"active");var l=i.computeTime(e);return i._mouseDownHandlerHook(e,l),"touch"===i.domEventType?(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),n.root.addEventListener("click",i.onBodyClick,!1)),!0}})),yi(pi(i),"onMouseUp",(function(e){var t=pi(i),n=t.player,r=t.config,o=t.pos,s=t.playerConfig,a=t._state;e.stopPropagation(),e.preventDefault(),sp.checkIsFunction(s.enableSwipeHandler)&&s.enableSwipeHandler(),sp.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),sp.event(e),sp.removeClass(i.progressBtn,"active");var c=i.computeTime(e);o.moving?i.triggerCallbacks("dragend",c,e):i.triggerCallbacks("click",c,e),i._mouseUpHandlerHook(e,c),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,a.time=0,"touch"===i.domEventType?(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),n.root.removeEventListener("click",i.onBodyClick,!1),o.isEnter?!s.isMobileSimulateMode&&i.bind("mousemove",i.onMoveOnly):i.onMouseLeave(e)),sp.setTimeout(pi(i),(function(){i.resetSeekState()}),10),n.focus()})),yi(pi(i),"onMouseMove",(function(e){var t=pi(i),n=t.pos,r=t.player,o=t.config;sp.checkTouchSupport()&&e.preventDefault(),sp.event(e);var s=sp.getEventPos(e,r.zoom),a=90===r.rotateDeg?s.clientY:s.clientX,c=Math.abs(n.x-a);if(!(n.moving&&c<o.miniMoveStep||!n.moving&&c<o.miniStartStep)){n.x=a;var l=i.computeTime(e);i._mouseMoveHandlerHook(e,l)}})),yi(pi(i),"onMouseOut",(function(e){i.triggerCallbacks("mouseout",null,e)})),yi(pi(i),"onMouseOver",(function(e){i.triggerCallbacks("mouseover",null,e)})),yi(pi(i),"onMouseEnter",(function(e){var t=pi(i),n=t.player,r=t.pos;i.triggerCallbacks("mouseenter",null,e),r.isDown||r.isEnter||n.isMini||!n.config.allowSeekAfterEnded&&n.ended||(r.isEnter=!0,i.bind("mousemove",i.onMoveOnly),i.bind("mouseleave",i.onMouseLeave),i.focus())})),yi(pi(i),"onMouseLeave",(function(e){i.triggerCallbacks("mouseleave",null,e);var t=pi(i),n=t.player,r=t.pos;r.isEnter=!1,n.isMini||(i.unbind("mousemove",i.onMoveOnly),r.isDown?i.unbind("mouseleave",i.onMouseLeave):i.blur())})),i.useable=!1,i.isProgressMoving=!1,i.__dragCallBacks=[],i._state={now:-1,direc:0,time:0},i._disableBlur=!1,i}return Co(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:"createInner",value:function(){var e=this;this.innerList=new Zm({fragments:this.config.fragments,style:this.playerConfig.commonStyle||{}}),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:"afterCreate",value:function(){var e=this;this.config.disable||this.playerConfig.isLive||(this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1},this.outer=this.find("xg-outer"),this.createInner(),"mobile"===hp.device&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(Cp,(function(){e.onTimeupdate()})),this.on(wp,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(Rp,(function(){e.onCacheUpdate()})),this.on(yp,(function(){e.onCacheUpdate(),e._state.now=0})),this.on(Ap,(function(){e.onReset()})),this.bindDomEvents(),this.initCustomStyle())}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===di(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(e){console.error("[XGPLAYER][triggerCallbacks] ".concat(i," error"),e)}}))}},{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:"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?(this.root.addEventListener("touchstart",this.onMouseDown),t&&(t.root&&t.root.addEventListener("touchmove",sp.stopPropagation),t.center&&t.center.addEventListener("touchend",sp.stopPropagation))):(this.bind("mousedown",this.onMouseDown),!n.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut))}},{key:"focus",value:function(){sp.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),sp.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-.2:Number(e).toFixed(1);this.updatePercent(t),this.updateTime(e),(1!==n||i.isDragingSeek&&"audio"!==r.videoConfig.mediaType)&&(this._state.now=o,this._state.direc=o>r.currentTime?0:1,r.seek(o))}}},{key:"computeTime",value:function(e){var t,n,i,r=this.player,o=this.root.getBoundingClientRect(),s=o.width,a=o.height,c=o.top,l=o.left,u=sp.getEventPos(e,r.zoom);90===r.rotateDeg?(t=a,n=c,i=u.clientY):(t=s,n=l,i=u.clientX);var h=i-n,f=(h=h>t?t:h<0?0:h)/t;return{percent:f=f<0?0:f>1?1:f,currentTime:parseInt(f*this.duration*1e3,10)/1e3,offset:h,width:t,left:n,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(){var e=this.player,t=this._state,n=this.duration;if(!(e.isSeeking||this.isProgressMoving||e.state<oy)){if(t.now>-1){var i=parseInt(1e3*t.now,10)-parseInt(1e3*e.currentTime,10);if(0===t.direc&&i>300||1===t.direc&&i>-300)return void(t.now=-1);t.now=-1}var r=this.timeOffset+e.currentTime;this.innerList.update({played:r},n),this.progressBtn.style.left="".concat(r/n*100,"%");var o=this.player.plugins.miniprogress;o&&o.update({played:r},n)}}},{key:"onCacheUpdate",value:function(){var e=this.player,t=this.duration,n=e.bufferedPoint;this.innerList.update({cached:n.end},t);var i=this.player.plugins.miniprogress;i&&i.update({cached:n.end},t)}},{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,"touch"===this.domEventType?(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",sp.stopPropagation),t.center&&t.center.removeEventListener("touchend",sp.stopPropagation))):(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,!1))}},{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:Ov.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){}}}}]),n}(Fv);function ek(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var tk=function(e){fi(n,e);var t=ek(n);function n(){return ui(this,n),t.apply(this,arguments)}return Co(n,[{key:"afterCreate",value:function(){var e=this,t=this.player;this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.on(mp,(function(){e.animate(t.paused)})),this.on(vp,(function(){e.animate(t.paused)})),this.animate(!0))}},{key:"registerIcons",value:function(){return{play:{icon:Ly,class:"xg-icon-play"},pause:{icon:Iy,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){var t=this.i18nKeys;e?(this.setAttr("data-state","pause"),this.changeLangTextKey(this.find(".xg-tips"),t.PLAY_TIPS)):(this.setAttr("data-state","play"),this.changeLangTextKey(this.find(".xg-tips"),t.PAUSE_TIPS))}},{key:"destroy",value:function(){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 <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PLAY_TIPS,'">').concat(this.i18n.PLAY_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:Ov.CONTROLS_LEFT,index:0,disable:!1}}}]),n}(Fv);function nk(){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}function ik(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var rk=function(e){fi(n,e);var t=ik(n);function n(){return ui(this,n),t.apply(this,arguments)}return Co(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:nk,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){sp.addClass(this.root,"show")}},{key:"hide",value:function(){sp.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:Ov.ROOT_TOP,index:0}}}]),n}(Fv);function ok(){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 sk(){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}function ak(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var ck=function(e){fi(n,e);var t=ak(n);function n(){var e;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(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 Co(n,[{key:"afterCreate",value:function(){var e=this,t=this.config,n=this.playerConfig;if(!t.disable){t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var i=sp.getFullScreenEl();n.fullscreenTarget===i&&this.player.getFullscreen(),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(Gp,(function(t){e.changeLangTextKey(e.find(".xg-tips"),t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t)})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:rk,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===hp.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:ok,class:"xg-get-fullscreen"},exitFullscreen:{icon:sk,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){this.unbind(".xgplayer-icon","mobile"===hp.device?"touchend":"click",this.handleFullscreen),"mobile"===hp.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()}},{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(){xo(gi(n.prototype),"show",this).call(this)}},{key:"hide",value:function(){xo(gi(n.prototype),"hide",this).call(this)}},{key:"render",value:function(){if(!this.config.disable){var e="FULLSCREEN_TIPS";return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</div>\n </xg-icon>")}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:Ov.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),n}(Fv);function lk(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var uk=function(e){fi(n,e);var t=lk(n);function n(e){var i;return ui(this,n),(i=t.call(this,e)).isActiving=!1,i}return Co(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.hide()),this.durationDom=this.find(".time-duration"),this.timeDom=this.find(".time-current"),this.on(Ep,(function(){e.onTimeUpdate()})),this.on(Cp,(function(){e.onTimeUpdate()})),this.on(Ap,(function(){e.onReset()})))}},{key:"show",value:function(){"flex"!==this.mode&&xo(gi(n.prototype),"show",this).call(this)}},{key:"onTimeUpdate",value:function(){var e=this.player;if(!(this.config.disable||this.isActiving||e.state<oy&&e.state!==iy)){var t=this.currentTime+this.timeOffset;"flex"===this.mode?(this.centerCurDom.innerHTML=sp.format(t),this.duration!==1/0&&this.duration>0&&(this.centerDurDom.innerHTML=sp.format(this.duration))):(this.timeDom.innerHTML=sp.format(t),this.duration!==1/0&&this.duration>0&&(this.durationDom.innerHTML=sp.format(this.duration)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=sp.format(0),this.centerDurDom.innerHTML=sp.format(0)):(this.timeDom.innerHTML=sp.format(0),this.durationDom.innerHTML=sp.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=sp.createDom("xg-icon","00:00",{},"xgplayer-time left"),this.centerDurDom=sp.createDom("xg-icon","00:00",{},"xgplayer-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?(sp.hide(this.durationDom),sp.hide(this.timeDom),sp.hide(this.find(".time-separator")),sp.show(this.find(".time-live-tag"))):sp.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(sp.hide(this.durationDom),sp.hide(this.timeDom),sp.hide(this.find(".time-separator")),sp.show(this.find(".time-live-tag"))):(sp.hide(this.find(".time-live-tag")),sp.show(this.find(".time-separator")),sp.show(this.durationDom),sp.show(this.timeDom))}},{key:"updateTime",value:function(e){this.isActiving=!0,!e&&0!==e||e>this.duration||("flex"!==this.mode?this.timeDom.innerHTML=sp.format(e):this.centerCurDom.innerHTML=sp.format(e))}},{key:"resetActive",value:function(){var e=this,t=this.player,n=function(){e.isActiving=!1};this.off(wp,n),t.isSeeking?this.once(wp,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:Ov.CONTROLS_LEFT,index:2,disable:!1}}}]),n}(Fv);function hk(){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 fk(){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 dk(){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}function pk(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var vk=function(e){fi(n,e);var t=pk(n);function n(){var e;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var n=pi(e).player,i=e.find(".xgplayer-slider"),r=e.find(".xgplayer-bar");i.focus(),sp.event(t);var o=r.getBoundingClientRect(),s=sp.getEventPos(t,n.zoom),a=o.height-(s.clientY-o.top);if(s.h=a,s.barH=o.height,e.pos=s,!(a<-2))return e.updateVolumePos(a,t),document.addEventListener("mouseup",e.onBarMouseUp),e.isStart=!0,!1})),yi(pi(e),"onBarMouseMove",(function(t){if(e.isStart){var n=pi(e),i=n.pos,r=n.player;t.preventDefault(),t.stopPropagation(),sp.event(t);var o=sp.getEventPos(t,r.zoom);e.isMoving=!0;var s=i.h-o.clientY+i.clientY;s>i.barH||e.updateVolumePos(s,t)}})),yi(pi(e),"onBarMouseUp",(function(t){sp.event(t),document.removeEventListener("mouseup",e.onBarMouseUp),e.isStart=!1,e.isMoving=!1})),yi(pi(e),"onMouseenter",(function(t){e._timerId&&(sp.clearTimeout(pi(e),e._timerId),e._timerId=null),sp.addClass(e.root,"slide-show")})),yi(pi(e),"onMouseleave",(function(t){e._timerId&&(sp.clearTimeout(pi(e),e._timerId),e._timerId=null),e._timerId=sp.setTimeout(pi(e),(function(){sp.removeClass(e.root,"slide-show"),e.isStart&&e.onBarMouseUp(t),e._timerId=null}),200)})),yi(pi(e),"onVolumeChange",(function(t){if(e.player){var n=e.player,i=n.muted,r=n.volume;e.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 Co(n,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:fk,class:"xg-volume-small"},volumeLarge:{icon:hk,class:"xg-volume"},volumeMuted:{icon:dk,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;if(this._timerId=null,!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()}}),"mobile"===hp.device||this.playerConfig.isMobileSimulateMode||(this.bind("mouseenter",this.onMouseenter),this.bind(["blur","mouseleave"],this.onMouseleave),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(Tp,this.onVolumeChange),this.once(Sp,this.onVolumeChange),"Number"!==sp.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 s=Math.max(Math.min(o/1e3,1),0),a={volume:{from:n.volume,to:s}};n.muted&&(a.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:n.muted,volume:n.volume,props:a}),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:"changeMuted",value:function(e){e&&e.stopPropagation();var t=this.player;this.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.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"===hp.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:Ov.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),n}(Fv);function gk(){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}function yk(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var mk=function(e){fi(n,e);var t=yk(n);function n(e){var i;return ui(this,n),(i=t.call(this,e)).rotateDeg=i.config.rotateDeg||0,i}return Co(n,[{key:"afterCreate",value:function(){var e=this;this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.rotate),this.onBtnClick=this.onBtnClick.bind(this),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(zp,(function(){e.rotateDeg&&sp.setTimeout(e,(function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)}),100)})),this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate))}},{key:"destroy",value:function(){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,s=i.video,a=r.offsetWidth,c=o&&t?o.offsetHeight:r.offsetHeight,l="100%",u="100%",h=0,f=0;.75!==e&&.25!==e||(l="".concat(c,"px"),u="".concat(a,"px"),h=-(c-a)/2,f=-(a-c)/2);var d="translate(".concat(h,"px,").concat(f,"px) rotate(").concat(e,"turn)"),p={transformOrigin:"center center",transform:d,webKitTransform:d,height:u,width:l},v=t?s:r,g=t?n.getPlugin("poster"):null;Object.keys(p).map((function(e){v.style[e]=p[e],g&&g.root&&(g.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(qp,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:gk}}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.ROTATE_TIPS,'">\n ').concat(this.i18n.ROTATE_TIPS,"\n </div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:Ov.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),n}(Fv);function kk(){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 bk(){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}function wk(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Ck="picture-in-picture",xk="inline",_k="fullscreen",Ek=function(e){fi(n,e);var t=wk(n);function n(){var e;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(e=t.call.apply(t,[this].concat(r))),"switchPIP",(function(t){if(!e.isPIPAvailable())return!1;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.video.readyState&&(e.requestPIP(),e.emitUserAction(t,"change_pip",{props:"pip",from:!1,to:!0}),e.setAttr("data-state","pip"))})),e}return Co(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()&&(this.pMode=xk,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(Bp,(function(){e.config.showIcon&&(sp.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:kk,class:"xg-get-pip"},pipIconExit:{icon:bk,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;sp.setTimeout(e,(function(){!n&&t.videoPlay()}),0),!n&&t.videoPlay(),e.setAttr("data-state","normal"),t.emit(Xp,!1)},this.enterPIPCallback=function(n){t.emit(Xp,!0),e.pipWindow=n.pictureInPictureWindow,e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(n){var i=t.video.webkitPresentationMode;e.pMode===_k&&i!==_k&&t.onFullscreenChange(null,!1),e.pMode=i,i===Ck?e.enterPIPCallback(n):i===xk&&e.leavePIPCallback(n)},t.video&&(t.video.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.video.addEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(t.video)&&t.video.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.video.poster="String"===sp.typeOf(i)?i:i.poster),n.checkWebkitSetPresentationMode(e.video)?e.video.webkitSetPresentationMode("picture-in-picture"):e.video.requestPictureInPicture(),!0}catch(e){return console.error("requestPiP",e),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{return this.isPIPAvailable()&&this.isPip&&(n.checkWebkitSetPresentationMode(e.video)?e.video.webkitSetPresentationMode("inline"):document.exitPictureInPicture()),!0}catch(e){return console.error("exitPIP",e),!1}}},{key:"isPip",get:function(){var e=this.player;return document.pictureInPictureElement&&document.pictureInPictureElement===e.video||e.video.webkitPresentationMode===Ck}},{key:"isPIPAvailable",value:function(){var e=this.player.video;return("Boolean"!==sp.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===sp.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===sp.typeOf(e.webkitSetPresentationMode))}},{key:"destroy",value:function(){var e=this.player;e.video.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.video.removeEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(e.video)&&e.video.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 <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PIP,'">').concat(this.i18n.PIP,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:Ov.CONTROLS_RIGHT,index:6,showIcon:!1}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}]),n}(Fv);function Tk(){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}function Sk(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Pk=function(e){fi(n,e);var t=Sk(n);function n(e){var i;return ui(this,n),yi(pi(i=t.call(this,e)),"playNext",(function(e){var t=pi(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(Zp,i.idx+1)):(i.nextHandler(),t.emit(Zp))})),i.idx=-1,i}return Co(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:Tk}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("nextClick",this.changeSrc);var e="mobile"===hp.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 <div class="xg-tips" lang-key="PLAYNEXT_TIPS">'.concat(this.i18n.PLAYNEXT_TIPS,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:Ov.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),n}(Fv),Rk={exports:{}};!function(e,t){e.exports=function e(t,n,i){var r,o,s=window,a="application/octet-stream",c=i||a,l=t,u=!n&&!i&&l,h=document.createElement("a"),f=function(e){return String(e)},d=s.Blob||s.MozBlob||s.WebKitBlob||f,p=n||"download";if(d=d.call?d.bind(s):Blob,"true"===String(this)&&(c=(l=[l,c])[0],l=l[1]),u&&u.length<2048&&(p=u.split("/").pop().split("?")[0],h.href=u,-1!==h.href.indexOf(u))){var v=new XMLHttpRequest;return v.open("GET",u,!0),v.responseType="blob",v.onload=function(t){e(t.target.response,p,a)},setTimeout((function(){v.send()}),0),v}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(l)){if(!(l.length>2096103.424&&d!==f))return navigator.msSaveBlob?navigator.msSaveBlob(k(l),p):b(l);c=(l=k(l)).type||a}else if(/([\x80-\xff])/.test(l)){for(var g=0,y=new Uint8Array(l.length),m=y.length;g<m;++g)y[g]=l.charCodeAt(g);l=new d([y],{type:c})}function k(e){for(var t=e.split(/[:;,]/),n=t[1],i=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),r=i.length,o=0,s=new Uint8Array(r);o<r;++o)s[o]=i.charCodeAt(o);return new d([s],{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(){s.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\/\-\+]+)/,a)),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\/\-\+]+)/,a)),n.src=e,setTimeout((function(){document.body.removeChild(n)}),333)}if(r=l instanceof d?l:new d([l],{type:c}),navigator.msSaveBlob)return navigator.msSaveBlob(r,p);if(s.URL)b(s.URL.createObjectURL(r),!0);else{if("string"==typeof r||r.constructor===f)try{return b("data:"+c+";base64,"+s.btoa(r))}catch(e){return b("data:"+c+","+encodeURIComponent(r))}(o=new FileReader).onload=function(e){b(this.result)},o.readAsDataURL(r)}return!0}}(Rk);var Ok=Rk.exports;function Ak(){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}function Lk(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Ik=function(e){fi(n,e);var t=Lk(n);function n(e){var i;return ui(this,n),yi(pi(i=t.call(this,e)),"download",(function(e){if(!i.isLock){i.emitUserAction(e,"download");var t=i.getAbsoluteURL(i.player.src);Ok(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 Co(n,[{key:"afterCreate",value:function(){this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.download),this.bind(["click","touchend"],this.download))}},{key:"registerIcons",value:function(){return{download:Ak}}},{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(){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 <div class="xg-tips" lang-key="'.concat(this.i18nKeys.DOWNLOAD_TIPS,'">').concat(this.i18n.DOWNLOAD_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:Ov.CONTROLS_RIGHT,index:3,disable:!0}}}]),n}(Fv);function Dk(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Mk=function(e){fi(n,e);var t=Dk(n);function n(){return ui(this,n),t.apply(this,arguments)}return Co(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){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(zp,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:"createCanvans",value:function(e,t){var n=document.createElement("canvas");this.canvasCtx=n.getContext("2d"),this.canvas=n,n.width=e||this.config.width,n.height=t||this.config.height}},{key:"onClickBtn",value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot"),this.shot().then((function(e){t.emit($p,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,s=i.quality||r.quality,a=i.type||r.type;return new Promise((function(i,c){n.canvas?(n.canvas.width=e||r.width,n.canvas.height=t||r.height):n.createCanvans(e,t),n.canvasCtx.drawImage(o.video,0,0,e||r.width,t||r.height);var l=n.canvas.toDataURL(a,s).replace(a,"image/octet-stream");i(l=l.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.onClickBtn),this.off(zp,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:Ov.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,fitVideo:!0,disable:!1,name:"screenshot"}}}]),n}(Fv),Nk=function(){function e(t){ui(this,e),this.config=t.config,this.parent=t.root,this.root=sp.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"===hp.device?"touchend":"click";this._delegates=Fv.delegate.call(this,this.root,"li",n,this.onItemClick)}return Co(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(sp.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&&sp.hasClass(t,"selected"))return!1;var n="function"==typeof this.config.onItemClick?this.config.onItemClick:null,i=this.root.querySelector(".selected");sp.addClass(t,"selected"),i&&sp.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(){sp.removeClass(this.root,"hide"),sp.addClass(this.root,"active")}},{key:"hide",value:function(){sp.removeClass(this.root,"active"),sp.addClass(this.root,"hide")}},{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}();function Fk(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Bk="mobile"===hp.device,jk=function(e){fi(n,e);var t=Fk(n);function n(e){var i;return ui(this,n),(i=t.call(this,e)).isActive=!1,i.curValue=null,i.curIndex=0,i}return Co(n,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;Bk&&"middle"!==t.listType&&(t.listType="rightSide"),t.hidePortrait&&sp.addClass(this.root,"portrait"),this.once(_p,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),Bk&&this.on(Lp,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),this.activeEvent=Bk?"touchend":"mouseenter",this.onEnter=this.onEnter.bind(this),this.onLeave=this.onLeave.bind(this),this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave)}},{key:"show",value:function(){!this.config.list||this.config.list.length<2||sp.addClass(this.root,"show")}},{key:"hide",value:function(){sp.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,n){if(void 0===e)return"";var i=this.config.list;return!n&&(n=this.player.lang),t=!t||sp.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=i[e]),"object"===di(e[t])?e[t][n]||e[t].zh:e[t]||""}},{key:"onEnter",value:function(e){e.preventDefault(),e.stopPropagation(),this.onToggle(!0)}},{key:"onLeave",value:function(e){e.preventDefault(),e.stopPropagation(),this.isActive&&this.onToggle(!1)}},{key:"onToggle",value:function(e){if(this.isActive!==e){var t=this.player.controls,n=this.config.listType;e?("rightSide"===n?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):("rightSide"===n?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;(Bk||"rightSide"===i)&&this.onToggle(!1),this.curIndex=t.to.index,this.curItem=r[this.curIndex],this.changeCurrentText(),this.onToggle(!1)}},{key:"changeCurrentText",value:function(){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 s={config:{data:e||[],className:"rightSide"===i.listType?"right-side":"",onItemClick:function(e,t){n.onItemClick(e,t)}},root:"rightSide"===i.listType?o.root:this.root};this.config.isShowIcon&&(this.optionsList=new Nk(s),this.changeCurrentText(),this.show())}},{key:"destroy",value:function(){this.unbind(this.activeEvent,this.onToggle),this.unbind("mouseleave",this.onToggle),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 btn-text">\n <span class="icon-text"></span>\n </div>\n </xg-icon>')}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:Ov.CONTROLS_RIGHT,index:100,list:[],listType:"middle",listStyle:{},hidePortrait:!0,isShowIcon:!1}}}]),n}(Fv);function Uk(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Hk=function(e){fi(n,e);var t=Uk(n);function n(e){var i;return ui(this,n),(i=t.call(this,e)).curTime=0,i.isPaused=!0,i}return Co(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;xo(gi(n.prototype),"afterCreate",this).call(this),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(Yp,(function(t){e.renderItemList(e.config.list,t.to)})),this.player.definitionList.length<2&&this.hide()}},{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,s=t.map((function(t,n){var i={url:t.url,definition:t.definition||"",showText:e.getTextByLang(t)||t.definition,selected:!1};return(t.selected||t.definition&&t.definition===r)&&(i.selected=!0,o=n),i}));xo(gi(n.prototype),"renderItemList",this).call(this,s,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){xo(gi(n.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to}),this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return{position:Ov.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0}}}]),n}(jk);function Gk(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Vk=function(e){fi(n,e);var t=Gk(n);function n(e){var i;return ui(this,n),(i=t.call(this,e)).curRate=1,i}return Co(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;xo(gi(n.prototype),"afterCreate",this).call(this),this.on(Pp,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(){this.config.list&&0!==this.config.list.length&&xo(gi(n.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){xo(gi(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=0,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}));xo(gi(n.prototype),"renderItemList",this).call(this,r,i)}},{key:"destroy",value:function(){xo(gi(n.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return{position:Ov.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1}}}]),n}(jk);function Wk(){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 Yk(){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}function Kk(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var zk=function(e){fi(n,e);var t=Kk(n);function n(){return ui(this,n),t.apply(this,arguments)}return Co(n,[{key:"afterCreate",value:function(){var e=this;this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(Vp,(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;this.changeLangTextKey(this.find(".xg-tips"),e?t.EXITCSSFULLSCREEN_TIPS:t.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:Wk,class:"xg-get-cssfull"},exitCssFullscreen:{icon:Yk,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){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 <div class="xg-tips" lang-key="'.concat(this.i18nKeys.EXITCSSFULLSCREEN_TIPS,'">').concat(this.i18n.CSSFULLSCREEN_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:Ov.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),n}(Fv);function Xk(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var qk=function(e){fi(n,e);var t=Xk(n);function n(){return ui(this,n),t.apply(this,arguments)}return Co(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(_p,(function(){e.handleCanPlay()})),this.on(kp,(function(t){e.onError(t)}))}},{key:"errorRetry",value:function(e){this.emitUserAction(e,"error_retry",{}),this.player.retry()}},{key:"handleCanPlay",value:function(){sp.removeClass(this.player.root,"xgplayer-is-error")}},{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}(Fv);function $k(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Zk=function(e){fi(n,e);var t=$k(n);function n(){return ui(this,n),t.apply(this,arguments)}return Co(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),sp.addClass(this.root,"show"),"arrow"===n.mode&&sp.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 s=n.interval||r;this.intervalId=setTimeout((function(){t.hide()}),s)}}}},{key:"hide",value:function(){sp.removeClass(this.root,"show"),sp.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(Jg.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}(Fv),Jk={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function Qk(e){Object.keys(Jk).map((function(t){void 0===e[t]&&(e[t]=Jk[t])}))}var eb={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&&(Qk(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 s=sp.createDom("xg-spot",e.template||"",{"data-text":e.text,"data-time":e.time,"data-id":e.id},o);Object.keys(r).map((function(e){s.style[e]=r[e]})),n.outer&&n.outer.appendChild(s)}},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,'"]'));if(r){var o=this.calcuPosition(e.time,e.duration),s=e.style||{};s.left="".concat(o.left,"%"),s.width="".concat(o.width,"%"),r.setAttribute("data-text",e.text),r.setAttribute("data-time",e.time),o.isMini?sp.addClass(r,"mini"):sp.removeClass(r,"mini"),Object.keys(s).map((function(e){r.style[e]=s[e]})),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 s=n.find('xg-spot[data-id="'.concat(e,'"]'));s&&s.parentElement.removeChild(s)}}},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.map((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},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,'"]'))}};function tb(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var nb={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver"},ib=function(e){fi(n,e);var t=tb(n);function n(e){var i;return ui(this,n),yi(pi(i=t.call(this,e)),"onMousemove",(function(e){(i._state.f||sp.hasClass(e.target,"xg-spot-content"))&&(sp.event(e),e.stopPropagation())})),yi(pi(i),"onMousedown",(function(e){(i._state.f||sp.hasClass(e.target,"xg-spot-content"))&&(sp.event(e),e.stopPropagation())})),yi(pi(i),"onDotMouseLeave",(function(e){i._curDot.removeEventListener("mouseleave",i.onDotMouseLeave),i.blurDot(e.target),i._curDot=null;var t=i.player.plugins.progress;t&&t.enableBlur(),i.show()})),yi(pi(i),"onProgressMouseOver",(function(e,t){if(sp.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._state={now:0,f:!1},i}return Co(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.time&&e.player.seek(n.time)})),function(e){var t=e.config,n=e.player;Object.keys(eb).map((function(t){e[t]=eb[t].bind(e)}));var i=n.config.progressDot||t.ispots||[];e._ispots=i.map((function(e){return Qk(e),e})),e._ispotsInit=!1,n.once(Ep,(function(){e.initDots()}))}(this)}},{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(nb).map((function(n){e[nb[n]]=e[nb[n]].bind(e),t.addCallBack(n,e[nb[n]])})),"mobile"!==hp.device)){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown);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.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragStart",value:function(e){console.log("onProgressDragStart"),this.isDrag=!0,this.videoPreview&&sp.addClass(this.videoPreview,"show")}},{key:"onProgressDragEnd",value:function(e){this.isDrag=!1,this.videoPreview&&sp.removeClass(this.videoPreview,"show")}},{key:"onProgressClick",value:function(e,t){if(sp.hasClass(t.target,"xgplayer-spot")){t.stopPropagation(),t.preventDefault();var n={};["time","id","text"].map((function(e){n[e]=t.target.getAttribute("data-".concat(e))})),n.time&&(n.time=Number(n.time)),this.handlerSpotClick(t,n)}}},{key:"updateLinePos",value:function(e,t){var n,i,r=this.root,o=this.previewLine,s=this.timePoint,a="flex"===this.player.controls.mode,c=r.getBoundingClientRect().width,l=s.getBoundingClientRect().width,u=e-c/2;u<0&&!a?(u=0,n=e-c/2,!this.thumbnail&&(i=e-c/2-l/2)):u>t-c&&!a?(n=u-(t-c),!this.thumbnail&&(i=u-(t-c)-l/2),u=t-c):!this.thumbnail&&(i=-l/2),o.style.transform=void 0!==n?"translateX(".concat(n,"px)"):"",s.style.transform=void 0!==i?"translateX(".concat(i,"px)"):"",r.style.transform="translateX(".concat(u,"px)")}},{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,s=this._state;if(r){this.updateLinePos(e,t),s.now=n;var a=sp.format(n);i&&i.target&&sp.hasClass(i.target,"xgplayer-spot")?(this.showTips(i.target.getAttribute("data-text"),!1,a),this.focusDot(i.target),s.f=!0,o.isFocusDots&&s.f&&(s.now=parseInt(i.target.getAttribute("data-time"),10))):o.defaultText?(s.f=!1,this.showTips(o.defaultText,!0,a)):(s.f=!1,this.hideTips("")),this.updateTimeText(a),this.updateThumbnails(s.now)}}},{key:"updateThumbnails",value:function(e){var t=this.player,n=this.videoPreview,i=t.plugins.thumbnail;if(i&&i.usable){this.thumbnail&&i.update(this.thumbnail,e,160,90);var r=n&&n.getBoundingClientRect();this.videothumbnail&&i.update(this.videothumbnail,e,r.width,r.height)}}},{key:"changeThumbnail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==hp.device){var t=this.player,n=this.config,i=t.getPlugin("thumbnail");if(i.changeConfig(e),i&&i.usable&&n.isShowThumbnail){sp.removeClass(this.root,"short-line no-thumbnail"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.thumbnail&&r.removeChild(this.thumbnail),this.thumbnail=i.createThumbnail(r,"progress-thumbnail"),n.isShowCoverPreview&&(this.videoPreview=sp.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=i.createThumbnail(this.videoPreview,"xgvideo-thumbnail"))}else{sp.addClass(this.root,"short-line no-thumbnail");var o=this.find(".xg-spot-thumbnail");this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.thumbnail&&o.removeChild(this.thumbnail),this.videothumbnail=null,this.thumbnail=null,this._hasThumnail=!1}}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==hp.device){var t=this.player,n=this.config,i=t.getPlugin("thumbnail");if(i&&Object.keys(e).map((function(t){i.config[t]=e[t]})),i&&i.usable&&n.isShowThumbnail){sp.removeClass(this.root,"short-line no-thumbnail"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.thumbnail=i.createThumbnail(r,"progress-thumbnail"),n.isShowCoverPreview&&(this.videoPreview=sp.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=i.createThumbnail(this.videoPreview,"xgvideo-thumbnail"))}else sp.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")),sp.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(sp.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";sp.addClass(this.root,"no-timepoint"),e&&(sp.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(sp.addClass(this.root,"product"),this.tipText.textContent=e):(sp.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(n," ").concat(e)))}},{key:"hideTips",value:function(){sp.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",sp.removeClass(this.find(".xg-spot-content"),"show-text"),sp.removeClass(this.root,"product")}},{key:"hide",value:function(){sp.addClass(this.root,"hide")}},{key:"show",value:function(){sp.removeClass(this.root,"hide")}},{key:"destroy",value:function(){var e=this,t=this.player.plugins.progress;t&&Object.keys(nb).map((function(n){t.removeCallBack(n,e[nb[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-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return"mobile"===hp.device||this.playerConfig.isMobileSimulateMode?"":'<div class="xg-spot-info '.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-line"></div>\n </div>')}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:""}}}]),n}(Fv);function rb(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var ob=function(e){fi(n,e);var t=rb(n);function n(e){var i;return ui(this,n),(i=t.call(this,e)).ratio=1,i.interval=-1,i.preloadMark={},i}return Co(n,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([Ep],(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:"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>0?r:Math.round(1e3*this.player.duration/i)/1e3,this.preload(0)}},{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,n=this.config.urls,i=n.length;[e-1,e,e+1,e+2].map((function(e){!t.preloadMark[e]&&e>=0&&e<i&&(sp.preloadImg(n[e]),t.preloadMark[e]=!0)}))}},{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,s=i.col,a=i.width,c=i.height,l=Math.ceil(e/this.interval),u=(l=l>r?r:l)<o*s?0:Math.ceil(l/(o*s))-1,h=l-u*(s*o),f=h>0?Math.ceil(h/s)-1:0,d=h>0?h-f*s-1:0,p=0,v=0;if(t&&n){var g=t/n;g<a/c?v=(p=t)/(a/c):p=(v=n)*(a/c)}else v=(p=t||a)/(a/c);var y=this.getUrlByIndex(u);return{urlIndex:u,rowIndex:f,colIndex:d,url:y,height:v,width:p,style:{backgroundImage:"url(".concat(y,")"),backgroundSize:"".concat(p*s,"px auto"),backgroundPosition:"-".concat(d*p,"px -").concat(f*v,"px"),width:"".concat(p,"px"),height:"".concat(v,"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,s=o.pic_num,a=o.urls;if(!(s<1)&&a&&0!==a.length){var c=this.getPosition(t,n,i);this.preload(c.urlIndex),Object.keys(c.style).map((function(t){e.style[t]=c.style[t]})),Object.keys(r).map((function(t){e.style[t]=r[t]}))}}},{key:"changeConfig",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.keys(t).forEach((function(n){void 0!==e.config[n]&&(e.config[n]=t[n])})),this.usable&&this.initThumbnail()}},{key:"createThumbnail",value:function(e,t){var n=sp.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,width:160,height:90,scale:1,className:"",hidePortrait:!1}}}]),n}(Fv);function sb(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var ab=function(e){fi(n,e);var t=sb(n);function n(){return ui(this,n),t.apply(this,arguments)}return Co(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}(Fv);function cb(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var lb="realtime",ub="firstframe";function hb(){try{return window.performance.now()}catch(e){return(new Date).getTime()}}function fb(e){return"safari"!==hp.browser||!/^blob/.test(e.currentSrc)&&!/^blob/.test(e.src)}var db=null,pb=function(e){fi(n,e);var t=cb(n);function n(){var e;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(e=t.call.apply(t,[this].concat(r))),"onLoadedData",(function(){if(e.player){var t=e.player.video;e.videoPI=parseInt(t.videoWidth/t.videoHeight*100,10)}})),yi(pi(e),"start",(function(){var t=e.player.video,n=hb();fb(t)&&e.canvasCtx&&(e.stop(),(e.config.mode===lb||n-e.preTime>=e.interval)&&(t&&t.videoWidth&&e.update(t,t.videoWidth,t.videoHeight),e.preTime=n),e.frameId=window.setTimeout((function(){e.start()}),e.interval))})),yi(pi(e),"stop",(function(){e.frameId&&(window.clearTimeout(e.frameId),e.frameId=null)})),e}return Co(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;i||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0},this.isStart=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/this.config.frameRate,10),this.canvas=null,this.canvasCtx=null,this.once(Bp,(function(){e.player&&(e.init(),!e.player.paused&&e.start())})),this.once(Sp,this.onLoadedData),this.on(Hp,(function(){e.once(Sp,e.onLoadedData)})),r!==ub&&(this.on(vp,(function(){e.start()})),this.on(mp,(function(){e.stop()}))),r===ub&&this.once(Cp,(function(){var t=e.player.video;t&&fb(t)&&t.videoWidth&&e.update(t,t.videoWidth,t.videoHeight)})))}},{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");var r=this.playerConfig.poster;if(r){var o="String"===sp.typeOf(r)?r:"String"===sp.typeOf(r.poster)?r.poster:null;this.updateImg(o)}}catch(e){np.logError("plugin:DynamicBg",e)}}},{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(){t.canvas&&(t.canvas.height=r,t.canvas.width=i,o=null)},o.src=e}}},{key:"update",value:function(e,t,n){if(this.canvas&&this.canvasCtx&&this.videoPI)try{var i=this._pos,r=this.config,o=this.canvas.getBoundingClientRect(),s=o.width,a=o.height;if(this.videoPI=parseInt(t/n*100,10),s!==i.width||a!==i.height){var c=parseInt(s/a*100,10);i.width=this.canvas.width=s,i.height=this.canvas.height=a;var l=a,u=s;c<this.videoPI?u=parseInt(a*this.videoPI/100,10):c>this.videoPI&&(l=parseInt(100*s/this.videoPI,10)),c<this.videoPI?u=parseInt(a*this.videoPI/100,10):c>this.videoPI&&(l=parseInt(100*s/this.videoPI,10)),i.rwidth=1.2*u,i.rheight=1.2*l,i.x=(s-i.rwidth)/2,i.y=(a-i.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=r.filter),this.canvasCtx.drawImage(e,i.x,i.y,i.rwidth,i.rheight)}catch(e){np.logError("plugin:DynamicBg",e)}}},{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)",addMask:!0,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof db?db:db=function(){try{return!!document.createElement("canvas").getContext}catch(e){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===hp.browser||"firefox"===hp.browser)}}]),n}(Fv),vb={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:"直播"}},gb=r,yb=he("iterator"),mb=!gb((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[yb]||"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})),kb=Ne,bb=Nc,wb=Bi,Cb=q,xb=function(e,t,n,i){try{return i?t(kb(n)[0],n[1]):t(n)}catch(t){throw bb(e),t}},_b=Oc,Eb=Mt,Tb=go,Sb=Dc,Pb=2147483647,Rb=/[^\0-\u007E]/,Ob=/[.\u3002\uFF0E\uFF61]/g,Ab="Overflow: input needs wider integers to process",Lb=Math.floor,Ib=String.fromCharCode,Db=function(e){return e+22+75*(e<26)},Mb=function(e,t,n){var i=0;for(e=n?Lb(e/700):e>>1,e+=Lb(e/t);e>455;i+=36)e=Lb(e/35);return Lb(i+36*e/(e+38))},Nb=function(e){var t,n,i=[],r=(e=function(e){for(var t=[],n=0,i=e.length;n<i;){var r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){var o=e.charCodeAt(n++);56320==(64512&o)?t.push(((1023&r)<<10)+(1023&o)+65536):(t.push(r),n--)}else t.push(r)}return t}(e)).length,o=128,s=0,a=72;for(t=0;t<e.length;t++)(n=e[t])<128&&i.push(Ib(n));var c=i.length,l=c;for(c&&i.push("-");l<r;){var u=Pb;for(t=0;t<e.length;t++)(n=e[t])>=o&&n<u&&(u=n);var h=l+1;if(u-o>Lb((Pb-s)/h))throw RangeError(Ab);for(s+=(u-o)*h,o=u,t=0;t<e.length;t++){if((n=e[t])<o&&++s>Pb)throw RangeError(Ab);if(n==o){for(var f=s,d=36;;d+=36){var p=d<=a?1:d>=a+26?26:d-a;if(f<p)break;var v=f-p,g=36-p;i.push(Ib(Db(p+v%g))),f=Lb(v/g)}i.push(Ib(Db(f))),a=Mb(s,h,l==c),s=0,++l}}++s,++o}return i.join("")},Fb=Ne,Bb=Dc,jb=En,Ub=E,Hb=mb,Gb=Ye.exports,Vb=vc,Wb=Ni,Yb=rg,Kb=bt,zb=Ec,Xb=J,qb=Bi,$b=ac,Zb=Ne,Jb=C,Qb=wi,ew=Kn,tw=f,nw=function(e){var t=Bb(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return Fb(t.call(e))},iw=Dc,rw=he,ow=Ub("fetch"),sw=Ub("Request"),aw=sw&&sw.prototype,cw=Ub("Headers"),lw=rw("iterator"),uw="URLSearchParams",hw="URLSearchParamsIterator",fw=Kb.set,dw=Kb.getterFor(uw),pw=Kb.getterFor(hw),vw=/\+/g,gw=Array(4),yw=function(e){return gw[e-1]||(gw[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},mw=function(e){try{return decodeURIComponent(e)}catch(t){return e}},kw=function(e){var t=e.replace(vw," "),n=4;try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace(yw(n--),mw);return t}},bw=/[!'()~]|%20/g,ww={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Cw=function(e){return ww[e]},xw=function(e){return encodeURIComponent(e).replace(bw,Cw)},_w=function(e,t){if(t)for(var n,i,r=t.split("&"),o=0;o<r.length;)(n=r[o++]).length&&(i=n.split("="),e.push({key:kw(i.shift()),value:kw(i.join("="))}))},Ew=function(e){this.entries.length=0,_w(this.entries,e)},Tw=function(e,t){if(e<t)throw TypeError("Not enough arguments")},Sw=Yb((function(e,t){fw(this,{type:hw,iterator:nw(dw(e).entries),kind:t})}),"Iterator",(function(){var e=pw(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})),Pw=function(){zb(this,Pw,uw);var e,t,n,i,r,o,s,a,c,l=arguments.length>0?arguments[0]:void 0,u=this,h=[];if(fw(u,{type:uw,entries:h,updateURL:function(){},updateSearchParams:Ew}),void 0!==l)if(Jb(l))if("function"==typeof(e=iw(l)))for(n=(t=e.call(l)).next;!(i=n.call(t)).done;){if((s=(o=(r=nw(Zb(i.value))).next).call(r)).done||(a=o.call(r)).done||!o.call(r).done)throw TypeError("Expected sequence with length 2");h.push({key:Qb(s.value),value:Qb(a.value)})}else for(c in l)Xb(l,c)&&h.push({key:c,value:Qb(l[c])});else _w(h,"string"==typeof l?"?"===l.charAt(0)?l.slice(1):l:Qb(l))},Rw=Pw.prototype;if(Vb(Rw,{append:function(e,t){Tw(arguments.length,2);var n=dw(this);n.entries.push({key:Qb(e),value:Qb(t)}),n.updateURL()},delete:function(e){Tw(arguments.length,1);for(var t=dw(this),n=t.entries,i=Qb(e),r=0;r<n.length;)n[r].key===i?n.splice(r,1):r++;t.updateURL()},get:function(e){Tw(arguments.length,1);for(var t=dw(this).entries,n=Qb(e),i=0;i<t.length;i++)if(t[i].key===n)return t[i].value;return null},getAll:function(e){Tw(arguments.length,1);for(var t=dw(this).entries,n=Qb(e),i=[],r=0;r<t.length;r++)t[r].key===n&&i.push(t[r].value);return i},has:function(e){Tw(arguments.length,1);for(var t=dw(this).entries,n=Qb(e),i=0;i<t.length;)if(t[i++].key===n)return!0;return!1},set:function(e,t){Tw(arguments.length,1);for(var n,i=dw(this),r=i.entries,o=!1,s=Qb(e),a=Qb(t),c=0;c<r.length;c++)(n=r[c]).key===s&&(o?r.splice(c--,1):(o=!0,n.value=a));o||r.push({key:s,value:a}),i.updateURL()},sort:function(){var e,t,n,i=dw(this),r=i.entries,o=r.slice();for(r.length=0,n=0;n<o.length;n++){for(e=o[n],t=0;t<n;t++)if(r[t].key>e.key){r.splice(t,0,e);break}t===n&&r.push(e)}i.updateURL()},forEach:function(e){for(var t,n=dw(this).entries,i=qb(e,arguments.length>1?arguments[1]:void 0,3),r=0;r<n.length;)i((t=n[r++]).value,t.key,this)},keys:function(){return new Sw(this,"keys")},values:function(){return new Sw(this,"values")},entries:function(){return new Sw(this,"entries")}},{enumerable:!0}),Gb(Rw,lw,Rw.entries),Gb(Rw,"toString",(function(){for(var e,t=dw(this).entries,n=[],i=0;i<t.length;)e=t[i++],n.push(xw(e.key)+"="+xw(e.value));return n.join("&")}),{enumerable:!0}),Wb(Pw,uw),jb({global:!0,forced:!Hb},{URLSearchParams:Pw}),!Hb&&"function"==typeof cw){var Ow=function(e){if(Jb(e)){var t,n=e.body;if($b(n)===uw)return(t=e.headers?new cw(e.headers):new cw).has("content-type")||t.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),ew(e,{body:tw(0,String(n)),headers:tw(0,t)})}return e};if("function"==typeof ow&&jb({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return ow(e,arguments.length>1?Ow(arguments[1]):{})}}),"function"==typeof sw){var Aw=function(e){return zb(this,Aw,"Request"),new sw(e,arguments.length>1?Ow(arguments[1]):{})};aw.constructor=Aw,Aw.prototype=aw,jb({global:!0,forced:!0},{Request:Aw})}}var Lw,Iw={URLSearchParams:Pw,getState:dw},Dw=En,Mw=o,Nw=mb,Fw=n,Bw=In,jw=Ye.exports,Uw=Ec,Hw=J,Gw=nf,Vw=function(e){var t,n,i,r,o,s,a=Cb(e),c="function"==typeof this?this:Array,l=arguments.length,u=l>1?arguments[1]:void 0,h=void 0!==u,f=Sb(a),d=0;if(h&&(u=wb(u,l>2?arguments[2]:void 0,2)),null==f||c==Array&&_b(f))for(n=new c(t=Eb(a.length));t>d;d++)s=h?u(a[d],d):a[d],Tb(n,d,s);else for(o=(r=f.call(a)).next,n=new c;!(i=o.call(r)).done;d++)s=h?xb(r,u,[i.value,d],!0):i.value,Tb(n,d,s);return n.length=d,n},Ww=ya.codeAt,Yw=function(e){var t,n,i=[],r=e.toLowerCase().replace(Ob,".").split(".");for(t=0;t<r.length;t++)n=r[t],i.push(Rb.test(n)?"xn--"+Nb(n):n);return i.join(".")},Kw=wi,zw=Ni,Xw=Iw,qw=bt,$w=Fw.URL,Zw=Xw.URLSearchParams,Jw=Xw.getState,Qw=qw.set,eC=qw.getterFor("URL"),tC=Math.floor,nC=Math.pow,iC="Invalid scheme",rC="Invalid host",oC="Invalid port",sC=/[A-Za-z]/,aC=/[\d+-.A-Za-z]/,cC=/\d/,lC=/^0x/i,uC=/^[0-7]+$/,hC=/^\d+$/,fC=/^[\dA-Fa-f]+$/,dC=/[\0\t\n\r #%/:<>?@[\\\]^|]/,pC=/[\0\t\n\r #/:<>?@[\\\]^|]/,vC=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,gC=/[\t\n\r]/g,yC=function(e,t){var n,i,r;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return rC;if(!(n=kC(t.slice(1,-1))))return rC;e.host=n}else if(SC(e)){if(t=Yw(t),dC.test(t))return rC;if(null===(n=mC(t)))return rC;e.host=n}else{if(pC.test(t))return rC;for(n="",i=Vw(t),r=0;r<i.length;r++)n+=EC(i[r],wC);e.host=n}},mC=function(e){var t,n,i,r,o,s,a,c=e.split(".");if(c.length&&""==c[c.length-1]&&c.pop(),(t=c.length)>4)return e;for(n=[],i=0;i<t;i++){if(""==(r=c[i]))return e;if(o=10,r.length>1&&"0"==r.charAt(0)&&(o=lC.test(r)?16:8,r=r.slice(8==o?1:2)),""===r)s=0;else{if(!(10==o?hC:8==o?uC:fC).test(r))return e;s=parseInt(r,o)}n.push(s)}for(i=0;i<t;i++)if(s=n[i],i==t-1){if(s>=nC(256,5-t))return null}else if(s>255)return null;for(a=n.pop(),i=0;i<n.length;i++)a+=n[i]*nC(256,3-i);return a},kC=function(e){var t,n,i,r,o,s,a,c=[0,0,0,0,0,0,0,0],l=0,u=null,h=0,f=function(){return e.charAt(h)};if(":"==f()){if(":"!=e.charAt(1))return;h+=2,u=++l}for(;f();){if(8==l)return;if(":"!=f()){for(t=n=0;n<4&&fC.test(f());)t=16*t+parseInt(f(),16),h++,n++;if("."==f()){if(0==n)return;if(h-=n,l>6)return;for(i=0;f();){if(r=null,i>0){if(!("."==f()&&i<4))return;h++}if(!cC.test(f()))return;for(;cC.test(f());){if(o=parseInt(f(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;h++}c[l]=256*c[l]+r,2!=++i&&4!=i||l++}if(4!=i)return;break}if(":"==f()){if(h++,!f())return}else if(f())return;c[l++]=t}else{if(null!==u)return;h++,u=++l}}if(null!==u)for(s=l-u,l=7;0!=l&&s>0;)a=c[l],c[l--]=c[u+s-1],c[u+--s]=a;else if(8!=l)return;return c},bC=function(e){var t,n,i,r;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=tC(e/256);return t.join(".")}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+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},wC={},CC=Gw({},wC,{" ":1,'"':1,"<":1,">":1,"`":1}),xC=Gw({},CC,{"#":1,"?":1,"{":1,"}":1}),_C=Gw({},xC,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),EC=function(e,t){var n=Ww(e,0);return n>32&&n<127&&!Hw(t,e)?e:encodeURIComponent(e)},TC={ftp:21,file:null,http:80,https:443,ws:80,wss:443},SC=function(e){return Hw(TC,e.scheme)},PC=function(e){return""!=e.username||""!=e.password},RC=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},OC=function(e,t){var n;return 2==e.length&&sC.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},AC=function(e){var t;return e.length>1&&OC(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},LC=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&OC(t[0],!0)||t.pop()},IC=function(e){return"."===e||"%2e"===e.toLowerCase()},DC={},MC={},NC={},FC={},BC={},jC={},UC={},HC={},GC={},VC={},WC={},YC={},KC={},zC={},XC={},qC={},$C={},ZC={},JC={},QC={},ex={},tx=function(e,t,n,i){var r,o,s,a,c,l=n||DC,u=0,h="",f=!1,d=!1,p=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(vC,"")),t=t.replace(gC,""),r=Vw(t);u<=r.length;){switch(o=r[u],l){case DC:if(!o||!sC.test(o)){if(n)return iC;l=NC;continue}h+=o.toLowerCase(),l=MC;break;case MC:if(o&&(aC.test(o)||"+"==o||"-"==o||"."==o))h+=o.toLowerCase();else{if(":"!=o){if(n)return iC;h="",l=NC,u=0;continue}if(n&&(SC(e)!=Hw(TC,h)||"file"==h&&(PC(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=h,n)return void(SC(e)&&TC[e.scheme]==e.port&&(e.port=null));h="","file"==e.scheme?l=zC:SC(e)&&i&&i.scheme==e.scheme?l=FC:SC(e)?l=HC:"/"==r[u+1]?(l=BC,u++):(e.cannotBeABaseURL=!0,e.path.push(""),l=JC)}break;case NC:if(!i||i.cannotBeABaseURL&&"#"!=o)return iC;if(i.cannotBeABaseURL&&"#"==o){e.scheme=i.scheme,e.path=i.path.slice(),e.query=i.query,e.fragment="",e.cannotBeABaseURL=!0,l=ex;break}l="file"==i.scheme?zC:jC;continue;case FC:if("/"!=o||"/"!=r[u+1]){l=jC;continue}l=GC,u++;break;case BC:if("/"==o){l=VC;break}l=ZC;continue;case jC:if(e.scheme=i.scheme,o==Lw)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query;else if("/"==o||"\\"==o&&SC(e))l=UC;else if("?"==o)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query="",l=QC;else{if("#"!=o){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.path.pop(),l=ZC;continue}e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query,e.fragment="",l=ex}break;case UC:if(!SC(e)||"/"!=o&&"\\"!=o){if("/"!=o){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,l=ZC;continue}l=VC}else l=GC;break;case HC:if(l=GC,"/"!=o||"/"!=h.charAt(u+1))continue;u++;break;case GC:if("/"!=o&&"\\"!=o){l=VC;continue}break;case VC:if("@"==o){f&&(h="%40"+h),f=!0,s=Vw(h);for(var v=0;v<s.length;v++){var g=s[v];if(":"!=g||p){var y=EC(g,_C);p?e.password+=y:e.username+=y}else p=!0}h=""}else if(o==Lw||"/"==o||"?"==o||"#"==o||"\\"==o&&SC(e)){if(f&&""==h)return"Invalid authority";u-=Vw(h).length+1,h="",l=WC}else h+=o;break;case WC:case YC:if(n&&"file"==e.scheme){l=qC;continue}if(":"!=o||d){if(o==Lw||"/"==o||"?"==o||"#"==o||"\\"==o&&SC(e)){if(SC(e)&&""==h)return rC;if(n&&""==h&&(PC(e)||null!==e.port))return;if(a=yC(e,h))return a;if(h="",l=$C,n)return;continue}"["==o?d=!0:"]"==o&&(d=!1),h+=o}else{if(""==h)return rC;if(a=yC(e,h))return a;if(h="",l=KC,n==YC)return}break;case KC:if(!cC.test(o)){if(o==Lw||"/"==o||"?"==o||"#"==o||"\\"==o&&SC(e)||n){if(""!=h){var m=parseInt(h,10);if(m>65535)return oC;e.port=SC(e)&&m===TC[e.scheme]?null:m,h=""}if(n)return;l=$C;continue}return oC}h+=o;break;case zC:if(e.scheme="file","/"==o||"\\"==o)l=XC;else{if(!i||"file"!=i.scheme){l=ZC;continue}if(o==Lw)e.host=i.host,e.path=i.path.slice(),e.query=i.query;else if("?"==o)e.host=i.host,e.path=i.path.slice(),e.query="",l=QC;else{if("#"!=o){AC(r.slice(u).join(""))||(e.host=i.host,e.path=i.path.slice(),LC(e)),l=ZC;continue}e.host=i.host,e.path=i.path.slice(),e.query=i.query,e.fragment="",l=ex}}break;case XC:if("/"==o||"\\"==o){l=qC;break}i&&"file"==i.scheme&&!AC(r.slice(u).join(""))&&(OC(i.path[0],!0)?e.path.push(i.path[0]):e.host=i.host),l=ZC;continue;case qC:if(o==Lw||"/"==o||"\\"==o||"?"==o||"#"==o){if(!n&&OC(h))l=ZC;else if(""==h){if(e.host="",n)return;l=$C}else{if(a=yC(e,h))return a;if("localhost"==e.host&&(e.host=""),n)return;h="",l=$C}continue}h+=o;break;case $C:if(SC(e)){if(l=ZC,"/"!=o&&"\\"!=o)continue}else if(n||"?"!=o)if(n||"#"!=o){if(o!=Lw&&(l=ZC,"/"!=o))continue}else e.fragment="",l=ex;else e.query="",l=QC;break;case ZC:if(o==Lw||"/"==o||"\\"==o&&SC(e)||!n&&("?"==o||"#"==o)){if(".."===(c=(c=h).toLowerCase())||"%2e."===c||".%2e"===c||"%2e%2e"===c?(LC(e),"/"==o||"\\"==o&&SC(e)||e.path.push("")):IC(h)?"/"==o||"\\"==o&&SC(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&OC(h)&&(e.host&&(e.host=""),h=h.charAt(0)+":"),e.path.push(h)),h="","file"==e.scheme&&(o==Lw||"?"==o||"#"==o))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==o?(e.query="",l=QC):"#"==o&&(e.fragment="",l=ex)}else h+=EC(o,xC);break;case JC:"?"==o?(e.query="",l=QC):"#"==o?(e.fragment="",l=ex):o!=Lw&&(e.path[0]+=EC(o,wC));break;case QC:n||"#"!=o?o!=Lw&&("'"==o&&SC(e)?e.query+="%27":e.query+="#"==o?"%23":EC(o,wC)):(e.fragment="",l=ex);break;case ex:o!=Lw&&(e.fragment+=EC(o,CC))}u++}},nx=function(e){var t,n,i=Uw(this,nx,"URL"),r=arguments.length>1?arguments[1]:void 0,o=Kw(e),s=Qw(i,{type:"URL"});if(void 0!==r)if(r instanceof nx)t=eC(r);else if(n=tx(t={},Kw(r)))throw TypeError(n);if(n=tx(s,o,null,t))throw TypeError(n);var a=s.searchParams=new Zw,c=Jw(a);c.updateSearchParams(s.query),c.updateURL=function(){s.query=String(a)||null},Mw||(i.href=rx.call(i),i.origin=ox.call(i),i.protocol=sx.call(i),i.username=ax.call(i),i.password=cx.call(i),i.host=lx.call(i),i.hostname=ux.call(i),i.port=hx.call(i),i.pathname=fx.call(i),i.search=dx.call(i),i.searchParams=px.call(i),i.hash=vx.call(i))},ix=nx.prototype,rx=function(){var e=eC(this),t=e.scheme,n=e.username,i=e.password,r=e.host,o=e.port,s=e.path,a=e.query,c=e.fragment,l=t+":";return null!==r?(l+="//",PC(e)&&(l+=n+(i?":"+i:"")+"@"),l+=bC(r),null!==o&&(l+=":"+o)):"file"==t&&(l+="//"),l+=e.cannotBeABaseURL?s[0]:s.length?"/"+s.join("/"):"",null!==a&&(l+="?"+a),null!==c&&(l+="#"+c),l},ox=function(){var e=eC(this),t=e.scheme,n=e.port;if("blob"==t)try{return new nx(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&SC(e)?t+"://"+bC(e.host)+(null!==n?":"+n:""):"null"},sx=function(){return eC(this).scheme+":"},ax=function(){return eC(this).username},cx=function(){return eC(this).password},lx=function(){var e=eC(this),t=e.host,n=e.port;return null===t?"":null===n?bC(t):bC(t)+":"+n},ux=function(){var e=eC(this).host;return null===e?"":bC(e)},hx=function(){var e=eC(this).port;return null===e?"":String(e)},fx=function(){var e=eC(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},dx=function(){var e=eC(this).query;return e?"?"+e:""},px=function(){return eC(this).searchParams},vx=function(){var e=eC(this).fragment;return e?"#"+e:""},gx=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(Mw&&Bw(ix,{href:gx(rx,(function(e){var t=eC(this),n=Kw(e),i=tx(t,n);if(i)throw TypeError(i);Jw(t.searchParams).updateSearchParams(t.query)})),origin:gx(ox),protocol:gx(sx,(function(e){var t=eC(this);tx(t,Kw(e)+":",DC)})),username:gx(ax,(function(e){var t=eC(this),n=Vw(Kw(e));if(!RC(t)){t.username="";for(var i=0;i<n.length;i++)t.username+=EC(n[i],_C)}})),password:gx(cx,(function(e){var t=eC(this),n=Vw(Kw(e));if(!RC(t)){t.password="";for(var i=0;i<n.length;i++)t.password+=EC(n[i],_C)}})),host:gx(lx,(function(e){var t=eC(this);t.cannotBeABaseURL||tx(t,Kw(e),WC)})),hostname:gx(ux,(function(e){var t=eC(this);t.cannotBeABaseURL||tx(t,Kw(e),YC)})),port:gx(hx,(function(e){var t=eC(this);RC(t)||(""==(e=Kw(e))?t.port=null:tx(t,e,KC))})),pathname:gx(fx,(function(e){var t=eC(this);t.cannotBeABaseURL||(t.path=[],tx(t,Kw(e),$C))})),search:gx(dx,(function(e){var t=eC(this);""==(e=Kw(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",tx(t,e,QC)),Jw(t.searchParams).updateSearchParams(t.query)})),searchParams:gx(px),hash:gx(vx,(function(e){var t=eC(this);""!=(e=Kw(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",tx(t,e,ex)):t.fragment=null}))}),jw(ix,"toJSON",(function(){return rx.call(this)}),{enumerable:!0}),jw(ix,"toString",(function(){return rx.call(this)}),{enumerable:!0}),$w){var yx=$w.createObjectURL,mx=$w.revokeObjectURL;yx&&jw(nx,"createObjectURL",(function(e){return yx.apply($w,arguments)})),mx&&jw(nx,"revokeObjectURL",(function(e){return mx.apply($w,arguments)}))}function kx(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 bx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kx(Object(n),!0).forEach((function(t){yi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kx(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wx(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}zw(nx,"URL"),Dw({global:!0,forced:!Nw,sham:!Mw},{URL:nx});var Cx="info",xx=nv,_x=function(e){fi(n,e);var t=wx(n);function n(){var e;ui(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return yi(pi(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(bx(bx({type:"userAction"},n),{},{payload:i}))})),yi(pi(e),"_onReset",(function(){e.reset()})),yi(pi(e),"_recordInfo",(function(t){e.info(t)})),yi(pi(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,console.log("linkhref",i),r.download="player.txt",r.disabled=!1,r.click()})),e}return Co(n,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(ev,this._recordUserActions),this.on(xx.STATS_INFO,this._recordUserActions),this.on(xx.STATS_DOWNLOAD,this._downloadStats),this.on(xx.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(bx(bx({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=bx({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=(yi(e={},Cx,[]),yi(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player.video,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(e){console.log("err",e)}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}(Cv);function Ex(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(e){return!1}}();return function(){var n,i=gi(e);if(t){var r=gi(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return vi(this,n)}}var Tx=function(e){fi(n,e);var t=Ex(n);function n(){return ui(this,n),t.apply(this,arguments)}return n}(Cy);return yi(Tx,"defaultPreset",(function e(t,n){var i,r,o;ui(this,e);var s=n&&n.isMobileSimulateMode,a=n.isLive,c=[].concat(a?[]:[Qm,ab,ib,uk],[tk,ck,mk,Pk,Hk,Vk,Ik,Mk,vk,Ek]),l=[Ry,Ay,Ny,Wm,By,qk,Zk,ob,Qy];this.plugins=[_x,Ty].concat(cf(c),l);var u=s?"mobile":hp.device;switch(u){case"pc":(i=this.plugins).push.apply(i,[Hm,im,zk]);break;case"mobile":(r=this.plugins).push.apply(r,[Nm]);break;default:(o=this.plugins).push.apply(o,[Hm,im,zk])}(hp.os.isIpad||"pc"===u)&&this.plugins.push(pb),hp.os.isIpad&&this.plugins.push(im),this.ignores=[],this.i18n=[vb]})),yi(Tx,"Util",sp),yi(Tx,"Sniffer",hp),yi(Tx,"Errors",pp),yi(Tx,"Events",iv),yi(Tx,"Plugin",Fv),yi(Tx,"BasePlugin",Cv),yi(Tx,"I18N",yy),yi(Tx,"STATE_CLASS",Jg),Tx}));
|
|
2
2
|
//# sourceMappingURL=index.min.js.map
|